@logicflow/extension 2.0.0-beta.3 → 2.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +6 -6
- package/dist/index.min.js +2 -2
- package/es/components/menu/index.d.ts +1 -1
- package/es/components/menu/index.js +9 -10
- package/es/components/menu/index.js.map +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/index.js.map +1 -1
- package/es/materials/node-selection/index.d.ts +2 -1
- package/es/materials/node-selection/index.js +64 -56
- package/es/materials/node-selection/index.js.map +1 -1
- package/es/tools/snapshot/index.d.ts +101 -11
- package/es/tools/snapshot/index.js +331 -147
- package/es/tools/snapshot/index.js.map +1 -1
- package/es/tools/snapshot/utils.d.ts +35 -0
- package/es/tools/snapshot/utils.js +238 -0
- package/es/tools/snapshot/utils.js.map +1 -0
- package/lib/components/menu/index.d.ts +1 -1
- package/lib/components/menu/index.js +9 -10
- package/lib/components/menu/index.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/materials/node-selection/index.d.ts +2 -1
- package/lib/materials/node-selection/index.js +63 -55
- package/lib/materials/node-selection/index.js.map +1 -1
- package/lib/tools/snapshot/index.d.ts +101 -11
- package/lib/tools/snapshot/index.js +331 -147
- package/lib/tools/snapshot/index.js.map +1 -1
- package/lib/tools/snapshot/utils.d.ts +35 -0
- package/lib/tools/snapshot/utils.js +247 -0
- package/lib/tools/snapshot/utils.js.map +1 -0
- package/package.json +3 -3
- package/src/components/menu/index.ts +16 -13
- package/src/index.ts +1 -0
- package/src/materials/node-selection/index.ts +72 -69
- package/src/tools/snapshot/README.md +130 -5
- package/src/tools/snapshot/index.ts +264 -98
- package/src/tools/snapshot/utils.ts +163 -0
package/dist/index.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@logicflow/core")):"function"==typeof define&&define.amd?define(["exports","@logicflow/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Extension={},t.Core)}(this,(function(t,e){"use strict";var n=40,r=40,i=40,o=40,a=40,u=40,s=100,l=80,c=100,d=80,h={rect:{radius:5,stroke:"rgb(24, 125, 255)"},circle:{r:18,stroke:"rgb(24, 125, 255)"},polygon:{stroke:"rgb(24, 125, 255)"},polyline:{stroke:"rgb(24, 125, 255)",hoverStroke:"rgb(24, 125, 255)",selectedStroke:"rgb(24, 125, 255)"},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"white",height:14,stroke:"transparent",radius:3}}},p=function(t,e){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},p(t,e)};function f(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var v=function(){return v=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},v.apply(this,arguments)};function g(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function y(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function b(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var x=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))},t.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},t}(),_=(null===globalThis||void 0===globalThis?void 0:globalThis._ids)||new x;function w(){return _.next()}var M=function(t){function e(e,n){return e.id||(e.id="Event_".concat(w())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),t.call(this,e,n)||this}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedTargetRules=function(){var e=t.prototype.getConnectedTargetRules.call(this);return e.push({message:"起始节点不能作为边的终点",validate:function(){return!1}}),e},e.extendKey="StartEventModel",e}(e.CircleNodeModel),E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.extendKey="StartEventNode",e}(e.CircleNode),N={type:"bpmn:startEvent",view:E,model:M},S=function(t){function e(e,n){return e.id||(e.id="Event_".concat(w())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),t.call(this,e,n)||this}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedSourceRules=function(){var e=t.prototype.getConnectedSourceRules.call(this);return e.push({message:"结束节点不能作为边的起点",validate:function(){return!1}}),e},e.extendKey="EndEventModel",e}(e.CircleNodeModel),A=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},n.prototype.getShape=function(){var n=this.props.model,r=n.getNodeStyle(),i=n,o=i.x,a=i.y,u=i.r,s=t.prototype.getShape.call(this);return e.h("g",{},s,e.h("circle",v(v({},r),{cx:o,cy:a,r:u-5})))},n.extendKey="EndEventView",n}(e.CircleNode),P={type:"bpmn:endEvent",view:A,model:S},O=function(t){function e(e,n){return e.id||(e.id="Flow_".concat(w())),t.call(this,e,n)||this}return f(e,t),e.extendKey="SequenceFlowModel",e}(e.PolylineEdgeModel),T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.extendKey="SequenceFlowEdge",e}(e.PolylineEdge),C={type:"bpmn:sequenceFlow",view:T,model:O},k=function(t){function e(e,n){var r=this;return e.id||(e.id="Gateway_".concat(w())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),(r=t.call(this,e,n)||this).points=[[25,0],[50,25],[25,50],[0,25]],r}return f(e,t),e.extendKey="ExclusiveGatewayModel",e}(e.PolygonNodeModel),j=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getShape=function(){var t=this.props.model,n=t,r=n.x,i=n.y,o=n.width,a=n.height,u=n.points,s=t.getNodeStyle();return e.h("g",{transform:"matrix(1 0 0 1 ".concat(r-o/2," ").concat(i-a/2,")")},e.h("polygon",v(v({},s),{x:r,y:i,points:u})),e.h("path",v({d:"m 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z"},s)))},n.extendKey="ExclusiveGatewayNode",n}(e.PolygonNode),I={type:"bpmn:exclusiveGateway",view:j,model:k},R=function(t){function e(e,n){return e.id||(e.id="Activity_".concat(w())),t.call(this,e,n)||this}return f(e,t),e.extendKey="ServiceTaskModel",e}(e.RectNodeModel),D=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getLabelShape=function(){var t=this.props.model,n=t.x,r=t.y,i=t.width,o=t.height,a=t.getNodeStyle();return e.h("svg",{x:n-i/2+5,y:r-o/2+5,width:30,height:30,viewBox:"0 0 1274 1024"},e.h("path",{fill:a.stroke,d:"M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z"}))},n.prototype.getShape=function(){var t=this.props.model,n=t.x,r=t.y,i=t.width,o=t.height,a=t.radius,u=t.getNodeStyle();return e.h("g",{},[e.h("rect",v({x:n-i/2,y:r-o/2,rx:a,ry:a,width:i,height:o},u)),this.getLabelShape()])},n.extendKey="ServiceTaskNode",n}(e.RectNode),L={type:"bpmn:serviceTask",view:D,model:R},B=function(t){function e(e,n){return e.id||(e.id="Activity_".concat(w())),t.call(this,e,n)||this}return f(e,t),e.extendKey="UserTaskModel",e}(e.RectNodeModel),z=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getLabelShape=function(){var t=this.props.model,n=t.x,r=t.y,i=t.width,o=t.height,a=t.getNodeStyle();return e.h("svg",{x:n-i/2+5,y:r-o/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},e.h("path",{fill:a.stroke,d:"M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z"}))},n.prototype.getShape=function(){var t=this.props.model,n=t.x,r=t.y,i=t.width,o=t.height,a=t.radius,u=t.getNodeStyle();return e.h("g",{},[e.h("rect",v(v({},u),{x:n-i/2,y:r-o/2,rx:a,ry:a,width:i,height:o})),this.getLabelShape()])},n.extendKey="UserTaskNode",n}(e.RectNode),W={type:"bpmn:userTask",view:z,model:B},F={pluginName:"bpmnElement",install:function(t){t.setTheme(h),t.register(N),t.register(P),t.register(I),t.register(W),t.register(L),t.options.customBpmnEdge||(t.register(C),t.setDefaultEdgeType("bpmn:sequenceFlow"))}},G=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))},t.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},t}(),H=(null===globalThis||void 0===globalThis?void 0:globalThis._ids)||new G;function X(){return H.next()}function U(t){return Object.prototype.toString.call(t)}function V(t){var e=t;return"[object Object]"===U(t)?(e={},Object.keys(t).forEach((function(n){var r=n;"-"===n.charAt(0)&&(r=n.substring(1)),e[r]=V(t[n])}))):Array.isArray(t)&&(e=[],t.forEach((function(t,n){e[n]=V(t)}))),e}var Y="\t\n";function q(t,e,n){var r=function(t){return" ".repeat(t)}(n),i="";if("#text"===e)return Y+r+t;if("#cdata-section"===e)return Y+r+"<![CDATA["+t+"]]>";if("#comment"===e)return Y+r+"\x3c!--"+t+"--\x3e";if("-"==="".concat(e).charAt(0))return" "+e.substring(1)+'="'+function(t){var e=t;try{"string"!=typeof e&&(e=JSON.parse(t))}catch(n){e=JSON.stringify(V(t)).replace(/"/g,"'")}return e}(t)+'"';if(Array.isArray(t))t.forEach((function(t){i+=q(t,e,n+1)}));else if("[object Object]"===U(t)){var o=Object.keys(t),a="",u="";i+=(0===n?"":Y+r)+"<"+e,o.forEach((function(e){"-"===e.charAt(0)?a+=q(t[e],e,n+1):u+=q(t[e],e,n+1)})),i+=a+(""!==u?">".concat(u).concat(Y+r,"</").concat(e,">"):" />")}else i+=Y+r+"<".concat(e,">").concat(t.toString(),"</").concat(e,">");return i}function Z(t){var e="";for(var n in t)e+=q(t[n],n,0);return e}var K=function(){};(K.ObjTree=function(){return this}).VERSION="0.23",K.ObjTree.prototype.xmlDecl='<?xml version="1.0" encoding="UTF-8" ?>\n',K.ObjTree.prototype.attr_prefix="-",K.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,r=n.parseFromString(t,"application/xml");if(!r)return;e=r.documentElement}else window.ActiveXObject&&((n=new ActiveXObject("Microsoft.XMLDOM")).async=!1,n.loadXML(t),e=n.documentElement);if(e)return this.parseDOM(e)},K.ObjTree.prototype.parseHTTP=function(t,e,n){var r,i={};for(var o in e)i[o]=e[o];if(i.method||(void 0===i.postBody&&void 0===i.postbody&&void 0===i.parameters?i.method="get":i.method="post"),n){i.asynchronous=!0;var a=this,u=n,s=i.onComplete;i.onComplete=function(t){var e;t&&t.responseXML&&t.responseXML.documentElement&&(e=a.parseDOM(t.responseXML.documentElement)),u(e,t),s&&s(t)}}else i.asynchronous=!1;if("undefined"!=typeof HTTP&&HTTP.Request)i.uri=t,(l=new HTTP.Request(i))&&(r=l.transport);else if("undefined"!=typeof Ajax&&Ajax.Request){var l;(l=new Ajax.Request(t,i))&&(r=l.transport)}return n?r:r&&r.responseXML&&r.responseXML.documentElement?this.parseDOM(r.responseXML.documentElement):void 0},K.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),11!=t.nodeType){var r={};r[t.nodeName]=n,n=r}return n}},K.ObjTree.prototype.parseElement=function(t){if(7!=t.nodeType){if(3==t.nodeType||4==t.nodeType||8==t.nodeType){if(null==t.nodeValue.match(/[^\x00-\x20]/))return;return t.nodeValue}var e=null,n={};if(t.attributes&&t.attributes.length){e={};for(var r=0;r<t.attributes.length;r++){if("string"==typeof(u=t.attributes[r].nodeName)){var i=t.attributes[r].nodeValue;try{i=JSON.parse(t.attributes[r].nodeValue.replace(/'/g,'"'))}catch(e){i=t.attributes[r].nodeValue}i&&(void 0===n[u=this.attr_prefix+u]&&(n[u]=0),n[u]++,this.addNode(e,u,n[u],i))}}}if(t.childNodes&&t.childNodes.length){var o=!0;e&&(o=!1);for(r=0;r<t.childNodes.length&&o;r++){var a=t.childNodes[r].nodeType;3!=a&&4!=a&&8!=a&&(o=!1)}if(o){e||(e="");for(r=0;r<t.childNodes.length;r++)e+=t.childNodes[r].nodeValue}else{e||(e={});for(r=0;r<t.childNodes.length;r++){var u;if("string"==typeof(u=t.childNodes[r].nodeName))(i=this.parseElement(t.childNodes[r]))&&(void 0===n[u]&&(n[u]=0),n[u]++,this.addNode(e,u,n[u],i))}}}else null===e&&(e={});return e}},K.ObjTree.prototype.addNode=function(t,e,n,r){this.__force_array[e]?(1==n&&(t[e]=[]),t[e][t[e].length]=r):1==n?t[e]=r:2==n?t[e]=[t[e],r]:t[e][t[e].length]=r},K.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e},K.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],r=[];for(var i in e)if(e.hasOwnProperty(i)){var o=e[i];i.charAt(0)!=this.attr_prefix?void 0===o||null==o?n[n.length]="<"+i+" />":"object"==typeof o&&o.constructor==Array?n[n.length]=this.array_to_xml(i,o):n[n.length]="object"==typeof o?this.hash_to_xml(i,o):this.scalar_to_xml(i,o):r[r.length]=" "+i.substring(1)+'="'+this.xml_escape(o)+'"'}var a=r.join(""),u=n.join("");return void 0===t||null==t||(u=n.length>0?u.match(/\n/)?"<"+t+a+">\n"+u+"</"+t+">\n":"<"+t+a+">"+u+"</"+t+">\n":"<"+t+a+" />\n"),u},K.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],r=0;r<e.length;r++){var i=e[r];void 0===i||null==i?n[n.length]="<"+t+" />":"object"==typeof i&&i.constructor==Array?n[n.length]=this.array_to_xml(t,i):n[n.length]="object"==typeof i?this.hash_to_xml(t,i):this.scalar_to_xml(t,i)}return n.join("")},K.ObjTree.prototype.scalar_to_xml=function(t,e){return"#text"==t?this.xml_escape(e):"<"+t+">"+this.xml_escape(e)+"</"+t+">\n"},K.ObjTree.prototype.xml_escape=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};var $,J=function(t){return(new K.ObjTree).parseXML(t)};!function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow"}($||($={}));var Q=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef"],tt=["properties","startPoint","endPoint","pointsList"];function et(t){var e=t?tt.concat(t):tt;return function(t){return function t(n){var r={};return"string"==typeof n?n:Array.isArray(n)?n.map((function(e){return t(e)})):(Object.entries(n).forEach((function(n){var i=m(n,2),o=i[0],a=i[1];"object"!=typeof a?0===o.indexOf("-")||["#text","#cdata-section","#comment"].includes(o)?r[o]=a:r["-".concat(o)]=a:e.includes(o)?r["-".concat(o)]=t(a):r[o]=t(a)})),r)}(t)}}function nt(t){var e={};return Object.entries(t).forEach((function(t){var n=m(t,2),r=n[0],i=n[1];0===r.indexOf("-")?e[r.substring(1)]=V(i):"string"==typeof i?e[r]=i:"[object Object]"===Object.prototype.toString.call(i)?e[r]=nt(i):Array.isArray(i)?e[r]=i.map((function(t){return nt(t)})):e[r]=i})),e}function rt(t,e){t["bpmndi:BPMNEdge"]=e.edges.map((function(t){var e,n=t.id,r=t.pointsList.map((function(t){return{"-x":t.x,"-y":t.y}})),i={"-id":"".concat(n,"_di"),"-bpmnElement":n,"di:waypoint":r};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(i["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),i})),t["bpmndi:BPMNShape"]=e.nodes.map((function(t){var e,n=t.id,r=100,i=80,o=t.x,a=t.y,u=ut.shapeConfigMap.get(t.type);u&&(r=u.width,i=u.height),o-=r/2,a-=i/2;var s={"-id":"".concat(n,"_di"),"-bpmnElement":n,"dc:Bounds":{"-x":o,"-y":a,"-width":r,"-height":i}};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(s["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),s}))}function it(t){var e=[],n=[],r=t["bpmn:definitions"];if(r){var i=r["bpmn:process"];Object.keys(i).forEach((function(t){if(0===t.indexOf("bpmn:")){var o=i[t];if(t===$.FLOW){var a=r["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];n=function(t,e){var n=[];if(Array.isArray(t))t.forEach((function(t){var r;r=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(at(r,t))}));else{var r=void 0;r=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(at(r,t))}return n}(o,a)}else{var u=r["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];e=e.concat(function(t,e,n){var r=[];if(Array.isArray(t))t.forEach((function(t){var i=ot(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);r.push(i)}));else{var i=ot(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);r.push(i)}return r}(o,u,t))}}}))}return{nodes:e,edges:n}}function ot(t,e,n){var r,i,o=Number(t["dc:Bounds"]["-x"]),a=Number(t["dc:Bounds"]["-y"]),u=n["-name"],s=ut.shapeConfigMap.get(e);if(s&&(o+=s.width/2,a+=s.height/2),Object.entries(n).forEach((function(t){var e=m(t,2),n=e[0],i=e[1];-1===Q.indexOf(n)&&(r||(r={}),r[n]=i)})),r&&(r=nt(r)),u&&(i={x:o,y:a,value:u},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var l=t["bpmndi:BPMNLabel"]["dc:Bounds"];i.x=Number(l["-x"])+Number(l["-width"])/2,i.y=Number(l["-y"])+Number(l["-height"])/2}var c={id:t["-bpmnElement"],type:e,x:o,y:a,properties:r};return i&&(c.text=i),c}function at(t,e){var n,r,i=e["-name"];if(i){var o=t["bpmndi:BPMNLabel"]["dc:Bounds"],a=0;i.split("\n").forEach((function(t){a<t.length&&(a=t.length)})),n={value:i,x:Number(o["-x"])+10*a/2,y:Number(o["-y"])+7}}Object.entries(e).forEach((function(t){var e=m(t,2),n=e[0],i=e[1];-1===Q.indexOf(n)&&(r||(r={}),r[n]=i)})),r&&(r=nt(r));var u={id:e["-id"],type:$.FLOW,pointsList:t["di:waypoint"].map((function(t){return{x:Number(t["-x"]),y:Number(t["-y"])}})),sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:r};return n&&(u.text=n),u}var ut=function(){function t(t){var e=t.lf,n=this;this.adapterOut=function(t,e){var r=v({},n.processAttributes);!function(t,e,n){var r=new Map;e.nodes.forEach((function(e){var i,o={"-id":e.id};if((null===(i=e.text)||void 0===i?void 0:i.value)&&(o["-name"]=e.text.value),e.properties){var a=et(n)(e.properties);Object.assign(o,a)}r.set(e.id,o),t[e.type]?Array.isArray(t[e.type])?t[e.type].push(o):t[e.type]=[t[e.type],o]:t[e.type]=o}));var i=e.edges.map((function(t){var e,i,o=r.get(t.targetNodeId);o["bpmn:incoming"]?Array.isArray(o["bpmn:incoming"])?o["bpmn:incoming"].push(t.id):o["bpmn:incoming"]=[o["bpmn:incoming"],t.id]:o["bpmn:incoming"]=t.id;var a={"-id":t.id,"-sourceRef":t.sourceNodeId,"-targetRef":t.targetNodeId};if((null===(e=t.text)||void 0===e?void 0:e.value)&&(a["-name"]=null===(i=t.text)||void 0===i?void 0:i.value),t.properties){var u=et(n)(t.properties);Object.assign(a,u)}return a}));e.edges.forEach((function(t){var e=r.get(t.sourceNodeId);e["bpmn:outgoing"]?Array.isArray(e["bpmn:outgoing"])?e["bpmn:outgoing"].push(t.id):e["bpmn:outgoing"]=[e["bpmn:outgoing"],t.id]:e["bpmn:outgoing"]=t.id})),t[$.FLOW]=i}(r,t,e);var i={"-id":"BPMNPlane_1","-bpmnElement":r["-id"]};rt(i,t);var o=n.definitionAttributes;return o["bpmn:process"]=r,o["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":i},{"bpmn:definitions":o}},this.adapterIn=function(t){if(t)return it(t)},e.adapterIn=function(t){return n.adapterIn(t)},e.adapterOut=function(t,e){return n.adapterOut(t,e)},this.processAttributes={"-isExecutable":"true","-id":"Process_".concat(X())},this.definitionAttributes={"-id":"Definitions_".concat(X()),"-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","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.0"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t}();ut.shapeConfigMap.set($.START,{width:n,height:r}),ut.shapeConfigMap.set($.END,{width:i,height:o}),ut.shapeConfigMap.set($.GATEWAY,{width:a,height:u}),ut.shapeConfigMap.set($.SYSTEM,{width:s,height:l}),ut.shapeConfigMap.set($.USER,{width:c,height:d});var st=function(t){function e(e){var n=t.call(this,e)||this;n.adapterXmlIn=function(t){var e=J(t);return n.adapterIn(e)},n.adapterXmlOut=function(t,e){return Z(n.adapterOut(t,e))};var r=e.lf;return r.adapterIn=n.adapterXmlIn,r.adapterOut=n.adapterXmlOut,n}return f(e,t),e.pluginName="bpmnXmlAdapter",e}(ut);function lt(){this.targetRules.push({message:"分组外的节点不允许连接分组内的",validate:function(t,e){var n=!!t.properties.parent,r=!!e.properties.parent;return!(!n&&r)}})}var ct=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))},t.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},t}(),dt=(null===globalThis||void 0===globalThis?void 0:globalThis._ids)||new ct;function ht(){return dt.next()}var pt=Object.freeze({__proto__:null,genBpmnId:ht,groupRule:lt});function ft(t){var n=m(t.useDefinition(),1)[0],r=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return f(r,t),r.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},r.prototype.getShape=function(){var r,i=this.props.model,o=i.getNodeStyle(),a=i,u=a.x,s=a.y,l=a.r,c=a.width,d=a.height,h=a.properties,p=t.prototype.getShape.call(this),f=h.definitionType,g=((null===(r=n.endEvent)||void 0===r?void 0:r.get(f))||{}).icon,y=Array.isArray(g)?e.h.apply(void 0,b(["g",{transform:"matrix(1 0 0 1 ".concat(u-c/2," ").concat(s-d/2,")")}],m(g),!1)):e.h("path",{transform:"matrix(1 0 0 1 ".concat(u-c/2," ").concat(s-d/2,")"),d:g,style:"fill: black; stroke-linecap: round; stroke-linejoin: round; stroke: white; stroke-width: 1px;"});return e.h("g",{},p,e.h("circle",v(v({},o),{strokeWidth:2,cx:u,cy:s,r:l-2})),y)},r}(e.CircleNode),i=function(t){function e(e,r){var i,o,a,u;e.id||(e.id="Event_".concat(ht())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40});var s=((null===(o=n.endEvent)||void 0===o?void 0:o.get(null===(a=e.properties)||void 0===a?void 0:a.definitionType))||{}).properties,l=void 0===s?{}:s;return e.properties=v(v({},l),e.properties),(null===(u=e.properties)||void 0===u?void 0:u.definitionType)&&(e.properties.definitionId="Definition_".concat(ht())),i=t.call(this,e,r)||this,lt.call(i),i}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedSourceRules=function(){var e=this,n=t.prototype.getConnectedSourceRules.call(this),r={message:"结束节点不能作为边的起点",validate:function(t,n){return console.log("_target",n),t!==e}};return n.push(r),n},e}(e.CircleNodeModel);return{type:"bpmn:endEvent",view:r,model:i}}function vt(t){var n=m(t.useDefinition(),1)[0],r=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return f(r,t),r.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},r.prototype.getShape=function(){var t,r=this.props.model,i=r.getNodeStyle(),o=r,a=o.x,u=o.y,s=o.r,l=o.width,c=o.height,d=o.properties.definitionType,h=((null===(t=n.intermediateCatchEvent)||void 0===t?void 0:t.get(d))||{}).icon,p=Array.isArray(h)?e.h.apply(void 0,b(["g",{transform:"matrix(1 0 0 1 ".concat(a-l/2," ").concat(u-c/2,")")}],m(h),!1)):e.h("path",{transform:"matrix(1 0 0 1 ".concat(a-l/2," ").concat(u-c/2,")"),d:h});return e.h("g",{},e.h("circle",v(v({},i),{cx:a,cy:u,r:s,strokeWidth:1.5})),e.h("circle",v(v({},i),{cx:a,cy:u,r:s-3,strokeWidth:1.5})),p)},r}(e.CircleNode),i=function(t){function e(e,r){var i,o,a,u;e.id||(e.id="Event_".concat(ht())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40});var s=((null===(o=n.intermediateCatchEvent)||void 0===o?void 0:o.get(null===(a=e.properties)||void 0===a?void 0:a.definitionType))||{}).properties,l=void 0===s?{}:s;return e.properties=v(v({},l),e.properties),(null===(u=e.properties)||void 0===u?void 0:u.definitionType)&&(e.properties.definitionId="Definition_".concat(ht())),i=t.call(this,e,r)||this,lt.call(i),i}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e}(e.CircleNodeModel);return{type:"bpmn:intermediateCatchEvent",view:r,model:i}}function gt(t){var n=m(t.useDefinition(),1)[0],r=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return f(r,t),r.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},r.prototype.getShape=function(){var t,r=this.props.model,i=r.getNodeStyle(),o=r,a=o.x,u=o.y,s=o.r,l=o.width,c=o.height,d=o.properties,h=d.definitionType,p=d.isInterrupting,f=((null===(t=n.startEvent)||void 0===t?void 0:t.get(h))||{}).icon,g=Array.isArray(f)?e.h.apply(void 0,b(["g",{transform:"matrix(1 0 0 1 ".concat(a-l/2," ").concat(u-c/2,")")}],m(f),!1)):e.h("path",{transform:"matrix(1 0 0 1 ".concat(a-l/2," ").concat(u-c/2,")"),d:f,style:"fill: white; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"});return e.h("g",{},e.h("circle",v(v({},i),{cx:a,cy:u,r:s,strokeDasharray:p?"5,5":"",strokeWidth:2})),g)},r}(e.CircleNode),i=function(t){function e(e,r){var i,o,a;e.id||(e.id="Event_".concat(ht())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40});var u=((null===(i=n.startEvent)||void 0===i?void 0:i.get(null===(o=e.properties)||void 0===o?void 0:o.definitionType))||{}).properties,s=void 0===u?{}:u;return e.properties=v(v({},s),e.properties),(null===(a=e.properties)||void 0===a?void 0:a.definitionType)&&(e.properties.definitionId="Definition_".concat(ht())),t.call(this,e,r)||this}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedTargetRules=function(){var e=this,n=t.prototype.getConnectedTargetRules.call(this),r={message:"起始节点不能作为边的终点",validate:function(t,n){return n!==e}};return n.push(r),n},e}(e.CircleNodeModel);return{type:"bpmn:startEvent",view:r,model:i}}function yt(t){var n=m(t.useDefinition(),1)[0],r=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return f(r,t),r.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},r.prototype.getShape=function(){var t,r=this.props.model,i=r.getNodeStyle(),o=r,a=o.x,u=o.y,s=o.r,l=o.width,c=o.height,d=o.properties,h=d.definitionType,p=d.cancelActivity,f=((null===(t=n.boundaryEvent)||void 0===t?void 0:t.get(h))||{}).icon,g=Array.isArray(f)?e.h.apply(void 0,b(["g",{transform:"matrix(1 0 0 1 ".concat(a-l/2," ").concat(u-c/2,")")}],m(f),!1)):e.h("path",{transform:"matrix(1 0 0 1 ".concat(a-l/2," ").concat(u-c/2,")"),d:f});return e.h("g",{},e.h("circle",v(v({},i),{cx:a,cy:u,r:s,strokeDasharray:p?"":"5,5",strokeWidth:1.5})),e.h("circle",v(v({},i),{cx:a,cy:u,r:s-3,strokeDasharray:p?"":"5,5",strokeWidth:1.5})),g)},r}(e.CircleNode),i=function(t){function e(e,r){var i,o,a,u;e.id||(e.id="Event_".concat(ht())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40});var s=((null===(o=n.boundaryEvent)||void 0===o?void 0:o.get(null===(a=e.properties)||void 0===a?void 0:a.definitionType))||{}).properties,l=void 0===s?{}:s;return e.properties=v(v({attachedToRef:"",cancelActivity:!0},l),e.properties),(null===(u=e.properties)||void 0===u?void 0:u.definitionType)&&(e.properties.definitionId="Definition_".concat(ht())),i=t.call(this,e,r)||this,lt.call(i),i}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.r=20,this.autoToFront=!1,this.zIndex=99999},e.prototype.setAttributes=function(){this.r=18},e}(e.CircleNodeModel);return{type:"bpmn:boundaryEvent",view:r,model:i}}function mt(t){var n=m(t.useDefinition(),1)[0],r=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return f(r,t),r.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},r.prototype.getShape=function(){var t,r=this.props.model,i=r.getNodeStyle(),o=r,a=o.x,u=o.y,s=o.r,l=o.width,c=o.height,d=o.properties.definitionType,h=((null===(t=n.intermediateThrowEvent)||void 0===t?void 0:t.get(d))||{}).icon,p=Array.isArray(h)?e.h.apply(void 0,b(["g",{transform:"matrix(1 0 0 1 ".concat(a-l/2," ").concat(u-c/2,")")}],m(h),!1)):e.h("path",{transform:"matrix(1 0 0 1 ".concat(a-l/2," ").concat(u-c/2,")"),d:h,style:"fill: black"});return e.h("g",{},e.h("circle",v(v({},i),{cx:a,cy:u,r:s,strokeWidth:1.5})),e.h("circle",v(v({},i),{cx:a,cy:u,r:s-3,strokeWidth:1.5})),p)},r}(e.CircleNode),i=function(t){function e(e,r){var i,o,a,u;e.id||(e.id="Event_".concat(ht())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40});var s=((null===(o=n.intermediateThrowEvent)||void 0===o?void 0:o.get(null===(a=e.properties)||void 0===a?void 0:a.definitionType))||{}).properties,l=void 0===s?{}:s;return e.properties=v(v({},l),e.properties),(null===(u=e.properties)||void 0===u?void 0:u.definitionType)&&(e.properties.definitionId="Definition_".concat(ht())),i=t.call(this,e,r)||this,lt.call(i),i}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e}(e.CircleNodeModel);return{type:"bpmn:intermediateThrowEvent",view:r,model:i}}var bt=[e.h("circle",{cx:18,cy:18,r:11,style:"stroke-linecap: round;stroke-linejoin: round;stroke: rgb(34, 36, 42);stroke-width: 2px;fill: white"}),e.h("path",{d:"M 18,18 l 2.25,-7.5 m -2.25,7.5 l 5.25,1.5",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(0,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(30,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(60,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(90,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(120,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(150,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(180,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(210,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(240,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(270,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(300,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(330,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"})],xt=[e.h("circle",{cx:18,cy:18,r:10,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 4px; fill: rgb(34, 36, 42);"})],_t="m 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z",wt="m 23,10 0,12.5 -12.5,0 0,5 12.5,0 0,12.5 5,0 0,-12.5 12.5,0 0,-5 -12.5,0 0,-12.5 -5,0 z",Mt=e.h("circle",{cx:25,cy:25,r:13,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2.5px; fill: white;"}),Et="M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z",Nt="M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z",St="m44,60 m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",At="m47,61 m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",Pt="m 50,73 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",Ot=Object.freeze({__proto__:null,compensationIcon:"m 7.92,18 9,-6.5 0,13 z m 9.3,-0.4 8.7,-6.1 0,13 -8.7,-6.1 z",conditionalIcon:"M 10.5,8.5 l 14.5,0 l 0,18 l -14.5,0 Z M 12.5,11.5 l 10.5,0 M 12.5,14.5 l 10.5,0 M 12.5,17.5 l 10.5,0 M 12.5,20.5 l 10.5,0 M 12.5,23.5 l 10.5,0 M 12.5,26.5 l 10.5,0 ",errorIcon:"m 7.2,25.991999999999997 0.09350000000000001,-0.025300000000000003 7.3392,-9.610700000000001 7.667000000000001,8.9661 4.7003,-18.2204 -5.8707,11.6501 -7.299600000000001,-9.585400000000002 z",escalationIcon:"M 18,7.2 l 8,20 l -8,-7 l -8,7 Z",exclusiveIcon:_t,inclusiveIcon:Mt,linkIcon:"m 20.52,9.468 0,4.4375 -13.5,0 0,6.75 13.5,0 0,4.4375 9.84375,-7.8125 -9.84375,-7.8125 z",loopMarker:Pt,manualTaskIcon:"M0.5,3.751L4.583,0.5009999999999999C4.583,0.5009999999999999,15.749,0.5839999999999999,16.666,0.5839999999999999S14.249,3.5009999999999994,15.166,3.5009999999999994S26.833,3.5009999999999994,27.75,3.5009999999999994C28.916,5.209,27.582,6.667999999999999,26.916,7.167999999999999S27.791,9.084999999999999,25.916,11.584999999999999C25.166,11.834999999999999,26.666,13.459999999999999,24.583000000000002,14.918C23.416,15.501,25.166,16.46,23.333000000000002,17.750999999999998C22.166,17.750999999999998,2.5000000000000036,17.833999999999996,2.5000000000000036,17.833999999999996L0.5000000000000036,16.500999999999998V3.751ZM13.5,7L27,7M13.5,11L26,11M14,14.5L25,14.5M8.2,3.1L15,3.1",messageIcon:"m 8.459999999999999,11.34 l 0,12.6 l 18.900000000000002,0 l 0,-12.6 z l 9.450000000000001,5.4 l 9.450000000000001,-5.4",parallelIcon:wt,parallelMarker:St,scriptTaskIcon:"M6.402,0.5H20.902C20.902,0.5,15.069,3.333,15.069,6.083S19.486,12.083,19.486,15.25S15.319,20.333,15.319,20.333H0.235C0.235,20.333,5.235,17.665999999999997,5.235,15.332999999999998S0.6520000000000001,8.582999999999998,0.6520000000000001,6.082999999999998S6.402,0.5,6.402,0.5ZM3.5,4.5L13.5,4.5M3.8,8.5L13.8,8.5M6.3,12.5L16.3,12.5M6.5,16.5L16.5,16.5",sequentialMarker:At,serviceTaskIcon:Et,signalIcon:"M 18,7.2 l 9,16.2 l -18,0 Z",style:{throw:"fill: rgb(34, 36, 42); stroke-linecap: round; stroke-linejoin: round; stroke: white; stroke-width: 1px;",catch:"fill: white; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;",nonIntermediate:"stroke-width: 1.5; stroke-dash-array: 6",intermediate:"stroke-width: 1.5"},terminateIcon:xt,timerIcon:bt,userTaskIcon:Nt});function Tt(t,n,r){var i=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return f(r,t),r.prototype.getShape=function(){var t=this.props.model,r=t,i=r.x,o=r.y,a=r.width,u=r.height,s=r.points,l=t.getNodeStyle();return e.h("g",{transform:"matrix(1 0 0 1 ".concat(i-a/2," ").concat(o-u/2,")")},e.h(e.Polygon,v(v({},l),{x:i,y:o,points:s})),"string"==typeof n?e.h("path",v(v({d:n},l),{fill:"rgb(34, 36, 42)",strokeWidth:1})):n)},r}(e.PolygonNode);return{type:t,view:i,model:function(t){function e(e,n){var i=this;return e.id||(e.id="Gateway_".concat(ht())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),e.properties=v(v({},r||{}),e.properties),(i=t.call(this,e,n)||this).points=[[25,0],[50,25],[25,50],[0,25]],lt.call(i),i}return f(e,t),e}(e.PolygonNodeModel)}}var Ct={parallel:St,sequential:At,loop:Pt};function kt(t,n,r){var i=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return f(r,t),r.prototype.getLabelShape=function(){var t=this.props.model,r=t.x,i=t.y,o=t.width,a=t.height,u=t.getNodeStyle(),s=Array.isArray(n)?e.h.apply(void 0,b(["g",{transform:"matrix(1 0 0 1 ".concat(r-o/2," ").concat(i-a/2,")")}],m(n),!1)):e.h("path",{fill:u.stroke,d:n});return e.h("svg",{x:r-o/2+5,y:i-a/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},s)},r.prototype.getShape=function(){var t=this.props.model,n=t.x,r=t.y,i=t.width,o=t.height,a=t.radius,u=t.properties,s=t.getNodeStyle();return e.h("g",{},[e.h("rect",v(v({},s),{x:n-i/2,y:r-o/2,rx:a,ry:a,width:i,height:o,opacity:.95})),this.getLabelShape(),e.h("g",{transform:"matrix(1 0 0 1 ".concat(n-i/2," ").concat(r-o/2,")")},e.h("path",{fill:"white",strokeLinecap:"round",strokeLinejoin:"round",stroke:"rgb(34, 36, 42)",strokeWidth:"2",d:Ct[u.multiInstanceType]||""}))])},r}(e.RectNode),o=function(t){function e(e,n){var i,o=this;e.id||(e.id="Activity_".concat(ht()));var a=v(v({},r||{}),e.properties);return e.properties=a,o=t.call(this,e,n)||this,null===(i=null==a?void 0:a.boundaryEvents)||void 0===i||i.forEach((function(t){o.addBoundaryEvent(t)})),o.deleteProperty("boundaryEvents"),lt.call(o),o}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.isTaskNode=!0,this.boundaryEvents=[]},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this);return this.properties.isBoundaryEventTouchingTask&&(e.stroke="#00acff",e.strokeWidth=2),e},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return e.stroke="transparent",!e.hover&&(e.hover={}),e.hover.stroke="transparent",e},e.prototype.setTouching=function(t){this.setProperty("isBoundaryEventTouchingTask",t)},e.prototype.addBoundaryEvent=function(t){if(this.setTouching(!1),this.boundaryEvents.find((function(e){return e===t})))return!1;var e=this.graphModel.getNodeModelById(t);return null==e||e.setProperties({attachedToRef:this.id}),this.boundaryEvents.push(t),!0},e.prototype.deleteBoundaryEvent=function(t){this.boundaryEvents=this.boundaryEvents.filter((function(e){return e!==t}))},e}(e.RectNodeModel);return{type:t,view:i,model:o}}var jt="object"==typeof global&&global&&global.Object===Object&&global,It="object"==typeof self&&self&&self.Object===Object&&self,Rt=jt||It||Function("return this")(),Dt=Rt.Symbol,Lt=Object.prototype,Bt=Lt.hasOwnProperty,zt=Lt.toString,Wt=Dt?Dt.toStringTag:void 0;var Ft=Object.prototype.toString;var Gt="[object Null]",Ht="[object Undefined]",Xt=Dt?Dt.toStringTag:void 0;function Ut(t){return null==t?void 0===t?Ht:Gt:Xt&&Xt in Object(t)?function(t){var e=Bt.call(t,Wt),n=t[Wt];try{t[Wt]=void 0;var r=!0}catch(t){}var i=zt.call(t);return r&&(e?t[Wt]=n:delete t[Wt]),i}(t):function(t){return Ft.call(t)}(t)}function Vt(t){return null!=t&&"object"==typeof t}var Yt="[object Symbol]";function qt(t){return"symbol"==typeof t||Vt(t)&&Ut(t)==Yt}var Zt=NaN;function Kt(t){return"number"==typeof t?t:qt(t)?Zt:+t}function $t(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var Jt=Array.isArray,Qt=1/0,te=Dt?Dt.prototype:void 0,ee=te?te.toString:void 0;function ne(t){if("string"==typeof t)return t;if(Jt(t))return $t(t,ne)+"";if(qt(t))return ee?ee.call(t):"";var e=t+"";return"0"==e&&1/t==-Qt?"-0":e}function re(t,e){return function(n,r){var i;if(void 0===n&&void 0===r)return e;if(void 0!==n&&(i=n),void 0!==r){if(void 0===i)return r;"string"==typeof n||"string"==typeof r?(n=ne(n),r=ne(r)):(n=Kt(n),r=Kt(r)),i=t(n,r)}return i}}var ie=re((function(t,e){return t+e}),0),oe=/\s/;function ae(t){for(var e=t.length;e--&&oe.test(t.charAt(e)););return e}var ue=/^\s+/;function se(t){return t?t.slice(0,ae(t)+1).replace(ue,""):t}function le(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var ce=NaN,de=/^[-+]0x[0-9a-f]+$/i,he=/^0b[01]+$/i,pe=/^0o[0-7]+$/i,fe=parseInt;function ve(t){if("number"==typeof t)return t;if(qt(t))return ce;if(le(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=le(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=se(t);var n=he.test(t);return n||pe.test(t)?fe(t.slice(2),n?2:8):de.test(t)?ce:+t}var ge=1/0,ye=17976931348623157e292;function me(t){return t?(t=ve(t))===ge||t===-ge?(t<0?-1:1)*ye:t==t?t:0:0===t?t:0}function be(t){var e=me(t),n=e%1;return e==e?n?e-n:e:0}function xe(t){return t}var _e="[object AsyncFunction]",we="[object Function]",Me="[object GeneratorFunction]",Ee="[object Proxy]";function Ne(t){if(!le(t))return!1;var e=Ut(t);return e==we||e==Me||e==_e||e==Ee}var Se,Ae=Rt["__core-js_shared__"],Pe=(Se=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||""))?"Symbol(src)_1."+Se:"";var Oe=Function.prototype.toString;function Te(t){if(null!=t){try{return Oe.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var Ce=/^\[object .+?Constructor\]$/,ke=Function.prototype,je=Object.prototype,Ie=ke.toString,Re=je.hasOwnProperty,De=RegExp("^"+Ie.call(Re).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Le(t){return!(!le(t)||function(t){return!!Pe&&Pe in t}(t))&&(Ne(t)?De:Ce).test(Te(t))}function Be(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return Le(n)?n:void 0}var ze=Be(Rt,"WeakMap"),We=ze&&new ze,Fe=We?function(t,e){return We.set(t,e),t}:xe,Ge=Object.create,He=function(){function t(){}return function(e){if(!le(e))return{};if(Ge)return Ge(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function Xe(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=He(t.prototype),r=t.apply(n,e);return le(r)?r:n}}var Ue=1;function Ve(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var Ye=Math.max;function qe(t,e,n,r){for(var i=-1,o=t.length,a=n.length,u=-1,s=e.length,l=Ye(o-a,0),c=Array(s+l),d=!r;++u<s;)c[u]=e[u];for(;++i<a;)(d||i<o)&&(c[n[i]]=t[i]);for(;l--;)c[u++]=t[i++];return c}var Ze=Math.max;function Ke(t,e,n,r){for(var i=-1,o=t.length,a=-1,u=n.length,s=-1,l=e.length,c=Ze(o-u,0),d=Array(c+l),h=!r;++i<c;)d[i]=t[i];for(var p=i;++s<l;)d[p+s]=e[s];for(;++a<u;)(h||i<o)&&(d[p+n[a]]=t[i++]);return d}function $e(){}var Je=4294967295;function Qe(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Je,this.__views__=[]}function tn(){}Qe.prototype=He($e.prototype),Qe.prototype.constructor=Qe;var en=We?function(t){return We.get(t)}:tn,nn={},rn=Object.prototype.hasOwnProperty;function on(t){for(var e=t.name+"",n=nn[e],r=rn.call(nn,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function an(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function un(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function sn(t){if(t instanceof Qe)return t.clone();var e=new an(t.__wrapped__,t.__chain__);return e.__actions__=un(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}an.prototype=He($e.prototype),an.prototype.constructor=an;var ln=Object.prototype.hasOwnProperty;function cn(t){if(Vt(t)&&!Jt(t)&&!(t instanceof Qe)){if(t instanceof an)return t;if(ln.call(t,"__wrapped__"))return sn(t)}return new an(t)}function dn(t){var e=on(t),n=cn[e];if("function"!=typeof n||!(e in Qe.prototype))return!1;if(t===n)return!0;var r=en(n);return!!r&&t===r[0]}cn.prototype=$e.prototype,cn.prototype.constructor=cn;var hn=Date.now;function pn(t){var e=0,n=0;return function(){var r=hn(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var fn=pn(Fe),vn=/\{\n\/\* \[wrapped with (.+)\] \*/,gn=/,? & /;var yn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function mn(t){return function(){return t}}var bn=function(){try{var t=Be(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),xn=bn?function(t,e){return bn(t,"toString",{configurable:!0,enumerable:!1,value:mn(e),writable:!0})}:xe,_n=pn(xn);function wn(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Mn(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function En(t){return t!=t}function Nn(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):Mn(t,En,n)}function Sn(t,e){return!!(null==t?0:t.length)&&Nn(t,e,0)>-1}var An=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];function Pn(t,e,n){var r=e+"";return _n(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(yn,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return wn(An,(function(n){var r="_."+n[0];e&n[1]&&!Sn(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(vn);return e?e[1].split(gn):[]}(r),n)))}var On=1,Tn=2,Cn=4,kn=8,jn=32,In=64;function Rn(t,e,n,r,i,o,a,u,s,l){var c=e&kn;e|=c?jn:In,(e&=~(c?In:jn))&Cn||(e&=~(On|Tn));var d=[t,e,i,c?o:void 0,c?a:void 0,c?void 0:o,c?void 0:a,u,s,l],h=n.apply(void 0,d);return dn(t)&&fn(h,d),h.placeholder=r,Pn(h,t,e)}function Dn(t){return t.placeholder}var Ln=9007199254740991,Bn=/^(?:0|[1-9]\d*)$/;function zn(t,e){var n=typeof t;return!!(e=null==e?Ln:e)&&("number"==n||"symbol"!=n&&Bn.test(t))&&t>-1&&t%1==0&&t<e}var Wn=Math.min;var Fn="__lodash_placeholder__";function Gn(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n];a!==e&&a!==Fn||(t[n]=Fn,o[i++]=n)}return o}var Hn=1,Xn=2,Un=8,Vn=16,Yn=128,qn=512;function Zn(t,e,n,r,i,o,a,u,s,l){var c=e&Yn,d=e&Hn,h=e&Xn,p=e&(Un|Vn),f=e&qn,v=h?void 0:Xe(t);return function g(){for(var y=arguments.length,m=Array(y),b=y;b--;)m[b]=arguments[b];if(p)var x=Dn(g),_=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(m,x);if(r&&(m=qe(m,r,i,p)),o&&(m=Ke(m,o,a,p)),y-=_,p&&y<l){var w=Gn(m,x);return Rn(t,e,Zn,g.placeholder,n,m,w,u,s,l-y)}var M=d?n:this,E=h?M[t]:t;return y=m.length,u?m=function(t,e){for(var n=t.length,r=Wn(e.length,n),i=un(t);r--;){var o=e[r];t[r]=zn(o,n)?i[o]:void 0}return t}(m,u):f&&y>1&&m.reverse(),c&&s<y&&(m.length=s),this&&this!==Rt&&this instanceof g&&(E=v||Xe(E)),E.apply(M,m)}}var Kn=1;var $n="__lodash_placeholder__",Jn=1,Qn=2,tr=4,er=8,nr=128,rr=256,ir=Math.min;var or="Expected a function",ar=1,ur=2,sr=8,lr=16,cr=32,dr=64,hr=Math.max;function pr(t,e,n,r,i,o,a,u){var s=e&ur;if(!s&&"function"!=typeof t)throw new TypeError(or);var l=r?r.length:0;if(l||(e&=~(cr|dr),r=i=void 0),a=void 0===a?a:hr(be(a),0),u=void 0===u?u:be(u),l-=i?i.length:0,e&dr){var c=r,d=i;r=i=void 0}var h=s?void 0:en(t),p=[t,e,n,r,i,c,d,o,a,u];if(h&&function(t,e){var n=t[1],r=e[1],i=n|r,o=i<(Jn|Qn|nr),a=r==nr&&n==er||r==nr&&n==rr&&t[7].length<=e[8]||r==(nr|rr)&&e[7].length<=e[8]&&n==er;if(!o&&!a)return t;r&Jn&&(t[2]=e[2],i|=n&Jn?0:tr);var u=e[3];if(u){var s=t[3];t[3]=s?qe(s,u,e[4]):u,t[4]=s?Gn(t[3],$n):e[4]}(u=e[5])&&(s=t[5],t[5]=s?Ke(s,u,e[6]):u,t[6]=s?Gn(t[5],$n):e[6]),(u=e[7])&&(t[7]=u),r&nr&&(t[8]=null==t[8]?e[8]:ir(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(p,h),t=p[0],e=p[1],n=p[2],r=p[3],i=p[4],!(u=p[9]=void 0===p[9]?s?0:t.length:hr(p[9]-l,0))&&e&(sr|lr)&&(e&=~(sr|lr)),e&&e!=ar)f=e==sr||e==lr?function(t,e,n){var r=Xe(t);return function i(){for(var o=arguments.length,a=Array(o),u=o,s=Dn(i);u--;)a[u]=arguments[u];var l=o<3&&a[0]!==s&&a[o-1]!==s?[]:Gn(a,s);return(o-=l.length)<n?Rn(t,e,Zn,i.placeholder,void 0,a,l,void 0,void 0,n-o):Ve(this&&this!==Rt&&this instanceof i?r:t,this,a)}}(t,e,u):e!=cr&&e!=(ar|cr)||i.length?Zn.apply(void 0,p):function(t,e,n,r){var i=e&Kn,o=Xe(t);return function e(){for(var a=-1,u=arguments.length,s=-1,l=r.length,c=Array(l+u),d=this&&this!==Rt&&this instanceof e?o:t;++s<l;)c[s]=r[s];for(;u--;)c[s++]=arguments[++a];return Ve(d,i?n:this,c)}}(t,e,n,r);else var f=function(t,e,n){var r=e&Ue,i=Xe(t);return function e(){return(this&&this!==Rt&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,n);return Pn((h?Fe:fn)(f,p),t,e)}var fr=128;function vr(t,e,n){return e=n?void 0:e,e=t&&null==e?t.length:e,pr(t,fr,void 0,void 0,void 0,void 0,e)}function gr(t,e,n){"__proto__"==e&&bn?bn(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function yr(t,e){return t===e||t!=t&&e!=e}var mr=Object.prototype.hasOwnProperty;function br(t,e,n){var r=t[e];mr.call(t,e)&&yr(r,n)&&(void 0!==n||e in t)||gr(t,e,n)}function xr(t,e,n,r){var i=!n;n||(n={});for(var o=-1,a=e.length;++o<a;){var u=e[o],s=r?r(n[u],t[u],u,n,t):void 0;void 0===s&&(s=t[u]),i?gr(n,u,s):br(n,u,s)}return n}var _r=Math.max;function wr(t,e,n){return e=_r(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=_r(r.length-e,0),a=Array(o);++i<o;)a[i]=r[e+i];i=-1;for(var u=Array(e+1);++i<e;)u[i]=r[i];return u[e]=n(a),Ve(t,this,u)}}function Mr(t,e){return _n(wr(t,e,xe),t+"")}var Er=9007199254740991;function Nr(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Er}function Sr(t){return null!=t&&Nr(t.length)&&!Ne(t)}function Ar(t,e,n){if(!le(n))return!1;var r=typeof e;return!!("number"==r?Sr(n)&&zn(e,n.length):"string"==r&&e in n)&&yr(n[e],t)}function Pr(t){return Mr((function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,a&&Ar(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var u=n[r];u&&t(e,u,r,o)}return e}))}var Or=Object.prototype;function Tr(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Or)}function Cr(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function kr(t){return Vt(t)&&"[object Arguments]"==Ut(t)}var jr=Object.prototype,Ir=jr.hasOwnProperty,Rr=jr.propertyIsEnumerable,Dr=kr(function(){return arguments}())?kr:function(t){return Vt(t)&&Ir.call(t,"callee")&&!Rr.call(t,"callee")};function Lr(){return!1}var Br="object"==typeof t&&t&&!t.nodeType&&t,zr=Br&&"object"==typeof module&&module&&!module.nodeType&&module,Wr=zr&&zr.exports===Br?Rt.Buffer:void 0,Fr=(Wr?Wr.isBuffer:void 0)||Lr,Gr={};function Hr(t){return function(e){return t(e)}}Gr["[object Float32Array]"]=Gr["[object Float64Array]"]=Gr["[object Int8Array]"]=Gr["[object Int16Array]"]=Gr["[object Int32Array]"]=Gr["[object Uint8Array]"]=Gr["[object Uint8ClampedArray]"]=Gr["[object Uint16Array]"]=Gr["[object Uint32Array]"]=!0,Gr["[object Arguments]"]=Gr["[object Array]"]=Gr["[object ArrayBuffer]"]=Gr["[object Boolean]"]=Gr["[object DataView]"]=Gr["[object Date]"]=Gr["[object Error]"]=Gr["[object Function]"]=Gr["[object Map]"]=Gr["[object Number]"]=Gr["[object Object]"]=Gr["[object RegExp]"]=Gr["[object Set]"]=Gr["[object String]"]=Gr["[object WeakMap]"]=!1;var Xr="object"==typeof t&&t&&!t.nodeType&&t,Ur=Xr&&"object"==typeof module&&module&&!module.nodeType&&module,Vr=Ur&&Ur.exports===Xr&&jt.process,Yr=function(){try{var t=Ur&&Ur.require&&Ur.require("util").types;return t||Vr&&Vr.binding&&Vr.binding("util")}catch(t){}}(),qr=Yr&&Yr.isTypedArray,Zr=qr?Hr(qr):function(t){return Vt(t)&&Nr(t.length)&&!!Gr[Ut(t)]},Kr=Object.prototype.hasOwnProperty;function $r(t,e){var n=Jt(t),r=!n&&Dr(t),i=!n&&!r&&Fr(t),o=!n&&!r&&!i&&Zr(t),a=n||r||i||o,u=a?Cr(t.length,String):[],s=u.length;for(var l in t)!e&&!Kr.call(t,l)||a&&("length"==l||i&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||zn(l,s))||u.push(l);return u}function Jr(t,e){return function(n){return t(e(n))}}var Qr=Jr(Object.keys,Object),ti=Object.prototype.hasOwnProperty;function ei(t){if(!Tr(t))return Qr(t);var e=[];for(var n in Object(t))ti.call(t,n)&&"constructor"!=n&&e.push(n);return e}function ni(t){return Sr(t)?$r(t):ei(t)}var ri=Object.prototype.hasOwnProperty,ii=Pr((function(t,e){if(Tr(e)||Sr(e))xr(e,ni(e),t);else for(var n in e)ri.call(e,n)&&br(t,n,e[n])}));var oi=Object.prototype.hasOwnProperty;function ai(t){if(!le(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=Tr(t),n=[];for(var r in t)("constructor"!=r||!e&&oi.call(t,r))&&n.push(r);return n}function ui(t){return Sr(t)?$r(t,!0):ai(t)}var si=Pr((function(t,e){xr(e,ui(e),t)})),li=Pr((function(t,e,n,r){xr(e,ui(e),t,r)})),ci=Pr((function(t,e,n,r){xr(e,ni(e),t,r)})),di=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hi=/^\w*$/;function pi(t,e){if(Jt(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!qt(t))||(hi.test(t)||!di.test(t)||null!=e&&t in Object(e))}var fi=Be(Object,"create");var vi=Object.prototype.hasOwnProperty;var gi=Object.prototype.hasOwnProperty;function yi(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function mi(t,e){for(var n=t.length;n--;)if(yr(t[n][0],e))return n;return-1}yi.prototype.clear=function(){this.__data__=fi?fi(null):{},this.size=0},yi.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},yi.prototype.get=function(t){var e=this.__data__;if(fi){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return vi.call(e,t)?e[t]:void 0},yi.prototype.has=function(t){var e=this.__data__;return fi?void 0!==e[t]:gi.call(e,t)},yi.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=fi&&void 0===e?"__lodash_hash_undefined__":e,this};var bi=Array.prototype.splice;function xi(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}xi.prototype.clear=function(){this.__data__=[],this.size=0},xi.prototype.delete=function(t){var e=this.__data__,n=mi(e,t);return!(n<0)&&(n==e.length-1?e.pop():bi.call(e,n,1),--this.size,!0)},xi.prototype.get=function(t){var e=this.__data__,n=mi(e,t);return n<0?void 0:e[n][1]},xi.prototype.has=function(t){return mi(this.__data__,t)>-1},xi.prototype.set=function(t,e){var n=this.__data__,r=mi(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var _i=Be(Rt,"Map");function wi(t,e){var n=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?n["string"==typeof e?"string":"hash"]:n.map}function Mi(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Mi.prototype.clear=function(){this.size=0,this.__data__={hash:new yi,map:new(_i||xi),string:new yi}},Mi.prototype.delete=function(t){var e=wi(this,t).delete(t);return this.size-=e?1:0,e},Mi.prototype.get=function(t){return wi(this,t).get(t)},Mi.prototype.has=function(t){return wi(this,t).has(t)},Mi.prototype.set=function(t,e){var n=wi(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var Ei="Expected a function";function Ni(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Ei);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Ni.Cache||Mi),n}Ni.Cache=Mi;var Si=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ai=/\\(\\)?/g,Pi=function(t){var e=Ni(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Si,(function(t,n,r,i){e.push(r?i.replace(Ai,"$1"):n||t)})),e}));function Oi(t){return null==t?"":ne(t)}function Ti(t,e){return Jt(t)?t:pi(t,e)?[t]:Pi(Oi(t))}var Ci=1/0;function ki(t){if("string"==typeof t||qt(t))return t;var e=t+"";return"0"==e&&1/t==-Ci?"-0":e}function ji(t,e){for(var n=0,r=(e=Ti(e,t)).length;null!=t&&n<r;)t=t[ki(e[n++])];return n&&n==r?t:void 0}function Ii(t,e,n){var r=null==t?void 0:ji(t,e);return void 0===r?n:r}function Ri(t,e){for(var n=-1,r=e.length,i=Array(r),o=null==t;++n<r;)i[n]=o?void 0:Ii(t,e[n]);return i}function Di(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var Li=Dt?Dt.isConcatSpreadable:void 0;function Bi(t){return Jt(t)||Dr(t)||!!(Li&&t&&t[Li])}function zi(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=Bi),i||(i=[]);++o<a;){var u=t[o];e>0&&n(u)?e>1?zi(u,e-1,n,r,i):Di(i,u):r||(i[i.length]=u)}return i}function Wi(t){return(null==t?0:t.length)?zi(t,1):[]}function Fi(t){return _n(wr(t,void 0,Wi),t+"")}var Gi=Fi(Ri),Hi=Jr(Object.getPrototypeOf,Object),Xi="[object Object]",Ui=Function.prototype,Vi=Object.prototype,Yi=Ui.toString,qi=Vi.hasOwnProperty,Zi=Yi.call(Object);function Ki(t){if(!Vt(t)||Ut(t)!=Xi)return!1;var e=Hi(t);if(null===e)return!0;var n=qi.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Yi.call(n)==Zi}var $i="[object DOMException]",Ji="[object Error]";function Qi(t){if(!Vt(t))return!1;var e=Ut(t);return e==Ji||e==$i||"string"==typeof t.message&&"string"==typeof t.name&&!Ki(t)}var to=Mr((function(t,e){try{return Ve(t,void 0,e)}catch(t){return Qi(t)?t:new Error(t)}})),eo="Expected a function";function no(t,e){var n;if("function"!=typeof e)throw new TypeError(eo);return t=be(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var ro=Mr((function(t,e,n){var r=1;if(n.length){var i=Gn(n,Dn(ro));r|=32}return pr(t,r,e,n,i)}));ro.placeholder={};var io=Fi((function(t,e){return wn(e,(function(e){e=ki(e),gr(t,e,ro(t[e],t))})),t})),oo=Mr((function(t,e,n){var r=3;if(n.length){var i=Gn(n,Dn(oo));r|=32}return pr(e,r,t,n,i)}));function ao(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}function uo(t,e,n){var r=t.length;return n=void 0===n?r:n,!e&&n>=r?t:ao(t,e,n)}oo.placeholder={};var so=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function lo(t){return so.test(t)}var co="\\ud800-\\udfff",ho="["+co+"]",po="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",fo="\\ud83c[\\udffb-\\udfff]",vo="[^"+co+"]",go="(?:\\ud83c[\\udde6-\\uddff]){2}",yo="[\\ud800-\\udbff][\\udc00-\\udfff]",mo="(?:"+po+"|"+fo+")"+"?",bo="[\\ufe0e\\ufe0f]?",xo=bo+mo+("(?:\\u200d(?:"+[vo,go,yo].join("|")+")"+bo+mo+")*"),_o="(?:"+[vo+po+"?",po,go,yo,ho].join("|")+")",wo=RegExp(fo+"(?="+fo+")|"+_o+xo,"g");function Mo(t){return lo(t)?function(t){return t.match(wo)||[]}(t):function(t){return t.split("")}(t)}function Eo(t){return function(e){var n=lo(e=Oi(e))?Mo(e):void 0,r=n?n[0]:e.charAt(0),i=n?uo(n,1).join(""):e.slice(1);return r[t]()+i}}var No=Eo("toUpperCase");function So(t){return No(Oi(t).toLowerCase())}function Ao(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function Po(t){return function(e){return null==t?void 0:t[e]}}var Oo=Po({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),To=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Co=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");function ko(t){return(t=Oi(t))&&t.replace(To,Oo).replace(Co,"")}var jo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var Io=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var Ro="\\ud800-\\udfff",Do="\\u2700-\\u27bf",Lo="a-z\\xdf-\\xf6\\xf8-\\xff",Bo="A-Z\\xc0-\\xd6\\xd8-\\xde",zo="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Wo="["+zo+"]",Fo="\\d+",Go="["+Do+"]",Ho="["+Lo+"]",Xo="[^"+Ro+zo+Fo+Do+Lo+Bo+"]",Uo="(?:\\ud83c[\\udde6-\\uddff]){2}",Vo="[\\ud800-\\udbff][\\udc00-\\udfff]",Yo="["+Bo+"]",qo="(?:"+Ho+"|"+Xo+")",Zo="(?:"+Yo+"|"+Xo+")",Ko="(?:['’](?:d|ll|m|re|s|t|ve))?",$o="(?:['’](?:D|LL|M|RE|S|T|VE))?",Jo="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Qo="[\\ufe0e\\ufe0f]?",ta=Qo+Jo+("(?:\\u200d(?:"+["[^"+Ro+"]",Uo,Vo].join("|")+")"+Qo+Jo+")*"),ea="(?:"+[Go,Uo,Vo].join("|")+")"+ta,na=RegExp([Yo+"?"+Ho+"+"+Ko+"(?="+[Wo,Yo,"$"].join("|")+")",Zo+"+"+$o+"(?="+[Wo,Yo+qo,"$"].join("|")+")",Yo+"?"+qo+"+"+Ko,Yo+"+"+$o,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Fo,ea].join("|"),"g");function ra(t,e,n){return t=Oi(t),void 0===(e=n?void 0:e)?function(t){return Io.test(t)}(t)?function(t){return t.match(na)||[]}(t):function(t){return t.match(jo)||[]}(t):t.match(e)||[]}var ia=RegExp("['’]","g");function oa(t){return function(e){return Ao(ra(ko(e).replace(ia,"")),t,"")}}var aa=oa((function(t,e,n){return e=e.toLowerCase(),t+(n?So(e):e)}));var ua=Rt.isFinite,sa=Math.min;function la(t){var e=Math[t];return function(t,n){if(t=ve(t),(n=null==n?0:sa(be(n),292))&&ua(t)){var r=(Oi(t)+"e").split("e");return+((r=(Oi(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var ca=la("ceil");function da(t){var e=cn(t);return e.__chain__=!0,e}var ha=Math.ceil,pa=Math.max;function fa(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}function va(t){var e=this.__data__=new xi(t);this.size=e.size}function ga(t,e){return t&&xr(e,ni(e),t)}va.prototype.clear=function(){this.__data__=new xi,this.size=0},va.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},va.prototype.get=function(t){return this.__data__.get(t)},va.prototype.has=function(t){return this.__data__.has(t)},va.prototype.set=function(t,e){var n=this.__data__;if(n instanceof xi){var r=n.__data__;if(!_i||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Mi(r)}return n.set(t,e),this.size=n.size,this};var ya="object"==typeof t&&t&&!t.nodeType&&t,ma=ya&&"object"==typeof module&&module&&!module.nodeType&&module,ba=ma&&ma.exports===ya?Rt.Buffer:void 0,xa=ba?ba.allocUnsafe:void 0;function _a(t,e){if(e)return t.slice();var n=t.length,r=xa?xa(n):new t.constructor(n);return t.copy(r),r}function wa(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function Ma(){return[]}var Ea=Object.prototype.propertyIsEnumerable,Na=Object.getOwnPropertySymbols,Sa=Na?function(t){return null==t?[]:(t=Object(t),wa(Na(t),(function(e){return Ea.call(t,e)})))}:Ma;var Aa=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Di(e,Sa(t)),t=Hi(t);return e}:Ma;function Pa(t,e,n){var r=e(t);return Jt(t)?r:Di(r,n(t))}function Oa(t){return Pa(t,ni,Sa)}function Ta(t){return Pa(t,ui,Aa)}var Ca=Be(Rt,"DataView"),ka=Be(Rt,"Promise"),ja=Be(Rt,"Set"),Ia="[object Map]",Ra="[object Promise]",Da="[object Set]",La="[object WeakMap]",Ba="[object DataView]",za=Te(Ca),Wa=Te(_i),Fa=Te(ka),Ga=Te(ja),Ha=Te(ze),Xa=Ut;(Ca&&Xa(new Ca(new ArrayBuffer(1)))!=Ba||_i&&Xa(new _i)!=Ia||ka&&Xa(ka.resolve())!=Ra||ja&&Xa(new ja)!=Da||ze&&Xa(new ze)!=La)&&(Xa=function(t){var e=Ut(t),n="[object Object]"==e?t.constructor:void 0,r=n?Te(n):"";if(r)switch(r){case za:return Ba;case Wa:return Ia;case Fa:return Ra;case Ga:return Da;case Ha:return La}return e});var Ua=Xa,Va=Object.prototype.hasOwnProperty;var Ya=Rt.Uint8Array;function qa(t){var e=new t.constructor(t.byteLength);return new Ya(e).set(new Ya(t)),e}var Za=/\w*$/;var Ka=Dt?Dt.prototype:void 0,$a=Ka?Ka.valueOf:void 0;function Ja(t,e){var n=e?qa(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var Qa="[object Boolean]",tu="[object Date]",eu="[object Map]",nu="[object Number]",ru="[object RegExp]",iu="[object Set]",ou="[object String]",au="[object Symbol]",uu="[object ArrayBuffer]",su="[object DataView]",lu="[object Float32Array]",cu="[object Float64Array]",du="[object Int8Array]",hu="[object Int16Array]",pu="[object Int32Array]",fu="[object Uint8Array]",vu="[object Uint8ClampedArray]",gu="[object Uint16Array]",yu="[object Uint32Array]";function mu(t,e,n){var r,i=t.constructor;switch(e){case uu:return qa(t);case Qa:case tu:return new i(+t);case su:return function(t,e){var n=e?qa(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case lu:case cu:case du:case hu:case pu:case fu:case vu:case gu:case yu:return Ja(t,n);case eu:return new i;case nu:case ou:return new i(t);case ru:return function(t){var e=new t.constructor(t.source,Za.exec(t));return e.lastIndex=t.lastIndex,e}(t);case iu:return new i;case au:return r=t,$a?Object($a.call(r)):{}}}function bu(t){return"function"!=typeof t.constructor||Tr(t)?{}:He(Hi(t))}var xu=Yr&&Yr.isMap,_u=xu?Hr(xu):function(t){return Vt(t)&&"[object Map]"==Ua(t)};var wu=Yr&&Yr.isSet,Mu=wu?Hr(wu):function(t){return Vt(t)&&"[object Set]"==Ua(t)},Eu=1,Nu=2,Su=4,Au="[object Arguments]",Pu="[object Function]",Ou="[object GeneratorFunction]",Tu="[object Object]",Cu={};function ku(t,e,n,r,i,o){var a,u=e&Eu,s=e&Nu,l=e&Su;if(n&&(a=i?n(t,r,i,o):n(t)),void 0!==a)return a;if(!le(t))return t;var c=Jt(t);if(c){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Va.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!u)return un(t,a)}else{var d=Ua(t),h=d==Pu||d==Ou;if(Fr(t))return _a(t,u);if(d==Tu||d==Au||h&&!i){if(a=s||h?{}:bu(t),!u)return s?function(t,e){return xr(t,Aa(t),e)}(t,function(t,e){return t&&xr(e,ui(e),t)}(a,t)):function(t,e){return xr(t,Sa(t),e)}(t,ga(a,t))}else{if(!Cu[d])return i?t:{};a=mu(t,d,u)}}o||(o=new va);var p=o.get(t);if(p)return p;o.set(t,a),Mu(t)?t.forEach((function(r){a.add(ku(r,e,n,r,t,o))})):_u(t)&&t.forEach((function(r,i){a.set(i,ku(r,e,n,i,t,o))}));var f=c?void 0:(l?s?Ta:Oa:s?ui:ni)(t);return wn(f||t,(function(r,i){f&&(r=t[i=r]),br(a,i,ku(r,e,n,i,t,o))})),a}Cu[Au]=Cu["[object Array]"]=Cu["[object ArrayBuffer]"]=Cu["[object DataView]"]=Cu["[object Boolean]"]=Cu["[object Date]"]=Cu["[object Float32Array]"]=Cu["[object Float64Array]"]=Cu["[object Int8Array]"]=Cu["[object Int16Array]"]=Cu["[object Int32Array]"]=Cu["[object Map]"]=Cu["[object Number]"]=Cu[Tu]=Cu["[object RegExp]"]=Cu["[object Set]"]=Cu["[object String]"]=Cu["[object Symbol]"]=Cu["[object Uint8Array]"]=Cu["[object Uint8ClampedArray]"]=Cu["[object Uint16Array]"]=Cu["[object Uint32Array]"]=!0,Cu["[object Error]"]=Cu[Pu]=Cu["[object WeakMap]"]=!1;function ju(t){return ku(t,5)}function Iu(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Mi;++e<n;)this.add(t[e])}function Ru(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function Du(t,e){return t.has(e)}Iu.prototype.add=Iu.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Iu.prototype.has=function(t){return this.__data__.has(t)};var Lu=1,Bu=2;function zu(t,e,n,r,i,o){var a=n&Lu,u=t.length,s=e.length;if(u!=s&&!(a&&s>u))return!1;var l=o.get(t),c=o.get(e);if(l&&c)return l==e&&c==t;var d=-1,h=!0,p=n&Bu?new Iu:void 0;for(o.set(t,e),o.set(e,t);++d<u;){var f=t[d],v=e[d];if(r)var g=a?r(v,f,d,e,t,o):r(f,v,d,t,e,o);if(void 0!==g){if(g)continue;h=!1;break}if(p){if(!Ru(e,(function(t,e){if(!Du(p,e)&&(f===t||i(f,t,n,r,o)))return p.push(e)}))){h=!1;break}}else if(f!==v&&!i(f,v,n,r,o)){h=!1;break}}return o.delete(t),o.delete(e),h}function Wu(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function Fu(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var Gu=1,Hu=2,Xu="[object Boolean]",Uu="[object Date]",Vu="[object Error]",Yu="[object Map]",qu="[object Number]",Zu="[object RegExp]",Ku="[object Set]",$u="[object String]",Ju="[object Symbol]",Qu="[object ArrayBuffer]",ts="[object DataView]",es=Dt?Dt.prototype:void 0,ns=es?es.valueOf:void 0;var rs=1,is=Object.prototype.hasOwnProperty;var os=1,as="[object Arguments]",us="[object Array]",ss="[object Object]",ls=Object.prototype.hasOwnProperty;function cs(t,e,n,r,i,o){var a=Jt(t),u=Jt(e),s=a?us:Ua(t),l=u?us:Ua(e),c=(s=s==as?ss:s)==ss,d=(l=l==as?ss:l)==ss,h=s==l;if(h&&Fr(t)){if(!Fr(e))return!1;a=!0,c=!1}if(h&&!c)return o||(o=new va),a||Zr(t)?zu(t,e,n,r,i,o):function(t,e,n,r,i,o,a){switch(n){case ts:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Qu:return!(t.byteLength!=e.byteLength||!o(new Ya(t),new Ya(e)));case Xu:case Uu:case qu:return yr(+t,+e);case Vu:return t.name==e.name&&t.message==e.message;case Zu:case $u:return t==e+"";case Yu:var u=Wu;case Ku:var s=r&Gu;if(u||(u=Fu),t.size!=e.size&&!s)return!1;var l=a.get(t);if(l)return l==e;r|=Hu,a.set(t,e);var c=zu(u(t),u(e),r,i,o,a);return a.delete(t),c;case Ju:if(ns)return ns.call(t)==ns.call(e)}return!1}(t,e,s,n,r,i,o);if(!(n&os)){var p=c&&ls.call(t,"__wrapped__"),f=d&&ls.call(e,"__wrapped__");if(p||f){var v=p?t.value():t,g=f?e.value():e;return o||(o=new va),i(v,g,n,r,o)}}return!!h&&(o||(o=new va),function(t,e,n,r,i,o){var a=n&rs,u=Oa(t),s=u.length;if(s!=Oa(e).length&&!a)return!1;for(var l=s;l--;){var c=u[l];if(!(a?c in e:is.call(e,c)))return!1}var d=o.get(t),h=o.get(e);if(d&&h)return d==e&&h==t;var p=!0;o.set(t,e),o.set(e,t);for(var f=a;++l<s;){var v=t[c=u[l]],g=e[c];if(r)var y=a?r(g,v,c,e,t,o):r(v,g,c,t,e,o);if(!(void 0===y?v===g||i(v,g,n,r,o):y)){p=!1;break}f||(f="constructor"==c)}if(p&&!f){var m=t.constructor,b=e.constructor;m==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof b&&b instanceof b||(p=!1)}return o.delete(t),o.delete(e),p}(t,e,n,r,i,o))}function ds(t,e,n,r,i){return t===e||(null==t||null==e||!Vt(t)&&!Vt(e)?t!=t&&e!=e:cs(t,e,n,r,ds,i))}var hs=1,ps=2;function fs(t,e,n,r){var i=n.length,o=i,a=!r;if(null==t)return!o;for(t=Object(t);i--;){var u=n[i];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++i<o;){var s=(u=n[i])[0],l=t[s],c=u[1];if(a&&u[2]){if(void 0===l&&!(s in t))return!1}else{var d=new va;if(r)var h=r(l,c,s,t,e,d);if(!(void 0===h?ds(c,l,hs|ps,r,d):h))return!1}}return!0}function vs(t){return t==t&&!le(t)}function gs(t){for(var e=ni(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,vs(i)]}return e}function ys(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}function ms(t){var e=gs(t);return 1==e.length&&e[0][2]?ys(e[0][0],e[0][1]):function(n){return n===t||fs(n,t,e)}}function bs(t,e){return null!=t&&e in Object(t)}function xs(t,e,n){for(var r=-1,i=(e=Ti(e,t)).length,o=!1;++r<i;){var a=ki(e[r]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&Nr(i)&&zn(a,i)&&(Jt(t)||Dr(t))}function _s(t,e){return null!=t&&xs(t,e,bs)}var ws=1,Ms=2;function Es(t,e){return pi(t)&&vs(e)?ys(ki(t),e):function(n){var r=Ii(n,t);return void 0===r&&r===e?_s(n,t):ds(e,r,ws|Ms)}}function Ns(t){return function(e){return null==e?void 0:e[t]}}function Ss(t){return pi(t)?Ns(ki(t)):function(t){return function(e){return ji(e,t)}}(t)}function As(t){return"function"==typeof t?t:null==t?xe:"object"==typeof t?Jt(t)?Es(t[0],t[1]):ms(t):Ss(t)}function Ps(t,e,n){var r=n.length;if(null==t)return!r;for(t=Object(t);r--;){var i=n[r],o=e[i],a=t[i];if(void 0===a&&!(i in t)||!o(a))return!1}return!0}function Os(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function Ts(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),u=a.length;u--;){var s=a[t?u:++i];if(!1===n(o[s],s,o))break}return e}}var Cs=Ts();function ks(t,e){return t&&Cs(t,e,ni)}function js(t,e){return function(n,r){if(null==n)return n;if(!Sr(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Object(n);(e?o--:++o<i)&&!1!==r(a[o],o,a););return n}}var Is=js(ks);function Rs(t,e,n,r){return Is(t,(function(t,i,o){e(r,t,n(t),o)})),r}function Ds(t,e){return function(n,r){var i=Jt(n)?Os:Rs,o=e?e():{};return i(n,t,As(r),o)}}var Ls=Object.prototype.hasOwnProperty,Bs=Ds((function(t,e,n){Ls.call(t,n)?++t[n]:gr(t,n,1)}));function zs(t,e,n){var r=pr(t,8,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return r.placeholder=zs.placeholder,r}zs.placeholder={};function Ws(t,e,n){var r=pr(t,16,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return r.placeholder=Ws.placeholder,r}Ws.placeholder={};var Fs=function(){return Rt.Date.now()},Gs="Expected a function",Hs=Math.max,Xs=Math.min;function Us(t,e,n){var r,i,o,a,u,s,l=0,c=!1,d=!1,h=!0;if("function"!=typeof t)throw new TypeError(Gs);function p(e){var n=r,o=i;return r=i=void 0,l=e,a=t.apply(o,n)}function f(t){var n=t-s;return void 0===s||n>=e||n<0||d&&t-l>=o}function v(){var t=Fs();if(f(t))return g(t);u=setTimeout(v,function(t){var n=e-(t-s);return d?Xs(n,o-(t-l)):n}(t))}function g(t){return u=void 0,h&&r?p(t):(r=i=void 0,a)}function y(){var t=Fs(),n=f(t);if(r=arguments,i=this,s=t,n){if(void 0===u)return function(t){return l=t,u=setTimeout(v,e),c?p(t):a}(s);if(d)return clearTimeout(u),u=setTimeout(v,e),p(s)}return void 0===u&&(u=setTimeout(v,e)),a}return e=ve(e)||0,le(n)&&(c=!!n.leading,o=(d="maxWait"in n)?Hs(ve(n.maxWait)||0,e):o,h="trailing"in n?!!n.trailing:h),y.cancel=function(){void 0!==u&&clearTimeout(u),l=0,r=s=i=u=void 0},y.flush=function(){return void 0===u?a:g(Fs())},y}var Vs=Object.prototype,Ys=Vs.hasOwnProperty,qs=Mr((function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&Ar(e[0],e[1],i)&&(r=1);++n<r;)for(var o=e[n],a=ui(o),u=-1,s=a.length;++u<s;){var l=a[u],c=t[l];(void 0===c||yr(c,Vs[l])&&!Ys.call(t,l))&&(t[l]=o[l])}return t}));function Zs(t,e,n){(void 0!==n&&!yr(t[e],n)||void 0===n&&!(e in t))&&gr(t,e,n)}function Ks(t){return Vt(t)&&Sr(t)}function $s(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function Js(t){return xr(t,ui(t))}function Qs(t,e,n,r,i){t!==e&&Cs(e,(function(o,a){if(i||(i=new va),le(o))!function(t,e,n,r,i,o,a){var u=$s(t,n),s=$s(e,n),l=a.get(s);if(l)Zs(t,n,l);else{var c=o?o(u,s,n+"",t,e,a):void 0,d=void 0===c;if(d){var h=Jt(s),p=!h&&Fr(s),f=!h&&!p&&Zr(s);c=s,h||p||f?Jt(u)?c=u:Ks(u)?c=un(u):p?(d=!1,c=_a(s,!0)):f?(d=!1,c=Ja(s,!0)):c=[]:Ki(s)||Dr(s)?(c=u,Dr(u)?c=Js(u):le(u)&&!Ne(u)||(c=bu(s))):d=!1}d&&(a.set(s,c),i(c,s,r,o,a),a.delete(s)),Zs(t,n,c)}}(t,e,a,n,Qs,r,i);else{var u=r?r($s(t,a),o,a+"",t,e,i):void 0;void 0===u&&(u=o),Zs(t,a,u)}}),ui)}function tl(t,e,n,r,i,o){return le(t)&&le(e)&&(o.set(e,t),Qs(t,e,void 0,tl,o),o.delete(e)),t}var el=Pr((function(t,e,n,r){Qs(t,e,n,r)})),nl=Mr((function(t){return t.push(void 0,tl),Ve(el,void 0,t)}));function rl(t,e,n){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,n)}),e)}var il=Mr((function(t,e){return rl(t,1,e)})),ol=Mr((function(t,e,n){return rl(t,ve(e)||0,n)}));function al(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}var ul=200;function sl(t,e,n,r){var i=-1,o=Sn,a=!0,u=t.length,s=[],l=e.length;if(!u)return s;n&&(e=$t(e,Hr(n))),r?(o=al,a=!1):e.length>=ul&&(o=Du,a=!1,e=new Iu(e));t:for(;++i<u;){var c=t[i],d=null==n?c:n(c);if(c=r||0!==c?c:0,a&&d==d){for(var h=l;h--;)if(e[h]===d)continue t;s.push(c)}else o(e,d,r)||s.push(c)}return s}var ll=Mr((function(t,e){return Ks(t)?sl(t,zi(e,1,Ks,!0)):[]}));function cl(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}var dl=Mr((function(t,e){var n=cl(e);return Ks(n)&&(n=void 0),Ks(t)?sl(t,zi(e,1,Ks,!0),As(n)):[]})),hl=Mr((function(t,e){var n=cl(e);return Ks(n)&&(n=void 0),Ks(t)?sl(t,zi(e,1,Ks,!0),void 0,n):[]})),pl=re((function(t,e){return t/e}),1);function fl(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?ao(t,r?0:o,r?o+1:i):ao(t,r?o+1:0,r?i:o)}function vl(t){return"function"==typeof t?t:xe}function gl(t,e){return(Jt(t)?wn:Is)(t,vl(e))}function yl(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}var ml=Ts(!0);function bl(t,e){return t&&ml(t,e,ni)}var xl=js(bl,!0);function _l(t,e){return(Jt(t)?yl:xl)(t,vl(e))}function wl(t){return function(e){var n=Ua(e);return"[object Map]"==n?Wu(e):"[object Set]"==n?function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}(e):function(t,e){return $t(e,(function(e){return[e,t[e]]}))}(e,t(e))}}var Ml=wl(ni),El=wl(ui),Nl=Po({"&":"&","<":"<",">":">",'"':""","'":"'"}),Sl=/[&<>"']/g,Al=RegExp(Sl.source);function Pl(t){return(t=Oi(t))&&Al.test(t)?t.replace(Sl,Nl):t}var Ol=/[\\^$.*+?()[\]{}|]/g,Tl=RegExp(Ol.source);function Cl(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function kl(t,e){var n=!0;return Is(t,(function(t,r,i){return n=!!e(t,r,i)})),n}var jl=4294967295;function Il(t){return t?fa(be(t),0,jl):0}function Rl(t,e){var n=[];return Is(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function Dl(t){return function(e,n,r){var i=Object(e);if(!Sr(e)){var o=As(n);e=ni(e),n=function(t){return o(i[t],t,i)}}var a=t(e,n,r);return a>-1?i[o?e[a]:a]:void 0}}var Ll=Math.max;function Bl(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:be(n);return i<0&&(i=Ll(r+i,0)),Mn(t,As(e),i)}var zl=Dl(Bl);function Wl(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}var Fl=Math.max,Gl=Math.min;function Hl(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return void 0!==n&&(i=be(n),i=n<0?Fl(r+i,0):Gl(i,r-1)),Mn(t,As(e),i,!0)}var Xl=Dl(Hl);function Ul(t){return t&&t.length?t[0]:void 0}function Vl(t,e){var n=-1,r=Sr(t)?Array(t.length):[];return Is(t,(function(t,i,o){r[++n]=e(t,i,o)})),r}function Yl(t,e){return(Jt(t)?$t:Vl)(t,As(e))}var ql=la("floor");function Zl(t){return Fi((function(e){var n=e.length,r=n,i=an.prototype.thru;for(t&&e.reverse();r--;){var o=e[r];if("function"!=typeof o)throw new TypeError("Expected a function");if(i&&!a&&"wrapper"==on(o))var a=new an([],!0)}for(r=a?r:n;++r<n;){var u=on(o=e[r]),s="wrapper"==u?en(o):void 0;a=s&&dn(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?a[on(s[0])].apply(a,s[3]):1==o.length&&dn(o)?a[u]():a.thru(o)}return function(){var t=arguments,r=t[0];if(a&&1==t.length&&Jt(r))return a.plant(r).value();for(var i=0,o=n?e[i].apply(this,t):r;++i<n;)o=e[i].call(this,o);return o}}))}var Kl=Zl(),$l=Zl(!0);function Jl(t,e){return wa(e,(function(e){return Ne(t[e])}))}var Ql=Object.prototype.hasOwnProperty,tc=Ds((function(t,e,n){Ql.call(t,n)?t[n].push(e):gr(t,n,[e])}));function ec(t,e){return t>e}function nc(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=ve(e),n=ve(n)),t(e,n)}}var rc=nc(ec),ic=nc((function(t,e){return t>=e})),oc=Object.prototype.hasOwnProperty;function ac(t,e){return null!=t&&oc.call(t,e)}function uc(t,e){return null!=t&&xs(t,e,ac)}var sc=Math.max,lc=Math.min;var cc="[object String]";function dc(t){return"string"==typeof t||!Jt(t)&&Vt(t)&&Ut(t)==cc}function hc(t,e){return $t(e,(function(e){return t[e]}))}function pc(t){return null==t?[]:hc(t,ni(t))}var fc=Math.max;var vc=Math.max;var gc=Math.min;function yc(t,e,n){for(var r=n?al:Sn,i=t[0].length,o=t.length,a=o,u=Array(o),s=1/0,l=[];a--;){var c=t[a];a&&e&&(c=$t(c,Hr(e))),s=gc(c.length,s),u[a]=!n&&(e||i>=120&&c.length>=120)?new Iu(a&&c):void 0}c=t[0];var d=-1,h=u[0];t:for(;++d<i&&l.length<s;){var p=c[d],f=e?e(p):p;if(p=n||0!==p?p:0,!(h?Du(h,f):r(l,f,n))){for(a=o;--a;){var v=u[a];if(!(v?Du(v,f):r(t[a],f,n)))continue t}h&&h.push(f),l.push(p)}}return l}function mc(t){return Ks(t)?t:[]}var bc=Mr((function(t){var e=$t(t,mc);return e.length&&e[0]===t[0]?yc(e):[]})),xc=Mr((function(t){var e=cl(t),n=$t(t,mc);return e===cl(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?yc(n,As(e)):[]})),_c=Mr((function(t){var e=cl(t),n=$t(t,mc);return(e="function"==typeof e?e:void 0)&&n.pop(),n.length&&n[0]===t[0]?yc(n,void 0,e):[]}));function wc(t,e){return function(n,r){return function(t,e,n,r){return ks(t,(function(t,i,o){e(r,n(t),i,o)})),r}(n,t,e(r),{})}}var Mc=Object.prototype.toString,Ec=wc((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Mc.call(e)),t[e]=n}),mn(xe)),Nc=Object.prototype,Sc=Nc.hasOwnProperty,Ac=Nc.toString,Pc=wc((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ac.call(e)),Sc.call(t,e)?t[e].push(n):t[e]=[n]}),As);function Oc(t,e){return e.length<2?t:ji(t,ao(e,0,-1))}function Tc(t,e,n){var r=null==(t=Oc(t,e=Ti(e,t)))?t:t[ki(cl(e))];return null==r?void 0:Ve(r,t,n)}var Cc=Mr(Tc),kc=Mr((function(t,e,n){var r=-1,i="function"==typeof e,o=Sr(t)?Array(t.length):[];return Is(t,(function(t){o[++r]=i?Ve(e,t,n):Tc(t,e,n)})),o}));var jc=Yr&&Yr.isArrayBuffer,Ic=jc?Hr(jc):function(t){return Vt(t)&&"[object ArrayBuffer]"==Ut(t)};var Rc=Yr&&Yr.isDate,Dc=Rc?Hr(Rc):function(t){return Vt(t)&&"[object Date]"==Ut(t)};var Lc=Object.prototype.hasOwnProperty;var Bc=Rt.isFinite;function zc(t){return"number"==typeof t&&t==be(t)}var Wc="[object Number]";function Fc(t){return"number"==typeof t||Vt(t)&&Ut(t)==Wc}var Gc=Ae?Ne:Lr;var Hc=Yr&&Yr.isRegExp,Xc=Hc?Hr(Hc):function(t){return Vt(t)&&"[object RegExp]"==Ut(t)},Uc=9007199254740991;var Vc=Array.prototype.join;var Yc=oa((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),qc=Ds((function(t,e,n){gr(t,n,e)}));var Zc=Math.max,Kc=Math.min;var $c=oa((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Jc=Eo("toLowerCase");function Qc(t,e){return t<e}var td=nc(Qc),ed=nc((function(t,e){return t<=e}));function nd(t,e,n){for(var r=-1,i=t.length;++r<i;){var o=t[r],a=e(o);if(null!=a&&(void 0===u?a==a&&!qt(a):n(a,u)))var u=a,s=o}return s}function rd(t,e){for(var n,r=-1,i=t.length;++r<i;){var o=e(t[r]);void 0!==o&&(n=void 0===n?o:n+o)}return n}var id=NaN;function od(t,e){var n=null==t?0:t.length;return n?rd(t,e)/n:id}var ad=Pr((function(t,e,n){Qs(t,e,n)})),ud=Mr((function(t,e){return function(n){return Tc(n,t,e)}})),sd=Mr((function(t,e){return function(n){return Tc(t,n,e)}}));function ld(t,e,n){var r=ni(e),i=Jl(e,r),o=!(le(n)&&"chain"in n&&!n.chain),a=Ne(t);return wn(i,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=un(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Di([this.value()],arguments))})})),t}var cd=re((function(t,e){return t*e}),1),dd="Expected a function";function hd(t){if("function"!=typeof t)throw new TypeError(dd);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}var pd="[object Map]",fd="[object Set]",vd=Dt?Dt.iterator:void 0;function gd(t){if(!t)return[];if(Sr(t))return dc(t)?Mo(t):un(t);if(vd&&t[vd])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[vd]());var e=Ua(t);return(e==pd?Wu:e==fd?Fu:pc)(t)}function yd(t,e){var n=t.length;if(n)return zn(e+=e<0?n:0,n)?t[e]:void 0}function md(t,e){return null==(t=Oc(t,e=Ti(e,t)))||delete t[ki(cl(e))]}function bd(t){return Ki(t)?void 0:t}var xd=Fi((function(t,e){var n={};if(null==t)return n;var r=!1;e=$t(e,(function(e){return e=Ti(e,t),r||(r=e.length>1),e})),xr(t,Ta(t),n),r&&(n=ku(n,7,bd));for(var i=e.length;i--;)md(n,e[i]);return n}));function _d(t,e,n,r){if(!le(t))return t;for(var i=-1,o=(e=Ti(e,t)).length,a=o-1,u=t;null!=u&&++i<o;){var s=ki(e[i]),l=n;if("__proto__"===s||"constructor"===s||"prototype"===s)return t;if(i!=a){var c=u[s];void 0===(l=r?r(c,s,u):void 0)&&(l=le(c)?c:zn(e[i+1])?[]:{})}br(u,s,l),u=u[s]}return t}function wd(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],u=ji(t,a);n(u,a)&&_d(o,Ti(a,t),u)}return o}function Md(t,e){if(null==t)return{};var n=$t(Ta(t),(function(t){return[t]}));return e=As(e),wd(t,n,(function(t,n){return e(t,n[0])}))}function Ed(t,e){if(t!==e){var n=void 0!==t,r=null===t,i=t==t,o=qt(t),a=void 0!==e,u=null===e,s=e==e,l=qt(e);if(!u&&!l&&!o&&t>e||o&&a&&s&&!u&&!l||r&&a&&s||!n&&s||!i)return 1;if(!r&&!o&&!l&&t<e||l&&n&&i&&!r&&!o||u&&n&&i||!a&&i||!s)return-1}return 0}function Nd(t,e,n){e=e.length?$t(e,(function(t){return Jt(t)?function(e){return ji(e,1===t.length?t[0]:t)}:t})):[xe];var r=-1;e=$t(e,Hr(As));var i=Vl(t,(function(t,n,i){var o=$t(e,(function(e){return e(t)}));return{criteria:o,index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(i,(function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,a=i.length,u=n.length;++r<a;){var s=Ed(i[r],o[r]);if(s)return r>=u?s:s*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function Sd(t){return Fi((function(e){return e=$t(e,Hr(As)),Mr((function(n){var r=this;return t(e,(function(t){return Ve(t,r,n)}))}))}))}var Ad=Sd($t),Pd=Mr,Od=Math.min,Td=Pd((function(t,e){var n=(e=1==e.length&&Jt(e[0])?$t(e[0],Hr(As)):$t(zi(e,1),Hr(As))).length;return Mr((function(r){for(var i=-1,o=Od(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return Ve(t,this,r)}))})),Cd=Sd(Cl),kd=Sd(Ru),jd=9007199254740991,Id=Math.floor;function Rd(t,e){var n="";if(!t||e<1||e>jd)return n;do{e%2&&(n+=t),(e=Id(e/2))&&(t+=t)}while(e);return n}var Dd=Ns("length"),Ld="\\ud800-\\udfff",Bd="["+Ld+"]",zd="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Wd="\\ud83c[\\udffb-\\udfff]",Fd="[^"+Ld+"]",Gd="(?:\\ud83c[\\udde6-\\uddff]){2}",Hd="[\\ud800-\\udbff][\\udc00-\\udfff]",Xd="(?:"+zd+"|"+Wd+")"+"?",Ud="[\\ufe0e\\ufe0f]?",Vd=Ud+Xd+("(?:\\u200d(?:"+[Fd,Gd,Hd].join("|")+")"+Ud+Xd+")*"),Yd="(?:"+[Fd+zd+"?",zd,Gd,Hd,Bd].join("|")+")",qd=RegExp(Wd+"(?="+Wd+")|"+Yd+Vd,"g");function Zd(t){return lo(t)?function(t){for(var e=qd.lastIndex=0;qd.test(t);)++e;return e}(t):Dd(t)}var Kd=Math.ceil;function $d(t,e){var n=(e=void 0===e?" ":ne(e)).length;if(n<2)return n?Rd(e,t):e;var r=Rd(e,Kd(t/Zd(e)));return lo(e)?uo(Mo(r),0,t).join(""):r.slice(0,t)}var Jd=Math.ceil,Qd=Math.floor;var th=/^\s+/,eh=Rt.parseInt;var nh=Mr((function(t,e){return pr(t,32,void 0,e,Gn(e,Dn(nh)))}));nh.placeholder={};var rh=Mr((function(t,e){return pr(t,64,void 0,e,Gn(e,Dn(rh)))}));rh.placeholder={};var ih=Ds((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var oh=Fi((function(t,e){return null==t?{}:function(t,e){return wd(t,e,(function(e,n){return _s(t,n)}))}(t,e)}));function ah(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}var uh=Array.prototype.splice;function sh(t,e,n,r){var i=r?ah:Nn,o=-1,a=e.length,u=t;for(t===e&&(e=un(e)),n&&(u=$t(t,Hr(n)));++o<a;)for(var s=0,l=e[o],c=n?n(l):l;(s=i(u,c,s,r))>-1;)u!==t&&uh.call(u,s,1),uh.call(t,s,1);return t}function lh(t,e){return t&&t.length&&e&&e.length?sh(t,e):t}var ch=Mr(lh);var dh=Array.prototype.splice;function hh(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;zn(i)?dh.call(t,i,1):md(t,i)}}return t}var ph=Fi((function(t,e){var n=null==t?0:t.length,r=Ri(t,e);return hh(t,$t(e,(function(t){return zn(t,n)?+t:t})).sort(Ed)),r})),fh=Math.floor,vh=Math.random;function gh(t,e){return t+fh(vh()*(e-t+1))}var yh=parseFloat,mh=Math.min,bh=Math.random;var xh=Math.ceil,_h=Math.max;function wh(t){return function(e,n,r){return r&&"number"!=typeof r&&Ar(e,n,r)&&(n=r=void 0),e=me(e),void 0===n?(n=e,e=0):n=me(n),function(t,e,n,r){for(var i=-1,o=_h(xh((e-t)/(n||1)),0),a=Array(o);o--;)a[r?o:++i]=t,t+=n;return a}(e,n,r=void 0===r?e<n?1:-1:me(r),t)}}var Mh=wh(),Eh=wh(!0),Nh=Fi((function(t,e){return pr(t,256,void 0,void 0,void 0,e)}));function Sh(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function Ah(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}var Ph=Array.prototype.reverse;function Oh(t){return null==t?t:Ph.call(t)}var Th=la("round");function Ch(t){var e=t.length;return e?t[gh(0,e-1)]:void 0}function kh(t){return Ch(pc(t))}function jh(t,e){var n=-1,r=t.length,i=r-1;for(e=void 0===e?r:e;++n<e;){var o=gh(n,i),a=t[o];t[o]=t[n],t[n]=a}return t.length=e,t}function Ih(t,e){return jh(un(t),fa(e,0,t.length))}function Rh(t,e){var n=pc(t);return jh(n,fa(e,0,n.length))}function Dh(t){return jh(un(t))}function Lh(t){return jh(pc(t))}var Bh=oa((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));function zh(t,e){var n;return Is(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}var Wh=Mr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&Ar(t,e[0],e[1])?e=[]:n>2&&Ar(e[0],e[1],e[2])&&(e=[e[0]]),Nd(t,zi(e,1),[])})),Fh=4294967294,Gh=Math.floor,Hh=Math.min;function Xh(t,e,n,r){var i=0,o=null==t?0:t.length;if(0===o)return 0;for(var a=(e=n(e))!=e,u=null===e,s=qt(e),l=void 0===e;i<o;){var c=Gh((i+o)/2),d=n(t[c]),h=void 0!==d,p=null===d,f=d==d,v=qt(d);if(a)var g=r||f;else g=l?f&&(r||h):u?f&&h&&(r||!p):s?f&&h&&!p&&(r||!v):!p&&!v&&(r?d<=e:d<e);g?i=c+1:o=c}return Hh(o,Fh)}var Uh=2147483647;function Vh(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=Uh){for(;r<i;){var o=r+i>>>1,a=t[o];null!==a&&!qt(a)&&(n?a<=e:a<e)?r=o+1:i=o}return i}return Xh(t,e,xe,n)}function Yh(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n],u=e?e(a):a;if(!n||!yr(u,s)){var s=u;o[i++]=0===a?0:a}}return o}var qh=Math.max;var Zh=oa((function(t,e,n){return t+(n?" ":"")+No(e)}));var Kh=re((function(t,e){return t-e}),0);var $h=Object.prototype,Jh=$h.hasOwnProperty;function Qh(t,e,n,r){return void 0===t||yr(t,$h[n])&&!Jh.call(r,n)?e:t}var tp={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function ep(t){return"\\"+tp[t]}var np=/<%=([\s\S]+?)%>/g,rp={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:np,variable:"",imports:{_:{escape:Pl}}},ip=/\b__p \+= '';/g,op=/\b(__p \+=) '' \+/g,ap=/(__e\(.*?\)|\b__t\)) \+\n'';/g,up=/[()=,{}\[\]\/\s]/,sp=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,lp=/($^)/,cp=/['\n\r\u2028\u2029\\]/g,dp=Object.prototype.hasOwnProperty;function hp(t,e){return e(t)}var pp=4294967295,fp=Math.min;function vp(t,e){var n=t;return n instanceof Qe&&(n=n.value()),Ao(e,(function(t,e){return e.func.apply(e.thisArg,Di([t],e.args))}),n)}function gp(){return vp(this.__wrapped__,this.__actions__)}var yp=9007199254740991;function mp(t,e){for(var n=t.length;n--&&Nn(e,t[n],0)>-1;);return n}function bp(t,e){for(var n=-1,r=t.length;++n<r&&Nn(e,t[n],0)>-1;);return n}var xp=/^\s+/;var _p=/\w*$/;var wp=Po({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Mp=/&(?:amp|lt|gt|quot|#39);/g,Ep=RegExp(Mp.source);var Np=ja&&1/Fu(new ja([,-0]))[1]==1/0?function(t){return new ja(t)}:tn,Sp=200;function Ap(t,e,n){var r=-1,i=Sn,o=t.length,a=!0,u=[],s=u;if(n)a=!1,i=al;else if(o>=Sp){var l=e?null:Np(t);if(l)return Fu(l);a=!1,i=Du,s=new Iu}else s=e?[]:u;t:for(;++r<o;){var c=t[r],d=e?e(c):c;if(c=n||0!==c?c:0,a&&d==d){for(var h=s.length;h--;)if(s[h]===d)continue t;e&&s.push(d),u.push(c)}else i(s,d,n)||(s!==u&&s.push(d),u.push(c))}return u}var Pp=Mr((function(t){return Ap(zi(t,1,Ks,!0))})),Op=Mr((function(t){var e=cl(t);return Ks(e)&&(e=void 0),Ap(zi(t,1,Ks,!0),As(e))})),Tp=Mr((function(t){var e=cl(t);return e="function"==typeof e?e:void 0,Ap(zi(t,1,Ks,!0),void 0,e)}));var Cp=0;var kp=Math.max;function jp(t){if(!t||!t.length)return[];var e=0;return t=wa(t,(function(t){if(Ks(t))return e=kp(t.length,e),!0})),Cr(e,(function(e){return $t(t,Ns(e))}))}function Ip(t,e){if(!t||!t.length)return[];var n=jp(t);return null==e?n:$t(n,(function(t){return Ve(e,void 0,t)}))}function Rp(t,e,n,r){return _d(t,e,n(ji(t,e)),r)}var Dp=oa((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}));var Lp=Mr((function(t,e){return Ks(t)?sl(t,e):[]}));var Bp=Fi((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return Ri(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Qe&&zn(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:hp,args:[i],thisArg:void 0}),new an(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(i)}));function zp(t,e,n){var r=t.length;if(r<2)return r?Ap(t[0]):[];for(var i=-1,o=Array(r);++i<r;)for(var a=t[i],u=-1;++u<r;)u!=i&&(o[i]=sl(o[i]||a,t[u],e,n));return Ap(zi(o,1),e,n)}var Wp=Mr((function(t){return zp(wa(t,Ks))})),Fp=Mr((function(t){var e=cl(t);return Ks(e)&&(e=void 0),zp(wa(t,Ks),As(e))})),Gp=Mr((function(t){var e=cl(t);return e="function"==typeof e?e:void 0,zp(wa(t,Ks),void 0,e)})),Hp=Mr(jp);function Xp(t,e,n){for(var r=-1,i=t.length,o=e.length,a={};++r<i;){var u=r<o?e[r]:void 0;n(a,t[r],u)}return a}var Up=Mr((function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,Ip(t,n)})),Vp={chunk:function(t,e,n){e=(n?Ar(t,e,n):void 0===e)?1:pa(be(e),0);var r=null==t?0:t.length;if(!r||e<1)return[];for(var i=0,o=0,a=Array(ha(r/e));i<r;)a[o++]=ao(t,i,i+=e);return a},compact:function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},concat:function(){var t=arguments.length;if(!t)return[];for(var e=Array(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return Di(Jt(n)?un(n):[n],zi(e,1))},difference:ll,differenceBy:dl,differenceWith:hl,drop:function(t,e,n){var r=null==t?0:t.length;return r?ao(t,(e=n||void 0===e?1:be(e))<0?0:e,r):[]},dropRight:function(t,e,n){var r=null==t?0:t.length;return r?ao(t,0,(e=r-(e=n||void 0===e?1:be(e)))<0?0:e):[]},dropRightWhile:function(t,e){return t&&t.length?fl(t,As(e),!0,!0):[]},dropWhile:function(t,e){return t&&t.length?fl(t,As(e),!0):[]},fill:function(t,e,n,r){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&Ar(t,e,n)&&(n=0,r=i),function(t,e,n,r){var i=t.length;for((n=be(n))<0&&(n=-n>i?0:i+n),(r=void 0===r||r>i?i:be(r))<0&&(r+=i),r=n>r?0:Il(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},findIndex:Bl,findLastIndex:Hl,first:Ul,flatten:Wi,flattenDeep:function(t){return(null==t?0:t.length)?zi(t,Infinity):[]},flattenDepth:function(t,e){return(null==t?0:t.length)?zi(t,e=void 0===e?1:be(e)):[]},fromPairs:function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},head:Ul,indexOf:function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:be(n);return i<0&&(i=vc(r+i,0)),Nn(t,e,i)},initial:function(t){return(null==t?0:t.length)?ao(t,0,-1):[]},intersection:bc,intersectionBy:xc,intersectionWith:_c,join:function(t,e){return null==t?"":Vc.call(t,e)},last:cl,lastIndexOf:function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=be(n))<0?Zc(r+i,0):Kc(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):Mn(t,En,i,!0)},nth:function(t,e){return t&&t.length?yd(t,be(e)):void 0},pull:ch,pullAll:lh,pullAllBy:function(t,e,n){return t&&t.length&&e&&e.length?sh(t,e,As(n)):t},pullAllWith:function(t,e,n){return t&&t.length&&e&&e.length?sh(t,e,void 0,n):t},pullAt:ph,remove:function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=As(e);++r<o;){var a=t[r];e(a,r,t)&&(n.push(a),i.push(r))}return hh(t,i),n},reverse:Oh,slice:function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&Ar(t,e,n)?(e=0,n=r):(e=null==e?0:be(e),n=void 0===n?r:be(n)),ao(t,e,n)):[]},sortedIndex:function(t,e){return Vh(t,e)},sortedIndexBy:function(t,e,n){return Xh(t,e,As(n))},sortedIndexOf:function(t,e){var n=null==t?0:t.length;if(n){var r=Vh(t,e);if(r<n&&yr(t[r],e))return r}return-1},sortedLastIndex:function(t,e){return Vh(t,e,!0)},sortedLastIndexBy:function(t,e,n){return Xh(t,e,As(n),!0)},sortedLastIndexOf:function(t,e){if(null==t?0:t.length){var n=Vh(t,e,!0)-1;if(yr(t[n],e))return n}return-1},sortedUniq:function(t){return t&&t.length?Yh(t):[]},sortedUniqBy:function(t,e){return t&&t.length?Yh(t,As(e)):[]},tail:function(t){var e=null==t?0:t.length;return e?ao(t,1,e):[]},take:function(t,e,n){return t&&t.length?ao(t,0,(e=n||void 0===e?1:be(e))<0?0:e):[]},takeRight:function(t,e,n){var r=null==t?0:t.length;return r?ao(t,(e=r-(e=n||void 0===e?1:be(e)))<0?0:e,r):[]},takeRightWhile:function(t,e){return t&&t.length?fl(t,As(e),!1,!0):[]},takeWhile:function(t,e){return t&&t.length?fl(t,As(e)):[]},union:Pp,unionBy:Op,unionWith:Tp,uniq:function(t){return t&&t.length?Ap(t):[]},uniqBy:function(t,e){return t&&t.length?Ap(t,As(e)):[]},uniqWith:function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Ap(t,void 0,e):[]},unzip:jp,unzipWith:Ip,without:Lp,xor:Wp,xorBy:Fp,xorWith:Gp,zip:Hp,zipObject:function(t,e){return Xp(t||[],e||[],br)},zipObjectDeep:function(t,e){return Xp(t||[],e||[],_d)},zipWith:Up},Yp={countBy:Bs,each:gl,eachRight:_l,every:function(t,e,n){var r=Jt(t)?Cl:kl;return n&&Ar(t,e,n)&&(e=void 0),r(t,As(e))},filter:function(t,e){return(Jt(t)?wa:Rl)(t,As(e))},find:zl,findLast:Xl,flatMap:function(t,e){return zi(Yl(t,e),1)},flatMapDeep:function(t,e){return zi(Yl(t,e),Infinity)},flatMapDepth:function(t,e,n){return n=void 0===n?1:be(n),zi(Yl(t,e),n)},forEach:gl,forEachRight:_l,groupBy:tc,includes:function(t,e,n,r){t=Sr(t)?t:pc(t),n=n&&!r?be(n):0;var i=t.length;return n<0&&(n=fc(i+n,0)),dc(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Nn(t,e,n)>-1},invokeMap:kc,keyBy:qc,map:Yl,orderBy:function(t,e,n,r){return null==t?[]:(Jt(e)||(e=null==e?[]:[e]),Jt(n=r?void 0:n)||(n=null==n?[]:[n]),Nd(t,e,n))},partition:ih,reduce:function(t,e,n){var r=Jt(t)?Ao:Sh,i=arguments.length<3;return r(t,As(e),n,i,Is)},reduceRight:function(t,e,n){var r=Jt(t)?Ah:Sh,i=arguments.length<3;return r(t,As(e),n,i,xl)},reject:function(t,e){return(Jt(t)?wa:Rl)(t,hd(As(e)))},sample:function(t){return(Jt(t)?Ch:kh)(t)},sampleSize:function(t,e,n){return e=(n?Ar(t,e,n):void 0===e)?1:be(e),(Jt(t)?Ih:Rh)(t,e)},shuffle:function(t){return(Jt(t)?Dh:Lh)(t)},size:function(t){if(null==t)return 0;if(Sr(t))return dc(t)?Zd(t):t.length;var e=Ua(t);return"[object Map]"==e||"[object Set]"==e?t.size:ei(t).length},some:function(t,e,n){var r=Jt(t)?Ru:zh;return n&&Ar(t,e,n)&&(e=void 0),r(t,As(e))},sortBy:Wh},qp=Fs,Zp={after:function(t,e){if("function"!=typeof e)throw new TypeError("Expected a function");return t=be(t),function(){if(--t<1)return e.apply(this,arguments)}},ary:vr,before:no,bind:ro,bindKey:oo,curry:zs,curryRight:Ws,debounce:Us,defer:il,delay:ol,flip:function(t){return pr(t,512)},memoize:Ni,negate:hd,once:function(t){return no(2,t)},overArgs:Td,partial:nh,partialRight:rh,rearg:Nh,rest:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return Mr(t,e=void 0===e?e:be(e))},spread:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return e=null==e?0:qh(be(e),0),Mr((function(n){var r=n[e],i=uo(n,0,e);return r&&Di(i,r),Ve(t,this,i)}))},throttle:function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return le(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Us(t,e,{leading:r,maxWait:e,trailing:i})},unary:function(t){return vr(t,1)},wrap:function(t,e){return nh(vl(e),t)}},Kp={castArray:function(){if(!arguments.length)return[];var t=arguments[0];return Jt(t)?t:[t]},clone:function(t){return ku(t,4)},cloneDeep:ju,cloneDeepWith:function(t,e){return ku(t,5,e="function"==typeof e?e:void 0)},cloneWith:function(t,e){return ku(t,4,e="function"==typeof e?e:void 0)},conformsTo:function(t,e){return null==e||Ps(t,e,ni(e))},eq:yr,gt:rc,gte:ic,isArguments:Dr,isArray:Jt,isArrayBuffer:Ic,isArrayLike:Sr,isArrayLikeObject:Ks,isBoolean:function(t){return!0===t||!1===t||Vt(t)&&"[object Boolean]"==Ut(t)},isBuffer:Fr,isDate:Dc,isElement:function(t){return Vt(t)&&1===t.nodeType&&!Ki(t)},isEmpty:function(t){if(null==t)return!0;if(Sr(t)&&(Jt(t)||"string"==typeof t||"function"==typeof t.splice||Fr(t)||Zr(t)||Dr(t)))return!t.length;var e=Ua(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(Tr(t))return!ei(t).length;for(var n in t)if(Lc.call(t,n))return!1;return!0},isEqual:function(t,e){return ds(t,e)},isEqualWith:function(t,e,n){var r=(n="function"==typeof n?n:void 0)?n(t,e):void 0;return void 0===r?ds(t,e,void 0,n):!!r},isError:Qi,isFinite:function(t){return"number"==typeof t&&Bc(t)},isFunction:Ne,isInteger:zc,isLength:Nr,isMap:_u,isMatch:function(t,e){return t===e||fs(t,e,gs(e))},isMatchWith:function(t,e,n){return n="function"==typeof n?n:void 0,fs(t,e,gs(e),n)},isNaN:function(t){return Fc(t)&&t!=+t},isNative:function(t){if(Gc(t))throw new Error("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Le(t)},isNil:function(t){return null==t},isNull:function(t){return null===t},isNumber:Fc,isObject:le,isObjectLike:Vt,isPlainObject:Ki,isRegExp:Xc,isSafeInteger:function(t){return zc(t)&&t>=-9007199254740991&&t<=Uc},isSet:Mu,isString:dc,isSymbol:qt,isTypedArray:Zr,isUndefined:function(t){return void 0===t},isWeakMap:function(t){return Vt(t)&&"[object WeakMap]"==Ua(t)},isWeakSet:function(t){return Vt(t)&&"[object WeakSet]"==Ut(t)},lt:td,lte:ed,toArray:gd,toFinite:me,toInteger:be,toLength:Il,toNumber:ve,toPlainObject:Js,toSafeInteger:function(t){return t?fa(be(t),-9007199254740991,yp):0===t?t:0},toString:Oi},$p={add:ie,ceil:ca,divide:pl,floor:ql,max:function(t){return t&&t.length?nd(t,xe,ec):void 0},maxBy:function(t,e){return t&&t.length?nd(t,As(e),ec):void 0},mean:function(t){return od(t,xe)},meanBy:function(t,e){return od(t,As(e))},min:function(t){return t&&t.length?nd(t,xe,Qc):void 0},minBy:function(t,e){return t&&t.length?nd(t,As(e),Qc):void 0},multiply:cd,round:Th,subtract:Kh,sum:function(t){return t&&t.length?rd(t,xe):0},sumBy:function(t,e){return t&&t.length?rd(t,As(e)):0}},Jp=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=ve(n))==n?n:0),void 0!==e&&(e=(e=ve(e))==e?e:0),fa(ve(t),e,n)},Qp=function(t,e,n){return e=me(e),void 0===n?(n=e,e=0):n=me(n),function(t,e,n){return t>=lc(e,n)&&t<sc(e,n)}(t=ve(t),e,n)},tf=function(t,e,n){if(n&&"boolean"!=typeof n&&Ar(t,e,n)&&(e=n=void 0),void 0===n&&("boolean"==typeof e?(n=e,e=void 0):"boolean"==typeof t&&(n=t,t=void 0)),void 0===t&&void 0===e?(t=0,e=1):(t=me(t),void 0===e?(e=t,t=0):e=me(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var i=bh();return mh(t+i*(e-t+yh("1e-"+((i+"").length-1))),e)}return gh(t,e)},ef={assign:ii,assignIn:si,assignInWith:li,assignWith:ci,at:Gi,create:function(t,e){var n=He(t);return null==e?n:ga(n,e)},defaults:qs,defaultsDeep:nl,entries:Ml,entriesIn:El,extend:si,extendWith:li,findKey:function(t,e){return Wl(t,As(e),ks)},findLastKey:function(t,e){return Wl(t,As(e),bl)},forIn:function(t,e){return null==t?t:Cs(t,vl(e),ui)},forInRight:function(t,e){return null==t?t:ml(t,vl(e),ui)},forOwn:function(t,e){return t&&ks(t,vl(e))},forOwnRight:function(t,e){return t&&bl(t,vl(e))},functions:function(t){return null==t?[]:Jl(t,ni(t))},functionsIn:function(t){return null==t?[]:Jl(t,ui(t))},get:Ii,has:uc,hasIn:_s,invert:Ec,invertBy:Pc,invoke:Cc,keys:ni,keysIn:ui,mapKeys:function(t,e){var n={};return e=As(e),ks(t,(function(t,r,i){gr(n,e(t,r,i),t)})),n},mapValues:function(t,e){var n={};return e=As(e),ks(t,(function(t,r,i){gr(n,r,e(t,r,i))})),n},merge:ad,mergeWith:el,omit:xd,omitBy:function(t,e){return Md(t,hd(As(e)))},pick:oh,pickBy:Md,result:function(t,e,n){var r=-1,i=(e=Ti(e,t)).length;for(i||(i=1,t=void 0);++r<i;){var o=null==t?void 0:t[ki(e[r])];void 0===o&&(r=i,o=n),t=Ne(o)?o.call(t):o}return t},set:function(t,e,n){return null==t?t:_d(t,e,n)},setWith:function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:_d(t,e,n,r)},toPairs:Ml,toPairsIn:El,transform:function(t,e,n){var r=Jt(t),i=r||Fr(t)||Zr(t);if(e=As(e),null==n){var o=t&&t.constructor;n=i?r?new o:[]:le(t)&&Ne(o)?He(Hi(t)):{}}return(i?wn:ks)(t,(function(t,r,i){return e(n,t,r,i)})),n},unset:function(t,e){return null==t||md(t,e)},update:function(t,e,n){return null==t?t:Rp(t,e,vl(n))},updateWith:function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:Rp(t,e,vl(n),r)},values:pc,valuesIn:function(t){return null==t?[]:hc(t,ui(t))}},nf={at:Bp,chain:da,commit:function(){return new an(this.value(),this.__chain__)},lodash:cn,next:function(){void 0===this.__values__&&(this.__values__=gd(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},plant:function(t){for(var e,n=this;n instanceof $e;){var r=sn(n);r.__index__=0,r.__values__=void 0,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},reverse:function(){var t=this.__wrapped__;if(t instanceof Qe){var e=t;return this.__actions__.length&&(e=new Qe(this)),(e=e.reverse()).__actions__.push({func:hp,args:[Oh],thisArg:void 0}),new an(e,this.__chain__)}return this.thru(Oh)},tap:function(t,e){return e(t),t},thru:hp,toIterator:function(){return this},toJSON:gp,value:gp,valueOf:gp,wrapperChain:function(){return da(this)}},rf={camelCase:aa,capitalize:So,deburr:ko,endsWith:function(t,e,n){t=Oi(t),e=ne(e);var r=t.length,i=n=void 0===n?r:fa(be(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},escape:Pl,escapeRegExp:function(t){return(t=Oi(t))&&Tl.test(t)?t.replace(Ol,"\\$&"):t},kebabCase:Yc,lowerCase:$c,lowerFirst:Jc,pad:function(t,e,n){t=Oi(t);var r=(e=be(e))?Zd(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return $d(Qd(i),n)+t+$d(Jd(i),n)},padEnd:function(t,e,n){t=Oi(t);var r=(e=be(e))?Zd(t):0;return e&&r<e?t+$d(e-r,n):t},padStart:function(t,e,n){t=Oi(t);var r=(e=be(e))?Zd(t):0;return e&&r<e?$d(e-r,n)+t:t},parseInt:function(t,e,n){return n||null==e?e=0:e&&(e=+e),eh(Oi(t).replace(th,""),e||0)},repeat:function(t,e,n){return e=(n?Ar(t,e,n):void 0===e)?1:be(e),Rd(Oi(t),e)},replace:function(){var t=arguments,e=Oi(t[0]);return t.length<3?e:e.replace(t[1],t[2])},snakeCase:Bh,split:function(t,e,n){return n&&"number"!=typeof n&&Ar(t,e,n)&&(e=n=void 0),(n=void 0===n?4294967295:n>>>0)?(t=Oi(t))&&("string"==typeof e||null!=e&&!Xc(e))&&!(e=ne(e))&&lo(t)?uo(Mo(t),0,n):t.split(e,n):[]},startCase:Zh,startsWith:function(t,e,n){return t=Oi(t),n=null==n?0:fa(be(n),0,t.length),e=ne(e),t.slice(n,n+e.length)==e},template:function(t,e,n){var r=rp.imports._.templateSettings||rp;n&&Ar(t,e,n)&&(e=void 0),t=Oi(t),e=li({},e,r,Qh);var i,o,a=li({},e.imports,r.imports,Qh),u=ni(a),s=hc(a,u),l=0,c=e.interpolate||lp,d="__p += '",h=RegExp((e.escape||lp).source+"|"+c.source+"|"+(c===np?sp:lp).source+"|"+(e.evaluate||lp).source+"|$","g"),p=dp.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(h,(function(e,n,r,a,u,s){return r||(r=a),d+=t.slice(l,s).replace(cp,ep),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),u&&(o=!0,d+="';\n"+u+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=s+e.length,e})),d+="';\n";var f=dp.call(e,"variable")&&e.variable;if(f){if(up.test(f))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(ip,""):d).replace(op,"$1").replace(ap,"$1;"),d="function("+(f||"obj")+") {\n"+(f?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var v=to((function(){return Function(u,p+"return "+d).apply(void 0,s)}));if(v.source=d,Qi(v))throw v;return v},templateSettings:rp,toLower:function(t){return Oi(t).toLowerCase()},toUpper:function(t){return Oi(t).toUpperCase()},trim:function(t,e,n){if((t=Oi(t))&&(n||void 0===e))return se(t);if(!t||!(e=ne(e)))return t;var r=Mo(t),i=Mo(e);return uo(r,bp(r,i),mp(r,i)+1).join("")},trimEnd:function(t,e,n){if((t=Oi(t))&&(n||void 0===e))return t.slice(0,ae(t)+1);if(!t||!(e=ne(e)))return t;var r=Mo(t);return uo(r,0,mp(r,Mo(e))+1).join("")},trimStart:function(t,e,n){if((t=Oi(t))&&(n||void 0===e))return t.replace(xp,"");if(!t||!(e=ne(e)))return t;var r=Mo(t);return uo(r,bp(r,Mo(e))).join("")},truncate:function(t,e){var n=30,r="...";if(le(e)){var i="separator"in e?e.separator:i;n="length"in e?be(e.length):n,r="omission"in e?ne(e.omission):r}var o=(t=Oi(t)).length;if(lo(t)){var a=Mo(t);o=a.length}if(n>=o)return t;var u=n-Zd(r);if(u<1)return r;var s=a?uo(a,0,u).join(""):t.slice(0,u);if(void 0===i)return s+r;if(a&&(u+=s.length-u),Xc(i)){if(t.slice(u).search(i)){var l,c=s;for(i.global||(i=RegExp(i.source,Oi(_p.exec(i))+"g")),i.lastIndex=0;l=i.exec(c);)var d=l.index;s=s.slice(0,void 0===d?u:d)}}else if(t.indexOf(ne(i),u)!=u){var h=s.lastIndexOf(i);h>-1&&(s=s.slice(0,h))}return s+r},unescape:function(t){return(t=Oi(t))&&Ep.test(t)?t.replace(Mp,wp):t},upperCase:Dp,upperFirst:No,words:ra},of={attempt:to,bindAll:io,cond:function(t){var e=null==t?0:t.length,n=As;return t=e?$t(t,(function(t){if("function"!=typeof t[1])throw new TypeError("Expected a function");return[n(t[0]),t[1]]})):[],Mr((function(n){for(var r=-1;++r<e;){var i=t[r];if(Ve(i[0],this,n))return Ve(i[1],this,n)}}))},conforms:function(t){return function(t){var e=ni(t);return function(n){return Ps(n,t,e)}}(ku(t,1))},constant:mn,defaultTo:function(t,e){return null==t||t!=t?e:t},flow:Kl,flowRight:$l,identity:xe,iteratee:function(t){return As("function"==typeof t?t:ku(t,1))},matches:function(t){return ms(ku(t,1))},matchesProperty:function(t,e){return Es(t,ku(e,1))},method:ud,methodOf:sd,mixin:ld,noop:tn,nthArg:function(t){return t=be(t),Mr((function(e){return yd(e,t)}))},over:Ad,overEvery:Cd,overSome:kd,property:Ss,propertyOf:function(t){return function(e){return null==t?void 0:ji(t,e)}},range:Mh,rangeRight:Eh,stubArray:Ma,stubFalse:Lr,stubObject:function(){return{}},stubString:function(){return""},stubTrue:function(){return!0},times:function(t,e){if((t=be(t))<1||t>9007199254740991)return[];var n=pp,r=fp(t,pp);e=vl(e),t-=pp;for(var i=Cr(r,e);++n<t;)e(n);return i},toPath:function(t){return Jt(t)?$t(t,ki):qt(t)?[t]:un(Pi(Oi(t)))},uniqueId:function(t){var e=++Cp;return Oi(t)+e}};var af=Math.max,uf=Math.min;var sf=Math.min;
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@logicflow/core")):"function"==typeof define&&define.amd?define(["exports","@logicflow/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Extension={},t.Core)}(this,(function(t,e){"use strict";var n=40,r=40,i=40,o=40,a=40,u=40,s=100,l=80,c=100,d=80,h={rect:{radius:5,stroke:"rgb(24, 125, 255)"},circle:{r:18,stroke:"rgb(24, 125, 255)"},polygon:{stroke:"rgb(24, 125, 255)"},polyline:{stroke:"rgb(24, 125, 255)",hoverStroke:"rgb(24, 125, 255)",selectedStroke:"rgb(24, 125, 255)"},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"white",height:14,stroke:"transparent",radius:3}}},p=function(t,e){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},p(t,e)};function f(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var v=function(){return v=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},v.apply(this,arguments)};function g(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function y(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{s(r.next(t))}catch(t){o(t)}}function u(t){try{s(r.throw(t))}catch(t){o(t)}}function s(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,u)}s((r=r.apply(t,e||[])).next())}))}function m(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(s){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&u[0]?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){a.label=u[1];break}if(6===u[0]&&a.label<i[1]){a.label=i[1],i=u;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(u);break}i[2]&&a.ops.pop(),a.trys.pop();continue}u=e.call(t,a)}catch(t){u=[6,t],r=0}finally{n=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}}function b(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function x(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function _(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var w=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))},t.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},t}(),M=(null===globalThis||void 0===globalThis?void 0:globalThis._ids)||new w;function E(){return M.next()}var N=function(t){function e(e,n){return e.id||(e.id="Event_".concat(E())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),t.call(this,e,n)||this}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedTargetRules=function(){var e=t.prototype.getConnectedTargetRules.call(this);return e.push({message:"起始节点不能作为边的终点",validate:function(){return!1}}),e},e.extendKey="StartEventModel",e}(e.CircleNodeModel),S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.extendKey="StartEventNode",e}(e.CircleNode),A={type:"bpmn:startEvent",view:S,model:N},P=function(t){function e(e,n){return e.id||(e.id="Event_".concat(E())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),t.call(this,e,n)||this}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedSourceRules=function(){var e=t.prototype.getConnectedSourceRules.call(this);return e.push({message:"结束节点不能作为边的起点",validate:function(){return!1}}),e},e.extendKey="EndEventModel",e}(e.CircleNodeModel),T=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},n.prototype.getShape=function(){var n=this.props.model,r=n.getNodeStyle(),i=n,o=i.x,a=i.y,u=i.r,s=t.prototype.getShape.call(this);return e.h("g",{},s,e.h("circle",v(v({},r),{cx:o,cy:a,r:u-5})))},n.extendKey="EndEventView",n}(e.CircleNode),k={type:"bpmn:endEvent",view:T,model:P},C=function(t){function e(e,n){return e.id||(e.id="Flow_".concat(E())),t.call(this,e,n)||this}return f(e,t),e.extendKey="SequenceFlowModel",e}(e.PolylineEdgeModel),O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.extendKey="SequenceFlowEdge",e}(e.PolylineEdge),I={type:"bpmn:sequenceFlow",view:O,model:C},j=function(t){function e(e,n){var r=this;return e.id||(e.id="Gateway_".concat(E())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),(r=t.call(this,e,n)||this).points=[[25,0],[50,25],[25,50],[0,25]],r}return f(e,t),e.extendKey="ExclusiveGatewayModel",e}(e.PolygonNodeModel),R=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getShape=function(){var t=this.props.model,n=t,r=n.x,i=n.y,o=n.width,a=n.height,u=n.points,s=t.getNodeStyle();return e.h("g",{transform:"matrix(1 0 0 1 ".concat(r-o/2," ").concat(i-a/2,")")},e.h("polygon",v(v({},s),{x:r,y:i,points:u})),e.h("path",v({d:"m 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z"},s)))},n.extendKey="ExclusiveGatewayNode",n}(e.PolygonNode),D={type:"bpmn:exclusiveGateway",view:R,model:j},L=function(t){function e(e,n){return e.id||(e.id="Activity_".concat(E())),t.call(this,e,n)||this}return f(e,t),e.extendKey="ServiceTaskModel",e}(e.RectNodeModel),B=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getLabelShape=function(){var t=this.props.model,n=t.x,r=t.y,i=t.width,o=t.height,a=t.getNodeStyle();return e.h("svg",{x:n-i/2+5,y:r-o/2+5,width:30,height:30,viewBox:"0 0 1274 1024"},e.h("path",{fill:a.stroke,d:"M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z"}))},n.prototype.getShape=function(){var t=this.props.model,n=t.x,r=t.y,i=t.width,o=t.height,a=t.radius,u=t.getNodeStyle();return e.h("g",{},[e.h("rect",v({x:n-i/2,y:r-o/2,rx:a,ry:a,width:i,height:o},u)),this.getLabelShape()])},n.extendKey="ServiceTaskNode",n}(e.RectNode),z={type:"bpmn:serviceTask",view:B,model:L},W=function(t){function e(e,n){return e.id||(e.id="Activity_".concat(E())),t.call(this,e,n)||this}return f(e,t),e.extendKey="UserTaskModel",e}(e.RectNodeModel),F=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getLabelShape=function(){var t=this.props.model,n=t.x,r=t.y,i=t.width,o=t.height,a=t.getNodeStyle();return e.h("svg",{x:n-i/2+5,y:r-o/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},e.h("path",{fill:a.stroke,d:"M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z"}))},n.prototype.getShape=function(){var t=this.props.model,n=t.x,r=t.y,i=t.width,o=t.height,a=t.radius,u=t.getNodeStyle();return e.h("g",{},[e.h("rect",v(v({},u),{x:n-i/2,y:r-o/2,rx:a,ry:a,width:i,height:o})),this.getLabelShape()])},n.extendKey="UserTaskNode",n}(e.RectNode),G={type:"bpmn:userTask",view:F,model:W},H={pluginName:"bpmnElement",install:function(t){t.setTheme(h),t.register(A),t.register(k),t.register(D),t.register(G),t.register(z),t.options.customBpmnEdge||(t.register(I),t.setDefaultEdgeType("bpmn:sequenceFlow"))}},X=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))},t.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},t}(),U=(null===globalThis||void 0===globalThis?void 0:globalThis._ids)||new X;function V(){return U.next()}function q(t){return Object.prototype.toString.call(t)}function Y(t){var e=t;return"[object Object]"===q(t)?(e={},Object.keys(t).forEach((function(n){var r=n;"-"===n.charAt(0)&&(r=n.substring(1)),e[r]=Y(t[n])}))):Array.isArray(t)&&(e=[],t.forEach((function(t,n){e[n]=Y(t)}))),e}var Z="\t\n";function K(t,e,n){var r=function(t){return" ".repeat(t)}(n),i="";if("#text"===e)return Z+r+t;if("#cdata-section"===e)return Z+r+"<![CDATA["+t+"]]>";if("#comment"===e)return Z+r+"\x3c!--"+t+"--\x3e";if("-"==="".concat(e).charAt(0))return" "+e.substring(1)+'="'+function(t){var e=t;try{"string"!=typeof e&&(e=JSON.parse(t))}catch(n){e=JSON.stringify(Y(t)).replace(/"/g,"'")}return e}(t)+'"';if(Array.isArray(t))t.forEach((function(t){i+=K(t,e,n+1)}));else if("[object Object]"===q(t)){var o=Object.keys(t),a="",u="";i+=(0===n?"":Z+r)+"<"+e,o.forEach((function(e){"-"===e.charAt(0)?a+=K(t[e],e,n+1):u+=K(t[e],e,n+1)})),i+=a+(""!==u?">".concat(u).concat(Z+r,"</").concat(e,">"):" />")}else i+=Z+r+"<".concat(e,">").concat(t.toString(),"</").concat(e,">");return i}function $(t){var e="";for(var n in t)e+=K(t[n],n,0);return e}var J=function(){};(J.ObjTree=function(){return this}).VERSION="0.23",J.ObjTree.prototype.xmlDecl='<?xml version="1.0" encoding="UTF-8" ?>\n',J.ObjTree.prototype.attr_prefix="-",J.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,r=n.parseFromString(t,"application/xml");if(!r)return;e=r.documentElement}else window.ActiveXObject&&((n=new ActiveXObject("Microsoft.XMLDOM")).async=!1,n.loadXML(t),e=n.documentElement);if(e)return this.parseDOM(e)},J.ObjTree.prototype.parseHTTP=function(t,e,n){var r,i={};for(var o in e)i[o]=e[o];if(i.method||(void 0===i.postBody&&void 0===i.postbody&&void 0===i.parameters?i.method="get":i.method="post"),n){i.asynchronous=!0;var a=this,u=n,s=i.onComplete;i.onComplete=function(t){var e;t&&t.responseXML&&t.responseXML.documentElement&&(e=a.parseDOM(t.responseXML.documentElement)),u(e,t),s&&s(t)}}else i.asynchronous=!1;if("undefined"!=typeof HTTP&&HTTP.Request)i.uri=t,(l=new HTTP.Request(i))&&(r=l.transport);else if("undefined"!=typeof Ajax&&Ajax.Request){var l;(l=new Ajax.Request(t,i))&&(r=l.transport)}return n?r:r&&r.responseXML&&r.responseXML.documentElement?this.parseDOM(r.responseXML.documentElement):void 0},J.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),11!=t.nodeType){var r={};r[t.nodeName]=n,n=r}return n}},J.ObjTree.prototype.parseElement=function(t){if(7!=t.nodeType){if(3==t.nodeType||4==t.nodeType||8==t.nodeType){if(null==t.nodeValue.match(/[^\x00-\x20]/))return;return t.nodeValue}var e=null,n={};if(t.attributes&&t.attributes.length){e={};for(var r=0;r<t.attributes.length;r++){if("string"==typeof(u=t.attributes[r].nodeName)){var i=t.attributes[r].nodeValue;try{i=JSON.parse(t.attributes[r].nodeValue.replace(/'/g,'"'))}catch(e){i=t.attributes[r].nodeValue}i&&(void 0===n[u=this.attr_prefix+u]&&(n[u]=0),n[u]++,this.addNode(e,u,n[u],i))}}}if(t.childNodes&&t.childNodes.length){var o=!0;e&&(o=!1);for(r=0;r<t.childNodes.length&&o;r++){var a=t.childNodes[r].nodeType;3!=a&&4!=a&&8!=a&&(o=!1)}if(o){e||(e="");for(r=0;r<t.childNodes.length;r++)e+=t.childNodes[r].nodeValue}else{e||(e={});for(r=0;r<t.childNodes.length;r++){var u;if("string"==typeof(u=t.childNodes[r].nodeName))(i=this.parseElement(t.childNodes[r]))&&(void 0===n[u]&&(n[u]=0),n[u]++,this.addNode(e,u,n[u],i))}}}else null===e&&(e={});return e}},J.ObjTree.prototype.addNode=function(t,e,n,r){this.__force_array[e]?(1==n&&(t[e]=[]),t[e][t[e].length]=r):1==n?t[e]=r:2==n?t[e]=[t[e],r]:t[e][t[e].length]=r},J.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e},J.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],r=[];for(var i in e)if(e.hasOwnProperty(i)){var o=e[i];i.charAt(0)!=this.attr_prefix?void 0===o||null==o?n[n.length]="<"+i+" />":"object"==typeof o&&o.constructor==Array?n[n.length]=this.array_to_xml(i,o):n[n.length]="object"==typeof o?this.hash_to_xml(i,o):this.scalar_to_xml(i,o):r[r.length]=" "+i.substring(1)+'="'+this.xml_escape(o)+'"'}var a=r.join(""),u=n.join("");return void 0===t||null==t||(u=n.length>0?u.match(/\n/)?"<"+t+a+">\n"+u+"</"+t+">\n":"<"+t+a+">"+u+"</"+t+">\n":"<"+t+a+" />\n"),u},J.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],r=0;r<e.length;r++){var i=e[r];void 0===i||null==i?n[n.length]="<"+t+" />":"object"==typeof i&&i.constructor==Array?n[n.length]=this.array_to_xml(t,i):n[n.length]="object"==typeof i?this.hash_to_xml(t,i):this.scalar_to_xml(t,i)}return n.join("")},J.ObjTree.prototype.scalar_to_xml=function(t,e){return"#text"==t?this.xml_escape(e):"<"+t+">"+this.xml_escape(e)+"</"+t+">\n"},J.ObjTree.prototype.xml_escape=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};var Q,tt=function(t){return(new J.ObjTree).parseXML(t)};!function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow"}(Q||(Q={}));var et=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef"],nt=["properties","startPoint","endPoint","pointsList"];function rt(t){var e=t?nt.concat(t):nt;return function(t){return function t(n){var r={};return"string"==typeof n?n:Array.isArray(n)?n.map((function(e){return t(e)})):(Object.entries(n).forEach((function(n){var i=x(n,2),o=i[0],a=i[1];"object"!=typeof a?0===o.indexOf("-")||["#text","#cdata-section","#comment"].includes(o)?r[o]=a:r["-".concat(o)]=a:e.includes(o)?r["-".concat(o)]=t(a):r[o]=t(a)})),r)}(t)}}function it(t){var e={};return Object.entries(t).forEach((function(t){var n=x(t,2),r=n[0],i=n[1];0===r.indexOf("-")?e[r.substring(1)]=Y(i):"string"==typeof i?e[r]=i:"[object Object]"===Object.prototype.toString.call(i)?e[r]=it(i):Array.isArray(i)?e[r]=i.map((function(t){return it(t)})):e[r]=i})),e}function ot(t,e){t["bpmndi:BPMNEdge"]=e.edges.map((function(t){var e,n=t.id,r=t.pointsList.map((function(t){return{"-x":t.x,"-y":t.y}})),i={"-id":"".concat(n,"_di"),"-bpmnElement":n,"di:waypoint":r};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(i["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),i})),t["bpmndi:BPMNShape"]=e.nodes.map((function(t){var e,n=t.id,r=100,i=80,o=t.x,a=t.y,u=lt.shapeConfigMap.get(t.type);u&&(r=u.width,i=u.height),o-=r/2,a-=i/2;var s={"-id":"".concat(n,"_di"),"-bpmnElement":n,"dc:Bounds":{"-x":o,"-y":a,"-width":r,"-height":i}};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(s["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),s}))}function at(t){var e=[],n=[],r=t["bpmn:definitions"];if(r){var i=r["bpmn:process"];Object.keys(i).forEach((function(t){if(0===t.indexOf("bpmn:")){var o=i[t];if(t===Q.FLOW){var a=r["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];n=function(t,e){var n=[];if(Array.isArray(t))t.forEach((function(t){var r;r=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(st(r,t))}));else{var r=void 0;r=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(st(r,t))}return n}(o,a)}else{var u=r["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];e=e.concat(function(t,e,n){var r=[];if(Array.isArray(t))t.forEach((function(t){var i=ut(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);r.push(i)}));else{var i=ut(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);r.push(i)}return r}(o,u,t))}}}))}return{nodes:e,edges:n}}function ut(t,e,n){var r,i,o=Number(t["dc:Bounds"]["-x"]),a=Number(t["dc:Bounds"]["-y"]),u=n["-name"],s=lt.shapeConfigMap.get(e);if(s&&(o+=s.width/2,a+=s.height/2),Object.entries(n).forEach((function(t){var e=x(t,2),n=e[0],i=e[1];-1===et.indexOf(n)&&(r||(r={}),r[n]=i)})),r&&(r=it(r)),u&&(i={x:o,y:a,value:u},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var l=t["bpmndi:BPMNLabel"]["dc:Bounds"];i.x=Number(l["-x"])+Number(l["-width"])/2,i.y=Number(l["-y"])+Number(l["-height"])/2}var c={id:t["-bpmnElement"],type:e,x:o,y:a,properties:r};return i&&(c.text=i),c}function st(t,e){var n,r,i=e["-name"];if(i){var o=t["bpmndi:BPMNLabel"]["dc:Bounds"],a=0;i.split("\n").forEach((function(t){a<t.length&&(a=t.length)})),n={value:i,x:Number(o["-x"])+10*a/2,y:Number(o["-y"])+7}}Object.entries(e).forEach((function(t){var e=x(t,2),n=e[0],i=e[1];-1===et.indexOf(n)&&(r||(r={}),r[n]=i)})),r&&(r=it(r));var u={id:e["-id"],type:Q.FLOW,pointsList:t["di:waypoint"].map((function(t){return{x:Number(t["-x"]),y:Number(t["-y"])}})),sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:r};return n&&(u.text=n),u}var lt=function(){function t(t){var e=t.lf,n=this;this.adapterOut=function(t,e){var r=v({},n.processAttributes);!function(t,e,n){var r=new Map;e.nodes.forEach((function(e){var i,o={"-id":e.id};if((null===(i=e.text)||void 0===i?void 0:i.value)&&(o["-name"]=e.text.value),e.properties){var a=rt(n)(e.properties);Object.assign(o,a)}r.set(e.id,o),t[e.type]?Array.isArray(t[e.type])?t[e.type].push(o):t[e.type]=[t[e.type],o]:t[e.type]=o}));var i=e.edges.map((function(t){var e,i,o=r.get(t.targetNodeId);o["bpmn:incoming"]?Array.isArray(o["bpmn:incoming"])?o["bpmn:incoming"].push(t.id):o["bpmn:incoming"]=[o["bpmn:incoming"],t.id]:o["bpmn:incoming"]=t.id;var a={"-id":t.id,"-sourceRef":t.sourceNodeId,"-targetRef":t.targetNodeId};if((null===(e=t.text)||void 0===e?void 0:e.value)&&(a["-name"]=null===(i=t.text)||void 0===i?void 0:i.value),t.properties){var u=rt(n)(t.properties);Object.assign(a,u)}return a}));e.edges.forEach((function(t){var e=r.get(t.sourceNodeId);e["bpmn:outgoing"]?Array.isArray(e["bpmn:outgoing"])?e["bpmn:outgoing"].push(t.id):e["bpmn:outgoing"]=[e["bpmn:outgoing"],t.id]:e["bpmn:outgoing"]=t.id})),t[Q.FLOW]=i}(r,t,e);var i={"-id":"BPMNPlane_1","-bpmnElement":r["-id"]};ot(i,t);var o=n.definitionAttributes;return o["bpmn:process"]=r,o["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":i},{"bpmn:definitions":o}},this.adapterIn=function(t){if(t)return at(t)},e.adapterIn=function(t){return n.adapterIn(t)},e.adapterOut=function(t,e){return n.adapterOut(t,e)},this.processAttributes={"-isExecutable":"true","-id":"Process_".concat(V())},this.definitionAttributes={"-id":"Definitions_".concat(V()),"-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","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.0"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t}();lt.shapeConfigMap.set(Q.START,{width:n,height:r}),lt.shapeConfigMap.set(Q.END,{width:i,height:o}),lt.shapeConfigMap.set(Q.GATEWAY,{width:a,height:u}),lt.shapeConfigMap.set(Q.SYSTEM,{width:s,height:l}),lt.shapeConfigMap.set(Q.USER,{width:c,height:d});var ct=function(t){function e(e){var n=t.call(this,e)||this;n.adapterXmlIn=function(t){var e=tt(t);return n.adapterIn(e)},n.adapterXmlOut=function(t,e){return $(n.adapterOut(t,e))};var r=e.lf;return r.adapterIn=n.adapterXmlIn,r.adapterOut=n.adapterXmlOut,n}return f(e,t),e.pluginName="bpmnXmlAdapter",e}(lt);function dt(){this.targetRules.push({message:"分组外的节点不允许连接分组内的",validate:function(t,e){var n=!!t.properties.parent,r=!!e.properties.parent;return!(!n&&r)}})}var ht=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))},t.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},t}(),pt=(null===globalThis||void 0===globalThis?void 0:globalThis._ids)||new ht;function ft(){return pt.next()}var vt=Object.freeze({__proto__:null,genBpmnId:ft,groupRule:dt});function gt(t){var n=x(t.useDefinition(),1)[0],r=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return f(r,t),r.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},r.prototype.getShape=function(){var r,i=this.props.model,o=i.getNodeStyle(),a=i,u=a.x,s=a.y,l=a.r,c=a.width,d=a.height,h=a.properties,p=t.prototype.getShape.call(this),f=h.definitionType,g=((null===(r=n.endEvent)||void 0===r?void 0:r.get(f))||{}).icon,y=Array.isArray(g)?e.h.apply(void 0,_(["g",{transform:"matrix(1 0 0 1 ".concat(u-c/2," ").concat(s-d/2,")")}],x(g),!1)):e.h("path",{transform:"matrix(1 0 0 1 ".concat(u-c/2," ").concat(s-d/2,")"),d:g,style:"fill: black; stroke-linecap: round; stroke-linejoin: round; stroke: white; stroke-width: 1px;"});return e.h("g",{},p,e.h("circle",v(v({},o),{strokeWidth:2,cx:u,cy:s,r:l-2})),y)},r}(e.CircleNode),i=function(t){function e(e,r){var i,o,a,u;e.id||(e.id="Event_".concat(ft())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40});var s=((null===(o=n.endEvent)||void 0===o?void 0:o.get(null===(a=e.properties)||void 0===a?void 0:a.definitionType))||{}).properties,l=void 0===s?{}:s;return e.properties=v(v({},l),e.properties),(null===(u=e.properties)||void 0===u?void 0:u.definitionType)&&(e.properties.definitionId="Definition_".concat(ft())),i=t.call(this,e,r)||this,dt.call(i),i}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedSourceRules=function(){var e=this,n=t.prototype.getConnectedSourceRules.call(this),r={message:"结束节点不能作为边的起点",validate:function(t,n){return console.log("_target",n),t!==e}};return n.push(r),n},e}(e.CircleNodeModel);return{type:"bpmn:endEvent",view:r,model:i}}function yt(t){var n=x(t.useDefinition(),1)[0],r=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return f(r,t),r.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},r.prototype.getShape=function(){var t,r=this.props.model,i=r.getNodeStyle(),o=r,a=o.x,u=o.y,s=o.r,l=o.width,c=o.height,d=o.properties.definitionType,h=((null===(t=n.intermediateCatchEvent)||void 0===t?void 0:t.get(d))||{}).icon,p=Array.isArray(h)?e.h.apply(void 0,_(["g",{transform:"matrix(1 0 0 1 ".concat(a-l/2," ").concat(u-c/2,")")}],x(h),!1)):e.h("path",{transform:"matrix(1 0 0 1 ".concat(a-l/2," ").concat(u-c/2,")"),d:h});return e.h("g",{},e.h("circle",v(v({},i),{cx:a,cy:u,r:s,strokeWidth:1.5})),e.h("circle",v(v({},i),{cx:a,cy:u,r:s-3,strokeWidth:1.5})),p)},r}(e.CircleNode),i=function(t){function e(e,r){var i,o,a,u;e.id||(e.id="Event_".concat(ft())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40});var s=((null===(o=n.intermediateCatchEvent)||void 0===o?void 0:o.get(null===(a=e.properties)||void 0===a?void 0:a.definitionType))||{}).properties,l=void 0===s?{}:s;return e.properties=v(v({},l),e.properties),(null===(u=e.properties)||void 0===u?void 0:u.definitionType)&&(e.properties.definitionId="Definition_".concat(ft())),i=t.call(this,e,r)||this,dt.call(i),i}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e}(e.CircleNodeModel);return{type:"bpmn:intermediateCatchEvent",view:r,model:i}}function mt(t){var n=x(t.useDefinition(),1)[0],r=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return f(r,t),r.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},r.prototype.getShape=function(){var t,r=this.props.model,i=r.getNodeStyle(),o=r,a=o.x,u=o.y,s=o.r,l=o.width,c=o.height,d=o.properties,h=d.definitionType,p=d.isInterrupting,f=((null===(t=n.startEvent)||void 0===t?void 0:t.get(h))||{}).icon,g=Array.isArray(f)?e.h.apply(void 0,_(["g",{transform:"matrix(1 0 0 1 ".concat(a-l/2," ").concat(u-c/2,")")}],x(f),!1)):e.h("path",{transform:"matrix(1 0 0 1 ".concat(a-l/2," ").concat(u-c/2,")"),d:f,style:"fill: white; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"});return e.h("g",{},e.h("circle",v(v({},i),{cx:a,cy:u,r:s,strokeDasharray:p?"5,5":"",strokeWidth:2})),g)},r}(e.CircleNode),i=function(t){function e(e,r){var i,o,a;e.id||(e.id="Event_".concat(ft())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40});var u=((null===(i=n.startEvent)||void 0===i?void 0:i.get(null===(o=e.properties)||void 0===o?void 0:o.definitionType))||{}).properties,s=void 0===u?{}:u;return e.properties=v(v({},s),e.properties),(null===(a=e.properties)||void 0===a?void 0:a.definitionType)&&(e.properties.definitionId="Definition_".concat(ft())),t.call(this,e,r)||this}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedTargetRules=function(){var e=this,n=t.prototype.getConnectedTargetRules.call(this),r={message:"起始节点不能作为边的终点",validate:function(t,n){return n!==e}};return n.push(r),n},e}(e.CircleNodeModel);return{type:"bpmn:startEvent",view:r,model:i}}function bt(t){var n=x(t.useDefinition(),1)[0],r=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return f(r,t),r.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},r.prototype.getShape=function(){var t,r=this.props.model,i=r.getNodeStyle(),o=r,a=o.x,u=o.y,s=o.r,l=o.width,c=o.height,d=o.properties,h=d.definitionType,p=d.cancelActivity,f=((null===(t=n.boundaryEvent)||void 0===t?void 0:t.get(h))||{}).icon,g=Array.isArray(f)?e.h.apply(void 0,_(["g",{transform:"matrix(1 0 0 1 ".concat(a-l/2," ").concat(u-c/2,")")}],x(f),!1)):e.h("path",{transform:"matrix(1 0 0 1 ".concat(a-l/2," ").concat(u-c/2,")"),d:f});return e.h("g",{},e.h("circle",v(v({},i),{cx:a,cy:u,r:s,strokeDasharray:p?"":"5,5",strokeWidth:1.5})),e.h("circle",v(v({},i),{cx:a,cy:u,r:s-3,strokeDasharray:p?"":"5,5",strokeWidth:1.5})),g)},r}(e.CircleNode),i=function(t){function e(e,r){var i,o,a,u;e.id||(e.id="Event_".concat(ft())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40});var s=((null===(o=n.boundaryEvent)||void 0===o?void 0:o.get(null===(a=e.properties)||void 0===a?void 0:a.definitionType))||{}).properties,l=void 0===s?{}:s;return e.properties=v(v({attachedToRef:"",cancelActivity:!0},l),e.properties),(null===(u=e.properties)||void 0===u?void 0:u.definitionType)&&(e.properties.definitionId="Definition_".concat(ft())),i=t.call(this,e,r)||this,dt.call(i),i}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.r=20,this.autoToFront=!1,this.zIndex=99999},e.prototype.setAttributes=function(){this.r=18},e}(e.CircleNodeModel);return{type:"bpmn:boundaryEvent",view:r,model:i}}function xt(t){var n=x(t.useDefinition(),1)[0],r=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return f(r,t),r.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},r.prototype.getShape=function(){var t,r=this.props.model,i=r.getNodeStyle(),o=r,a=o.x,u=o.y,s=o.r,l=o.width,c=o.height,d=o.properties.definitionType,h=((null===(t=n.intermediateThrowEvent)||void 0===t?void 0:t.get(d))||{}).icon,p=Array.isArray(h)?e.h.apply(void 0,_(["g",{transform:"matrix(1 0 0 1 ".concat(a-l/2," ").concat(u-c/2,")")}],x(h),!1)):e.h("path",{transform:"matrix(1 0 0 1 ".concat(a-l/2," ").concat(u-c/2,")"),d:h,style:"fill: black"});return e.h("g",{},e.h("circle",v(v({},i),{cx:a,cy:u,r:s,strokeWidth:1.5})),e.h("circle",v(v({},i),{cx:a,cy:u,r:s-3,strokeWidth:1.5})),p)},r}(e.CircleNode),i=function(t){function e(e,r){var i,o,a,u;e.id||(e.id="Event_".concat(ft())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40});var s=((null===(o=n.intermediateThrowEvent)||void 0===o?void 0:o.get(null===(a=e.properties)||void 0===a?void 0:a.definitionType))||{}).properties,l=void 0===s?{}:s;return e.properties=v(v({},l),e.properties),(null===(u=e.properties)||void 0===u?void 0:u.definitionType)&&(e.properties.definitionId="Definition_".concat(ft())),i=t.call(this,e,r)||this,dt.call(i),i}return f(e,t),e.prototype.setAttributes=function(){this.r=18},e}(e.CircleNodeModel);return{type:"bpmn:intermediateThrowEvent",view:r,model:i}}var _t=[e.h("circle",{cx:18,cy:18,r:11,style:"stroke-linecap: round;stroke-linejoin: round;stroke: rgb(34, 36, 42);stroke-width: 2px;fill: white"}),e.h("path",{d:"M 18,18 l 2.25,-7.5 m -2.25,7.5 l 5.25,1.5",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(0,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(30,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(60,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(90,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(120,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(150,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(180,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(210,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(240,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(270,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(300,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"}),e.h("path",{d:"M 18,18 m 0,7.5 l -0,2.25",transform:"rotate(330,18,18)",style:"fill: none; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"})],wt=[e.h("circle",{cx:18,cy:18,r:10,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 4px; fill: rgb(34, 36, 42);"})],Mt="m 16,15 7.42857142857143,9.714285714285715 -7.42857142857143,9.714285714285715 3.428571428571429,0 5.714285714285715,-7.464228571428572 5.714285714285715,7.464228571428572 3.428571428571429,0 -7.42857142857143,-9.714285714285715 7.42857142857143,-9.714285714285715 -3.428571428571429,0 -5.714285714285715,7.464228571428572 -5.714285714285715,-7.464228571428572 -3.428571428571429,0 z",Et="m 23,10 0,12.5 -12.5,0 0,5 12.5,0 0,12.5 5,0 0,-12.5 12.5,0 0,-5 -12.5,0 0,-12.5 -5,0 z",Nt=e.h("circle",{cx:25,cy:25,r:13,style:"stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 2.5px; fill: white;"}),St="M882.527918 434.149934c-2.234901-5.303796-7.311523-8.853645-13.059434-9.138124l-61.390185-3.009544c-6.635117-20.973684-15.521508-41.175795-26.513864-60.282968l42.051745-47.743374c4.308119-4.889357 4.955872-12.004405 1.602498-17.59268-46.384423-77.30362-103.969956-101.422947-106.400309-102.410438-5.332449-2.170432-11.432377-1.090844-15.693424 2.77009L654.674467 240.664222c-17.004279-8.654101-35.092239-15.756869-53.995775-21.210068l-3.26537-66.490344c-0.280386-5.747911-3.833305-10.824533-9.134031-13.059434-1.683339-0.709151-30.193673-12.391215-76.866668-12.051477-46.672996-0.339738-75.18333 11.342326-76.866668 12.051477-5.300726 2.234901-8.853645 7.311523-9.134031 13.059434l-3.26537 66.490344c-18.903535 5.453199-36.991496 12.555967-53.995775 21.210068l-48.450479-43.922349c-4.261047-3.860934-10.360975-4.940522-15.693424-2.77009-2.430352 0.98749-60.015885 25.106818-106.400309 102.410438-3.353374 5.588275-2.705622 12.703323 1.602498 17.59268l42.051745 47.743374c-10.992355 19.107173-19.878746 39.309284-26.513864 60.282968l-61.390185 3.009544c-5.747911 0.284479-10.824533 3.834328-13.059434 9.138124-1.01512 2.415003-24.687262 60.190871-2.822278 147.651828 1.583055 6.324032 7.072069 10.893094 13.57518 11.308557 5.892197 0.37146 11.751648 0.523933 17.419741 0.667196 14.498202 0.372483 28.193109 0.723477 40.908712 4.63353 4.212952 1.294482 6.435573 8.270361 9.349949 18.763342 1.287319 4.640694 2.617617 9.43693 4.484128 14.010085 1.794879 4.393054 3.75758 8.570189 5.66093 12.607132 1.302669 2.765997 2.529613 5.380544 3.689019 8.018627 2.986007 6.803963 2.682086 9.773598 2.578732 10.349719-3.061732 3.672646-6.391571 7.238868-9.91379 11.015891-1.810229 1.943258-3.680832 3.949962-5.523807 5.980201l-22.560832 24.8909c-3.865028 4.261047-4.940522 10.365068-2.774183 15.693424 0.991584 2.426259 25.102724 60.011792 102.414531 106.400309 5.588275 3.353374 12.703323 2.701528 17.591657-1.603521l23.476691-20.682042c2.346441-2.061962 4.64888-4.336772 6.875594-6.534833 9.05319-8.93858 14.018272-12.95608 17.73185-11.576663 3.305279 1.222851 6.907317 3.166109 10.720156 5.228071 3.325745 1.794879 6.764054 3.650133 10.465352 5.288446 6.016017 2.662643 12.120039 4.688789 18.019399 6.65149 6.827499 2.266623 13.279445 4.409426 18.819624 7.275707 1.518586 0.782829 1.926886 0.994654 2.358721 7.830339 0.726547 11.496845 1.25048 23.276123 1.753947 34.672684 0.264013 5.900384 0.528026 11.803837 0.815575 17.700127 0.284479 5.743818 3.833305 10.82044 9.138124 13.05534 1.654686 0.698918 29.371958 12.063757 74.869175 12.063757 0.328481 0 3.65832 0 3.986801 0 45.497217 0 73.214489-11.364839 74.869175-12.063757 5.304819-2.234901 8.853645-7.311523 9.138124-13.05534 0.287549-5.89629 0.551562-11.799744 0.815575-17.700127 0.503467-11.396561 1.027399-23.175839 1.753947-34.672684 0.431835-6.835685 0.840134-7.04751 2.358721-7.830339 5.54018-2.866281 11.992125-5.009084 18.819624-7.275707 5.89936-1.962701 12.003382-3.988848 18.019399-6.65149 3.701299-1.638313 7.139607-3.493567 10.465352-5.288446 3.812839-2.061962 7.414877-4.00522 10.720156-5.228071 3.713578-1.379417 8.67866 2.638083 17.73185 11.576663 2.226714 2.198062 4.529153 4.472871 6.875594 6.534833l23.476691 20.682042c4.888334 4.305049 12.003382 4.956895 17.591657 1.603521 77.311807-46.388517 101.422947-103.97405 102.414531-106.400309 2.166339-5.328355 1.090844-11.432377-2.774183-15.693424l-22.560832-24.8909c-1.842974-2.030239-3.713578-4.036943-5.523807-5.980201-3.52222-3.777023-6.852058-7.343245-9.91379-11.015891-0.103354-0.576121-0.407276-3.545756 2.578732-10.349719 1.159406-2.638083 2.38635-5.252631 3.689019-8.018627 1.90335-4.036943 3.866051-8.214079 5.66093-12.607132 1.866511-4.573155 3.196809-9.369392 4.484128-14.010085 2.914376-10.492982 5.136997-17.46886 9.349949-18.763342 12.715603-3.910053 26.41051-4.261047 40.908712-4.63353 5.668093-0.143263 11.527544-0.295735 17.419741-0.667196 6.503111-0.415462 11.992125-4.984524 13.57518-11.308557C907.21518 494.340805 883.543038 436.564937 882.527918 434.149934zM643.49894 643.761929c-35.280528 35.280528-82.191954 54.711066-132.086317 54.711066s-96.806813-19.430538-132.086317-54.711066c-35.280528-35.279504-54.711066-82.191954-54.711066-132.086317 0-49.894364 19.430538-96.80272 54.711066-132.082224 35.283598-35.284621 82.191954-54.711066 132.086317-54.711066s96.80579 19.426445 132.086317 54.711066c35.279504 35.279504 54.711066 82.187861 54.711066 132.082224C698.210006 561.569976 678.782537 608.482425 643.49894 643.761929z",At="M655.807326 287.35973m-223.989415 0a218.879 218.879 0 1 0 447.978829 0 218.879 218.879 0 1 0-447.978829 0ZM1039.955839 895.482975c-0.490184-212.177424-172.287821-384.030443-384.148513-384.030443-211.862739 0-383.660376 171.85302-384.15056 384.030443L1039.955839 895.482975z",Pt="m44,60 m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",Tt="m47,61 m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",kt="m 50,73 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",Ct=Object.freeze({__proto__:null,compensationIcon:"m 7.92,18 9,-6.5 0,13 z m 9.3,-0.4 8.7,-6.1 0,13 -8.7,-6.1 z",conditionalIcon:"M 10.5,8.5 l 14.5,0 l 0,18 l -14.5,0 Z M 12.5,11.5 l 10.5,0 M 12.5,14.5 l 10.5,0 M 12.5,17.5 l 10.5,0 M 12.5,20.5 l 10.5,0 M 12.5,23.5 l 10.5,0 M 12.5,26.5 l 10.5,0 ",errorIcon:"m 7.2,25.991999999999997 0.09350000000000001,-0.025300000000000003 7.3392,-9.610700000000001 7.667000000000001,8.9661 4.7003,-18.2204 -5.8707,11.6501 -7.299600000000001,-9.585400000000002 z",escalationIcon:"M 18,7.2 l 8,20 l -8,-7 l -8,7 Z",exclusiveIcon:Mt,inclusiveIcon:Nt,linkIcon:"m 20.52,9.468 0,4.4375 -13.5,0 0,6.75 13.5,0 0,4.4375 9.84375,-7.8125 -9.84375,-7.8125 z",loopMarker:kt,manualTaskIcon:"M0.5,3.751L4.583,0.5009999999999999C4.583,0.5009999999999999,15.749,0.5839999999999999,16.666,0.5839999999999999S14.249,3.5009999999999994,15.166,3.5009999999999994S26.833,3.5009999999999994,27.75,3.5009999999999994C28.916,5.209,27.582,6.667999999999999,26.916,7.167999999999999S27.791,9.084999999999999,25.916,11.584999999999999C25.166,11.834999999999999,26.666,13.459999999999999,24.583000000000002,14.918C23.416,15.501,25.166,16.46,23.333000000000002,17.750999999999998C22.166,17.750999999999998,2.5000000000000036,17.833999999999996,2.5000000000000036,17.833999999999996L0.5000000000000036,16.500999999999998V3.751ZM13.5,7L27,7M13.5,11L26,11M14,14.5L25,14.5M8.2,3.1L15,3.1",messageIcon:"m 8.459999999999999,11.34 l 0,12.6 l 18.900000000000002,0 l 0,-12.6 z l 9.450000000000001,5.4 l 9.450000000000001,-5.4",parallelIcon:Et,parallelMarker:Pt,scriptTaskIcon:"M6.402,0.5H20.902C20.902,0.5,15.069,3.333,15.069,6.083S19.486,12.083,19.486,15.25S15.319,20.333,15.319,20.333H0.235C0.235,20.333,5.235,17.665999999999997,5.235,15.332999999999998S0.6520000000000001,8.582999999999998,0.6520000000000001,6.082999999999998S6.402,0.5,6.402,0.5ZM3.5,4.5L13.5,4.5M3.8,8.5L13.8,8.5M6.3,12.5L16.3,12.5M6.5,16.5L16.5,16.5",sequentialMarker:Tt,serviceTaskIcon:St,signalIcon:"M 18,7.2 l 9,16.2 l -18,0 Z",style:{throw:"fill: rgb(34, 36, 42); stroke-linecap: round; stroke-linejoin: round; stroke: white; stroke-width: 1px;",catch:"fill: white; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;",nonIntermediate:"stroke-width: 1.5; stroke-dash-array: 6",intermediate:"stroke-width: 1.5"},terminateIcon:wt,timerIcon:_t,userTaskIcon:At});function Ot(t,n,r){var i=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return f(r,t),r.prototype.getShape=function(){var t=this.props.model,r=t,i=r.x,o=r.y,a=r.width,u=r.height,s=r.points,l=t.getNodeStyle();return e.h("g",{transform:"matrix(1 0 0 1 ".concat(i-a/2," ").concat(o-u/2,")")},e.h(e.Polygon,v(v({},l),{x:i,y:o,points:s})),"string"==typeof n?e.h("path",v(v({d:n},l),{fill:"rgb(34, 36, 42)",strokeWidth:1})):n)},r}(e.PolygonNode);return{type:t,view:i,model:function(t){function e(e,n){var i=this;return e.id||(e.id="Gateway_".concat(ft())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),e.properties=v(v({},r||{}),e.properties),(i=t.call(this,e,n)||this).points=[[25,0],[50,25],[25,50],[0,25]],dt.call(i),i}return f(e,t),e}(e.PolygonNodeModel)}}var It={parallel:Pt,sequential:Tt,loop:kt};function jt(t,n,r){var i=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return f(r,t),r.prototype.getLabelShape=function(){var t=this.props.model,r=t.x,i=t.y,o=t.width,a=t.height,u=t.getNodeStyle(),s=Array.isArray(n)?e.h.apply(void 0,_(["g",{transform:"matrix(1 0 0 1 ".concat(r-o/2," ").concat(i-a/2,")")}],x(n),!1)):e.h("path",{fill:u.stroke,d:n});return e.h("svg",{x:r-o/2+5,y:i-a/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},s)},r.prototype.getShape=function(){var t=this.props.model,n=t.x,r=t.y,i=t.width,o=t.height,a=t.radius,u=t.properties,s=t.getNodeStyle();return e.h("g",{},[e.h("rect",v(v({},s),{x:n-i/2,y:r-o/2,rx:a,ry:a,width:i,height:o,opacity:.95})),this.getLabelShape(),e.h("g",{transform:"matrix(1 0 0 1 ".concat(n-i/2," ").concat(r-o/2,")")},e.h("path",{fill:"white",strokeLinecap:"round",strokeLinejoin:"round",stroke:"rgb(34, 36, 42)",strokeWidth:"2",d:It[u.multiInstanceType]||""}))])},r}(e.RectNode),o=function(t){function e(e,n){var i,o=this;e.id||(e.id="Activity_".concat(ft()));var a=v(v({},r||{}),e.properties);return e.properties=a,o=t.call(this,e,n)||this,null===(i=null==a?void 0:a.boundaryEvents)||void 0===i||i.forEach((function(t){o.addBoundaryEvent(t)})),o.deleteProperty("boundaryEvents"),dt.call(o),o}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.isTaskNode=!0,this.boundaryEvents=[]},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this);return this.properties.isBoundaryEventTouchingTask&&(e.stroke="#00acff",e.strokeWidth=2),e},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return e.stroke="transparent",!e.hover&&(e.hover={}),e.hover.stroke="transparent",e},e.prototype.setTouching=function(t){this.setProperty("isBoundaryEventTouchingTask",t)},e.prototype.addBoundaryEvent=function(t){if(this.setTouching(!1),this.boundaryEvents.find((function(e){return e===t})))return!1;var e=this.graphModel.getNodeModelById(t);return null==e||e.setProperties({attachedToRef:this.id}),this.boundaryEvents.push(t),!0},e.prototype.deleteBoundaryEvent=function(t){this.boundaryEvents=this.boundaryEvents.filter((function(e){return e!==t}))},e}(e.RectNodeModel);return{type:t,view:i,model:o}}var Rt="object"==typeof global&&global&&global.Object===Object&&global,Dt="object"==typeof self&&self&&self.Object===Object&&self,Lt=Rt||Dt||Function("return this")(),Bt=Lt.Symbol,zt=Object.prototype,Wt=zt.hasOwnProperty,Ft=zt.toString,Gt=Bt?Bt.toStringTag:void 0;var Ht=Object.prototype.toString;var Xt="[object Null]",Ut="[object Undefined]",Vt=Bt?Bt.toStringTag:void 0;function qt(t){return null==t?void 0===t?Ut:Xt:Vt&&Vt in Object(t)?function(t){var e=Wt.call(t,Gt),n=t[Gt];try{t[Gt]=void 0;var r=!0}catch(t){}var i=Ft.call(t);return r&&(e?t[Gt]=n:delete t[Gt]),i}(t):function(t){return Ht.call(t)}(t)}function Yt(t){return null!=t&&"object"==typeof t}var Zt="[object Symbol]";function Kt(t){return"symbol"==typeof t||Yt(t)&&qt(t)==Zt}var $t=NaN;function Jt(t){return"number"==typeof t?t:Kt(t)?$t:+t}function Qt(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var te=Array.isArray,ee=1/0,ne=Bt?Bt.prototype:void 0,re=ne?ne.toString:void 0;function ie(t){if("string"==typeof t)return t;if(te(t))return Qt(t,ie)+"";if(Kt(t))return re?re.call(t):"";var e=t+"";return"0"==e&&1/t==-ee?"-0":e}function oe(t,e){return function(n,r){var i;if(void 0===n&&void 0===r)return e;if(void 0!==n&&(i=n),void 0!==r){if(void 0===i)return r;"string"==typeof n||"string"==typeof r?(n=ie(n),r=ie(r)):(n=Jt(n),r=Jt(r)),i=t(n,r)}return i}}var ae=oe((function(t,e){return t+e}),0),ue=/\s/;function se(t){for(var e=t.length;e--&&ue.test(t.charAt(e)););return e}var le=/^\s+/;function ce(t){return t?t.slice(0,se(t)+1).replace(le,""):t}function de(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var he=NaN,pe=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,ve=/^0o[0-7]+$/i,ge=parseInt;function ye(t){if("number"==typeof t)return t;if(Kt(t))return he;if(de(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=de(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=ce(t);var n=fe.test(t);return n||ve.test(t)?ge(t.slice(2),n?2:8):pe.test(t)?he:+t}var me=1/0,be=17976931348623157e292;function xe(t){return t?(t=ye(t))===me||t===-me?(t<0?-1:1)*be:t==t?t:0:0===t?t:0}function _e(t){var e=xe(t),n=e%1;return e==e?n?e-n:e:0}function we(t){return t}var Me="[object AsyncFunction]",Ee="[object Function]",Ne="[object GeneratorFunction]",Se="[object Proxy]";function Ae(t){if(!de(t))return!1;var e=qt(t);return e==Ee||e==Ne||e==Me||e==Se}var Pe,Te=Lt["__core-js_shared__"],ke=(Pe=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||""))?"Symbol(src)_1."+Pe:"";var Ce=Function.prototype.toString;function Oe(t){if(null!=t){try{return Ce.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var Ie=/^\[object .+?Constructor\]$/,je=Function.prototype,Re=Object.prototype,De=je.toString,Le=Re.hasOwnProperty,Be=RegExp("^"+De.call(Le).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ze(t){return!(!de(t)||function(t){return!!ke&&ke in t}(t))&&(Ae(t)?Be:Ie).test(Oe(t))}function We(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return ze(n)?n:void 0}var Fe=We(Lt,"WeakMap"),Ge=Fe&&new Fe,He=Ge?function(t,e){return Ge.set(t,e),t}:we,Xe=Object.create,Ue=function(){function t(){}return function(e){if(!de(e))return{};if(Xe)return Xe(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function Ve(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Ue(t.prototype),r=t.apply(n,e);return de(r)?r:n}}var qe=1;function Ye(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var Ze=Math.max;function Ke(t,e,n,r){for(var i=-1,o=t.length,a=n.length,u=-1,s=e.length,l=Ze(o-a,0),c=Array(s+l),d=!r;++u<s;)c[u]=e[u];for(;++i<a;)(d||i<o)&&(c[n[i]]=t[i]);for(;l--;)c[u++]=t[i++];return c}var $e=Math.max;function Je(t,e,n,r){for(var i=-1,o=t.length,a=-1,u=n.length,s=-1,l=e.length,c=$e(o-u,0),d=Array(c+l),h=!r;++i<c;)d[i]=t[i];for(var p=i;++s<l;)d[p+s]=e[s];for(;++a<u;)(h||i<o)&&(d[p+n[a]]=t[i++]);return d}function Qe(){}var tn=4294967295;function en(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=tn,this.__views__=[]}function nn(){}en.prototype=Ue(Qe.prototype),en.prototype.constructor=en;var rn=Ge?function(t){return Ge.get(t)}:nn,on={},an=Object.prototype.hasOwnProperty;function un(t){for(var e=t.name+"",n=on[e],r=an.call(on,e)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==t)return i.name}return e}function sn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function ln(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function cn(t){if(t instanceof en)return t.clone();var e=new sn(t.__wrapped__,t.__chain__);return e.__actions__=ln(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}sn.prototype=Ue(Qe.prototype),sn.prototype.constructor=sn;var dn=Object.prototype.hasOwnProperty;function hn(t){if(Yt(t)&&!te(t)&&!(t instanceof en)){if(t instanceof sn)return t;if(dn.call(t,"__wrapped__"))return cn(t)}return new sn(t)}function pn(t){var e=un(t),n=hn[e];if("function"!=typeof n||!(e in en.prototype))return!1;if(t===n)return!0;var r=rn(n);return!!r&&t===r[0]}hn.prototype=Qe.prototype,hn.prototype.constructor=hn;var fn=Date.now;function vn(t){var e=0,n=0;return function(){var r=fn(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var gn=vn(He),yn=/\{\n\/\* \[wrapped with (.+)\] \*/,mn=/,? & /;var bn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function xn(t){return function(){return t}}var _n=function(){try{var t=We(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),wn=_n?function(t,e){return _n(t,"toString",{configurable:!0,enumerable:!1,value:xn(e),writable:!0})}:we,Mn=vn(wn);function En(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Nn(t,e,n,r){for(var i=t.length,o=n+(r?1:-1);r?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function Sn(t){return t!=t}function An(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):Nn(t,Sn,n)}function Pn(t,e){return!!(null==t?0:t.length)&&An(t,e,0)>-1}var Tn=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];function kn(t,e,n){var r=e+"";return Mn(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(bn,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return En(Tn,(function(n){var r="_."+n[0];e&n[1]&&!Pn(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(yn);return e?e[1].split(mn):[]}(r),n)))}var Cn=1,On=2,In=4,jn=8,Rn=32,Dn=64;function Ln(t,e,n,r,i,o,a,u,s,l){var c=e&jn;e|=c?Rn:Dn,(e&=~(c?Dn:Rn))&In||(e&=~(Cn|On));var d=[t,e,i,c?o:void 0,c?a:void 0,c?void 0:o,c?void 0:a,u,s,l],h=n.apply(void 0,d);return pn(t)&&gn(h,d),h.placeholder=r,kn(h,t,e)}function Bn(t){return t.placeholder}var zn=9007199254740991,Wn=/^(?:0|[1-9]\d*)$/;function Fn(t,e){var n=typeof t;return!!(e=null==e?zn:e)&&("number"==n||"symbol"!=n&&Wn.test(t))&&t>-1&&t%1==0&&t<e}var Gn=Math.min;var Hn="__lodash_placeholder__";function Xn(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n];a!==e&&a!==Hn||(t[n]=Hn,o[i++]=n)}return o}var Un=1,Vn=2,qn=8,Yn=16,Zn=128,Kn=512;function $n(t,e,n,r,i,o,a,u,s,l){var c=e&Zn,d=e&Un,h=e&Vn,p=e&(qn|Yn),f=e&Kn,v=h?void 0:Ve(t);return function g(){for(var y=arguments.length,m=Array(y),b=y;b--;)m[b]=arguments[b];if(p)var x=Bn(g),_=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(m,x);if(r&&(m=Ke(m,r,i,p)),o&&(m=Je(m,o,a,p)),y-=_,p&&y<l){var w=Xn(m,x);return Ln(t,e,$n,g.placeholder,n,m,w,u,s,l-y)}var M=d?n:this,E=h?M[t]:t;return y=m.length,u?m=function(t,e){for(var n=t.length,r=Gn(e.length,n),i=ln(t);r--;){var o=e[r];t[r]=Fn(o,n)?i[o]:void 0}return t}(m,u):f&&y>1&&m.reverse(),c&&s<y&&(m.length=s),this&&this!==Lt&&this instanceof g&&(E=v||Ve(E)),E.apply(M,m)}}var Jn=1;var Qn="__lodash_placeholder__",tr=1,er=2,nr=4,rr=8,ir=128,or=256,ar=Math.min;var ur="Expected a function",sr=1,lr=2,cr=8,dr=16,hr=32,pr=64,fr=Math.max;function vr(t,e,n,r,i,o,a,u){var s=e&lr;if(!s&&"function"!=typeof t)throw new TypeError(ur);var l=r?r.length:0;if(l||(e&=~(hr|pr),r=i=void 0),a=void 0===a?a:fr(_e(a),0),u=void 0===u?u:_e(u),l-=i?i.length:0,e&pr){var c=r,d=i;r=i=void 0}var h=s?void 0:rn(t),p=[t,e,n,r,i,c,d,o,a,u];if(h&&function(t,e){var n=t[1],r=e[1],i=n|r,o=i<(tr|er|ir),a=r==ir&&n==rr||r==ir&&n==or&&t[7].length<=e[8]||r==(ir|or)&&e[7].length<=e[8]&&n==rr;if(!o&&!a)return t;r&tr&&(t[2]=e[2],i|=n&tr?0:nr);var u=e[3];if(u){var s=t[3];t[3]=s?Ke(s,u,e[4]):u,t[4]=s?Xn(t[3],Qn):e[4]}(u=e[5])&&(s=t[5],t[5]=s?Je(s,u,e[6]):u,t[6]=s?Xn(t[5],Qn):e[6]),(u=e[7])&&(t[7]=u),r&ir&&(t[8]=null==t[8]?e[8]:ar(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=i}(p,h),t=p[0],e=p[1],n=p[2],r=p[3],i=p[4],!(u=p[9]=void 0===p[9]?s?0:t.length:fr(p[9]-l,0))&&e&(cr|dr)&&(e&=~(cr|dr)),e&&e!=sr)f=e==cr||e==dr?function(t,e,n){var r=Ve(t);return function i(){for(var o=arguments.length,a=Array(o),u=o,s=Bn(i);u--;)a[u]=arguments[u];var l=o<3&&a[0]!==s&&a[o-1]!==s?[]:Xn(a,s);return(o-=l.length)<n?Ln(t,e,$n,i.placeholder,void 0,a,l,void 0,void 0,n-o):Ye(this&&this!==Lt&&this instanceof i?r:t,this,a)}}(t,e,u):e!=hr&&e!=(sr|hr)||i.length?$n.apply(void 0,p):function(t,e,n,r){var i=e&Jn,o=Ve(t);return function e(){for(var a=-1,u=arguments.length,s=-1,l=r.length,c=Array(l+u),d=this&&this!==Lt&&this instanceof e?o:t;++s<l;)c[s]=r[s];for(;u--;)c[s++]=arguments[++a];return Ye(d,i?n:this,c)}}(t,e,n,r);else var f=function(t,e,n){var r=e&qe,i=Ve(t);return function e(){return(this&&this!==Lt&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,n);return kn((h?He:gn)(f,p),t,e)}var gr=128;function yr(t,e,n){return e=n?void 0:e,e=t&&null==e?t.length:e,vr(t,gr,void 0,void 0,void 0,void 0,e)}function mr(t,e,n){"__proto__"==e&&_n?_n(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function br(t,e){return t===e||t!=t&&e!=e}var xr=Object.prototype.hasOwnProperty;function _r(t,e,n){var r=t[e];xr.call(t,e)&&br(r,n)&&(void 0!==n||e in t)||mr(t,e,n)}function wr(t,e,n,r){var i=!n;n||(n={});for(var o=-1,a=e.length;++o<a;){var u=e[o],s=r?r(n[u],t[u],u,n,t):void 0;void 0===s&&(s=t[u]),i?mr(n,u,s):_r(n,u,s)}return n}var Mr=Math.max;function Er(t,e,n){return e=Mr(void 0===e?t.length-1:e,0),function(){for(var r=arguments,i=-1,o=Mr(r.length-e,0),a=Array(o);++i<o;)a[i]=r[e+i];i=-1;for(var u=Array(e+1);++i<e;)u[i]=r[i];return u[e]=n(a),Ye(t,this,u)}}function Nr(t,e){return Mn(Er(t,e,we),t+"")}var Sr=9007199254740991;function Ar(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Sr}function Pr(t){return null!=t&&Ar(t.length)&&!Ae(t)}function Tr(t,e,n){if(!de(n))return!1;var r=typeof e;return!!("number"==r?Pr(n)&&Fn(e,n.length):"string"==r&&e in n)&&br(n[e],t)}function kr(t){return Nr((function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,a&&Tr(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var u=n[r];u&&t(e,u,r,o)}return e}))}var Cr=Object.prototype;function Or(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Cr)}function Ir(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function jr(t){return Yt(t)&&"[object Arguments]"==qt(t)}var Rr=Object.prototype,Dr=Rr.hasOwnProperty,Lr=Rr.propertyIsEnumerable,Br=jr(function(){return arguments}())?jr:function(t){return Yt(t)&&Dr.call(t,"callee")&&!Lr.call(t,"callee")};function zr(){return!1}var Wr="object"==typeof t&&t&&!t.nodeType&&t,Fr=Wr&&"object"==typeof module&&module&&!module.nodeType&&module,Gr=Fr&&Fr.exports===Wr?Lt.Buffer:void 0,Hr=(Gr?Gr.isBuffer:void 0)||zr,Xr={};function Ur(t){return function(e){return t(e)}}Xr["[object Float32Array]"]=Xr["[object Float64Array]"]=Xr["[object Int8Array]"]=Xr["[object Int16Array]"]=Xr["[object Int32Array]"]=Xr["[object Uint8Array]"]=Xr["[object Uint8ClampedArray]"]=Xr["[object Uint16Array]"]=Xr["[object Uint32Array]"]=!0,Xr["[object Arguments]"]=Xr["[object Array]"]=Xr["[object ArrayBuffer]"]=Xr["[object Boolean]"]=Xr["[object DataView]"]=Xr["[object Date]"]=Xr["[object Error]"]=Xr["[object Function]"]=Xr["[object Map]"]=Xr["[object Number]"]=Xr["[object Object]"]=Xr["[object RegExp]"]=Xr["[object Set]"]=Xr["[object String]"]=Xr["[object WeakMap]"]=!1;var Vr="object"==typeof t&&t&&!t.nodeType&&t,qr=Vr&&"object"==typeof module&&module&&!module.nodeType&&module,Yr=qr&&qr.exports===Vr&&Rt.process,Zr=function(){try{var t=qr&&qr.require&&qr.require("util").types;return t||Yr&&Yr.binding&&Yr.binding("util")}catch(t){}}(),Kr=Zr&&Zr.isTypedArray,$r=Kr?Ur(Kr):function(t){return Yt(t)&&Ar(t.length)&&!!Xr[qt(t)]},Jr=Object.prototype.hasOwnProperty;function Qr(t,e){var n=te(t),r=!n&&Br(t),i=!n&&!r&&Hr(t),o=!n&&!r&&!i&&$r(t),a=n||r||i||o,u=a?Ir(t.length,String):[],s=u.length;for(var l in t)!e&&!Jr.call(t,l)||a&&("length"==l||i&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Fn(l,s))||u.push(l);return u}function ti(t,e){return function(n){return t(e(n))}}var ei=ti(Object.keys,Object),ni=Object.prototype.hasOwnProperty;function ri(t){if(!Or(t))return ei(t);var e=[];for(var n in Object(t))ni.call(t,n)&&"constructor"!=n&&e.push(n);return e}function ii(t){return Pr(t)?Qr(t):ri(t)}var oi=Object.prototype.hasOwnProperty,ai=kr((function(t,e){if(Or(e)||Pr(e))wr(e,ii(e),t);else for(var n in e)oi.call(e,n)&&_r(t,n,e[n])}));var ui=Object.prototype.hasOwnProperty;function si(t){if(!de(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=Or(t),n=[];for(var r in t)("constructor"!=r||!e&&ui.call(t,r))&&n.push(r);return n}function li(t){return Pr(t)?Qr(t,!0):si(t)}var ci=kr((function(t,e){wr(e,li(e),t)})),di=kr((function(t,e,n,r){wr(e,li(e),t,r)})),hi=kr((function(t,e,n,r){wr(e,ii(e),t,r)})),pi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,fi=/^\w*$/;function vi(t,e){if(te(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Kt(t))||(fi.test(t)||!pi.test(t)||null!=e&&t in Object(e))}var gi=We(Object,"create");var yi=Object.prototype.hasOwnProperty;var mi=Object.prototype.hasOwnProperty;function bi(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function xi(t,e){for(var n=t.length;n--;)if(br(t[n][0],e))return n;return-1}bi.prototype.clear=function(){this.__data__=gi?gi(null):{},this.size=0},bi.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},bi.prototype.get=function(t){var e=this.__data__;if(gi){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return yi.call(e,t)?e[t]:void 0},bi.prototype.has=function(t){var e=this.__data__;return gi?void 0!==e[t]:mi.call(e,t)},bi.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=gi&&void 0===e?"__lodash_hash_undefined__":e,this};var _i=Array.prototype.splice;function wi(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}wi.prototype.clear=function(){this.__data__=[],this.size=0},wi.prototype.delete=function(t){var e=this.__data__,n=xi(e,t);return!(n<0)&&(n==e.length-1?e.pop():_i.call(e,n,1),--this.size,!0)},wi.prototype.get=function(t){var e=this.__data__,n=xi(e,t);return n<0?void 0:e[n][1]},wi.prototype.has=function(t){return xi(this.__data__,t)>-1},wi.prototype.set=function(t,e){var n=this.__data__,r=xi(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var Mi=We(Lt,"Map");function Ei(t,e){var n=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?n["string"==typeof e?"string":"hash"]:n.map}function Ni(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ni.prototype.clear=function(){this.size=0,this.__data__={hash:new bi,map:new(Mi||wi),string:new bi}},Ni.prototype.delete=function(t){var e=Ei(this,t).delete(t);return this.size-=e?1:0,e},Ni.prototype.get=function(t){return Ei(this,t).get(t)},Ni.prototype.has=function(t){return Ei(this,t).has(t)},Ni.prototype.set=function(t,e){var n=Ei(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var Si="Expected a function";function Ai(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Si);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Ai.Cache||Ni),n}Ai.Cache=Ni;var Pi=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ti=/\\(\\)?/g,ki=function(t){var e=Ai(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Pi,(function(t,n,r,i){e.push(r?i.replace(Ti,"$1"):n||t)})),e}));function Ci(t){return null==t?"":ie(t)}function Oi(t,e){return te(t)?t:vi(t,e)?[t]:ki(Ci(t))}var Ii=1/0;function ji(t){if("string"==typeof t||Kt(t))return t;var e=t+"";return"0"==e&&1/t==-Ii?"-0":e}function Ri(t,e){for(var n=0,r=(e=Oi(e,t)).length;null!=t&&n<r;)t=t[ji(e[n++])];return n&&n==r?t:void 0}function Di(t,e,n){var r=null==t?void 0:Ri(t,e);return void 0===r?n:r}function Li(t,e){for(var n=-1,r=e.length,i=Array(r),o=null==t;++n<r;)i[n]=o?void 0:Di(t,e[n]);return i}function Bi(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var zi=Bt?Bt.isConcatSpreadable:void 0;function Wi(t){return te(t)||Br(t)||!!(zi&&t&&t[zi])}function Fi(t,e,n,r,i){var o=-1,a=t.length;for(n||(n=Wi),i||(i=[]);++o<a;){var u=t[o];e>0&&n(u)?e>1?Fi(u,e-1,n,r,i):Bi(i,u):r||(i[i.length]=u)}return i}function Gi(t){return(null==t?0:t.length)?Fi(t,1):[]}function Hi(t){return Mn(Er(t,void 0,Gi),t+"")}var Xi=Hi(Li),Ui=ti(Object.getPrototypeOf,Object),Vi="[object Object]",qi=Function.prototype,Yi=Object.prototype,Zi=qi.toString,Ki=Yi.hasOwnProperty,$i=Zi.call(Object);function Ji(t){if(!Yt(t)||qt(t)!=Vi)return!1;var e=Ui(t);if(null===e)return!0;var n=Ki.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Zi.call(n)==$i}var Qi="[object DOMException]",to="[object Error]";function eo(t){if(!Yt(t))return!1;var e=qt(t);return e==to||e==Qi||"string"==typeof t.message&&"string"==typeof t.name&&!Ji(t)}var no=Nr((function(t,e){try{return Ye(t,void 0,e)}catch(t){return eo(t)?t:new Error(t)}})),ro="Expected a function";function io(t,e){var n;if("function"!=typeof e)throw new TypeError(ro);return t=_e(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var oo=Nr((function(t,e,n){var r=1;if(n.length){var i=Xn(n,Bn(oo));r|=32}return vr(t,r,e,n,i)}));oo.placeholder={};var ao=Hi((function(t,e){return En(e,(function(e){e=ji(e),mr(t,e,oo(t[e],t))})),t})),uo=Nr((function(t,e,n){var r=3;if(n.length){var i=Xn(n,Bn(uo));r|=32}return vr(e,r,t,n,i)}));function so(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}function lo(t,e,n){var r=t.length;return n=void 0===n?r:n,!e&&n>=r?t:so(t,e,n)}uo.placeholder={};var co=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function ho(t){return co.test(t)}var po="\\ud800-\\udfff",fo="["+po+"]",vo="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",go="\\ud83c[\\udffb-\\udfff]",yo="[^"+po+"]",mo="(?:\\ud83c[\\udde6-\\uddff]){2}",bo="[\\ud800-\\udbff][\\udc00-\\udfff]",xo="(?:"+vo+"|"+go+")"+"?",_o="[\\ufe0e\\ufe0f]?",wo=_o+xo+("(?:\\u200d(?:"+[yo,mo,bo].join("|")+")"+_o+xo+")*"),Mo="(?:"+[yo+vo+"?",vo,mo,bo,fo].join("|")+")",Eo=RegExp(go+"(?="+go+")|"+Mo+wo,"g");function No(t){return ho(t)?function(t){return t.match(Eo)||[]}(t):function(t){return t.split("")}(t)}function So(t){return function(e){var n=ho(e=Ci(e))?No(e):void 0,r=n?n[0]:e.charAt(0),i=n?lo(n,1).join(""):e.slice(1);return r[t]()+i}}var Ao=So("toUpperCase");function Po(t){return Ao(Ci(t).toLowerCase())}function To(t,e,n,r){var i=-1,o=null==t?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function ko(t){return function(e){return null==t?void 0:t[e]}}var Co=ko({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Oo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Io=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");function jo(t){return(t=Ci(t))&&t.replace(Oo,Co).replace(Io,"")}var Ro=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var Do=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var Lo="\\ud800-\\udfff",Bo="\\u2700-\\u27bf",zo="a-z\\xdf-\\xf6\\xf8-\\xff",Wo="A-Z\\xc0-\\xd6\\xd8-\\xde",Fo="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Go="["+Fo+"]",Ho="\\d+",Xo="["+Bo+"]",Uo="["+zo+"]",Vo="[^"+Lo+Fo+Ho+Bo+zo+Wo+"]",qo="(?:\\ud83c[\\udde6-\\uddff]){2}",Yo="[\\ud800-\\udbff][\\udc00-\\udfff]",Zo="["+Wo+"]",Ko="(?:"+Uo+"|"+Vo+")",$o="(?:"+Zo+"|"+Vo+")",Jo="(?:['’](?:d|ll|m|re|s|t|ve))?",Qo="(?:['’](?:D|LL|M|RE|S|T|VE))?",ta="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",ea="[\\ufe0e\\ufe0f]?",na=ea+ta+("(?:\\u200d(?:"+["[^"+Lo+"]",qo,Yo].join("|")+")"+ea+ta+")*"),ra="(?:"+[Xo,qo,Yo].join("|")+")"+na,ia=RegExp([Zo+"?"+Uo+"+"+Jo+"(?="+[Go,Zo,"$"].join("|")+")",$o+"+"+Qo+"(?="+[Go,Zo+Ko,"$"].join("|")+")",Zo+"?"+Ko+"+"+Jo,Zo+"+"+Qo,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ho,ra].join("|"),"g");function oa(t,e,n){return t=Ci(t),void 0===(e=n?void 0:e)?function(t){return Do.test(t)}(t)?function(t){return t.match(ia)||[]}(t):function(t){return t.match(Ro)||[]}(t):t.match(e)||[]}var aa=RegExp("['’]","g");function ua(t){return function(e){return To(oa(jo(e).replace(aa,"")),t,"")}}var sa=ua((function(t,e,n){return e=e.toLowerCase(),t+(n?Po(e):e)}));var la=Lt.isFinite,ca=Math.min;function da(t){var e=Math[t];return function(t,n){if(t=ye(t),(n=null==n?0:ca(_e(n),292))&&la(t)){var r=(Ci(t)+"e").split("e");return+((r=(Ci(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var ha=da("ceil");function pa(t){var e=hn(t);return e.__chain__=!0,e}var fa=Math.ceil,va=Math.max;function ga(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}function ya(t){var e=this.__data__=new wi(t);this.size=e.size}function ma(t,e){return t&&wr(e,ii(e),t)}ya.prototype.clear=function(){this.__data__=new wi,this.size=0},ya.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},ya.prototype.get=function(t){return this.__data__.get(t)},ya.prototype.has=function(t){return this.__data__.has(t)},ya.prototype.set=function(t,e){var n=this.__data__;if(n instanceof wi){var r=n.__data__;if(!Mi||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Ni(r)}return n.set(t,e),this.size=n.size,this};var ba="object"==typeof t&&t&&!t.nodeType&&t,xa=ba&&"object"==typeof module&&module&&!module.nodeType&&module,_a=xa&&xa.exports===ba?Lt.Buffer:void 0,wa=_a?_a.allocUnsafe:void 0;function Ma(t,e){if(e)return t.slice();var n=t.length,r=wa?wa(n):new t.constructor(n);return t.copy(r),r}function Ea(t,e){for(var n=-1,r=null==t?0:t.length,i=0,o=[];++n<r;){var a=t[n];e(a,n,t)&&(o[i++]=a)}return o}function Na(){return[]}var Sa=Object.prototype.propertyIsEnumerable,Aa=Object.getOwnPropertySymbols,Pa=Aa?function(t){return null==t?[]:(t=Object(t),Ea(Aa(t),(function(e){return Sa.call(t,e)})))}:Na;var Ta=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Bi(e,Pa(t)),t=Ui(t);return e}:Na;function ka(t,e,n){var r=e(t);return te(t)?r:Bi(r,n(t))}function Ca(t){return ka(t,ii,Pa)}function Oa(t){return ka(t,li,Ta)}var Ia=We(Lt,"DataView"),ja=We(Lt,"Promise"),Ra=We(Lt,"Set"),Da="[object Map]",La="[object Promise]",Ba="[object Set]",za="[object WeakMap]",Wa="[object DataView]",Fa=Oe(Ia),Ga=Oe(Mi),Ha=Oe(ja),Xa=Oe(Ra),Ua=Oe(Fe),Va=qt;(Ia&&Va(new Ia(new ArrayBuffer(1)))!=Wa||Mi&&Va(new Mi)!=Da||ja&&Va(ja.resolve())!=La||Ra&&Va(new Ra)!=Ba||Fe&&Va(new Fe)!=za)&&(Va=function(t){var e=qt(t),n="[object Object]"==e?t.constructor:void 0,r=n?Oe(n):"";if(r)switch(r){case Fa:return Wa;case Ga:return Da;case Ha:return La;case Xa:return Ba;case Ua:return za}return e});var qa=Va,Ya=Object.prototype.hasOwnProperty;var Za=Lt.Uint8Array;function Ka(t){var e=new t.constructor(t.byteLength);return new Za(e).set(new Za(t)),e}var $a=/\w*$/;var Ja=Bt?Bt.prototype:void 0,Qa=Ja?Ja.valueOf:void 0;function tu(t,e){var n=e?Ka(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var eu="[object Boolean]",nu="[object Date]",ru="[object Map]",iu="[object Number]",ou="[object RegExp]",au="[object Set]",uu="[object String]",su="[object Symbol]",lu="[object ArrayBuffer]",cu="[object DataView]",du="[object Float32Array]",hu="[object Float64Array]",pu="[object Int8Array]",fu="[object Int16Array]",vu="[object Int32Array]",gu="[object Uint8Array]",yu="[object Uint8ClampedArray]",mu="[object Uint16Array]",bu="[object Uint32Array]";function xu(t,e,n){var r,i=t.constructor;switch(e){case lu:return Ka(t);case eu:case nu:return new i(+t);case cu:return function(t,e){var n=e?Ka(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case du:case hu:case pu:case fu:case vu:case gu:case yu:case mu:case bu:return tu(t,n);case ru:return new i;case iu:case uu:return new i(t);case ou:return function(t){var e=new t.constructor(t.source,$a.exec(t));return e.lastIndex=t.lastIndex,e}(t);case au:return new i;case su:return r=t,Qa?Object(Qa.call(r)):{}}}function _u(t){return"function"!=typeof t.constructor||Or(t)?{}:Ue(Ui(t))}var wu=Zr&&Zr.isMap,Mu=wu?Ur(wu):function(t){return Yt(t)&&"[object Map]"==qa(t)};var Eu=Zr&&Zr.isSet,Nu=Eu?Ur(Eu):function(t){return Yt(t)&&"[object Set]"==qa(t)},Su=1,Au=2,Pu=4,Tu="[object Arguments]",ku="[object Function]",Cu="[object GeneratorFunction]",Ou="[object Object]",Iu={};function ju(t,e,n,r,i,o){var a,u=e&Su,s=e&Au,l=e&Pu;if(n&&(a=i?n(t,r,i,o):n(t)),void 0!==a)return a;if(!de(t))return t;var c=te(t);if(c){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Ya.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!u)return ln(t,a)}else{var d=qa(t),h=d==ku||d==Cu;if(Hr(t))return Ma(t,u);if(d==Ou||d==Tu||h&&!i){if(a=s||h?{}:_u(t),!u)return s?function(t,e){return wr(t,Ta(t),e)}(t,function(t,e){return t&&wr(e,li(e),t)}(a,t)):function(t,e){return wr(t,Pa(t),e)}(t,ma(a,t))}else{if(!Iu[d])return i?t:{};a=xu(t,d,u)}}o||(o=new ya);var p=o.get(t);if(p)return p;o.set(t,a),Nu(t)?t.forEach((function(r){a.add(ju(r,e,n,r,t,o))})):Mu(t)&&t.forEach((function(r,i){a.set(i,ju(r,e,n,i,t,o))}));var f=c?void 0:(l?s?Oa:Ca:s?li:ii)(t);return En(f||t,(function(r,i){f&&(r=t[i=r]),_r(a,i,ju(r,e,n,i,t,o))})),a}Iu[Tu]=Iu["[object Array]"]=Iu["[object ArrayBuffer]"]=Iu["[object DataView]"]=Iu["[object Boolean]"]=Iu["[object Date]"]=Iu["[object Float32Array]"]=Iu["[object Float64Array]"]=Iu["[object Int8Array]"]=Iu["[object Int16Array]"]=Iu["[object Int32Array]"]=Iu["[object Map]"]=Iu["[object Number]"]=Iu[Ou]=Iu["[object RegExp]"]=Iu["[object Set]"]=Iu["[object String]"]=Iu["[object Symbol]"]=Iu["[object Uint8Array]"]=Iu["[object Uint8ClampedArray]"]=Iu["[object Uint16Array]"]=Iu["[object Uint32Array]"]=!0,Iu["[object Error]"]=Iu[ku]=Iu["[object WeakMap]"]=!1;function Ru(t){return ju(t,5)}function Du(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Ni;++e<n;)this.add(t[e])}function Lu(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function Bu(t,e){return t.has(e)}Du.prototype.add=Du.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Du.prototype.has=function(t){return this.__data__.has(t)};var zu=1,Wu=2;function Fu(t,e,n,r,i,o){var a=n&zu,u=t.length,s=e.length;if(u!=s&&!(a&&s>u))return!1;var l=o.get(t),c=o.get(e);if(l&&c)return l==e&&c==t;var d=-1,h=!0,p=n&Wu?new Du:void 0;for(o.set(t,e),o.set(e,t);++d<u;){var f=t[d],v=e[d];if(r)var g=a?r(v,f,d,e,t,o):r(f,v,d,t,e,o);if(void 0!==g){if(g)continue;h=!1;break}if(p){if(!Lu(e,(function(t,e){if(!Bu(p,e)&&(f===t||i(f,t,n,r,o)))return p.push(e)}))){h=!1;break}}else if(f!==v&&!i(f,v,n,r,o)){h=!1;break}}return o.delete(t),o.delete(e),h}function Gu(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function Hu(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var Xu=1,Uu=2,Vu="[object Boolean]",qu="[object Date]",Yu="[object Error]",Zu="[object Map]",Ku="[object Number]",$u="[object RegExp]",Ju="[object Set]",Qu="[object String]",ts="[object Symbol]",es="[object ArrayBuffer]",ns="[object DataView]",rs=Bt?Bt.prototype:void 0,is=rs?rs.valueOf:void 0;var os=1,as=Object.prototype.hasOwnProperty;var us=1,ss="[object Arguments]",ls="[object Array]",cs="[object Object]",ds=Object.prototype.hasOwnProperty;function hs(t,e,n,r,i,o){var a=te(t),u=te(e),s=a?ls:qa(t),l=u?ls:qa(e),c=(s=s==ss?cs:s)==cs,d=(l=l==ss?cs:l)==cs,h=s==l;if(h&&Hr(t)){if(!Hr(e))return!1;a=!0,c=!1}if(h&&!c)return o||(o=new ya),a||$r(t)?Fu(t,e,n,r,i,o):function(t,e,n,r,i,o,a){switch(n){case ns:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case es:return!(t.byteLength!=e.byteLength||!o(new Za(t),new Za(e)));case Vu:case qu:case Ku:return br(+t,+e);case Yu:return t.name==e.name&&t.message==e.message;case $u:case Qu:return t==e+"";case Zu:var u=Gu;case Ju:var s=r&Xu;if(u||(u=Hu),t.size!=e.size&&!s)return!1;var l=a.get(t);if(l)return l==e;r|=Uu,a.set(t,e);var c=Fu(u(t),u(e),r,i,o,a);return a.delete(t),c;case ts:if(is)return is.call(t)==is.call(e)}return!1}(t,e,s,n,r,i,o);if(!(n&us)){var p=c&&ds.call(t,"__wrapped__"),f=d&&ds.call(e,"__wrapped__");if(p||f){var v=p?t.value():t,g=f?e.value():e;return o||(o=new ya),i(v,g,n,r,o)}}return!!h&&(o||(o=new ya),function(t,e,n,r,i,o){var a=n&os,u=Ca(t),s=u.length;if(s!=Ca(e).length&&!a)return!1;for(var l=s;l--;){var c=u[l];if(!(a?c in e:as.call(e,c)))return!1}var d=o.get(t),h=o.get(e);if(d&&h)return d==e&&h==t;var p=!0;o.set(t,e),o.set(e,t);for(var f=a;++l<s;){var v=t[c=u[l]],g=e[c];if(r)var y=a?r(g,v,c,e,t,o):r(v,g,c,t,e,o);if(!(void 0===y?v===g||i(v,g,n,r,o):y)){p=!1;break}f||(f="constructor"==c)}if(p&&!f){var m=t.constructor,b=e.constructor;m==b||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof b&&b instanceof b||(p=!1)}return o.delete(t),o.delete(e),p}(t,e,n,r,i,o))}function ps(t,e,n,r,i){return t===e||(null==t||null==e||!Yt(t)&&!Yt(e)?t!=t&&e!=e:hs(t,e,n,r,ps,i))}var fs=1,vs=2;function gs(t,e,n,r){var i=n.length,o=i,a=!r;if(null==t)return!o;for(t=Object(t);i--;){var u=n[i];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++i<o;){var s=(u=n[i])[0],l=t[s],c=u[1];if(a&&u[2]){if(void 0===l&&!(s in t))return!1}else{var d=new ya;if(r)var h=r(l,c,s,t,e,d);if(!(void 0===h?ps(c,l,fs|vs,r,d):h))return!1}}return!0}function ys(t){return t==t&&!de(t)}function ms(t){for(var e=ii(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,ys(i)]}return e}function bs(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}function xs(t){var e=ms(t);return 1==e.length&&e[0][2]?bs(e[0][0],e[0][1]):function(n){return n===t||gs(n,t,e)}}function _s(t,e){return null!=t&&e in Object(t)}function ws(t,e,n){for(var r=-1,i=(e=Oi(e,t)).length,o=!1;++r<i;){var a=ji(e[r]);if(!(o=null!=t&&n(t,a)))break;t=t[a]}return o||++r!=i?o:!!(i=null==t?0:t.length)&&Ar(i)&&Fn(a,i)&&(te(t)||Br(t))}function Ms(t,e){return null!=t&&ws(t,e,_s)}var Es=1,Ns=2;function Ss(t,e){return vi(t)&&ys(e)?bs(ji(t),e):function(n){var r=Di(n,t);return void 0===r&&r===e?Ms(n,t):ps(e,r,Es|Ns)}}function As(t){return function(e){return null==e?void 0:e[t]}}function Ps(t){return vi(t)?As(ji(t)):function(t){return function(e){return Ri(e,t)}}(t)}function Ts(t){return"function"==typeof t?t:null==t?we:"object"==typeof t?te(t)?Ss(t[0],t[1]):xs(t):Ps(t)}function ks(t,e,n){var r=n.length;if(null==t)return!r;for(t=Object(t);r--;){var i=n[r],o=e[i],a=t[i];if(void 0===a&&!(i in t)||!o(a))return!1}return!0}function Cs(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i<o;){var a=t[i];e(r,a,n(a),t)}return r}function Os(t){return function(e,n,r){for(var i=-1,o=Object(e),a=r(e),u=a.length;u--;){var s=a[t?u:++i];if(!1===n(o[s],s,o))break}return e}}var Is=Os();function js(t,e){return t&&Is(t,e,ii)}function Rs(t,e){return function(n,r){if(null==n)return n;if(!Pr(n))return t(n,r);for(var i=n.length,o=e?i:-1,a=Object(n);(e?o--:++o<i)&&!1!==r(a[o],o,a););return n}}var Ds=Rs(js);function Ls(t,e,n,r){return Ds(t,(function(t,i,o){e(r,t,n(t),o)})),r}function Bs(t,e){return function(n,r){var i=te(n)?Cs:Ls,o=e?e():{};return i(n,t,Ts(r),o)}}var zs=Object.prototype.hasOwnProperty,Ws=Bs((function(t,e,n){zs.call(t,n)?++t[n]:mr(t,n,1)}));function Fs(t,e,n){var r=vr(t,8,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return r.placeholder=Fs.placeholder,r}Fs.placeholder={};function Gs(t,e,n){var r=vr(t,16,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return r.placeholder=Gs.placeholder,r}Gs.placeholder={};var Hs=function(){return Lt.Date.now()},Xs="Expected a function",Us=Math.max,Vs=Math.min;function qs(t,e,n){var r,i,o,a,u,s,l=0,c=!1,d=!1,h=!0;if("function"!=typeof t)throw new TypeError(Xs);function p(e){var n=r,o=i;return r=i=void 0,l=e,a=t.apply(o,n)}function f(t){var n=t-s;return void 0===s||n>=e||n<0||d&&t-l>=o}function v(){var t=Hs();if(f(t))return g(t);u=setTimeout(v,function(t){var n=e-(t-s);return d?Vs(n,o-(t-l)):n}(t))}function g(t){return u=void 0,h&&r?p(t):(r=i=void 0,a)}function y(){var t=Hs(),n=f(t);if(r=arguments,i=this,s=t,n){if(void 0===u)return function(t){return l=t,u=setTimeout(v,e),c?p(t):a}(s);if(d)return clearTimeout(u),u=setTimeout(v,e),p(s)}return void 0===u&&(u=setTimeout(v,e)),a}return e=ye(e)||0,de(n)&&(c=!!n.leading,o=(d="maxWait"in n)?Us(ye(n.maxWait)||0,e):o,h="trailing"in n?!!n.trailing:h),y.cancel=function(){void 0!==u&&clearTimeout(u),l=0,r=s=i=u=void 0},y.flush=function(){return void 0===u?a:g(Hs())},y}var Ys=Object.prototype,Zs=Ys.hasOwnProperty,Ks=Nr((function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&Tr(e[0],e[1],i)&&(r=1);++n<r;)for(var o=e[n],a=li(o),u=-1,s=a.length;++u<s;){var l=a[u],c=t[l];(void 0===c||br(c,Ys[l])&&!Zs.call(t,l))&&(t[l]=o[l])}return t}));function $s(t,e,n){(void 0!==n&&!br(t[e],n)||void 0===n&&!(e in t))&&mr(t,e,n)}function Js(t){return Yt(t)&&Pr(t)}function Qs(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function tl(t){return wr(t,li(t))}function el(t,e,n,r,i){t!==e&&Is(e,(function(o,a){if(i||(i=new ya),de(o))!function(t,e,n,r,i,o,a){var u=Qs(t,n),s=Qs(e,n),l=a.get(s);if(l)$s(t,n,l);else{var c=o?o(u,s,n+"",t,e,a):void 0,d=void 0===c;if(d){var h=te(s),p=!h&&Hr(s),f=!h&&!p&&$r(s);c=s,h||p||f?te(u)?c=u:Js(u)?c=ln(u):p?(d=!1,c=Ma(s,!0)):f?(d=!1,c=tu(s,!0)):c=[]:Ji(s)||Br(s)?(c=u,Br(u)?c=tl(u):de(u)&&!Ae(u)||(c=_u(s))):d=!1}d&&(a.set(s,c),i(c,s,r,o,a),a.delete(s)),$s(t,n,c)}}(t,e,a,n,el,r,i);else{var u=r?r(Qs(t,a),o,a+"",t,e,i):void 0;void 0===u&&(u=o),$s(t,a,u)}}),li)}function nl(t,e,n,r,i,o){return de(t)&&de(e)&&(o.set(e,t),el(t,e,void 0,nl,o),o.delete(e)),t}var rl=kr((function(t,e,n,r){el(t,e,n,r)})),il=Nr((function(t){return t.push(void 0,nl),Ye(rl,void 0,t)}));function ol(t,e,n){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,n)}),e)}var al=Nr((function(t,e){return ol(t,1,e)})),ul=Nr((function(t,e,n){return ol(t,ye(e)||0,n)}));function sl(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}var ll=200;function cl(t,e,n,r){var i=-1,o=Pn,a=!0,u=t.length,s=[],l=e.length;if(!u)return s;n&&(e=Qt(e,Ur(n))),r?(o=sl,a=!1):e.length>=ll&&(o=Bu,a=!1,e=new Du(e));t:for(;++i<u;){var c=t[i],d=null==n?c:n(c);if(c=r||0!==c?c:0,a&&d==d){for(var h=l;h--;)if(e[h]===d)continue t;s.push(c)}else o(e,d,r)||s.push(c)}return s}var dl=Nr((function(t,e){return Js(t)?cl(t,Fi(e,1,Js,!0)):[]}));function hl(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}var pl=Nr((function(t,e){var n=hl(e);return Js(n)&&(n=void 0),Js(t)?cl(t,Fi(e,1,Js,!0),Ts(n)):[]})),fl=Nr((function(t,e){var n=hl(e);return Js(n)&&(n=void 0),Js(t)?cl(t,Fi(e,1,Js,!0),void 0,n):[]})),vl=oe((function(t,e){return t/e}),1);function gl(t,e,n,r){for(var i=t.length,o=r?i:-1;(r?o--:++o<i)&&e(t[o],o,t););return n?so(t,r?0:o,r?o+1:i):so(t,r?o+1:0,r?i:o)}function yl(t){return"function"==typeof t?t:we}function ml(t,e){return(te(t)?En:Ds)(t,yl(e))}function bl(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}var xl=Os(!0);function _l(t,e){return t&&xl(t,e,ii)}var wl=Rs(_l,!0);function Ml(t,e){return(te(t)?bl:wl)(t,yl(e))}function El(t){return function(e){var n=qa(e);return"[object Map]"==n?Gu(e):"[object Set]"==n?function(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}(e):function(t,e){return Qt(e,(function(e){return[e,t[e]]}))}(e,t(e))}}var Nl=El(ii),Sl=El(li),Al=ko({"&":"&","<":"<",">":">",'"':""","'":"'"}),Pl=/[&<>"']/g,Tl=RegExp(Pl.source);function kl(t){return(t=Ci(t))&&Tl.test(t)?t.replace(Pl,Al):t}var Cl=/[\\^$.*+?()[\]{}|]/g,Ol=RegExp(Cl.source);function Il(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function jl(t,e){var n=!0;return Ds(t,(function(t,r,i){return n=!!e(t,r,i)})),n}var Rl=4294967295;function Dl(t){return t?ga(_e(t),0,Rl):0}function Ll(t,e){var n=[];return Ds(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function Bl(t){return function(e,n,r){var i=Object(e);if(!Pr(e)){var o=Ts(n);e=ii(e),n=function(t){return o(i[t],t,i)}}var a=t(e,n,r);return a>-1?i[o?e[a]:a]:void 0}}var zl=Math.max;function Wl(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:_e(n);return i<0&&(i=zl(r+i,0)),Nn(t,Ts(e),i)}var Fl=Bl(Wl);function Gl(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}var Hl=Math.max,Xl=Math.min;function Ul(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return void 0!==n&&(i=_e(n),i=n<0?Hl(r+i,0):Xl(i,r-1)),Nn(t,Ts(e),i,!0)}var Vl=Bl(Ul);function ql(t){return t&&t.length?t[0]:void 0}function Yl(t,e){var n=-1,r=Pr(t)?Array(t.length):[];return Ds(t,(function(t,i,o){r[++n]=e(t,i,o)})),r}function Zl(t,e){return(te(t)?Qt:Yl)(t,Ts(e))}var Kl=da("floor");function $l(t){return Hi((function(e){var n=e.length,r=n,i=sn.prototype.thru;for(t&&e.reverse();r--;){var o=e[r];if("function"!=typeof o)throw new TypeError("Expected a function");if(i&&!a&&"wrapper"==un(o))var a=new sn([],!0)}for(r=a?r:n;++r<n;){var u=un(o=e[r]),s="wrapper"==u?rn(o):void 0;a=s&&pn(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?a[un(s[0])].apply(a,s[3]):1==o.length&&pn(o)?a[u]():a.thru(o)}return function(){var t=arguments,r=t[0];if(a&&1==t.length&&te(r))return a.plant(r).value();for(var i=0,o=n?e[i].apply(this,t):r;++i<n;)o=e[i].call(this,o);return o}}))}var Jl=$l(),Ql=$l(!0);function tc(t,e){return Ea(e,(function(e){return Ae(t[e])}))}var ec=Object.prototype.hasOwnProperty,nc=Bs((function(t,e,n){ec.call(t,n)?t[n].push(e):mr(t,n,[e])}));function rc(t,e){return t>e}function ic(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=ye(e),n=ye(n)),t(e,n)}}var oc=ic(rc),ac=ic((function(t,e){return t>=e})),uc=Object.prototype.hasOwnProperty;function sc(t,e){return null!=t&&uc.call(t,e)}function lc(t,e){return null!=t&&ws(t,e,sc)}var cc=Math.max,dc=Math.min;var hc="[object String]";function pc(t){return"string"==typeof t||!te(t)&&Yt(t)&&qt(t)==hc}function fc(t,e){return Qt(e,(function(e){return t[e]}))}function vc(t){return null==t?[]:fc(t,ii(t))}var gc=Math.max;var yc=Math.max;var mc=Math.min;function bc(t,e,n){for(var r=n?sl:Pn,i=t[0].length,o=t.length,a=o,u=Array(o),s=1/0,l=[];a--;){var c=t[a];a&&e&&(c=Qt(c,Ur(e))),s=mc(c.length,s),u[a]=!n&&(e||i>=120&&c.length>=120)?new Du(a&&c):void 0}c=t[0];var d=-1,h=u[0];t:for(;++d<i&&l.length<s;){var p=c[d],f=e?e(p):p;if(p=n||0!==p?p:0,!(h?Bu(h,f):r(l,f,n))){for(a=o;--a;){var v=u[a];if(!(v?Bu(v,f):r(t[a],f,n)))continue t}h&&h.push(f),l.push(p)}}return l}function xc(t){return Js(t)?t:[]}var _c=Nr((function(t){var e=Qt(t,xc);return e.length&&e[0]===t[0]?bc(e):[]})),wc=Nr((function(t){var e=hl(t),n=Qt(t,xc);return e===hl(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?bc(n,Ts(e)):[]})),Mc=Nr((function(t){var e=hl(t),n=Qt(t,xc);return(e="function"==typeof e?e:void 0)&&n.pop(),n.length&&n[0]===t[0]?bc(n,void 0,e):[]}));function Ec(t,e){return function(n,r){return function(t,e,n,r){return js(t,(function(t,i,o){e(r,n(t),i,o)})),r}(n,t,e(r),{})}}var Nc=Object.prototype.toString,Sc=Ec((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Nc.call(e)),t[e]=n}),xn(we)),Ac=Object.prototype,Pc=Ac.hasOwnProperty,Tc=Ac.toString,kc=Ec((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Tc.call(e)),Pc.call(t,e)?t[e].push(n):t[e]=[n]}),Ts);function Cc(t,e){return e.length<2?t:Ri(t,so(e,0,-1))}function Oc(t,e,n){var r=null==(t=Cc(t,e=Oi(e,t)))?t:t[ji(hl(e))];return null==r?void 0:Ye(r,t,n)}var Ic=Nr(Oc),jc=Nr((function(t,e,n){var r=-1,i="function"==typeof e,o=Pr(t)?Array(t.length):[];return Ds(t,(function(t){o[++r]=i?Ye(e,t,n):Oc(t,e,n)})),o}));var Rc=Zr&&Zr.isArrayBuffer,Dc=Rc?Ur(Rc):function(t){return Yt(t)&&"[object ArrayBuffer]"==qt(t)};var Lc=Zr&&Zr.isDate,Bc=Lc?Ur(Lc):function(t){return Yt(t)&&"[object Date]"==qt(t)};var zc=Object.prototype.hasOwnProperty;var Wc=Lt.isFinite;function Fc(t){return"number"==typeof t&&t==_e(t)}var Gc="[object Number]";function Hc(t){return"number"==typeof t||Yt(t)&&qt(t)==Gc}var Xc=Te?Ae:zr;var Uc=Zr&&Zr.isRegExp,Vc=Uc?Ur(Uc):function(t){return Yt(t)&&"[object RegExp]"==qt(t)},qc=9007199254740991;var Yc=Array.prototype.join;var Zc=ua((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Kc=Bs((function(t,e,n){mr(t,n,e)}));var $c=Math.max,Jc=Math.min;var Qc=ua((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),td=So("toLowerCase");function ed(t,e){return t<e}var nd=ic(ed),rd=ic((function(t,e){return t<=e}));function id(t,e,n){for(var r=-1,i=t.length;++r<i;){var o=t[r],a=e(o);if(null!=a&&(void 0===u?a==a&&!Kt(a):n(a,u)))var u=a,s=o}return s}function od(t,e){for(var n,r=-1,i=t.length;++r<i;){var o=e(t[r]);void 0!==o&&(n=void 0===n?o:n+o)}return n}var ad=NaN;function ud(t,e){var n=null==t?0:t.length;return n?od(t,e)/n:ad}var sd=kr((function(t,e,n){el(t,e,n)})),ld=Nr((function(t,e){return function(n){return Oc(n,t,e)}})),cd=Nr((function(t,e){return function(n){return Oc(t,n,e)}}));function dd(t,e,n){var r=ii(e),i=tc(e,r),o=!(de(n)&&"chain"in n&&!n.chain),a=Ae(t);return En(i,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=ln(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Bi([this.value()],arguments))})})),t}var hd=oe((function(t,e){return t*e}),1),pd="Expected a function";function fd(t){if("function"!=typeof t)throw new TypeError(pd);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}var vd="[object Map]",gd="[object Set]",yd=Bt?Bt.iterator:void 0;function md(t){if(!t)return[];if(Pr(t))return pc(t)?No(t):ln(t);if(yd&&t[yd])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[yd]());var e=qa(t);return(e==vd?Gu:e==gd?Hu:vc)(t)}function bd(t,e){var n=t.length;if(n)return Fn(e+=e<0?n:0,n)?t[e]:void 0}function xd(t,e){return null==(t=Cc(t,e=Oi(e,t)))||delete t[ji(hl(e))]}function _d(t){return Ji(t)?void 0:t}var wd=Hi((function(t,e){var n={};if(null==t)return n;var r=!1;e=Qt(e,(function(e){return e=Oi(e,t),r||(r=e.length>1),e})),wr(t,Oa(t),n),r&&(n=ju(n,7,_d));for(var i=e.length;i--;)xd(n,e[i]);return n}));function Md(t,e,n,r){if(!de(t))return t;for(var i=-1,o=(e=Oi(e,t)).length,a=o-1,u=t;null!=u&&++i<o;){var s=ji(e[i]),l=n;if("__proto__"===s||"constructor"===s||"prototype"===s)return t;if(i!=a){var c=u[s];void 0===(l=r?r(c,s,u):void 0)&&(l=de(c)?c:Fn(e[i+1])?[]:{})}_r(u,s,l),u=u[s]}return t}function Ed(t,e,n){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],u=Ri(t,a);n(u,a)&&Md(o,Oi(a,t),u)}return o}function Nd(t,e){if(null==t)return{};var n=Qt(Oa(t),(function(t){return[t]}));return e=Ts(e),Ed(t,n,(function(t,n){return e(t,n[0])}))}function Sd(t,e){if(t!==e){var n=void 0!==t,r=null===t,i=t==t,o=Kt(t),a=void 0!==e,u=null===e,s=e==e,l=Kt(e);if(!u&&!l&&!o&&t>e||o&&a&&s&&!u&&!l||r&&a&&s||!n&&s||!i)return 1;if(!r&&!o&&!l&&t<e||l&&n&&i&&!r&&!o||u&&n&&i||!a&&i||!s)return-1}return 0}function Ad(t,e,n){e=e.length?Qt(e,(function(t){return te(t)?function(e){return Ri(e,1===t.length?t[0]:t)}:t})):[we];var r=-1;e=Qt(e,Ur(Ts));var i=Yl(t,(function(t,n,i){var o=Qt(e,(function(e){return e(t)}));return{criteria:o,index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(i,(function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,o=e.criteria,a=i.length,u=n.length;++r<a;){var s=Sd(i[r],o[r]);if(s)return r>=u?s:s*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function Pd(t){return Hi((function(e){return e=Qt(e,Ur(Ts)),Nr((function(n){var r=this;return t(e,(function(t){return Ye(t,r,n)}))}))}))}var Td=Pd(Qt),kd=Nr,Cd=Math.min,Od=kd((function(t,e){var n=(e=1==e.length&&te(e[0])?Qt(e[0],Ur(Ts)):Qt(Fi(e,1),Ur(Ts))).length;return Nr((function(r){for(var i=-1,o=Cd(r.length,n);++i<o;)r[i]=e[i].call(this,r[i]);return Ye(t,this,r)}))})),Id=Pd(Il),jd=Pd(Lu),Rd=9007199254740991,Dd=Math.floor;function Ld(t,e){var n="";if(!t||e<1||e>Rd)return n;do{e%2&&(n+=t),(e=Dd(e/2))&&(t+=t)}while(e);return n}var Bd=As("length"),zd="\\ud800-\\udfff",Wd="["+zd+"]",Fd="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Gd="\\ud83c[\\udffb-\\udfff]",Hd="[^"+zd+"]",Xd="(?:\\ud83c[\\udde6-\\uddff]){2}",Ud="[\\ud800-\\udbff][\\udc00-\\udfff]",Vd="(?:"+Fd+"|"+Gd+")"+"?",qd="[\\ufe0e\\ufe0f]?",Yd=qd+Vd+("(?:\\u200d(?:"+[Hd,Xd,Ud].join("|")+")"+qd+Vd+")*"),Zd="(?:"+[Hd+Fd+"?",Fd,Xd,Ud,Wd].join("|")+")",Kd=RegExp(Gd+"(?="+Gd+")|"+Zd+Yd,"g");function $d(t){return ho(t)?function(t){for(var e=Kd.lastIndex=0;Kd.test(t);)++e;return e}(t):Bd(t)}var Jd=Math.ceil;function Qd(t,e){var n=(e=void 0===e?" ":ie(e)).length;if(n<2)return n?Ld(e,t):e;var r=Ld(e,Jd(t/$d(e)));return ho(e)?lo(No(r),0,t).join(""):r.slice(0,t)}var th=Math.ceil,eh=Math.floor;var nh=/^\s+/,rh=Lt.parseInt;var ih=Nr((function(t,e){return vr(t,32,void 0,e,Xn(e,Bn(ih)))}));ih.placeholder={};var oh=Nr((function(t,e){return vr(t,64,void 0,e,Xn(e,Bn(oh)))}));oh.placeholder={};var ah=Bs((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var uh=Hi((function(t,e){return null==t?{}:function(t,e){return Ed(t,e,(function(e,n){return Ms(t,n)}))}(t,e)}));function sh(t,e,n,r){for(var i=n-1,o=t.length;++i<o;)if(r(t[i],e))return i;return-1}var lh=Array.prototype.splice;function ch(t,e,n,r){var i=r?sh:An,o=-1,a=e.length,u=t;for(t===e&&(e=ln(e)),n&&(u=Qt(t,Ur(n)));++o<a;)for(var s=0,l=e[o],c=n?n(l):l;(s=i(u,c,s,r))>-1;)u!==t&&lh.call(u,s,1),lh.call(t,s,1);return t}function dh(t,e){return t&&t.length&&e&&e.length?ch(t,e):t}var hh=Nr(dh);var ph=Array.prototype.splice;function fh(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;Fn(i)?ph.call(t,i,1):xd(t,i)}}return t}var vh=Hi((function(t,e){var n=null==t?0:t.length,r=Li(t,e);return fh(t,Qt(e,(function(t){return Fn(t,n)?+t:t})).sort(Sd)),r})),gh=Math.floor,yh=Math.random;function mh(t,e){return t+gh(yh()*(e-t+1))}var bh=parseFloat,xh=Math.min,_h=Math.random;var wh=Math.ceil,Mh=Math.max;function Eh(t){return function(e,n,r){return r&&"number"!=typeof r&&Tr(e,n,r)&&(n=r=void 0),e=xe(e),void 0===n?(n=e,e=0):n=xe(n),function(t,e,n,r){for(var i=-1,o=Mh(wh((e-t)/(n||1)),0),a=Array(o);o--;)a[r?o:++i]=t,t+=n;return a}(e,n,r=void 0===r?e<n?1:-1:xe(r),t)}}var Nh=Eh(),Sh=Eh(!0),Ah=Hi((function(t,e){return vr(t,256,void 0,void 0,void 0,e)}));function Ph(t,e,n,r,i){return i(t,(function(t,i,o){n=r?(r=!1,t):e(n,t,i,o)})),n}function Th(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}var kh=Array.prototype.reverse;function Ch(t){return null==t?t:kh.call(t)}var Oh=da("round");function Ih(t){var e=t.length;return e?t[mh(0,e-1)]:void 0}function jh(t){return Ih(vc(t))}function Rh(t,e){var n=-1,r=t.length,i=r-1;for(e=void 0===e?r:e;++n<e;){var o=mh(n,i),a=t[o];t[o]=t[n],t[n]=a}return t.length=e,t}function Dh(t,e){return Rh(ln(t),ga(e,0,t.length))}function Lh(t,e){var n=vc(t);return Rh(n,ga(e,0,n.length))}function Bh(t){return Rh(ln(t))}function zh(t){return Rh(vc(t))}var Wh=ua((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));function Fh(t,e){var n;return Ds(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}var Gh=Nr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&Tr(t,e[0],e[1])?e=[]:n>2&&Tr(e[0],e[1],e[2])&&(e=[e[0]]),Ad(t,Fi(e,1),[])})),Hh=4294967294,Xh=Math.floor,Uh=Math.min;function Vh(t,e,n,r){var i=0,o=null==t?0:t.length;if(0===o)return 0;for(var a=(e=n(e))!=e,u=null===e,s=Kt(e),l=void 0===e;i<o;){var c=Xh((i+o)/2),d=n(t[c]),h=void 0!==d,p=null===d,f=d==d,v=Kt(d);if(a)var g=r||f;else g=l?f&&(r||h):u?f&&h&&(r||!p):s?f&&h&&!p&&(r||!v):!p&&!v&&(r?d<=e:d<e);g?i=c+1:o=c}return Uh(o,Hh)}var qh=2147483647;function Yh(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=qh){for(;r<i;){var o=r+i>>>1,a=t[o];null!==a&&!Kt(a)&&(n?a<=e:a<e)?r=o+1:i=o}return i}return Vh(t,e,we,n)}function Zh(t,e){for(var n=-1,r=t.length,i=0,o=[];++n<r;){var a=t[n],u=e?e(a):a;if(!n||!br(u,s)){var s=u;o[i++]=0===a?0:a}}return o}var Kh=Math.max;var $h=ua((function(t,e,n){return t+(n?" ":"")+Ao(e)}));var Jh=oe((function(t,e){return t-e}),0);var Qh=Object.prototype,tp=Qh.hasOwnProperty;function ep(t,e,n,r){return void 0===t||br(t,Qh[n])&&!tp.call(r,n)?e:t}var np={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function rp(t){return"\\"+np[t]}var ip=/<%=([\s\S]+?)%>/g,op={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:ip,variable:"",imports:{_:{escape:kl}}},ap=/\b__p \+= '';/g,up=/\b(__p \+=) '' \+/g,sp=/(__e\(.*?\)|\b__t\)) \+\n'';/g,lp=/[()=,{}\[\]\/\s]/,cp=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,dp=/($^)/,hp=/['\n\r\u2028\u2029\\]/g,pp=Object.prototype.hasOwnProperty;function fp(t,e){return e(t)}var vp=4294967295,gp=Math.min;function yp(t,e){var n=t;return n instanceof en&&(n=n.value()),To(e,(function(t,e){return e.func.apply(e.thisArg,Bi([t],e.args))}),n)}function mp(){return yp(this.__wrapped__,this.__actions__)}var bp=9007199254740991;function xp(t,e){for(var n=t.length;n--&&An(e,t[n],0)>-1;);return n}function _p(t,e){for(var n=-1,r=t.length;++n<r&&An(e,t[n],0)>-1;);return n}var wp=/^\s+/;var Mp=/\w*$/;var Ep=ko({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Np=/&(?:amp|lt|gt|quot|#39);/g,Sp=RegExp(Np.source);var Ap=Ra&&1/Hu(new Ra([,-0]))[1]==1/0?function(t){return new Ra(t)}:nn,Pp=200;function Tp(t,e,n){var r=-1,i=Pn,o=t.length,a=!0,u=[],s=u;if(n)a=!1,i=sl;else if(o>=Pp){var l=e?null:Ap(t);if(l)return Hu(l);a=!1,i=Bu,s=new Du}else s=e?[]:u;t:for(;++r<o;){var c=t[r],d=e?e(c):c;if(c=n||0!==c?c:0,a&&d==d){for(var h=s.length;h--;)if(s[h]===d)continue t;e&&s.push(d),u.push(c)}else i(s,d,n)||(s!==u&&s.push(d),u.push(c))}return u}var kp=Nr((function(t){return Tp(Fi(t,1,Js,!0))})),Cp=Nr((function(t){var e=hl(t);return Js(e)&&(e=void 0),Tp(Fi(t,1,Js,!0),Ts(e))})),Op=Nr((function(t){var e=hl(t);return e="function"==typeof e?e:void 0,Tp(Fi(t,1,Js,!0),void 0,e)}));var Ip=0;var jp=Math.max;function Rp(t){if(!t||!t.length)return[];var e=0;return t=Ea(t,(function(t){if(Js(t))return e=jp(t.length,e),!0})),Ir(e,(function(e){return Qt(t,As(e))}))}function Dp(t,e){if(!t||!t.length)return[];var n=Rp(t);return null==e?n:Qt(n,(function(t){return Ye(e,void 0,t)}))}function Lp(t,e,n,r){return Md(t,e,n(Ri(t,e)),r)}var Bp=ua((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}));var zp=Nr((function(t,e){return Js(t)?cl(t,e):[]}));var Wp=Hi((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return Li(e,t)};return!(e>1||this.__actions__.length)&&r instanceof en&&Fn(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:fp,args:[i],thisArg:void 0}),new sn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(i)}));function Fp(t,e,n){var r=t.length;if(r<2)return r?Tp(t[0]):[];for(var i=-1,o=Array(r);++i<r;)for(var a=t[i],u=-1;++u<r;)u!=i&&(o[i]=cl(o[i]||a,t[u],e,n));return Tp(Fi(o,1),e,n)}var Gp=Nr((function(t){return Fp(Ea(t,Js))})),Hp=Nr((function(t){var e=hl(t);return Js(e)&&(e=void 0),Fp(Ea(t,Js),Ts(e))})),Xp=Nr((function(t){var e=hl(t);return e="function"==typeof e?e:void 0,Fp(Ea(t,Js),void 0,e)})),Up=Nr(Rp);function Vp(t,e,n){for(var r=-1,i=t.length,o=e.length,a={};++r<i;){var u=r<o?e[r]:void 0;n(a,t[r],u)}return a}var qp=Nr((function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,Dp(t,n)})),Yp={chunk:function(t,e,n){e=(n?Tr(t,e,n):void 0===e)?1:va(_e(e),0);var r=null==t?0:t.length;if(!r||e<1)return[];for(var i=0,o=0,a=Array(fa(r/e));i<r;)a[o++]=so(t,i,i+=e);return a},compact:function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i},concat:function(){var t=arguments.length;if(!t)return[];for(var e=Array(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return Bi(te(n)?ln(n):[n],Fi(e,1))},difference:dl,differenceBy:pl,differenceWith:fl,drop:function(t,e,n){var r=null==t?0:t.length;return r?so(t,(e=n||void 0===e?1:_e(e))<0?0:e,r):[]},dropRight:function(t,e,n){var r=null==t?0:t.length;return r?so(t,0,(e=r-(e=n||void 0===e?1:_e(e)))<0?0:e):[]},dropRightWhile:function(t,e){return t&&t.length?gl(t,Ts(e),!0,!0):[]},dropWhile:function(t,e){return t&&t.length?gl(t,Ts(e),!0):[]},fill:function(t,e,n,r){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&Tr(t,e,n)&&(n=0,r=i),function(t,e,n,r){var i=t.length;for((n=_e(n))<0&&(n=-n>i?0:i+n),(r=void 0===r||r>i?i:_e(r))<0&&(r+=i),r=n>r?0:Dl(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},findIndex:Wl,findLastIndex:Ul,first:ql,flatten:Gi,flattenDeep:function(t){return(null==t?0:t.length)?Fi(t,Infinity):[]},flattenDepth:function(t,e){return(null==t?0:t.length)?Fi(t,e=void 0===e?1:_e(e)):[]},fromPairs:function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},head:ql,indexOf:function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:_e(n);return i<0&&(i=yc(r+i,0)),An(t,e,i)},initial:function(t){return(null==t?0:t.length)?so(t,0,-1):[]},intersection:_c,intersectionBy:wc,intersectionWith:Mc,join:function(t,e){return null==t?"":Yc.call(t,e)},last:hl,lastIndexOf:function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=_e(n))<0?$c(r+i,0):Jc(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):Nn(t,Sn,i,!0)},nth:function(t,e){return t&&t.length?bd(t,_e(e)):void 0},pull:hh,pullAll:dh,pullAllBy:function(t,e,n){return t&&t.length&&e&&e.length?ch(t,e,Ts(n)):t},pullAllWith:function(t,e,n){return t&&t.length&&e&&e.length?ch(t,e,void 0,n):t},pullAt:vh,remove:function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],o=t.length;for(e=Ts(e);++r<o;){var a=t[r];e(a,r,t)&&(n.push(a),i.push(r))}return fh(t,i),n},reverse:Ch,slice:function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&Tr(t,e,n)?(e=0,n=r):(e=null==e?0:_e(e),n=void 0===n?r:_e(n)),so(t,e,n)):[]},sortedIndex:function(t,e){return Yh(t,e)},sortedIndexBy:function(t,e,n){return Vh(t,e,Ts(n))},sortedIndexOf:function(t,e){var n=null==t?0:t.length;if(n){var r=Yh(t,e);if(r<n&&br(t[r],e))return r}return-1},sortedLastIndex:function(t,e){return Yh(t,e,!0)},sortedLastIndexBy:function(t,e,n){return Vh(t,e,Ts(n),!0)},sortedLastIndexOf:function(t,e){if(null==t?0:t.length){var n=Yh(t,e,!0)-1;if(br(t[n],e))return n}return-1},sortedUniq:function(t){return t&&t.length?Zh(t):[]},sortedUniqBy:function(t,e){return t&&t.length?Zh(t,Ts(e)):[]},tail:function(t){var e=null==t?0:t.length;return e?so(t,1,e):[]},take:function(t,e,n){return t&&t.length?so(t,0,(e=n||void 0===e?1:_e(e))<0?0:e):[]},takeRight:function(t,e,n){var r=null==t?0:t.length;return r?so(t,(e=r-(e=n||void 0===e?1:_e(e)))<0?0:e,r):[]},takeRightWhile:function(t,e){return t&&t.length?gl(t,Ts(e),!1,!0):[]},takeWhile:function(t,e){return t&&t.length?gl(t,Ts(e)):[]},union:kp,unionBy:Cp,unionWith:Op,uniq:function(t){return t&&t.length?Tp(t):[]},uniqBy:function(t,e){return t&&t.length?Tp(t,Ts(e)):[]},uniqWith:function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Tp(t,void 0,e):[]},unzip:Rp,unzipWith:Dp,without:zp,xor:Gp,xorBy:Hp,xorWith:Xp,zip:Up,zipObject:function(t,e){return Vp(t||[],e||[],_r)},zipObjectDeep:function(t,e){return Vp(t||[],e||[],Md)},zipWith:qp},Zp={countBy:Ws,each:ml,eachRight:Ml,every:function(t,e,n){var r=te(t)?Il:jl;return n&&Tr(t,e,n)&&(e=void 0),r(t,Ts(e))},filter:function(t,e){return(te(t)?Ea:Ll)(t,Ts(e))},find:Fl,findLast:Vl,flatMap:function(t,e){return Fi(Zl(t,e),1)},flatMapDeep:function(t,e){return Fi(Zl(t,e),Infinity)},flatMapDepth:function(t,e,n){return n=void 0===n?1:_e(n),Fi(Zl(t,e),n)},forEach:ml,forEachRight:Ml,groupBy:nc,includes:function(t,e,n,r){t=Pr(t)?t:vc(t),n=n&&!r?_e(n):0;var i=t.length;return n<0&&(n=gc(i+n,0)),pc(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&An(t,e,n)>-1},invokeMap:jc,keyBy:Kc,map:Zl,orderBy:function(t,e,n,r){return null==t?[]:(te(e)||(e=null==e?[]:[e]),te(n=r?void 0:n)||(n=null==n?[]:[n]),Ad(t,e,n))},partition:ah,reduce:function(t,e,n){var r=te(t)?To:Ph,i=arguments.length<3;return r(t,Ts(e),n,i,Ds)},reduceRight:function(t,e,n){var r=te(t)?Th:Ph,i=arguments.length<3;return r(t,Ts(e),n,i,wl)},reject:function(t,e){return(te(t)?Ea:Ll)(t,fd(Ts(e)))},sample:function(t){return(te(t)?Ih:jh)(t)},sampleSize:function(t,e,n){return e=(n?Tr(t,e,n):void 0===e)?1:_e(e),(te(t)?Dh:Lh)(t,e)},shuffle:function(t){return(te(t)?Bh:zh)(t)},size:function(t){if(null==t)return 0;if(Pr(t))return pc(t)?$d(t):t.length;var e=qa(t);return"[object Map]"==e||"[object Set]"==e?t.size:ri(t).length},some:function(t,e,n){var r=te(t)?Lu:Fh;return n&&Tr(t,e,n)&&(e=void 0),r(t,Ts(e))},sortBy:Gh},Kp=Hs,$p={after:function(t,e){if("function"!=typeof e)throw new TypeError("Expected a function");return t=_e(t),function(){if(--t<1)return e.apply(this,arguments)}},ary:yr,before:io,bind:oo,bindKey:uo,curry:Fs,curryRight:Gs,debounce:qs,defer:al,delay:ul,flip:function(t){return vr(t,512)},memoize:Ai,negate:fd,once:function(t){return io(2,t)},overArgs:Od,partial:ih,partialRight:oh,rearg:Ah,rest:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return Nr(t,e=void 0===e?e:_e(e))},spread:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return e=null==e?0:Kh(_e(e),0),Nr((function(n){var r=n[e],i=lo(n,0,e);return r&&Bi(i,r),Ye(t,this,i)}))},throttle:function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return de(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),qs(t,e,{leading:r,maxWait:e,trailing:i})},unary:function(t){return yr(t,1)},wrap:function(t,e){return ih(yl(e),t)}},Jp={castArray:function(){if(!arguments.length)return[];var t=arguments[0];return te(t)?t:[t]},clone:function(t){return ju(t,4)},cloneDeep:Ru,cloneDeepWith:function(t,e){return ju(t,5,e="function"==typeof e?e:void 0)},cloneWith:function(t,e){return ju(t,4,e="function"==typeof e?e:void 0)},conformsTo:function(t,e){return null==e||ks(t,e,ii(e))},eq:br,gt:oc,gte:ac,isArguments:Br,isArray:te,isArrayBuffer:Dc,isArrayLike:Pr,isArrayLikeObject:Js,isBoolean:function(t){return!0===t||!1===t||Yt(t)&&"[object Boolean]"==qt(t)},isBuffer:Hr,isDate:Bc,isElement:function(t){return Yt(t)&&1===t.nodeType&&!Ji(t)},isEmpty:function(t){if(null==t)return!0;if(Pr(t)&&(te(t)||"string"==typeof t||"function"==typeof t.splice||Hr(t)||$r(t)||Br(t)))return!t.length;var e=qa(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(Or(t))return!ri(t).length;for(var n in t)if(zc.call(t,n))return!1;return!0},isEqual:function(t,e){return ps(t,e)},isEqualWith:function(t,e,n){var r=(n="function"==typeof n?n:void 0)?n(t,e):void 0;return void 0===r?ps(t,e,void 0,n):!!r},isError:eo,isFinite:function(t){return"number"==typeof t&&Wc(t)},isFunction:Ae,isInteger:Fc,isLength:Ar,isMap:Mu,isMatch:function(t,e){return t===e||gs(t,e,ms(e))},isMatchWith:function(t,e,n){return n="function"==typeof n?n:void 0,gs(t,e,ms(e),n)},isNaN:function(t){return Hc(t)&&t!=+t},isNative:function(t){if(Xc(t))throw new Error("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return ze(t)},isNil:function(t){return null==t},isNull:function(t){return null===t},isNumber:Hc,isObject:de,isObjectLike:Yt,isPlainObject:Ji,isRegExp:Vc,isSafeInteger:function(t){return Fc(t)&&t>=-9007199254740991&&t<=qc},isSet:Nu,isString:pc,isSymbol:Kt,isTypedArray:$r,isUndefined:function(t){return void 0===t},isWeakMap:function(t){return Yt(t)&&"[object WeakMap]"==qa(t)},isWeakSet:function(t){return Yt(t)&&"[object WeakSet]"==qt(t)},lt:nd,lte:rd,toArray:md,toFinite:xe,toInteger:_e,toLength:Dl,toNumber:ye,toPlainObject:tl,toSafeInteger:function(t){return t?ga(_e(t),-9007199254740991,bp):0===t?t:0},toString:Ci},Qp={add:ae,ceil:ha,divide:vl,floor:Kl,max:function(t){return t&&t.length?id(t,we,rc):void 0},maxBy:function(t,e){return t&&t.length?id(t,Ts(e),rc):void 0},mean:function(t){return ud(t,we)},meanBy:function(t,e){return ud(t,Ts(e))},min:function(t){return t&&t.length?id(t,we,ed):void 0},minBy:function(t,e){return t&&t.length?id(t,Ts(e),ed):void 0},multiply:hd,round:Oh,subtract:Jh,sum:function(t){return t&&t.length?od(t,we):0},sumBy:function(t,e){return t&&t.length?od(t,Ts(e)):0}},tf=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=ye(n))==n?n:0),void 0!==e&&(e=(e=ye(e))==e?e:0),ga(ye(t),e,n)},ef=function(t,e,n){return e=xe(e),void 0===n?(n=e,e=0):n=xe(n),function(t,e,n){return t>=dc(e,n)&&t<cc(e,n)}(t=ye(t),e,n)},nf=function(t,e,n){if(n&&"boolean"!=typeof n&&Tr(t,e,n)&&(e=n=void 0),void 0===n&&("boolean"==typeof e?(n=e,e=void 0):"boolean"==typeof t&&(n=t,t=void 0)),void 0===t&&void 0===e?(t=0,e=1):(t=xe(t),void 0===e?(e=t,t=0):e=xe(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var i=_h();return xh(t+i*(e-t+bh("1e-"+((i+"").length-1))),e)}return mh(t,e)},rf={assign:ai,assignIn:ci,assignInWith:di,assignWith:hi,at:Xi,create:function(t,e){var n=Ue(t);return null==e?n:ma(n,e)},defaults:Ks,defaultsDeep:il,entries:Nl,entriesIn:Sl,extend:ci,extendWith:di,findKey:function(t,e){return Gl(t,Ts(e),js)},findLastKey:function(t,e){return Gl(t,Ts(e),_l)},forIn:function(t,e){return null==t?t:Is(t,yl(e),li)},forInRight:function(t,e){return null==t?t:xl(t,yl(e),li)},forOwn:function(t,e){return t&&js(t,yl(e))},forOwnRight:function(t,e){return t&&_l(t,yl(e))},functions:function(t){return null==t?[]:tc(t,ii(t))},functionsIn:function(t){return null==t?[]:tc(t,li(t))},get:Di,has:lc,hasIn:Ms,invert:Sc,invertBy:kc,invoke:Ic,keys:ii,keysIn:li,mapKeys:function(t,e){var n={};return e=Ts(e),js(t,(function(t,r,i){mr(n,e(t,r,i),t)})),n},mapValues:function(t,e){var n={};return e=Ts(e),js(t,(function(t,r,i){mr(n,r,e(t,r,i))})),n},merge:sd,mergeWith:rl,omit:wd,omitBy:function(t,e){return Nd(t,fd(Ts(e)))},pick:uh,pickBy:Nd,result:function(t,e,n){var r=-1,i=(e=Oi(e,t)).length;for(i||(i=1,t=void 0);++r<i;){var o=null==t?void 0:t[ji(e[r])];void 0===o&&(r=i,o=n),t=Ae(o)?o.call(t):o}return t},set:function(t,e,n){return null==t?t:Md(t,e,n)},setWith:function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:Md(t,e,n,r)},toPairs:Nl,toPairsIn:Sl,transform:function(t,e,n){var r=te(t),i=r||Hr(t)||$r(t);if(e=Ts(e),null==n){var o=t&&t.constructor;n=i?r?new o:[]:de(t)&&Ae(o)?Ue(Ui(t)):{}}return(i?En:js)(t,(function(t,r,i){return e(n,t,r,i)})),n},unset:function(t,e){return null==t||xd(t,e)},update:function(t,e,n){return null==t?t:Lp(t,e,yl(n))},updateWith:function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:Lp(t,e,yl(n),r)},values:vc,valuesIn:function(t){return null==t?[]:fc(t,li(t))}},of={at:Wp,chain:pa,commit:function(){return new sn(this.value(),this.__chain__)},lodash:hn,next:function(){void 0===this.__values__&&(this.__values__=md(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},plant:function(t){for(var e,n=this;n instanceof Qe;){var r=cn(n);r.__index__=0,r.__values__=void 0,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},reverse:function(){var t=this.__wrapped__;if(t instanceof en){var e=t;return this.__actions__.length&&(e=new en(this)),(e=e.reverse()).__actions__.push({func:fp,args:[Ch],thisArg:void 0}),new sn(e,this.__chain__)}return this.thru(Ch)},tap:function(t,e){return e(t),t},thru:fp,toIterator:function(){return this},toJSON:mp,value:mp,valueOf:mp,wrapperChain:function(){return pa(this)}},af={camelCase:sa,capitalize:Po,deburr:jo,endsWith:function(t,e,n){t=Ci(t),e=ie(e);var r=t.length,i=n=void 0===n?r:ga(_e(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},escape:kl,escapeRegExp:function(t){return(t=Ci(t))&&Ol.test(t)?t.replace(Cl,"\\$&"):t},kebabCase:Zc,lowerCase:Qc,lowerFirst:td,pad:function(t,e,n){t=Ci(t);var r=(e=_e(e))?$d(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Qd(eh(i),n)+t+Qd(th(i),n)},padEnd:function(t,e,n){t=Ci(t);var r=(e=_e(e))?$d(t):0;return e&&r<e?t+Qd(e-r,n):t},padStart:function(t,e,n){t=Ci(t);var r=(e=_e(e))?$d(t):0;return e&&r<e?Qd(e-r,n)+t:t},parseInt:function(t,e,n){return n||null==e?e=0:e&&(e=+e),rh(Ci(t).replace(nh,""),e||0)},repeat:function(t,e,n){return e=(n?Tr(t,e,n):void 0===e)?1:_e(e),Ld(Ci(t),e)},replace:function(){var t=arguments,e=Ci(t[0]);return t.length<3?e:e.replace(t[1],t[2])},snakeCase:Wh,split:function(t,e,n){return n&&"number"!=typeof n&&Tr(t,e,n)&&(e=n=void 0),(n=void 0===n?4294967295:n>>>0)?(t=Ci(t))&&("string"==typeof e||null!=e&&!Vc(e))&&!(e=ie(e))&&ho(t)?lo(No(t),0,n):t.split(e,n):[]},startCase:$h,startsWith:function(t,e,n){return t=Ci(t),n=null==n?0:ga(_e(n),0,t.length),e=ie(e),t.slice(n,n+e.length)==e},template:function(t,e,n){var r=op.imports._.templateSettings||op;n&&Tr(t,e,n)&&(e=void 0),t=Ci(t),e=di({},e,r,ep);var i,o,a=di({},e.imports,r.imports,ep),u=ii(a),s=fc(a,u),l=0,c=e.interpolate||dp,d="__p += '",h=RegExp((e.escape||dp).source+"|"+c.source+"|"+(c===ip?cp:dp).source+"|"+(e.evaluate||dp).source+"|$","g"),p=pp.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(h,(function(e,n,r,a,u,s){return r||(r=a),d+=t.slice(l,s).replace(hp,rp),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),u&&(o=!0,d+="';\n"+u+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=s+e.length,e})),d+="';\n";var f=pp.call(e,"variable")&&e.variable;if(f){if(lp.test(f))throw new Error("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(o?d.replace(ap,""):d).replace(up,"$1").replace(sp,"$1;"),d="function("+(f||"obj")+") {\n"+(f?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var v=no((function(){return Function(u,p+"return "+d).apply(void 0,s)}));if(v.source=d,eo(v))throw v;return v},templateSettings:op,toLower:function(t){return Ci(t).toLowerCase()},toUpper:function(t){return Ci(t).toUpperCase()},trim:function(t,e,n){if((t=Ci(t))&&(n||void 0===e))return ce(t);if(!t||!(e=ie(e)))return t;var r=No(t),i=No(e);return lo(r,_p(r,i),xp(r,i)+1).join("")},trimEnd:function(t,e,n){if((t=Ci(t))&&(n||void 0===e))return t.slice(0,se(t)+1);if(!t||!(e=ie(e)))return t;var r=No(t);return lo(r,0,xp(r,No(e))+1).join("")},trimStart:function(t,e,n){if((t=Ci(t))&&(n||void 0===e))return t.replace(wp,"");if(!t||!(e=ie(e)))return t;var r=No(t);return lo(r,_p(r,No(e))).join("")},truncate:function(t,e){var n=30,r="...";if(de(e)){var i="separator"in e?e.separator:i;n="length"in e?_e(e.length):n,r="omission"in e?ie(e.omission):r}var o=(t=Ci(t)).length;if(ho(t)){var a=No(t);o=a.length}if(n>=o)return t;var u=n-$d(r);if(u<1)return r;var s=a?lo(a,0,u).join(""):t.slice(0,u);if(void 0===i)return s+r;if(a&&(u+=s.length-u),Vc(i)){if(t.slice(u).search(i)){var l,c=s;for(i.global||(i=RegExp(i.source,Ci(Mp.exec(i))+"g")),i.lastIndex=0;l=i.exec(c);)var d=l.index;s=s.slice(0,void 0===d?u:d)}}else if(t.indexOf(ie(i),u)!=u){var h=s.lastIndexOf(i);h>-1&&(s=s.slice(0,h))}return s+r},unescape:function(t){return(t=Ci(t))&&Sp.test(t)?t.replace(Np,Ep):t},upperCase:Bp,upperFirst:Ao,words:oa},uf={attempt:no,bindAll:ao,cond:function(t){var e=null==t?0:t.length,n=Ts;return t=e?Qt(t,(function(t){if("function"!=typeof t[1])throw new TypeError("Expected a function");return[n(t[0]),t[1]]})):[],Nr((function(n){for(var r=-1;++r<e;){var i=t[r];if(Ye(i[0],this,n))return Ye(i[1],this,n)}}))},conforms:function(t){return function(t){var e=ii(t);return function(n){return ks(n,t,e)}}(ju(t,1))},constant:xn,defaultTo:function(t,e){return null==t||t!=t?e:t},flow:Jl,flowRight:Ql,identity:we,iteratee:function(t){return Ts("function"==typeof t?t:ju(t,1))},matches:function(t){return xs(ju(t,1))},matchesProperty:function(t,e){return Ss(t,ju(e,1))},method:ld,methodOf:cd,mixin:dd,noop:nn,nthArg:function(t){return t=_e(t),Nr((function(e){return bd(e,t)}))},over:Td,overEvery:Id,overSome:jd,property:Ps,propertyOf:function(t){return function(e){return null==t?void 0:Ri(t,e)}},range:Nh,rangeRight:Sh,stubArray:Na,stubFalse:zr,stubObject:function(){return{}},stubString:function(){return""},stubTrue:function(){return!0},times:function(t,e){if((t=_e(t))<1||t>9007199254740991)return[];var n=vp,r=gp(t,vp);e=yl(e),t-=vp;for(var i=Ir(r,e);++n<t;)e(n);return i},toPath:function(t){return te(t)?Qt(t,ji):Kt(t)?[t]:ln(ki(Ci(t)))},uniqueId:function(t){var e=++Ip;return Ci(t)+e}};var sf=Math.max,lf=Math.min;var cf=Math.min;
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Lodash (Custom Build) <https://lodash.com/>
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
9
9
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
10
10
|
*/
|
|
11
|
-
var lf,cf,df=4294967295,hf=Array.prototype,pf=Object.prototype.hasOwnProperty,ff=Dt?Dt.iterator:void 0,vf=Math.max,gf=Math.min,yf=function(t){return function(e,n,r){if(null==r){var i=le(n),o=i&&ni(n),a=o&&o.length&&Jl(n,o);(a?a.length:i)||(r=n,n=e,e=this)}return t(e,n,r)}}(ld);cn.after=Zp.after,cn.ary=Zp.ary,cn.assign=ef.assign,cn.assignIn=ef.assignIn,cn.assignInWith=ef.assignInWith,cn.assignWith=ef.assignWith,cn.at=ef.at,cn.before=Zp.before,cn.bind=Zp.bind,cn.bindAll=of.bindAll,cn.bindKey=Zp.bindKey,cn.castArray=Kp.castArray,cn.chain=nf.chain,cn.chunk=Vp.chunk,cn.compact=Vp.compact,cn.concat=Vp.concat,cn.cond=of.cond,cn.conforms=of.conforms,cn.constant=of.constant,cn.countBy=Yp.countBy,cn.create=ef.create,cn.curry=Zp.curry,cn.curryRight=Zp.curryRight,cn.debounce=Zp.debounce,cn.defaults=ef.defaults,cn.defaultsDeep=ef.defaultsDeep,cn.defer=Zp.defer,cn.delay=Zp.delay,cn.difference=Vp.difference,cn.differenceBy=Vp.differenceBy,cn.differenceWith=Vp.differenceWith,cn.drop=Vp.drop,cn.dropRight=Vp.dropRight,cn.dropRightWhile=Vp.dropRightWhile,cn.dropWhile=Vp.dropWhile,cn.fill=Vp.fill,cn.filter=Yp.filter,cn.flatMap=Yp.flatMap,cn.flatMapDeep=Yp.flatMapDeep,cn.flatMapDepth=Yp.flatMapDepth,cn.flatten=Vp.flatten,cn.flattenDeep=Vp.flattenDeep,cn.flattenDepth=Vp.flattenDepth,cn.flip=Zp.flip,cn.flow=of.flow,cn.flowRight=of.flowRight,cn.fromPairs=Vp.fromPairs,cn.functions=ef.functions,cn.functionsIn=ef.functionsIn,cn.groupBy=Yp.groupBy,cn.initial=Vp.initial,cn.intersection=Vp.intersection,cn.intersectionBy=Vp.intersectionBy,cn.intersectionWith=Vp.intersectionWith,cn.invert=ef.invert,cn.invertBy=ef.invertBy,cn.invokeMap=Yp.invokeMap,cn.iteratee=of.iteratee,cn.keyBy=Yp.keyBy,cn.keys=ni,cn.keysIn=ef.keysIn,cn.map=Yp.map,cn.mapKeys=ef.mapKeys,cn.mapValues=ef.mapValues,cn.matches=of.matches,cn.matchesProperty=of.matchesProperty,cn.memoize=Zp.memoize,cn.merge=ef.merge,cn.mergeWith=ef.mergeWith,cn.method=of.method,cn.methodOf=of.methodOf,cn.mixin=yf,cn.negate=hd,cn.nthArg=of.nthArg,cn.omit=ef.omit,cn.omitBy=ef.omitBy,cn.once=Zp.once,cn.orderBy=Yp.orderBy,cn.over=of.over,cn.overArgs=Zp.overArgs,cn.overEvery=of.overEvery,cn.overSome=of.overSome,cn.partial=Zp.partial,cn.partialRight=Zp.partialRight,cn.partition=Yp.partition,cn.pick=ef.pick,cn.pickBy=ef.pickBy,cn.property=of.property,cn.propertyOf=of.propertyOf,cn.pull=Vp.pull,cn.pullAll=Vp.pullAll,cn.pullAllBy=Vp.pullAllBy,cn.pullAllWith=Vp.pullAllWith,cn.pullAt=Vp.pullAt,cn.range=of.range,cn.rangeRight=of.rangeRight,cn.rearg=Zp.rearg,cn.reject=Yp.reject,cn.remove=Vp.remove,cn.rest=Zp.rest,cn.reverse=Vp.reverse,cn.sampleSize=Yp.sampleSize,cn.set=ef.set,cn.setWith=ef.setWith,cn.shuffle=Yp.shuffle,cn.slice=Vp.slice,cn.sortBy=Yp.sortBy,cn.sortedUniq=Vp.sortedUniq,cn.sortedUniqBy=Vp.sortedUniqBy,cn.split=rf.split,cn.spread=Zp.spread,cn.tail=Vp.tail,cn.take=Vp.take,cn.takeRight=Vp.takeRight,cn.takeRightWhile=Vp.takeRightWhile,cn.takeWhile=Vp.takeWhile,cn.tap=nf.tap,cn.throttle=Zp.throttle,cn.thru=hp,cn.toArray=Kp.toArray,cn.toPairs=ef.toPairs,cn.toPairsIn=ef.toPairsIn,cn.toPath=of.toPath,cn.toPlainObject=Kp.toPlainObject,cn.transform=ef.transform,cn.unary=Zp.unary,cn.union=Vp.union,cn.unionBy=Vp.unionBy,cn.unionWith=Vp.unionWith,cn.uniq=Vp.uniq,cn.uniqBy=Vp.uniqBy,cn.uniqWith=Vp.uniqWith,cn.unset=ef.unset,cn.unzip=Vp.unzip,cn.unzipWith=Vp.unzipWith,cn.update=ef.update,cn.updateWith=ef.updateWith,cn.values=ef.values,cn.valuesIn=ef.valuesIn,cn.without=Vp.without,cn.words=rf.words,cn.wrap=Zp.wrap,cn.xor=Vp.xor,cn.xorBy=Vp.xorBy,cn.xorWith=Vp.xorWith,cn.zip=Vp.zip,cn.zipObject=Vp.zipObject,cn.zipObjectDeep=Vp.zipObjectDeep,cn.zipWith=Vp.zipWith,cn.entries=ef.toPairs,cn.entriesIn=ef.toPairsIn,cn.extend=ef.assignIn,cn.extendWith=ef.assignInWith,yf(cn,cn),cn.add=$p.add,cn.attempt=of.attempt,cn.camelCase=rf.camelCase,cn.capitalize=rf.capitalize,cn.ceil=$p.ceil,cn.clamp=Jp,cn.clone=Kp.clone,cn.cloneDeep=Kp.cloneDeep,cn.cloneDeepWith=Kp.cloneDeepWith,cn.cloneWith=Kp.cloneWith,cn.conformsTo=Kp.conformsTo,cn.deburr=rf.deburr,cn.defaultTo=of.defaultTo,cn.divide=$p.divide,cn.endsWith=rf.endsWith,cn.eq=Kp.eq,cn.escape=rf.escape,cn.escapeRegExp=rf.escapeRegExp,cn.every=Yp.every,cn.find=Yp.find,cn.findIndex=Vp.findIndex,cn.findKey=ef.findKey,cn.findLast=Yp.findLast,cn.findLastIndex=Vp.findLastIndex,cn.findLastKey=ef.findLastKey,cn.floor=$p.floor,cn.forEach=Yp.forEach,cn.forEachRight=Yp.forEachRight,cn.forIn=ef.forIn,cn.forInRight=ef.forInRight,cn.forOwn=ef.forOwn,cn.forOwnRight=ef.forOwnRight,cn.get=ef.get,cn.gt=Kp.gt,cn.gte=Kp.gte,cn.has=ef.has,cn.hasIn=ef.hasIn,cn.head=Vp.head,cn.identity=xe,cn.includes=Yp.includes,cn.indexOf=Vp.indexOf,cn.inRange=Qp,cn.invoke=ef.invoke,cn.isArguments=Kp.isArguments,cn.isArray=Jt,cn.isArrayBuffer=Kp.isArrayBuffer,cn.isArrayLike=Kp.isArrayLike,cn.isArrayLikeObject=Kp.isArrayLikeObject,cn.isBoolean=Kp.isBoolean,cn.isBuffer=Kp.isBuffer,cn.isDate=Kp.isDate,cn.isElement=Kp.isElement,cn.isEmpty=Kp.isEmpty,cn.isEqual=Kp.isEqual,cn.isEqualWith=Kp.isEqualWith,cn.isError=Kp.isError,cn.isFinite=Kp.isFinite,cn.isFunction=Kp.isFunction,cn.isInteger=Kp.isInteger,cn.isLength=Kp.isLength,cn.isMap=Kp.isMap,cn.isMatch=Kp.isMatch,cn.isMatchWith=Kp.isMatchWith,cn.isNaN=Kp.isNaN,cn.isNative=Kp.isNative,cn.isNil=Kp.isNil,cn.isNull=Kp.isNull,cn.isNumber=Kp.isNumber,cn.isObject=le,cn.isObjectLike=Kp.isObjectLike,cn.isPlainObject=Kp.isPlainObject,cn.isRegExp=Kp.isRegExp,cn.isSafeInteger=Kp.isSafeInteger,cn.isSet=Kp.isSet,cn.isString=Kp.isString,cn.isSymbol=Kp.isSymbol,cn.isTypedArray=Kp.isTypedArray,cn.isUndefined=Kp.isUndefined,cn.isWeakMap=Kp.isWeakMap,cn.isWeakSet=Kp.isWeakSet,cn.join=Vp.join,cn.kebabCase=rf.kebabCase,cn.last=cl,cn.lastIndexOf=Vp.lastIndexOf,cn.lowerCase=rf.lowerCase,cn.lowerFirst=rf.lowerFirst,cn.lt=Kp.lt,cn.lte=Kp.lte,cn.max=$p.max,cn.maxBy=$p.maxBy,cn.mean=$p.mean,cn.meanBy=$p.meanBy,cn.min=$p.min,cn.minBy=$p.minBy,cn.stubArray=of.stubArray,cn.stubFalse=of.stubFalse,cn.stubObject=of.stubObject,cn.stubString=of.stubString,cn.stubTrue=of.stubTrue,cn.multiply=$p.multiply,cn.nth=Vp.nth,cn.noop=of.noop,cn.now=qp,cn.pad=rf.pad,cn.padEnd=rf.padEnd,cn.padStart=rf.padStart,cn.parseInt=rf.parseInt,cn.random=tf,cn.reduce=Yp.reduce,cn.reduceRight=Yp.reduceRight,cn.repeat=rf.repeat,cn.replace=rf.replace,cn.result=ef.result,cn.round=$p.round,cn.sample=Yp.sample,cn.size=Yp.size,cn.snakeCase=rf.snakeCase,cn.some=Yp.some,cn.sortedIndex=Vp.sortedIndex,cn.sortedIndexBy=Vp.sortedIndexBy,cn.sortedIndexOf=Vp.sortedIndexOf,cn.sortedLastIndex=Vp.sortedLastIndex,cn.sortedLastIndexBy=Vp.sortedLastIndexBy,cn.sortedLastIndexOf=Vp.sortedLastIndexOf,cn.startCase=rf.startCase,cn.startsWith=rf.startsWith,cn.subtract=$p.subtract,cn.sum=$p.sum,cn.sumBy=$p.sumBy,cn.template=rf.template,cn.times=of.times,cn.toFinite=Kp.toFinite,cn.toInteger=be,cn.toLength=Kp.toLength,cn.toLower=rf.toLower,cn.toNumber=Kp.toNumber,cn.toSafeInteger=Kp.toSafeInteger,cn.toString=Kp.toString,cn.toUpper=rf.toUpper,cn.trim=rf.trim,cn.trimEnd=rf.trimEnd,cn.trimStart=rf.trimStart,cn.truncate=rf.truncate,cn.unescape=rf.unescape,cn.uniqueId=of.uniqueId,cn.upperCase=rf.upperCase,cn.upperFirst=rf.upperFirst,cn.each=Yp.forEach,cn.eachRight=Yp.forEachRight,cn.first=Vp.head,yf(cn,(lf={},ks(cn,(function(t,e){pf.call(cn.prototype,e)||(lf[e]=t)})),lf),{chain:!1}),cn.VERSION="4.17.21",(cn.templateSettings=rf.templateSettings).imports._=cn,wn(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){cn[t].placeholder=cn})),wn(["drop","take"],(function(t,e){Qe.prototype[t]=function(n){n=void 0===n?1:vf(be(n),0);var r=this.__filtered__&&!e?new Qe(this):this.clone();return r.__filtered__?r.__takeCount__=gf(n,r.__takeCount__):r.__views__.push({size:gf(n,df),type:t+(r.__dir__<0?"Right":"")}),r},Qe.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),wn(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Qe.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:As(t),type:n}),e.__filtered__=e.__filtered__||r,e}})),wn(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Qe.prototype[t]=function(){return this[n](1).value()[0]}})),wn(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Qe.prototype[t]=function(){return this.__filtered__?new Qe(this):this[n](1)}})),Qe.prototype.compact=function(){return this.filter(xe)},Qe.prototype.find=function(t){return this.filter(t).head()},Qe.prototype.findLast=function(t){return this.reverse().find(t)},Qe.prototype.invokeMap=Mr((function(t,e){return"function"==typeof t?new Qe(this):this.map((function(n){return Tc(n,t,e)}))})),Qe.prototype.reject=function(t){return this.filter(hd(As(t)))},Qe.prototype.slice=function(t,e){t=be(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Qe(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=be(e))<0?n.dropRight(-e):n.take(e-t)),n)},Qe.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Qe.prototype.toArray=function(){return this.take(df)},ks(Qe.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=cn[r?"take"+("last"==e?"Right":""):e],o=r||/^find/.test(e);i&&(cn.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,u=e instanceof Qe,s=a[0],l=u||Jt(e),c=function(t){var e=i.apply(cn,Di([t],a));return r&&d?e[0]:e};l&&n&&"function"==typeof s&&1!=s.length&&(u=l=!1);var d=this.__chain__,h=!!this.__actions__.length,p=o&&!d,f=u&&!h;if(!o&&l){e=f?e:new Qe(this);var v=t.apply(e,a);return v.__actions__.push({func:hp,args:[c],thisArg:void 0}),new an(v,d)}return p&&f?t.apply(this,a):(v=this.thru(c),p?r?v.value()[0]:v.value():v)})})),wn(["pop","push","shift","sort","splice","unshift"],(function(t){var e=hf[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);cn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Jt(i)?i:[],t)}return this[n]((function(n){return e.apply(Jt(n)?n:[],t)}))}})),ks(Qe.prototype,(function(t,e){var n=cn[e];if(n){var r=n.name+"";pf.call(nn,r)||(nn[r]=[]),nn[r].push({name:e,func:n})}})),nn[Zn(void 0,2).name]=[{name:"wrapper",func:void 0}],Qe.prototype.clone=function(){var t=new Qe(this.__wrapped__);return t.__actions__=un(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=un(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=un(this.__views__),t},Qe.prototype.reverse=function(){if(this.__filtered__){var t=new Qe(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Qe.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Jt(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=uf(e,t+a);break;case"takeRight":t=af(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=o.start,u=o.end,s=u-a,l=r?u:a-1,c=this.__iteratees__,d=c.length,h=0,p=sf(s,this.__takeCount__);if(!n||!r&&i==s&&p==s)return vp(t,this.__actions__);var f=[];t:for(;s--&&h<p;){for(var v=-1,g=t[l+=e];++v<d;){var y=c[v],m=y.iteratee,b=y.type,x=m(g);if(2==b)g=x;else if(!x){if(1==b)continue t;break t}}f[h++]=g}return f},cn.prototype.at=nf.at,cn.prototype.chain=nf.wrapperChain,cn.prototype.commit=nf.commit,cn.prototype.next=nf.next,cn.prototype.plant=nf.plant,cn.prototype.reverse=nf.reverse,cn.prototype.toJSON=cn.prototype.valueOf=cn.prototype.value=nf.value,cn.prototype.first=cn.prototype.head,ff&&(cn.prototype[ff]=nf.toIterator),cf={__e:function(t,e,n,r){for(var i,o,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(t)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(t,r||{}),a=i.__d),a)return i.__E=i}catch(e){t=e}throw t}},"function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout;var mf=0;function bf(t,e,n,r,i,o){e||(e={});var a,u,s=e;if("ref"in s)for(u in s={},e)"ref"==u?a=e[u]:s[u]=e[u];var l={type:t,props:s,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--mf,__i:-1,__u:0,__source:i,__self:o};if("function"==typeof t&&(a=t.defaultProps))for(u in a)void 0===s[u]&&(s[u]=a[u]);return cf.vnode&&cf.vnode(l),l}var xf=e.LogicFlowUtil.StepDrag,_f=function(t){function n(n){var r=t.call(this)||this;return r.updatePosition=function(t){var e=t.deltaX,n=t.deltaY,i=r.nodeModel,o=i.x,a=i.y;r.nodeModel.x=o+e/2,r.nodeModel.y=a+n/2,r.nodeModel.moveText(e/2,n/2)},r.getResize=function(t){var e=t.index,n=t.deltaX,r=t.deltaY,i=t.width,o=t.height,a=t.PCTResizeInfo,u=t.pct,s=void 0===u?1:u,l=t.freezeWidth,c=void 0!==l&&l,d=t.freezeHeight,h=void 0!==d&&d,p={width:i,height:o,deltaX:n,deltaY:r};if(a){var f=0,v=0;switch(e){case 0:v=(-1*n-r)/4;break;case 1:v=(n-r)/4;break;case 2:v=(n+r)/4;break;case 3:v=(-1*n+r)/4}0!==v&&(f=Math.round(v/a.ResizeBasis.basisHeight*1e5)/1e3),a.ResizePCT.widthPCT=Math.max(Math.min(a.ResizePCT.widthPCT+f,a.ScaleLimit.maxScaleLimit),a.ScaleLimit.minScaleLimit),a.ResizePCT.heightPCT=Math.max(Math.min(a.ResizePCT.heightPCT+f,a.ScaleLimit.maxScaleLimit),a.ScaleLimit.minScaleLimit);var g=Math.round(a.ResizePCT.widthPCT*a.ResizeBasis.basisWidth/100),y=Math.round(a.ResizePCT.heightPCT*a.ResizeBasis.basisHeight/100);switch(e){case 0:n=i-g,r=o-y;break;case 1:n=g-i,r=o-y;break;case 2:n=g-i,r=y-o;break;case 3:n=i-g,r=y-o}return p.width=g,p.height=y,p.deltaX=n/s,p.deltaY=r/s,p}switch(e){case 0:p.width=c?i:i-n*s,p.height=h?o:o-r*s;break;case 1:p.width=c?i:i+n*s,p.height=h?o:o-r*s;break;case 2:p.width=c?i:i+n*s,p.height=h?o:o+r*s;break;case 3:p.width=c?i:i-n*s,p.height=h?o:o+r*s}return p},r.updateEdgePointByAnchors=function(){var t=r.nodeModel,e=t.id,n=t.anchors,i=r.getNodeEdges(e);i.sourceEdges.forEach((function(t){var e=n.find((function(e){return e.id===t.sourceAnchorId}));e&&t.updateStartPoint({x:e.x,y:e.y})})),i.targetEdges.forEach((function(t){var e=n.find((function(e){return e.id===t.targetAnchorId}));e&&t.updateEndPoint({x:e.x,y:e.y})}))},r.updateRect=function(t){var e=t.deltaX,n=t.deltaY,i=r.nodeModel,o=i.x,a=i.y,u=i.width,s=i.height,l=i.radius,c=i.PCTResizeInfo,d=r.nodeModel,h=d.minWidth,p=d.minHeight,f=d.maxWidth,v=d.maxHeight,g=r.index,y=h===f,m=p===v,b=r.getResize({index:g,deltaX:e,deltaY:n,width:u,height:s,PCTResizeInfo:c,pct:1,freezeWidth:y,freezeHeight:m});if(b.width<h||b.width>f||b.height<p||b.height>v)r.dragHandler.cancelDrag();else{r.updatePosition({deltaX:y?0:b.deltaX,deltaY:m?0:b.deltaY}),r.nodeModel.width=b.width,r.nodeModel.height=b.height,r.nodeModel.setProperties({nodeSize:{width:b.width,height:b.height}});var x={x:o,y:a,width:u,height:s,radius:l},_={x:r.nodeModel.x,y:r.nodeModel.y,width:r.nodeModel.width,height:r.nodeModel.height,radius:l};r.updateEdgePointByAnchors(),r.eventEmit({beforeNode:x,afterNode:_})}},r.updateEllipse=function(t){var e=t.deltaX,n=t.deltaY,i=r.nodeModel,o=i.rx,a=i.ry,u=i.x,s=i.y,l=i.PCTResizeInfo,c=r.index,d=r.nodeModel,h=d.minWidth,p=d.minHeight,f=d.maxWidth,g=d.maxHeight,y=h===f,m=p===g,b=o,x=a,_=r.getResize({index:c,deltaX:e,deltaY:n,width:b,height:x,PCTResizeInfo:l,pct:.5,freezeWidth:y,freezeHeight:m});if(_.width<h/2||_.width>f/2||_.height<p/2||_.height>g/2)r.dragHandler.cancelDrag();else{r.updatePosition({deltaX:y?0:_.deltaX,deltaY:m?0:_.deltaY}),r.nodeModel.rx=_.width,r.nodeModel.ry=_.height,r.nodeModel.setProperties({nodeSize:{rx:_.width,ry:_.height}});var w={x:u,y:s},M={rx:_.width,ry:_.height,x:r.nodeModel.x,y:r.nodeModel.y};r.updateEdgePointByAnchors(),r.eventEmit({beforeNode:v(v({},w),{rx:o,ry:a}),afterNode:M})}},r.updateDiamond=function(t){var e=t.deltaX,n=t.deltaY,i=r.nodeModel,o=i.rx,a=i.ry,u=i.x,s=i.y,l=i.PCTResizeInfo,c=r.index,d=r.nodeModel,h=d.minWidth,p=d.minHeight,f=d.maxWidth,v=d.maxHeight,g=h===f,y=p===v,m=o,b=a,x=r.getResize({index:c,deltaX:e,deltaY:n,width:m,height:b,PCTResizeInfo:l,pct:.5,freezeWidth:g,freezeHeight:y});if(x.width<h/2||x.width>f/2||x.height<p/2||x.height>v/2)r.dragHandler.cancelDrag();else{r.updatePosition({deltaX:g?0:x.deltaX,deltaY:y?0:x.deltaY}),r.nodeModel.rx=x.width,r.nodeModel.ry=x.height,r.nodeModel.setProperties({nodeSize:{rx:x.width,ry:x.height}});var _={x:u,y:s,rx:o,ry:a},w={rx:x.width,ry:x.height,x:r.nodeModel.x,y:r.nodeModel.y};r.updateEdgePointByAnchors(),r.eventEmit({beforeNode:_,afterNode:w})}},r.eventEmit=function(t){var e=t.beforeNode,n=t.afterNode,i=r.nodeModel,o=i.id,a=i.modelType,u=i.type,s=v({id:o,modelType:a,type:u},e),l=v({id:o,modelType:a,type:u},n);r.graphModel.eventCenter.emit("node:resize",{oldNodeSize:s,newNodeSize:l})},r.onDragging=function(t){var n,i=t.deltaX,o=t.deltaY,a=r.graphModel.transformModel,u=r.nodeModel.modelType;i=(n=m(a.fixDeltaXY(i,o),2))[0],o=n[1],u===e.ModelType.RECT_NODE||u===e.ModelType.HTML_NODE?r.updateRect({deltaX:i,deltaY:o}):u===e.ModelType.ELLIPSE_NODE?r.updateEllipse({deltaX:i,deltaY:o}):u===e.ModelType.DIAMOND_NODE&&r.updateDiamond({deltaX:i,deltaY:o})},r.onDragEnd=function(){var t=r.graphModel.gridSize,e=void 0===t?1:t,n=e*Math.round(r.nodeModel.x/e),i=e*Math.round(r.nodeModel.y/e);r.nodeModel.moveTo(n,i),r.updateEdgePointByAnchors()},r.index=n.index,r.nodeModel=n.model,r.graphModel=n.graphModel,r.dragHandler=new xf({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:1}),r}return f(n,t),n.prototype.getNodeEdges=function(t){for(var e=this.graphModel.edges,n=[],r=[],i=0;i<e.length;i++){var o=e[i];o.sourceNodeId===t?n.push(o):e[i].targetNodeId===t&&r.push(o)}return{sourceEdges:n,targetEdges:r}},n.prototype.render=function(){var t=this.props,n=t.x,r=t.y,i=t.index,o=t.model.getControlPointStyle();return bf("g",{className:"lf-resize-control-".concat(i),children:bf(e.Rect,v({className:"lf-node-control",x:n,y:r},o,{onMouseDown:this.dragHandler.handleMouseDown}))})},n}(e.Component),wf=function(t){function n(){var e=t.call(this)||this;return e.state={},e}return f(n,t),n.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,r=e.x,i=e.y,o=e.width,a=e.height,u={minX:r-o/2,minY:i-a/2,maxX:r+o/2,maxY:i+a/2},s=u.minX,l=u.minY,c=u.maxX,d=u.maxY;return[{x:s,y:l},{x:c,y:l},{x:c,y:d},{x:s,y:d}].map((function(t,r){return bf(_f,v({index:r},t,{model:e,graphModel:n}))}))},n.prototype.getGroupSolid=function(){var t=this.props.model,n=t.x,r=t.y,i=t.width,o=t.height,a=t.getResizeOutlineStyle();return bf(e.Rect,v({},a,{x:n,y:r,width:i,height:o}))},n.prototype.render=function(){return bf("g",{className:"lf-resize-control",children:[this.getGroupSolid(),this.getResizeControl()]})},n}(e.Component),Mf=function(t){function e(e,n){var r=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(r.rx=i.rx,r.ry=i.ry),r}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.rx,basisHeight:this.ry},n={maxScaleLimit:Math.min(this.maxWidth/(2*this.rx)*100,this.maxHeight/(2*this.ry)*100),minScaleLimit:Math.max(this.minWidth/(2*this.rx)*100,this.minHeight/(2*this.ry)*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.EllipseNodeModel),Ef=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return bf(wf,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model,n=t.graphModel.editConfigModel.isSilentMode;return bf("g",{children:[this.getResizeShape(),e.isSelected&&!n?this.getControlGroup():""]})},e}(e.EllipseNode),Nf={type:"ellipse",view:Ef,model:Mf},Sf=function(t){function e(e,n){var r=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(r.rx=i.rx,r.ry=i.ry),r}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.gridSize=1},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.rx,basisHeight:this.ry},n={maxScaleLimit:Math.min(this.maxWidth/(2*this.rx)*100,this.maxHeight/(2*this.ry)*100),minScaleLimit:Math.max(this.minWidth/(2*this.rx)*100,this.minHeight/(2*this.ry)*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.DiamondNodeModel),Af=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return bf(wf,{model:e,graphModel:n})},n.prototype.getResizeShape=function(){var t=this.props.model,n=t.points,r=t.getNodeStyle();return bf("g",{children:bf(e.Polygon,v({},r,{points:n}))})},n.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return bf("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},n}(e.DiamondNode),Pf={type:"diamond",view:Af,model:Sf},Of=function(t){function e(e,n){var r=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(r.width=i.width,r.height=i.height),r}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.width,basisHeight:this.height},n={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.HtmlNodeModel),Tf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return bf(wf,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return bf("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},e}(e.HtmlNode),Cf={type:"html",view:Tf,model:Of},kf=function(t){function e(e,n){var r=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(r.width=i.width,r.height=i.height),r}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.width,basisHeight:this.height},n={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.RectNodeModel),jf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return bf(wf,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return bf("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},e}(e.RectNode),If={type:"rect",view:jf,model:kf},Rf={pluginName:"nodeResize",step:0,install:function(t){t.register(Nf),t.register(Pf),t.register(Cf),t.register(If)}},Df=function(t){function e(){var e=t.apply(this,b([],m(arguments),!1))||this;return e.isGroup=!0,e.isFolded=!1,e.unfoldedWidth=500,e.unfoldedHeight=300,e.childrenLastFoldStatus={},e}return f(e,t),e.prototype.initNodeData=function(e){var n=this;t.prototype.initNodeData.call(this,e);var r=[];Array.isArray(e.children)&&(r=e.children),this.children=new Set(r),this.width=500,this.height=300,this.foldedWidth=80,this.foldedHeight=60,this.zIndex=-1e4,this.radius=0,this.text.editable=!1,this.text.draggable=!1,this.isRestrict=!1,this.resizable=!1,this.autoToFront=!1,this.foldable=!1,void 0===this.properties.isFolded&&(this.properties.isFolded=!1),this.isFolded=!!this.properties.isFolded,setTimeout((function(){n.isFolded&&n.foldGroup(n.isFolded)}))},e.prototype.getResizeOutlineStyle=function(){var e=t.prototype.getResizeOutlineStyle.call(this);return e.stroke="none",e},e.prototype.foldGroup=function(t){var e=this;if(t!==this.isFolded){this.setProperty("isFolded",t),this.isFolded=t,t?(this.x=this.x-this.width/2+this.foldedWidth/2,this.y=this.y-this.height/2+this.foldedHeight/2,this.unfoldedWidth=this.width,this.unfoldedHeight=this.height,this.width=this.foldedWidth,this.height=this.foldedHeight):(this.width=this.unfoldedWidth,this.height=this.unfoldedHeight,this.x=this.x+this.width/2-this.foldedWidth/2,this.y=this.y+this.height/2-this.foldedHeight/2);var n=b(b([],m(this.incoming.edges),!1),m(this.outgoing.edges),!1);this.children.forEach((function(r){var i=e.graphModel.getElement(r);if(i){var o=i.isFolded;if(i.isGroup&&!i.isFolded&&i.foldGroup(t),i.isGroup&&!t){var a=e.childrenLastFoldStatus[r];void 0!==a&&a!==i.isFolded&&i.foldGroup(a)}e.childrenLastFoldStatus[r]=!!o,i.visible=!t;var u=i.incoming.edges,s=i.outgoing.edges;n=b(b(b([],m(n),!1),m(u),!1),m(s),!1)}})),this.foldEdge(t,n)}},e.prototype.getAnchorStyle=function(e){var n=t.prototype.getAnchorStyle.call(this,e);return n.stroke="transparent",n.fill="transparent",n.hover.fill="transparent",n.hover.stroke="transparent",n},e.prototype.foldEdge=function(t,e){var n=this;e.forEach((function(e,r){var i=e.id,o=e.sourceNodeId,a=e.targetNodeId,u=e.startPoint,s=e.endPoint,l=e.type,c=e.text,d=e.getProperties(),h={id:"".concat(i,"__").concat(r),sourceNodeId:o,targetNodeId:a,startPoint:u,endPoint:s,type:l,properties:d,text:null==c?void 0:c.value};e.virtual&&n.graphModel.deleteEdgeById(e.id);var p=n.graphModel.group.getNodeGroup(a);p||(p=n.graphModel.getNodeModelById(a));var f=n.graphModel.group.getNodeGroup(o);f||(f=n.graphModel.getNodeModelById(o)),t&&!1!==e.visible&&(n.children.has(o)||n.id===o?(h.startPoint=void 0,h.sourceNodeId=n.id):(h.endPoint=void 0,h.targetNodeId=n.id),p.id===n.id&&f.id===n.id||n.createVirtualEdge(h),e.visible=!1),t||!1!==e.visible||(p&&p.isGroup&&p.isFolded?(h.targetNodeId=p.id,h.endPoint=void 0,n.createVirtualEdge(h)):f&&f.isGroup&&f.isFolded?(h.sourceNodeId=f.id,h.startPoint=void 0,n.createVirtualEdge(h)):e.visible=!0)}))},e.prototype.createVirtualEdge=function(t){t.pointsList=void 0;var e=this.graphModel.addEdge(t);e.virtual=!0,e.text.editable=!1,e.isFoldedEdge=!0},e.prototype.isInRange=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2;return e>=this.x-this.width/2&&r<=this.x+this.width/2&&n>=this.y-this.height/2&&i<=this.y+this.height/2},e.prototype.isAllowMoveTo=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2;return{x:e>=this.x-this.width/2&&r<=this.x+this.width/2,y:n>=this.y-this.height/2&&i<=this.y+this.height/2}},e.prototype.setAllowAppendChild=function(t){this.setProperty("groupAddable",t)},e.prototype.addChild=function(t){this.children.add(t),this.graphModel.eventCenter.emit("group:add-node",{data:this.getData()})},e.prototype.removeChild=function(t){this.children.delete(t),this.graphModel.eventCenter.emit("group:remove-node",{data:this.getData()})},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#FEB663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},e.prototype.getData=function(){var e=this,n=t.prototype.getData.call(this);n.children=[],this.children.forEach((function(t){var r=e.graphModel.getNodeModelById(t);r&&!r.virtual&&n.children.push(t)}));var r=n.properties;return null==r||delete r.groupAddable,null==r||delete r.isFolded,n},e.prototype.getHistoryData=function(){var e=t.prototype.getData.call(this);e.children=b([],m(this.children),!1),e.isGroup=!0;var n=e.properties;return null==n||delete n.groupAddable,(null==n?void 0:n.isFolded)&&(e.x=e.x+this.unfoldedWidth/2-this.foldedWidth/2,e.y=e.y+this.unfoldedHeight/2-this.foldedHeight/2),e},e.prototype.isAllowAppendIn=function(t){return console.info("_nodeData",t),!0},e.prototype.toBack=function(){this.zIndex--},e}(kf),Lf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getControlGroup=function(){var e=this.props.model,n=e.resizable,r=e.properties;return n&&!r.isFolded?t.prototype.getControlGroup.call(this):null},n.prototype.getAddableShape=function(){var t=this.props.model,n=t.width,r=t.height,i=t.x,o=t.y,a=t.radius,u=t.properties,s=t.getAddableOutlineStyle;if(!u.groupAddable)return null;var l=this.props.model.getNodeStyle().strokeWidth,c=void 0===l?0:l,d=s(),h=n+c+8,p=r+c+8;return e.h("rect",v(v({},d),{width:h,height:p,x:i-h/2,y:o-p/2,rx:a,ry:a}))},n.prototype.getFoldIcon=function(){var t=this.props.model,n=t.x-t.width/2+5,r=t.y-t.height/2+5;if(!t.foldable)return null;var i=e.h("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:t.properties.isFolded?"M ".concat(n+3,",").concat(r+6," ").concat(n+11,",").concat(r+6," M").concat(n+7,",").concat(r+2," ").concat(n+7,",").concat(r+10):"M ".concat(n+3,",").concat(r+6," ").concat(n+11,",").concat(r+6," ")});return e.h("g",{},[e.h("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:t.x-t.width/2+5,y:t.y-t.height/2+5,onClick:function(){t.foldGroup(!t.properties.isFolded)}}),i])},n.prototype.getResizeShape=function(){return e.h("g",{},[this.getAddableShape(),t.prototype.getResizeShape.call(this),this.getFoldIcon()])},n}(jf),Bf={type:"group",view:Lf,model:Df},zf=-1e4,Wf=function(){function t(t){var e=t.lf,n=this;this.topGroupZIndex=zf,this.nodeGroupMap=new Map,this.graphRendered=function(t){var e=t.data;e&&e.nodes&&(e.nodes.forEach((function(t){t.children&&t.children.forEach((function(e){n.nodeGroupMap.set(e,t.id)}))})),n.checkAndCorrectTopGroupZIndex(e.nodes))},this.appendNodeToGroup=function(t){var e=t.data,r=n.nodeGroupMap.get(e.id);if(r){var i=n.lf.getNodeModelById(r);i.removeChild(e.id),n.nodeGroupMap.delete(e.id),i.setAllowAppendChild(!1)}var o=n.lf.getNodeModelById(e.id),a=null==o?void 0:o.getBounds();if(a&&o){var u=n.getGroup(a,e);if(o.isGroup&&(e.children.forEach((function(t){n.nodeGroupMap.set(t,e.id)})),n.checkAndCorrectTopGroupZIndex([e]),n.nodeSelected({data:e,isSelected:!1,isMultiple:!1})),!u)return;if(!u.isAllowAppendIn(e))return void n.lf.emit("group:not-allowed",{group:u.getData(),node:e});u.addChild(e.id),n.nodeGroupMap.set(e.id,u.id),u.setAllowAppendChild(!1)}},this.deleteGroupChild=function(t){var e=t.data;e.children&&e.children.forEach((function(t){n.nodeGroupMap.delete(t),n.lf.deleteNode(t)}));var r=n.nodeGroupMap.get(e.id);r&&(n.lf.getNodeModelById(r).removeChild(e.id),n.nodeGroupMap.delete(e.id))},this.setActiveGroup=function(t){var e=t.data,r=n.lf.getNodeModelById(e.id),i=null==r?void 0:r.getBounds();if(r&&i){var o=n.getGroup(i,e);if(n.activeGroup&&n.activeGroup.setAllowAppendChild(!1),!o||r.isGroup&&o.id===e.id)return;if(!o.isAllowAppendIn(e))return;n.activeGroup=o,n.activeGroup.setAllowAppendChild(!0)}},this.findNodeAndChildMaxZIndex=function(t){var e=zf;return t.isGroup&&(e=Math.max(e,t.zIndex)),t.children&&t.children.forEach((function(t){"object"==typeof t&&(t=t.id);var r=n.lf.getNodeModelById(t);if(null==r?void 0:r.isGroup){var i=n.findNodeAndChildMaxZIndex(r);e=Math.max(i,e)}})),e},this.checkAndCorrectTopGroupZIndex=function(t){var e=zf;if(t.forEach((function(t){var r=n.lf.getNodeModelById(t.id);if(r){var i=n.findNodeAndChildMaxZIndex(r);i>e&&(e=i)}})),!(n.topGroupZIndex>=e)){for(var r=n.lf.graphModel.nodes.filter((function(t){return t.isGroup})),i=n.topGroupZIndex,o=0;o<r.length;o++){var a=r[o];a.zIndex>i&&(i=a.zIndex)}n.topGroupZIndex=i}},this.nodeSelected=function(t){var e=t.data,r=t.isMultiple,i=t.isSelected,o=n.lf.getNodeModelById(e.id);if(n.toFrontGroup(o),n.topGroupZIndex>-1e3){n.topGroupZIndex=zf;for(var a=n.lf.graphModel.nodes.filter((function(t){return t.isGroup})).sort((function(t,e){return t.zIndex-e.zIndex})),u=0,s=0;s<a.length;s++){var l=a[s];l.zIndex!==u&&(n.topGroupZIndex++,u=l.zIndex),l.setZIndex(n.topGroupZIndex)}}if(r&&i)if(null==o?void 0:o.isGroup)o.children.forEach((function(t){var e=n.lf.graphModel.getElement(t);null==e||e.setSelected(!1)}));else{var c=n.nodeGroupMap.get(e.id);if(c){var d=n.lf.getNodeModelById(c);(null==d?void 0:d.isSelected)&&(null==o||o.setSelected(!1))}}},this.toFrontGroup=function(t){t&&t.isGroup&&(n.topGroupZIndex++,t.setZIndex(n.topGroupZIndex),t.children&&t.children.forEach((function(t){var e=n.lf.getNodeModelById(t);n.toFrontGroup(e)})))},e.register(Bf),this.lf=e,e.graphModel.addNodeMoveRules((function(t,r,i){if(t.isGroup){var o=n.getNodeAllChild(t);return e.graphModel.moveNodes(o,r,i,!0),!0}var a=e.getNodeModelById(n.nodeGroupMap.get(t.id));if(a&&a.isRestrict){var u=t.getBounds(),s=u.x1,l=u.y1,c=u.x2,d=u.y2;return a.isAllowMoveTo({x1:s+r,y1:l+i,x2:c+r,y2:d+i})}return!0})),e.graphModel.group=this,e.on("node:add,node:drop,node:dnd-add",this.appendNodeToGroup),e.on("node:delete",this.deleteGroupChild),e.on("node:dnd-drag,node:drag",this.setActiveGroup),e.on("node:click",this.nodeSelected),e.on("graph:rendered",this.graphRendered),e.addElements=function(t,r){var i=t.nodes,o=t.edges,a={},u={nodes:[],edges:[]},s=[];return gl(i,(function(t){var i=t.id,o=t.children,l=g(t,["children"]),c=e.addNode(l);if(!c)return{nodes:[],edges:[]};i&&(a[i]=c.id),u.nodes.push(c);var d=n.createAllChildNodes(a,o,c,r).edgesArray;s.push.apply(s,b([],m(d),!1))})),s.forEach((function(t){n.createEdgeModel(t,a,r)})),gl(o,(function(t){var e=n.createEdgeModel(t,a,0);u.edges.push(e)})),u}}return t.prototype.createAllChildNodes=function(t,n,r,i){var o=this,a=this.lf,u=[],s=[],l=[];null==n||n.forEach((function(n){var c=a.getNodeModelById(n);if(c){var d=c.x,h=c.y,p=c.properties,f=c.type,g=c.text,y=c.rotate,x=c.children,_=e.EventType.NODE_GROUP_COPY||"node:group-copy-add",w=a.addNode({x:d+i,y:h+i,properties:p,type:f,text:v(v({},g),{x:g.x+i,y:g.y+i}),rotate:y},_);if(r.addChild(w.id),t[n]=w.id,l.push(w),c.incoming.edges.forEach((function(t){s.push(t)})),c.outgoing.edges.forEach((function(t){s.push(t)})),x instanceof Set){var M=o.createAllChildNodes(t,x,w,i),E=M.nodesArray,N=M.edgesArray;l.push.apply(l,b([],m(E),!1)),u.push.apply(u,b([],m(N),!1))}}}));var c=s.filter((function(e){return t[e.sourceNodeId]&&t[e.targetNodeId]})).map((function(t){return t.getData()}));return{nodesArray:l,edgesArray:u.concat(c)}},t.prototype.createEdgeModel=function(t,e,n){var r=this.lf,i=t.sourceNodeId,o=t.targetNodeId;e[i]&&(i=e[i]),e[o]&&(o=e[o]);var a=t.type,u=t.startPoint,s=t.endPoint,l=t.pointsList,c=t.text,d={x:((null==u?void 0:u.x)||0)+n,y:((null==u?void 0:u.y)||0)+n},h={x:((null==s?void 0:s.x)||0)+n,y:((null==s?void 0:s.y)||0)+n},p=[];l&&l.length>0&&(p=l.map((function(t){return t.x+=n,t.y+=n,t})));var f=c;return c&&"string"!=typeof c&&(f.x=c.x+n,f.y=c.y+n),r.graphModel.addEdge({type:a,startPoint:d,endPoint:h,sourceNodeId:i,targetNodeId:o,pointsList:p,text:f})},t.prototype.getNodeAllChild=function(t){var e=this,n=[];return t.children&&t.children.forEach((function(t){n.push(t);var r=e.lf.getNodeModelById(t);(null==r?void 0:r.isGroup)&&(n=n.concat(e.getNodeAllChild(r)))})),n},t.prototype.getGroup=function(t,e){var n=this.lf.graphModel.nodes.filter((function(n){return n.isGroup&&n.isInRange(t)&&n.id!==e.id}));if(0!==n.length){if(1===n.length)return n[0];for(var r=n[n.length-1],i=n.length-2;i>=0;i--)n[i].zIndex>r.zIndex&&(r=n[i]);return r}},t.prototype.getNodeGroup=function(t){var e=this.nodeGroupMap.get(t);if(e)return this.lf.getNodeModelById(e)},t.prototype.render=function(){},t.prototype.destroy=function(){},t.pluginName="group",t}();function Ff(){var t=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getFoldIcon=function(){var t=this.props.model,n=t,r=n.x,i=n.y,o=n.width,a=n.height,u=n.properties,s=n.foldable,l=t.x-t.width/2+5,c=t.y-t.height/2+5;if(!s)return null;var d=e.h("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:u.isFolded?"M ".concat(l+3,",").concat(c+6," ").concat(l+11,",").concat(c+6," M").concat(l+7,",").concat(c+2," ").concat(l+7,",").concat(c+10):"M ".concat(l+3,",").concat(c+6," ").concat(l+11,",").concat(c+6," ")});return e.h("g",{},[e.h("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:r-o/2+5,y:i-a/2+5,onClick:function(e){var n,r;null===(r=(n=e.stopPropagation()(t)).foldGroup)||void 0===r||r.call(n,!u.isFolded)}}),d])},n.prototype.getResizeShape=function(){var t=this.props.model,n=t.x,r=t.y,i=t.width,o=t.height,a=t.getNodeStyle(),u=v(v({},a),{x:n-i/2,y:r-o/2,width:i,height:o,stroke:"black",strokeWidth:2,strokeDasharray:"0 0"});return e.h("g",{},[e.h("rect",v({},u)),this.getFoldIcon()])},n}(Lf),n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.foldable=!0,this.resizable=!0,this.width=400,this.height=200,this.resetWidthHeight(),this.isTaskNode=!0,this.boundaryEvents=[]},e.prototype.resetWidthHeight=function(){var t,e,n=null===(t=this.properties.iniProp)||void 0===t?void 0:t.width,r=null===(e=this.properties.iniProp)||void 0===e?void 0:e.height;n&&(this.width=n),r&&(this.height=r)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this);return e.stroke="#989891",e.strokeWidth=1,e.strokeDasharray="3 3",this.isSelected&&(e.stroke="rgb(124, 15, 255)"),this.properties.isBoundaryEventTouchingTask&&(e.stroke="#00acff",e.strokeWidth=2),e},e.prototype.addChild=function(e){var n=this.graphModel.getElement(e);null==n||n.setProperties({parent:this.id}),t.prototype.addChild.call(this,e)},e.prototype.getAnchorStyle=function(){var e=t.prototype.getAnchorStyle.call(this);return e.stroke="#000",e.fill="#fff",e.hover||(e.hover={}),e.hover.stroke="transparent",e},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return e.stroke="transparent",e.hover||(e.hover={}),e.hover.stroke="transparent",e},e.prototype.setTouching=function(t){this.setProperty("isBoundaryEventTouchingTask",t)},e.prototype.addBoundaryEvent=function(t){if(this.setTouching(!1),this.boundaryEvents.find((function(e){return e===t})))return!1;var e=this.graphModel.getNodeModelById(t);return null==e||e.setProperties({attachedToRef:this.id}),this.boundaryEvents.push(t),!0},e.prototype.deleteBoundaryEvent=function(t){this.boundaryEvents=this.boundaryEvents.filter((function(e){return e!==t}))},e}(Df);return{type:"bpmn:subProcess",view:t,model:n}}function Gf(t){var e=kt("bpmn:serviceTask",Et),n=kt("bpmn:userTask",Nt);t.register(e),t.register(n),t.register(Ff()),function(t){function e(t,e){var n=t.x,r=t.y,i=t.width,o=t.height,a=t.id,u=n-i/2,s=n+i/2,l=r-o/2,c=r+o/2,d=e.x,h=e.y;return d>u-5&&d<s+5&&h>l-5&&h<c+5&&!(d>u+5&&d<s-5&&h>l+5&&h<c-5)?a:null}t.on("node:drag,node:dnd-drag",(function(n){var r,i,o=n.data;if("bpmn:boundaryEvent"===o.type){var a=t.graphModel.nodes;try{for(var u=y(a),s=u.next();!s.done;s=u.next()){var l=s.value;l.isTaskNode&&(e(l,o)?l.setTouching(!0):l.setTouching(!1))}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}})),t.on("node:drop,node:dnd-add",(function(n){var r,i,o=n.data,a=o.type,u=o.id;if("bpmn:boundaryEvent"===a){var s=t.graphModel.nodes;try{for(var l=y(s),c=l.next();!c.done;c=l.next()){var d,h=c.value;if(h.isTaskNode)if(null!==(d=e(h,o))){var p=t.graphModel.getNodeModelById(u),f=t.graphModel.getNodeModelById(d),v=p.properties.attachedToRef;return v&&v!==d&&t.graphModel.getNodeModelById(v).deleteBoundaryEvent(u),void f.addBoundaryEvent(u)}}}catch(t){r={error:t}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}}})),t.graphModel.addNodeMoveRules((function(e,n,r){if(e.isTaskNode){var i=e.boundaryEvents;return t.graphModel.moveNodes(i,n,r,!0),!0}return!0}))}(t)}function Hf(t){var n=function(e){function n(n,r){n.id||(n.id="Flow_".concat(ht()));var i=v(v(v({},t||{}),n.properties),{isDefaultFlow:!1});return n.properties=i,e.call(this,n,r)||this}return f(n,e),n.extendKey="SequenceFlowModel",n}(e.PolylineEdgeModel),r=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getStartArrow=function(){return this.props.model.properties.isDefaultFlow?e.h("path",{refX:15,stroke:"#000000",strokeWidth:2,d:"M 20 5 10 -5 z"}):e.h("path",{d:""})},n.extendKey="SequenceFlowEdge",n}(e.PolylineEdge);return{type:"bpmn:sequenceFlow",view:r,model:n}}var Xf=Hf();var Uf=[{nodes:["startEvent","intermediateCatchEvent","boundaryEvent"],definition:[{type:"bpmn:timerEventDefinition",icon:bt,properties:{definitionType:"bpmn:timerEventDefinition",timerValue:"",timerType:""}}]}];function Vf(t){function e(e){e.forEach((function(e){var n,r;n=e.nodes,r=e.definition,n.forEach((function(e){(null==t?void 0:t[e])||(t[e]=new Map);var n=null==t?void 0:t[e];r.forEach((function(t){n.set(t.type,t)}))}))}))}return function(){return[t,e]}}var Yf=function(){function t(t){var e=t.lf;e.definition={},e.useDefinition=Vf(e.definition);var n=m(e.useDefinition(),2),r=n[0],i=n[1];console.log("_definition",r),i(Uf),function(t){t.register(gt(t)),t.register(ft(t)),t.register(vt(t)),t.register(mt(t)),t.register(yt(t))}(e),function(t){var e=Tt("bpmn:exclusiveGateway",_t),n=Tt("bpmn:parallelGateway",wt),r=Tt("bpmn:inclusiveGateway",Mt);t.register(e),t.register(r),t.register(n)}(e),function(t){t.register(Xf)}(e),Gf(e),e.setDefaultEdgeType("bpmn:sequenceFlow")}return t.pluginName="BpmnElementsPlugin",t}(),qf=40,Zf=40,Kf=40,$f=40,Jf=100,Qf=80,tv=100,ev=80,nv=100,rv=80,iv=100,ov=80,av=100,uv=80,sv=100,lv=80,cv=100,dv=80,hv=100,pv=80,fv=function(){};(fv.ObjTree=function(){return this}).VERSION="0.23",fv.ObjTree.prototype.xmlDecl='<?xml version="1.0" encoding="UTF-8" ?>\n',fv.ObjTree.prototype.attr_prefix="-",fv.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,r=n.parseFromString(t,"application/xml");if(!r)return;e=r.documentElement}else window.ActiveXObject&&((n=new ActiveXObject("Microsoft.XMLDOM")).async=!1,n.loadXML(t),e=n.documentElement);if(e)return this.parseDOM(e)},fv.ObjTree.prototype.parseHTTP=function(t,e,n){var r,i={};for(var o in e)i[o]=e[o];if(i.method||(void 0===i.postBody&&void 0===i.postbody&&void 0===i.parameters?i.method="get":i.method="post"),n){i.asynchronous=!0;var a=this,u=n,s=i.onComplete;i.onComplete=function(t){var e;t&&t.responseXML&&t.responseXML.documentElement&&(e=a.parseDOM(t.responseXML.documentElement)),u(e,t),s&&s(t)}}else i.asynchronous=!1;if("undefined"!=typeof HTTP&&HTTP.Request)i.uri=t,(l=new HTTP.Request(i))&&(r=l.transport);else if("undefined"!=typeof Ajax&&Ajax.Request){var l;(l=new Ajax.Request(t,i))&&(r=l.transport)}return n?r:r&&r.responseXML&&r.responseXML.documentElement?this.parseDOM(r.responseXML.documentElement):void 0},fv.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),11!==t.nodeType){var r={};r[t.nodeName]=n,n=r}return n}},fv.ObjTree.prototype.parseElement=function(t){if(7!==t.nodeType){if(3===t.nodeType||4===t.nodeType||8===t.nodeType){if(null==t.nodeValue.match(/[^\x00-\x20]/))return;return t.nodeValue}var e=null,n={};if(t.attributes&&t.attributes.length){e={};for(var r=0;r<t.attributes.length;r++){if("string"==typeof(u=t.attributes[r].nodeName)){var i=t.attributes[r].nodeValue;try{i=JSON.parse(t.attributes[r].nodeValue.replace(/'/g,'"'))}catch(e){i=t.attributes[r].nodeValue}null!=i&&(void 0===n[u=this.attr_prefix+u]&&(n[u]=0),n[u]++,this.addNode(e,u,n[u],i))}}}if(t.childNodes&&t.childNodes.length){var o=!0;e&&(o=!1);for(r=0;r<t.childNodes.length&&o;r++){var a=t.childNodes[r].nodeType;3!==a&&4!==a&&8!==a&&(o=!1)}if(o){e||(e="");for(r=0;r<t.childNodes.length;r++)e+=t.childNodes[r].nodeValue}else{e||(e={});for(r=0;r<t.childNodes.length;r++){var u;if("string"==typeof(u=t.childNodes[r].nodeName))(i=this.parseElement(t.childNodes[r]))&&(void 0===n[u]&&(n[u]=0),n[u]++,this.addNode(e,u,n[u],i))}}}else null===e&&(e={});return e}},fv.ObjTree.prototype.addNode=function(t,e,n,r){this.__force_array[e]?(1===n&&(t[e]=[]),t[e][t[e].length]=r):1===n?t[e]=r:2===n?t[e]=[t[e],r]:t[e][t[e].length]=r},fv.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e},fv.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],r=[];for(var i in e)if(uc(e,i)){var o=e[i];i.charAt(0)!==this.attr_prefix?void 0===o||null==o?n[n.length]="<".concat(i," />"):"object"==typeof o&&o.constructor===Array?n[n.length]=this.array_to_xml(i,o):n[n.length]="object"==typeof o?this.hash_to_xml(i,o):this.scalar_to_xml(i,o):r[r.length]=" ".concat(i.substring(1),'="').concat(this.xml_escape(o),'"')}var a=r.join(""),u=n.join("");return void 0===t||null==t||(u=n.length>0?u.match(/\n/)?"<".concat(t).concat(a,">\n").concat(u,"</").concat(t,">\n"):"<".concat(t).concat(a,">").concat(u,"</").concat(t,">\n"):"<".concat(t).concat(a," />\n")),u},fv.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],r=0;r<e.length;r++){var i=e[r];void 0===i||null==i?n[n.length]="<".concat(t," />"):"object"==typeof i&&i.constructor===Array?n[n.length]=this.array_to_xml(t,i):n[n.length]="object"==typeof i?this.hash_to_xml(t,i):this.scalar_to_xml(t,i)}return n.join("")},fv.ObjTree.prototype.scalar_to_xml=function(t,e){return"#text"===t?this.xml_escape(e):"<".concat(t,">").concat(this.xml_escape(e),"</").concat(t,">\n")},fv.ObjTree.prototype.xml_escape=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};function vv(t){return Object.prototype.toString.call(t)}function gv(t){return" ".repeat(t)}function yv(t){return"[object Object]"===vv(t)?Object.keys(t).reduce((function(e,n){var r=n;return"-"===n.charAt(0)&&(r=n.substring(1)),e[r]=yv(t[n]),e}),{}):Array.isArray(t)?t.map((function(t){return yv(t)})):t}var mv,bv="\t\n";function xv(t,e,n){var r=gv(n),i="",o=bv+r;if("-json"===e)return"";if("#text"===e)return o+t;if("#cdata-section"===e)return"".concat(o,"<![CDATA[").concat(t,"]]>");if("#comment"===e)return"".concat(o,"\x3c!--").concat(t,"--\x3e");if("-"==="".concat(e).charAt(0))return" ".concat(e.substring(1),'="').concat(function(t){var e=t;try{"string"!=typeof e&&(e=JSON.parse(t))}catch(n){e=JSON.stringify(yv(t)).replace(/"/g,"'")}return e}(t),'"');if(Array.isArray(t))i+=t.map((function(t){return xv(t,e,n+1)})).join("");else if("[object Object]"===vv(t)){var a=Object.keys(t),u="",s=t["-json"]?bv+gv(n+1)+t["-json"]:"";i+="".concat(0===n?"":o,"<").concat(e),a.forEach((function(e){"-"===e.charAt(0)?u+=xv(t[e],e,n+1):s+=xv(t[e],e,n+1)})),i+=u+(""!==s?">".concat(s).concat(o,"</").concat(e,">"):" />")}else i+="".concat(o,"<").concat(e,">").concat(t.toString(),"</").concat(e,">");return i}!function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.INTERMEDIATE_CATCH="bpmn:intermediateCatchEvent",t.INTERMEDIATE_THROW="bpmn:intermediateThrowEvent",t.BOUNDARY="bpmn:boundaryEvent",t.PARALLEL_GATEWAY="bpmn:parallelGateway",t.INCLUSIVE_GATEWAY="bpmn:inclusiveGateway",t.EXCLUSIVE_GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow",t.SUBPROCESS="bpmn:subProcess"}(mv||(mv={}));var _v=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef","-children"],wv=["properties","startPoint","endPoint","pointsList"],Mv={in:[],out:["properties.panels","properties.nodeSize","properties.definitionId","properties.timerValue","properties.timerType","properties.definitionType","properties.parent","properties.isBoundaryEventTouchingTask"]},Ev=function(t,e){return Object.keys(e||{}).forEach((function(n){if(t[n]){var r=e[n],i=r.in,o=r.out;i&&(t[n].in=i),o&&(t[n].out=o)}else t[n]=e[n]})),t},Nv={"bpmn:startEvent":{out:function(t){var e,n,r=t.properties;return(null===(n=null===(e=Nv[r.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:intermediateCatchEvent":{out:function(t){var e,n,r=t.properties;return(null===(n=null===(e=Nv[r.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:intermediateThrowEvent":{out:function(t){var e,n,r=t.properties;return(null===(n=null===(e=Nv[r.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:boundaryEvent":{out:function(t){var e,n,r=t.properties;return(null===(n=null===(e=Nv[r.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:sequenceFlow":{out:function(t){var e=t.properties,n=e.expressionType,r=e.condition;return r?"cdata"===n?{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[${'.concat(r,"}]]></bpmn:conditionExpression>")}:{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression">'.concat(r,"</bpmn:conditionExpression>")}:{json:""}}},"bpmn:timerEventDefinition":{out:function(t){var e=t.properties,n=e.timerType,r=e.timerValue,i=e.definitionId;return{json:'<bpmn:timerEventDefinition id="'.concat(i,'"').concat(n&&r?">".concat("<bpmn:".concat(n,' xsi:type="bpmn:tFormalExpression">').concat(r,"</bpmn:").concat(n,">"),"</bpmn:timerEventDefinition>"):"/>")}},in:function(t,e){var n,r,i,o=t,a=e["-id"],u="",s="";try{for(var l=y(Object.keys(e)),c=l.next();!c.done;c=l.next()){var d=c.value;d.includes("bpmn:")&&(u=m(d.split(":"),2)[1],s=null===(i=e[d])||void 0===i?void 0:i["#text"])}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return{"-definitionId":a,"-definitionType":o,"-timerType":u,"-timerValue":s}}},"bpmn:conditionExpression":{in:function(t,e){var n,r="",i="";return e["#cdata-section"]?(i="cdata",r=(null===(n=/^\$\{(.*)\}$/g.exec(e["#cdata-section"]))||void 0===n?void 0:n[1])||""):e["#text"]&&(i="normal",r=e["#text"]),{"-condition":r,"-expressionType":i}}}};function Sv(t){var e=null!=t?t:{},n=e.retainedAttrsFields,r=e.excludeFields,i=e.transformer,o=new Set(b(b([],m(wv),!1),m(n||[]),!1)),a={in:new Set(b(b([],m(Mv.in),!1),m((null==r?void 0:r.in)||[]),!1)),out:new Set(b(b([],m(Mv.out),!1),m((null==r?void 0:r.out)||[]),!1))};return Nv=Ev(Nv,i),function(t){var e=t.nodes,n=t.edges;return function t(r,i){var u,s;if(1!==(null==r?void 0:r.flag)){var l;if((l=Nv[r.type])&&l.out){var c=l.out(r),d=Object.keys(c);d.length>0&&d.forEach((function(t){r[t]=c[t]}))}(null==r?void 0:r.children)&&(r.children=r.children.map((function(t){return e.find((function(e){return e.id===t}))||n.find((function(e){return e.id===t}))||{}})));var h={};if("string"==typeof r)return r;if(Array.isArray(r))return r.map((function(e){return t(e,"")})).filter((function(t){return null!=t}));try{for(var p=y(Object.entries(r)),f=p.next();!f.done;f=p.next()){var v=m(f.value,2),g=v[0],b=v[1];if(1===(null==b?void 0:b.flag))return;var x=[i,g].filter((function(t){return t})).join(".");a.out.has(x)||("object"!=typeof b?0===g.indexOf("-")||["#text","#cdata-section","#comment"].includes(g)?h[g]=b:h["-".concat(g)]=b:o.has(x)?h["-".concat(g)]=t(b,x):h[g]=t(b,x))}}catch(t){u={error:t}}finally{try{f&&!f.done&&(s=p.return)&&s.call(p)}finally{if(u)throw u.error}}return h}}(t,"")}}function Av(t){var e,n,r={};try{for(var i=y(Object.entries(t)),o=i.next();!o.done;o=i.next()){var a=m(o.value,2),u=a[0],s=a[1];0===u.indexOf("-")?r[u.substring(1)]=yv(s):"string"==typeof s?r[u]=s:"[object Object]"===Object.prototype.toString.call(s)?r[u]=Av(s):Array.isArray(s)?r[u]=s.map((function(t){return Av(t)})):r[u]=s}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function Pv(t,e){t["bpmndi:BPMNEdge"]=e.edges.map((function(t){var e,n=t.id,r=t.pointsList.map((function(t){return{"-x":t.x,"-y":t.y}})),i={"-id":"".concat(n,"_di"),"-bpmnElement":n,"di:waypoint":r};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(i["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),i})),t["bpmndi:BPMNShape"]=e.nodes.map((function(t){var e,n=t.id,r=100,i=80,o=t.x,a=t.y,u=jv.shapeConfigMap.get(t.type);u&&(r=u.width,i=u.height),o-=r/2,a-=i/2;var s={"-id":"".concat(n,"_di"),"-bpmnElement":n,"dc:Bounds":{"-x":o,"-y":a,"-width":r,"-height":i}};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(s["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),s}))}var Ov=["bpmn:incoming","bpmn:outgoing"];function Tv(t,e){var n=[],r=[],i=new Map,o=null!=e?e:{},a=o.transformer,u=o.excludeFields,s={in:new Set(b(b([],m(Mv.in),!1),m((null==u?void 0:u.in)||[]),!1)),out:new Set(b(b([],m(Mv.out),!1),m((null==u?void 0:u.out)||[]),!1))};Nv=Ev(Nv,a);var l,c,d=t["bpmn:definitions"];if(d){var h=d["bpmn:process"];l=h,c=[function(t){function e(t){t["-children"]||(t["-children"]=[]),Object.keys(t).forEach((function(e){var n;0!==e.indexOf("bpmn:")||Ov.includes(e)||(h[e]||(h[e]=[]),!Array.isArray(h[e])&&(h[e]=[h[e]]),Array.isArray(t[e])?(n=h[e]).push.apply(n,b([],m(t[e]),!1)):h[e].push(t[e]),Array.isArray(t[e])?t[e].forEach((function(n){!e.includes("Flow")&&t["-children"].push(n["-id"])})):!e.includes("Flow")&&t["-children"].push(t[e]["-id"]),delete t[e])}))}if("bpmn:subProcess"===t){var n=h[t];Array.isArray(n)?n.forEach((function(n){"bpmn:subProcess"===t&&e(n)})):e(n)}},function(t){function e(t){var n;i.set(t["-id"],t),Array.isArray(t)?t.forEach((function(t){e(t)})):"object"==typeof t&&(n=t,Object.keys(n).forEach((function(t){var r,i;if(t.includes("bpmn:")){var o={};Nv[t]&&Nv[t].in?(o=null===(i=(r=Nv[t]).in)||void 0===i?void 0:i.call(r,t,cn.cloneDeep(n[t])),delete n[t]):e(n[t]);var a=void 0;(a=Reflect.ownKeys(o)).length>0&&a.forEach((function(t){Reflect.set(n,t,o[t])}))}})))}e(h[t])},function(t){if(0===t.indexOf("bpmn:")){var e=h[t];if("bpmn:sequenceFlow"===t){var o=d["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];r=function(t,e){var n=[];if(Array.isArray(t))t.forEach((function(t){var r;r=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(kv(r,t))}));else{var r=void 0;r=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(kv(r,t))}return n}(e,o)}else{var a=d["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];if("bpmn:boundaryEvent"===t){var u=h[t],s=function(t){var e=t["-attachedToRef"],n=i.get(e);n["-boundaryEvents"]||(n["-boundaryEvents"]=[]),n["-boundaryEvents"].push(t["-id"])};Array.isArray(u)?u.forEach((function(t){s(t)})):s(u)}n=n.concat(function(t,e,n){var r=[];if(Array.isArray(t))t.forEach((function(t){var i=Cv(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);r.push(i)}));else{var i=Cv(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);r.push(i)}return r}(e,a,t))}}}],c.forEach((function(t){try{Object.keys(l).forEach((function(e){try{t(e)}catch(t){console.error(t)}}))}catch(t){console.error(t)}}))}var p=function(t,e,n){Object.keys(t).forEach((function(r){var i=n?"".concat(n,".").concat(r):r;e.has(i)?delete t[r]:"object"==typeof t[r]&&p(t[r],e,i)}))};return n.forEach((function(t){var n,r;if(null===(n=null==e?void 0:e.mapping)||void 0===n?void 0:n.in){var i=null===(r=null==e?void 0:e.mapping)||void 0===r?void 0:r.in,o=t.type;i[o]&&(t.type=i[o])}p(t,s.in,"")})),r.forEach((function(t){var n,r;if(null===(n=null==e?void 0:e.mapping)||void 0===n?void 0:n.in){var i=null===(r=null==e?void 0:e.mapping)||void 0===r?void 0:r.in,o=t.type;i[o]&&(t.type=i[o])}p(t,s.in,"")})),{nodes:n,edges:r}}function Cv(t,e,n){var r=Number(t["dc:Bounds"]["-x"]),i=Number(t["dc:Bounds"]["-y"]),o=n["-children"],a=n["-name"],u=jv.shapeConfigMap.get(e);u&&(r+=u.width/2,i+=u.height/2);var s,l={};if(Object.entries(n).forEach((function(t){var e=m(t,2),n=e[0],r=e[1];_v.includes(n)||(l[n]=r)})),l=Av(l),a&&(s={x:r,y:i,value:a},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var c=t["bpmndi:BPMNLabel"]["dc:Bounds"];s.x=Number(c["-x"])+Number(c["-width"])/2,s.y=Number(c["-y"])+Number(c["-height"])/2}var d={id:t["-bpmnElement"],type:e,x:r,y:i,properties:l};return o&&(d.children=o),s&&(d.text=s),d}function kv(t,e){var n,r=e["-name"];if(r){var i=t["bpmndi:BPMNLabel"]["dc:Bounds"],o=0;r.split("\n").forEach((function(t){o<t.length&&(o=t.length)})),n={value:r,x:Number(i["-x"])+10*o/2,y:Number(i["-y"])+7}}var a={};Object.entries(e).forEach((function(t){var e=m(t,2),n=e[0],r=e[1];_v.includes(n)||(a[n]=r)})),a=Av(a);var u=t["di:waypoint"].map((function(t){return{x:Number(t["-x"]),y:Number(t["-y"])}})),s={id:e["-id"],type:mv.FLOW,pointsList:u,sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:a};return n&&(s.text=n),s}var jv=function(){function t(t){var e=t.lf,n=this;this.adapterOut=function(t,e){var r,i,o=v({},n.processAttributes);!function(t,e,n){var r,i=new Map,o=Sv(n)(e);o.nodes.forEach((function(e){var n=e["-id"],r=e["-type"],o=e.text,a=e.children,u=g(e,["-id","-type","text","children"]),s={"-id":n};(null==o?void 0:o["-value"])&&(s["-name"]=o["-value"]),u["-json"]&&(s["-json"]=u["-json"]),u["-properties"]&&Object.assign(s,u["-properties"]),a&&(s.children=a),t[r]||(t[r]=[]),t[r].push(s),i.set(n,s)}));var a=o.edges.map((function(t){var e=t["-id"],n=t["-sourceNodeId"],r=t["-targetNodeId"],o=t.text,a=g(t,["-id","-sourceNodeId","-targetNodeId","text"]),u=i.get(r);u["bpmn:incoming"]||(u["bpmn:incoming"]=[]),u["bpmn:incoming"].push(e);var s={"-id":e,"-sourceRef":n,"-targetRef":r};return(null==o?void 0:o["-value"])&&(s["-name"]=o["-value"]),a["-json"]&&(s["-json"]=a["-json"]),a["-properties"]&&Object.assign(s,a["-properties"]),s}));e.edges.forEach((function(t){var e=t.sourceNodeId,n=t.id,r=i.get(e);r["bpmn:outgoing"]||(r["bpmn:outgoing"]=[]),r["bpmn:outgoing"].push(n)})),null===(r=t["bpmn:subProcess"])||void 0===r||r.forEach((function(e){var n={"bpmn:incoming":new Set,"bpmn:outgoing":new Set},r=[];e.children.forEach((function(r){var o,a=i.get(r["-id"]);["bpmn:incoming","bpmn:outgoing"].forEach((function(t){a[t]&&a[t].forEach((function(e){n[t].add(e)}))}));var u=null===(o=t[r["-type"]])||void 0===o?void 0:o.findIndex((function(t){return t["-id"]===r["-id"]}));u>=0&&t[r["-type"]].splice(u,1),i.delete(r["-id"]),e[r["-type"]]||(e[r["-type"]]=[]),e[r["-type"]].push(a)}));var o=n["bpmn:incoming"];n["bpmn:outgoing"].forEach((function(t){o.has(t)&&r.push(t)}));for(var u,s=function(t){var n=a.findIndex((function(e){return e["-id"]===r[t]}));n>=0?(e["bpmn:sequenceFlow"]||(e["bpmn:sequenceFlow"]=[]),e["bpmn:sequenceFlow"].push(a[n]),a.splice(n,1)):t++,u=t},l=0;l<r.length;)s(l),l=u;delete e.children})),t[mv.FLOW]=a}(o,t,e);var a={"-id":"BPMNPlane_1","-bpmnElement":o["-id"]};Pv(a,t);var u=n.definitionAttributes;u["bpmn:process"]=o,u["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":a};var s={"bpmn:definitions":u};if(null===(r=null==e?void 0:e.mapping)||void 0===r?void 0:r.out){var l=null===(i=null==e?void 0:e.mapping)||void 0===i?void 0:i.out,c=function(t){Array.isArray(t)&&t.forEach((function(t){return c(t)})),"object"==typeof t&&Object.keys(t).forEach((function(e){var n;(n=l[e])?(t[n]=cn.cloneDeep(t[e]),delete t[e],c(t[n])):c(t[e])}))};c(s)}return s},this.adapterIn=function(t,e){if(t)return Tv(t,e)},e.adapterIn=this.adapterIn,e.adapterOut=this.adapterOut,this.processAttributes={"-isExecutable":"true","-id":"Process"},this.definitionAttributes={"-id":"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","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.10"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t}();jv.shapeConfigMap.set(mv.START,{width:qf,height:Zf}),jv.shapeConfigMap.set(mv.END,{width:Kf,height:$f}),jv.shapeConfigMap.set(mv.INTERMEDIATE_CATCH,{width:tv,height:ev}),jv.shapeConfigMap.set(mv.INTERMEDIATE_THROW,{width:tv,height:ev}),jv.shapeConfigMap.set(mv.BOUNDARY,{width:Jf,height:Qf}),jv.shapeConfigMap.set(mv.PARALLEL_GATEWAY,{width:nv,height:rv}),jv.shapeConfigMap.set(mv.INCLUSIVE_GATEWAY,{width:iv,height:ov}),jv.shapeConfigMap.set(mv.EXCLUSIVE_GATEWAY,{width:av,height:uv}),jv.shapeConfigMap.set(mv.SYSTEM,{width:sv,height:lv}),jv.shapeConfigMap.set(mv.USER,{width:cv,height:dv}),jv.shapeConfigMap.set(mv.SUBPROCESS,{width:hv,height:pv});var Iv,Rv=function(t){function e(e){var n=t.call(this,e)||this;n.adapterXmlIn=function(t){var e,r=(e=t,(new fv.ObjTree).parseXML(e));return n.adapterIn(r,n.props)},n.adapterXmlOut=function(t){return function(t){var e="";for(var n in t)e+=xv(t[n],n,0);return e}(n.adapterOut(t,n.props))};var r=e.lf,i=e.props;return r.adapterIn=n.adapterXmlIn,r.adapterOut=n.adapterXmlOut,n.props=i,n}return f(e,t),e.pluginName="BPMNAdapter",e}(jv),Dv=function(){function t(t){var e=t.lf,n=this;this.fileName="snapshot.png",this.lf=e,this.customCssRules="",this.useGlobalRules=!0,e.getSnapshot=function(t,e){n.getSnapshot(t,e)},e.getSnapshotBlob=function(t){return n.getSnapshotBlob(t)},e.getSnapshotBase64=function(t){return n.getSnapshotBase64(t)}}return t.prototype.getSvgRootElement=function(t){return t.container.querySelector(".lf-canvas-overlay")},t.prototype.triggerDownload=function(t){var e=new MouseEvent("click",{view:document.defaultView,bubbles:!1,cancelable:!0}),n=document.createElement("a");n.setAttribute("download",this.fileName),n.setAttribute("href",t),n.setAttribute("target","_blank"),n.dispatchEvent(e)},t.prototype.removeAnchor=function(t){for(var e=t.childNodes,n=t.childNodes&&t.childNodes.length,r=0;r<n;r++){var i=e[r];(i.classList&&Array.from(i.classList)||[]).indexOf("lf-anchor")>-1&&(t.removeChild(t.childNodes[r]),n--,r--)}},t.prototype.removeRotateControl=function(t){for(var e=t.childNodes,n=t.childNodes&&t.childNodes.length,r=0;r<n;r++){var i=e[r];(i.classList&&Array.from(i.classList)||[]).indexOf("lf-rotate-control")>-1&&(t.removeChild(t.childNodes[r]),n--,r--)}},t.prototype.getSnapshot=function(t,e){var n=this;this.fileName=t||"logic-flow.".concat(Date.now(),".png");var r=this.getSvgRootElement(this.lf);this.getCanvasData(r,e).then((function(t){var e=t.toDataURL("image/png").replace("image/png","image/octet-stream");n.triggerDownload(e)}))},t.prototype.getSnapshotBase64=function(t){var e=this,n=this.getSvgRootElement(this.lf);return new Promise((function(r){e.getCanvasData(n,t).then((function(t){var e=t.toDataURL("image/png");r({data:e,width:t.width,height:t.height})}))}))},t.prototype.getSnapshotBlob=function(t){var e=this,n=this.getSvgRootElement(this.lf);return new Promise((function(r){e.getCanvasData(n,t).then((function(t){t.toBlob((function(e){r({data:e,width:t.width,height:t.height})}),"image/png")}))}))},t.prototype.getClassRules=function(){var t="";if(this.useGlobalRules)for(var e=document.styleSheets,n=0;n<e.length;n++)for(var r=e[n],i=0;i<r.cssRules.length;i++)t+=r.cssRules[i].cssText;return this.customCssRules&&(t+=this.customCssRules),t},t.prototype.getCanvasData=function(t,e){var n,r=this,i=t.cloneNode(!0),o=i.lastChild,a=null===(n=null==o?void 0:o.childNodes)||void 0===n?void 0:n.length;if(a)for(var u=0;u<a;u++){var s=null==o?void 0:o.childNodes[u],l=s.classList&&Array.from(s.classList);if(l&&l.indexOf("lf-base")<0)null==o||o.removeChild(o.childNodes[u]),a--,u--;else{var c=null==o?void 0:o.childNodes[u];c&&c.childNodes.forEach((function(t){var e=t;r.removeAnchor(e.firstChild),r.removeRotateControl(e.firstChild)}))}}var d=window.devicePixelRatio||1;d<1&&(d=1);var h=document.createElement("canvas"),p=this.lf.graphModel.rootEl.querySelector(".lf-base").getBoundingClientRect(),f=this.lf.container.querySelector(".lf-canvas-overlay").getBoundingClientRect(),v=p.x-f.x,g=p.y-f.y,y=this.lf.graphModel.transformModel,m=y.SCALE_X,b=y.SCALE_Y,x=y.TRANSLATE_X,_=y.TRANSLATE_Y;i.lastChild.style.transform="matrix(1, 0, 0, 1, ".concat((-v+x)*(1/m)+10,", ").concat((-g+_)*(1/b)+10,")");var w=Math.ceil(p.width/m),M=Math.ceil(p.height/b);h.style.width="".concat(w,"px"),h.style.height="".concat(M,"px"),h.width=w*d+80,h.height=M*d+80;var E=h.getContext("2d");E&&(E.clearRect(0,0,h.width,h.height),E.scale(d,d),e?(E.fillStyle=e,E.fillRect(0,0,w*d+80,M*d+80)):E.clearRect(0,0,w,M));var N=new Image,S=document.createElement("style");S.innerHTML=this.getClassRules();var A=document.createElement("foreignObject");return A.appendChild(S),i.appendChild(A),new Promise((function(t){N.onload=function(){var e=navigator.userAgent.indexOf("Firefox")>-1;try{e?createImageBitmap(N,{resizeWidth:h.width,resizeHeight:h.height}).then((function(e){null==E||E.drawImage(e,0,0),t(h)})):(null==E||E.drawImage(N,0,0),t(h))}catch(e){null==E||E.drawImage(N,0,0),t(h)}};var e="data:image/svg+xml;charset=utf-8,".concat((new XMLSerializer).serializeToString(i)).replace(/\n/g,"").replace(/\t/g,"").replace(/#/g,"%23");N.src=e}))},t.pluginName="snapshot",t}(),Lv={SEQUENCE_FLOW:1,START_EVENT:2,END_EVENT:3,USER_TASK:4,EXCLUSIVE_GATEWAY:6},Bv={1:"bpmn:sequenceFlow",2:"bpmn:startEvent",3:"bpmn:endEvent",4:"bpmn:userTask",6:"bpmn:exclusiveGateway"};function zv(t){switch(t){case"bpmn:sequenceFlow":return Lv.SEQUENCE_FLOW;case"bpmn:startEvent":return Lv.START_EVENT;case"bpmn:endEvent":return Lv.END_EVENT;case"bpmn:userTask":return Lv.USER_TASK;case"bpmn:exclusiveGateway":return Lv.EXCLUSIVE_GATEWAY;default:return t}}!function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}(Iv||(Iv={}));var Wv=function(t,e,n,r){return void 0===r&&(r=0),Hv(t,e,n)<=r};function Fv(t){return t*t}function Gv(t,e){return Fv(t.x-e.x)+Fv(t.y-e.y)}var Hv=function(t,e,n){return Math.sqrt(function(t,e,n){var r=Gv(e,n);if(0===r)return Gv(t,e);var i=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/r;return i=Math.max(0,Math.min(1,i)),Gv(t,{x:e.x+i*(n.x-e.x),y:e.y+i*(n.y-e.y)})}(t,e,n))},Xv=function(t,e,n){var r=function(t){var e=t.x,n=t.y,r=t.width,i=t.height;return{minX:e-r/2,minY:n-i/2,maxX:e+r/2,maxY:n+i/2,x:e,y:n,width:r,height:i,centerX:e,centerY:n}}(t),i=function(t,e){var n;return t.x===e.x?n=Iv.VERTICAL:t.y===e.y&&(n=Iv.HORIZONTAL),n}(e,n),o=Math.max(e.x,n.x),a=Math.min(e.x,n.x),u=Math.max(e.y,n.y),s=Math.min(e.y,n.y),l=t.x,c=t.y,d=t.width,h=t.height;if(i===Iv.HORIZONTAL){if(o>=r.maxX&&a<=r.minX)return{startCrossPoint:{x:e.x>n.x?l+d/2:l-d/2,y:e.y},endCrossPoint:{x:e.x>n.x?l-d/2:l+d/2,y:e.y}}}else if(i===Iv.VERTICAL&&u>=r.maxY&&s<=r.minY)return{startCrossPoint:{x:e.x,y:e.y>n.y?c+h/2:c-h/2},endCrossPoint:{x:e.x,y:e.y>n.y?c-h/2:c+h/2}}},Uv=function(t,e,n){void 0===n&&(n=0);for(var r=t.x,i=t.y,o=e.pointsList,a=0;a<o.length-1;a++)if(Wv({x:r,y:i},o[a],o[a+1],n)){var u=Xv(t,o[a],o[a+1]);if(u)return{crossIndex:a+1,crossPoints:u}}return{crossIndex:-1,crossPoints:{startCrossPoint:{x:0,y:0},endCrossPoint:{x:0,y:0}}}},Vv=function(){function t(t){var e=t.lf;this._lf=e,this.deviation=20,this.dndAdd=!0,this.dropAdd=!0,this.eventHandler()}return t.prototype.eventHandler=function(){var t=this;this.dndAdd&&this._lf.on("node:dnd-add",(function(e){var n=e.data;t.insetNode(n)})),this.dropAdd&&this._lf.on("node:drop",(function(e){for(var n=e.data,r=t._lf.graphModel.edges,i=n.id,o=!0,a=0;a<r.length;a++)if(r[a].sourceNodeId===i||r[a].targetNodeId===i){o=!1;break}o&&t.insetNode(n)}))},t.prototype.checkRuleBeforeInsetNode=function(t,n,r,i,o){var a=this._lf.getNodeModelById(t),u=this._lf.getNodeModelById(n),s=a.getAnchorInfo(r),l=u.getAnchorInfo(i),c=a.isAllowConnectedAsSource(o,s,l),d=u.isAllowConnectedAsTarget(o,s,l),h=e.formatAnchorConnectValidateData(c),p=h.isAllPass,f=h.msg,v=e.formatAnchorConnectValidateData(d),g=v.isAllPass;return{isPass:p&&g,sourceMsg:f,targetMsg:v.msg}},t.prototype.insetNode=function(t){var n=this,r=this._lf.graphModel.edges,i=this._lf.getNodeModelById(t.id),o=null==i?void 0:i.getDefaultAnchor();if(!o||0===o.length)this._lf.graphModel.eventCenter.emit(e.EventType.CONNECTION_NOT_ALLOWED,{data:t,msg:"自定义类型节点不显示锚点,也不允许其他节点连接到此节点"});else if(i)for(var a=0;a<r.length;a++){var u=Uv(i,r[a],this.deviation),s=u.crossIndex,l=u.crossPoints;if(s>=0){var c=r[a],d=c.sourceNodeId,h=c.targetNodeId,p=c.id,f=c.type,v=c.pointsList,g=c.sourceAnchorId,y=c.targetAnchorId,x=ju(v[0]),_=ju(l.startCrossPoint);this._lf.deleteEdge(p);var w=this.checkRuleBeforeInsetNode(d,h,g,y,t);if(this._lf.addEdge({type:f,sourceNodeId:d,targetNodeId:t.id,startPoint:x,endPoint:_,pointsList:b(b([],m(v.slice(0,s)),!1),[l.startCrossPoint],!1)}),this._lf.addEdge({type:f,sourceNodeId:t.id,targetNodeId:h,startPoint:ju(l.endCrossPoint),endPoint:ju(v[v.length-1]),pointsList:b([l.endCrossPoint],m(v.slice(s)),!1)}),w.isPass)break;this._lf.graphModel.eventCenter.emit(e.EventType.CONNECTION_NOT_ALLOWED,{data:t,msg:w.targetMsg||w.sourceMsg}),setTimeout((function(){n._lf.undo()}),200);break}}},t.pluginName="insertNodeInPolyline",t}(),Yv=function(){function t(t){var e=t.lf,n=this;this.controlItems=[{key:"zoom-out",iconClass:"lf-control-zoomOut",title:"缩小流程图",text:"缩小",onClick:function(){n.lf.zoom(!1)}},{key:"zoom-in",iconClass:"lf-control-zoomIn",title:"放大流程图",text:"放大",onClick:function(){n.lf.zoom(!0)}},{key:"reset",iconClass:"lf-control-fit",title:"恢复流程原有尺寸",text:"适应",onClick:function(){n.lf.resetZoom()}},{key:"undo",iconClass:"lf-control-undo",title:"回到上一步",text:"上一步",onClick:function(){n.lf.undo()}},{key:"redo",iconClass:"lf-control-redo",title:"移到下一步",text:"下一步",onClick:function(){n.lf.redo()}}],this.lf=e}return t.prototype.render=function(t,e){this.destroy();var n=this.getControlTool();this.toolEl=n,e.appendChild(n),this.domContainer=e},t.prototype.destroy=function(){this.domContainer&&this.toolEl&&this.domContainer.contains(this.toolEl)&&this.domContainer.removeChild(this.toolEl)},t.prototype.addItem=function(t){this.controlItems.push(t)},t.prototype.removeItem=function(t){var e=this.controlItems.findIndex((function(e){return e.key===t}));return-1==e?null:this.controlItems.splice(e,1)[0]},t.prototype.getControlTool=function(){var t=this,e="lf-control-item",n="lf-control-item disabled",r=document.createElement("div"),i=[];return r.className="lf-control",this.controlItems.forEach((function(r){var o=document.createElement("div"),a=document.createElement("i"),u=document.createElement("span");switch(o.className=n,r.onClick&&(o.onclick=r.onClick.bind(null,t.lf)),r.onMouseEnter&&(o.onmouseenter=r.onMouseEnter.bind(null,t.lf)),r.onMouseLeave&&(o.onmouseleave=r.onMouseLeave.bind(null,t.lf)),a.className=r.iconClass,u.className="lf-control-text",u.title=r.title,u.innerText=r.text,o.append(a,u),r.text){case"上一步":t.lf.on("history:change",(function(t){var r=t.data.undoAble;o.className=r?e:n}));break;case"下一步":t.lf.on("history:change",(function(t){var r=t.data.redoAble;o.className=r?e:n}));break;default:o.className=e}i.push(o)})),r.append.apply(r,b([],m(i),!1)),r},t.pluginName="control",t}(),qv="lf:defaultNodeMenu",Zv="lf:defaultEdgeMenu",Kv="lf:defaultGraphMenu",$v="lf:defaultSelectionMenu",Jv=function(){function t(t){var e=t.lf,n=this;this.lf=e,e.options.isSilentMode||(this.__menuDOM=document.createElement("ul"),this.menuTypeMap=new Map,this.init(),this.lf.setMenuConfig=function(t){n.setMenuConfig(t)},this.lf.addMenuConfig=function(t){n.addMenuConfig(t)},this.lf.setMenuByType=function(t){n.setMenuByType(t)})}return t.prototype.init=function(){var t,e,n,r,i=this,o=[{text:"删除",callback:function(t){i.lf.deleteNode(t.id)}},{text:"编辑文本",callback:function(t){i.lf.graphModel.editText(t.id)}},{text:"复制",callback:function(t){i.lf.cloneNode(t.id)}}];null===(t=this.menuTypeMap)||void 0===t||t.set(qv,o);var a=[{text:"删除",callback:function(t){i.lf.deleteEdge(t.id)}},{text:"编辑文本",callback:function(t){i.lf.graphModel.editText(t.id)}}];null===(e=this.menuTypeMap)||void 0===e||e.set(Zv,a),null===(n=this.menuTypeMap)||void 0===n||n.set(Kv,[]);var u=[{text:"删除",callback:function(t){i.lf.clearSelectElements(),t.edges.forEach((function(t){return i.lf.deleteEdge(t.id)})),t.nodes.forEach((function(t){return i.lf.deleteNode(t.id)}))}}];null===(r=this.menuTypeMap)||void 0===r||r.set($v,u)},t.prototype.render=function(t,e){var n=this;t.options.isSilentMode||(this.__container=e,this.__currentData=null,this.__menuDOM&&(this.__menuDOM.className="lf-menu",e.appendChild(this.__menuDOM),this.__menuDOM.addEventListener("click",(function(t){t.stopPropagation();for(var e=t.target;-1===Array.from(e.classList).indexOf("lf-menu-item")&&-1===Array.from(e.classList).indexOf("lf-menu");)e=null==e?void 0:e.parentElement;Array.from(e.classList).indexOf("lf-menu-item")>-1?(e.onclickCallback(n.__currentData),n.__menuDOM&&(n.__menuDOM.style.display="none"),n.__currentData=null):console.warn("点击区域不在菜单项内,请检查代码!")}),!0)),this.lf.on("node:contextmenu",(function(t){var e,r,i=t.data,o=t.position,a=t.e,u=o.domOverlayPosition,s=u.x,l=u.y,c=i.id,d=n.lf.graphModel.getNodeModelById(c);if(d){var h=[],p=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(d.type);h=d&&d.menu&&Array.isArray(d.menu)?d.menu:p||(null===(r=n.menuTypeMap)||void 0===r?void 0:r.get(qv)),n.__currentData=i,n.showMenu(s,l,h,{width:d.width,height:d.height,clientX:a.clientX,clientY:a.clientY})}})),this.lf.on("edge:contextmenu",(function(t){var e,r,i,o,a=t.data,u=t.position,s=t.e,l=u.domOverlayPosition,c=l.x,d=l.y,h=a.id,p=n.lf.graphModel.getEdgeModelById(h);if(p){var f=[],v=null!==(r=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(p.type))&&void 0!==r?r:[];f=p&&p.menu&&Array.isArray(p.menu)?p.menu:v||(null!==(o=null===(i=n.menuTypeMap)||void 0===i?void 0:i.get(Zv))&&void 0!==o?o:[]),n.__currentData=a,n.showMenu(c,d,f,{width:p.width,height:p.height,clientX:s.clientX,clientY:s.clientY})}})),this.lf.on("blank:contextmenu",(function(t){var e,r,i=t.position,o=null!==(r=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(Kv))&&void 0!==r?r:[],a=i.domOverlayPosition,u=a.x,s=a.y;n.showMenu(u,s,o)})),this.lf.on("selection:contextmenu",(function(t){var e,r=t.data,i=t.position,o=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get($v),a=i.domOverlayPosition,u=a.x,s=a.y;n.__currentData=r,n.showMenu(u,s,o)})),this.lf.on("node:mousedown",(function(){n.__menuDOM.style.display="none"})),this.lf.on("edge:click",(function(){n.__menuDOM.style.display="none"})),this.lf.on("blank:click",(function(){n.__menuDOM.style.display="none"})))},t.prototype.destroy=function(){var t;this.__menuDOM&&(null===(t=null==this?void 0:this.__container)||void 0===t||t.removeChild(this.__menuDOM),this.__menuDOM=void 0)},t.prototype.showMenu=function(t,e,n,r){if(n&&n.length){var i=this.__menuDOM;if(i){if(i.innerHTML="",i.append.apply(i,b([],m(this.__getMenuDom(n)),!1)),!i.children.length)return;if(i.style.display="block",!r)return i.style.top="".concat(e,"px"),void(i.style.left="".concat(t,"px"));var o=r.width,a=r.height,u=r.clientX,s=r.clientY,l=this.lf.graphModel,c=i.offsetWidth,d=!0,h=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,p=h-u,f=l.rootEl.getBoundingClientRect(),v=f.left+f.width;v<h&&(p=v-u),p<c&&(d=!1),i.style.left="".concat(d?t:t-o,"px");var g=i.offsetHeight,y=!0,x=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,_=x-s,w=f.top+f.height;w<x&&(_=w-s),_<g&&(y=!1),i.style.top="".concat(y?e:e-a,"px")}}},t.prototype.setMenuByType=function(t){var e;t.type&&t.menu&&(null===(e=this.menuTypeMap)||void 0===e||e.set(t.type,t.menu))},t.prototype.__getMenuDom=function(t){var e=[];return t&&t.length>0&&t.forEach((function(t){var n=document.createElement("li");if(t.className?n.className="lf-menu-item ".concat(t.className):n.className="lf-menu-item",!0===t.icon){var r=document.createElement("span");r.className="lf-menu-item-icon",n.appendChild(r)}var i=document.createElement("span");i.className="lf-menu-item-text",t.text&&(i.innerText=t.text),n.appendChild(i),n.onclickCallback=t.callback,e.push(n)})),e},t.prototype.setMenuConfig=function(t){var e,n,r;t&&(void 0!==t.nodeMenu&&(null===(e=this.menuTypeMap)||void 0===e||e.set(qv,t.nodeMenu?t.nodeMenu:[])),void 0!==t.edgeMenu&&(null===(n=this.menuTypeMap)||void 0===n||n.set(Zv,t.edgeMenu?t.edgeMenu:[])),void 0!==t.graphMenu&&(null===(r=this.menuTypeMap)||void 0===r||r.set(Kv,t.graphMenu?t.graphMenu:[])))},t.prototype.addMenuConfig=function(t){var e,n,r,i,o,a,u,s,l;if(t){if(Array.isArray(t.nodeMenu)){var c=null!==(n=null===(e=this.menuTypeMap)||void 0===e?void 0:e.get(qv))&&void 0!==n?n:[];null===(r=this.menuTypeMap)||void 0===r||r.set(qv,c.concat(t.nodeMenu))}if(Array.isArray(t.edgeMenu)){c=null!==(o=null===(i=this.menuTypeMap)||void 0===i?void 0:i.get(Zv))&&void 0!==o?o:[];null===(a=this.menuTypeMap)||void 0===a||a.set(Zv,c.concat(t.edgeMenu))}if(Array.isArray(t.graphMenu)){c=null!==(s=null===(u=this.menuTypeMap)||void 0===u?void 0:u.get(Kv))&&void 0!==s?s:[];null===(l=this.menuTypeMap)||void 0===l||l.set(Kv,c.concat(t.graphMenu))}}},t.prototype.changeMenuItem=function(t,e){if("add"===t)this.addMenuConfig(e);else{if("reset"!==t)throw new Error("The first parameter of changeMenuConfig should be 'add' or 'reset'");this.setMenuConfig(e)}},t.pluginName="menu",t}(),Qv="menu-common",tg=function(){function t(t){var e=t.lf,n=this;this.menuTypeMap=new Map,this.listenDelete=function(){n.hideContextMenu()},this.lf=e,this.__menuDOM=document.createElement("div"),this.__menuDOM.className="lf-inner-context",this.menuTypeMap.set(Qv,[]),this.lf.setContextMenuByType=function(t,e){n.setContextMenuByType(t,e)},this.lf.setContextMenuItems=function(t){n.setContextMenuItems(t)},this.lf.showContextMenu=function(t){n.showContextMenu(t)},this.lf.hideContextMenu=function(){n.hideContextMenu()}}return t.prototype.render=function(t,e){var n=this;this.container=e,t.on("node:click",(function(t){var e=t.data;n._activeData=e,n.createContextMenu()})),t.on("edge:click",(function(t){var e=t.data;n._activeData=e,n.createContextMenu()})),t.on("blank:click",(function(){n.hideContextMenu()}))},t.prototype.setContextMenuByType=function(t,e){this.menuTypeMap.set(t,e)},t.prototype.hideContextMenu=function(){this.__menuDOM.innerHTML="",this.__menuDOM.style.display="none",this.isShow&&this.container.removeChild(this.__menuDOM),this.lf.off("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!1},t.prototype.showContextMenu=function(t){t&&t.id?(this._activeData=t,this.createContextMenu()):console.warn("请检查传入的参数")},t.prototype.setContextMenuItems=function(t){this.menuTypeMap.set(Qv,t)},t.prototype.getContextMenuPosition=function(){var t=this._activeData,e=this.lf.graphModel.getElement(t.id);if(e){var n,r;if("edge"===e.BaseType){n=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER;var i=e.getData();n=Math.max(i.startPoint.x,n),r=Math.min(i.startPoint.y,r),n=Math.max(i.endPoint.x,n),r=Math.min(i.endPoint.y,r),i.pointsList&&i.pointsList.forEach((function(t){n=Math.max(t.x,n),r=Math.min(t.y,r)}))}return"node"===e.BaseType&&(n=t.x+e.width/2,r=t.y-e.height/2),this.lf.graphModel.transformModel.CanvasPointToHtmlPoint([n,r])}},t.prototype.createContextMenu=function(){var t=this;if(!this.lf.options.isSilentMode){var e=b(b([],m(this.menuTypeMap.get(this._activeData.type)||[]),!1),m(this.menuTypeMap.get(Qv)||[]),!1),n=document.createDocumentFragment();e.forEach((function(e){var r=document.createElement("div");r.className="lf-context-item";var i=document.createElement("img");i.src=e.icon,i.className="lf-context-img",e.className&&(r.className="".concat(r.className," ").concat(e.className)),i.addEventListener("click",(function(){t.hideContextMenu(),e.callback?e.callback(t._activeData):t.addNode({sourceId:t._activeData.id,x:t._activeData.x,y:t._activeData.y,properties:e.properties,type:e.type})})),r.appendChild(i),n.appendChild(r)})),this.__menuDOM.innerHTML="",this.__menuDOM.appendChild(n),this.showMenu()}},t.prototype.addNode=function(t,e){var n=void 0!==e;void 0===e&&(e=t.y);var r=this.lf.getNodeModelById(t.sourceId);if(r){var i=t.x-r.width+200,o=e-t.y/2-20,a=t.x+r.width+200,u=e+t.y/2+20;if(this.lf.getAreaElement([i,o],[a,u]).length)return e+=100,void this.addNode(t,e);if(t.type){var s=this.lf.addNode({type:t.type,x:t.x+200,y:e,properties:t.properties}),l=void 0,c=void 0;n&&(l={x:t.x,y:t.y+r.height/2},c={x:s.x-s.width/2,y:s.y}),this.lf.addEdge({sourceNodeId:t.sourceId,targetNodeId:s.id,startPoint:l,endPoint:c})}}},t.prototype.showMenu=function(){var t=this.getContextMenuPosition();if(t){var e=m(t,2),n=e[0],r=e[1];this.__menuDOM.style.display="flex",this.__menuDOM.style.top="".concat(r,"px"),this.__menuDOM.style.left="".concat(n+10,"px"),this.container.appendChild(this.__menuDOM),!this.isShow&&this.lf.on("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!0}},t.pluginName="contextMenu",t}(),eg=function(){function t(t){var e=t.lf,n=this;this.lf=e,this.lf.setPatternItems=function(t){n.setPatternItems(t)}}return t.prototype.render=function(t,e){var n=this;this.destroy(),this.shapeList&&0!==this.shapeList.length?(this.panelEl=document.createElement("div"),this.panelEl.className="lf-dndpanel",this.shapeList.forEach((function(t){var e;null===(e=n.panelEl)||void 0===e||e.appendChild(n.createDndItem(t))})),e.appendChild(this.panelEl),this.domContainer=e):this.domContainer=e},t.prototype.destroy=function(){this.domContainer&&this.panelEl&&this.domContainer.contains(this.panelEl)&&this.domContainer.removeChild(this.panelEl)},t.prototype.setPatternItems=function(t){this.shapeList=t,this.domContainer&&this.render(this.lf,this.domContainer)},t.prototype.createDndItem=function(t){var e=this,n=document.createElement("div");n.className=t.className?"lf-dnd-item ".concat(t.className):"lf-dnd-item";var r=document.createElement("div");if(r.className="lf-dnd-shape",t.icon&&(r.style.backgroundImage="url(".concat(t.icon,")")),n.appendChild(r),t.label){var i=document.createElement("div");i.innerText=t.label,i.className="lf-dnd-text",n.appendChild(i)}return t.disabled?(n.classList.add("disabled"),n.onmousedown=function(){t.callback&&t.callback(e.lf,e.domContainer)},n):(n.onmousedown=function(){t.type&&e.lf.dnd.startDrag({type:t.type,properties:t.properties,text:t.text}),t.callback&&t.callback(e.lf,e.domContainer)},n.ondblclick=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-dbclick",{e:n,data:t})},n.onclick=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-click",{e:n,data:t})},n.oncontextmenu=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-contextmenu",{e:n,data:t})},n)},t.pluginName="dndPanel",t}(),ng=function(){function t(t){var e=t.lf,n=this;this.disabled=!0,this.isDefaultStopMoveGraph=!1,this.isWholeNode=!0,this.isWholeEdge=!0,this.draw=function(t){var e=n.lf.getPointByClient(t.clientX,t.clientY).domOverlayPosition,r=e.x,i=e.y;if(n.endPoint={x:r,y:i},n.startPoint){var o=n.startPoint,a=o.x,u=o.y,s=a,l=u,c=r-a,d=i-u;r<a&&(s=r,c=a-r),i<u&&(l=i,d=u-i),n.wrapper&&(n.wrapper.style.left="".concat(s,"px"),n.wrapper.style.top="".concat(l,"px"),n.wrapper.style.width="".concat(c,"px"),n.wrapper.style.height="".concat(d,"px"))}},this.drawOff=function(){var t;if(document.removeEventListener("mousemove",n.draw),document.removeEventListener("mouseup",n.drawOff),n.wrapper&&(n.wrapper.oncontextmenu=null,null===(t=n.container)||void 0===t||t.removeChild(n.wrapper)),n.startPoint&&n.endPoint){var e=n.startPoint,r=e.x,i=e.y,o=n.endPoint,a=o.x,u=o.y,s=[Math.min(r,a),Math.min(i,u)],l=[Math.max(r,a),Math.max(i,u)];if(n.lf.emit("selection:selected-area",{topLeft:s,bottomRight:l}),Math.abs(a-r)<10&&Math.abs(u-i)<10)return;var c=n.lf.graphModel.getAreaElement(s,l,n.isWholeEdge,n.isWholeNode,!0),d=n.lf.graphModel.group;c.forEach((function(t){d&&d.getNodeGroup(t.id)||n.lf.selectElementById(t.id,!0)})),n.lf.emit("selection:selected",c)}},this.lf=e;var r=e.getEditConfig().stopMoveGraph;this.isDefaultStopMoveGraph=r,e.openSelectionSelect=function(){n.openSelectionSelect()},e.closeSelectionSelect=function(){n.closeSelectionSelect()}}return t.prototype.render=function(t,e){var n=this;this.container=e,t.on("blank:mousedown",(function(r){var i=r.e;if(t.getEditConfig().stopMoveGraph&&!n.disabled&&!(2===i.button)){var o=t.getPointByClient(i.clientX,i.clientY).domOverlayPosition,a=o.x,u=o.y;n.startPoint={x:a,y:u},n.endPoint={x:a,y:u};var s=document.createElement("div");s.className="lf-selection-select",s.oncontextmenu=function(t){t.preventDefault()},s.style.top="".concat(n.startPoint.y,"px"),s.style.left="".concat(n.startPoint.x,"px"),e.appendChild(s),n.wrapper=s,document.addEventListener("mousemove",n.draw),document.addEventListener("mouseup",n.drawOff)}}))},t.prototype.setSelectionSense=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!0),this.isWholeEdge=t,this.isWholeNode=e},t.prototype.openSelectionSelect=function(){this.lf.getEditConfig().stopMoveGraph||(this.isDefaultStopMoveGraph=!1,this.lf.updateEditConfig({stopMoveGraph:!0})),this.open()},t.prototype.closeSelectionSelect=function(){this.isDefaultStopMoveGraph||this.lf.updateEditConfig({stopMoveGraph:!1}),this.close()},t.prototype.open=function(){this.disabled=!1},t.prototype.close=function(){this.disabled=!0},t.pluginName="selectionSelect",t}(),rg=function(){function t(t){var e=t.lf,n=t.LogicFlow,r=t.options,i=this;this.width=200,this.height=150,this.scale=1,this.translateX=0,this.translateY=0,this.showEdge=!1,this.viewPortTop=0,this.viewPortLeft=0,this.viewPortWidth=150,this.viewPortHeight=75,this.isShow=!1,this.isShowHeader=!1,this.isShowCloseIcon=!1,this.headerTitle="导航",this.disabledPlugins=["miniMap","control","selectionSelect"],this.render=function(t,e){i.container=e,i.lf.on("history:change",(function(){i.isShow&&i.setView()})),i.lf.on("graph:transform",(function(){i.isShow&&i.setView(!1)}))},this.show=function(t,e){i.isShow||(i.createMiniMap(t,e),i.setView()),i.isShow=!0},this.hide=function(){i.isShow&&(i.removeMiniMap(),i.lf.emit("miniMap:close",{})),i.isShow=!1},this.updatePosition=function(t){if("object"==typeof t)void 0===t.left&&void 0===t.right||(i.leftPosition=t.left,i.rightPosition=t.right),void 0===t.top&&void 0===t.bottom||(i.topPosition=t.top,i.bottomPosition=t.bottom);else switch(t){case"left-top":i.leftPosition=0,i.rightPosition=void 0,i.topPosition=0,i.bottomPosition=void 0;break;case"right-top":i.leftPosition=void 0,i.rightPosition=0,i.topPosition=0,i.bottomPosition=void 0;break;case"left-bottom":i.leftPosition=0,i.rightPosition=void 0,i.topPosition=void 0,i.bottomPosition=0;break;case"right-bottom":i.leftPosition=void 0,i.rightPosition=0,i.topPosition=void 0,i.bottomPosition=0}i.updateMiniMapPosition()},this.reset=function(){i.lf.resetTranslate(),i.lf.resetZoom()},this.setShowEdge=function(t){i.showEdge!==t&&(i.showEdge=t,i.setView())},this.startDrag=function(t){document.addEventListener("mousemove",i.drag),document.addEventListener("mouseup",i.drop);var e=t.x,n=t.y;i.startPosition={x:e,y:n}},this.drag=function(t){var e=t.x,n=t.y,r=(e-i.startPosition.x)/i.scale,o=(n-i.startPosition.y)/i.scale,a=i.viewPortLeft+r+i.viewPortWidth/i.scale/2,u=i.viewPortTop+o+i.viewPortHeight/i.scale/2;i.startPosition={x:e,y:n},i.lf.focusOn({coordinate:{x:a,y:u}})},this.drop=function(){document.removeEventListener("mousemove",i.drag),document.removeEventListener("mouseup",i.drop)},this.mapClick=function(t){var e=t.offsetX,n=t.offsetY,r=i.translateX+e/i.scale,o=i.translateY+n/i.scale;i.lf.focusOn({coordinate:{x:r,y:o}})},this.lf=e,this.LFCtor=n,r&&r.MiniMap&&this.setOption(r.MiniMap),this.viewPortWidth=e.graphModel.width,this.viewPortHeight=e.graphModel.height;var o={left:0,right:this.viewPortWidth,top:0,bottom:this.viewPortHeight};this.bounds=o,this.elementAreaBounds=o,this.viewPortBounds=o,this.initMiniMap()}return t.prototype.setOption=function(t){var e=t.width,n=void 0===e?150:e,r=t.height,i=void 0===r?220:r,o=t.showEdge,a=void 0!==o&&o,u=t.isShowHeader,s=void 0!==u&&u,l=t.isShowCloseIcon,c=void 0!==l&&l,d=t.leftPosition,h=t.topPosition,p=t.rightPosition,f=void 0===p?0:p,v=t.bottomPosition,g=void 0===v?0:v,y=t.headerTitle,m=void 0===y?"导航":y;this.width=n,this.height=i,this.showEdge=a,this.isShowHeader=s,this.isShowCloseIcon=c,this.leftPosition=d,this.rightPosition=void 0!==d?void 0:f,this.topPosition=h,this.bottomPosition=void 0!==h?void 0:g,this.headerTitle=m},t.prototype.initMiniMap=function(){var t=document.createElement("div");t.className="lf-mini-map-graph",t.style.width="".concat(this.width,"px"),t.style.height="".concat(this.height,"px"),this.lfMap=new this.LFCtor({container:t,grid:!1,isSilentMode:!0,stopZoomGraph:!0,stopScrollGraph:!0,stopMoveGraph:!1,history:!1,snapline:!1,disabledPlugins:this.disabledPlugins}),this.miniMapWrap=t,this.createViewPort(),t.addEventListener("click",this.mapClick)},t.prototype.createMiniMap=function(t,e){var n,r=document.createElement("div");this.miniMapContainer=r,r.appendChild(this.miniMapWrap),r.style.position="absolute",void 0===t&&void 0===e||(this.leftPosition=t||0,this.topPosition=e||0,this.rightPosition=void 0,this.bottomPosition=void 0),this.updateMiniMapPosition(),r.className="lf-mini-map",this.isShowCloseIcon||r.classList.add("lf-mini-map-no-close-icon"),this.isShowHeader||r.classList.add("lf-mini-map-no-header"),null===(n=this.container)||void 0===n||n.appendChild(r),this.miniMapWrap.appendChild(this.viewport);var i=document.createElement("div");i.className="lf-mini-map-header",i.innerText=this.headerTitle,r.appendChild(i);var o=document.createElement("span");o.className="lf-mini-map-close",o.addEventListener("click",this.hide),r.appendChild(o)},t.prototype.updateMiniMapPosition=function(){if(this.miniMapContainer){var t=this.miniMapContainer.style;void 0!==this.rightPosition?(t.right="".concat(this.rightPosition,"px"),t.left=""):(t.left="".concat(this.leftPosition,"px"),t.right=""),void 0!==this.bottomPosition?(t.bottom="".concat(this.bottomPosition,"px"),t.top=""):(t.top="".concat(this.topPosition,"px"),t.bottom="")}},t.prototype.removeMiniMap=function(){var t;this.miniMapContainer&&(null===(t=this.container)||void 0===t||t.removeChild(this.miniMapContainer))},t.prototype.updateBounds=function(t){t&&this.updateElementAreaBounds(t),this.updateViewPortBounds(),this.bounds={left:Math.min(this.elementAreaBounds.left,this.viewPortBounds.left),right:Math.max(this.elementAreaBounds.right,this.viewPortBounds.right),top:Math.min(this.elementAreaBounds.top,this.viewPortBounds.top),bottom:Math.max(this.elementAreaBounds.bottom,this.viewPortBounds.bottom)}},t.prototype.updateElementAreaBounds=function(t){var e={left:0,right:0,top:0,bottom:0},n=t.nodes;n&&n.length>0&&n.forEach((function(t){var n,r,i=t.x,o=t.y,a=null!==(n=t.width)&&void 0!==n?n:200,u=null!==(r=t.height)&&void 0!==r?r:200,s=i-a/2,l=i+a/2,c=o-u/2,d=o+u/2;e.left=Math.min(s,e.left),e.right=Math.max(l,e.right),e.top=Math.min(c,e.top),e.bottom=Math.max(d,e.bottom)})),this.elementAreaBounds=e},t.prototype.updateViewPortBounds=function(){var t=this.lf.getTransform(),e=t.TRANSLATE_X,n=t.TRANSLATE_Y,r=t.SCALE_X,i=t.SCALE_Y,o=this.lf.graphModel,a=o.width,u=o.height;this.viewPortBounds={left:-e/r,right:(-e+a)/r,top:-n/i,bottom:(-n+u)/i}},t.prototype.resetData=function(t){var e=t.nodes,n=t.edges;return e.forEach((function(t){t.text=void 0})),this.showEdge&&n.forEach((function(t){t.text=void 0})),{nodes:e,edges:this.showEdge?n:[]}},t.prototype.setView=function(t){var e,n;if(void 0===t&&(t=!0),t){var r=this.lf.getGraphRawData(),i=this.resetData(r),o=this.lf.viewMap,a=this.lf.graphModel.modelMap,u=this.lfMap.viewMap;try{for(var s=y(o.keys()),l=s.next();!l.done;l=s.next()){var c=l.value;u.has(c)||this.lfMap.register({type:c,view:o.get(c),model:a.get(c)})}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}this.lfMap.render(i),this.updateBounds(i)}else this.updateBounds();var d=this.bounds,h=d.left,p=d.top,f=d.right-h,v=d.bottom-p,g=this.width/f,m=this.height/v,b=Math.min(g,m);this.scale=b;var x=h-(this.width/b-f)/2,_=p-(this.height/b-v)/2;if(this.lfMap.graphModel.transformModel.translate(-x+this.translateX,-_+this.translateY),this.translateX=x,this.translateY=_,this.miniMapWrap.firstChild){var w=this.miniMapWrap.firstChild.style;w.pointerEvents="none",w.transform="matrix(".concat(b,", 0, 0, ").concat(b,", 0, 0)"),w.transformOrigin="left top",w.height="".concat(this.height/b,"px"),w.width="".concat(this.width/b,"px"),this.updateViewPort()}},t.prototype.updateViewPort=function(){var t=this.viewport.style,e=this.lf.getTransform(),n=e.TRANSLATE_X,r=e.TRANSLATE_Y,i=e.SCALE_X,o=e.SCALE_Y,a=this.lf.graphModel,u=a.width,s=a.height;this.viewPortLeft=-n/i,this.viewPortTop=-r/o,this.viewPortWidth=u/i*this.scale,this.viewPortHeight=s/o*this.scale,t.width="".concat(this.viewPortWidth,"px"),t.height="".concat(this.viewPortHeight,"px"),t.left="".concat((this.viewPortLeft-this.translateX)*this.scale,"px"),t.top="".concat((this.viewPortTop-this.translateY)*this.scale,"px")},t.prototype.createViewPort=function(){var t=document.createElement("div");t.className="lf-minimap-viewport",t.addEventListener("mousedown",this.startDrag),t.addEventListener("click",(function(t){t.stopPropagation()})),this.viewport=t},t.pluginName="miniMap",t}(),ig={tr:"tl",lb:"tl",tl:"tr",rb:"tr",br:"bl",lt:"bl",bl:"br",rt:"br"};function og(t,e,n,r){var i,o="",a="";t[0]===e[0]?o=t[1]>e[1]?"t":"b":t[1]===e[1]&&(o=t[0]>e[0]?"l":"r"),e[0]===n[0]?a=e[1]>n[1]?"t":"b":e[1]===n[1]&&(a=e[0]>n[0]?"l":"r");var u=Math.min(Math.hypot(e[0]-t[0],e[1]-t[1])/2,Math.hypot(n[0]-e[0],n[1]-e[1])/2,r)||.2*r,s="".concat(o).concat(a),l=ig[s]||"-",c="L ".concat(t[0]," ").concat(t[1]);if("-"===l)c+="L ".concat(e[0]," ").concat(e[1]," L ").concat(n[0]," ").concat(n[1]);else{var d=m(function(t,e,n,r){var i=[t[0],t[1]],o=[t[0],t[1]];switch(n){case"tl":return"tr"===e?(i[1]+=r,o[0]+=r):"lb"===e&&(i[0]+=r,o[1]+=r),[i,o];case"tr":return"tl"===e?(i[1]+=r,o[0]-=r):"rb"===e&&(i[0]-=r,o[1]+=r),[i,o];case"bl":return"br"===e?(i[1]-=r,o[0]+=r):"lt"===e&&(i[0]+=r,o[1]-=r),[i,o];case"br":return"bl"===e?(i[1]-=r,o[0]-=r):"rt"===e&&(i[0]-=r,o[1]-=r),[i,o];default:return[]}}(e,s,l,u),2),h=d[0],p=d[1];h&&p&&(c+="L ".concat(h[0]," ").concat(h[1]," Q ").concat(e[0]," ").concat(e[1]," ").concat(p[0]," ").concat(p[1]),i=m(p,2),e[0]=i[0],e[1]=i[1])}return c}function ag(t,e){var n=0,r="";if(2===t.length)r+="M".concat(t[n][0]," ").concat(t[n++][1]," L ").concat(t[n][0]," ").concat(t[n][1]);else{for(r+="M".concat(t[n][0]," ").concat(t[n++][1]);n+1<t.length;){r+=og(t[n-1],t[n],t[1+n++],e)}r+="L ".concat(t[n][0]," ").concat(t[n][1])}return r}var ug=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getEdge=function(){var t=this.props.model,n=t.points,r=t.isAnimation,i=t.arrowConfig,o=t.radius,a=void 0===o?5:o,u=t.getEdgeStyle(),s=t.getEdgeAnimationStyle(),l=function(t){for(var e=t,n=1;n<e.length-1;){var r=m(e[n-1],2),i=r[0],o=r[1],a=m(e[n],2),u=a[0],s=a[1],l=m(e[n+1],2),c=l[0],d=l[1];i===u&&u===c||o===s&&s===d?e.splice(n,1):n++}return e}(n.split(" ").map((function(t){return t.split(",").map((function(t){return+t}))}))),c=ag(l,a),d=v(v(v({style:r?s:{}},u),i),{fill:"none"});return e.h("path",v({d:c},d))},n}(e.PolylineEdge),sg=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e}(e.PolylineEdgeModel),lg=function(){function t(t){var e=t.lf,n=this;this.lf=e,this.paths=[],e.getPathes=function(){if(!n.startNodeType)throw new Error("需要预先指定开始节点类型");return n.getPathes()},e.setRawPaths=function(t){n.setPathes(t)},e.getRawPathes=function(){return n.paths},e.setStartNodeType=function(t){n.startNodeType=t}}return t.prototype.setPathes=function(t){this.paths=t.map((function(t){return{routeId:t.routeId,name:t.name,elements:t.elements,type:t.type,similarElement:null,weight:0}}))},t.prototype.getPathes=function(){var t=this,e=this.lf.getGraphRawData(),n=new Map,r=[];e.nodes.forEach((function(e){n.set(e.id,{id:e.id,data:e,nextNodes:[]}),e.type===t.startNodeType&&r.push(e.id)})),e.edges.forEach((function(t){var e=n.get(t.sourceNodeId);null==e||e.nextNodes.push(t.targetNodeId)}));var i=[];return r.forEach((function(e){var r=n.get(e);r&&(i=i.concat(t.findPathElements(r,n,[])))})),this.getNewPathes(i)},t.prototype.findPathElements=function(t,e,n){void 0===n&&(n=[]);var r=b([],m(n),!1);if(r.push(t.id),0===t.nextNodes.length)return[r];for(var i=[],o=0;o<t.nextNodes.length;o++){var a=e.get(t.nextNodes[o]),u=void 0;if(a){var s=r.indexOf(a.id);u=-1!==s?[b(b([],m(r.slice(s)),!1),[a.id],!1)]:this.findPathElements(a,e,b([],m(r),!1)),i=i.concat(u)}}return i},t.prototype.getNewPathes=function(t){var e=this,n=[],r=new Set;t.forEach((function(t){console.log("elements",t);var i=e.getNewId("path"),o=e.getNewId("路径"),a=e.isLoopPath(t),u=t.join(",");r.has(u)||(r.add(u),n.push({routeId:i,name:o,elements:t,type:a,weight:0,similarElement:""}))}));var i=JSON.parse(JSON.stringify(this.paths));return n.forEach((function(t){for(var n=0;n<i.length;n++){var r=i[n],o=e.similar2Path(b([],m(t.elements),!1),b([],m(r.elements),!1));o>t.weight&&r.weight<=o&&(t.weight=o,t.similarElement=r,o===r.weight&&r.similarElement?(r.similarElement.similarElement=null,r.similarElement.weight=0,r.similarElement=null,r.weight=0):(r.similarElement=t,r.weight=o))}})),n.forEach((function(t){t.similarElement&&t.similarElement.similarElement===t&&(t.routeId=t.similarElement.routeId,t.name=t.similarElement.name),delete t.similarElement,delete t.weight})),this.setPathes(n),n},t.prototype.similar2Path=function(t,e){var n=0,r=t.length+e.length;t.sort(),e.sort();for(var i=t.shift(),o=e.shift();void 0!==i&&void 0!==o;)i===o?(n++,i=t.shift(),o=e.shift()):i<o?i=t.shift():i>o&&(o=e.shift());return n/r*200},t.prototype.getNewId=function(t){return"".concat(t,"_").concat(w())},t.prototype.isLoopPath=function(t){var e=t.length;return t.indexOf(t[e-1])!==e-1?1:0},t.pluginName="flowPath",t}(),cg=-1,dg=0,hg=1,pg=function(){function t(t){var e=t.lf,n=this;this.levelHeight=[],this.newNodeMap=new Map,this.lf=e,this.trunk=[],e.layout=function(t){var e=n.lf.getGraphRawData();n.lf.setStartNodeType(t);var r=n.lf.getPathes();return n.levelHeight=[],n.newNodeMap=new Map,n.layout(e,r)}}return t.prototype.layout=function(t,e){var n=this,r=[];e.forEach((function(t){var e=t.elements;e.length>r.length?r=e:e.length===r.length&&JSON.stringify(e)===JSON.stringify(n.trunk)&&(r=n.trunk)})),this.trunk=r;for(var i=this.formatData(t),o={nodes:[],edges:[]},a=r.length-1;a>=0;a--)this.setNodePosition(r[a],i,o,a,1);this.lf.graphModel.graphDataToModel(o)},t.prototype.setNodePosition=function(t,e,n,r,i){var o=this,a=e[t],u=a.text,s=a.type,l=a.next,c=a.properties,d=160*r+40,h=120*i,p={id:t,x:d,text:u,y:h,type:s,properties:c};return u&&"object"==typeof u&&(p.text=v(v({},u),{x:d+u.x,y:h+u.y})),this.newNodeMap.set(p.id,{x:p.x,y:p.y,type:s}),n.nodes.push(p),a.isFixed=!0,this.addLevelHeight(r,1),l&&l.length>0&&l.forEach((function(i){if(!e[i.nodeId].isFixed){var a=o.getLevelHeight(r+1);o.addLevelHeight(r,1),o.setNodePosition(i.nodeId,e,n,r+1,a+1)}n.edges.push(v({id:i.edgeId,type:i.edgeType,sourceNodeId:t,targetNodeId:i.nodeId,properties:i.properties,text:i.text},o.getEdgeDataPoints(t,i.nodeId)))})),p},t.prototype.getEdgeDataPoints=function(t,e){var n=this.newNodeMap.get(t),r=this.newNodeMap.get(e),i=this.getShape(t),o=i.width,a=i.height,u=this.getShape(e),s=u.width,l=u.height,c=this.getRelativePosition(n,r),d={x:n.x,y:n.y},h={x:r.x,y:r.y};switch(c){case dg:d.x=n.x+o/2,h.x=r.x-s/2;break;case cg:d.y=n.y+a/2,h.x=r.x-s/2;break;case hg:d.x=n.x+o/2,h.y=r.y+l/2}return{startPoint:d,endPoint:h}},t.prototype.getRelativePosition=function(t,e){var n=t.y,r=e.y;return n<r?-1:n===r?0:1},t.prototype.getShape=function(t){var e,n,r=this.lf.getNodeModelById(t);return{height:null!==(e=null==r?void 0:r.height)&&void 0!==e?e:0,width:null!==(n=null==r?void 0:r.width)&&void 0!==n?n:0}},t.prototype.formatData=function(t){var e=t.nodes.reduce((function(t,e){var n=e.type,r=e.properties,i=e.text,o=e.x,a=e.y;return i&&"object"==typeof i&&(i.x=i.x-o,i.y=i.y-a),t[e.id]={type:n,properties:r,text:i,prev:[],next:[]},t}),{});return t.edges.forEach((function(t){var n=t.sourceNodeId,r=t.targetNodeId,i=t.id,o=t.properties,a=t.text,u=a;"object"==typeof a&&(u=a.value),e[n].next.push({edgeId:i,nodeId:r,edgeType:t.type,properties:o,text:u}),e[r].prev.push({edgeId:i,nodeId:n,properties:o,text:u})})),e},t.prototype.addLevelHeight=function(t,e,n){void 0===e&&(e=1),void 0===n&&(n=!1);var r=this.levelHeight[t];r||(r={positiveHeight:0,negativeHeight:0},this.levelHeight[t]=r),n?r.negativeHeight-=e:r.positiveHeight+=e},t.prototype.getLevelHeight=function(t,e){void 0===e&&(e=!1);var n=this.levelHeight[t];return n?e?n.negativeHeight:n.positiveHeight:0},t.pluginName="AutoLayout",t}(),fg=function(t,e){var n=[],r=[],i=function(t,r,o){o&&r.unshift.apply(r,b([],m(e.getEdgeModels({sourceNodeId:t.id,targetNodeId:null==o?void 0:o.id}).map((function(t){return t.id}))),!1)),r.includes(t.id)?n.push(r):(r.unshift(t.id),t.incoming.nodes.length?t.incoming.nodes.forEach((function(e){i(e,r.slice(),t)})):n.push(r))},o=function(t,n,i){i&&n.push.apply(n,b([],m(e.getEdgeModels({sourceNodeId:null==i?void 0:i.id,targetNodeId:t.id}).map((function(t){return t.id}))),!1)),n.includes(t.id)?r.push(n):(n.push(t.id),t.outgoing.nodes.length?t.outgoing.nodes.forEach((function(e){o(e,n.slice(),t)})):r.push(n))};return i(t,[]),o(t,[]),b([],m(new Set(b(b([],m(n.flat()),!1),m(r.flat()),!1))),!1)},vg=function(){function t(t){var e=t.lf;this.mode="path",this.manual=!1,this.tempStyles={},this.lf=e}return t.prototype.setMode=function(t){this.mode=t},t.prototype.setManual=function(t){this.manual=t},t.prototype.highlightSingle=function(t){var e=this.lf.getModelById(t);"node"===(null==e?void 0:e.BaseType)?e.updateStyles(this.tempStyles[t]):"edge"===(null==e?void 0:e.BaseType)&&(e.updateStyles(this.tempStyles[t]),e.sourceNode.updateStyles(this.tempStyles[e.sourceNode.id]),e.targetNode.updateStyles(this.tempStyles[e.targetNode.id]))},t.prototype.highlightPath=function(t){var e=this,n=function(t,e){var n=e.getModelById(t);return fg("node"===(null==n?void 0:n.BaseType)?n:null==n?void 0:n.targetNode,e)}(t,this.lf);n.forEach((function(t){var n;null===(n=e.lf.getModelById(t))||void 0===n||n.updateStyles(e.tempStyles[t])}))},t.prototype.highlight=function(t,e){var n=this;(void 0===e&&(e=this.mode),this.manual)||(Object.keys(this.tempStyles).length&&this.restoreHighlight(),Object.values(this.lf.graphModel.modelsMap).forEach((function(t){var e="node"===t.BaseType?t.getNodeStyle():t.getEdgeStyle();n.tempStyles[t.id]=v({},e),t.setStyles({opacity:.1})})),{single:this.highlightSingle.bind(this),path:this.highlightPath.bind(this)}[e](t))},t.prototype.restoreHighlight=function(){var t=this;Object.keys(this.tempStyles).length&&(Object.values(this.lf.graphModel.modelsMap).forEach((function(e){var n,r=null!==(n=t.tempStyles[e.id])&&void 0!==n?n:{};e.updateStyles(v({},r))})),this.tempStyles={})},t.prototype.render=function(){var t=this;this.lf.on("node:mouseenter",(function(e){var n=e.data;return t.highlight(n.id)})),this.lf.on("edge:mouseenter",(function(e){var n=e.data;return t.highlight(n.id)})),this.lf.on("node:mouseleave",this.restoreHighlight.bind(this)),this.lf.on("edge:mouseleave",this.restoreHighlight.bind(this)),this.lf.on("history:change",this.restoreHighlight.bind(this))},t.prototype.destroy=function(){},t.pluginName="highlight",t}();t.AutoLayout=pg,t.BPMNAdapter=Rv,t.BPMNBaseAdapter=jv,t.BPMNElements=Yf,t.BoundaryEventFactory=yt,t.BpmnAdapter=ut,t.BpmnElement=F,t.BpmnXmlAdapter=st,t.ContextMenu=tg,t.Control=Yv,t.CurvedEdge=ug,t.CurvedEdgeModel=sg,t.DiamondResize=Pf,t.DiamondResizeModel=Sf,t.DiamondResizeView=Af,t.DndPanel=eg,t.EllipseResize=Nf,t.EllipseResizeModel=Mf,t.EllipseResizeView=Ef,t.EndEventFactory=ft,t.EndEventModel=S,t.EndEventView=A,t.ExclusiveGatewayModel=k,t.ExclusiveGatewayView=j,t.FlowPath=lg,t.GatewayNodeFactory=Tt,t.Group=Wf,t.GroupNode=Lf,t.GroupNodeModel=Df,t.Highlight=vg,t.HtmlResize=Cf,t.HtmlResizeModel=Of,t.HtmlResizeView=Tf,t.InsertNodeInPolyline=Vv,t.IntermediateCatchEventFactory=vt,t.IntermediateThrowEventFactory=mt,t.Menu=Jv,t.MiniMap=rg,t.NodeResize=Rf,t.RectResize=If,t.RectResizeModel=kf,t.RectResizeView=jf,t.SelectionSelect=ng,t.SequenceFlowModel=O,t.SequenceFlowView=T,t.ServiceTaskModel=R,t.ServiceTaskView=D,t.Snapshot=Dv,t.StartEventFactory=gt,t.StartEventModel=M,t.StartEventView=E,t.SubProcessFactory=Ff,t.TaskNodeFactory=kt,t.UserTaskModel=B,t.UserTaskView=z,t.bpmnUtils=pt,t.convertNormalToXml=Sv,t.convertXmlToNormal=Av,t.gateway={exclusive:0,inclusive:1,parallel:2},t.gatewayComposable=[[1,1,0],[0,0,1],[0,1,1]],t.getCurvedEdgePath=ag,t.handleAttributes=V,t.icons=Ot,t.lfJson2Xml=Z,t.lfXml2Json=J,t.multiInstanceIcon=Ct,t.sequenceFlowFactory=Hf,t.toLogicflowData=function(t){var e={nodes:[],edges:[]},n=t.flowElementList;return n&&n.length>0&&n.forEach((function(t){if(t.type===Lv.SEQUENCE_FLOW){var n=function(t){var e=t.incoming,n=t.outgoing,r=t.properties,i=t.key,o=t.type,a=r.text,u=r.name,s=r.startPoint,l=r.endPoint,c=r.pointsList,d={id:i,type:Bv[o],sourceNodeId:e[0],targetNodeId:n[0],text:a||u,properties:{}};s&&(d.startPoint=JSON.parse(s)),l&&(d.endPoint=JSON.parse(l)),c&&(d.pointsList=JSON.parse(c));var h=["startPoint","endPoint","pointsList","text"];return Object.keys(t.properties).forEach((function(e){-1===h.indexOf(e)&&(d.properties[e]=t.properties[e])})),d}(t);e.edges.push(n)}else{var r=function(t){var e=t.properties,n=t.key,r=t.type,i=t.bounds,o=e.x,a=e.y,u=e.text;if(void 0===o){var s=m(i,2),l=s[0],c=l.x,d=l.y,h=s[1];o=(c+h.x)/2,a=(d+h.y)/2}var p={id:n,type:Bv[r],x:o,y:a,text:u,properties:{}},f=["x","y","text"];return Object.keys(t.properties).forEach((function(e){-1===f.indexOf(e)&&(p.properties[e]=t.properties[e])})),p}(t);e.nodes.push(r)}})),e},t.toNormalJson=nt,t.toTurboData=function(t){var e=new Map,n={flowElementList:[]};return t.nodes.forEach((function(t){var r=function(t){var e=t.id,n=t.type,r=t.x,i=t.y,o=t.text,a=void 0===o?"":o,u=t.properties;return{incoming:[],outgoing:[],dockers:[],type:zv(n),properties:v(v({},u),{name:a&&a.value||"",x:r,y:i,text:a}),key:e}}(t);n.flowElementList.push(r),e.set(t.id,r)})),t.edges.forEach((function(t){var r=function(t){var e=t.id,n=t.type,r=t.sourceNodeId,i=t.targetNodeId,o=t.startPoint,a=t.endPoint,u=t.pointsList,s=t.text,l=void 0===s?"":s,c=t.properties;return{incoming:[r],outgoing:[i],type:zv(n),dockers:[],properties:v(v({},c),{name:l&&l.value||"",text:l,startPoint:JSON.stringify(o),endPoint:JSON.stringify(a),pointsList:JSON.stringify(u)}),key:e}}(t);e.get(t.sourceNodeId).outgoing.push(r.key),e.get(t.targetNodeId).incoming.push(r.key),n.flowElementList.push(r)})),n},t.toXmlJson=et,t.useDefinition=Vf}));
|
|
11
|
+
var df,hf,pf=4294967295,ff=Array.prototype,vf=Object.prototype.hasOwnProperty,gf=Bt?Bt.iterator:void 0,yf=Math.max,mf=Math.min,bf=function(t){return function(e,n,r){if(null==r){var i=de(n),o=i&&ii(n),a=o&&o.length&&tc(n,o);(a?a.length:i)||(r=n,n=e,e=this)}return t(e,n,r)}}(dd);hn.after=$p.after,hn.ary=$p.ary,hn.assign=rf.assign,hn.assignIn=rf.assignIn,hn.assignInWith=rf.assignInWith,hn.assignWith=rf.assignWith,hn.at=rf.at,hn.before=$p.before,hn.bind=$p.bind,hn.bindAll=uf.bindAll,hn.bindKey=$p.bindKey,hn.castArray=Jp.castArray,hn.chain=of.chain,hn.chunk=Yp.chunk,hn.compact=Yp.compact,hn.concat=Yp.concat,hn.cond=uf.cond,hn.conforms=uf.conforms,hn.constant=uf.constant,hn.countBy=Zp.countBy,hn.create=rf.create,hn.curry=$p.curry,hn.curryRight=$p.curryRight,hn.debounce=$p.debounce,hn.defaults=rf.defaults,hn.defaultsDeep=rf.defaultsDeep,hn.defer=$p.defer,hn.delay=$p.delay,hn.difference=Yp.difference,hn.differenceBy=Yp.differenceBy,hn.differenceWith=Yp.differenceWith,hn.drop=Yp.drop,hn.dropRight=Yp.dropRight,hn.dropRightWhile=Yp.dropRightWhile,hn.dropWhile=Yp.dropWhile,hn.fill=Yp.fill,hn.filter=Zp.filter,hn.flatMap=Zp.flatMap,hn.flatMapDeep=Zp.flatMapDeep,hn.flatMapDepth=Zp.flatMapDepth,hn.flatten=Yp.flatten,hn.flattenDeep=Yp.flattenDeep,hn.flattenDepth=Yp.flattenDepth,hn.flip=$p.flip,hn.flow=uf.flow,hn.flowRight=uf.flowRight,hn.fromPairs=Yp.fromPairs,hn.functions=rf.functions,hn.functionsIn=rf.functionsIn,hn.groupBy=Zp.groupBy,hn.initial=Yp.initial,hn.intersection=Yp.intersection,hn.intersectionBy=Yp.intersectionBy,hn.intersectionWith=Yp.intersectionWith,hn.invert=rf.invert,hn.invertBy=rf.invertBy,hn.invokeMap=Zp.invokeMap,hn.iteratee=uf.iteratee,hn.keyBy=Zp.keyBy,hn.keys=ii,hn.keysIn=rf.keysIn,hn.map=Zp.map,hn.mapKeys=rf.mapKeys,hn.mapValues=rf.mapValues,hn.matches=uf.matches,hn.matchesProperty=uf.matchesProperty,hn.memoize=$p.memoize,hn.merge=rf.merge,hn.mergeWith=rf.mergeWith,hn.method=uf.method,hn.methodOf=uf.methodOf,hn.mixin=bf,hn.negate=fd,hn.nthArg=uf.nthArg,hn.omit=rf.omit,hn.omitBy=rf.omitBy,hn.once=$p.once,hn.orderBy=Zp.orderBy,hn.over=uf.over,hn.overArgs=$p.overArgs,hn.overEvery=uf.overEvery,hn.overSome=uf.overSome,hn.partial=$p.partial,hn.partialRight=$p.partialRight,hn.partition=Zp.partition,hn.pick=rf.pick,hn.pickBy=rf.pickBy,hn.property=uf.property,hn.propertyOf=uf.propertyOf,hn.pull=Yp.pull,hn.pullAll=Yp.pullAll,hn.pullAllBy=Yp.pullAllBy,hn.pullAllWith=Yp.pullAllWith,hn.pullAt=Yp.pullAt,hn.range=uf.range,hn.rangeRight=uf.rangeRight,hn.rearg=$p.rearg,hn.reject=Zp.reject,hn.remove=Yp.remove,hn.rest=$p.rest,hn.reverse=Yp.reverse,hn.sampleSize=Zp.sampleSize,hn.set=rf.set,hn.setWith=rf.setWith,hn.shuffle=Zp.shuffle,hn.slice=Yp.slice,hn.sortBy=Zp.sortBy,hn.sortedUniq=Yp.sortedUniq,hn.sortedUniqBy=Yp.sortedUniqBy,hn.split=af.split,hn.spread=$p.spread,hn.tail=Yp.tail,hn.take=Yp.take,hn.takeRight=Yp.takeRight,hn.takeRightWhile=Yp.takeRightWhile,hn.takeWhile=Yp.takeWhile,hn.tap=of.tap,hn.throttle=$p.throttle,hn.thru=fp,hn.toArray=Jp.toArray,hn.toPairs=rf.toPairs,hn.toPairsIn=rf.toPairsIn,hn.toPath=uf.toPath,hn.toPlainObject=Jp.toPlainObject,hn.transform=rf.transform,hn.unary=$p.unary,hn.union=Yp.union,hn.unionBy=Yp.unionBy,hn.unionWith=Yp.unionWith,hn.uniq=Yp.uniq,hn.uniqBy=Yp.uniqBy,hn.uniqWith=Yp.uniqWith,hn.unset=rf.unset,hn.unzip=Yp.unzip,hn.unzipWith=Yp.unzipWith,hn.update=rf.update,hn.updateWith=rf.updateWith,hn.values=rf.values,hn.valuesIn=rf.valuesIn,hn.without=Yp.without,hn.words=af.words,hn.wrap=$p.wrap,hn.xor=Yp.xor,hn.xorBy=Yp.xorBy,hn.xorWith=Yp.xorWith,hn.zip=Yp.zip,hn.zipObject=Yp.zipObject,hn.zipObjectDeep=Yp.zipObjectDeep,hn.zipWith=Yp.zipWith,hn.entries=rf.toPairs,hn.entriesIn=rf.toPairsIn,hn.extend=rf.assignIn,hn.extendWith=rf.assignInWith,bf(hn,hn),hn.add=Qp.add,hn.attempt=uf.attempt,hn.camelCase=af.camelCase,hn.capitalize=af.capitalize,hn.ceil=Qp.ceil,hn.clamp=tf,hn.clone=Jp.clone,hn.cloneDeep=Jp.cloneDeep,hn.cloneDeepWith=Jp.cloneDeepWith,hn.cloneWith=Jp.cloneWith,hn.conformsTo=Jp.conformsTo,hn.deburr=af.deburr,hn.defaultTo=uf.defaultTo,hn.divide=Qp.divide,hn.endsWith=af.endsWith,hn.eq=Jp.eq,hn.escape=af.escape,hn.escapeRegExp=af.escapeRegExp,hn.every=Zp.every,hn.find=Zp.find,hn.findIndex=Yp.findIndex,hn.findKey=rf.findKey,hn.findLast=Zp.findLast,hn.findLastIndex=Yp.findLastIndex,hn.findLastKey=rf.findLastKey,hn.floor=Qp.floor,hn.forEach=Zp.forEach,hn.forEachRight=Zp.forEachRight,hn.forIn=rf.forIn,hn.forInRight=rf.forInRight,hn.forOwn=rf.forOwn,hn.forOwnRight=rf.forOwnRight,hn.get=rf.get,hn.gt=Jp.gt,hn.gte=Jp.gte,hn.has=rf.has,hn.hasIn=rf.hasIn,hn.head=Yp.head,hn.identity=we,hn.includes=Zp.includes,hn.indexOf=Yp.indexOf,hn.inRange=ef,hn.invoke=rf.invoke,hn.isArguments=Jp.isArguments,hn.isArray=te,hn.isArrayBuffer=Jp.isArrayBuffer,hn.isArrayLike=Jp.isArrayLike,hn.isArrayLikeObject=Jp.isArrayLikeObject,hn.isBoolean=Jp.isBoolean,hn.isBuffer=Jp.isBuffer,hn.isDate=Jp.isDate,hn.isElement=Jp.isElement,hn.isEmpty=Jp.isEmpty,hn.isEqual=Jp.isEqual,hn.isEqualWith=Jp.isEqualWith,hn.isError=Jp.isError,hn.isFinite=Jp.isFinite,hn.isFunction=Jp.isFunction,hn.isInteger=Jp.isInteger,hn.isLength=Jp.isLength,hn.isMap=Jp.isMap,hn.isMatch=Jp.isMatch,hn.isMatchWith=Jp.isMatchWith,hn.isNaN=Jp.isNaN,hn.isNative=Jp.isNative,hn.isNil=Jp.isNil,hn.isNull=Jp.isNull,hn.isNumber=Jp.isNumber,hn.isObject=de,hn.isObjectLike=Jp.isObjectLike,hn.isPlainObject=Jp.isPlainObject,hn.isRegExp=Jp.isRegExp,hn.isSafeInteger=Jp.isSafeInteger,hn.isSet=Jp.isSet,hn.isString=Jp.isString,hn.isSymbol=Jp.isSymbol,hn.isTypedArray=Jp.isTypedArray,hn.isUndefined=Jp.isUndefined,hn.isWeakMap=Jp.isWeakMap,hn.isWeakSet=Jp.isWeakSet,hn.join=Yp.join,hn.kebabCase=af.kebabCase,hn.last=hl,hn.lastIndexOf=Yp.lastIndexOf,hn.lowerCase=af.lowerCase,hn.lowerFirst=af.lowerFirst,hn.lt=Jp.lt,hn.lte=Jp.lte,hn.max=Qp.max,hn.maxBy=Qp.maxBy,hn.mean=Qp.mean,hn.meanBy=Qp.meanBy,hn.min=Qp.min,hn.minBy=Qp.minBy,hn.stubArray=uf.stubArray,hn.stubFalse=uf.stubFalse,hn.stubObject=uf.stubObject,hn.stubString=uf.stubString,hn.stubTrue=uf.stubTrue,hn.multiply=Qp.multiply,hn.nth=Yp.nth,hn.noop=uf.noop,hn.now=Kp,hn.pad=af.pad,hn.padEnd=af.padEnd,hn.padStart=af.padStart,hn.parseInt=af.parseInt,hn.random=nf,hn.reduce=Zp.reduce,hn.reduceRight=Zp.reduceRight,hn.repeat=af.repeat,hn.replace=af.replace,hn.result=rf.result,hn.round=Qp.round,hn.sample=Zp.sample,hn.size=Zp.size,hn.snakeCase=af.snakeCase,hn.some=Zp.some,hn.sortedIndex=Yp.sortedIndex,hn.sortedIndexBy=Yp.sortedIndexBy,hn.sortedIndexOf=Yp.sortedIndexOf,hn.sortedLastIndex=Yp.sortedLastIndex,hn.sortedLastIndexBy=Yp.sortedLastIndexBy,hn.sortedLastIndexOf=Yp.sortedLastIndexOf,hn.startCase=af.startCase,hn.startsWith=af.startsWith,hn.subtract=Qp.subtract,hn.sum=Qp.sum,hn.sumBy=Qp.sumBy,hn.template=af.template,hn.times=uf.times,hn.toFinite=Jp.toFinite,hn.toInteger=_e,hn.toLength=Jp.toLength,hn.toLower=af.toLower,hn.toNumber=Jp.toNumber,hn.toSafeInteger=Jp.toSafeInteger,hn.toString=Jp.toString,hn.toUpper=af.toUpper,hn.trim=af.trim,hn.trimEnd=af.trimEnd,hn.trimStart=af.trimStart,hn.truncate=af.truncate,hn.unescape=af.unescape,hn.uniqueId=uf.uniqueId,hn.upperCase=af.upperCase,hn.upperFirst=af.upperFirst,hn.each=Zp.forEach,hn.eachRight=Zp.forEachRight,hn.first=Yp.head,bf(hn,(df={},js(hn,(function(t,e){vf.call(hn.prototype,e)||(df[e]=t)})),df),{chain:!1}),hn.VERSION="4.17.21",(hn.templateSettings=af.templateSettings).imports._=hn,En(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){hn[t].placeholder=hn})),En(["drop","take"],(function(t,e){en.prototype[t]=function(n){n=void 0===n?1:yf(_e(n),0);var r=this.__filtered__&&!e?new en(this):this.clone();return r.__filtered__?r.__takeCount__=mf(n,r.__takeCount__):r.__views__.push({size:mf(n,pf),type:t+(r.__dir__<0?"Right":"")}),r},en.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),En(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;en.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Ts(t),type:n}),e.__filtered__=e.__filtered__||r,e}})),En(["head","last"],(function(t,e){var n="take"+(e?"Right":"");en.prototype[t]=function(){return this[n](1).value()[0]}})),En(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");en.prototype[t]=function(){return this.__filtered__?new en(this):this[n](1)}})),en.prototype.compact=function(){return this.filter(we)},en.prototype.find=function(t){return this.filter(t).head()},en.prototype.findLast=function(t){return this.reverse().find(t)},en.prototype.invokeMap=Nr((function(t,e){return"function"==typeof t?new en(this):this.map((function(n){return Oc(n,t,e)}))})),en.prototype.reject=function(t){return this.filter(fd(Ts(t)))},en.prototype.slice=function(t,e){t=_e(t);var n=this;return n.__filtered__&&(t>0||e<0)?new en(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=_e(e))<0?n.dropRight(-e):n.take(e-t)),n)},en.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},en.prototype.toArray=function(){return this.take(pf)},js(en.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=hn[r?"take"+("last"==e?"Right":""):e],o=r||/^find/.test(e);i&&(hn.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,u=e instanceof en,s=a[0],l=u||te(e),c=function(t){var e=i.apply(hn,Bi([t],a));return r&&d?e[0]:e};l&&n&&"function"==typeof s&&1!=s.length&&(u=l=!1);var d=this.__chain__,h=!!this.__actions__.length,p=o&&!d,f=u&&!h;if(!o&&l){e=f?e:new en(this);var v=t.apply(e,a);return v.__actions__.push({func:fp,args:[c],thisArg:void 0}),new sn(v,d)}return p&&f?t.apply(this,a):(v=this.thru(c),p?r?v.value()[0]:v.value():v)})})),En(["pop","push","shift","sort","splice","unshift"],(function(t){var e=ff[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);hn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(te(i)?i:[],t)}return this[n]((function(n){return e.apply(te(n)?n:[],t)}))}})),js(en.prototype,(function(t,e){var n=hn[e];if(n){var r=n.name+"";vf.call(on,r)||(on[r]=[]),on[r].push({name:e,func:n})}})),on[$n(void 0,2).name]=[{name:"wrapper",func:void 0}],en.prototype.clone=function(){var t=new en(this.__wrapped__);return t.__actions__=ln(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=ln(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=ln(this.__views__),t},en.prototype.reverse=function(){if(this.__filtered__){var t=new en(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},en.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=te(t),r=e<0,i=n?t.length:0,o=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=lf(e,t+a);break;case"takeRight":t=sf(t,e-a)}}return{start:t,end:e}}(0,i,this.__views__),a=o.start,u=o.end,s=u-a,l=r?u:a-1,c=this.__iteratees__,d=c.length,h=0,p=cf(s,this.__takeCount__);if(!n||!r&&i==s&&p==s)return yp(t,this.__actions__);var f=[];t:for(;s--&&h<p;){for(var v=-1,g=t[l+=e];++v<d;){var y=c[v],m=y.iteratee,b=y.type,x=m(g);if(2==b)g=x;else if(!x){if(1==b)continue t;break t}}f[h++]=g}return f},hn.prototype.at=of.at,hn.prototype.chain=of.wrapperChain,hn.prototype.commit=of.commit,hn.prototype.next=of.next,hn.prototype.plant=of.plant,hn.prototype.reverse=of.reverse,hn.prototype.toJSON=hn.prototype.valueOf=hn.prototype.value=of.value,hn.prototype.first=hn.prototype.head,gf&&(hn.prototype[gf]=of.toIterator),hf={__e:function(t,e,n,r){for(var i,o,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(t)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(t,r||{}),a=i.__d),a)return i.__E=i}catch(e){t=e}throw t}},"function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout;var xf=0;function _f(t,e,n,r,i,o){e||(e={});var a,u,s=e;if("ref"in s)for(u in s={},e)"ref"==u?a=e[u]:s[u]=e[u];var l={type:t,props:s,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--xf,__i:-1,__u:0,__source:i,__self:o};if("function"==typeof t&&(a=t.defaultProps))for(u in a)void 0===s[u]&&(s[u]=a[u]);return hf.vnode&&hf.vnode(l),l}var wf=e.LogicFlowUtil.StepDrag,Mf=function(t){function n(n){var r=t.call(this)||this;return r.updatePosition=function(t){var e=t.deltaX,n=t.deltaY,i=r.nodeModel,o=i.x,a=i.y;r.nodeModel.x=o+e/2,r.nodeModel.y=a+n/2,r.nodeModel.moveText(e/2,n/2)},r.getResize=function(t){var e=t.index,n=t.deltaX,r=t.deltaY,i=t.width,o=t.height,a=t.PCTResizeInfo,u=t.pct,s=void 0===u?1:u,l=t.freezeWidth,c=void 0!==l&&l,d=t.freezeHeight,h=void 0!==d&&d,p={width:i,height:o,deltaX:n,deltaY:r};if(a){var f=0,v=0;switch(e){case 0:v=(-1*n-r)/4;break;case 1:v=(n-r)/4;break;case 2:v=(n+r)/4;break;case 3:v=(-1*n+r)/4}0!==v&&(f=Math.round(v/a.ResizeBasis.basisHeight*1e5)/1e3),a.ResizePCT.widthPCT=Math.max(Math.min(a.ResizePCT.widthPCT+f,a.ScaleLimit.maxScaleLimit),a.ScaleLimit.minScaleLimit),a.ResizePCT.heightPCT=Math.max(Math.min(a.ResizePCT.heightPCT+f,a.ScaleLimit.maxScaleLimit),a.ScaleLimit.minScaleLimit);var g=Math.round(a.ResizePCT.widthPCT*a.ResizeBasis.basisWidth/100),y=Math.round(a.ResizePCT.heightPCT*a.ResizeBasis.basisHeight/100);switch(e){case 0:n=i-g,r=o-y;break;case 1:n=g-i,r=o-y;break;case 2:n=g-i,r=y-o;break;case 3:n=i-g,r=y-o}return p.width=g,p.height=y,p.deltaX=n/s,p.deltaY=r/s,p}switch(e){case 0:p.width=c?i:i-n*s,p.height=h?o:o-r*s;break;case 1:p.width=c?i:i+n*s,p.height=h?o:o-r*s;break;case 2:p.width=c?i:i+n*s,p.height=h?o:o+r*s;break;case 3:p.width=c?i:i-n*s,p.height=h?o:o+r*s}return p},r.updateEdgePointByAnchors=function(){var t=r.nodeModel,e=t.id,n=t.anchors,i=r.getNodeEdges(e);i.sourceEdges.forEach((function(t){var e=n.find((function(e){return e.id===t.sourceAnchorId}));e&&t.updateStartPoint({x:e.x,y:e.y})})),i.targetEdges.forEach((function(t){var e=n.find((function(e){return e.id===t.targetAnchorId}));e&&t.updateEndPoint({x:e.x,y:e.y})}))},r.updateRect=function(t){var e=t.deltaX,n=t.deltaY,i=r.nodeModel,o=i.x,a=i.y,u=i.width,s=i.height,l=i.radius,c=i.PCTResizeInfo,d=r.nodeModel,h=d.minWidth,p=d.minHeight,f=d.maxWidth,v=d.maxHeight,g=r.index,y=h===f,m=p===v,b=r.getResize({index:g,deltaX:e,deltaY:n,width:u,height:s,PCTResizeInfo:c,pct:1,freezeWidth:y,freezeHeight:m});if(b.width<h||b.width>f||b.height<p||b.height>v)r.dragHandler.cancelDrag();else{r.updatePosition({deltaX:y?0:b.deltaX,deltaY:m?0:b.deltaY}),r.nodeModel.width=b.width,r.nodeModel.height=b.height,r.nodeModel.setProperties({nodeSize:{width:b.width,height:b.height}});var x={x:o,y:a,width:u,height:s,radius:l},_={x:r.nodeModel.x,y:r.nodeModel.y,width:r.nodeModel.width,height:r.nodeModel.height,radius:l};r.updateEdgePointByAnchors(),r.eventEmit({beforeNode:x,afterNode:_})}},r.updateEllipse=function(t){var e=t.deltaX,n=t.deltaY,i=r.nodeModel,o=i.rx,a=i.ry,u=i.x,s=i.y,l=i.PCTResizeInfo,c=r.index,d=r.nodeModel,h=d.minWidth,p=d.minHeight,f=d.maxWidth,g=d.maxHeight,y=h===f,m=p===g,b=o,x=a,_=r.getResize({index:c,deltaX:e,deltaY:n,width:b,height:x,PCTResizeInfo:l,pct:.5,freezeWidth:y,freezeHeight:m});if(_.width<h/2||_.width>f/2||_.height<p/2||_.height>g/2)r.dragHandler.cancelDrag();else{r.updatePosition({deltaX:y?0:_.deltaX,deltaY:m?0:_.deltaY}),r.nodeModel.rx=_.width,r.nodeModel.ry=_.height,r.nodeModel.setProperties({nodeSize:{rx:_.width,ry:_.height}});var w={x:u,y:s},M={rx:_.width,ry:_.height,x:r.nodeModel.x,y:r.nodeModel.y};r.updateEdgePointByAnchors(),r.eventEmit({beforeNode:v(v({},w),{rx:o,ry:a}),afterNode:M})}},r.updateDiamond=function(t){var e=t.deltaX,n=t.deltaY,i=r.nodeModel,o=i.rx,a=i.ry,u=i.x,s=i.y,l=i.PCTResizeInfo,c=r.index,d=r.nodeModel,h=d.minWidth,p=d.minHeight,f=d.maxWidth,v=d.maxHeight,g=h===f,y=p===v,m=o,b=a,x=r.getResize({index:c,deltaX:e,deltaY:n,width:m,height:b,PCTResizeInfo:l,pct:.5,freezeWidth:g,freezeHeight:y});if(x.width<h/2||x.width>f/2||x.height<p/2||x.height>v/2)r.dragHandler.cancelDrag();else{r.updatePosition({deltaX:g?0:x.deltaX,deltaY:y?0:x.deltaY}),r.nodeModel.rx=x.width,r.nodeModel.ry=x.height,r.nodeModel.setProperties({nodeSize:{rx:x.width,ry:x.height}});var _={x:u,y:s,rx:o,ry:a},w={rx:x.width,ry:x.height,x:r.nodeModel.x,y:r.nodeModel.y};r.updateEdgePointByAnchors(),r.eventEmit({beforeNode:_,afterNode:w})}},r.eventEmit=function(t){var e=t.beforeNode,n=t.afterNode,i=r.nodeModel,o=i.id,a=i.modelType,u=i.type,s=v({id:o,modelType:a,type:u},e),l=v({id:o,modelType:a,type:u},n);r.graphModel.eventCenter.emit("node:resize",{oldNodeSize:s,newNodeSize:l})},r.onDragging=function(t){var n,i=t.deltaX,o=t.deltaY,a=r.graphModel.transformModel,u=r.nodeModel.modelType;i=(n=x(a.fixDeltaXY(i,o),2))[0],o=n[1],u===e.ModelType.RECT_NODE||u===e.ModelType.HTML_NODE?r.updateRect({deltaX:i,deltaY:o}):u===e.ModelType.ELLIPSE_NODE?r.updateEllipse({deltaX:i,deltaY:o}):u===e.ModelType.DIAMOND_NODE&&r.updateDiamond({deltaX:i,deltaY:o})},r.onDragEnd=function(){var t=r.graphModel.gridSize,e=void 0===t?1:t,n=e*Math.round(r.nodeModel.x/e),i=e*Math.round(r.nodeModel.y/e);r.nodeModel.moveTo(n,i),r.updateEdgePointByAnchors()},r.index=n.index,r.nodeModel=n.model,r.graphModel=n.graphModel,r.dragHandler=new wf({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:1}),r}return f(n,t),n.prototype.getNodeEdges=function(t){for(var e=this.graphModel.edges,n=[],r=[],i=0;i<e.length;i++){var o=e[i];o.sourceNodeId===t?n.push(o):e[i].targetNodeId===t&&r.push(o)}return{sourceEdges:n,targetEdges:r}},n.prototype.render=function(){var t=this.props,n=t.x,r=t.y,i=t.index,o=t.model.getControlPointStyle();return _f("g",{className:"lf-resize-control-".concat(i),children:_f(e.Rect,v({className:"lf-node-control",x:n,y:r},o,{onMouseDown:this.dragHandler.handleMouseDown}))})},n}(e.Component),Ef=function(t){function n(){var e=t.call(this)||this;return e.state={},e}return f(n,t),n.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,r=e.x,i=e.y,o=e.width,a=e.height,u={minX:r-o/2,minY:i-a/2,maxX:r+o/2,maxY:i+a/2},s=u.minX,l=u.minY,c=u.maxX,d=u.maxY;return[{x:s,y:l},{x:c,y:l},{x:c,y:d},{x:s,y:d}].map((function(t,r){return _f(Mf,v({index:r},t,{model:e,graphModel:n}))}))},n.prototype.getGroupSolid=function(){var t=this.props.model,n=t.x,r=t.y,i=t.width,o=t.height,a=t.getResizeOutlineStyle();return _f(e.Rect,v({},a,{x:n,y:r,width:i,height:o}))},n.prototype.render=function(){return _f("g",{className:"lf-resize-control",children:[this.getGroupSolid(),this.getResizeControl()]})},n}(e.Component),Nf=function(t){function e(e,n){var r=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(r.rx=i.rx,r.ry=i.ry),r}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.rx,basisHeight:this.ry},n={maxScaleLimit:Math.min(this.maxWidth/(2*this.rx)*100,this.maxHeight/(2*this.ry)*100),minScaleLimit:Math.max(this.minWidth/(2*this.rx)*100,this.minHeight/(2*this.ry)*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.EllipseNodeModel),Sf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return _f(Ef,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model,n=t.graphModel.editConfigModel.isSilentMode;return _f("g",{children:[this.getResizeShape(),e.isSelected&&!n?this.getControlGroup():""]})},e}(e.EllipseNode),Af={type:"ellipse",view:Sf,model:Nf},Pf=function(t){function e(e,n){var r=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(r.rx=i.rx,r.ry=i.ry),r}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.gridSize=1},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.rx,basisHeight:this.ry},n={maxScaleLimit:Math.min(this.maxWidth/(2*this.rx)*100,this.maxHeight/(2*this.ry)*100),minScaleLimit:Math.max(this.minWidth/(2*this.rx)*100,this.minHeight/(2*this.ry)*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.DiamondNodeModel),Tf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return _f(Ef,{model:e,graphModel:n})},n.prototype.getResizeShape=function(){var t=this.props.model,n=t.points,r=t.getNodeStyle();return _f("g",{children:_f(e.Polygon,v({},r,{points:n}))})},n.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return _f("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},n}(e.DiamondNode),kf={type:"diamond",view:Tf,model:Pf},Cf=function(t){function e(e,n){var r=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(r.width=i.width,r.height=i.height),r}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.width,basisHeight:this.height},n={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.HtmlNodeModel),Of=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return _f(Ef,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return _f("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},e}(e.HtmlNode),If={type:"html",view:Of,model:Cf},jf=function(t){function e(e,n){var r=t.call(this,e,n)||this,i=e.properties.nodeSize;return i&&(r.width=i.width,r.height=i.height),r}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return this.graphModel.editConfigModel.isSilentMode||(e.stroke="none",e.hover&&(e.hover.stroke="none")),e},e.prototype.getResizeOutlineStyle=function(){return{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(void 0===t&&(t=!0),t){var e={basisWidth:this.width,basisHeight:this.height},n={maxScaleLimit:Math.min(this.maxWidth/this.width*100,this.maxHeight/this.height*100),minScaleLimit:Math.max(this.minWidth/this.width*100,this.minHeight/this.height*100)};this.PCTResizeInfo={ResizePCT:{widthPCT:100,heightPCT:100},ResizeBasis:e,ScaleLimit:n}}else delete this.PCTResizeInfo},e}(e.RectNodeModel),Rf=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return _f(Ef,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){return t.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return _f("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},e}(e.RectNode),Df={type:"rect",view:Rf,model:jf},Lf={pluginName:"nodeResize",step:0,install:function(t){t.register(Af),t.register(kf),t.register(If),t.register(Df)}},Bf=function(t){function e(){var e=t.apply(this,_([],x(arguments),!1))||this;return e.isGroup=!0,e.isFolded=!1,e.unfoldedWidth=500,e.unfoldedHeight=300,e.childrenLastFoldStatus={},e}return f(e,t),e.prototype.initNodeData=function(e){var n=this;t.prototype.initNodeData.call(this,e);var r=[];Array.isArray(e.children)&&(r=e.children),this.children=new Set(r),this.width=500,this.height=300,this.foldedWidth=80,this.foldedHeight=60,this.zIndex=-1e4,this.radius=0,this.text.editable=!1,this.text.draggable=!1,this.isRestrict=!1,this.resizable=!1,this.autoToFront=!1,this.foldable=!1,void 0===this.properties.isFolded&&(this.properties.isFolded=!1),this.isFolded=!!this.properties.isFolded,setTimeout((function(){n.isFolded&&n.foldGroup(n.isFolded)}))},e.prototype.getResizeOutlineStyle=function(){var e=t.prototype.getResizeOutlineStyle.call(this);return e.stroke="none",e},e.prototype.foldGroup=function(t){var e=this;if(t!==this.isFolded){this.setProperty("isFolded",t),this.isFolded=t,t?(this.x=this.x-this.width/2+this.foldedWidth/2,this.y=this.y-this.height/2+this.foldedHeight/2,this.unfoldedWidth=this.width,this.unfoldedHeight=this.height,this.width=this.foldedWidth,this.height=this.foldedHeight):(this.width=this.unfoldedWidth,this.height=this.unfoldedHeight,this.x=this.x+this.width/2-this.foldedWidth/2,this.y=this.y+this.height/2-this.foldedHeight/2);var n=_(_([],x(this.incoming.edges),!1),x(this.outgoing.edges),!1);this.children.forEach((function(r){var i=e.graphModel.getElement(r);if(i){var o=i.isFolded;if(i.isGroup&&!i.isFolded&&i.foldGroup(t),i.isGroup&&!t){var a=e.childrenLastFoldStatus[r];void 0!==a&&a!==i.isFolded&&i.foldGroup(a)}e.childrenLastFoldStatus[r]=!!o,i.visible=!t;var u=i.incoming.edges,s=i.outgoing.edges;n=_(_(_([],x(n),!1),x(u),!1),x(s),!1)}})),this.foldEdge(t,n)}},e.prototype.getAnchorStyle=function(e){var n=t.prototype.getAnchorStyle.call(this,e);return n.stroke="transparent",n.fill="transparent",n.hover.fill="transparent",n.hover.stroke="transparent",n},e.prototype.foldEdge=function(t,e){var n=this;e.forEach((function(e,r){var i=e.id,o=e.sourceNodeId,a=e.targetNodeId,u=e.startPoint,s=e.endPoint,l=e.type,c=e.text,d=e.getProperties(),h={id:"".concat(i,"__").concat(r),sourceNodeId:o,targetNodeId:a,startPoint:u,endPoint:s,type:l,properties:d,text:null==c?void 0:c.value};e.virtual&&n.graphModel.deleteEdgeById(e.id);var p=n.graphModel.group.getNodeGroup(a);p||(p=n.graphModel.getNodeModelById(a));var f=n.graphModel.group.getNodeGroup(o);f||(f=n.graphModel.getNodeModelById(o)),t&&!1!==e.visible&&(n.children.has(o)||n.id===o?(h.startPoint=void 0,h.sourceNodeId=n.id):(h.endPoint=void 0,h.targetNodeId=n.id),p.id===n.id&&f.id===n.id||n.createVirtualEdge(h),e.visible=!1),t||!1!==e.visible||(p&&p.isGroup&&p.isFolded?(h.targetNodeId=p.id,h.endPoint=void 0,n.createVirtualEdge(h)):f&&f.isGroup&&f.isFolded?(h.sourceNodeId=f.id,h.startPoint=void 0,n.createVirtualEdge(h)):e.visible=!0)}))},e.prototype.createVirtualEdge=function(t){t.pointsList=void 0;var e=this.graphModel.addEdge(t);e.virtual=!0,e.text.editable=!1,e.isFoldedEdge=!0},e.prototype.isInRange=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2;return e>=this.x-this.width/2&&r<=this.x+this.width/2&&n>=this.y-this.height/2&&i<=this.y+this.height/2},e.prototype.isAllowMoveTo=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2;return{x:e>=this.x-this.width/2&&r<=this.x+this.width/2,y:n>=this.y-this.height/2&&i<=this.y+this.height/2}},e.prototype.setAllowAppendChild=function(t){this.setProperty("groupAddable",t)},e.prototype.addChild=function(t){this.children.add(t),this.graphModel.eventCenter.emit("group:add-node",{data:this.getData()})},e.prototype.removeChild=function(t){this.children.delete(t),this.graphModel.eventCenter.emit("group:remove-node",{data:this.getData()})},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#FEB663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},e.prototype.getData=function(){var e=this,n=t.prototype.getData.call(this);n.children=[],this.children.forEach((function(t){var r=e.graphModel.getNodeModelById(t);r&&!r.virtual&&n.children.push(t)}));var r=n.properties;return null==r||delete r.groupAddable,null==r||delete r.isFolded,n},e.prototype.getHistoryData=function(){var e=t.prototype.getData.call(this);e.children=_([],x(this.children),!1),e.isGroup=!0;var n=e.properties;return null==n||delete n.groupAddable,(null==n?void 0:n.isFolded)&&(e.x=e.x+this.unfoldedWidth/2-this.foldedWidth/2,e.y=e.y+this.unfoldedHeight/2-this.foldedHeight/2),e},e.prototype.isAllowAppendIn=function(t){return console.info("_nodeData",t),!0},e.prototype.toBack=function(){this.zIndex--},e}(jf),zf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getControlGroup=function(){var e=this.props.model,n=e.resizable,r=e.properties;return n&&!r.isFolded?t.prototype.getControlGroup.call(this):null},n.prototype.getAddableShape=function(){var t=this.props.model,n=t.width,r=t.height,i=t.x,o=t.y,a=t.radius,u=t.properties,s=t.getAddableOutlineStyle;if(!u.groupAddable)return null;var l=this.props.model.getNodeStyle().strokeWidth,c=void 0===l?0:l,d=s(),h=n+c+8,p=r+c+8;return e.h("rect",v(v({},d),{width:h,height:p,x:i-h/2,y:o-p/2,rx:a,ry:a}))},n.prototype.getFoldIcon=function(){var t=this.props.model,n=t.x-t.width/2+5,r=t.y-t.height/2+5;if(!t.foldable)return null;var i=e.h("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:t.properties.isFolded?"M ".concat(n+3,",").concat(r+6," ").concat(n+11,",").concat(r+6," M").concat(n+7,",").concat(r+2," ").concat(n+7,",").concat(r+10):"M ".concat(n+3,",").concat(r+6," ").concat(n+11,",").concat(r+6," ")});return e.h("g",{},[e.h("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:t.x-t.width/2+5,y:t.y-t.height/2+5,onClick:function(){t.foldGroup(!t.properties.isFolded)}}),i])},n.prototype.getResizeShape=function(){return e.h("g",{},[this.getAddableShape(),t.prototype.getResizeShape.call(this),this.getFoldIcon()])},n}(Rf),Wf={type:"group",view:zf,model:Bf},Ff=-1e4,Gf=function(){function t(t){var e=t.lf,n=this;this.topGroupZIndex=Ff,this.nodeGroupMap=new Map,this.graphRendered=function(t){var e=t.data;e&&e.nodes&&(e.nodes.forEach((function(t){t.children&&t.children.forEach((function(e){n.nodeGroupMap.set(e,t.id)}))})),n.checkAndCorrectTopGroupZIndex(e.nodes))},this.appendNodeToGroup=function(t){var e=t.data,r=n.nodeGroupMap.get(e.id);if(r){var i=n.lf.getNodeModelById(r);i.removeChild(e.id),n.nodeGroupMap.delete(e.id),i.setAllowAppendChild(!1)}var o=n.lf.getNodeModelById(e.id),a=null==o?void 0:o.getBounds();if(a&&o){var u=n.getGroup(a,e);if(o.isGroup&&(e.children.forEach((function(t){n.nodeGroupMap.set(t,e.id)})),n.checkAndCorrectTopGroupZIndex([e]),n.nodeSelected({data:e,isSelected:!1,isMultiple:!1})),!u)return;if(!u.isAllowAppendIn(e))return void n.lf.emit("group:not-allowed",{group:u.getData(),node:e});u.addChild(e.id),n.nodeGroupMap.set(e.id,u.id),u.setAllowAppendChild(!1)}},this.deleteGroupChild=function(t){var e=t.data;e.children&&e.children.forEach((function(t){n.nodeGroupMap.delete(t),n.lf.deleteNode(t)}));var r=n.nodeGroupMap.get(e.id);r&&(n.lf.getNodeModelById(r).removeChild(e.id),n.nodeGroupMap.delete(e.id))},this.setActiveGroup=function(t){var e=t.data,r=n.lf.getNodeModelById(e.id),i=null==r?void 0:r.getBounds();if(r&&i){var o=n.getGroup(i,e);if(n.activeGroup&&n.activeGroup.setAllowAppendChild(!1),!o||r.isGroup&&o.id===e.id)return;if(!o.isAllowAppendIn(e))return;n.activeGroup=o,n.activeGroup.setAllowAppendChild(!0)}},this.findNodeAndChildMaxZIndex=function(t){var e=Ff;return t.isGroup&&(e=Math.max(e,t.zIndex)),t.children&&t.children.forEach((function(t){"object"==typeof t&&(t=t.id);var r=n.lf.getNodeModelById(t);if(null==r?void 0:r.isGroup){var i=n.findNodeAndChildMaxZIndex(r);e=Math.max(i,e)}})),e},this.checkAndCorrectTopGroupZIndex=function(t){var e=Ff;if(t.forEach((function(t){var r=n.lf.getNodeModelById(t.id);if(r){var i=n.findNodeAndChildMaxZIndex(r);i>e&&(e=i)}})),!(n.topGroupZIndex>=e)){for(var r=n.lf.graphModel.nodes.filter((function(t){return t.isGroup})),i=n.topGroupZIndex,o=0;o<r.length;o++){var a=r[o];a.zIndex>i&&(i=a.zIndex)}n.topGroupZIndex=i}},this.nodeSelected=function(t){var e=t.data,r=t.isMultiple,i=t.isSelected,o=n.lf.getNodeModelById(e.id);if(n.toFrontGroup(o),n.topGroupZIndex>-1e3){n.topGroupZIndex=Ff;for(var a=n.lf.graphModel.nodes.filter((function(t){return t.isGroup})).sort((function(t,e){return t.zIndex-e.zIndex})),u=0,s=0;s<a.length;s++){var l=a[s];l.zIndex!==u&&(n.topGroupZIndex++,u=l.zIndex),l.setZIndex(n.topGroupZIndex)}}if(r&&i)if(null==o?void 0:o.isGroup)o.children.forEach((function(t){var e=n.lf.graphModel.getElement(t);null==e||e.setSelected(!1)}));else{var c=n.nodeGroupMap.get(e.id);if(c){var d=n.lf.getNodeModelById(c);(null==d?void 0:d.isSelected)&&(null==o||o.setSelected(!1))}}},this.toFrontGroup=function(t){t&&t.isGroup&&(n.topGroupZIndex++,t.setZIndex(n.topGroupZIndex),t.children&&t.children.forEach((function(t){var e=n.lf.getNodeModelById(t);n.toFrontGroup(e)})))},e.register(Wf),this.lf=e,e.graphModel.addNodeMoveRules((function(t,r,i){if(t.isGroup){var o=n.getNodeAllChild(t);return e.graphModel.moveNodes(o,r,i,!0),!0}var a=e.getNodeModelById(n.nodeGroupMap.get(t.id));if(a&&a.isRestrict){var u=t.getBounds(),s=u.x1,l=u.y1,c=u.x2,d=u.y2;return a.isAllowMoveTo({x1:s+r,y1:l+i,x2:c+r,y2:d+i})}return!0})),e.graphModel.group=this,e.on("node:add,node:drop,node:dnd-add",this.appendNodeToGroup),e.on("node:delete",this.deleteGroupChild),e.on("node:dnd-drag,node:drag",this.setActiveGroup),e.on("node:click",this.nodeSelected),e.on("graph:rendered",this.graphRendered),e.addElements=function(t,r){var i=t.nodes,o=t.edges,a={},u={nodes:[],edges:[]},s=[];return ml(i,(function(t){var i=t.id,o=t.children,l=g(t,["children"]),c=e.addNode(l);if(!c)return{nodes:[],edges:[]};i&&(a[i]=c.id),u.nodes.push(c);var d=n.createAllChildNodes(a,o,c,r).edgesArray;s.push.apply(s,_([],x(d),!1))})),s.forEach((function(t){n.createEdgeModel(t,a,r)})),ml(o,(function(t){var e=n.createEdgeModel(t,a,0);u.edges.push(e)})),u}}return t.prototype.createAllChildNodes=function(t,n,r,i){var o=this,a=this.lf,u=[],s=[],l=[];null==n||n.forEach((function(n){var c=a.getNodeModelById(n);if(c){var d=c.x,h=c.y,p=c.properties,f=c.type,g=c.text,y=c.rotate,m=c.children,b=e.EventType.NODE_GROUP_COPY||"node:group-copy-add",w=a.addNode({x:d+i,y:h+i,properties:p,type:f,text:v(v({},g),{x:g.x+i,y:g.y+i}),rotate:y},b);if(r.addChild(w.id),t[n]=w.id,l.push(w),c.incoming.edges.forEach((function(t){s.push(t)})),c.outgoing.edges.forEach((function(t){s.push(t)})),m instanceof Set){var M=o.createAllChildNodes(t,m,w,i),E=M.nodesArray,N=M.edgesArray;l.push.apply(l,_([],x(E),!1)),u.push.apply(u,_([],x(N),!1))}}}));var c=s.filter((function(e){return t[e.sourceNodeId]&&t[e.targetNodeId]})).map((function(t){return t.getData()}));return{nodesArray:l,edgesArray:u.concat(c)}},t.prototype.createEdgeModel=function(t,e,n){var r=this.lf,i=t.sourceNodeId,o=t.targetNodeId;e[i]&&(i=e[i]),e[o]&&(o=e[o]);var a=t.type,u=t.startPoint,s=t.endPoint,l=t.pointsList,c=t.text,d={x:((null==u?void 0:u.x)||0)+n,y:((null==u?void 0:u.y)||0)+n},h={x:((null==s?void 0:s.x)||0)+n,y:((null==s?void 0:s.y)||0)+n},p=[];l&&l.length>0&&(p=l.map((function(t){return t.x+=n,t.y+=n,t})));var f=c;return c&&"string"!=typeof c&&(f.x=c.x+n,f.y=c.y+n),r.graphModel.addEdge({type:a,startPoint:d,endPoint:h,sourceNodeId:i,targetNodeId:o,pointsList:p,text:f})},t.prototype.getNodeAllChild=function(t){var e=this,n=[];return t.children&&t.children.forEach((function(t){n.push(t);var r=e.lf.getNodeModelById(t);(null==r?void 0:r.isGroup)&&(n=n.concat(e.getNodeAllChild(r)))})),n},t.prototype.getGroup=function(t,e){var n=this.lf.graphModel.nodes.filter((function(n){return n.isGroup&&n.isInRange(t)&&n.id!==e.id}));if(0!==n.length){if(1===n.length)return n[0];for(var r=n[n.length-1],i=n.length-2;i>=0;i--)n[i].zIndex>r.zIndex&&(r=n[i]);return r}},t.prototype.getNodeGroup=function(t){var e=this.nodeGroupMap.get(t);if(e)return this.lf.getNodeModelById(e)},t.prototype.render=function(){},t.prototype.destroy=function(){},t.pluginName="group",t}();function Hf(){var t=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getFoldIcon=function(){var t=this.props.model,n=t,r=n.x,i=n.y,o=n.width,a=n.height,u=n.properties,s=n.foldable,l=t.x-t.width/2+5,c=t.y-t.height/2+5;if(!s)return null;var d=e.h("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:u.isFolded?"M ".concat(l+3,",").concat(c+6," ").concat(l+11,",").concat(c+6," M").concat(l+7,",").concat(c+2," ").concat(l+7,",").concat(c+10):"M ".concat(l+3,",").concat(c+6," ").concat(l+11,",").concat(c+6," ")});return e.h("g",{},[e.h("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:r-o/2+5,y:i-a/2+5,onClick:function(e){var n,r;null===(r=(n=e.stopPropagation()(t)).foldGroup)||void 0===r||r.call(n,!u.isFolded)}}),d])},n.prototype.getResizeShape=function(){var t=this.props.model,n=t.x,r=t.y,i=t.width,o=t.height,a=t.getNodeStyle(),u=v(v({},a),{x:n-i/2,y:r-o/2,width:i,height:o,stroke:"black",strokeWidth:2,strokeDasharray:"0 0"});return e.h("g",{},[e.h("rect",v({},u)),this.getFoldIcon()])},n}(zf),n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.foldable=!0,this.resizable=!0,this.width=400,this.height=200,this.resetWidthHeight(),this.isTaskNode=!0,this.boundaryEvents=[]},e.prototype.resetWidthHeight=function(){var t,e,n=null===(t=this.properties.iniProp)||void 0===t?void 0:t.width,r=null===(e=this.properties.iniProp)||void 0===e?void 0:e.height;n&&(this.width=n),r&&(this.height=r)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this);return e.stroke="#989891",e.strokeWidth=1,e.strokeDasharray="3 3",this.isSelected&&(e.stroke="rgb(124, 15, 255)"),this.properties.isBoundaryEventTouchingTask&&(e.stroke="#00acff",e.strokeWidth=2),e},e.prototype.addChild=function(e){var n=this.graphModel.getElement(e);null==n||n.setProperties({parent:this.id}),t.prototype.addChild.call(this,e)},e.prototype.getAnchorStyle=function(){var e=t.prototype.getAnchorStyle.call(this);return e.stroke="#000",e.fill="#fff",e.hover||(e.hover={}),e.hover.stroke="transparent",e},e.prototype.getOutlineStyle=function(){var e=t.prototype.getOutlineStyle.call(this);return e.stroke="transparent",e.hover||(e.hover={}),e.hover.stroke="transparent",e},e.prototype.setTouching=function(t){this.setProperty("isBoundaryEventTouchingTask",t)},e.prototype.addBoundaryEvent=function(t){if(this.setTouching(!1),this.boundaryEvents.find((function(e){return e===t})))return!1;var e=this.graphModel.getNodeModelById(t);return null==e||e.setProperties({attachedToRef:this.id}),this.boundaryEvents.push(t),!0},e.prototype.deleteBoundaryEvent=function(t){this.boundaryEvents=this.boundaryEvents.filter((function(e){return e!==t}))},e}(Bf);return{type:"bpmn:subProcess",view:t,model:n}}function Xf(t){var e=jt("bpmn:serviceTask",St),n=jt("bpmn:userTask",At);t.register(e),t.register(n),t.register(Hf()),function(t){function e(t,e){var n=t.x,r=t.y,i=t.width,o=t.height,a=t.id,u=n-i/2,s=n+i/2,l=r-o/2,c=r+o/2,d=e.x,h=e.y;return d>u-5&&d<s+5&&h>l-5&&h<c+5&&!(d>u+5&&d<s-5&&h>l+5&&h<c-5)?a:null}t.on("node:drag,node:dnd-drag",(function(n){var r,i,o=n.data;if("bpmn:boundaryEvent"===o.type){var a=t.graphModel.nodes;try{for(var u=b(a),s=u.next();!s.done;s=u.next()){var l=s.value;l.isTaskNode&&(e(l,o)?l.setTouching(!0):l.setTouching(!1))}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}})),t.on("node:drop,node:dnd-add",(function(n){var r,i,o=n.data,a=o.type,u=o.id;if("bpmn:boundaryEvent"===a){var s=t.graphModel.nodes;try{for(var l=b(s),c=l.next();!c.done;c=l.next()){var d,h=c.value;if(h.isTaskNode)if(null!==(d=e(h,o))){var p=t.graphModel.getNodeModelById(u),f=t.graphModel.getNodeModelById(d),v=p.properties.attachedToRef;return v&&v!==d&&t.graphModel.getNodeModelById(v).deleteBoundaryEvent(u),void f.addBoundaryEvent(u)}}}catch(t){r={error:t}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}}})),t.graphModel.addNodeMoveRules((function(e,n,r){if(e.isTaskNode){var i=e.boundaryEvents;return t.graphModel.moveNodes(i,n,r,!0),!0}return!0}))}(t)}function Uf(t){var n=function(e){function n(n,r){n.id||(n.id="Flow_".concat(ft()));var i=v(v(v({},t||{}),n.properties),{isDefaultFlow:!1});return n.properties=i,e.call(this,n,r)||this}return f(n,e),n.extendKey="SequenceFlowModel",n}(e.PolylineEdgeModel),r=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getStartArrow=function(){return this.props.model.properties.isDefaultFlow?e.h("path",{refX:15,stroke:"#000000",strokeWidth:2,d:"M 20 5 10 -5 z"}):e.h("path",{d:""})},n.extendKey="SequenceFlowEdge",n}(e.PolylineEdge);return{type:"bpmn:sequenceFlow",view:r,model:n}}var Vf=Uf();var qf=[{nodes:["startEvent","intermediateCatchEvent","boundaryEvent"],definition:[{type:"bpmn:timerEventDefinition",icon:_t,properties:{definitionType:"bpmn:timerEventDefinition",timerValue:"",timerType:""}}]}];function Yf(t){function e(e){e.forEach((function(e){var n,r;n=e.nodes,r=e.definition,n.forEach((function(e){(null==t?void 0:t[e])||(t[e]=new Map);var n=null==t?void 0:t[e];r.forEach((function(t){n.set(t.type,t)}))}))}))}return function(){return[t,e]}}var Zf=function(){function t(t){var e=t.lf;e.definition={},e.useDefinition=Yf(e.definition);var n=x(e.useDefinition(),2),r=n[0],i=n[1];console.log("_definition",r),i(qf),function(t){t.register(mt(t)),t.register(gt(t)),t.register(yt(t)),t.register(xt(t)),t.register(bt(t))}(e),function(t){var e=Ot("bpmn:exclusiveGateway",Mt),n=Ot("bpmn:parallelGateway",Et),r=Ot("bpmn:inclusiveGateway",Nt);t.register(e),t.register(r),t.register(n)}(e),function(t){t.register(Vf)}(e),Xf(e),e.setDefaultEdgeType("bpmn:sequenceFlow")}return t.pluginName="BpmnElementsPlugin",t}(),Kf=40,$f=40,Jf=40,Qf=40,tv=100,ev=80,nv=100,rv=80,iv=100,ov=80,av=100,uv=80,sv=100,lv=80,cv=100,dv=80,hv=100,pv=80,fv=100,vv=80,gv=function(){};(gv.ObjTree=function(){return this}).VERSION="0.23",gv.ObjTree.prototype.xmlDecl='<?xml version="1.0" encoding="UTF-8" ?>\n',gv.ObjTree.prototype.attr_prefix="-",gv.ObjTree.prototype.parseXML=function(t){var e;if(window.DOMParser){var n=new DOMParser,r=n.parseFromString(t,"application/xml");if(!r)return;e=r.documentElement}else window.ActiveXObject&&((n=new ActiveXObject("Microsoft.XMLDOM")).async=!1,n.loadXML(t),e=n.documentElement);if(e)return this.parseDOM(e)},gv.ObjTree.prototype.parseHTTP=function(t,e,n){var r,i={};for(var o in e)i[o]=e[o];if(i.method||(void 0===i.postBody&&void 0===i.postbody&&void 0===i.parameters?i.method="get":i.method="post"),n){i.asynchronous=!0;var a=this,u=n,s=i.onComplete;i.onComplete=function(t){var e;t&&t.responseXML&&t.responseXML.documentElement&&(e=a.parseDOM(t.responseXML.documentElement)),u(e,t),s&&s(t)}}else i.asynchronous=!1;if("undefined"!=typeof HTTP&&HTTP.Request)i.uri=t,(l=new HTTP.Request(i))&&(r=l.transport);else if("undefined"!=typeof Ajax&&Ajax.Request){var l;(l=new Ajax.Request(t,i))&&(r=l.transport)}return n?r:r&&r.responseXML&&r.responseXML.documentElement?this.parseDOM(r.responseXML.documentElement):void 0},gv.ObjTree.prototype.parseDOM=function(t){if(t){if(this.__force_array={},this.force_array)for(var e=0;e<this.force_array.length;e++)this.__force_array[this.force_array[e]]=1;var n=this.parseElement(t);if(this.__force_array[t.nodeName]&&(n=[n]),11!==t.nodeType){var r={};r[t.nodeName]=n,n=r}return n}},gv.ObjTree.prototype.parseElement=function(t){if(7!==t.nodeType){if(3===t.nodeType||4===t.nodeType||8===t.nodeType){if(null==t.nodeValue.match(/[^\x00-\x20]/))return;return t.nodeValue}var e=null,n={};if(t.attributes&&t.attributes.length){e={};for(var r=0;r<t.attributes.length;r++){if("string"==typeof(u=t.attributes[r].nodeName)){var i=t.attributes[r].nodeValue;try{i=JSON.parse(t.attributes[r].nodeValue.replace(/'/g,'"'))}catch(e){i=t.attributes[r].nodeValue}null!=i&&(void 0===n[u=this.attr_prefix+u]&&(n[u]=0),n[u]++,this.addNode(e,u,n[u],i))}}}if(t.childNodes&&t.childNodes.length){var o=!0;e&&(o=!1);for(r=0;r<t.childNodes.length&&o;r++){var a=t.childNodes[r].nodeType;3!==a&&4!==a&&8!==a&&(o=!1)}if(o){e||(e="");for(r=0;r<t.childNodes.length;r++)e+=t.childNodes[r].nodeValue}else{e||(e={});for(r=0;r<t.childNodes.length;r++){var u;if("string"==typeof(u=t.childNodes[r].nodeName))(i=this.parseElement(t.childNodes[r]))&&(void 0===n[u]&&(n[u]=0),n[u]++,this.addNode(e,u,n[u],i))}}}else null===e&&(e={});return e}},gv.ObjTree.prototype.addNode=function(t,e,n,r){this.__force_array[e]?(1===n&&(t[e]=[]),t[e][t[e].length]=r):1===n?t[e]=r:2===n?t[e]=[t[e],r]:t[e][t[e].length]=r},gv.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e},gv.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],r=[];for(var i in e)if(lc(e,i)){var o=e[i];i.charAt(0)!==this.attr_prefix?void 0===o||null==o?n[n.length]="<".concat(i," />"):"object"==typeof o&&o.constructor===Array?n[n.length]=this.array_to_xml(i,o):n[n.length]="object"==typeof o?this.hash_to_xml(i,o):this.scalar_to_xml(i,o):r[r.length]=" ".concat(i.substring(1),'="').concat(this.xml_escape(o),'"')}var a=r.join(""),u=n.join("");return void 0===t||null==t||(u=n.length>0?u.match(/\n/)?"<".concat(t).concat(a,">\n").concat(u,"</").concat(t,">\n"):"<".concat(t).concat(a,">").concat(u,"</").concat(t,">\n"):"<".concat(t).concat(a," />\n")),u},gv.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],r=0;r<e.length;r++){var i=e[r];void 0===i||null==i?n[n.length]="<".concat(t," />"):"object"==typeof i&&i.constructor===Array?n[n.length]=this.array_to_xml(t,i):n[n.length]="object"==typeof i?this.hash_to_xml(t,i):this.scalar_to_xml(t,i)}return n.join("")},gv.ObjTree.prototype.scalar_to_xml=function(t,e){return"#text"===t?this.xml_escape(e):"<".concat(t,">").concat(this.xml_escape(e),"</").concat(t,">\n")},gv.ObjTree.prototype.xml_escape=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};function yv(t){return Object.prototype.toString.call(t)}function mv(t){return" ".repeat(t)}function bv(t){return"[object Object]"===yv(t)?Object.keys(t).reduce((function(e,n){var r=n;return"-"===n.charAt(0)&&(r=n.substring(1)),e[r]=bv(t[n]),e}),{}):Array.isArray(t)?t.map((function(t){return bv(t)})):t}var xv,_v="\t\n";function wv(t,e,n){var r=mv(n),i="",o=_v+r;if("-json"===e)return"";if("#text"===e)return o+t;if("#cdata-section"===e)return"".concat(o,"<![CDATA[").concat(t,"]]>");if("#comment"===e)return"".concat(o,"\x3c!--").concat(t,"--\x3e");if("-"==="".concat(e).charAt(0))return" ".concat(e.substring(1),'="').concat(function(t){var e=t;try{"string"!=typeof e&&(e=JSON.parse(t))}catch(n){e=JSON.stringify(bv(t)).replace(/"/g,"'")}return e}(t),'"');if(Array.isArray(t))i+=t.map((function(t){return wv(t,e,n+1)})).join("");else if("[object Object]"===yv(t)){var a=Object.keys(t),u="",s=t["-json"]?_v+mv(n+1)+t["-json"]:"";i+="".concat(0===n?"":o,"<").concat(e),a.forEach((function(e){"-"===e.charAt(0)?u+=wv(t[e],e,n+1):s+=wv(t[e],e,n+1)})),i+=u+(""!==s?">".concat(s).concat(o,"</").concat(e,">"):" />")}else i+="".concat(o,"<").concat(e,">").concat(t.toString(),"</").concat(e,">");return i}!function(t){t.START="bpmn:startEvent",t.END="bpmn:endEvent",t.INTERMEDIATE_CATCH="bpmn:intermediateCatchEvent",t.INTERMEDIATE_THROW="bpmn:intermediateThrowEvent",t.BOUNDARY="bpmn:boundaryEvent",t.PARALLEL_GATEWAY="bpmn:parallelGateway",t.INCLUSIVE_GATEWAY="bpmn:inclusiveGateway",t.EXCLUSIVE_GATEWAY="bpmn:exclusiveGateway",t.USER="bpmn:userTask",t.SYSTEM="bpmn:serviceTask",t.FLOW="bpmn:sequenceFlow",t.SUBPROCESS="bpmn:subProcess"}(xv||(xv={}));var Mv=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef","-children"],Ev=["properties","startPoint","endPoint","pointsList"],Nv={in:[],out:["properties.panels","properties.nodeSize","properties.definitionId","properties.timerValue","properties.timerType","properties.definitionType","properties.parent","properties.isBoundaryEventTouchingTask"]},Sv=function(t,e){return Object.keys(e||{}).forEach((function(n){if(t[n]){var r=e[n],i=r.in,o=r.out;i&&(t[n].in=i),o&&(t[n].out=o)}else t[n]=e[n]})),t},Av={"bpmn:startEvent":{out:function(t){var e,n,r=t.properties;return(null===(n=null===(e=Av[r.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:intermediateCatchEvent":{out:function(t){var e,n,r=t.properties;return(null===(n=null===(e=Av[r.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:intermediateThrowEvent":{out:function(t){var e,n,r=t.properties;return(null===(n=null===(e=Av[r.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:boundaryEvent":{out:function(t){var e,n,r=t.properties;return(null===(n=null===(e=Av[r.definitionType])||void 0===e?void 0:e.out)||void 0===n?void 0:n.call(e,t))||{}}},"bpmn:sequenceFlow":{out:function(t){var e=t.properties,n=e.expressionType,r=e.condition;return r?"cdata"===n?{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression"><![CDATA[${'.concat(r,"}]]></bpmn:conditionExpression>")}:{json:'<bpmn:conditionExpression xsi:type="bpmn2:tFormalExpression">'.concat(r,"</bpmn:conditionExpression>")}:{json:""}}},"bpmn:timerEventDefinition":{out:function(t){var e=t.properties,n=e.timerType,r=e.timerValue,i=e.definitionId;return{json:'<bpmn:timerEventDefinition id="'.concat(i,'"').concat(n&&r?">".concat("<bpmn:".concat(n,' xsi:type="bpmn:tFormalExpression">').concat(r,"</bpmn:").concat(n,">"),"</bpmn:timerEventDefinition>"):"/>")}},in:function(t,e){var n,r,i,o=t,a=e["-id"],u="",s="";try{for(var l=b(Object.keys(e)),c=l.next();!c.done;c=l.next()){var d=c.value;d.includes("bpmn:")&&(u=x(d.split(":"),2)[1],s=null===(i=e[d])||void 0===i?void 0:i["#text"])}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return{"-definitionId":a,"-definitionType":o,"-timerType":u,"-timerValue":s}}},"bpmn:conditionExpression":{in:function(t,e){var n,r="",i="";return e["#cdata-section"]?(i="cdata",r=(null===(n=/^\$\{(.*)\}$/g.exec(e["#cdata-section"]))||void 0===n?void 0:n[1])||""):e["#text"]&&(i="normal",r=e["#text"]),{"-condition":r,"-expressionType":i}}}};function Pv(t){var e=null!=t?t:{},n=e.retainedAttrsFields,r=e.excludeFields,i=e.transformer,o=new Set(_(_([],x(Ev),!1),x(n||[]),!1)),a={in:new Set(_(_([],x(Nv.in),!1),x((null==r?void 0:r.in)||[]),!1)),out:new Set(_(_([],x(Nv.out),!1),x((null==r?void 0:r.out)||[]),!1))};return Av=Sv(Av,i),function(t){var e=t.nodes,n=t.edges;return function t(r,i){var u,s;if(1!==(null==r?void 0:r.flag)){var l;if((l=Av[r.type])&&l.out){var c=l.out(r),d=Object.keys(c);d.length>0&&d.forEach((function(t){r[t]=c[t]}))}(null==r?void 0:r.children)&&(r.children=r.children.map((function(t){return e.find((function(e){return e.id===t}))||n.find((function(e){return e.id===t}))||{}})));var h={};if("string"==typeof r)return r;if(Array.isArray(r))return r.map((function(e){return t(e,"")})).filter((function(t){return null!=t}));try{for(var p=b(Object.entries(r)),f=p.next();!f.done;f=p.next()){var v=x(f.value,2),g=v[0],y=v[1];if(1===(null==y?void 0:y.flag))return;var m=[i,g].filter((function(t){return t})).join(".");a.out.has(m)||("object"!=typeof y?0===g.indexOf("-")||["#text","#cdata-section","#comment"].includes(g)?h[g]=y:h["-".concat(g)]=y:o.has(m)?h["-".concat(g)]=t(y,m):h[g]=t(y,m))}}catch(t){u={error:t}}finally{try{f&&!f.done&&(s=p.return)&&s.call(p)}finally{if(u)throw u.error}}return h}}(t,"")}}function Tv(t){var e,n,r={};try{for(var i=b(Object.entries(t)),o=i.next();!o.done;o=i.next()){var a=x(o.value,2),u=a[0],s=a[1];0===u.indexOf("-")?r[u.substring(1)]=bv(s):"string"==typeof s?r[u]=s:"[object Object]"===Object.prototype.toString.call(s)?r[u]=Tv(s):Array.isArray(s)?r[u]=s.map((function(t){return Tv(t)})):r[u]=s}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}function kv(t,e){t["bpmndi:BPMNEdge"]=e.edges.map((function(t){var e,n=t.id,r=t.pointsList.map((function(t){return{"-x":t.x,"-y":t.y}})),i={"-id":"".concat(n,"_di"),"-bpmnElement":n,"di:waypoint":r};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(i["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),i})),t["bpmndi:BPMNShape"]=e.nodes.map((function(t){var e,n=t.id,r=100,i=80,o=t.x,a=t.y,u=Rv.shapeConfigMap.get(t.type);u&&(r=u.width,i=u.height),o-=r/2,a-=i/2;var s={"-id":"".concat(n,"_di"),"-bpmnElement":n,"dc:Bounds":{"-x":o,"-y":a,"-width":r,"-height":i}};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(s["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-10*t.text.value.length/2,"-y":t.text.y-7,"-width":10*t.text.value.length,"-height":14}}),s}))}var Cv=["bpmn:incoming","bpmn:outgoing"];function Ov(t,e){var n=[],r=[],i=new Map,o=null!=e?e:{},a=o.transformer,u=o.excludeFields,s={in:new Set(_(_([],x(Nv.in),!1),x((null==u?void 0:u.in)||[]),!1)),out:new Set(_(_([],x(Nv.out),!1),x((null==u?void 0:u.out)||[]),!1))};Av=Sv(Av,a);var l,c,d=t["bpmn:definitions"];if(d){var h=d["bpmn:process"];l=h,c=[function(t){function e(t){t["-children"]||(t["-children"]=[]),Object.keys(t).forEach((function(e){var n;0!==e.indexOf("bpmn:")||Cv.includes(e)||(h[e]||(h[e]=[]),!Array.isArray(h[e])&&(h[e]=[h[e]]),Array.isArray(t[e])?(n=h[e]).push.apply(n,_([],x(t[e]),!1)):h[e].push(t[e]),Array.isArray(t[e])?t[e].forEach((function(n){!e.includes("Flow")&&t["-children"].push(n["-id"])})):!e.includes("Flow")&&t["-children"].push(t[e]["-id"]),delete t[e])}))}if("bpmn:subProcess"===t){var n=h[t];Array.isArray(n)?n.forEach((function(n){"bpmn:subProcess"===t&&e(n)})):e(n)}},function(t){function e(t){var n;i.set(t["-id"],t),Array.isArray(t)?t.forEach((function(t){e(t)})):"object"==typeof t&&(n=t,Object.keys(n).forEach((function(t){var r,i;if(t.includes("bpmn:")){var o={};Av[t]&&Av[t].in?(o=null===(i=(r=Av[t]).in)||void 0===i?void 0:i.call(r,t,hn.cloneDeep(n[t])),delete n[t]):e(n[t]);var a=void 0;(a=Reflect.ownKeys(o)).length>0&&a.forEach((function(t){Reflect.set(n,t,o[t])}))}})))}e(h[t])},function(t){if(0===t.indexOf("bpmn:")){var e=h[t];if("bpmn:sequenceFlow"===t){var o=d["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];r=function(t,e){var n=[];if(Array.isArray(t))t.forEach((function(t){var r;r=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(jv(r,t))}));else{var r=void 0;r=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(jv(r,t))}return n}(e,o)}else{var a=d["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];if("bpmn:boundaryEvent"===t){var u=h[t],s=function(t){var e=t["-attachedToRef"],n=i.get(e);n["-boundaryEvents"]||(n["-boundaryEvents"]=[]),n["-boundaryEvents"].push(t["-id"])};Array.isArray(u)?u.forEach((function(t){s(t)})):s(u)}n=n.concat(function(t,e,n){var r=[];if(Array.isArray(t))t.forEach((function(t){var i=Iv(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);r.push(i)}));else{var i=Iv(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);r.push(i)}return r}(e,a,t))}}}],c.forEach((function(t){try{Object.keys(l).forEach((function(e){try{t(e)}catch(t){console.error(t)}}))}catch(t){console.error(t)}}))}var p=function(t,e,n){Object.keys(t).forEach((function(r){var i=n?"".concat(n,".").concat(r):r;e.has(i)?delete t[r]:"object"==typeof t[r]&&p(t[r],e,i)}))};return n.forEach((function(t){var n,r;if(null===(n=null==e?void 0:e.mapping)||void 0===n?void 0:n.in){var i=null===(r=null==e?void 0:e.mapping)||void 0===r?void 0:r.in,o=t.type;i[o]&&(t.type=i[o])}p(t,s.in,"")})),r.forEach((function(t){var n,r;if(null===(n=null==e?void 0:e.mapping)||void 0===n?void 0:n.in){var i=null===(r=null==e?void 0:e.mapping)||void 0===r?void 0:r.in,o=t.type;i[o]&&(t.type=i[o])}p(t,s.in,"")})),{nodes:n,edges:r}}function Iv(t,e,n){var r=Number(t["dc:Bounds"]["-x"]),i=Number(t["dc:Bounds"]["-y"]),o=n["-children"],a=n["-name"],u=Rv.shapeConfigMap.get(e);u&&(r+=u.width/2,i+=u.height/2);var s,l={};if(Object.entries(n).forEach((function(t){var e=x(t,2),n=e[0],r=e[1];Mv.includes(n)||(l[n]=r)})),l=Tv(l),a&&(s={x:r,y:i,value:a},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var c=t["bpmndi:BPMNLabel"]["dc:Bounds"];s.x=Number(c["-x"])+Number(c["-width"])/2,s.y=Number(c["-y"])+Number(c["-height"])/2}var d={id:t["-bpmnElement"],type:e,x:r,y:i,properties:l};return o&&(d.children=o),s&&(d.text=s),d}function jv(t,e){var n,r=e["-name"];if(r){var i=t["bpmndi:BPMNLabel"]["dc:Bounds"],o=0;r.split("\n").forEach((function(t){o<t.length&&(o=t.length)})),n={value:r,x:Number(i["-x"])+10*o/2,y:Number(i["-y"])+7}}var a={};Object.entries(e).forEach((function(t){var e=x(t,2),n=e[0],r=e[1];Mv.includes(n)||(a[n]=r)})),a=Tv(a);var u=t["di:waypoint"].map((function(t){return{x:Number(t["-x"]),y:Number(t["-y"])}})),s={id:e["-id"],type:xv.FLOW,pointsList:u,sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:a};return n&&(s.text=n),s}var Rv=function(){function t(t){var e=t.lf,n=this;this.adapterOut=function(t,e){var r,i,o=v({},n.processAttributes);!function(t,e,n){var r,i=new Map,o=Pv(n)(e);o.nodes.forEach((function(e){var n=e["-id"],r=e["-type"],o=e.text,a=e.children,u=g(e,["-id","-type","text","children"]),s={"-id":n};(null==o?void 0:o["-value"])&&(s["-name"]=o["-value"]),u["-json"]&&(s["-json"]=u["-json"]),u["-properties"]&&Object.assign(s,u["-properties"]),a&&(s.children=a),t[r]||(t[r]=[]),t[r].push(s),i.set(n,s)}));var a=o.edges.map((function(t){var e=t["-id"],n=t["-sourceNodeId"],r=t["-targetNodeId"],o=t.text,a=g(t,["-id","-sourceNodeId","-targetNodeId","text"]),u=i.get(r);u["bpmn:incoming"]||(u["bpmn:incoming"]=[]),u["bpmn:incoming"].push(e);var s={"-id":e,"-sourceRef":n,"-targetRef":r};return(null==o?void 0:o["-value"])&&(s["-name"]=o["-value"]),a["-json"]&&(s["-json"]=a["-json"]),a["-properties"]&&Object.assign(s,a["-properties"]),s}));e.edges.forEach((function(t){var e=t.sourceNodeId,n=t.id,r=i.get(e);r["bpmn:outgoing"]||(r["bpmn:outgoing"]=[]),r["bpmn:outgoing"].push(n)})),null===(r=t["bpmn:subProcess"])||void 0===r||r.forEach((function(e){var n={"bpmn:incoming":new Set,"bpmn:outgoing":new Set},r=[];e.children.forEach((function(r){var o,a=i.get(r["-id"]);["bpmn:incoming","bpmn:outgoing"].forEach((function(t){a[t]&&a[t].forEach((function(e){n[t].add(e)}))}));var u=null===(o=t[r["-type"]])||void 0===o?void 0:o.findIndex((function(t){return t["-id"]===r["-id"]}));u>=0&&t[r["-type"]].splice(u,1),i.delete(r["-id"]),e[r["-type"]]||(e[r["-type"]]=[]),e[r["-type"]].push(a)}));var o=n["bpmn:incoming"];n["bpmn:outgoing"].forEach((function(t){o.has(t)&&r.push(t)}));for(var u,s=function(t){var n=a.findIndex((function(e){return e["-id"]===r[t]}));n>=0?(e["bpmn:sequenceFlow"]||(e["bpmn:sequenceFlow"]=[]),e["bpmn:sequenceFlow"].push(a[n]),a.splice(n,1)):t++,u=t},l=0;l<r.length;)s(l),l=u;delete e.children})),t[xv.FLOW]=a}(o,t,e);var a={"-id":"BPMNPlane_1","-bpmnElement":o["-id"]};kv(a,t);var u=n.definitionAttributes;u["bpmn:process"]=o,u["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":a};var s={"bpmn:definitions":u};if(null===(r=null==e?void 0:e.mapping)||void 0===r?void 0:r.out){var l=null===(i=null==e?void 0:e.mapping)||void 0===i?void 0:i.out,c=function(t){Array.isArray(t)&&t.forEach((function(t){return c(t)})),"object"==typeof t&&Object.keys(t).forEach((function(e){var n;(n=l[e])?(t[n]=hn.cloneDeep(t[e]),delete t[e],c(t[n])):c(t[e])}))};c(s)}return s},this.adapterIn=function(t,e){if(t)return Ov(t,e)},e.adapterIn=this.adapterIn,e.adapterOut=this.adapterOut,this.processAttributes={"-isExecutable":"true","-id":"Process"},this.definitionAttributes={"-id":"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","-xmlns:di":"http://www.omg.org/spec/DD/20100524/DI","-targetNamespace":"http://logic-flow.org","-exporter":"logicflow","-exporterVersion":"1.2.10"}}return t.prototype.setCustomShape=function(e,n){t.shapeConfigMap.set(e,n)},t.pluginName="bpmn-adapter",t.shapeConfigMap=new Map,t}();Rv.shapeConfigMap.set(xv.START,{width:Kf,height:$f}),Rv.shapeConfigMap.set(xv.END,{width:Jf,height:Qf}),Rv.shapeConfigMap.set(xv.INTERMEDIATE_CATCH,{width:nv,height:rv}),Rv.shapeConfigMap.set(xv.INTERMEDIATE_THROW,{width:nv,height:rv}),Rv.shapeConfigMap.set(xv.BOUNDARY,{width:tv,height:ev}),Rv.shapeConfigMap.set(xv.PARALLEL_GATEWAY,{width:iv,height:ov}),Rv.shapeConfigMap.set(xv.INCLUSIVE_GATEWAY,{width:av,height:uv}),Rv.shapeConfigMap.set(xv.EXCLUSIVE_GATEWAY,{width:sv,height:lv}),Rv.shapeConfigMap.set(xv.SYSTEM,{width:cv,height:dv}),Rv.shapeConfigMap.set(xv.USER,{width:hv,height:pv}),Rv.shapeConfigMap.set(xv.SUBPROCESS,{width:fv,height:vv});var Dv=function(t){function e(e){var n=t.call(this,e)||this;n.adapterXmlIn=function(t){var e,r=(e=t,(new gv.ObjTree).parseXML(e));return n.adapterIn(r,n.props)},n.adapterXmlOut=function(t){return function(t){var e="";for(var n in t)e+=wv(t[n],n,0);return e}(n.adapterOut(t,n.props))};var r=e.lf,i=e.props;return r.adapterIn=n.adapterXmlIn,r.adapterOut=n.adapterXmlOut,n.props=i,n}return f(e,t),e.pluginName="BPMNAdapter",e}(Rv),Lv={};function Bv(t){return t.startsWith("data:text/plain")}function zv(t){return y(this,void 0,void 0,(function(){return m(this,(function(e){return Lv[t]?[2,Lv[t]]:[2,new Promise((function(e,n){try{fetch(t).then((function(t){return t.blob()})).then((function(r){var i=new FileReader;i.onloadend=function(){e(Lv[t]=i.result)},i.onerror=n,i.readAsDataURL(r)})).catch((function(){e(Lv[t]=t)}))}catch(e){return Lv[t]=t}}))]}))}))}function Wv(t,e){return y(this,void 0,void 0,(function(){var n,r,i;return m(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),(n=t.getAttribute(e)||"").startsWith("data:")?[2]:[4,zv(n)];case 1:return Bv(r=o.sent())?[2]:(t.setAttribute(e,r),[3,3]);case 2:return i=o.sent(),console.error(i),[3,3];case 3:return[2]}}))}))}function Fv(t,e){return y(this,void 0,void 0,(function(){var n,r;return m(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e.startsWith("data:")?[2]:[4,zv(e)];case 1:return Bv(n=i.sent())?[2]:(t.style.backgroundImage="url(".concat(n,")"),[3,3]);case 2:return r=i.sent(),console.error(r),[3,3];case 3:return[2]}}))}))}function Gv(t){return y(this,void 0,void 0,(function(){var e,n,r,i,o,a,u,s,l;return m(this,(function(c){switch(c.label){case 0:for(e=[t],r=[];e.length;)(n=e.shift()).children.length&&e.push.apply(e,_([],x(n.children),!1)),n instanceof HTMLElement&&(i=n.style,o=i.background,a=i.backgroundImage,(u=o.match(/url\(["']?(.*?)["']?\)/))&&u[1]&&(l=u[1],r.push(Fv(n,l))),(s=a.match(/url\(["']?(.*?)["']?\)/))&&s[1]&&(l=s[1],r.push(Fv(n,l)))),n instanceof HTMLImageElement?r.push(Wv(n,"src")):n instanceof SVGImageElement&&r.push(Wv(n,"href"));return[4,Promise.all(r)];case 1:return c.sent(),[2]}}))}))}function Hv(t,e,n){var r=document.createElement("canvas");r.width=e,r.height=n;var i=r.getContext("2d");return i&&i.drawImage(t,0,0,t.width,t.height,0,0,e,n),r}var Xv,Uv=function(){function t(t){var e=t.lf,n=this;this.lf=e,this.customCssRules="",this.useGlobalRules=!0,e.getSnapshot=function(t,e){return y(n,void 0,void 0,(function(){var n,r,i,o=this;return m(this,(function(a){switch(a.label){case 0:return n=this.lf.graphModel.getPartial(),r=(null!=e?e:{}).partial,n===(i=void 0===r?n:r)?[3,1]:(this.lf.graphModel.setPartial(i),this.lf.graphModel.eventCenter.once("graph:updated",(function(){return y(o,void 0,void 0,(function(){return m(this,(function(r){switch(r.label){case 0:return[4,this.getSnapshot(t,e)];case 1:return r.sent(),this.lf.graphModel.setPartial(n),[2]}}))}))})),[3,3]);case 1:return[4,this.getSnapshot(t,e)];case 2:a.sent(),a.label=3;case 3:return[2]}}))}))},e.getSnapshotBlob=function(t,e){return y(n,void 0,void 0,(function(){return m(this,(function(n){switch(n.label){case 0:return[4,this.getSnapshotBlob(t,e)];case 1:return[2,n.sent()]}}))}))},e.getSnapshotBase64=function(t,e){return y(n,void 0,void 0,(function(){return m(this,(function(n){switch(n.label){case 0:return[4,this.getSnapshotBase64(t,e)];case 1:return[2,n.sent()]}}))}))}}return t.prototype.getSvgRootElement=function(t){return t.container.querySelector(".lf-canvas-overlay")},t.prototype.triggerDownload=function(t){var e=new MouseEvent("click",{view:document.defaultView,bubbles:!1,cancelable:!0}),n=document.createElement("a");n.setAttribute("download",this.fileName),n.setAttribute("href",t),n.setAttribute("target","_blank"),n.dispatchEvent(e)},t.prototype.removeAnchor=function(t){for(var e=t.childNodes,n=t.childNodes&&t.childNodes.length,r=0;r<n;r++){var i=e[r];(i.classList&&Array.from(i.classList)||[]).indexOf("lf-anchor")>-1&&(t.removeChild(t.childNodes[r]),n--,r--)}},t.prototype.removeRotateControl=function(t){for(var e=t.childNodes,n=t.childNodes&&t.childNodes.length,r=0;r<n;r++){var i=e[r];(i.classList&&Array.from(i.classList)||[]).indexOf("lf-rotate-control")>-1&&(t.removeChild(t.childNodes[r]),n--,r--)}},t.prototype.getSnapshot=function(t,e){return y(this,void 0,void 0,(function(){var n,r,i,o,a,u,s,l,c,d=this;return m(this,(function(h){switch(h.label){case 0:return r=(n=null!=e?e:{}).fileType,i=void 0===r?"png":r,o=n.quality,this.fileName="".concat(null!=t?t:"logic-flow.".concat(Date.now()),".").concat(i),[4,Gv(a=this.getSvgRootElement(this.lf))];case 1:return h.sent(),"svg"===i?(u=this.cloneSvg(a),s=(new XMLSerializer).serializeToString(u),l=new Blob([s],{type:"image/svg+xml;charset=utf-8"}),c=URL.createObjectURL(l),this.triggerDownload(c)):this.getCanvasData(a,null!=e?e:{}).then((function(t){var e=t.toDataURL("image/".concat(i),o).replace("image/".concat(i),"image/octet-stream");d.triggerDownload(e)})),[2]}}))}))},t.prototype.getSnapshotBase64=function(t,e){return y(this,void 0,void 0,(function(){var n,r=this;return m(this,(function(i){switch(i.label){case 0:return[4,Gv(n=this.getSvgRootElement(this.lf))];case 1:return i.sent(),[2,new Promise((function(i){r.getCanvasData(n,{backgroundColor:t}).then((function(t){var n=t.toDataURL("image/".concat(null!=e?e:"png"));i({data:n,width:t.width,height:t.height})}))}))]}}))}))},t.prototype.getSnapshotBlob=function(t,e){return y(this,void 0,void 0,(function(){var n,r=this;return m(this,(function(i){switch(i.label){case 0:return[4,Gv(n=this.getSvgRootElement(this.lf))];case 1:return i.sent(),[2,new Promise((function(i){r.getCanvasData(n,{backgroundColor:t}).then((function(t){t.toBlob((function(e){i({data:e,width:t.width,height:t.height})}),"image/".concat(null!=e?e:"png"))}))}))]}}))}))},t.prototype.getClassRules=function(){var t="";if(this.useGlobalRules)for(var e=document.styleSheets,n=0;n<e.length;n++)for(var r=e[n],i=0;i<r.cssRules.length;i++)t+=r.cssRules[i].cssText;return this.customCssRules&&(t+=this.customCssRules),t},t.prototype.getCanvasData=function(t,e){return y(this,void 0,void 0,(function(){var n,r,i,o,a,u,s,l,c,d,h,p,f,v,g,y,b,x,_,w,M,E,N,S,A,P;return m(this,(function(m){return n=e.width,r=e.height,i=e.backgroundColor,o=e.padding,a=void 0===o?40:o,u=this.cloneSvg(t,!1),(s=window.devicePixelRatio||1)<1&&(s=1),l=this.lf.graphModel.rootEl.querySelector(".lf-base"),c=l.getBoundingClientRect(),d=this.lf.container.querySelector(".lf-canvas-overlay"),h=d.getBoundingClientRect(),p=c.x-h.x,f=c.y-h.y,v=this.lf.graphModel,g=v.transformModel,y=g.SCALE_X,b=g.SCALE_Y,x=g.TRANSLATE_X,_=g.TRANSLATE_Y,u.lastChild.style.transform="matrix(1, 0, 0, 1, ".concat((-p+x)*(1/y),", ").concat((-f+_)*(1/b),")"),w=Math.ceil(c.width/y),M=Math.ceil(c.height/b),(E=document.createElement("canvas")).style.width="".concat(w,"px"),E.style.height="".concat(M,"px"),E.width=w*s+2*a,E.height=M*s+2*a,(N=E.getContext("2d"))&&(N.clearRect(0,0,E.width,E.height),N.scale(s,s),i?(N.fillStyle=i,N.fillRect(0,0,E.width,E.height)):N.clearRect(0,0,E.width,E.height)),S=new Image,(A=document.createElement("style")).innerHTML=this.getClassRules(),(P=document.createElement("foreignObject")).appendChild(A),u.appendChild(P),[2,new Promise((function(t){S.onload=function(){var e=navigator.userAgent.indexOf("Firefox")>-1;try{e?createImageBitmap(S,{resizeWidth:n&&r?Hv(E,n,r).width:E.width,resizeHeight:n&&r?Hv(E,n,r).height:E.height}).then((function(e){null==N||N.drawImage(e,a/s,a/s),t(n&&r?Hv(E,n,r):E)})):(null==N||N.drawImage(S,a/s,a/s),t(n&&r?Hv(E,n,r):E))}catch(e){null==N||N.drawImage(S,a/s,a/s),t(n&&r?Hv(E,n,r):E)}};var e="data:image/svg+xml;charset=utf-8,".concat((new XMLSerializer).serializeToString(u)).replace(/\n/g,"").replace(/\t/g,"").replace(/#/g,"%23");S.src=e}))]}))}))},t.prototype.cloneSvg=function(t,e){var n,r=this;void 0===e&&(e=!0);var i=t.cloneNode(!0),o=i.lastChild,a=null===(n=null==o?void 0:o.childNodes)||void 0===n?void 0:n.length;if(a)for(var u=0;u<a;u++){var s=null==o?void 0:o.childNodes[u],l=s.classList&&Array.from(s.classList);if(l&&l.indexOf("lf-base")<0)null==o||o.removeChild(o.childNodes[u]),a--,u--;else{var c=null==o?void 0:o.childNodes[u];c&&c.childNodes.forEach((function(t){var e=t;r.removeAnchor(e.firstChild),r.removeRotateControl(e.firstChild)}))}}if(e){var d=document.createElement("style");d.innerHTML=this.getClassRules();var h=document.createElement("foreignObject");h.appendChild(d),i.appendChild(h)}return i},t.pluginName="snapshot",t}(),Vv={SEQUENCE_FLOW:1,START_EVENT:2,END_EVENT:3,USER_TASK:4,EXCLUSIVE_GATEWAY:6},qv={1:"bpmn:sequenceFlow",2:"bpmn:startEvent",3:"bpmn:endEvent",4:"bpmn:userTask",6:"bpmn:exclusiveGateway"};function Yv(t){switch(t){case"bpmn:sequenceFlow":return Vv.SEQUENCE_FLOW;case"bpmn:startEvent":return Vv.START_EVENT;case"bpmn:endEvent":return Vv.END_EVENT;case"bpmn:userTask":return Vv.USER_TASK;case"bpmn:exclusiveGateway":return Vv.EXCLUSIVE_GATEWAY;default:return t}}!function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}(Xv||(Xv={}));var Zv=function(t,e,n,r){return void 0===r&&(r=0),Jv(t,e,n)<=r};function Kv(t){return t*t}function $v(t,e){return Kv(t.x-e.x)+Kv(t.y-e.y)}var Jv=function(t,e,n){return Math.sqrt(function(t,e,n){var r=$v(e,n);if(0===r)return $v(t,e);var i=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/r;return i=Math.max(0,Math.min(1,i)),$v(t,{x:e.x+i*(n.x-e.x),y:e.y+i*(n.y-e.y)})}(t,e,n))},Qv=function(t,e,n){var r=function(t){var e=t.x,n=t.y,r=t.width,i=t.height;return{minX:e-r/2,minY:n-i/2,maxX:e+r/2,maxY:n+i/2,x:e,y:n,width:r,height:i,centerX:e,centerY:n}}(t),i=function(t,e){var n;return t.x===e.x?n=Xv.VERTICAL:t.y===e.y&&(n=Xv.HORIZONTAL),n}(e,n),o=Math.max(e.x,n.x),a=Math.min(e.x,n.x),u=Math.max(e.y,n.y),s=Math.min(e.y,n.y),l=t.x,c=t.y,d=t.width,h=t.height;if(i===Xv.HORIZONTAL){if(o>=r.maxX&&a<=r.minX)return{startCrossPoint:{x:e.x>n.x?l+d/2:l-d/2,y:e.y},endCrossPoint:{x:e.x>n.x?l-d/2:l+d/2,y:e.y}}}else if(i===Xv.VERTICAL&&u>=r.maxY&&s<=r.minY)return{startCrossPoint:{x:e.x,y:e.y>n.y?c+h/2:c-h/2},endCrossPoint:{x:e.x,y:e.y>n.y?c-h/2:c+h/2}}},tg=function(t,e,n){void 0===n&&(n=0);for(var r=t.x,i=t.y,o=e.pointsList,a=0;a<o.length-1;a++)if(Zv({x:r,y:i},o[a],o[a+1],n)){var u=Qv(t,o[a],o[a+1]);if(u)return{crossIndex:a+1,crossPoints:u}}return{crossIndex:-1,crossPoints:{startCrossPoint:{x:0,y:0},endCrossPoint:{x:0,y:0}}}},eg=function(){function t(t){var e=t.lf;this._lf=e,this.deviation=20,this.dndAdd=!0,this.dropAdd=!0,this.eventHandler()}return t.prototype.eventHandler=function(){var t=this;this.dndAdd&&this._lf.on("node:dnd-add",(function(e){var n=e.data;t.insetNode(n)})),this.dropAdd&&this._lf.on("node:drop",(function(e){for(var n=e.data,r=t._lf.graphModel.edges,i=n.id,o=!0,a=0;a<r.length;a++)if(r[a].sourceNodeId===i||r[a].targetNodeId===i){o=!1;break}o&&t.insetNode(n)}))},t.prototype.checkRuleBeforeInsetNode=function(t,n,r,i,o){var a=this._lf.getNodeModelById(t),u=this._lf.getNodeModelById(n),s=a.getAnchorInfo(r),l=u.getAnchorInfo(i),c=a.isAllowConnectedAsSource(o,s,l),d=u.isAllowConnectedAsTarget(o,s,l),h=e.formatAnchorConnectValidateData(c),p=h.isAllPass,f=h.msg,v=e.formatAnchorConnectValidateData(d),g=v.isAllPass;return{isPass:p&&g,sourceMsg:f,targetMsg:v.msg}},t.prototype.insetNode=function(t){var n=this,r=this._lf.graphModel.edges,i=this._lf.getNodeModelById(t.id),o=null==i?void 0:i.getDefaultAnchor();if(!o||0===o.length)this._lf.graphModel.eventCenter.emit(e.EventType.CONNECTION_NOT_ALLOWED,{data:t,msg:"自定义类型节点不显示锚点,也不允许其他节点连接到此节点"});else if(i)for(var a=0;a<r.length;a++){var u=tg(i,r[a],this.deviation),s=u.crossIndex,l=u.crossPoints;if(s>=0){var c=r[a],d=c.sourceNodeId,h=c.targetNodeId,p=c.id,f=c.type,v=c.pointsList,g=c.sourceAnchorId,y=c.targetAnchorId,m=Ru(v[0]),b=Ru(l.startCrossPoint);this._lf.deleteEdge(p);var w=this.checkRuleBeforeInsetNode(d,h,g,y,t);if(this._lf.addEdge({type:f,sourceNodeId:d,targetNodeId:t.id,startPoint:m,endPoint:b,pointsList:_(_([],x(v.slice(0,s)),!1),[l.startCrossPoint],!1)}),this._lf.addEdge({type:f,sourceNodeId:t.id,targetNodeId:h,startPoint:Ru(l.endCrossPoint),endPoint:Ru(v[v.length-1]),pointsList:_([l.endCrossPoint],x(v.slice(s)),!1)}),w.isPass)break;this._lf.graphModel.eventCenter.emit(e.EventType.CONNECTION_NOT_ALLOWED,{data:t,msg:w.targetMsg||w.sourceMsg}),setTimeout((function(){n._lf.undo()}),200);break}}},t.pluginName="insertNodeInPolyline",t}(),ng=function(){function t(t){var e=t.lf,n=this;this.controlItems=[{key:"zoom-out",iconClass:"lf-control-zoomOut",title:"缩小流程图",text:"缩小",onClick:function(){n.lf.zoom(!1)}},{key:"zoom-in",iconClass:"lf-control-zoomIn",title:"放大流程图",text:"放大",onClick:function(){n.lf.zoom(!0)}},{key:"reset",iconClass:"lf-control-fit",title:"恢复流程原有尺寸",text:"适应",onClick:function(){n.lf.resetZoom()}},{key:"undo",iconClass:"lf-control-undo",title:"回到上一步",text:"上一步",onClick:function(){n.lf.undo()}},{key:"redo",iconClass:"lf-control-redo",title:"移到下一步",text:"下一步",onClick:function(){n.lf.redo()}}],this.lf=e}return t.prototype.render=function(t,e){this.destroy();var n=this.getControlTool();this.toolEl=n,e.appendChild(n),this.domContainer=e},t.prototype.destroy=function(){this.domContainer&&this.toolEl&&this.domContainer.contains(this.toolEl)&&this.domContainer.removeChild(this.toolEl)},t.prototype.addItem=function(t){this.controlItems.push(t)},t.prototype.removeItem=function(t){var e=this.controlItems.findIndex((function(e){return e.key===t}));return-1==e?null:this.controlItems.splice(e,1)[0]},t.prototype.getControlTool=function(){var t=this,e="lf-control-item",n="lf-control-item disabled",r=document.createElement("div"),i=[];return r.className="lf-control",this.controlItems.forEach((function(r){var o=document.createElement("div"),a=document.createElement("i"),u=document.createElement("span");switch(o.className=n,r.onClick&&(o.onclick=r.onClick.bind(null,t.lf)),r.onMouseEnter&&(o.onmouseenter=r.onMouseEnter.bind(null,t.lf)),r.onMouseLeave&&(o.onmouseleave=r.onMouseLeave.bind(null,t.lf)),a.className=r.iconClass,u.className="lf-control-text",u.title=r.title,u.innerText=r.text,o.append(a,u),r.text){case"上一步":t.lf.on("history:change",(function(t){var r=t.data.undoAble;o.className=r?e:n}));break;case"下一步":t.lf.on("history:change",(function(t){var r=t.data.redoAble;o.className=r?e:n}));break;default:o.className=e}i.push(o)})),r.append.apply(r,_([],x(i),!1)),r},t.pluginName="control",t}(),rg="lf:defaultNodeMenu",ig="lf:defaultEdgeMenu",og="lf:defaultGraphMenu",ag="lf:defaultSelectionMenu",ug=function(){function t(t){var e=t.lf,n=this;this.__currentData=null,this.lf=e,e.options.isSilentMode||(this.__menuDOM=document.createElement("ul"),this.menuTypeMap=new Map,this.init(),this.lf.setMenuConfig=function(t){n.setMenuConfig(t)},this.lf.addMenuConfig=function(t){n.addMenuConfig(t)},this.lf.setMenuByType=function(t){n.setMenuByType(t)})}return t.prototype.init=function(){var t,e,n,r,i=this,o=[{text:"删除",callback:function(t){i.lf.deleteNode(t.id)}},{text:"编辑文本",callback:function(t){i.lf.graphModel.editText(t.id)}},{text:"复制",callback:function(t){i.lf.cloneNode(t.id)}}];null===(t=this.menuTypeMap)||void 0===t||t.set(rg,o);var a=[{text:"删除",callback:function(t){i.lf.deleteEdge(t.id)}},{text:"编辑文本",callback:function(t){i.lf.graphModel.editText(t.id)}}];null===(e=this.menuTypeMap)||void 0===e||e.set(ig,a),null===(n=this.menuTypeMap)||void 0===n||n.set(og,[]);var u=[{text:"删除",callback:function(t){i.lf.clearSelectElements(),t.edges.forEach((function(t){return i.lf.deleteEdge(t.id)})),t.nodes.forEach((function(t){return i.lf.deleteNode(t.id)}))}}];null===(r=this.menuTypeMap)||void 0===r||r.set(ag,u)},t.prototype.render=function(t,e){var n=this;t.options.isSilentMode||(this.__container=e,this.__currentData=null,this.__menuDOM&&(this.__menuDOM.className="lf-menu",e.appendChild(this.__menuDOM),this.__menuDOM.addEventListener("click",(function(t){t.stopPropagation();for(var e=t.target;-1===Array.from(e.classList).indexOf("lf-menu-item")&&-1===Array.from(e.classList).indexOf("lf-menu");)e=null==e?void 0:e.parentElement;Array.from(e.classList).indexOf("lf-menu-item")>-1?(e.onclickCallback(n.__currentData),n.__menuDOM&&(n.__menuDOM.style.display="none"),n.__currentData=null):console.warn("点击区域不在菜单项内,请检查代码!")}),!0)),this.lf.on("node:contextmenu",(function(t){var e,r,i=t.data,o=t.position,a=t.e,u=o.domOverlayPosition,s=u.x,l=u.y,c=i.id,d=n.lf.graphModel.getNodeModelById(c);if(d){var h=[],p=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(d.type);h=d&&d.menu&&Array.isArray(d.menu)?d.menu:p||(null===(r=n.menuTypeMap)||void 0===r?void 0:r.get(rg)),n.__currentData=i,n.showMenu(s,l,h,{width:d.width,height:d.height,clientX:a.clientX,clientY:a.clientY})}})),this.lf.on("edge:contextmenu",(function(t){var e,r,i,o=t.data,a=t.position,u=t.e,s=a.domOverlayPosition,l=s.x,c=s.y,d=o.id,h=n.lf.graphModel.getEdgeModelById(d);if(h){var p=[],f=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(h.type);p=h&&h.menu&&Array.isArray(h.menu)?h.menu:f||(null!==(i=null===(r=n.menuTypeMap)||void 0===r?void 0:r.get(ig))&&void 0!==i?i:[]),n.__currentData=o,n.showMenu(l,c,p,{width:h.width,height:h.height,clientX:u.clientX,clientY:u.clientY})}})),this.lf.on("blank:contextmenu",(function(t){var e,r,i=t.position,o=null!==(r=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(og))&&void 0!==r?r:[],a=i.domOverlayPosition,u=a.x,s=a.y;n.showMenu(u,s,o)})),this.lf.on("selection:contextmenu",(function(t){var e,r=t.data,i=t.position,o=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(ag),a=i.domOverlayPosition,u=a.x,s=a.y;n.__currentData=r,n.showMenu(u,s,o)})),this.lf.on("node:mousedown",(function(){n.__menuDOM.style.display="none"})),this.lf.on("edge:click",(function(){n.__menuDOM.style.display="none"})),this.lf.on("blank:click",(function(){n.__menuDOM.style.display="none"})))},t.prototype.destroy=function(){var t;this.__menuDOM&&(null===(t=null==this?void 0:this.__container)||void 0===t||t.removeChild(this.__menuDOM),this.__menuDOM=void 0)},t.prototype.showMenu=function(t,e,n,r){if(n&&n.length){var i=this.__menuDOM;if(i){if(i.innerHTML="",i.append.apply(i,_([],x(this.__getMenuDom(n)),!1)),!i.children.length)return;if(i.style.display="block",!r)return i.style.top="".concat(e,"px"),void(i.style.left="".concat(t,"px"));var o=r.width,a=r.height,u=r.clientX,s=r.clientY,l=this.lf.graphModel,c=i.offsetWidth,d=!0,h=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,p=h-u,f=l.rootEl.getBoundingClientRect(),v=f.left+f.width;v<h&&(p=v-u),p<c&&(d=!1),i.style.left="".concat(d?t:t-o,"px");var g=i.offsetHeight,y=!0,m=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,b=m-s,w=f.top+f.height;w<m&&(b=w-s),b<g&&(y=!1),i.style.top="".concat(y?e:e-a,"px")}}},t.prototype.setMenuByType=function(t){var e;t.type&&t.menu&&(null===(e=this.menuTypeMap)||void 0===e||e.set(t.type,t.menu))},t.prototype.__getMenuDom=function(t){var e=[];return t&&t.length>0&&t.forEach((function(t){var n=document.createElement("li");if(t.className?n.className="lf-menu-item ".concat(t.className):n.className="lf-menu-item",!0===t.icon){var r=document.createElement("span");r.className="lf-menu-item-icon",n.appendChild(r)}var i=document.createElement("span");i.className="lf-menu-item-text",t.text&&(i.innerText=t.text),n.appendChild(i),n.onclickCallback=t.callback,e.push(n)})),e},t.prototype.setMenuConfig=function(t){var e,n,r;t&&(void 0!==t.nodeMenu&&(null===(e=this.menuTypeMap)||void 0===e||e.set(rg,t.nodeMenu?t.nodeMenu:[])),void 0!==t.edgeMenu&&(null===(n=this.menuTypeMap)||void 0===n||n.set(ig,t.edgeMenu?t.edgeMenu:[])),void 0!==t.graphMenu&&(null===(r=this.menuTypeMap)||void 0===r||r.set(og,t.graphMenu?t.graphMenu:[])))},t.prototype.addMenuConfig=function(t){var e,n,r,i,o,a,u,s,l;if(t){if(Array.isArray(t.nodeMenu)){var c=null!==(n=null===(e=this.menuTypeMap)||void 0===e?void 0:e.get(rg))&&void 0!==n?n:[];null===(r=this.menuTypeMap)||void 0===r||r.set(rg,c.concat(t.nodeMenu))}if(Array.isArray(t.edgeMenu)){c=null!==(o=null===(i=this.menuTypeMap)||void 0===i?void 0:i.get(ig))&&void 0!==o?o:[];null===(a=this.menuTypeMap)||void 0===a||a.set(ig,c.concat(t.edgeMenu))}if(Array.isArray(t.graphMenu)){c=null!==(s=null===(u=this.menuTypeMap)||void 0===u?void 0:u.get(og))&&void 0!==s?s:[];null===(l=this.menuTypeMap)||void 0===l||l.set(og,c.concat(t.graphMenu))}}},t.prototype.changeMenuItem=function(t,e){if("add"===t)this.addMenuConfig(e);else{if("reset"!==t)throw new Error("The first parameter of changeMenuConfig should be 'add' or 'reset'");this.setMenuConfig(e)}},t.pluginName="menu",t}(),sg="menu-common",lg=function(){function t(t){var e=t.lf,n=this;this.menuTypeMap=new Map,this.listenDelete=function(){n.hideContextMenu()},this.lf=e,this.__menuDOM=document.createElement("div"),this.__menuDOM.className="lf-inner-context",this.menuTypeMap.set(sg,[]),this.lf.setContextMenuByType=function(t,e){n.setContextMenuByType(t,e)},this.lf.setContextMenuItems=function(t){n.setContextMenuItems(t)},this.lf.showContextMenu=function(t){n.showContextMenu(t)},this.lf.hideContextMenu=function(){n.hideContextMenu()}}return t.prototype.render=function(t,e){var n=this;this.container=e,t.on("node:click",(function(t){var e=t.data;n._activeData=e,n.createContextMenu()})),t.on("edge:click",(function(t){var e=t.data;n._activeData=e,n.createContextMenu()})),t.on("blank:click",(function(){n.hideContextMenu()}))},t.prototype.setContextMenuByType=function(t,e){this.menuTypeMap.set(t,e)},t.prototype.hideContextMenu=function(){this.__menuDOM.innerHTML="",this.__menuDOM.style.display="none",this.isShow&&this.container.removeChild(this.__menuDOM),this.lf.off("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!1},t.prototype.showContextMenu=function(t){t&&t.id?(this._activeData=t,this.createContextMenu()):console.warn("请检查传入的参数")},t.prototype.setContextMenuItems=function(t){this.menuTypeMap.set(sg,t)},t.prototype.getContextMenuPosition=function(){var t=this._activeData,e=this.lf.graphModel.getElement(t.id);if(e){var n,r;if("edge"===e.BaseType){n=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER;var i=e.getData();n=Math.max(i.startPoint.x,n),r=Math.min(i.startPoint.y,r),n=Math.max(i.endPoint.x,n),r=Math.min(i.endPoint.y,r),i.pointsList&&i.pointsList.forEach((function(t){n=Math.max(t.x,n),r=Math.min(t.y,r)}))}return"node"===e.BaseType&&(n=t.x+e.width/2,r=t.y-e.height/2),this.lf.graphModel.transformModel.CanvasPointToHtmlPoint([n,r])}},t.prototype.createContextMenu=function(){var t=this;if(!this.lf.options.isSilentMode){var e=_(_([],x(this.menuTypeMap.get(this._activeData.type)||[]),!1),x(this.menuTypeMap.get(sg)||[]),!1),n=document.createDocumentFragment();e.forEach((function(e){var r=document.createElement("div");r.className="lf-context-item";var i=document.createElement("img");i.src=e.icon,i.className="lf-context-img",e.className&&(r.className="".concat(r.className," ").concat(e.className)),i.addEventListener("click",(function(){t.hideContextMenu(),e.callback?e.callback(t._activeData):t.addNode({sourceId:t._activeData.id,x:t._activeData.x,y:t._activeData.y,properties:e.properties,type:e.type})})),r.appendChild(i),n.appendChild(r)})),this.__menuDOM.innerHTML="",this.__menuDOM.appendChild(n),this.showMenu()}},t.prototype.addNode=function(t,e){var n=void 0!==e;void 0===e&&(e=t.y);var r=this.lf.getNodeModelById(t.sourceId);if(r){var i=t.x-r.width+200,o=e-t.y/2-20,a=t.x+r.width+200,u=e+t.y/2+20;if(this.lf.getAreaElement([i,o],[a,u]).length)return e+=100,void this.addNode(t,e);if(t.type){var s=this.lf.addNode({type:t.type,x:t.x+200,y:e,properties:t.properties}),l=void 0,c=void 0;n&&(l={x:t.x,y:t.y+r.height/2},c={x:s.x-s.width/2,y:s.y}),this.lf.addEdge({sourceNodeId:t.sourceId,targetNodeId:s.id,startPoint:l,endPoint:c})}}},t.prototype.showMenu=function(){var t=this.getContextMenuPosition();if(t){var e=x(t,2),n=e[0],r=e[1];this.__menuDOM.style.display="flex",this.__menuDOM.style.top="".concat(r,"px"),this.__menuDOM.style.left="".concat(n+10,"px"),this.container.appendChild(this.__menuDOM),!this.isShow&&this.lf.on("node:delete,edge:delete,node:drag,graph:transform",this.listenDelete),this.isShow=!0}},t.pluginName="contextMenu",t}(),cg=function(){function t(t){var e=t.lf,n=this;this.lf=e,this.lf.setPatternItems=function(t){n.setPatternItems(t)}}return t.prototype.render=function(t,e){var n=this;this.destroy(),this.shapeList&&0!==this.shapeList.length?(this.panelEl=document.createElement("div"),this.panelEl.className="lf-dndpanel",this.shapeList.forEach((function(t){var e;null===(e=n.panelEl)||void 0===e||e.appendChild(n.createDndItem(t))})),e.appendChild(this.panelEl),this.domContainer=e):this.domContainer=e},t.prototype.destroy=function(){this.domContainer&&this.panelEl&&this.domContainer.contains(this.panelEl)&&this.domContainer.removeChild(this.panelEl)},t.prototype.setPatternItems=function(t){this.shapeList=t,this.domContainer&&this.render(this.lf,this.domContainer)},t.prototype.createDndItem=function(t){var e=this,n=document.createElement("div");n.className=t.className?"lf-dnd-item ".concat(t.className):"lf-dnd-item";var r=document.createElement("div");if(r.className="lf-dnd-shape",t.icon&&(r.style.backgroundImage="url(".concat(t.icon,")")),n.appendChild(r),t.label){var i=document.createElement("div");i.innerText=t.label,i.className="lf-dnd-text",n.appendChild(i)}return t.disabled?(n.classList.add("disabled"),n.onmousedown=function(){t.callback&&t.callback(e.lf,e.domContainer)},n):(n.onmousedown=function(){t.type&&e.lf.dnd.startDrag({type:t.type,properties:t.properties,text:t.text}),t.callback&&t.callback(e.lf,e.domContainer)},n.ondblclick=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-dbclick",{e:n,data:t})},n.onclick=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-click",{e:n,data:t})},n.oncontextmenu=function(n){e.lf.graphModel.eventCenter.emit("dnd:panel-contextmenu",{e:n,data:t})},n)},t.pluginName="dndPanel",t}(),dg=function(){function t(t){var e=t.lf,n=this;this.disabled=!0,this.isDefaultStopMoveGraph=!1,this.isWholeNode=!0,this.isWholeEdge=!0,this.draw=function(t){var e=n.lf.getPointByClient(t.clientX,t.clientY).domOverlayPosition,r=e.x,i=e.y;if(n.endPoint={x:r,y:i},n.startPoint){var o=n.startPoint,a=o.x,u=o.y,s=a,l=u,c=r-a,d=i-u;r<a&&(s=r,c=a-r),i<u&&(l=i,d=u-i),n.wrapper&&(n.wrapper.style.left="".concat(s,"px"),n.wrapper.style.top="".concat(l,"px"),n.wrapper.style.width="".concat(c,"px"),n.wrapper.style.height="".concat(d,"px"))}},this.drawOff=function(){var t;if(document.removeEventListener("mousemove",n.draw),document.removeEventListener("mouseup",n.drawOff),n.wrapper&&(n.wrapper.oncontextmenu=null,null===(t=n.container)||void 0===t||t.removeChild(n.wrapper)),n.startPoint&&n.endPoint){var e=n.startPoint,r=e.x,i=e.y,o=n.endPoint,a=o.x,u=o.y,s=[Math.min(r,a),Math.min(i,u)],l=[Math.max(r,a),Math.max(i,u)];if(n.lf.emit("selection:selected-area",{topLeft:s,bottomRight:l}),Math.abs(a-r)<10&&Math.abs(u-i)<10)return;var c=n.lf.graphModel.getAreaElement(s,l,n.isWholeEdge,n.isWholeNode,!0),d=n.lf.graphModel.group;c.forEach((function(t){d&&d.getNodeGroup(t.id)||n.lf.selectElementById(t.id,!0)})),n.lf.emit("selection:selected",c)}},this.lf=e;var r=e.getEditConfig().stopMoveGraph;this.isDefaultStopMoveGraph=r,e.openSelectionSelect=function(){n.openSelectionSelect()},e.closeSelectionSelect=function(){n.closeSelectionSelect()}}return t.prototype.render=function(t,e){var n=this;this.container=e,t.on("blank:mousedown",(function(r){var i=r.e;if(t.getEditConfig().stopMoveGraph&&!n.disabled&&!(2===i.button)){var o=t.getPointByClient(i.clientX,i.clientY).domOverlayPosition,a=o.x,u=o.y;n.startPoint={x:a,y:u},n.endPoint={x:a,y:u};var s=document.createElement("div");s.className="lf-selection-select",s.oncontextmenu=function(t){t.preventDefault()},s.style.top="".concat(n.startPoint.y,"px"),s.style.left="".concat(n.startPoint.x,"px"),e.appendChild(s),n.wrapper=s,document.addEventListener("mousemove",n.draw),document.addEventListener("mouseup",n.drawOff)}}))},t.prototype.setSelectionSense=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!0),this.isWholeEdge=t,this.isWholeNode=e},t.prototype.openSelectionSelect=function(){this.lf.getEditConfig().stopMoveGraph||(this.isDefaultStopMoveGraph=!1,this.lf.updateEditConfig({stopMoveGraph:!0})),this.open()},t.prototype.closeSelectionSelect=function(){this.isDefaultStopMoveGraph||this.lf.updateEditConfig({stopMoveGraph:!1}),this.close()},t.prototype.open=function(){this.disabled=!1},t.prototype.close=function(){this.disabled=!0},t.pluginName="selectionSelect",t}(),hg=function(){function t(t){var e=t.lf,n=t.LogicFlow,r=t.options,i=this;this.width=200,this.height=150,this.scale=1,this.translateX=0,this.translateY=0,this.showEdge=!1,this.viewPortTop=0,this.viewPortLeft=0,this.viewPortWidth=150,this.viewPortHeight=75,this.isShow=!1,this.isShowHeader=!1,this.isShowCloseIcon=!1,this.headerTitle="导航",this.disabledPlugins=["miniMap","control","selectionSelect"],this.render=function(t,e){i.container=e,i.lf.on("history:change",(function(){i.isShow&&i.setView()})),i.lf.on("graph:transform",(function(){i.isShow&&i.setView(!1)}))},this.show=function(t,e){i.isShow||(i.createMiniMap(t,e),i.setView()),i.isShow=!0},this.hide=function(){i.isShow&&(i.removeMiniMap(),i.lf.emit("miniMap:close",{})),i.isShow=!1},this.updatePosition=function(t){if("object"==typeof t)void 0===t.left&&void 0===t.right||(i.leftPosition=t.left,i.rightPosition=t.right),void 0===t.top&&void 0===t.bottom||(i.topPosition=t.top,i.bottomPosition=t.bottom);else switch(t){case"left-top":i.leftPosition=0,i.rightPosition=void 0,i.topPosition=0,i.bottomPosition=void 0;break;case"right-top":i.leftPosition=void 0,i.rightPosition=0,i.topPosition=0,i.bottomPosition=void 0;break;case"left-bottom":i.leftPosition=0,i.rightPosition=void 0,i.topPosition=void 0,i.bottomPosition=0;break;case"right-bottom":i.leftPosition=void 0,i.rightPosition=0,i.topPosition=void 0,i.bottomPosition=0}i.updateMiniMapPosition()},this.reset=function(){i.lf.resetTranslate(),i.lf.resetZoom()},this.setShowEdge=function(t){i.showEdge!==t&&(i.showEdge=t,i.setView())},this.startDrag=function(t){document.addEventListener("mousemove",i.drag),document.addEventListener("mouseup",i.drop);var e=t.x,n=t.y;i.startPosition={x:e,y:n}},this.drag=function(t){var e=t.x,n=t.y,r=(e-i.startPosition.x)/i.scale,o=(n-i.startPosition.y)/i.scale,a=i.viewPortLeft+r+i.viewPortWidth/i.scale/2,u=i.viewPortTop+o+i.viewPortHeight/i.scale/2;i.startPosition={x:e,y:n},i.lf.focusOn({coordinate:{x:a,y:u}})},this.drop=function(){document.removeEventListener("mousemove",i.drag),document.removeEventListener("mouseup",i.drop)},this.mapClick=function(t){var e=t.offsetX,n=t.offsetY,r=i.translateX+e/i.scale,o=i.translateY+n/i.scale;i.lf.focusOn({coordinate:{x:r,y:o}})},this.lf=e,this.LFCtor=n,r&&r.MiniMap&&this.setOption(r.MiniMap),this.viewPortWidth=e.graphModel.width,this.viewPortHeight=e.graphModel.height;var o={left:0,right:this.viewPortWidth,top:0,bottom:this.viewPortHeight};this.bounds=o,this.elementAreaBounds=o,this.viewPortBounds=o,this.initMiniMap()}return t.prototype.setOption=function(t){var e=t.width,n=void 0===e?150:e,r=t.height,i=void 0===r?220:r,o=t.showEdge,a=void 0!==o&&o,u=t.isShowHeader,s=void 0!==u&&u,l=t.isShowCloseIcon,c=void 0!==l&&l,d=t.leftPosition,h=t.topPosition,p=t.rightPosition,f=void 0===p?0:p,v=t.bottomPosition,g=void 0===v?0:v,y=t.headerTitle,m=void 0===y?"导航":y;this.width=n,this.height=i,this.showEdge=a,this.isShowHeader=s,this.isShowCloseIcon=c,this.leftPosition=d,this.rightPosition=void 0!==d?void 0:f,this.topPosition=h,this.bottomPosition=void 0!==h?void 0:g,this.headerTitle=m},t.prototype.initMiniMap=function(){var t=document.createElement("div");t.className="lf-mini-map-graph",t.style.width="".concat(this.width,"px"),t.style.height="".concat(this.height,"px"),this.lfMap=new this.LFCtor({container:t,grid:!1,isSilentMode:!0,stopZoomGraph:!0,stopScrollGraph:!0,stopMoveGraph:!1,history:!1,snapline:!1,disabledPlugins:this.disabledPlugins}),this.miniMapWrap=t,this.createViewPort(),t.addEventListener("click",this.mapClick)},t.prototype.createMiniMap=function(t,e){var n,r=document.createElement("div");this.miniMapContainer=r,r.appendChild(this.miniMapWrap),r.style.position="absolute",void 0===t&&void 0===e||(this.leftPosition=t||0,this.topPosition=e||0,this.rightPosition=void 0,this.bottomPosition=void 0),this.updateMiniMapPosition(),r.className="lf-mini-map",this.isShowCloseIcon||r.classList.add("lf-mini-map-no-close-icon"),this.isShowHeader||r.classList.add("lf-mini-map-no-header"),null===(n=this.container)||void 0===n||n.appendChild(r),this.miniMapWrap.appendChild(this.viewport);var i=document.createElement("div");i.className="lf-mini-map-header",i.innerText=this.headerTitle,r.appendChild(i);var o=document.createElement("span");o.className="lf-mini-map-close",o.addEventListener("click",this.hide),r.appendChild(o)},t.prototype.updateMiniMapPosition=function(){if(this.miniMapContainer){var t=this.miniMapContainer.style;void 0!==this.rightPosition?(t.right="".concat(this.rightPosition,"px"),t.left=""):(t.left="".concat(this.leftPosition,"px"),t.right=""),void 0!==this.bottomPosition?(t.bottom="".concat(this.bottomPosition,"px"),t.top=""):(t.top="".concat(this.topPosition,"px"),t.bottom="")}},t.prototype.removeMiniMap=function(){var t;this.miniMapContainer&&(null===(t=this.container)||void 0===t||t.removeChild(this.miniMapContainer))},t.prototype.updateBounds=function(t){t&&this.updateElementAreaBounds(t),this.updateViewPortBounds(),this.bounds={left:Math.min(this.elementAreaBounds.left,this.viewPortBounds.left),right:Math.max(this.elementAreaBounds.right,this.viewPortBounds.right),top:Math.min(this.elementAreaBounds.top,this.viewPortBounds.top),bottom:Math.max(this.elementAreaBounds.bottom,this.viewPortBounds.bottom)}},t.prototype.updateElementAreaBounds=function(t){var e={left:0,right:0,top:0,bottom:0},n=t.nodes;n&&n.length>0&&n.forEach((function(t){var n,r,i=t.x,o=t.y,a=null!==(n=t.width)&&void 0!==n?n:200,u=null!==(r=t.height)&&void 0!==r?r:200,s=i-a/2,l=i+a/2,c=o-u/2,d=o+u/2;e.left=Math.min(s,e.left),e.right=Math.max(l,e.right),e.top=Math.min(c,e.top),e.bottom=Math.max(d,e.bottom)})),this.elementAreaBounds=e},t.prototype.updateViewPortBounds=function(){var t=this.lf.getTransform(),e=t.TRANSLATE_X,n=t.TRANSLATE_Y,r=t.SCALE_X,i=t.SCALE_Y,o=this.lf.graphModel,a=o.width,u=o.height;this.viewPortBounds={left:-e/r,right:(-e+a)/r,top:-n/i,bottom:(-n+u)/i}},t.prototype.resetData=function(t){var e=t.nodes,n=t.edges;return e.forEach((function(t){t.text=void 0})),this.showEdge&&n.forEach((function(t){t.text=void 0})),{nodes:e,edges:this.showEdge?n:[]}},t.prototype.setView=function(t){var e,n;if(void 0===t&&(t=!0),t){var r=this.lf.getGraphRawData(),i=this.resetData(r),o=this.lf.viewMap,a=this.lf.graphModel.modelMap,u=this.lfMap.viewMap;try{for(var s=b(o.keys()),l=s.next();!l.done;l=s.next()){var c=l.value;u.has(c)||this.lfMap.register({type:c,view:o.get(c),model:a.get(c)})}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}this.lfMap.render(i),this.updateBounds(i)}else this.updateBounds();var d=this.bounds,h=d.left,p=d.top,f=d.right-h,v=d.bottom-p,g=this.width/f,y=this.height/v,m=Math.min(g,y);this.scale=m;var x=h-(this.width/m-f)/2,_=p-(this.height/m-v)/2;if(this.lfMap.graphModel.transformModel.translate(-x+this.translateX,-_+this.translateY),this.translateX=x,this.translateY=_,this.miniMapWrap.firstChild){var w=this.miniMapWrap.firstChild.style;w.pointerEvents="none",w.transform="matrix(".concat(m,", 0, 0, ").concat(m,", 0, 0)"),w.transformOrigin="left top",w.height="".concat(this.height/m,"px"),w.width="".concat(this.width/m,"px"),this.updateViewPort()}},t.prototype.updateViewPort=function(){var t=this.viewport.style,e=this.lf.getTransform(),n=e.TRANSLATE_X,r=e.TRANSLATE_Y,i=e.SCALE_X,o=e.SCALE_Y,a=this.lf.graphModel,u=a.width,s=a.height;this.viewPortLeft=-n/i,this.viewPortTop=-r/o,this.viewPortWidth=u/i*this.scale,this.viewPortHeight=s/o*this.scale,t.width="".concat(this.viewPortWidth,"px"),t.height="".concat(this.viewPortHeight,"px"),t.left="".concat((this.viewPortLeft-this.translateX)*this.scale,"px"),t.top="".concat((this.viewPortTop-this.translateY)*this.scale,"px")},t.prototype.createViewPort=function(){var t=document.createElement("div");t.className="lf-minimap-viewport",t.addEventListener("mousedown",this.startDrag),t.addEventListener("click",(function(t){t.stopPropagation()})),this.viewport=t},t.pluginName="miniMap",t}(),pg={tr:"tl",lb:"tl",tl:"tr",rb:"tr",br:"bl",lt:"bl",bl:"br",rt:"br"};function fg(t,e,n,r){var i,o="",a="";t[0]===e[0]?o=t[1]>e[1]?"t":"b":t[1]===e[1]&&(o=t[0]>e[0]?"l":"r"),e[0]===n[0]?a=e[1]>n[1]?"t":"b":e[1]===n[1]&&(a=e[0]>n[0]?"l":"r");var u=Math.min(Math.hypot(e[0]-t[0],e[1]-t[1])/2,Math.hypot(n[0]-e[0],n[1]-e[1])/2,r)||.2*r,s="".concat(o).concat(a),l=pg[s]||"-",c="L ".concat(t[0]," ").concat(t[1]);if("-"===l)c+="L ".concat(e[0]," ").concat(e[1]," L ").concat(n[0]," ").concat(n[1]);else{var d=x(function(t,e,n,r){var i=[t[0],t[1]],o=[t[0],t[1]];switch(n){case"tl":return"tr"===e?(i[1]+=r,o[0]+=r):"lb"===e&&(i[0]+=r,o[1]+=r),[i,o];case"tr":return"tl"===e?(i[1]+=r,o[0]-=r):"rb"===e&&(i[0]-=r,o[1]+=r),[i,o];case"bl":return"br"===e?(i[1]-=r,o[0]+=r):"lt"===e&&(i[0]+=r,o[1]-=r),[i,o];case"br":return"bl"===e?(i[1]-=r,o[0]-=r):"rt"===e&&(i[0]-=r,o[1]-=r),[i,o];default:return[]}}(e,s,l,u),2),h=d[0],p=d[1];h&&p&&(c+="L ".concat(h[0]," ").concat(h[1]," Q ").concat(e[0]," ").concat(e[1]," ").concat(p[0]," ").concat(p[1]),i=x(p,2),e[0]=i[0],e[1]=i[1])}return c}function vg(t,e){var n=0,r="";if(2===t.length)r+="M".concat(t[n][0]," ").concat(t[n++][1]," L ").concat(t[n][0]," ").concat(t[n][1]);else{for(r+="M".concat(t[n][0]," ").concat(t[n++][1]);n+1<t.length;){r+=fg(t[n-1],t[n],t[1+n++],e)}r+="L ".concat(t[n][0]," ").concat(t[n][1])}return r}var gg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getEdge=function(){var t=this.props.model,n=t.points,r=t.isAnimation,i=t.arrowConfig,o=t.radius,a=void 0===o?5:o,u=t.getEdgeStyle(),s=t.getEdgeAnimationStyle(),l=function(t){for(var e=t,n=1;n<e.length-1;){var r=x(e[n-1],2),i=r[0],o=r[1],a=x(e[n],2),u=a[0],s=a[1],l=x(e[n+1],2),c=l[0],d=l[1];i===u&&u===c||o===s&&s===d?e.splice(n,1):n++}return e}(n.split(" ").map((function(t){return t.split(",").map((function(t){return+t}))}))),c=vg(l,a),d=v(v(v({style:r?s:{}},u),i),{fill:"none"});return e.h("path",v({d:c},d))},n}(e.PolylineEdge),yg=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e}(e.PolylineEdgeModel),mg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return f(n,t),n.prototype.getLabelShape=function(){var t=this.props.model,n=t.id,r=t.x,i=t.y,o=t.width,a=t.height,u=t.properties,s=this.props.model.getNodeStyle();return e.h("svg",{x:r-o/2,y:i-a/2,width:50,height:24,style:"z-index: 0; background: none; overflow: auto;"},[u.labelText?e.h("text",{x:0,y:-5,fontSize:"16px",fill:s.stroke},u.labelText):"",u.disabledDelete?"":e.h("text",{x:u.labelText?50:0,y:-5,fontSize:"24px",cursor:"pointer",fill:s.stroke,onclick:this.handleCustomDeleteIconClick.bind(this,n)},"x")])},n.prototype.getShape=function(){var t=this.props.model,n=t.x,r=t.y,i=t.width,o=t.height,a=t.id,u=this.props.model.getNodeStyle();return e.h("g",{},[e.h("rect",v(v({},u),{x:n-i/2,y:r-o/2,width:i,height:o,id:a})),this.getLabelShape()])},n.prototype.toFront=function(){},n.prototype.handleCustomDeleteIconClick=function(t){this.props.graphModel.deleteNode(t)},n}(e.PolygonNode),bg=function(t){function e(){var e=t.apply(this,_([],x(arguments),!1))||this;return e.d=10,e}return f(e,t),e.prototype.initNodeData=function(e){e.text={value:"",x:e.x,y:e.y,draggable:!1,editable:!1},t.prototype.initNodeData.call(this,e),this.zIndex=0,this.draggable=!0},e.prototype.setAttributes=function(){var t,e=this;this.points=[],(null===(t=this.properties)||void 0===t?void 0:t.node_selection_ids).length>1&&setTimeout((function(){var t;e.updatePointsByNodes((null===(t=e.properties)||void 0===t?void 0:t.node_selection_ids)||[])}))},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this);return e.stroke=this.properties.strokeColor||"#008000",e.strokeDasharray="10 5",e},e.prototype.getDefaultAnchor=function(){return[]},e.prototype.updatePoints=function(t){this.points=t},e.prototype.updateCoordinate=function(t){var e=t.x,n=t.y;this.x=e,this.y=n},e.prototype.updatePointsByNodes=function(t){var e=this,n=[],r=1/0,i=1/0,o=-1/0,a=-1/0;t.forEach((function(t){var n=e.graphModel.getNodeModelById(t);if(n){var u=n.width,s=n.height,l=n.x,c=n.y;r=Math.min(r,l-u/2-e.d),i=Math.min(i,c-s/2-e.d),o=Math.max(o,l+u/2+e.d),a=Math.max(a,c+s/2+e.d)}})),n.push([r,i],[o,i],[o,a],[r,a]),[r,i,o,a].some((function(t){return Math.abs(t)===1/0}))||(this.updatePoints(n),this.updateCoordinate({x:(o+r)/2,y:(a+i)/2}))},e}(e.PolygonNodeModel),xg=function(){function t(t){var e=t.lf;this.selectNodes=[],this.d=10,e.register({type:"node-selection",view:mg,model:bg})}return Object.defineProperty(t.prototype,"selectNodesIds",{get:function(){return this.selectNodes.map((function(t){return t.id}))},enumerable:!1,configurable:!0}),t.prototype.addNodeSelection=function(){this.lf.addNode({type:"node-selection",text:"",properties:{node_selection_ids:this.selectNodesIds}}).updatePointsByNodes(this.selectNodesIds)},t.prototype.updateNodeSelection=function(){var t=this.getNodeSelection();t&&(this.lf.setProperties(t.id,{node_selection_ids:this.selectNodesIds}),this.lf.getNodeModelById(t.id).updatePointsByNodes(this.selectNodesIds))},t.prototype.getNodeSelection=function(){var t=this,e=this.selectNodesIds,n=this.lf.getGraphRawData(),r=e.filter((function(e){return e!==t.currentClickNode.id}));return n.nodes.find((function(t){if("node-selection"===t.type){var e=Di(t,"properties.node_selection_ids",[]);return r.every((function(t){return e.includes(t)}))}return!1}))},t.prototype.render=function(t){var e=this;this.lf=t,t.on("node:click",(function(n){if(n.e.shiftKey&&"node-selection"!==n.data.type){e.currentClickNode=n.data;var r=!1;e.selectNodesIds.includes(n.data.id)&&(e.lf.getNodeModelById(n.data.id).setSelected(!1),r=!0);var i=t.getSelectElements(!0).nodes;e.selectNodes=i,1===e.selectNodes.length?r?e.updateNodeSelection():e.addNodeSelection():e.selectNodes.length>1&&e.updateNodeSelection()}})),t.graphModel.addNodeMoveRules((function(e,n,r){if("node-selection"===e.type){var i=e.properties.node_selection_ids;return t.graphModel.moveNodes(i,n,r,!0),!0}return!0}))},t.pluginName="node-selection",t}(),_g=function(){function t(t){var e=t.lf,n=this;this.lf=e,this.paths=[],e.getPathes=function(){if(!n.startNodeType)throw new Error("需要预先指定开始节点类型");return n.getPathes()},e.setRawPaths=function(t){n.setPathes(t)},e.getRawPathes=function(){return n.paths},e.setStartNodeType=function(t){n.startNodeType=t}}return t.prototype.setPathes=function(t){this.paths=t.map((function(t){return{routeId:t.routeId,name:t.name,elements:t.elements,type:t.type,similarElement:null,weight:0}}))},t.prototype.getPathes=function(){var t=this,e=this.lf.getGraphRawData(),n=new Map,r=[];e.nodes.forEach((function(e){n.set(e.id,{id:e.id,data:e,nextNodes:[]}),e.type===t.startNodeType&&r.push(e.id)})),e.edges.forEach((function(t){var e=n.get(t.sourceNodeId);null==e||e.nextNodes.push(t.targetNodeId)}));var i=[];return r.forEach((function(e){var r=n.get(e);r&&(i=i.concat(t.findPathElements(r,n,[])))})),this.getNewPathes(i)},t.prototype.findPathElements=function(t,e,n){void 0===n&&(n=[]);var r=_([],x(n),!1);if(r.push(t.id),0===t.nextNodes.length)return[r];for(var i=[],o=0;o<t.nextNodes.length;o++){var a=e.get(t.nextNodes[o]),u=void 0;if(a){var s=r.indexOf(a.id);u=-1!==s?[_(_([],x(r.slice(s)),!1),[a.id],!1)]:this.findPathElements(a,e,_([],x(r),!1)),i=i.concat(u)}}return i},t.prototype.getNewPathes=function(t){var e=this,n=[],r=new Set;t.forEach((function(t){console.log("elements",t);var i=e.getNewId("path"),o=e.getNewId("路径"),a=e.isLoopPath(t),u=t.join(",");r.has(u)||(r.add(u),n.push({routeId:i,name:o,elements:t,type:a,weight:0,similarElement:""}))}));var i=JSON.parse(JSON.stringify(this.paths));return n.forEach((function(t){for(var n=0;n<i.length;n++){var r=i[n],o=e.similar2Path(_([],x(t.elements),!1),_([],x(r.elements),!1));o>t.weight&&r.weight<=o&&(t.weight=o,t.similarElement=r,o===r.weight&&r.similarElement?(r.similarElement.similarElement=null,r.similarElement.weight=0,r.similarElement=null,r.weight=0):(r.similarElement=t,r.weight=o))}})),n.forEach((function(t){t.similarElement&&t.similarElement.similarElement===t&&(t.routeId=t.similarElement.routeId,t.name=t.similarElement.name),delete t.similarElement,delete t.weight})),this.setPathes(n),n},t.prototype.similar2Path=function(t,e){var n=0,r=t.length+e.length;t.sort(),e.sort();for(var i=t.shift(),o=e.shift();void 0!==i&&void 0!==o;)i===o?(n++,i=t.shift(),o=e.shift()):i<o?i=t.shift():i>o&&(o=e.shift());return n/r*200},t.prototype.getNewId=function(t){return"".concat(t,"_").concat(E())},t.prototype.isLoopPath=function(t){var e=t.length;return t.indexOf(t[e-1])!==e-1?1:0},t.pluginName="flowPath",t}(),wg=-1,Mg=0,Eg=1,Ng=function(){function t(t){var e=t.lf,n=this;this.levelHeight=[],this.newNodeMap=new Map,this.lf=e,this.trunk=[],e.layout=function(t){var e=n.lf.getGraphRawData();n.lf.setStartNodeType(t);var r=n.lf.getPathes();return n.levelHeight=[],n.newNodeMap=new Map,n.layout(e,r)}}return t.prototype.layout=function(t,e){var n=this,r=[];e.forEach((function(t){var e=t.elements;e.length>r.length?r=e:e.length===r.length&&JSON.stringify(e)===JSON.stringify(n.trunk)&&(r=n.trunk)})),this.trunk=r;for(var i=this.formatData(t),o={nodes:[],edges:[]},a=r.length-1;a>=0;a--)this.setNodePosition(r[a],i,o,a,1);this.lf.graphModel.graphDataToModel(o)},t.prototype.setNodePosition=function(t,e,n,r,i){var o=this,a=e[t],u=a.text,s=a.type,l=a.next,c=a.properties,d=160*r+40,h=120*i,p={id:t,x:d,text:u,y:h,type:s,properties:c};return u&&"object"==typeof u&&(p.text=v(v({},u),{x:d+u.x,y:h+u.y})),this.newNodeMap.set(p.id,{x:p.x,y:p.y,type:s}),n.nodes.push(p),a.isFixed=!0,this.addLevelHeight(r,1),l&&l.length>0&&l.forEach((function(i){if(!e[i.nodeId].isFixed){var a=o.getLevelHeight(r+1);o.addLevelHeight(r,1),o.setNodePosition(i.nodeId,e,n,r+1,a+1)}n.edges.push(v({id:i.edgeId,type:i.edgeType,sourceNodeId:t,targetNodeId:i.nodeId,properties:i.properties,text:i.text},o.getEdgeDataPoints(t,i.nodeId)))})),p},t.prototype.getEdgeDataPoints=function(t,e){var n=this.newNodeMap.get(t),r=this.newNodeMap.get(e),i=this.getShape(t),o=i.width,a=i.height,u=this.getShape(e),s=u.width,l=u.height,c=this.getRelativePosition(n,r),d={x:n.x,y:n.y},h={x:r.x,y:r.y};switch(c){case Mg:d.x=n.x+o/2,h.x=r.x-s/2;break;case wg:d.y=n.y+a/2,h.x=r.x-s/2;break;case Eg:d.x=n.x+o/2,h.y=r.y+l/2}return{startPoint:d,endPoint:h}},t.prototype.getRelativePosition=function(t,e){var n=t.y,r=e.y;return n<r?-1:n===r?0:1},t.prototype.getShape=function(t){var e,n,r=this.lf.getNodeModelById(t);return{height:null!==(e=null==r?void 0:r.height)&&void 0!==e?e:0,width:null!==(n=null==r?void 0:r.width)&&void 0!==n?n:0}},t.prototype.formatData=function(t){var e=t.nodes.reduce((function(t,e){var n=e.type,r=e.properties,i=e.text,o=e.x,a=e.y;return i&&"object"==typeof i&&(i.x=i.x-o,i.y=i.y-a),t[e.id]={type:n,properties:r,text:i,prev:[],next:[]},t}),{});return t.edges.forEach((function(t){var n=t.sourceNodeId,r=t.targetNodeId,i=t.id,o=t.properties,a=t.text,u=a;"object"==typeof a&&(u=a.value),e[n].next.push({edgeId:i,nodeId:r,edgeType:t.type,properties:o,text:u}),e[r].prev.push({edgeId:i,nodeId:n,properties:o,text:u})})),e},t.prototype.addLevelHeight=function(t,e,n){void 0===e&&(e=1),void 0===n&&(n=!1);var r=this.levelHeight[t];r||(r={positiveHeight:0,negativeHeight:0},this.levelHeight[t]=r),n?r.negativeHeight-=e:r.positiveHeight+=e},t.prototype.getLevelHeight=function(t,e){void 0===e&&(e=!1);var n=this.levelHeight[t];return n?e?n.negativeHeight:n.positiveHeight:0},t.pluginName="AutoLayout",t}(),Sg=function(t,e){var n=[],r=[],i=function(t,r,o){o&&r.unshift.apply(r,_([],x(e.getEdgeModels({sourceNodeId:t.id,targetNodeId:null==o?void 0:o.id}).map((function(t){return t.id}))),!1)),r.includes(t.id)?n.push(r):(r.unshift(t.id),t.incoming.nodes.length?t.incoming.nodes.forEach((function(e){i(e,r.slice(),t)})):n.push(r))},o=function(t,n,i){i&&n.push.apply(n,_([],x(e.getEdgeModels({sourceNodeId:null==i?void 0:i.id,targetNodeId:t.id}).map((function(t){return t.id}))),!1)),n.includes(t.id)?r.push(n):(n.push(t.id),t.outgoing.nodes.length?t.outgoing.nodes.forEach((function(e){o(e,n.slice(),t)})):r.push(n))};return i(t,[]),o(t,[]),_([],x(new Set(_(_([],x(n.flat()),!1),x(r.flat()),!1))),!1)},Ag=function(){function t(t){var e=t.lf;this.mode="path",this.manual=!1,this.tempStyles={},this.lf=e}return t.prototype.setMode=function(t){this.mode=t},t.prototype.setManual=function(t){this.manual=t},t.prototype.highlightSingle=function(t){var e=this.lf.getModelById(t);"node"===(null==e?void 0:e.BaseType)?e.updateStyles(this.tempStyles[t]):"edge"===(null==e?void 0:e.BaseType)&&(e.updateStyles(this.tempStyles[t]),e.sourceNode.updateStyles(this.tempStyles[e.sourceNode.id]),e.targetNode.updateStyles(this.tempStyles[e.targetNode.id]))},t.prototype.highlightPath=function(t){var e=this,n=function(t,e){var n=e.getModelById(t);return Sg("node"===(null==n?void 0:n.BaseType)?n:null==n?void 0:n.targetNode,e)}(t,this.lf);n.forEach((function(t){var n;null===(n=e.lf.getModelById(t))||void 0===n||n.updateStyles(e.tempStyles[t])}))},t.prototype.highlight=function(t,e){var n=this;(void 0===e&&(e=this.mode),this.manual)||(Object.keys(this.tempStyles).length&&this.restoreHighlight(),Object.values(this.lf.graphModel.modelsMap).forEach((function(t){var e="node"===t.BaseType?t.getNodeStyle():t.getEdgeStyle();n.tempStyles[t.id]=v({},e),t.setStyles({opacity:.1})})),{single:this.highlightSingle.bind(this),path:this.highlightPath.bind(this)}[e](t))},t.prototype.restoreHighlight=function(){var t=this;Object.keys(this.tempStyles).length&&(Object.values(this.lf.graphModel.modelsMap).forEach((function(e){var n,r=null!==(n=t.tempStyles[e.id])&&void 0!==n?n:{};e.updateStyles(v({},r))})),this.tempStyles={})},t.prototype.render=function(){var t=this;this.lf.on("node:mouseenter",(function(e){var n=e.data;return t.highlight(n.id)})),this.lf.on("edge:mouseenter",(function(e){var n=e.data;return t.highlight(n.id)})),this.lf.on("node:mouseleave",this.restoreHighlight.bind(this)),this.lf.on("edge:mouseleave",this.restoreHighlight.bind(this)),this.lf.on("history:change",this.restoreHighlight.bind(this))},t.prototype.destroy=function(){},t.pluginName="highlight",t}();t.AutoLayout=Ng,t.BPMNAdapter=Dv,t.BPMNBaseAdapter=Rv,t.BPMNElements=Zf,t.BoundaryEventFactory=bt,t.BpmnAdapter=lt,t.BpmnElement=H,t.BpmnXmlAdapter=ct,t.ContextMenu=lg,t.Control=ng,t.CurvedEdge=gg,t.CurvedEdgeModel=yg,t.DiamondResize=kf,t.DiamondResizeModel=Pf,t.DiamondResizeView=Tf,t.DndPanel=cg,t.EllipseResize=Af,t.EllipseResizeModel=Nf,t.EllipseResizeView=Sf,t.EndEventFactory=gt,t.EndEventModel=P,t.EndEventView=T,t.ExclusiveGatewayModel=j,t.ExclusiveGatewayView=R,t.FlowPath=_g,t.GatewayNodeFactory=Ot,t.Group=Gf,t.GroupNode=zf,t.GroupNodeModel=Bf,t.Highlight=Ag,t.HtmlResize=If,t.HtmlResizeModel=Cf,t.HtmlResizeView=Of,t.InsertNodeInPolyline=eg,t.IntermediateCatchEventFactory=yt,t.IntermediateThrowEventFactory=xt,t.Menu=ug,t.MiniMap=hg,t.NodeResize=Lf,t.NodeSelection=xg,t.RectResize=Df,t.RectResizeModel=jf,t.RectResizeView=Rf,t.SelectionSelect=dg,t.SequenceFlowModel=C,t.SequenceFlowView=O,t.ServiceTaskModel=L,t.ServiceTaskView=B,t.Snapshot=Uv,t.StartEventFactory=mt,t.StartEventModel=N,t.StartEventView=S,t.SubProcessFactory=Hf,t.TaskNodeFactory=jt,t.UserTaskModel=W,t.UserTaskView=F,t.bpmnUtils=vt,t.convertNormalToXml=Pv,t.convertXmlToNormal=Tv,t.gateway={exclusive:0,inclusive:1,parallel:2},t.gatewayComposable=[[1,1,0],[0,0,1],[0,1,1]],t.getCurvedEdgePath=vg,t.handleAttributes=Y,t.icons=Ct,t.lfJson2Xml=$,t.lfXml2Json=tt,t.multiInstanceIcon=It,t.sequenceFlowFactory=Uf,t.toLogicflowData=function(t){var e={nodes:[],edges:[]},n=t.flowElementList;return n&&n.length>0&&n.forEach((function(t){if(t.type===Vv.SEQUENCE_FLOW){var n=function(t){var e=t.incoming,n=t.outgoing,r=t.properties,i=t.key,o=t.type,a=r.text,u=r.name,s=r.startPoint,l=r.endPoint,c=r.pointsList,d={id:i,type:qv[o],sourceNodeId:e[0],targetNodeId:n[0],text:a||u,properties:{}};s&&(d.startPoint=JSON.parse(s)),l&&(d.endPoint=JSON.parse(l)),c&&(d.pointsList=JSON.parse(c));var h=["startPoint","endPoint","pointsList","text"];return Object.keys(t.properties).forEach((function(e){-1===h.indexOf(e)&&(d.properties[e]=t.properties[e])})),d}(t);e.edges.push(n)}else{var r=function(t){var e=t.properties,n=t.key,r=t.type,i=t.bounds,o=e.x,a=e.y,u=e.text;if(void 0===o){var s=x(i,2),l=s[0],c=l.x,d=l.y,h=s[1];o=(c+h.x)/2,a=(d+h.y)/2}var p={id:n,type:qv[r],x:o,y:a,text:u,properties:{}},f=["x","y","text"];return Object.keys(t.properties).forEach((function(e){-1===f.indexOf(e)&&(p.properties[e]=t.properties[e])})),p}(t);e.nodes.push(r)}})),e},t.toNormalJson=it,t.toTurboData=function(t){var e=new Map,n={flowElementList:[]};return t.nodes.forEach((function(t){var r=function(t){var e=t.id,n=t.type,r=t.x,i=t.y,o=t.text,a=void 0===o?"":o,u=t.properties;return{incoming:[],outgoing:[],dockers:[],type:Yv(n),properties:v(v({},u),{name:a&&a.value||"",x:r,y:i,text:a}),key:e}}(t);n.flowElementList.push(r),e.set(t.id,r)})),t.edges.forEach((function(t){var r=function(t){var e=t.id,n=t.type,r=t.sourceNodeId,i=t.targetNodeId,o=t.startPoint,a=t.endPoint,u=t.pointsList,s=t.text,l=void 0===s?"":s,c=t.properties;return{incoming:[r],outgoing:[i],type:Yv(n),dockers:[],properties:v(v({},c),{name:l&&l.value||"",text:l,startPoint:JSON.stringify(o),endPoint:JSON.stringify(a),pointsList:JSON.stringify(u)}),key:e}}(t);e.get(t.sourceNodeId).outgoing.push(r.key),e.get(t.targetNodeId).incoming.push(r.key),n.flowElementList.push(r)})),n},t.toXmlJson=rt,t.useDefinition=Yf}));
|
|
12
12
|
//# sourceMappingURL=index.min.js.map
|