@logicflow/extension 2.0.0-beta.0 → 2.0.0-beta.2

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.
Files changed (61) hide show
  1. package/.turbo/turbo-build.log +18 -718
  2. package/dist/index.min.js +12 -0
  3. package/dist/index.min.js.map +1 -0
  4. package/es/NodeResize/node/DiamondResize.d.ts +1 -0
  5. package/es/NodeResize/node/DiamondResize.js +2 -1
  6. package/es/NodeResize/node/DiamondResize.js.map +1 -1
  7. package/es/NodeResize/node/EllipseResize.d.ts +1 -0
  8. package/es/NodeResize/node/EllipseResize.js +2 -1
  9. package/es/NodeResize/node/EllipseResize.js.map +1 -1
  10. package/es/NodeResize/node/HtmlResize.d.ts +1 -0
  11. package/es/NodeResize/node/HtmlResize.js +2 -1
  12. package/es/NodeResize/node/HtmlResize.js.map +1 -1
  13. package/es/bpmn/constant.d.ts +1 -1
  14. package/es/bpmn/constant.js +3 -0
  15. package/es/bpmn/constant.js.map +1 -1
  16. package/es/bpmn/index.d.ts +3 -6
  17. package/es/bpmn/index.js +5 -7
  18. package/es/bpmn/index.js.map +1 -1
  19. package/es/components/control/index.d.ts +4 -4
  20. package/es/components/control/index.js.map +1 -1
  21. package/es/components/mini-map/index.d.ts +1 -1
  22. package/es/components/mini-map/index.js.map +1 -1
  23. package/es/components/selection-select/index.d.ts +1 -1
  24. package/es/components/selection-select/index.js.map +1 -1
  25. package/es/materials/group/index.d.ts +1 -1
  26. package/es/materials/group/index.js.map +1 -1
  27. package/lib/NodeResize/node/DiamondResize.d.ts +1 -0
  28. package/lib/NodeResize/node/DiamondResize.js +2 -1
  29. package/lib/NodeResize/node/DiamondResize.js.map +1 -1
  30. package/lib/NodeResize/node/EllipseResize.d.ts +1 -0
  31. package/lib/NodeResize/node/EllipseResize.js +2 -1
  32. package/lib/NodeResize/node/EllipseResize.js.map +1 -1
  33. package/lib/NodeResize/node/HtmlResize.d.ts +1 -0
  34. package/lib/NodeResize/node/HtmlResize.js +2 -1
  35. package/lib/NodeResize/node/HtmlResize.js.map +1 -1
  36. package/lib/bpmn/constant.d.ts +1 -1
  37. package/lib/bpmn/constant.js +3 -0
  38. package/lib/bpmn/constant.js.map +1 -1
  39. package/lib/bpmn/index.d.ts +3 -6
  40. package/lib/bpmn/index.js +5 -7
  41. package/lib/bpmn/index.js.map +1 -1
  42. package/lib/components/control/index.d.ts +4 -4
  43. package/lib/components/control/index.js.map +1 -1
  44. package/lib/components/mini-map/index.d.ts +1 -1
  45. package/lib/components/mini-map/index.js.map +1 -1
  46. package/lib/components/selection-select/index.d.ts +1 -1
  47. package/lib/components/selection-select/index.js.map +1 -1
  48. package/lib/materials/group/index.d.ts +1 -1
  49. package/lib/materials/group/index.js.map +1 -1
  50. package/package.json +14 -3
  51. package/src/NodeResize/node/DiamondResize.tsx +2 -1
  52. package/src/NodeResize/node/EllipseResize.tsx +2 -1
  53. package/src/NodeResize/node/HtmlResize.tsx +2 -1
  54. package/src/bpmn/constant.ts +4 -1
  55. package/src/bpmn/index.ts +7 -4
  56. package/src/components/control/index.ts +4 -4
  57. package/src/components/mini-map/index.ts +1 -1
  58. package/src/components/selection-select/index.ts +1 -1
  59. package/src/materials/group/index.ts +1 -1
  60. package/dist/index.js +0 -26
  61. package/dist/index.js.map +0 -1
package/dist/index.js DELETED
@@ -1,26 +0,0 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Extension={})}(this,(function(t){"use strict";var e=40,n=40,r=40,o=40,i=40,a=40,s=100,u=80,l=100,c=80,p={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:{background:{fill:"white",height:14,stroke:"transparent",radius:3}}},d=function(t,e){return d=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])},d(t,e)};function h(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}d(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var f=function(){return f=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},f.apply(this,arguments)};function y(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 o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}function v(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 g(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function m(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var _="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function b(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var n=function t(){if(this instanceof t){var n=[null];return n.push.apply(n,arguments),new(Function.bind.apply(e,n))}return e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:function(){return t[e]}})})),n}var x,E={},w={};var O="An invariant failed, however the error is obfuscated because this is a production build.",M=[];Object.freeze(M);var S={};function A(){return++Qt.mobxGuid}function P(t){throw N(!1,t),"X"}function N(t,e){if(!t)throw new Error("[mobx] "+(e||O))}function T(t){var e=!1;return function(){if(!e)return e=!0,t.apply(this,arguments)}}Object.freeze(S);var D=function(){};function j(t){return null!==t&&"object"==typeof t}function C(t){if(null===t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function I(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!0,configurable:!0,value:n})}function k(t,e){var n="isMobX"+t;return e.prototype[n]=!0,function(t){return j(t)&&!0===t[n]}}function R(t){return t instanceof Map}function L(t){return t instanceof Set}function B(t){var e=new Set;for(var n in t)e.add(n);return Object.getOwnPropertySymbols(t).forEach((function(n){Object.getOwnPropertyDescriptor(t,n).enumerable&&e.add(n)})),Array.from(e)}function z(t){return t&&t.toString?t.toString():new String(t).toString()}function H(t){return null===t?null:"object"==typeof t?""+t:t}var X="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,G=Symbol("mobx administration"),W=function(){function t(t){void 0===t&&(t="Atom@"+A()),this.name=t,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=gt.NOT_TRACKING}return t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(t){return t()}))},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(t){return t()}))},t.prototype.reportObserved=function(){return ie(this)},t.prototype.reportChanged=function(){re(),function(t){if(t.lowestObserverState===gt.STALE)return;t.lowestObserverState=gt.STALE,t.observers.forEach((function(e){e.dependenciesState===gt.UP_TO_DATE&&(e.isTracing!==mt.NONE&&ae(e,t),e.onBecomeStale()),e.dependenciesState=gt.STALE}))}(this),oe()},t.prototype.toString=function(){return this.name},t}(),F=k("Atom",W);function U(t,e,n){void 0===e&&(e=D),void 0===n&&(n=D);var r=new W(t);return e!==D&&Me(r,e),n!==D&&Se(r,n),r}var Y={identity:function(t,e){return t===e},structural:function(t,e){return Rn(t,e)},default:function(t,e){return Object.is(t,e)},shallow:function(t,e){return Rn(t,e,1)}},V=function(t,e){return V=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},V(t,e)};
2
- /*! *****************************************************************************
3
- Copyright (c) Microsoft Corporation. All rights reserved.
4
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5
- this file except in compliance with the License. You may obtain a copy of the
6
- License at http://www.apache.org/licenses/LICENSE-2.0
7
-
8
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
9
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
10
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
11
- MERCHANTABLITY OR NON-INFRINGEMENT.
12
-
13
- See the Apache Version 2.0 License for specific language governing permissions
14
- and limitations under the License.
15
- ***************************************************************************** */var K=function(){return K=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},K.apply(this,arguments)};function q(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function Z(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function J(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Z(arguments[e]));return t}var $=Symbol("mobx did run lazy initializers"),Q=Symbol("mobx pending decorators"),tt={},et={};function nt(t){var e,n;if(!0!==t[$]){var r=t[Q];if(r){I(t,$,!0);var o=J(Object.getOwnPropertySymbols(r),Object.keys(r));try{for(var i=q(o),a=i.next();!a.done;a=i.next()){var s=r[a.value];s.propertyCreator(t,s.prop,s.descriptor,s.decoratorTarget,s.decoratorArguments)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}}}}function rt(t,e){return function(){var n,r,o=function(r,o,i,a){if(!0===a)return e(r,o,i,r,n),null;if(!Object.prototype.hasOwnProperty.call(r,Q)){var s=r[Q];I(r,Q,K({},s))}return r[Q][o]={prop:o,propertyCreator:e,descriptor:i,decoratorTarget:r,decoratorArguments:n},function(t,e){var n=e?tt:et;return n[t]||(n[t]={configurable:!0,enumerable:e,get:function(){return nt(this),this[t]},set:function(e){nt(this),this[t]=e}})}(o,t)};return(2===(r=arguments).length||3===r.length)&&("string"==typeof r[1]||"symbol"==typeof r[1])||4===r.length&&!0===r[3]?(n=M,o.apply(null,arguments)):(n=Array.prototype.slice.call(arguments),o)}}function ot(t,e,n){return Ge(t)?t:Array.isArray(t)?yt.array(t,{name:n}):C(t)?yt.object(t,void 0,{name:n}):R(t)?yt.map(t,{name:n}):L(t)?yt.set(t,{name:n}):t}function it(t){return t}function at(t){N(t);var e=rt(!0,(function(e,n,r,o,i){var a=r?r.initializer?r.initializer.call(e):r.value:void 0;Sn(e).addObservableProp(n,a,t)})),n=("undefined"!=typeof process&&process.env,e);return n.enhancer=t,n}var st={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function ut(t){return null==t?st:"string"==typeof t?{name:t,deep:!0,proxy:!0}:t}Object.freeze(st);var lt=at(ot),ct=at((function(t,e,n){return null==t||Dn(t)||gn(t)||xn(t)||On(t)?t:Array.isArray(t)?yt.array(t,{name:n,deep:!1}):C(t)?yt.object(t,void 0,{name:n,deep:!1}):R(t)?yt.map(t,{name:n,deep:!1}):L(t)?yt.set(t,{name:n,deep:!1}):P(!1)})),pt=at(it),dt=at((function(t,e,n){return Rn(t,e)?e:t}));function ht(t){return t.defaultDecorator?t.defaultDecorator.enhancer:!1===t.deep?it:ot}var ft={box:function(t,e){arguments.length>2&&vt("box");var n=ut(e);return new Wt(t,ht(n),n.name,!0,n.equals)},array:function(t,e){arguments.length>2&&vt("array");var n=ut(e);return function(t,e,n,r){void 0===n&&(n="ObservableArray@"+A());void 0===r&&(r=!1);var o=new hn(n,e,r);!function(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}(o.values,G,o);var i=new Proxy(o.values,dn);if(o.proxy=i,t&&t.length){var a=Xt(!0);o.spliceWithArray(0,0,t),Gt(a)}return i}(t,ht(n),n.name)},map:function(t,e){arguments.length>2&&vt("map");var n=ut(e);return new bn(t,ht(n),n.name)},set:function(t,e){arguments.length>2&&vt("set");var n=ut(e);return new wn(t,ht(n),n.name)},object:function(t,e,n){"string"==typeof arguments[1]&&vt("object");var r=ut(n);if(!1===r.proxy)return Ne({},t,e,r);var o=Te(r),i=function(t){var e=new Proxy(t,on);return t[G].proxy=e,e}(Ne({},void 0,void 0,r));return De(i,t,e,o),i},ref:pt,shallow:ct,deep:lt,struct:dt},yt=function(t,e,n){if("string"==typeof arguments[1]||"symbol"==typeof arguments[1])return lt.apply(null,arguments);if(Ge(t))return t;var r=C(t)?yt.object(t,e,n):Array.isArray(t)?yt.array(t,e):R(t)?yt.map(t,e):L(t)?yt.set(t,e):t;if(r!==t)return r;P(!1)};function vt(t){P("Expected one or two arguments to observable."+t+". Did you accidentally try to use observable."+t+" as decorator?")}Object.keys(ft).forEach((function(t){return yt[t]=ft[t]}));var gt,mt,_t=rt(!1,(function(t,e,n,r,o){var i=n.get,a=n.set,s=o[0]||{};Sn(t).addComputedProp(t,e,K({get:i,set:a,context:t},s))})),bt=_t({equals:Y.structural}),xt=function(t,e,n){if("string"==typeof e)return _t.apply(null,arguments);if(null!==t&&"object"==typeof t&&1===arguments.length)return _t.apply(null,arguments);var r="object"==typeof e?e:{};return r.get=t,r.set="function"==typeof e?e:r.set,r.name=r.name||t.name||"",new Ut(r)};xt.struct=bt,function(t){t[t.NOT_TRACKING=-1]="NOT_TRACKING",t[t.UP_TO_DATE=0]="UP_TO_DATE",t[t.POSSIBLY_STALE=1]="POSSIBLY_STALE",t[t.STALE=2]="STALE"}(gt||(gt={})),function(t){t[t.NONE=0]="NONE",t[t.LOG=1]="LOG",t[t.BREAK=2]="BREAK"}(mt||(mt={}));var Et=function(t){this.cause=t};function wt(t){return t instanceof Et}function Ot(t){switch(t.dependenciesState){case gt.UP_TO_DATE:return!1;case gt.NOT_TRACKING:case gt.STALE:return!0;case gt.POSSIBLY_STALE:for(var e=Dt(!0),n=Nt(),r=t.observing,o=r.length,i=0;i<o;i++){var a=r[i];if(Yt(a)){if(Qt.disableErrorBoundaries)a.get();else try{a.get()}catch(t){return Tt(n),jt(e),!0}if(t.dependenciesState===gt.STALE)return Tt(n),jt(e),!0}}return Ct(t),Tt(n),jt(e),!1}}function Mt(t){var e=t.observers.size>0;Qt.computationDepth>0&&e&&P(!1),Qt.allowStateChanges||!e&&"strict"!==Qt.enforceActions||P(!1)}function St(t,e,n){var r=Dt(!0);Ct(t),t.newObserving=new Array(t.observing.length+100),t.unboundDepsCount=0,t.runId=++Qt.runId;var o,i=Qt.trackingDerivation;if(Qt.trackingDerivation=t,!0===Qt.disableErrorBoundaries)o=e.call(n);else try{o=e.call(n)}catch(t){o=new Et(t)}return Qt.trackingDerivation=i,function(t){for(var e=t.observing,n=t.observing=t.newObserving,r=gt.UP_TO_DATE,o=0,i=t.unboundDepsCount,a=0;a<i;a++){0===(s=n[a]).diffValue&&(s.diffValue=1,o!==a&&(n[o]=s),o++),s.dependenciesState>r&&(r=s.dependenciesState)}n.length=o,t.newObserving=null,i=e.length;for(;i--;){0===(s=e[i]).diffValue&&ee(s,t),s.diffValue=0}for(;o--;){var s;1===(s=n[o]).diffValue&&(s.diffValue=0,te(s,t))}r!==gt.UP_TO_DATE&&(t.dependenciesState=r,t.onBecomeStale())}(t),jt(r),o}function At(t){var e=t.observing;t.observing=[];for(var n=e.length;n--;)ee(e[n],t);t.dependenciesState=gt.NOT_TRACKING}function Pt(t){var e=Nt();try{return t()}finally{Tt(e)}}function Nt(){var t=Qt.trackingDerivation;return Qt.trackingDerivation=null,t}function Tt(t){Qt.trackingDerivation=t}function Dt(t){var e=Qt.allowStateReads;return Qt.allowStateReads=t,e}function jt(t){Qt.allowStateReads=t}function Ct(t){if(t.dependenciesState!==gt.UP_TO_DATE){t.dependenciesState=gt.UP_TO_DATE;for(var e=t.observing,n=e.length;n--;)e[n].lowestObserverState=gt.UP_TO_DATE}}var It=0,kt=1,Rt=Object.getOwnPropertyDescriptor((function(){}),"name");function Lt(t,e,n){var r=function(){return Bt(t,e,n||this,arguments)};return r.isMobxAction=!0,r}function Bt(t,e,n,r){var o=zt();try{return e.apply(n,r)}catch(t){throw o.error=t,t}finally{Ht(o)}}function zt(t,e,n){var r=Nt();re();var o={prevDerivation:r,prevAllowStateChanges:Xt(!0),prevAllowStateReads:Dt(!0),notifySpy:false,startTime:0,actionId:kt++,parentActionId:It};return It=o.actionId,o}function Ht(t){It!==t.actionId&&P("invalid action stack. did you forget to finish an action?"),It=t.parentActionId,void 0!==t.error&&(Qt.suppressReactionErrors=!0),Gt(t.prevAllowStateChanges),jt(t.prevAllowStateReads),oe(),Tt(t.prevDerivation),t.notifySpy,Qt.suppressReactionErrors=!1}function Xt(t){var e=Qt.allowStateChanges;return Qt.allowStateChanges=t,e}function Gt(t){Qt.allowStateChanges=t}Rt&&Rt.configurable;var Wt=function(t){function e(e,n,r,o,i){void 0===r&&(r="ObservableValue@"+A()),void 0===o&&(o=!0),void 0===i&&(i=Y.default);var a=t.call(this,r)||this;return a.enhancer=n,a.name=r,a.equals=i,a.hasUnreportedChange=!1,a.value=n(e,void 0,r),a}return function(t,e){function n(){this.constructor=t}V(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}(e,t),e.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},e.prototype.set=function(t){this.value;if((t=this.prepareNewValue(t))!==Qt.UNCHANGED){false,this.setNewValue(t)}},e.prototype.prepareNewValue=function(t){if(Mt(this),an(this)){var e=un(this,{object:this,type:"update",newValue:t});if(!e)return Qt.UNCHANGED;t=e.newValue}return t=this.enhancer(t,this.value,this.name),this.equals(this.value,t)?Qt.UNCHANGED:t},e.prototype.setNewValue=function(t){var e=this.value;this.value=t,this.reportChanged(),ln(this)&&pn(this,{type:"update",object:this,newValue:t,oldValue:e})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(t){return sn(this,t)},e.prototype.observe=function(t,e){return e&&t({object:this,type:"update",newValue:this.value,oldValue:void 0}),cn(this,t)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return H(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e}(W),Ft=k("ObservableValue",Wt),Ut=function(){function t(t){this.dependenciesState=gt.NOT_TRACKING,this.observing=[],this.newObserving=null,this.isBeingObserved=!1,this.isPendingUnobservation=!1,this.observers=new Set,this.diffValue=0,this.runId=0,this.lastAccessedBy=0,this.lowestObserverState=gt.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+A(),this.value=new Et(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=mt.NONE,N(t.get,"missing option for computed: get"),this.derivation=t.get,this.name=t.name||"ComputedValue@"+A(),t.set&&(this.setter=Lt(this.name+"-setter",t.set)),this.equals=t.equals||(t.compareStructural||t.struct?Y.structural:Y.default),this.scope=t.context,this.requiresReaction=!!t.requiresReaction,this.keepAlive=!!t.keepAlive}return t.prototype.onBecomeStale=function(){!function(t){if(t.lowestObserverState!==gt.UP_TO_DATE)return;t.lowestObserverState=gt.POSSIBLY_STALE,t.observers.forEach((function(e){e.dependenciesState===gt.UP_TO_DATE&&(e.dependenciesState=gt.POSSIBLY_STALE,e.isTracing!==mt.NONE&&ae(e,t),e.onBecomeStale())}))}(this)},t.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach((function(t){return t()}))},t.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach((function(t){return t()}))},t.prototype.get=function(){this.isComputing&&P("Cycle detected in computation "+this.name+": "+this.derivation),0!==Qt.inBatch||0!==this.observers.size||this.keepAlive?(ie(this),Ot(this)&&this.trackAndCompute()&&function(t){if(t.lowestObserverState===gt.STALE)return;t.lowestObserverState=gt.STALE,t.observers.forEach((function(e){e.dependenciesState===gt.POSSIBLY_STALE?e.dependenciesState=gt.STALE:e.dependenciesState===gt.UP_TO_DATE&&(t.lowestObserverState=gt.UP_TO_DATE)}))}(this)):Ot(this)&&(this.warnAboutUntrackedRead(),re(),this.value=this.computeValue(!1),oe());var t=this.value;if(wt(t))throw t.cause;return t},t.prototype.peek=function(){var t=this.computeValue(!1);if(wt(t))throw t.cause;return t},t.prototype.set=function(t){if(this.setter){N(!this.isRunningSetter,"The setter of computed value '"+this.name+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"),this.isRunningSetter=!0;try{this.setter.call(this.scope,t)}finally{this.isRunningSetter=!1}}else N(!1,!1)},t.prototype.trackAndCompute=function(){var t=this.value,e=this.dependenciesState===gt.NOT_TRACKING,n=this.computeValue(!0),r=e||wt(t)||wt(n)||!this.equals(t,n);return r&&(this.value=n),r},t.prototype.computeValue=function(t){var e;if(this.isComputing=!0,Qt.computationDepth++,t)e=St(this,this.derivation,this.scope);else if(!0===Qt.disableErrorBoundaries)e=this.derivation.call(this.scope);else try{e=this.derivation.call(this.scope)}catch(t){e=new Et(t)}return Qt.computationDepth--,this.isComputing=!1,e},t.prototype.suspend=function(){this.keepAlive||(At(this),this.value=void 0)},t.prototype.observe=function(t,e){var n=this,r=!0,o=void 0;return xe((function(){var i=n.get();if(!r||e){var a=Nt();t({type:"update",object:n,newValue:i,oldValue:o}),Tt(a)}r=!1,o=i}))},t.prototype.warnAboutUntrackedRead=function(){},t.prototype.toJSON=function(){return this.get()},t.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},t.prototype.valueOf=function(){return H(this.get())},t.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},t}(),Yt=k("ComputedValue",Ut),Vt=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","allowStateReads","disableErrorBoundaries","runId","UNCHANGED"],Kt=function(){this.version=5,this.UNCHANGED={},this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.allowStateReads=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.computedConfigurable=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1},qt={};function Zt(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:qt}var Jt=!0,$t=!1,Qt=function(){var t=Zt();return t.__mobxInstanceCount>0&&!t.__mobxGlobals&&(Jt=!1),t.__mobxGlobals&&t.__mobxGlobals.version!==(new Kt).version&&(Jt=!1),Jt?t.__mobxGlobals?(t.__mobxInstanceCount+=1,t.__mobxGlobals.UNCHANGED||(t.__mobxGlobals.UNCHANGED={}),t.__mobxGlobals):(t.__mobxInstanceCount=1,t.__mobxGlobals=new Kt):(setTimeout((function(){$t||P("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")}),1),new Kt)}();function te(t,e){t.observers.add(e),t.lowestObserverState>e.dependenciesState&&(t.lowestObserverState=e.dependenciesState)}function ee(t,e){t.observers.delete(e),0===t.observers.size&&ne(t)}function ne(t){!1===t.isPendingUnobservation&&(t.isPendingUnobservation=!0,Qt.pendingUnobservations.push(t))}function re(){Qt.inBatch++}function oe(){if(0==--Qt.inBatch){pe();for(var t=Qt.pendingUnobservations,e=0;e<t.length;e++){var n=t[e];n.isPendingUnobservation=!1,0===n.observers.size&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBecomeUnobserved()),n instanceof Ut&&n.suspend())}Qt.pendingUnobservations=[]}}function ie(t){var e=Qt.trackingDerivation;return null!==e?(e.runId!==t.lastAccessedBy&&(t.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=t,t.isBeingObserved||(t.isBeingObserved=!0,t.onBecomeObserved())),!0):(0===t.observers.size&&Qt.inBatch>0&&ne(t),!1)}function ae(t,e){if(console.log("[mobx.trace] '"+t.name+"' is invalidated due to a change in: '"+e.name+"'"),t.isTracing===mt.BREAK){var n=[];se(je(t),n,1),new Function("debugger;\n/*\nTracing '"+t.name+"'\n\nYou are entering this break point because derivation '"+t.name+"' is being traced and '"+e.name+"' is now forcing it to update.\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\n\n"+(t instanceof Ut?t.derivation.toString().replace(/[*]\//g,"/"):"")+"\n\nThe dependencies for this derivation are:\n\n"+n.join("\n")+"\n*/\n ")()}}function se(t,e,n){e.length>=1e3?e.push("(and many more)"):(e.push(""+new Array(n).join("\t")+t.name),t.dependencies&&t.dependencies.forEach((function(t){return se(t,e,n+1)})))}var ue=function(){function t(t,e,n,r){void 0===t&&(t="Reaction@"+A()),void 0===r&&(r=!1),this.name=t,this.onInvalidate=e,this.errorHandler=n,this.requiresObservable=r,this.observing=[],this.newObserving=[],this.dependenciesState=gt.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+A(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=mt.NONE}return t.prototype.onBecomeStale=function(){this.schedule()},t.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,Qt.pendingReactions.push(this),pe())},t.prototype.isScheduled=function(){return this._isScheduled},t.prototype.runReaction=function(){if(!this.isDisposed){if(re(),this._isScheduled=!1,Ot(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending}catch(t){this.reportExceptionInDerivation(t)}}oe()}},t.prototype.track=function(t){if(!this.isDisposed){re(),this._isRunning=!0;var e=St(this,t,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&At(this),wt(e)&&this.reportExceptionInDerivation(e.cause),oe()}},t.prototype.reportExceptionInDerivation=function(t){var e=this;if(this.errorHandler)this.errorHandler(t,this);else{if(Qt.disableErrorBoundaries)throw t;var n="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";Qt.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(n,t),Qt.globalReactionErrorHandlers.forEach((function(n){return n(t,e)}))}},t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(re(),At(this),oe()))},t.prototype.getDisposer=function(){var t=this.dispose.bind(this);return t[G]=this,t},t.prototype.toString=function(){return"Reaction["+this.name+"]"},t.prototype.trace=function(t){void 0===t&&(t=!1),Qe(this,t)},t}();var le=100,ce=function(t){return t()};function pe(){Qt.inBatch>0||Qt.isRunningReactions||ce(de)}function de(){Qt.isRunningReactions=!0;for(var t=Qt.pendingReactions,e=0;t.length>0;){++e===le&&(console.error("Reaction doesn't converge to a stable state after "+le+" iterations. Probably there is a cycle in the reactive function: "+t[0]),t.splice(0));for(var n=t.splice(0),r=0,o=n.length;r<o;r++)n[r].runReaction()}Qt.isRunningReactions=!1}var he=k("Reaction",ue);function fe(t){var e=ce;ce=function(n){return t((function(){return e(n)}))}}function ye(t){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}function ve(){P(!1)}function ge(t){return function(e,n,r){if(r){if(r.value)return{value:Lt(t,r.value),enumerable:!1,configurable:!0,writable:!0};var o=r.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return Lt(t,o.call(this))}}}return function(t){return function(e,n,r){Object.defineProperty(e,n,{configurable:!0,enumerable:!1,get:function(){},set:function(e){I(this,n,me(t,e))}})}}(t).apply(this,arguments)}}var me=function(t,e,n,r){return 1===arguments.length&&"function"==typeof t?Lt(t.name||"<unnamed action>",t):2===arguments.length&&"function"==typeof e?Lt(t,e):1===arguments.length&&"string"==typeof t?ge(t):!0!==r?ge(e).apply(null,arguments):void I(t,e,Lt(t.name||e,n.value,this))};function _e(t,e){"string"==typeof t||t.name;return Bt(0,"function"==typeof t?t:e,this,void 0)}function be(t,e,n){I(t,e,Lt(e,n.bind(t)))}function xe(t,e){void 0===e&&(e=S);var n,r=e&&e.name||t.name||"Autorun@"+A();if(!e.scheduler&&!e.delay)n=new ue(r,(function(){this.track(a)}),e.onError,e.requiresObservable);else{var o=we(e),i=!1;n=new ue(r,(function(){i||(i=!0,o((function(){i=!1,n.isDisposed||n.track(a)})))}),e.onError,e.requiresObservable)}function a(){t(n)}return n.schedule(),n.getDisposer()}me.bound=function(t,e,n,r){return!0===r?(be(t,e,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return be(this,e,n.value||n.initializer.call(this)),this[e]},set:ve}:{enumerable:!1,configurable:!0,set:function(t){be(this,e,t)},get:function(){}}};var Ee=function(t){return t()};function we(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:Ee}function Oe(t,e,n){void 0===n&&(n=S);var r,o,i,a=n.name||"Reaction@"+A(),s=me(a,n.onError?(r=n.onError,o=e,function(){try{return o.apply(this,arguments)}catch(t){r.call(this,t)}}):e),u=!n.scheduler&&!n.delay,l=we(n),c=!0,p=!1,d=n.compareStructural?Y.structural:n.equals||Y.default,h=new ue(a,(function(){c||u?f():p||(p=!0,l(f))}),n.onError,n.requiresObservable);function f(){if(p=!1,!h.isDisposed){var e=!1;h.track((function(){var n=t(h);e=c||!d(i,n),i=n})),c&&n.fireImmediately&&s(i,h),c||!0!==e||s(i,h),c&&(c=!1)}}return h.schedule(),h.getDisposer()}function Me(t,e,n){return Ae("onBecomeObserved",t,e,n)}function Se(t,e,n){return Ae("onBecomeUnobserved",t,e,n)}function Ae(t,e,n,r){var o="function"==typeof r?jn(e,n):jn(e),i="function"==typeof r?r:n,a=t+"Listeners";return o[a]?o[a].add(i):o[a]=new Set([i]),"function"!=typeof o[t]?P(!1):function(){var t=o[a];t&&(t.delete(i),0===t.size&&delete o[a])}}function Pe(t){var e=t.enforceActions,n=t.computedRequiresReaction,r=t.computedConfigurable,o=t.disableErrorBoundaries,i=t.reactionScheduler,a=t.reactionRequiresObservable,s=t.observableRequiresReaction;if(!0===t.isolateGlobalState&&((Qt.pendingReactions.length||Qt.inBatch||Qt.isRunningReactions)&&P("isolateGlobalState should be called before MobX is running any reactions"),$t=!0,Jt&&(0==--Zt().__mobxInstanceCount&&(Zt().__mobxGlobals=void 0),Qt=new Kt)),void 0!==e){var u=void 0;switch(e){case!0:case"observed":u=!0;break;case!1:case"never":u=!1;break;case"strict":case"always":u="strict";break;default:P("Invalid value for 'enforceActions': '"+e+"', expected 'never', 'always' or 'observed'")}Qt.enforceActions=u,Qt.allowStateChanges=!0!==u&&"strict"!==u}void 0!==n&&(Qt.computedRequiresReaction=!!n),void 0!==a&&(Qt.reactionRequiresObservable=!!a),void 0!==s&&(Qt.observableRequiresReaction=!!s,Qt.allowStateReads=!Qt.observableRequiresReaction),void 0!==r&&(Qt.computedConfigurable=!!r),void 0!==o&&(!0===o&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),Qt.disableErrorBoundaries=!!o),i&&fe(i)}function Ne(t,e,n,r){var o=Te(r=ut(r));return nt(t),Sn(t,r.name,o.enhancer),e&&De(t,e,n,o),t}function Te(t){return t.defaultDecorator||(!1===t.deep?pt:lt)}function De(t,e,n,r){var o,i;re();try{var a=X(e);try{for(var s=q(a),u=s.next();!u.done;u=s.next()){var l=u.value,c=Object.getOwnPropertyDescriptor(e,l);0;var p=n&&l in n?n[l]:c.get?_t:r;0;var d=p(t,l,c,!0);d&&Object.defineProperty(t,l,d)}}catch(t){o={error:t}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}}finally{oe()}}function je(t,e){return Ce(jn(t,e))}function Ce(t){var e,n,r={name:t.name};return t.observing&&t.observing.length>0&&(r.dependencies=(e=t.observing,n=[],e.forEach((function(t){-1===n.indexOf(t)&&n.push(t)})),n).map(Ce)),r}function Ie(t){var e={name:t.name};return function(t){return t.observers&&t.observers.size>0}(t)&&(e.observers=Array.from(function(t){return t.observers}(t)).map(Ie)),e}var ke=0;function Re(){this.message="FLOW_CANCELLED"}function Le(t){"function"==typeof t.cancel&&t.cancel()}function Be(t,e){if(null==t)return!1;if(void 0!==e){if(!1===Dn(t))return!1;if(!t[G].values.has(e))return!1;var n=jn(t,e);return Yt(n)}return Yt(t)}function ze(t){return arguments.length>1?P(!1):Be(t)}function He(t,e){return"string"!=typeof e?P(!1):Be(t,e)}function Xe(t,e){return null!=t&&(void 0!==e?!!Dn(t)&&t[G].values.has(e):Dn(t)||!!t[G]||F(t)||he(t)||Yt(t))}function Ge(t){return 1!==arguments.length&&P(!1),Xe(t)}function We(t){return Dn(t)?t[G].getKeys():xn(t)||On(t)?Array.from(t.keys()):gn(t)?t.map((function(t,e){return e})):P(!1)}function Fe(t){return Dn(t)?We(t).map((function(e){return t[e]})):xn(t)?We(t).map((function(e){return t.get(e)})):On(t)?Array.from(t.values()):gn(t)?t.slice():P(!1)}function Ue(t){return Dn(t)?We(t).map((function(e){return[e,t[e]]})):xn(t)?We(t).map((function(e){return[e,t.get(e)]})):On(t)?Array.from(t.entries()):gn(t)?t.map((function(t,e){return[e,t]})):P(!1)}function Ye(t,e,n){if(2!==arguments.length||On(t))if(Dn(t)){var r=t[G];r.values.get(e)?r.write(e,n):r.addObservableProp(e,n,r.defaultEnhancer)}else if(xn(t))t.set(e,n);else if(On(t))t.add(e);else{if(!gn(t))return P(!1);"number"!=typeof e&&(e=parseInt(e,10)),N(e>=0,"Not a valid index: '"+e+"'"),re(),e>=t.length&&(t.length=e+1),t[e]=n,oe()}else{re();var o=e;try{for(var i in o)Ye(t,i,o[i])}finally{oe()}}}function Ve(t,e){return Dn(t)?Cn(t).has(e):xn(t)||On(t)?t.has(e):gn(t)?e>=0&&e<t.length:P(!1)}function Ke(t,e,n,r){return"function"==typeof n?function(t,e,n,r){return Cn(t,e).observe(n,r)}(t,e,n,r):function(t,e,n){return Cn(t).observe(e,n)}(t,e,n)}Re.prototype=Object.create(Error.prototype);var qe={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function Ze(t,e,n,r){return r.detectCycles&&t.set(e,n),n}function Je(t,e,n){if(!e.recurseEverything&&!Ge(t))return t;if("object"!=typeof t)return t;if(null===t)return null;if(t instanceof Date)return t;if(Ft(t))return Je(t.get(),e,n);if(Ge(t)&&We(t),!0===e.detectCycles&&null!==t&&n.has(t))return n.get(t);if(gn(t)||Array.isArray(t)){var r=Ze(n,t,[],e),o=t.map((function(t){return Je(t,e,n)}));r.length=o.length;for(var i=0,a=o.length;i<a;i++)r[i]=o[i];return r}if(On(t)||Object.getPrototypeOf(t)===Set.prototype){if(!1===e.exportMapsAsObjects){var s=Ze(n,t,new Set,e);return t.forEach((function(t){s.add(Je(t,e,n))})),s}var u=Ze(n,t,[],e);return t.forEach((function(t){u.push(Je(t,e,n))})),u}if(xn(t)||Object.getPrototypeOf(t)===Map.prototype){if(!1===e.exportMapsAsObjects){var l=Ze(n,t,new Map,e);return t.forEach((function(t,r){l.set(r,Je(t,e,n))})),l}var c=Ze(n,t,{},e);return t.forEach((function(t,r){c[r]=Je(t,e,n)})),c}var p=Ze(n,t,{},e);return B(t).forEach((function(r){p[r]=Je(t[r],e,n)})),p}function $e(t,e){var n;return"boolean"==typeof e&&(e={detectCycles:e}),e||(e=qe),e.detectCycles=void 0===e.detectCycles?!0===e.recurseEverything:!0===e.detectCycles,e.detectCycles&&(n=new Map),Je(t,e,n)}function Qe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!1;"boolean"==typeof t[t.length-1]&&(n=t.pop());var r=function(t){switch(t.length){case 0:return Qt.trackingDerivation;case 1:return jn(t[0]);case 2:return jn(t[0],t[1])}}(t);if(!r)return P(!1);r.isTracing===mt.NONE&&console.log("[mobx.trace] '"+r.name+"' tracing enabled"),r.isTracing=n?mt.BREAK:mt.LOG}function tn(t,e){void 0===e&&(e=void 0),re();try{return t.apply(e)}finally{oe()}}function en(t,e,n){var r;"number"==typeof n.timeout&&(r=setTimeout((function(){if(!i[G].isDisposed){i();var t=new Error("WHEN_TIMEOUT");if(!n.onError)throw t;n.onError(t)}}),n.timeout)),n.name=n.name||"When@"+A();var o=Lt(n.name+"-effect",e),i=xe((function(e){t()&&(e.dispose(),r&&clearTimeout(r),o())}),n);return i}function nn(t){return t[G]}function rn(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t}var on={has:function(t,e){if(e===G||"constructor"===e||e===$)return!0;var n=nn(t);return rn(e)?n.has(e):e in t},get:function(t,e){if(e===G||"constructor"===e||e===$)return t[e];var n=nn(t),r=n.values.get(e);if(r instanceof W){var o=r.get();return void 0===o&&n.has(e),o}return rn(e)&&n.has(e),t[e]},set:function(t,e,n){return!!rn(e)&&(Ye(t,e,n),!0)},deleteProperty:function(t,e){return!!rn(e)&&(nn(t).remove(e),!0)},ownKeys:function(t){return nn(t).keysAtom.reportObserved(),Reflect.ownKeys(t)},preventExtensions:function(t){return P("Dynamic observable objects cannot be frozen"),!1}};function an(t){return void 0!==t.interceptors&&t.interceptors.length>0}function sn(t,e){var n=t.interceptors||(t.interceptors=[]);return n.push(e),T((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function un(t,e){var n=Nt();try{for(var r=J(t.interceptors||[]),o=0,i=r.length;o<i&&(N(!(e=r[o](e))||e.type,"Intercept handlers should return nothing or a change object"),e);o++);return e}finally{Tt(n)}}function ln(t){return void 0!==t.changeListeners&&t.changeListeners.length>0}function cn(t,e){var n=t.changeListeners||(t.changeListeners=[]);return n.push(e),T((function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}))}function pn(t,e){var n=Nt(),r=t.changeListeners;if(r){for(var o=0,i=(r=r.slice()).length;o<i;o++)r[o](e);Tt(n)}}var dn={get:function(t,e){return e===G?t[G]:"length"===e?t[G].getArrayLength():"number"==typeof e?fn.get.call(t,e):"string"!=typeof e||isNaN(e)?fn.hasOwnProperty(e)?fn[e]:t[e]:fn.get.call(t,parseInt(e))},set:function(t,e,n){return"length"===e&&t[G].setArrayLength(n),"number"==typeof e&&fn.set.call(t,e,n),"symbol"==typeof e||isNaN(e)?t[e]=n:fn.set.call(t,parseInt(e),n),!0},preventExtensions:function(t){return P("Observable arrays cannot be frozen"),!1}};var hn=function(){function t(t,e,n){this.owned=n,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new W(t||"ObservableArray@"+A()),this.enhancer=function(n,r){return e(n,r,t+"[..]")}}return t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.dehanceValues=function(t){return void 0!==this.dehancer&&t.length>0?t.map(this.dehancer):t},t.prototype.intercept=function(t){return sn(this,t)},t.prototype.observe=function(t,e){return void 0===e&&(e=!1),e&&t({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),cn(this,t)},t.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},t.prototype.setArrayLength=function(t){if("number"!=typeof t||t<0)throw new Error("[mobx.array] Out of range: "+t);var e=this.values.length;if(t!==e)if(t>e){for(var n=new Array(t-e),r=0;r<t-e;r++)n[r]=void 0;this.spliceWithArray(e,0,n)}else this.spliceWithArray(t,e-t)},t.prototype.updateArrayLength=function(t,e){if(t!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=e},t.prototype.spliceWithArray=function(t,e,n){var r=this;Mt(this.atom);var o=this.values.length;if(void 0===t?t=0:t>o?t=o:t<0&&(t=Math.max(0,o+t)),e=1===arguments.length?o-t:null==e?0:Math.max(0,Math.min(e,o-t)),void 0===n&&(n=M),an(this)){var i=un(this,{object:this.proxy,type:"splice",index:t,removedCount:e,added:n});if(!i)return M;e=i.removedCount,n=i.added}n=0===n.length?n:n.map((function(t){return r.enhancer(t,void 0)}));var a=this.spliceItemsIntoValues(t,e,n);return 0===e&&0===n.length||this.notifyArraySplice(t,n,a),this.dehanceValues(a)},t.prototype.spliceItemsIntoValues=function(t,e,n){var r;if(n.length<1e4)return(r=this.values).splice.apply(r,J([t,e],n));var o=this.values.slice(t,t+e);return this.values=this.values.slice(0,t).concat(n,this.values.slice(t+e)),o},t.prototype.notifyArrayChildUpdate=function(t,e,n){var r=!this.owned&&!1,o=ln(this),i=o||r?{object:this.proxy,type:"update",index:t,newValue:e,oldValue:n}:null;this.atom.reportChanged(),o&&pn(this,i)},t.prototype.notifyArraySplice=function(t,e,n){var r=!this.owned&&!1,o=ln(this),i=o||r?{object:this.proxy,type:"splice",index:t,removed:n,added:e,removedCount:n.length,addedCount:e.length}:null;this.atom.reportChanged(),o&&pn(this,i)},t}(),fn={intercept:function(t){return this[G].intercept(t)},observe:function(t,e){return void 0===e&&(e=!1),this[G].observe(t,e)},clear:function(){return this.splice(0)},replace:function(t){var e=this[G];return e.spliceWithArray(0,e.values.length,t)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=this[G];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray(t);case 2:return o.spliceWithArray(t,e)}return o.spliceWithArray(t,e,n)},spliceWithArray:function(t,e,n){return this[G].spliceWithArray(t,e,n)},push:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[G];return n.spliceWithArray(n.values.length,0,t),n.values.length},pop:function(){return this.splice(Math.max(this[G].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this[G];return n.spliceWithArray(0,0,t),n.values.length},reverse:function(){var t=this.slice();return t.reverse.apply(t,arguments)},sort:function(t){var e=this.slice();return e.sort.apply(e,arguments)},remove:function(t){var e=this[G],n=e.dehanceValues(e.values).indexOf(t);return n>-1&&(this.splice(n,1),!0)},get:function(t){var e=this[G];if(e){if(t<e.values.length)return e.atom.reportObserved(),e.dehanceValue(e.values[t]);console.warn("[mobx.array] Attempt to read an array index ("+t+") that is out of bounds ("+e.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},set:function(t,e){var n=this[G],r=n.values;if(t<r.length){Mt(n.atom);var o=r[t];if(an(n)){var i=un(n,{type:"update",object:n.proxy,index:t,newValue:e});if(!i)return;e=i.newValue}(e=n.enhancer(e,o))!==o&&(r[t]=e,n.notifyArrayChildUpdate(t,e,o))}else{if(t!==r.length)throw new Error("[mobx.array] Index out of bounds, "+t+" is larger than "+r.length);n.spliceWithArray(t,0,[e])}}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach((function(t){"function"==typeof Array.prototype[t]&&(fn[t]=function(){var e=this[G];e.atom.reportObserved();var n=e.dehanceValues(e.values);return n[t].apply(n,arguments)})})),["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach((function(t){"function"==typeof Array.prototype[t]&&(fn[t]=function(e,n){var r=this,o=this[G];return o.atom.reportObserved(),o.dehanceValues(o.values)[t]((function(t,o){return e.call(n,t,o,r)}),n)})})),["reduce","reduceRight"].forEach((function(t){fn[t]=function(){var e=this,n=this[G];n.atom.reportObserved();var r=arguments[0];return arguments[0]=function(t,o,i){return o=n.dehanceValue(o),r(t,o,i,e)},n.values[t].apply(n.values,arguments)}}));var yn,vn=k("ObservableArrayAdministration",hn);function gn(t){return j(t)&&vn(t[G])}var mn,_n={},bn=function(){function t(t,e,n){if(void 0===e&&(e=ot),void 0===n&&(n="ObservableMap@"+A()),this.enhancer=e,this.name=n,this[yn]=_n,this._keysAtom=U(this.name+".keys()"),this[Symbol.toStringTag]="Map","function"!=typeof Map)throw new Error("mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js");this._data=new Map,this._hasMap=new Map,this.merge(t)}return t.prototype._has=function(t){return this._data.has(t)},t.prototype.has=function(t){var e=this;if(!Qt.trackingDerivation)return this._has(t);var n=this._hasMap.get(t);if(!n){var r=n=new Wt(this._has(t),it,this.name+"."+z(t)+"?",!1);this._hasMap.set(t,r),Se(r,(function(){return e._hasMap.delete(t)}))}return n.get()},t.prototype.set=function(t,e){var n=this._has(t);if(an(this)){var r=un(this,{type:n?"update":"add",object:this,newValue:e,name:t});if(!r)return this;e=r.newValue}return n?this._updateValue(t,e):this._addValue(t,e),this},t.prototype.delete=function(t){var e=this;if((Mt(this._keysAtom),an(this))&&!(r=un(this,{type:"delete",object:this,name:t})))return!1;if(this._has(t)){var n=ln(this),r=n?{type:"delete",object:this,oldValue:this._data.get(t).value,name:t}:null;return tn((function(){e._keysAtom.reportChanged(),e._updateHasMapEntry(t,!1),e._data.get(t).setNewValue(void 0),e._data.delete(t)})),n&&pn(this,r),!0}return!1},t.prototype._updateHasMapEntry=function(t,e){var n=this._hasMap.get(t);n&&n.setNewValue(e)},t.prototype._updateValue=function(t,e){var n=this._data.get(t);if((e=n.prepareNewValue(e))!==Qt.UNCHANGED){var r=ln(this),o=r?{type:"update",object:this,oldValue:n.value,name:t,newValue:e}:null;false,n.setNewValue(e),r&&pn(this,o)}},t.prototype._addValue=function(t,e){var n=this;Mt(this._keysAtom),tn((function(){var r=new Wt(e,n.enhancer,n.name+"."+z(t),!1);n._data.set(t,r),e=r.value,n._updateHasMapEntry(t,!0),n._keysAtom.reportChanged()}));var r=ln(this);r&&pn(this,r?{type:"add",object:this,name:t,newValue:e}:null)},t.prototype.get=function(t){return this.has(t)?this.dehanceValue(this._data.get(t).get()):this.dehanceValue(void 0)},t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},t.prototype.values=function(){var t=this,e=this.keys();return Hn({next:function(){var n=e.next(),r=n.done,o=n.value;return{done:r,value:r?void 0:t.get(o)}}})},t.prototype.entries=function(){var t=this,e=this.keys();return Hn({next:function(){var n=e.next(),r=n.done,o=n.value;return{done:r,value:r?void 0:[o,t.get(o)]}}})},t.prototype[(yn=G,Symbol.iterator)]=function(){return this.entries()},t.prototype.forEach=function(t,e){var n,r;try{for(var o=q(this),i=o.next();!i.done;i=o.next()){var a=Z(i.value,2),s=a[0],u=a[1];t.call(e,u,s,this)}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},t.prototype.merge=function(t){var e=this;return xn(t)&&(t=t.toJS()),tn((function(){var n=Xt(!0);try{C(t)?B(t).forEach((function(n){return e.set(n,t[n])})):Array.isArray(t)?t.forEach((function(t){var n=Z(t,2),r=n[0],o=n[1];return e.set(r,o)})):R(t)?(t.constructor!==Map&&P("Cannot initialize from classes that inherit from Map: "+t.constructor.name),t.forEach((function(t,n){return e.set(n,t)}))):null!=t&&P("Cannot initialize map from "+t)}finally{Gt(n)}})),this},t.prototype.clear=function(){var t=this;tn((function(){Pt((function(){var e,n;try{for(var r=q(t.keys()),o=r.next();!o.done;o=r.next()){var i=o.value;t.delete(i)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}))}))},t.prototype.replace=function(t){var e=this;return tn((function(){var n,r,o,i,a=function(t){if(R(t)||xn(t))return t;if(Array.isArray(t))return new Map(t);if(C(t)){var e=new Map;for(var n in t)e.set(n,t[n]);return e}return P("Cannot convert to map from '"+t+"'")}(t),s=new Map,u=!1;try{for(var l=q(e._data.keys()),c=l.next();!c.done;c=l.next()){var p=c.value;if(!a.has(p))if(e.delete(p))u=!0;else{var d=e._data.get(p);s.set(p,d)}}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}try{for(var h=q(a.entries()),f=h.next();!f.done;f=h.next()){var y=Z(f.value,2),v=(p=y[0],d=y[1],e._data.has(p));if(e.set(p,d),e._data.has(p)){var g=e._data.get(p);s.set(p,g),v||(u=!0)}}}catch(t){o={error:t}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}if(!u)if(e._data.size!==s.size)e._keysAtom.reportChanged();else for(var m=e._data.keys(),_=s.keys(),b=m.next(),x=_.next();!b.done;){if(b.value!==x.value){e._keysAtom.reportChanged();break}b=m.next(),x=_.next()}e._data=s})),this},Object.defineProperty(t.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.toPOJO=function(){var t,e,n={};try{for(var r=q(this),o=r.next();!o.done;o=r.next()){var i=Z(o.value,2),a=i[0],s=i[1];n["symbol"==typeof a?a:z(a)]=s}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},t.prototype.toJS=function(){return new Map(this)},t.prototype.toJSON=function(){return this.toPOJO()},t.prototype.toString=function(){var t=this;return this.name+"[{ "+Array.from(this.keys()).map((function(e){return z(e)+": "+t.get(e)})).join(", ")+" }]"},t.prototype.observe=function(t,e){return cn(this,t)},t.prototype.intercept=function(t){return sn(this,t)},t}(),xn=k("ObservableMap",bn),En={},wn=function(){function t(t,e,n){if(void 0===e&&(e=ot),void 0===n&&(n="ObservableSet@"+A()),this.name=n,this[mn]=En,this._data=new Set,this._atom=U(this.name),this[Symbol.toStringTag]="Set","function"!=typeof Set)throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(t,r){return e(t,r,n)},t&&this.replace(t)}return t.prototype.dehanceValue=function(t){return void 0!==this.dehancer?this.dehancer(t):t},t.prototype.clear=function(){var t=this;tn((function(){Pt((function(){var e,n;try{for(var r=q(t._data.values()),o=r.next();!o.done;o=r.next()){var i=o.value;t.delete(i)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}}))}))},t.prototype.forEach=function(t,e){var n,r;try{for(var o=q(this),i=o.next();!i.done;i=o.next()){var a=i.value;t.call(e,a,a,this)}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),t.prototype.add=function(t){var e=this;if((Mt(this._atom),an(this))&&!(r=un(this,{type:"add",object:this,newValue:t})))return this;if(!this.has(t)){tn((function(){e._data.add(e.enhancer(t,void 0)),e._atom.reportChanged()}));var n=ln(this),r=n?{type:"add",object:this,newValue:t}:null;n&&pn(this,r)}return this},t.prototype.delete=function(t){var e=this;if(an(this)&&!(r=un(this,{type:"delete",object:this,oldValue:t})))return!1;if(this.has(t)){var n=ln(this),r=n?{type:"delete",object:this,oldValue:t}:null;return tn((function(){e._atom.reportChanged(),e._data.delete(t)})),n&&pn(this,r),!0}return!1},t.prototype.has=function(t){return this._atom.reportObserved(),this._data.has(this.dehanceValue(t))},t.prototype.entries=function(){var t=0,e=Array.from(this.keys()),n=Array.from(this.values());return Hn({next:function(){var r=t;return t+=1,r<n.length?{value:[e[r],n[r]],done:!1}:{done:!0}}})},t.prototype.keys=function(){return this.values()},t.prototype.values=function(){this._atom.reportObserved();var t=this,e=0,n=Array.from(this._data.values());return Hn({next:function(){return e<n.length?{value:t.dehanceValue(n[e++]),done:!1}:{done:!0}}})},t.prototype.replace=function(t){var e=this;return On(t)&&(t=t.toJS()),tn((function(){var n=Xt(!0);try{Array.isArray(t)||L(t)?(e.clear(),t.forEach((function(t){return e.add(t)}))):null!=t&&P("Cannot initialize set from "+t)}finally{Gt(n)}})),this},t.prototype.observe=function(t,e){return cn(this,t)},t.prototype.intercept=function(t){return sn(this,t)},t.prototype.toJS=function(){return new Set(this)},t.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},t.prototype[(mn=G,Symbol.iterator)]=function(){return this.values()},t}(),On=k("ObservableSet",wn),Mn=function(){function t(t,e,n,r){void 0===e&&(e=new Map),this.target=t,this.values=e,this.name=n,this.defaultEnhancer=r,this.keysAtom=new W(n+".keys")}return t.prototype.read=function(t){return this.values.get(t).get()},t.prototype.write=function(t,e){var n=this.target,r=this.values.get(t);if(r instanceof Ut)r.set(e);else{if(an(this)){if(!(i=un(this,{type:"update",object:this.proxy||n,name:t,newValue:e})))return;e=i.newValue}if((e=r.prepareNewValue(e))!==Qt.UNCHANGED){var o=ln(this),i=o?{type:"update",object:this.proxy||n,oldValue:r.value,name:t,newValue:e}:null;false,r.setNewValue(e),o&&pn(this,i)}}},t.prototype.has=function(t){var e=this.pendingKeys||(this.pendingKeys=new Map),n=e.get(t);if(n)return n.get();var r=!!this.values.get(t);return n=new Wt(r,it,this.name+"."+z(t)+"?",!1),e.set(t,n),n.get()},t.prototype.addObservableProp=function(t,e,n){void 0===n&&(n=this.defaultEnhancer);var r=this.target;if(an(this)){var o=un(this,{object:this.proxy||r,name:t,type:"add",newValue:e});if(!o)return;e=o.newValue}var i=new Wt(e,n,this.name+"."+z(t),!1);this.values.set(t,i),e=i.value,Object.defineProperty(r,t,function(t){return An[t]||(An[t]={configurable:!0,enumerable:!0,get:function(){return this[G].read(t)},set:function(e){this[G].write(t,e)}})}(t)),this.notifyPropertyAddition(t,e)},t.prototype.addComputedProp=function(t,e,n){var r=this.target;n.name=n.name||this.name+"."+z(e),this.values.set(e,new Ut(n)),(t===r||function(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!n||!1!==n.configurable&&!1!==n.writable}(t,e))&&Object.defineProperty(t,e,function(t){return Pn[t]||(Pn[t]={configurable:Qt.computedConfigurable,enumerable:!1,get:function(){return Nn(this).read(t)},set:function(e){Nn(this).write(t,e)}})}(e))},t.prototype.remove=function(t){if(this.values.has(t)){var e=this.target;if(an(this))if(!(s=un(this,{object:this.proxy||e,name:t,type:"remove"})))return;try{re();var n=ln(this),r=!1,o=this.values.get(t),i=o&&o.get();if(o&&o.set(void 0),this.keysAtom.reportChanged(),this.values.delete(t),this.pendingKeys){var a=this.pendingKeys.get(t);a&&a.set(!1)}delete this.target[t];var s=n?{type:"remove",object:this.proxy||e,oldValue:i,name:t}:null;r,n&&pn(this,s)}finally{oe()}}},t.prototype.illegalAccess=function(t,e){console.warn("Property '"+e+"' of '"+t+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},t.prototype.observe=function(t,e){return cn(this,t)},t.prototype.intercept=function(t){return sn(this,t)},t.prototype.notifyPropertyAddition=function(t,e){var n=ln(this),r=n?{type:"add",object:this.proxy||this.target,name:t,newValue:e}:null;if(n&&pn(this,r),this.pendingKeys){var o=this.pendingKeys.get(t);o&&o.set(!0)}this.keysAtom.reportChanged()},t.prototype.getKeys=function(){var t,e;this.keysAtom.reportObserved();var n=[];try{for(var r=q(this.values),o=r.next();!o.done;o=r.next()){var i=Z(o.value,2),a=i[0];i[1]instanceof Wt&&n.push(a)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},t}();function Sn(t,e,n){if(void 0===e&&(e=""),void 0===n&&(n=ot),Object.prototype.hasOwnProperty.call(t,G))return t[G];C(t)||(e=(t.constructor.name||"ObservableObject")+"@"+A()),e||(e="ObservableObject@"+A());var r=new Mn(t,new Map,z(e),n);return I(t,G,r),r}var An=Object.create(null),Pn=Object.create(null);function Nn(t){var e=t[G];return e||(nt(t),t[G])}var Tn=k("ObservableObjectAdministration",Mn);function Dn(t){return!!j(t)&&(nt(t),Tn(t[G]))}function jn(t,e){if("object"==typeof t&&null!==t){if(gn(t))return void 0!==e&&P(!1),t[G].atom;if(On(t))return t[G];if(xn(t)){var n=t;return void 0===e?n._keysAtom:((r=n._data.get(e)||n._hasMap.get(e))||P(!1),r)}var r;if(nt(t),e&&!t[G]&&t[e],Dn(t))return e?((r=t[G].values.get(e))||P(!1),r):P(!1);if(F(t)||Yt(t)||he(t))return t}else if("function"==typeof t&&he(t[G]))return t[G];return P(!1)}function Cn(t,e){return t||P("Expecting some object"),void 0!==e?Cn(jn(t,e)):F(t)||Yt(t)||he(t)||xn(t)||On(t)?t:(nt(t),t[G]?t[G]:void P(!1))}function In(t,e){return(void 0!==e?jn(t,e):Dn(t)||xn(t)||On(t)?Cn(t):jn(t)).name}var kn=Object.prototype.toString;function Rn(t,e,n){return void 0===n&&(n=-1),Ln(t,e,n)}function Ln(t,e,n,r,o){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;if("function"!==i&&"object"!==i&&"object"!=typeof e)return!1;var a=kn.call(t);if(a!==kn.call(e))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(t)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":n>=0&&n++}t=Bn(t),e=Bn(e);var s="[object Array]"===a;if(!s){if("object"!=typeof t||"object"!=typeof e)return!1;var u=t.constructor,l=e.constructor;if(u!==l&&!("function"==typeof u&&u instanceof u&&"function"==typeof l&&l instanceof l)&&"constructor"in t&&"constructor"in e)return!1}if(0===n)return!1;n<0&&(n=-1),o=o||[];for(var c=(r=r||[]).length;c--;)if(r[c]===t)return o[c]===e;if(r.push(t),o.push(e),s){if((c=t.length)!==e.length)return!1;for(;c--;)if(!Ln(t[c],e[c],n-1,r,o))return!1}else{var p=Object.keys(t),d=void 0;if(c=p.length,Object.keys(e).length!==c)return!1;for(;c--;)if(!zn(e,d=p[c])||!Ln(t[d],e[d],n-1,r,o))return!1}return r.pop(),o.pop(),!0}function Bn(t){return gn(t)?t.slice():R(t)||xn(t)||L(t)||On(t)?Array.from(t.entries()):t}function zn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Hn(t){return t[Symbol.iterator]=Xn,t}function Xn(){return this}if("undefined"==typeof Proxy||"undefined"==typeof Symbol)throw new Error("[mobx] MobX 5+ requires Proxy and Symbol objects. If your environment doesn't support Symbol or Proxy objects, please downgrade to MobX 4. For React Native Android, consider upgrading JSCore.");"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:ye,extras:{getDebugName:In},$mobx:G});var Gn=Object.freeze({__proto__:null,$mobx:G,FlowCancellationError:Re,get IDerivationState(){return gt},ObservableMap:bn,ObservableSet:wn,Reaction:ue,_allowStateChanges:function(t,e){var n,r=Xt(t);try{n=e()}finally{Gt(r)}return n},_allowStateChangesInsideComputed:function(t){var e,n=Qt.computationDepth;Qt.computationDepth=0;try{e=t()}finally{Qt.computationDepth=n}return e},_allowStateReadsEnd:jt,_allowStateReadsStart:Dt,_endAction:Ht,_getAdministration:Cn,_getGlobalState:function(){return Qt},_interceptReads:function(t,e,n){var r;if(xn(t)||gn(t)||Ft(t))r=Cn(t);else{if(!Dn(t))return P(!1);if("string"!=typeof e)return P(!1);r=Cn(t,e)}return void 0!==r.dehancer?P(!1):(r.dehancer="function"==typeof e?e:n,function(){r.dehancer=void 0})},_isComputingDerivation:function(){return null!==Qt.trackingDerivation},_resetGlobalState:function(){var t=new Kt;for(var e in t)-1===Vt.indexOf(e)&&(Qt[e]=t[e]);Qt.allowStateChanges=!Qt.enforceActions},_startAction:zt,action:me,autorun:xe,comparer:Y,computed:xt,configure:Pe,createAtom:U,decorate:function(t,e){var n="function"==typeof t?t.prototype:t,r=function(t){var r=e[t];Array.isArray(r)||(r=[r]);var o=Object.getOwnPropertyDescriptor(n,t),i=r.reduce((function(e,r){return r(n,t,e)}),o);i&&Object.defineProperty(n,t,i)};for(var o in e)r(o);return t},entries:Ue,extendObservable:Ne,flow:function(t){1!==arguments.length&&P("Flow expects 1 argument and cannot be used as decorator");var e=t.name||"<unnamed flow>";return function(){var n,r=arguments,o=++ke,i=me(e+" - runid: "+o+" - init",t).apply(this,r),a=void 0,s=new Promise((function(t,r){var s=0;function u(t){var n;a=void 0;try{n=me(e+" - runid: "+o+" - yield "+s++,i.next).call(i,t)}catch(t){return r(t)}c(n)}function l(t){var n;a=void 0;try{n=me(e+" - runid: "+o+" - yield "+s++,i.throw).call(i,t)}catch(t){return r(t)}c(n)}function c(e){if(!e||"function"!=typeof e.then)return e.done?t(e.value):(a=Promise.resolve(e.value)).then(u,l);e.then(c,r)}n=r,u(void 0)}));return s.cancel=me(e+" - runid: "+o+" - cancel",(function(){try{a&&Le(a);var t=i.return(void 0),e=Promise.resolve(t.value);e.then(D,D),Le(e),n(new Re)}catch(t){n(t)}})),s}},get:function(t,e){if(Ve(t,e))return Dn(t)?t[e]:xn(t)?t.get(e):gn(t)?t[e]:P(!1)},getAtom:jn,getDebugName:In,getDependencyTree:je,getObserverTree:function(t,e){return Ie(jn(t,e))},has:Ve,intercept:function(t,e,n){return"function"==typeof n?function(t,e,n){return Cn(t,e).intercept(n)}(t,e,n):function(t,e){return Cn(t).intercept(e)}(t,e)},isAction:function(t){return"function"==typeof t&&!0===t.isMobxAction},isArrayLike:function(t){return Array.isArray(t)||gn(t)},isBoxedObservable:Ft,isComputed:ze,isComputedProp:He,isFlowCancellationError:function(t){return t instanceof Re},isObservable:Ge,isObservableArray:gn,isObservableMap:xn,isObservableObject:Dn,isObservableProp:function(t,e){return"string"!=typeof e?P(!1):Xe(t,e)},isObservableSet:On,keys:We,observable:yt,observe:Ke,onBecomeObserved:Me,onBecomeUnobserved:Se,onReactionError:function(t){return Qt.globalReactionErrorHandlers.push(t),function(){var e=Qt.globalReactionErrorHandlers.indexOf(t);e>=0&&Qt.globalReactionErrorHandlers.splice(e,1)}},reaction:Oe,remove:function(t,e){if(Dn(t))t[G].remove(e);else if(xn(t))t.delete(e);else if(On(t))t.delete(e);else{if(!gn(t))return P(!1);"number"!=typeof e&&(e=parseInt(e,10)),N(e>=0,"Not a valid index: '"+e+"'"),t.splice(e,1)}},runInAction:_e,set:Ye,spy:ye,toJS:$e,trace:Qe,transaction:tn,untracked:Pt,values:Fe,when:function(t,e,n){return 1===arguments.length||e&&"object"==typeof e?function(t,e){var n,r=new Promise((function(r,o){var i=en(t,r,K(K({},e),{onError:o}));n=function(){i(),o("WHEN_CANCELLED")}}));return r.cancel=n,r}(t,e):en(t,e,n||{})}}),Wn=b(Gn);!function(t,e){!function(t,e,n){function r(t){return!(t.prototype&&t.prototype.render||e.Component.isPrototypeOf(t))}function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.prefix,r=void 0===n?"":n,o=e.suffix,i=void 0===o?"":o;return r+(t.displayName||t.name||t.constructor&&t.constructor.name||"<component>")+i}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},s=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),u=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},l=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},c=!1,p=console;function d(t){c=t}function h(t){var e=n._getGlobalState().allowStateChanges;return n._getGlobalState().allowStateChanges=t,e}function f(t){n._getGlobalState().allowStateChanges=t}function y(t,e,n,r,o){var i=h(t),a=void 0;try{a=e(n,r,o)}finally{f(i)}return a}function v(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t[e],o=m[e],i=r?!0===n?function(){o.apply(this,arguments),r.apply(this,arguments)}:function(){r.apply(this,arguments),o.apply(this,arguments)}:o;t[e]=i}function g(t,e){if(null==t||null==e||"object"!==(void 0===t?"undefined":i(t))||"object"!==(void 0===e?"undefined":i(e)))return t!==e;var n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(var r=void 0,o=n.length-1;r=n[o];o--)if(e[r]!==t[r])return!0;return!1}var m={componentWillMount:function(){var t=this;if(!0!==c){var r=o(this),i=!1,a=!1;h.call(this,"props"),h.call(this,"state");var s=this.render.bind(this),u=null,l=!1,p=function(){return(u=new n.Reaction(r+".render()",(function(){if(!l&&(l=!0,"function"==typeof t.componentWillReact&&t.componentWillReact(),!0!==t.__$mobxIsUnmounted)){var n=!0;try{a=!0,i||e.Component.prototype.forceUpdate.call(t),n=!1}finally{a=!1,n&&u.dispose()}}}))).reactComponent=t,d.$mobx=u,t.render=d,d(t.props,t.state,t.context)},d=function(t,e,n){l=!1;var r=void 0,o=void 0;if(u.track((function(){try{o=y(!1,s,t,e,n)}catch(t){r=t}})),r)throw r;return o};this.render=p}function h(t){var e=this[t],r=n.createAtom("reactive "+t);Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get:function(){return r.reportObserved(),e},set:function(t){!a&&g(e,t)?(e=t,i=!0,r.reportChanged(),i=!1):e=t}})}},componentWillUnmount:function(){!0!==c&&(this.render.$mobx&&this.render.$mobx.dispose(),this.__$mobxIsUnmounted=!0)},componentDidMount:function(){},componentDidUpdate:function(){},shouldComponentUpdate:function(t,e){return c&&p.warn("[mobx-preact] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==e||g(this.props,t)}};function b(t){var n,i;if(arguments.length>1&&p.warn('Mobx observer: Using observer to inject stores is not supported. Use `@connect(["store1", "store2"]) ComponentClass instead or preferably, use `@inject("store1", "store2") @observer ComponentClass` or `inject("store1", "store2")(observer(componentClass))``'),!0===t.isMobxInjector&&p.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),r(t))return b((i=n=function(e){function n(){return a(this,n),l(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return u(n,e),s(n,[{key:"render",value:function(){return t.call(this,this.props,this.context)}}]),n}(e.Component),n.displayName=o(t),i));if(!t)throw new Error("Please pass a valid component to 'observer'");return x(t.prototype||t),t.isMobXReactObserver=!0,t}function x(t){v(t,"componentWillMount",!0),v(t,"componentDidMount"),t.shouldComponentUpdate||(t.shouldComponentUpdate=m.shouldComponentUpdate)}var E=b((function(t){return t.children[0]()}));function w(t,e){return t(e={exports:{}},e.exports),e.exports}E.displayName="Observer","undefined"!=typeof window?window:void 0!==_||"undefined"!=typeof self&&self;var O=w((function(t,e){!function(e,n){t.exports=n()}(0,(function(){var t={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},e={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},n=Object.defineProperty,r=Object.getOwnPropertyNames,o=Object.getOwnPropertySymbols,i=Object.getOwnPropertyDescriptor,a=Object.getPrototypeOf,s=a&&a(Object);return function u(l,c,p){if("string"!=typeof c){if(s){var d=a(c);d&&d!==s&&u(l,d,p)}var h=r(c);o&&(h=h.concat(o(c)));for(var f=0;f<h.length;++f){var y=h[f];if(!(t[y]||e[y]||p&&p[y])){var v=i(c,y);try{n(l,y,v)}catch(t){}}}return l}return l}}))})),M={isMobxInjector:{value:!0,writable:!0,configurable:!0,enumerable:!0}};function S(t,n,r){var i,c,p=o(n,{prefix:"inject-",suffix:r?"-with-"+r:""}),d=(c=i=function(r){function o(){return a(this,o),l(this,(o.__proto__||Object.getPrototypeOf(o)).apply(this,arguments))}return u(o,r),s(o,[{key:"render",value:function(){var r={};for(var o in this.props)this.props.hasOwnProperty(o)&&(r[o]=this.props[o]);var i=t(this.context.mobxStores||{},r,this.context)||{};for(var a in i)r[a]=i[a];return e.h(n,r)}}]),o}(e.Component),i.displayName=p,c);return O(d,n),d.wrappedComponent=n,Object.defineProperties(d,M),d}function A(t){return function(e,n){return t.forEach((function(t){if(!(t in n)){if(!(t in e))throw new Error("MobX injector: Store '"+t+"' is not available! Make sure it is provided by some Provider");n[t]=e[t]}})),n}}function P(){var t=void 0;if("function"==typeof arguments[0])return t=arguments[0],function(e){var n=S(t,e);return n.isMobxInjector=!1,(n=b(n)).isMobxInjector=!0,n};for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t=A(e),function(n){return S(t,n,e.join("-"))}}function N(t,e){if("string"==typeof t)throw new Error("Store names should be provided as array");return Array.isArray(t)?e?P.apply(null,t)(N(e)):function(e){return N(t,e)}:b(t)}var T={children:!0,key:!0,ref:!0},D=console,j=function(t){function n(){return a(this,n),l(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return u(n,t),s(n,[{key:"render",value:function(t){var n=t.children;return n.length>1?e.h("div",null," ",n," "):n[0]}},{key:"getChildContext",value:function(){var t={},e=this.context.mobxStores;if(e)for(var n in e)t[n]=e[n];for(var r in this.props)T[r]||"suppressChangedStoreWarning"===r||(t[r]=this.props[r]);return{mobxStores:t}}},{key:"componentWillReceiveProps",value:function(t){if(Object.keys(t).length!==Object.keys(this.props).length&&D.warn("MobX Provider: The set of provided stores has changed. Please avoid changing stores as the change might not propagate to all children"),!t.suppressChangedStoreWarning)for(var e in t)T[e]||this.props[e]===t[e]||D.warn("MobX Provider: Provided store '"+e+"' has changed. Please avoid replacing stores as the change might not propagate to all children")}}]),n}(e.Component);if(!e.Component)throw new Error("mobx-preact requires Preact to be available");t.observer=b,t.Observer=E,t.useStaticRendering=d,t.connect=N,t.inject=P,t.Provider=j,Object.defineProperty(t,"__esModule",{value:!0})}(e,function(){if(x)return w;x=1;var t,e,n,r,o,i,a,s,u,l,c,p,d={},h=[],f=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function v(t,e){for(var n in e)t[n]=e[n];return t}function g(t){var e=t.parentNode;e&&e.removeChild(t)}function m(e,n,r){var o,i,a,s={};for(a in n)"key"==a?o=n[a]:"ref"==a?i=n[a]:s[a]=n[a];if(arguments.length>2&&(s.children=arguments.length>3?t.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return _(e,s,o,i,null)}function _(t,r,o,i,a){var s={type:t,props:r,key:o,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++n:a,__i:-1,__u:0};return null==a&&null!=e.vnode&&e.vnode(s),s}function b(t){return t.children}function E(t,e){this.props=t,this.context=e}function O(t,e){if(null==e)return t.__?O(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?O(t):null}function M(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return M(t)}}function S(t){(!t.__d&&(t.__d=!0)&&o.push(t)&&!A.__r++||i!==e.debounceRendering)&&((i=e.debounceRendering)||a)(A)}function A(){var t,n,r,i,a,u,l,c;for(o.sort(s);t=o.shift();)t.__d&&(n=o.length,i=void 0,u=(a=(r=t).__v).__e,l=[],c=[],r.__P&&((i=v({},a)).__v=a.__v+1,e.vnode&&e.vnode(i),k(r.__P,i,a,r.__n,r.__P.namespaceURI,32&a.__u?[u]:null,l,null==u?O(a):u,!!(32&a.__u),c),i.__v=a.__v,i.__.__k[i.__i]=i,R(l,i,c),i.__e!=u&&M(i)),o.length>n&&o.sort(s));A.__r=0}function P(t,e,n,r,o,i,a,s,u,l,c){var p,f,y,v,g,m=r&&r.__k||h,_=e.length;for(n.__d=u,N(n,e,m),u=n.__d,p=0;p<_;p++)null!=(y=n.__k[p])&&"boolean"!=typeof y&&"function"!=typeof y&&(f=-1===y.__i?d:m[y.__i]||d,y.__i=p,k(t,y,f,o,i,a,s,u,l,c),v=y.__e,y.ref&&f.ref!=y.ref&&(f.ref&&B(f.ref,null,y),c.push(y.ref,y.__c||v,y)),null==g&&null!=v&&(g=v),65536&y.__u||f.__k===y.__k?(u&&!u.isConnected&&(u=O(f)),u=T(y,u,t)):"function"==typeof y.type&&void 0!==y.__d?u=y.__d:v&&(u=v.nextSibling),y.__d=void 0,y.__u&=-196609);n.__d=u,n.__e=g}function N(t,e,n){var r,o,i,a,s,u=e.length,l=n.length,c=l,p=0;for(t.__k=[],r=0;r<u;r++)a=r+p,null!=(o=t.__k[r]=null==(o=e[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?_(null,o,null,null,null):y(o)?_(b,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?_(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=t,o.__b=t.__b+1,s=D(o,n,a,c),o.__i=s,i=null,-1!==s&&(c--,(i=n[s])&&(i.__u|=131072)),null==i||null===i.__v?(-1==s&&p--,"function"!=typeof o.type&&(o.__u|=65536)):s!==a&&(s===a+1?p++:s>a?c>u-a?p+=s-a:p--:s<a?s==a-1&&(p=s-a):p=0,s!==r+p&&(o.__u|=65536))):(i=n[a])&&null==i.key&&i.__e&&0==(131072&i.__u)&&(i.__e==t.__d&&(t.__d=O(i)),z(i,i,!1),n[a]=null,c--);if(c)for(r=0;r<l;r++)null!=(i=n[r])&&0==(131072&i.__u)&&(i.__e==t.__d&&(t.__d=O(i)),z(i,i))}function T(t,e,n){var r,o;if("function"==typeof t.type){for(r=t.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=t,e=T(r[o],e,n));return e}t.__e!=e&&(n.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8===e.nodeType);return e}function D(t,e,n,r){var o=t.key,i=t.type,a=n-1,s=n+1,u=e[n];if(null===u||u&&o==u.key&&i===u.type&&0==(131072&u.__u))return n;if(r>(null!=u&&0==(131072&u.__u)?1:0))for(;a>=0||s<e.length;){if(a>=0){if((u=e[a])&&0==(131072&u.__u)&&o==u.key&&i===u.type)return a;a--}if(s<e.length){if((u=e[s])&&0==(131072&u.__u)&&o==u.key&&i===u.type)return s;s++}}return-1}function j(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||f.test(e)?n:n+"px"}function C(t,e,n,r,o){var i;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||j(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||j(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])i=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t||"onFocusOut"===e||"onFocusIn"===e?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.t=r.t:(n.t=u,t.addEventListener(e,i?c:l,i)):t.removeEventListener(e,i?c:l,i);else{if("http://www.w3.org/2000/svg"==o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function I(t){return function(n){if(this.l){var r=this.l[n.type+t];if(null==n.u)n.u=u++;else if(n.u<r.t)return;return r(e.event?e.event(n):n)}}}function k(t,n,r,o,i,a,s,u,l,c){var p,d,h,f,g,m,_,x,w,O,M,S,A,N,T,D=n.type;if(void 0!==n.constructor)return null;128&r.__u&&(l=!!(32&r.__u),a=[u=n.__e=r.__e]),(p=e.__b)&&p(n);t:if("function"==typeof D)try{if(x=n.props,w=(p=D.contextType)&&o[p.__c],O=p?w?w.props.value:p.__:o,r.__c?_=(d=n.__c=r.__c).__=d.__E:("prototype"in D&&D.prototype.render?n.__c=d=new D(x,O):(n.__c=d=new E(x,O),d.constructor=D,d.render=H),w&&w.sub(d),d.props=x,d.state||(d.state={}),d.context=O,d.__n=o,h=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=D.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=v({},d.__s)),v(d.__s,D.getDerivedStateFromProps(x,d.__s))),f=d.props,g=d.state,d.__v=n,h)null==D.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==D.getDerivedStateFromProps&&x!==f&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(x,O),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(x,d.__s,O)||n.__v===r.__v)){for(n.__v!==r.__v&&(d.props=x,d.state=d.__s,d.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.forEach((function(t){t&&(t.__=n)})),M=0;M<d._sb.length;M++)d.__h.push(d._sb[M]);d._sb=[],d.__h.length&&s.push(d);break t}null!=d.componentWillUpdate&&d.componentWillUpdate(x,d.__s,O),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(f,g,m)}))}if(d.context=O,d.props=x,d.__P=t,d.__e=!1,S=e.__r,A=0,"prototype"in D&&D.prototype.render){for(d.state=d.__s,d.__d=!1,S&&S(n),p=d.render(d.props,d.state,d.context),N=0;N<d._sb.length;N++)d.__h.push(d._sb[N]);d._sb=[]}else do{d.__d=!1,S&&S(n),p=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++A<25);d.state=d.__s,null!=d.getChildContext&&(o=v(v({},o),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(m=d.getSnapshotBeforeUpdate(f,g)),P(t,y(T=null!=p&&p.type===b&&null==p.key?p.props.children:p)?T:[T],n,r,o,i,a,s,u,l,c),d.base=n.__e,n.__u&=-161,d.__h.length&&s.push(d),_&&(d.__E=d.__=null)}catch(t){n.__v=null,l||null!=a?(n.__e=u,n.__u|=l?160:32,a[a.indexOf(u)]=null):(n.__e=r.__e,n.__k=r.__k),e.__e(t,n,r)}else null==a&&n.__v===r.__v?(n.__k=r.__k,n.__e=r.__e):n.__e=L(r.__e,n,r,o,i,a,s,l,c);(p=e.diffed)&&p(n)}function R(t,n,r){n.__d=void 0;for(var o=0;o<r.length;o++)B(r[o],r[++o],r[++o]);e.__c&&e.__c(n,t),t.some((function(n){try{t=n.__h,n.__h=[],t.some((function(t){t.call(n)}))}catch(t){e.__e(t,n.__v)}}))}function L(e,n,r,o,i,a,s,u,l){var c,p,h,f,v,m,_,b=r.props,x=n.props,E=n.type;if("svg"===E?i="http://www.w3.org/2000/svg":"math"===E?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=a)for(c=0;c<a.length;c++)if((v=a[c])&&"setAttribute"in v==!!E&&(E?v.localName===E:3===v.nodeType)){e=v,a[c]=null;break}if(null==e){if(null===E)return document.createTextNode(x);e=document.createElementNS(i,E,x.is&&x),a=null,u=!1}if(null===E)b===x||u&&e.data===x||(e.data=x);else{if(a=a&&t.call(e.childNodes),b=r.props||d,!u&&null!=a)for(b={},c=0;c<e.attributes.length;c++)b[(v=e.attributes[c]).name]=v.value;for(c in b)if(v=b[c],"children"==c);else if("dangerouslySetInnerHTML"==c)h=v;else if("key"!==c&&!(c in x)){if("value"==c&&"defaultValue"in x||"checked"==c&&"defaultChecked"in x)continue;C(e,c,null,v,i)}for(c in x)v=x[c],"children"==c?f=v:"dangerouslySetInnerHTML"==c?p=v:"value"==c?m=v:"checked"==c?_=v:"key"===c||u&&"function"!=typeof v||b[c]===v||C(e,c,v,b[c],i);if(p)u||h&&(p.__html===h.__html||p.__html===e.innerHTML)||(e.innerHTML=p.__html),n.__k=[];else if(h&&(e.innerHTML=""),P(e,y(f)?f:[f],n,r,o,"foreignObject"===E?"http://www.w3.org/1999/xhtml":i,a,s,a?a[0]:r.__k&&O(r,0),u,l),null!=a)for(c=a.length;c--;)null!=a[c]&&g(a[c]);u||(c="value",void 0!==m&&(m!==e[c]||"progress"===E&&!m||"option"===E&&m!==b[c])&&C(e,c,m,b[c],i),c="checked",void 0!==_&&_!==e[c]&&C(e,c,_,b[c],i))}return e}function B(t,n,r){try{"function"==typeof t?t(n):t.current=n}catch(t){e.__e(t,r)}}function z(t,n,r){var o,i;if(e.unmount&&e.unmount(t),(o=t.ref)&&(o.current&&o.current!==t.__e||B(o,null,n)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){e.__e(t,n)}o.base=o.__P=null}if(o=t.__k)for(i=0;i<o.length;i++)o[i]&&z(o[i],n,r||"function"!=typeof t.type);r||null==t.__e||g(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function H(t,e,n){return this.constructor(t,n)}function X(n,r,o){var i,a,s,u;e.__&&e.__(n,r),a=(i="function"==typeof o)?null:o&&o.__k||r.__k,s=[],u=[],k(r,n=(!i&&o||r).__k=m(b,null,[n]),a||d,d,r.namespaceURI,!i&&o?[o]:a?null:r.firstChild?t.call(r.childNodes):null,s,!i&&o?o:a?a.__e:r.firstChild,i,u),R(s,n,u)}return t=h.slice,e={__e:function(t,e,n,r){for(var o,i,a;e=e.__;)if((o=e.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(t)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(t,r||{}),a=o.__d),a)return o.__E=o}catch(e){t=e}throw t}},n=0,r=function(t){return null!=t&&null==t.constructor},E.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=v({},this.state),"function"==typeof t&&(t=t(v({},n),this.props)),t&&v(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),S(this))},E.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),S(this))},E.prototype.render=b,o=[],a="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,s=function(t,e){return t.__v.__b-e.__v.__b},A.__r=0,u=0,l=I(!1),c=I(!0),p=0,w.Component=E,w.Fragment=b,w.cloneElement=function(e,n,r){var o,i,a,s,u=v({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),n)"key"==a?o=n[a]:"ref"==a?i=n[a]:u[a]=void 0===n[a]&&void 0!==s?s[a]:n[a];return arguments.length>2&&(u.children=arguments.length>3?t.call(arguments,2):r),_(e.type,u,o||e.key,i||e.ref,null)},w.createContext=function(t,e){var n={__c:e="__cC"+p++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var n,r;return this.getChildContext||(n=[],(r={})[e]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&n.some((function(t){t.__e=!0,S(t)}))},this.sub=function(t){n.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n.splice(n.indexOf(t),1),e&&e.call(t)}}),t.children}};return n.Provider.__=n.Consumer.contextType=n},w.createElement=m,w.createRef=function(){return{current:null}},w.h=m,w.hydrate=function t(e,n){X(e,n,t)},w.isValidElement=r,w.options=e,w.render=X,w.toChildArray=function t(e,n){return n=n||[],null==e||"boolean"==typeof e||(y(e)?e.some((function(e){t(e,n)})):n.push(e)),n},w}(),Wn)}(0,E);var Fn,Un,Yn,Vn,Kn,qn,Zn,Jn,$n,Qn,tr={},er=[],nr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,rr=Array.isArray;function or(t,e){for(var n in e)t[n]=e[n];return t}function ir(t){var e=t.parentNode;e&&e.removeChild(t)}function ar(t,e,n){var r,o,i,a={};for(i in e)"key"==i?r=e[i]:"ref"==i?o=e[i]:a[i]=e[i];if(arguments.length>2&&(a.children=arguments.length>3?Fn.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(i in t.defaultProps)void 0===a[i]&&(a[i]=t.defaultProps[i]);return sr(t,a,r,o,null)}function sr(t,e,n,r,o){var i={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==o?++Yn:o,__i:-1,__u:0};return null==o&&null!=Un.vnode&&Un.vnode(i),i}function ur(t){return t.children}function lr(t,e){this.props=t,this.context=e}function cr(t,e){if(null==e)return t.__?cr(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?cr(t):null}function pr(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return pr(t)}}function dr(t){(!t.__d&&(t.__d=!0)&&Vn.push(t)&&!hr.__r++||Kn!==Un.debounceRendering)&&((Kn=Un.debounceRendering)||qn)(hr)}function hr(){var t,e,n,r,o,i,a,s;for(Vn.sort(Zn);t=Vn.shift();)t.__d&&(e=Vn.length,r=void 0,i=(o=(n=t).__v).__e,a=[],s=[],n.__P&&((r=or({},o)).__v=o.__v+1,Un.vnode&&Un.vnode(r),Er(n.__P,r,o,n.__n,n.__P.namespaceURI,32&o.__u?[i]:null,a,null==i?cr(o):i,!!(32&o.__u),s),r.__v=o.__v,r.__.__k[r.__i]=r,wr(a,r,s),r.__e!=i&&pr(r)),Vn.length>e&&Vn.sort(Zn));hr.__r=0}function fr(t,e,n,r,o,i,a,s,u,l,c){var p,d,h,f,y,v=r&&r.__k||er,g=e.length;for(n.__d=u,yr(n,e,v),u=n.__d,p=0;p<g;p++)null!=(h=n.__k[p])&&"boolean"!=typeof h&&"function"!=typeof h&&(d=-1===h.__i?tr:v[h.__i]||tr,h.__i=p,Er(t,h,d,o,i,a,s,u,l,c),f=h.__e,h.ref&&d.ref!=h.ref&&(d.ref&&Mr(d.ref,null,h),c.push(h.ref,h.__c||f,h)),null==y&&null!=f&&(y=f),65536&h.__u||d.__k===h.__k?(u&&!u.isConnected&&(u=cr(d)),u=vr(h,u,t)):"function"==typeof h.type&&void 0!==h.__d?u=h.__d:f&&(u=f.nextSibling),h.__d=void 0,h.__u&=-196609);n.__d=u,n.__e=y}function yr(t,e,n){var r,o,i,a,s,u=e.length,l=n.length,c=l,p=0;for(t.__k=[],r=0;r<u;r++)a=r+p,null!=(o=t.__k[r]=null==(o=e[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?sr(null,o,null,null,null):rr(o)?sr(ur,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?sr(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=t,o.__b=t.__b+1,s=mr(o,n,a,c),o.__i=s,i=null,-1!==s&&(c--,(i=n[s])&&(i.__u|=131072)),null==i||null===i.__v?(-1==s&&p--,"function"!=typeof o.type&&(o.__u|=65536)):s!==a&&(s===a+1?p++:s>a?c>u-a?p+=s-a:p--:s<a?s==a-1&&(p=s-a):p=0,s!==r+p&&(o.__u|=65536))):(i=n[a])&&null==i.key&&i.__e&&0==(131072&i.__u)&&(i.__e==t.__d&&(t.__d=cr(i)),Sr(i,i,!1),n[a]=null,c--);if(c)for(r=0;r<l;r++)null!=(i=n[r])&&0==(131072&i.__u)&&(i.__e==t.__d&&(t.__d=cr(i)),Sr(i,i))}function vr(t,e,n){var r,o;if("function"==typeof t.type){for(r=t.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=t,e=vr(r[o],e,n));return e}t.__e!=e&&(n.insertBefore(t.__e,e||null),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8===e.nodeType);return e}function gr(t,e){return e=e||[],null==t||"boolean"==typeof t||(rr(t)?t.some((function(t){gr(t,e)})):e.push(t)),e}function mr(t,e,n,r){var o=t.key,i=t.type,a=n-1,s=n+1,u=e[n];if(null===u||u&&o==u.key&&i===u.type&&0==(131072&u.__u))return n;if(r>(null!=u&&0==(131072&u.__u)?1:0))for(;a>=0||s<e.length;){if(a>=0){if((u=e[a])&&0==(131072&u.__u)&&o==u.key&&i===u.type)return a;a--}if(s<e.length){if((u=e[s])&&0==(131072&u.__u)&&o==u.key&&i===u.type)return s;s++}}return-1}function _r(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||nr.test(e)?n:n+"px"}function br(t,e,n,r,o){var i;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof r&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||_r(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||_r(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])i=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t||"onFocusOut"===e||"onFocusIn"===e?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r?n.u=r.u:(n.u=Jn,t.addEventListener(e,i?Qn:$n,i)):t.removeEventListener(e,i?Qn:$n,i);else{if("http://www.w3.org/2000/svg"==o)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function xr(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e.t)e.t=Jn++;else if(e.t<n.u)return;return n(Un.event?Un.event(e):e)}}}function Er(t,e,n,r,o,i,a,s,u,l){var c,p,d,h,f,y,v,g,m,_,b,x,E,w,O,M=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(u=!!(32&n.__u),i=[s=e.__e=n.__e]),(c=Un.__b)&&c(e);t:if("function"==typeof M)try{if(g=e.props,m=(c=M.contextType)&&r[c.__c],_=c?m?m.props.value:c.__:r,n.__c?v=(p=e.__c=n.__c).__=p.__E:("prototype"in M&&M.prototype.render?e.__c=p=new M(g,_):(e.__c=p=new lr(g,_),p.constructor=M,p.render=Ar),m&&m.sub(p),p.props=g,p.state||(p.state={}),p.context=_,p.__n=r,d=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=M.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=or({},p.__s)),or(p.__s,M.getDerivedStateFromProps(g,p.__s))),h=p.props,f=p.state,p.__v=e,d)null==M.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==M.getDerivedStateFromProps&&g!==h&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(g,_),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(g,p.__s,_)||e.__v===n.__v)){for(e.__v!==n.__v&&(p.props=g,p.state=p.__s,p.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),b=0;b<p._sb.length;b++)p.__h.push(p._sb[b]);p._sb=[],p.__h.length&&a.push(p);break t}null!=p.componentWillUpdate&&p.componentWillUpdate(g,p.__s,_),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(h,f,y)}))}if(p.context=_,p.props=g,p.__P=t,p.__e=!1,x=Un.__r,E=0,"prototype"in M&&M.prototype.render){for(p.state=p.__s,p.__d=!1,x&&x(e),c=p.render(p.props,p.state,p.context),w=0;w<p._sb.length;w++)p.__h.push(p._sb[w]);p._sb=[]}else do{p.__d=!1,x&&x(e),c=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++E<25);p.state=p.__s,null!=p.getChildContext&&(r=or(or({},r),p.getChildContext())),d||null==p.getSnapshotBeforeUpdate||(y=p.getSnapshotBeforeUpdate(h,f)),fr(t,rr(O=null!=c&&c.type===ur&&null==c.key?c.props.children:c)?O:[O],e,n,r,o,i,a,s,u,l),p.base=e.__e,e.__u&=-161,p.__h.length&&a.push(p),v&&(p.__E=p.__=null)}catch(t){e.__v=null,u||null!=i?(e.__e=s,e.__u|=u?160:32,i[i.indexOf(s)]=null):(e.__e=n.__e,e.__k=n.__k),Un.__e(t,e,n)}else null==i&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=Or(n.__e,e,n,r,o,i,a,u,l);(c=Un.diffed)&&c(e)}function wr(t,e,n){e.__d=void 0;for(var r=0;r<n.length;r++)Mr(n[r],n[++r],n[++r]);Un.__c&&Un.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){Un.__e(t,e.__v)}}))}function Or(t,e,n,r,o,i,a,s,u){var l,c,p,d,h,f,y,v=n.props,g=e.props,m=e.type;if("svg"===m?o="http://www.w3.org/2000/svg":"math"===m?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=i)for(l=0;l<i.length;l++)if((h=i[l])&&"setAttribute"in h==!!m&&(m?h.localName===m:3===h.nodeType)){t=h,i[l]=null;break}if(null==t){if(null===m)return document.createTextNode(g);t=document.createElementNS(o,m,g.is&&g),i=null,s=!1}if(null===m)v===g||s&&t.data===g||(t.data=g);else{if(i=i&&Fn.call(t.childNodes),v=n.props||tr,!s&&null!=i)for(v={},l=0;l<t.attributes.length;l++)v[(h=t.attributes[l]).name]=h.value;for(l in v)if(h=v[l],"children"==l);else if("dangerouslySetInnerHTML"==l)p=h;else if("key"!==l&&!(l in g)){if("value"==l&&"defaultValue"in g||"checked"==l&&"defaultChecked"in g)continue;br(t,l,null,h,o)}for(l in g)h=g[l],"children"==l?d=h:"dangerouslySetInnerHTML"==l?c=h:"value"==l?f=h:"checked"==l?y=h:"key"===l||s&&"function"!=typeof h||v[l]===h||br(t,l,h,v[l],o);if(c)s||p&&(c.__html===p.__html||c.__html===t.innerHTML)||(t.innerHTML=c.__html),e.__k=[];else if(p&&(t.innerHTML=""),fr(t,rr(d)?d:[d],e,n,r,"foreignObject"===m?"http://www.w3.org/1999/xhtml":o,i,a,i?i[0]:n.__k&&cr(n,0),s,u),null!=i)for(l=i.length;l--;)null!=i[l]&&ir(i[l]);s||(l="value",void 0!==f&&(f!==t[l]||"progress"===m&&!f||"option"===m&&f!==v[l])&&br(t,l,f,v[l],o),l="checked",void 0!==y&&y!==t[l]&&br(t,l,y,v[l],o))}return t}function Mr(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){Un.__e(t,n)}}function Sr(t,e,n){var r,o;if(Un.unmount&&Un.unmount(t),(r=t.ref)&&(r.current&&r.current!==t.__e||Mr(r,null,e)),null!=(r=t.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(t){Un.__e(t,e)}r.base=r.__P=null}if(r=t.__k)for(o=0;o<r.length;o++)r[o]&&Sr(r[o],e,n||"function"!=typeof t.type);n||null==t.__e||ir(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function Ar(t,e,n){return this.constructor(t,n)}function Pr(t,e,n){var r,o,i,a;Un.__&&Un.__(t,e),o=(r="function"==typeof n)?null:n&&n.__k||e.__k,i=[],a=[],Er(e,t=(!r&&n||e).__k=ar(ur,null,[t]),o||tr,tr,e.namespaceURI,!r&&n?[n]:o?null:e.firstChild?Fn.call(e.childNodes):null,i,!r&&n?n:o?o.__e:e.firstChild,r,a),wr(i,t,a)}Fn=er.slice,Un={__e:function(t,e,n,r){for(var o,i,a;e=e.__;)if((o=e.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(t)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(t,r||{}),a=o.__d),a)return o.__E=o}catch(e){t=e}throw t}},Yn=0,lr.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=or({},this.state),"function"==typeof t&&(t=t(or({},n),this.props)),t&&or(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),dr(this))},lr.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),dr(this))},lr.prototype.render=ur,Vn=[],qn="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Zn=function(t,e){return t.__v.__b-e.__v.__b},hr.__r=0,Jn=0,$n=xr(!1),Qn=xr(!0);var Nr,Tr,Dr,jr=[],Cr=[],Ir=Un,kr=Ir.__b,Rr=Ir.__r,Lr=Ir.diffed,Br=Ir.__c,zr=Ir.unmount,Hr=Ir.__;function Xr(){for(var t;t=jr.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Fr),t.__H.__h.forEach(Ur),t.__H.__h=[]}catch(e){t.__H.__h=[],Ir.__e(e,t.__v)}}Ir.__b=function(t){Nr=null,kr&&kr(t)},Ir.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Hr&&Hr(t,e)},Ir.__r=function(t){Rr&&Rr(t);var e=(Nr=t.__c).__H;e&&(Tr===Nr?(e.__h=[],Nr.__h=[],e.__.forEach((function(t){t.__N&&(t.__=t.__N),t.__V=Cr,t.__N=t.i=void 0}))):(e.__h.forEach(Fr),e.__h.forEach(Ur),e.__h=[])),Tr=Nr},Ir.diffed=function(t){Lr&&Lr(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==jr.push(e)&&Dr===Ir.requestAnimationFrame||((Dr=Ir.requestAnimationFrame)||Wr)(Xr)),e.__H.__.forEach((function(t){t.i&&(t.__H=t.i),t.__V!==Cr&&(t.__=t.__V),t.i=void 0,t.__V=Cr}))),Tr=Nr=null},Ir.__c=function(t,e){e.some((function(t){try{t.__h.forEach(Fr),t.__h=t.__h.filter((function(t){return!t.__||Ur(t)}))}catch(n){e.some((function(t){t.__h&&(t.__h=[])})),e=[],Ir.__e(n,t.__v)}})),Br&&Br(t,e)},Ir.unmount=function(t){zr&&zr(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach((function(t){try{Fr(t)}catch(t){e=t}})),n.__H=void 0,e&&Ir.__e(e,n.__v))};var Gr="function"==typeof requestAnimationFrame;function Wr(t){var e,n=function(){clearTimeout(r),Gr&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,100);Gr&&(e=requestAnimationFrame(n))}function Fr(t){var e=Nr,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),Nr=e}function Ur(t){var e=Nr;t.__c=t.__(),Nr=e}function Yr(t,e){for(var n in t)if("__source"!==n&&!(n in e))return!0;for(var r in e)if("__source"!==r&&t[r]!==e[r])return!0;return!1}function Vr(t,e){this.props=t,this.context=e}(Vr.prototype=new lr).isPureReactComponent=!0,Vr.prototype.shouldComponentUpdate=function(t,e){return Yr(this.props,t)||Yr(this.state,e)};var Kr=Un.__b;Un.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),Kr&&Kr(t)};var qr=Un.__e;Un.__e=function(t,e,n,r){if(t.then)for(var o,i=e;i=i.__;)if((o=i.__c)&&o.__c)return null==e.__e&&(e.__e=n.__e,e.__k=n.__k),o.__c(t,e);qr(t,e,n,r)};var Zr=Un.unmount;function Jr(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(t){"function"==typeof t.__c&&t.__c()})),t.__c.__H=null),null!=(t=function(t,e){for(var n in e)t[n]=e[n];return t}({},t)).__c&&(t.__c.__P===n&&(t.__c.__P=e),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return Jr(t,e,n)}))),t}function $r(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return $r(t,e,n)})),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=n)),t}function Qr(){this.__u=0,this.t=null,this.__b=null}function to(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function eo(){this.u=null,this.o=null}Un.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),Zr&&Zr(t)},(Qr.prototype=new lr).__c=function(t,e){var n=e.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=to(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(s):s())};n.__R=a;var s=function(){if(! --r.__u){if(r.state.__a){var t=r.state.__a;r.__v.__k[0]=$r(t,t.__c.__P,t.__c.__O)}var e;for(r.setState({__a:r.__b=null});e=r.t.pop();)e.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),t.then(a,a)},Qr.prototype.componentWillUnmount=function(){this.t=[]},Qr.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Jr(this.__b,n,r.__O=r.__P)}this.__b=null}var o=e.__a&&ar(ur,null,t.fallback);return o&&(o.__u&=-33),[ar(ur,null,e.__a?null:t.children),o]};var no=function(t,e,n){if(++n[1]===n[0]&&t.o.delete(e),t.props.revealOrder&&("t"!==t.props.revealOrder[0]||!t.o.size))for(n=t.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.u=n=n[2]}};(eo.prototype=new lr).__a=function(t){var e=this,n=to(e.__v),r=e.o.get(t);return r[0]++,function(o){var i=function(){e.props.revealOrder?(r.push(o),no(e,t,r)):o()};n?n(i):i()}},eo.prototype.render=function(t){this.u=null,this.o=new Map;var e=gr(t.children);t.revealOrder&&"b"===t.revealOrder[0]&&e.reverse();for(var n=e.length;n--;)this.o.set(e[n],this.u=[1,0,this.u]);return t.children},eo.prototype.componentDidUpdate=eo.prototype.componentDidMount=function(){var t=this;this.o.forEach((function(e,n){no(t,n,e)}))};var ro="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,oo=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,io=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,ao=/[A-Z0-9]/g,so="undefined"!=typeof document,uo=function(t){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(t)};lr.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(t){Object.defineProperty(lr.prototype,t,{configurable:!0,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}));var lo=Un.event;function co(){}function po(){return this.cancelBubble}function ho(){return this.defaultPrevented}Un.event=function(t){return lo&&(t=lo(t)),t.persist=co,t.isPropagationStopped=po,t.isDefaultPrevented=ho,t.nativeEvent=t};var fo={enumerable:!1,configurable:!0,get:function(){return this.class}},yo=Un.vnode;Un.vnode=function(t){"string"==typeof t.type&&function(t){var e=t.props,n=t.type,r={};for(var o in e){var i=e[o];if(!("value"===o&&"defaultValue"in e&&null==i||so&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var a=o.toLowerCase();"defaultValue"===o&&"value"in e&&null==e.value?o="value":"download"===o&&!0===i?i="":"translate"===a&&"no"===i?i=!1:"ondoubleclick"===a?o="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||uo(e.type)?"onfocus"===a?o="onfocusin":"onblur"===a?o="onfocusout":io.test(o)?o=a:-1===n.indexOf("-")&&oo.test(o)?o=o.replace(ao,"-$&").toLowerCase():null===i&&(i=void 0):a=o="oninput","oninput"===a&&r[o=a]&&(o="oninputCapture"),r[o]=i}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=gr(e.children).forEach((function(t){t.props.selected=-1!=r.value.indexOf(t.props.value)}))),"select"==n&&null!=r.defaultValue&&(r.value=gr(e.children).forEach((function(t){t.props.selected=r.multiple?-1!=r.defaultValue.indexOf(t.props.value):r.defaultValue==t.props.value}))),e.class&&!e.className?(r.class=e.class,Object.defineProperty(r,"className",fo)):(e.className&&!e.class||e.class&&e.className)&&(r.class=r.className=e.className),t.props=r}(t),t.$$typeof=ro,yo&&yo(t)};var vo=Un.__r;Un.__r=function(t){vo&&vo(t),t.__c};var go=Un.diffed;Un.diffed=function(t){go&&go(t);var e=t.props,n=t.__e;null!=n&&"textarea"===t.type&&"value"in e&&e.value!==n.value&&(n.value=null==e.value?"":e.value)};var mo=0;function _o(t,e,n,r,o,i){e||(e={});var a,s,u=e;if("ref"in u)for(s in u={},e)"ref"==s?a=e[s]:u[s]=e[s];var l={type:t,props:u,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--mo,__i:-1,__u:0,__source:o,__self:i};if("function"==typeof t&&(a=t.defaultProps))for(s in a)void 0===u[s]&&(u[s]=a[s]);return Un.vnode&&Un.vnode(l),l}var bo="object"==typeof global&&global&&global.Object===Object&&global,xo="object"==typeof self&&self&&self.Object===Object&&self,Eo=bo||xo||Function("return this")(),wo=Eo.Symbol,Oo=Object.prototype,Mo=Oo.hasOwnProperty,So=Oo.toString,Ao=wo?wo.toStringTag:void 0;var Po=Object.prototype.toString;var No="[object Null]",To="[object Undefined]",Do=wo?wo.toStringTag:void 0;function jo(t){return null==t?void 0===t?To:No:Do&&Do in Object(t)?function(t){var e=Mo.call(t,Ao),n=t[Ao];try{t[Ao]=void 0;var r=!0}catch(t){}var o=So.call(t);return r&&(e?t[Ao]=n:delete t[Ao]),o}(t):function(t){return Po.call(t)}(t)}function Co(t){return null!=t&&"object"==typeof t}var Io="[object Symbol]";function ko(t){return"symbol"==typeof t||Co(t)&&jo(t)==Io}var Ro=NaN;function Lo(t){return"number"==typeof t?t:ko(t)?Ro:+t}function Bo(t,e){for(var n=-1,r=null==t?0:t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}var zo=Array.isArray,Ho=1/0,Xo=wo?wo.prototype:void 0,Go=Xo?Xo.toString:void 0;function Wo(t){if("string"==typeof t)return t;if(zo(t))return Bo(t,Wo)+"";if(ko(t))return Go?Go.call(t):"";var e=t+"";return"0"==e&&1/t==-Ho?"-0":e}function Fo(t,e){return function(n,r){var o;if(void 0===n&&void 0===r)return e;if(void 0!==n&&(o=n),void 0!==r){if(void 0===o)return r;"string"==typeof n||"string"==typeof r?(n=Wo(n),r=Wo(r)):(n=Lo(n),r=Lo(r)),o=t(n,r)}return o}}var Uo=Fo((function(t,e){return t+e}),0),Yo=/\s/;function Vo(t){for(var e=t.length;e--&&Yo.test(t.charAt(e)););return e}var Ko=/^\s+/;function qo(t){return t?t.slice(0,Vo(t)+1).replace(Ko,""):t}function Zo(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var Jo=NaN,$o=/^[-+]0x[0-9a-f]+$/i,Qo=/^0b[01]+$/i,ti=/^0o[0-7]+$/i,ei=parseInt;function ni(t){if("number"==typeof t)return t;if(ko(t))return Jo;if(Zo(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Zo(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=qo(t);var n=Qo.test(t);return n||ti.test(t)?ei(t.slice(2),n?2:8):$o.test(t)?Jo:+t}var ri=1/0,oi=17976931348623157e292;function ii(t){return t?(t=ni(t))===ri||t===-ri?(t<0?-1:1)*oi:t==t?t:0:0===t?t:0}function ai(t){var e=ii(t),n=e%1;return e==e?n?e-n:e:0}function si(t){return t}var ui="[object AsyncFunction]",li="[object Function]",ci="[object GeneratorFunction]",pi="[object Proxy]";function di(t){if(!Zo(t))return!1;var e=jo(t);return e==li||e==ci||e==ui||e==pi}var hi,fi=Eo["__core-js_shared__"],yi=(hi=/[^.]+$/.exec(fi&&fi.keys&&fi.keys.IE_PROTO||""))?"Symbol(src)_1."+hi:"";var vi=Function.prototype.toString;function gi(t){if(null!=t){try{return vi.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var mi=/^\[object .+?Constructor\]$/,_i=Function.prototype,bi=Object.prototype,xi=_i.toString,Ei=bi.hasOwnProperty,wi=RegExp("^"+xi.call(Ei).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Oi(t){return!(!Zo(t)||function(t){return!!yi&&yi in t}(t))&&(di(t)?wi:mi).test(gi(t))}function Mi(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return Oi(n)?n:void 0}var Si=Mi(Eo,"WeakMap"),Ai=Si&&new Si,Pi=Ai?function(t,e){return Ai.set(t,e),t}:si,Ni=Object.create,Ti=function(){function t(){}return function(e){if(!Zo(e))return{};if(Ni)return Ni(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function Di(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=Ti(t.prototype),r=t.apply(n,e);return Zo(r)?r:n}}var ji=1;function Ci(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 Ii=Math.max;function ki(t,e,n,r){for(var o=-1,i=t.length,a=n.length,s=-1,u=e.length,l=Ii(i-a,0),c=Array(u+l),p=!r;++s<u;)c[s]=e[s];for(;++o<a;)(p||o<i)&&(c[n[o]]=t[o]);for(;l--;)c[s++]=t[o++];return c}var Ri=Math.max;function Li(t,e,n,r){for(var o=-1,i=t.length,a=-1,s=n.length,u=-1,l=e.length,c=Ri(i-s,0),p=Array(c+l),d=!r;++o<c;)p[o]=t[o];for(var h=o;++u<l;)p[h+u]=e[u];for(;++a<s;)(d||o<i)&&(p[h+n[a]]=t[o++]);return p}function Bi(){}var zi=4294967295;function Hi(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=zi,this.__views__=[]}function Xi(){}Hi.prototype=Ti(Bi.prototype),Hi.prototype.constructor=Hi;var Gi=Ai?function(t){return Ai.get(t)}:Xi,Wi={},Fi=Object.prototype.hasOwnProperty;function Ui(t){for(var e=t.name+"",n=Wi[e],r=Fi.call(Wi,e)?n.length:0;r--;){var o=n[r],i=o.func;if(null==i||i==t)return o.name}return e}function Yi(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function Vi(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function Ki(t){if(t instanceof Hi)return t.clone();var e=new Yi(t.__wrapped__,t.__chain__);return e.__actions__=Vi(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}Yi.prototype=Ti(Bi.prototype),Yi.prototype.constructor=Yi;var qi=Object.prototype.hasOwnProperty;function Zi(t){if(Co(t)&&!zo(t)&&!(t instanceof Hi)){if(t instanceof Yi)return t;if(qi.call(t,"__wrapped__"))return Ki(t)}return new Yi(t)}function Ji(t){var e=Ui(t),n=Zi[e];if("function"!=typeof n||!(e in Hi.prototype))return!1;if(t===n)return!0;var r=Gi(n);return!!r&&t===r[0]}Zi.prototype=Bi.prototype,Zi.prototype.constructor=Zi;var $i=Date.now;function Qi(t){var e=0,n=0;return function(){var r=$i(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var ta=Qi(Pi),ea=/\{\n\/\* \[wrapped with (.+)\] \*/,na=/,? & /;var ra=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function oa(t){return function(){return t}}var ia=function(){try{var t=Mi(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),aa=ia?function(t,e){return ia(t,"toString",{configurable:!0,enumerable:!1,value:oa(e),writable:!0})}:si,sa=Qi(aa);function ua(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function la(t,e,n,r){for(var o=t.length,i=n+(r?1:-1);r?i--:++i<o;)if(e(t[i],i,t))return i;return-1}function ca(t){return t!=t}function pa(t,e,n){return e==e?function(t,e,n){for(var r=n-1,o=t.length;++r<o;)if(t[r]===e)return r;return-1}(t,e,n):la(t,ca,n)}function da(t,e){return!!(null==t?0:t.length)&&pa(t,e,0)>-1}var ha=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];function fa(t,e,n){var r=e+"";return sa(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(ra,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return ua(ha,(function(n){var r="_."+n[0];e&n[1]&&!da(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(ea);return e?e[1].split(na):[]}(r),n)))}var ya=1,va=2,ga=4,ma=8,_a=32,ba=64;function xa(t,e,n,r,o,i,a,s,u,l){var c=e&ma;e|=c?_a:ba,(e&=~(c?ba:_a))&ga||(e&=~(ya|va));var p=[t,e,o,c?i:void 0,c?a:void 0,c?void 0:i,c?void 0:a,s,u,l],d=n.apply(void 0,p);return Ji(t)&&ta(d,p),d.placeholder=r,fa(d,t,e)}function Ea(t){return t.placeholder}var wa=9007199254740991,Oa=/^(?:0|[1-9]\d*)$/;function Ma(t,e){var n=typeof t;return!!(e=null==e?wa:e)&&("number"==n||"symbol"!=n&&Oa.test(t))&&t>-1&&t%1==0&&t<e}var Sa=Math.min;var Aa="__lodash_placeholder__";function Pa(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var a=t[n];a!==e&&a!==Aa||(t[n]=Aa,i[o++]=n)}return i}var Na=1,Ta=2,Da=8,ja=16,Ca=128,Ia=512;function ka(t,e,n,r,o,i,a,s,u,l){var c=e&Ca,p=e&Na,d=e&Ta,h=e&(Da|ja),f=e&Ia,y=d?void 0:Di(t);return function v(){for(var g=arguments.length,m=Array(g),_=g;_--;)m[_]=arguments[_];if(h)var b=Ea(v),x=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(m,b);if(r&&(m=ki(m,r,o,h)),i&&(m=Li(m,i,a,h)),g-=x,h&&g<l){var E=Pa(m,b);return xa(t,e,ka,v.placeholder,n,m,E,s,u,l-g)}var w=p?n:this,O=d?w[t]:t;return g=m.length,s?m=function(t,e){for(var n=t.length,r=Sa(e.length,n),o=Vi(t);r--;){var i=e[r];t[r]=Ma(i,n)?o[i]:void 0}return t}(m,s):f&&g>1&&m.reverse(),c&&u<g&&(m.length=u),this&&this!==Eo&&this instanceof v&&(O=y||Di(O)),O.apply(w,m)}}var Ra=1;var La="__lodash_placeholder__",Ba=1,za=2,Ha=4,Xa=8,Ga=128,Wa=256,Fa=Math.min;var Ua="Expected a function",Ya=1,Va=2,Ka=8,qa=16,Za=32,Ja=64,$a=Math.max;function Qa(t,e,n,r,o,i,a,s){var u=e&Va;if(!u&&"function"!=typeof t)throw new TypeError(Ua);var l=r?r.length:0;if(l||(e&=~(Za|Ja),r=o=void 0),a=void 0===a?a:$a(ai(a),0),s=void 0===s?s:ai(s),l-=o?o.length:0,e&Ja){var c=r,p=o;r=o=void 0}var d=u?void 0:Gi(t),h=[t,e,n,r,o,c,p,i,a,s];if(d&&function(t,e){var n=t[1],r=e[1],o=n|r,i=o<(Ba|za|Ga),a=r==Ga&&n==Xa||r==Ga&&n==Wa&&t[7].length<=e[8]||r==(Ga|Wa)&&e[7].length<=e[8]&&n==Xa;if(!i&&!a)return t;r&Ba&&(t[2]=e[2],o|=n&Ba?0:Ha);var s=e[3];if(s){var u=t[3];t[3]=u?ki(u,s,e[4]):s,t[4]=u?Pa(t[3],La):e[4]}(s=e[5])&&(u=t[5],t[5]=u?Li(u,s,e[6]):s,t[6]=u?Pa(t[5],La):e[6]),(s=e[7])&&(t[7]=s),r&Ga&&(t[8]=null==t[8]?e[8]:Fa(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=o}(h,d),t=h[0],e=h[1],n=h[2],r=h[3],o=h[4],!(s=h[9]=void 0===h[9]?u?0:t.length:$a(h[9]-l,0))&&e&(Ka|qa)&&(e&=~(Ka|qa)),e&&e!=Ya)f=e==Ka||e==qa?function(t,e,n){var r=Di(t);return function o(){for(var i=arguments.length,a=Array(i),s=i,u=Ea(o);s--;)a[s]=arguments[s];var l=i<3&&a[0]!==u&&a[i-1]!==u?[]:Pa(a,u);return(i-=l.length)<n?xa(t,e,ka,o.placeholder,void 0,a,l,void 0,void 0,n-i):Ci(this&&this!==Eo&&this instanceof o?r:t,this,a)}}(t,e,s):e!=Za&&e!=(Ya|Za)||o.length?ka.apply(void 0,h):function(t,e,n,r){var o=e&Ra,i=Di(t);return function e(){for(var a=-1,s=arguments.length,u=-1,l=r.length,c=Array(l+s),p=this&&this!==Eo&&this instanceof e?i:t;++u<l;)c[u]=r[u];for(;s--;)c[u++]=arguments[++a];return Ci(p,o?n:this,c)}}(t,e,n,r);else var f=function(t,e,n){var r=e&ji,o=Di(t);return function e(){return(this&&this!==Eo&&this instanceof e?o:t).apply(r?n:this,arguments)}}(t,e,n);return fa((d?Pi:ta)(f,h),t,e)}var ts=128;function es(t,e,n){return e=n?void 0:e,e=t&&null==e?t.length:e,Qa(t,ts,void 0,void 0,void 0,void 0,e)}function ns(t,e,n){"__proto__"==e&&ia?ia(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function rs(t,e){return t===e||t!=t&&e!=e}var os=Object.prototype.hasOwnProperty;function is(t,e,n){var r=t[e];os.call(t,e)&&rs(r,n)&&(void 0!==n||e in t)||ns(t,e,n)}function as(t,e,n,r){var o=!n;n||(n={});for(var i=-1,a=e.length;++i<a;){var s=e[i],u=r?r(n[s],t[s],s,n,t):void 0;void 0===u&&(u=t[s]),o?ns(n,s,u):is(n,s,u)}return n}var ss=Math.max;function us(t,e,n){return e=ss(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=ss(r.length-e,0),a=Array(i);++o<i;)a[o]=r[e+o];o=-1;for(var s=Array(e+1);++o<e;)s[o]=r[o];return s[e]=n(a),Ci(t,this,s)}}function ls(t,e){return sa(us(t,e,si),t+"")}var cs=9007199254740991;function ps(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=cs}function ds(t){return null!=t&&ps(t.length)&&!di(t)}function hs(t,e,n){if(!Zo(n))return!1;var r=typeof e;return!!("number"==r?ds(n)&&Ma(e,n.length):"string"==r&&e in n)&&rs(n[e],t)}function fs(t){return ls((function(e,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i=t.length>3&&"function"==typeof i?(o--,i):void 0,a&&hs(n[0],n[1],a)&&(i=o<3?void 0:i,o=1),e=Object(e);++r<o;){var s=n[r];s&&t(e,s,r,i)}return e}))}var ys=Object.prototype;function vs(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||ys)}function gs(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function ms(t){return Co(t)&&"[object Arguments]"==jo(t)}var _s=Object.prototype,bs=_s.hasOwnProperty,xs=_s.propertyIsEnumerable,Es=ms(function(){return arguments}())?ms:function(t){return Co(t)&&bs.call(t,"callee")&&!xs.call(t,"callee")};function ws(){return!1}var Os="object"==typeof t&&t&&!t.nodeType&&t,Ms=Os&&"object"==typeof module&&module&&!module.nodeType&&module,Ss=Ms&&Ms.exports===Os?Eo.Buffer:void 0,As=(Ss?Ss.isBuffer:void 0)||ws,Ps={};function Ns(t){return function(e){return t(e)}}Ps["[object Float32Array]"]=Ps["[object Float64Array]"]=Ps["[object Int8Array]"]=Ps["[object Int16Array]"]=Ps["[object Int32Array]"]=Ps["[object Uint8Array]"]=Ps["[object Uint8ClampedArray]"]=Ps["[object Uint16Array]"]=Ps["[object Uint32Array]"]=!0,Ps["[object Arguments]"]=Ps["[object Array]"]=Ps["[object ArrayBuffer]"]=Ps["[object Boolean]"]=Ps["[object DataView]"]=Ps["[object Date]"]=Ps["[object Error]"]=Ps["[object Function]"]=Ps["[object Map]"]=Ps["[object Number]"]=Ps["[object Object]"]=Ps["[object RegExp]"]=Ps["[object Set]"]=Ps["[object String]"]=Ps["[object WeakMap]"]=!1;var Ts="object"==typeof t&&t&&!t.nodeType&&t,Ds=Ts&&"object"==typeof module&&module&&!module.nodeType&&module,js=Ds&&Ds.exports===Ts&&bo.process,Cs=function(){try{var t=Ds&&Ds.require&&Ds.require("util").types;return t||js&&js.binding&&js.binding("util")}catch(t){}}(),Is=Cs&&Cs.isTypedArray,ks=Is?Ns(Is):function(t){return Co(t)&&ps(t.length)&&!!Ps[jo(t)]},Rs=Object.prototype.hasOwnProperty;function Ls(t,e){var n=zo(t),r=!n&&Es(t),o=!n&&!r&&As(t),i=!n&&!r&&!o&&ks(t),a=n||r||o||i,s=a?gs(t.length,String):[],u=s.length;for(var l in t)!e&&!Rs.call(t,l)||a&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Ma(l,u))||s.push(l);return s}function Bs(t,e){return function(n){return t(e(n))}}var zs=Bs(Object.keys,Object),Hs=Object.prototype.hasOwnProperty;function Xs(t){if(!vs(t))return zs(t);var e=[];for(var n in Object(t))Hs.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Gs(t){return ds(t)?Ls(t):Xs(t)}var Ws=Object.prototype.hasOwnProperty,Fs=fs((function(t,e){if(vs(e)||ds(e))as(e,Gs(e),t);else for(var n in e)Ws.call(e,n)&&is(t,n,e[n])}));var Us=Object.prototype.hasOwnProperty;function Ys(t){if(!Zo(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=vs(t),n=[];for(var r in t)("constructor"!=r||!e&&Us.call(t,r))&&n.push(r);return n}function Vs(t){return ds(t)?Ls(t,!0):Ys(t)}var Ks=fs((function(t,e){as(e,Vs(e),t)})),qs=fs((function(t,e,n,r){as(e,Vs(e),t,r)})),Zs=fs((function(t,e,n,r){as(e,Gs(e),t,r)})),Js=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$s=/^\w*$/;function Qs(t,e){if(zo(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ko(t))||($s.test(t)||!Js.test(t)||null!=e&&t in Object(e))}var tu=Mi(Object,"create");var eu=Object.prototype.hasOwnProperty;var nu=Object.prototype.hasOwnProperty;function ru(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 ou(t,e){for(var n=t.length;n--;)if(rs(t[n][0],e))return n;return-1}ru.prototype.clear=function(){this.__data__=tu?tu(null):{},this.size=0},ru.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ru.prototype.get=function(t){var e=this.__data__;if(tu){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return eu.call(e,t)?e[t]:void 0},ru.prototype.has=function(t){var e=this.__data__;return tu?void 0!==e[t]:nu.call(e,t)},ru.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=tu&&void 0===e?"__lodash_hash_undefined__":e,this};var iu=Array.prototype.splice;function au(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])}}au.prototype.clear=function(){this.__data__=[],this.size=0},au.prototype.delete=function(t){var e=this.__data__,n=ou(e,t);return!(n<0)&&(n==e.length-1?e.pop():iu.call(e,n,1),--this.size,!0)},au.prototype.get=function(t){var e=this.__data__,n=ou(e,t);return n<0?void 0:e[n][1]},au.prototype.has=function(t){return ou(this.__data__,t)>-1},au.prototype.set=function(t,e){var n=this.__data__,r=ou(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var su=Mi(Eo,"Map");function uu(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 lu(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])}}lu.prototype.clear=function(){this.size=0,this.__data__={hash:new ru,map:new(su||au),string:new ru}},lu.prototype.delete=function(t){var e=uu(this,t).delete(t);return this.size-=e?1:0,e},lu.prototype.get=function(t){return uu(this,t).get(t)},lu.prototype.has=function(t){return uu(this,t).has(t)},lu.prototype.set=function(t,e){var n=uu(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var cu="Expected a function";function pu(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(cu);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(pu.Cache||lu),n}pu.Cache=lu;var du=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,hu=/\\(\\)?/g,fu=function(t){var e=pu(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(du,(function(t,n,r,o){e.push(r?o.replace(hu,"$1"):n||t)})),e}));function yu(t){return null==t?"":Wo(t)}function vu(t,e){return zo(t)?t:Qs(t,e)?[t]:fu(yu(t))}var gu=1/0;function mu(t){if("string"==typeof t||ko(t))return t;var e=t+"";return"0"==e&&1/t==-gu?"-0":e}function _u(t,e){for(var n=0,r=(e=vu(e,t)).length;null!=t&&n<r;)t=t[mu(e[n++])];return n&&n==r?t:void 0}function bu(t,e,n){var r=null==t?void 0:_u(t,e);return void 0===r?n:r}function xu(t,e){for(var n=-1,r=e.length,o=Array(r),i=null==t;++n<r;)o[n]=i?void 0:bu(t,e[n]);return o}function Eu(t,e){for(var n=-1,r=e.length,o=t.length;++n<r;)t[o+n]=e[n];return t}var wu=wo?wo.isConcatSpreadable:void 0;function Ou(t){return zo(t)||Es(t)||!!(wu&&t&&t[wu])}function Mu(t,e,n,r,o){var i=-1,a=t.length;for(n||(n=Ou),o||(o=[]);++i<a;){var s=t[i];e>0&&n(s)?e>1?Mu(s,e-1,n,r,o):Eu(o,s):r||(o[o.length]=s)}return o}function Su(t){return(null==t?0:t.length)?Mu(t,1):[]}function Au(t){return sa(us(t,void 0,Su),t+"")}var Pu=Au(xu),Nu=Bs(Object.getPrototypeOf,Object),Tu="[object Object]",Du=Function.prototype,ju=Object.prototype,Cu=Du.toString,Iu=ju.hasOwnProperty,ku=Cu.call(Object);function Ru(t){if(!Co(t)||jo(t)!=Tu)return!1;var e=Nu(t);if(null===e)return!0;var n=Iu.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Cu.call(n)==ku}var Lu="[object DOMException]",Bu="[object Error]";function zu(t){if(!Co(t))return!1;var e=jo(t);return e==Bu||e==Lu||"string"==typeof t.message&&"string"==typeof t.name&&!Ru(t)}var Hu=ls((function(t,e){try{return Ci(t,void 0,e)}catch(t){return zu(t)?t:new Error(t)}})),Xu="Expected a function";function Gu(t,e){var n;if("function"!=typeof e)throw new TypeError(Xu);return t=ai(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var Wu=ls((function(t,e,n){var r=1;if(n.length){var o=Pa(n,Ea(Wu));r|=32}return Qa(t,r,e,n,o)}));Wu.placeholder={};var Fu=Au((function(t,e){return ua(e,(function(e){e=mu(e),ns(t,e,Wu(t[e],t))})),t})),Uu=ls((function(t,e,n){var r=3;if(n.length){var o=Pa(n,Ea(Uu));r|=32}return Qa(e,r,t,n,o)}));function Yu(t,e,n){var r=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r<o;)i[r]=t[r+e];return i}function Vu(t,e,n){var r=t.length;return n=void 0===n?r:n,!e&&n>=r?t:Yu(t,e,n)}Uu.placeholder={};var Ku=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function qu(t){return Ku.test(t)}var Zu="\\ud800-\\udfff",Ju="["+Zu+"]",$u="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Qu="\\ud83c[\\udffb-\\udfff]",tl="[^"+Zu+"]",el="(?:\\ud83c[\\udde6-\\uddff]){2}",nl="[\\ud800-\\udbff][\\udc00-\\udfff]",rl="(?:"+$u+"|"+Qu+")"+"?",ol="[\\ufe0e\\ufe0f]?",il=ol+rl+("(?:\\u200d(?:"+[tl,el,nl].join("|")+")"+ol+rl+")*"),al="(?:"+[tl+$u+"?",$u,el,nl,Ju].join("|")+")",sl=RegExp(Qu+"(?="+Qu+")|"+al+il,"g");function ul(t){return qu(t)?function(t){return t.match(sl)||[]}(t):function(t){return t.split("")}(t)}function ll(t){return function(e){var n=qu(e=yu(e))?ul(e):void 0,r=n?n[0]:e.charAt(0),o=n?Vu(n,1).join(""):e.slice(1);return r[t]()+o}}var cl=ll("toUpperCase");function pl(t){return cl(yu(t).toLowerCase())}function dl(t,e,n,r){var o=-1,i=null==t?0:t.length;for(r&&i&&(n=t[++o]);++o<i;)n=e(n,t[o],o,t);return n}function hl(t){return function(e){return null==t?void 0:t[e]}}var fl=hl({"À":"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"}),yl=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vl=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");function gl(t){return(t=yu(t))&&t.replace(yl,fl).replace(vl,"")}var ml=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var _l=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var bl="\\ud800-\\udfff",xl="\\u2700-\\u27bf",El="a-z\\xdf-\\xf6\\xf8-\\xff",wl="A-Z\\xc0-\\xd6\\xd8-\\xde",Ol="\\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",Ml="["+Ol+"]",Sl="\\d+",Al="["+xl+"]",Pl="["+El+"]",Nl="[^"+bl+Ol+Sl+xl+El+wl+"]",Tl="(?:\\ud83c[\\udde6-\\uddff]){2}",Dl="[\\ud800-\\udbff][\\udc00-\\udfff]",jl="["+wl+"]",Cl="(?:"+Pl+"|"+Nl+")",Il="(?:"+jl+"|"+Nl+")",kl="(?:['’](?:d|ll|m|re|s|t|ve))?",Rl="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ll="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Bl="[\\ufe0e\\ufe0f]?",zl=Bl+Ll+("(?:\\u200d(?:"+["[^"+bl+"]",Tl,Dl].join("|")+")"+Bl+Ll+")*"),Hl="(?:"+[Al,Tl,Dl].join("|")+")"+zl,Xl=RegExp([jl+"?"+Pl+"+"+kl+"(?="+[Ml,jl,"$"].join("|")+")",Il+"+"+Rl+"(?="+[Ml,jl+Cl,"$"].join("|")+")",jl+"?"+Cl+"+"+kl,jl+"+"+Rl,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Sl,Hl].join("|"),"g");function Gl(t,e,n){return t=yu(t),void 0===(e=n?void 0:e)?function(t){return _l.test(t)}(t)?function(t){return t.match(Xl)||[]}(t):function(t){return t.match(ml)||[]}(t):t.match(e)||[]}var Wl=RegExp("['’]","g");function Fl(t){return function(e){return dl(Gl(gl(e).replace(Wl,"")),t,"")}}var Ul=Fl((function(t,e,n){return e=e.toLowerCase(),t+(n?pl(e):e)}));var Yl=Eo.isFinite,Vl=Math.min;function Kl(t){var e=Math[t];return function(t,n){if(t=ni(t),(n=null==n?0:Vl(ai(n),292))&&Yl(t)){var r=(yu(t)+"e").split("e");return+((r=(yu(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var ql=Kl("ceil");function Zl(t){var e=Zi(t);return e.__chain__=!0,e}var Jl=Math.ceil,$l=Math.max;function Ql(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}function tc(t){var e=this.__data__=new au(t);this.size=e.size}function ec(t,e){return t&&as(e,Gs(e),t)}tc.prototype.clear=function(){this.__data__=new au,this.size=0},tc.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},tc.prototype.get=function(t){return this.__data__.get(t)},tc.prototype.has=function(t){return this.__data__.has(t)},tc.prototype.set=function(t,e){var n=this.__data__;if(n instanceof au){var r=n.__data__;if(!su||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new lu(r)}return n.set(t,e),this.size=n.size,this};var nc="object"==typeof t&&t&&!t.nodeType&&t,rc=nc&&"object"==typeof module&&module&&!module.nodeType&&module,oc=rc&&rc.exports===nc?Eo.Buffer:void 0,ic=oc?oc.allocUnsafe:void 0;function ac(t,e){if(e)return t.slice();var n=t.length,r=ic?ic(n):new t.constructor(n);return t.copy(r),r}function sc(t,e){for(var n=-1,r=null==t?0:t.length,o=0,i=[];++n<r;){var a=t[n];e(a,n,t)&&(i[o++]=a)}return i}function uc(){return[]}var lc=Object.prototype.propertyIsEnumerable,cc=Object.getOwnPropertySymbols,pc=cc?function(t){return null==t?[]:(t=Object(t),sc(cc(t),(function(e){return lc.call(t,e)})))}:uc;var dc=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Eu(e,pc(t)),t=Nu(t);return e}:uc;function hc(t,e,n){var r=e(t);return zo(t)?r:Eu(r,n(t))}function fc(t){return hc(t,Gs,pc)}function yc(t){return hc(t,Vs,dc)}var vc=Mi(Eo,"DataView"),gc=Mi(Eo,"Promise"),mc=Mi(Eo,"Set"),_c="[object Map]",bc="[object Promise]",xc="[object Set]",Ec="[object WeakMap]",wc="[object DataView]",Oc=gi(vc),Mc=gi(su),Sc=gi(gc),Ac=gi(mc),Pc=gi(Si),Nc=jo;(vc&&Nc(new vc(new ArrayBuffer(1)))!=wc||su&&Nc(new su)!=_c||gc&&Nc(gc.resolve())!=bc||mc&&Nc(new mc)!=xc||Si&&Nc(new Si)!=Ec)&&(Nc=function(t){var e=jo(t),n="[object Object]"==e?t.constructor:void 0,r=n?gi(n):"";if(r)switch(r){case Oc:return wc;case Mc:return _c;case Sc:return bc;case Ac:return xc;case Pc:return Ec}return e});var Tc=Nc,Dc=Object.prototype.hasOwnProperty;var jc=Eo.Uint8Array;function Cc(t){var e=new t.constructor(t.byteLength);return new jc(e).set(new jc(t)),e}var Ic=/\w*$/;var kc=wo?wo.prototype:void 0,Rc=kc?kc.valueOf:void 0;function Lc(t,e){var n=e?Cc(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var Bc="[object Boolean]",zc="[object Date]",Hc="[object Map]",Xc="[object Number]",Gc="[object RegExp]",Wc="[object Set]",Fc="[object String]",Uc="[object Symbol]",Yc="[object ArrayBuffer]",Vc="[object DataView]",Kc="[object Float32Array]",qc="[object Float64Array]",Zc="[object Int8Array]",Jc="[object Int16Array]",$c="[object Int32Array]",Qc="[object Uint8Array]",tp="[object Uint8ClampedArray]",ep="[object Uint16Array]",np="[object Uint32Array]";function rp(t,e,n){var r,o=t.constructor;switch(e){case Yc:return Cc(t);case Bc:case zc:return new o(+t);case Vc:return function(t,e){var n=e?Cc(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case Kc:case qc:case Zc:case Jc:case $c:case Qc:case tp:case ep:case np:return Lc(t,n);case Hc:return new o;case Xc:case Fc:return new o(t);case Gc:return function(t){var e=new t.constructor(t.source,Ic.exec(t));return e.lastIndex=t.lastIndex,e}(t);case Wc:return new o;case Uc:return r=t,Rc?Object(Rc.call(r)):{}}}function op(t){return"function"!=typeof t.constructor||vs(t)?{}:Ti(Nu(t))}var ip=Cs&&Cs.isMap,ap=ip?Ns(ip):function(t){return Co(t)&&"[object Map]"==Tc(t)};var sp=Cs&&Cs.isSet,up=sp?Ns(sp):function(t){return Co(t)&&"[object Set]"==Tc(t)},lp=1,cp=2,pp=4,dp="[object Arguments]",hp="[object Function]",fp="[object GeneratorFunction]",yp="[object Object]",vp={};function gp(t,e,n,r,o,i){var a,s=e&lp,u=e&cp,l=e&pp;if(n&&(a=o?n(t,r,o,i):n(t)),void 0!==a)return a;if(!Zo(t))return t;var c=zo(t);if(c){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Dc.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!s)return Vi(t,a)}else{var p=Tc(t),d=p==hp||p==fp;if(As(t))return ac(t,s);if(p==yp||p==dp||d&&!o){if(a=u||d?{}:op(t),!s)return u?function(t,e){return as(t,dc(t),e)}(t,function(t,e){return t&&as(e,Vs(e),t)}(a,t)):function(t,e){return as(t,pc(t),e)}(t,ec(a,t))}else{if(!vp[p])return o?t:{};a=rp(t,p,s)}}i||(i=new tc);var h=i.get(t);if(h)return h;i.set(t,a),up(t)?t.forEach((function(r){a.add(gp(r,e,n,r,t,i))})):ap(t)&&t.forEach((function(r,o){a.set(o,gp(r,e,n,o,t,i))}));var f=c?void 0:(l?u?yc:fc:u?Vs:Gs)(t);return ua(f||t,(function(r,o){f&&(r=t[o=r]),is(a,o,gp(r,e,n,o,t,i))})),a}vp[dp]=vp["[object Array]"]=vp["[object ArrayBuffer]"]=vp["[object DataView]"]=vp["[object Boolean]"]=vp["[object Date]"]=vp["[object Float32Array]"]=vp["[object Float64Array]"]=vp["[object Int8Array]"]=vp["[object Int16Array]"]=vp["[object Int32Array]"]=vp["[object Map]"]=vp["[object Number]"]=vp[yp]=vp["[object RegExp]"]=vp["[object Set]"]=vp["[object String]"]=vp["[object Symbol]"]=vp["[object Uint8Array]"]=vp["[object Uint8ClampedArray]"]=vp["[object Uint16Array]"]=vp["[object Uint32Array]"]=!0,vp["[object Error]"]=vp[hp]=vp["[object WeakMap]"]=!1;function mp(t){return gp(t,5)}function _p(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new lu;++e<n;)this.add(t[e])}function bp(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 xp(t,e){return t.has(e)}_p.prototype.add=_p.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},_p.prototype.has=function(t){return this.__data__.has(t)};var Ep=1,wp=2;function Op(t,e,n,r,o,i){var a=n&Ep,s=t.length,u=e.length;if(s!=u&&!(a&&u>s))return!1;var l=i.get(t),c=i.get(e);if(l&&c)return l==e&&c==t;var p=-1,d=!0,h=n&wp?new _p:void 0;for(i.set(t,e),i.set(e,t);++p<s;){var f=t[p],y=e[p];if(r)var v=a?r(y,f,p,e,t,i):r(f,y,p,t,e,i);if(void 0!==v){if(v)continue;d=!1;break}if(h){if(!bp(e,(function(t,e){if(!xp(h,e)&&(f===t||o(f,t,n,r,i)))return h.push(e)}))){d=!1;break}}else if(f!==y&&!o(f,y,n,r,i)){d=!1;break}}return i.delete(t),i.delete(e),d}function Mp(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function Sp(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var Ap=1,Pp=2,Np="[object Boolean]",Tp="[object Date]",Dp="[object Error]",jp="[object Map]",Cp="[object Number]",Ip="[object RegExp]",kp="[object Set]",Rp="[object String]",Lp="[object Symbol]",Bp="[object ArrayBuffer]",zp="[object DataView]",Hp=wo?wo.prototype:void 0,Xp=Hp?Hp.valueOf:void 0;var Gp=1,Wp=Object.prototype.hasOwnProperty;var Fp=1,Up="[object Arguments]",Yp="[object Array]",Vp="[object Object]",Kp=Object.prototype.hasOwnProperty;function qp(t,e,n,r,o,i){var a=zo(t),s=zo(e),u=a?Yp:Tc(t),l=s?Yp:Tc(e),c=(u=u==Up?Vp:u)==Vp,p=(l=l==Up?Vp:l)==Vp,d=u==l;if(d&&As(t)){if(!As(e))return!1;a=!0,c=!1}if(d&&!c)return i||(i=new tc),a||ks(t)?Op(t,e,n,r,o,i):function(t,e,n,r,o,i,a){switch(n){case zp:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Bp:return!(t.byteLength!=e.byteLength||!i(new jc(t),new jc(e)));case Np:case Tp:case Cp:return rs(+t,+e);case Dp:return t.name==e.name&&t.message==e.message;case Ip:case Rp:return t==e+"";case jp:var s=Mp;case kp:var u=r&Ap;if(s||(s=Sp),t.size!=e.size&&!u)return!1;var l=a.get(t);if(l)return l==e;r|=Pp,a.set(t,e);var c=Op(s(t),s(e),r,o,i,a);return a.delete(t),c;case Lp:if(Xp)return Xp.call(t)==Xp.call(e)}return!1}(t,e,u,n,r,o,i);if(!(n&Fp)){var h=c&&Kp.call(t,"__wrapped__"),f=p&&Kp.call(e,"__wrapped__");if(h||f){var y=h?t.value():t,v=f?e.value():e;return i||(i=new tc),o(y,v,n,r,i)}}return!!d&&(i||(i=new tc),function(t,e,n,r,o,i){var a=n&Gp,s=fc(t),u=s.length;if(u!=fc(e).length&&!a)return!1;for(var l=u;l--;){var c=s[l];if(!(a?c in e:Wp.call(e,c)))return!1}var p=i.get(t),d=i.get(e);if(p&&d)return p==e&&d==t;var h=!0;i.set(t,e),i.set(e,t);for(var f=a;++l<u;){var y=t[c=s[l]],v=e[c];if(r)var g=a?r(v,y,c,e,t,i):r(y,v,c,t,e,i);if(!(void 0===g?y===v||o(y,v,n,r,i):g)){h=!1;break}f||(f="constructor"==c)}if(h&&!f){var m=t.constructor,_=e.constructor;m==_||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof _&&_ instanceof _||(h=!1)}return i.delete(t),i.delete(e),h}(t,e,n,r,o,i))}function Zp(t,e,n,r,o){return t===e||(null==t||null==e||!Co(t)&&!Co(e)?t!=t&&e!=e:qp(t,e,n,r,Zp,o))}var Jp=1,$p=2;function Qp(t,e,n,r){var o=n.length,i=o,a=!r;if(null==t)return!i;for(t=Object(t);o--;){var s=n[o];if(a&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++o<i;){var u=(s=n[o])[0],l=t[u],c=s[1];if(a&&s[2]){if(void 0===l&&!(u in t))return!1}else{var p=new tc;if(r)var d=r(l,c,u,t,e,p);if(!(void 0===d?Zp(c,l,Jp|$p,r,p):d))return!1}}return!0}function td(t){return t==t&&!Zo(t)}function ed(t){for(var e=Gs(t),n=e.length;n--;){var r=e[n],o=t[r];e[n]=[r,o,td(o)]}return e}function nd(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}function rd(t){var e=ed(t);return 1==e.length&&e[0][2]?nd(e[0][0],e[0][1]):function(n){return n===t||Qp(n,t,e)}}function od(t,e){return null!=t&&e in Object(t)}function id(t,e,n){for(var r=-1,o=(e=vu(e,t)).length,i=!1;++r<o;){var a=mu(e[r]);if(!(i=null!=t&&n(t,a)))break;t=t[a]}return i||++r!=o?i:!!(o=null==t?0:t.length)&&ps(o)&&Ma(a,o)&&(zo(t)||Es(t))}function ad(t,e){return null!=t&&id(t,e,od)}var sd=1,ud=2;function ld(t,e){return Qs(t)&&td(e)?nd(mu(t),e):function(n){var r=bu(n,t);return void 0===r&&r===e?ad(n,t):Zp(e,r,sd|ud)}}function cd(t){return function(e){return null==e?void 0:e[t]}}function pd(t){return Qs(t)?cd(mu(t)):function(t){return function(e){return _u(e,t)}}(t)}function dd(t){return"function"==typeof t?t:null==t?si:"object"==typeof t?zo(t)?ld(t[0],t[1]):rd(t):pd(t)}function hd(t,e,n){var r=n.length;if(null==t)return!r;for(t=Object(t);r--;){var o=n[r],i=e[o],a=t[o];if(void 0===a&&!(o in t)||!i(a))return!1}return!0}function fd(t,e,n,r){for(var o=-1,i=null==t?0:t.length;++o<i;){var a=t[o];e(r,a,n(a),t)}return r}function yd(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),s=a.length;s--;){var u=a[t?s:++o];if(!1===n(i[u],u,i))break}return e}}var vd=yd();function gd(t,e){return t&&vd(t,e,Gs)}function md(t,e){return function(n,r){if(null==n)return n;if(!ds(n))return t(n,r);for(var o=n.length,i=e?o:-1,a=Object(n);(e?i--:++i<o)&&!1!==r(a[i],i,a););return n}}var _d=md(gd);function bd(t,e,n,r){return _d(t,(function(t,o,i){e(r,t,n(t),i)})),r}function xd(t,e){return function(n,r){var o=zo(n)?fd:bd,i=e?e():{};return o(n,t,dd(r),i)}}var Ed=Object.prototype.hasOwnProperty,wd=xd((function(t,e,n){Ed.call(t,n)?++t[n]:ns(t,n,1)}));function Od(t,e,n){var r=Qa(t,8,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return r.placeholder=Od.placeholder,r}Od.placeholder={};function Md(t,e,n){var r=Qa(t,16,void 0,void 0,void 0,void 0,void 0,e=n?void 0:e);return r.placeholder=Md.placeholder,r}Md.placeholder={};var Sd=function(){return Eo.Date.now()},Ad="Expected a function",Pd=Math.max,Nd=Math.min;function Td(t,e,n){var r,o,i,a,s,u,l=0,c=!1,p=!1,d=!0;if("function"!=typeof t)throw new TypeError(Ad);function h(e){var n=r,i=o;return r=o=void 0,l=e,a=t.apply(i,n)}function f(t){var n=t-u;return void 0===u||n>=e||n<0||p&&t-l>=i}function y(){var t=Sd();if(f(t))return v(t);s=setTimeout(y,function(t){var n=e-(t-u);return p?Nd(n,i-(t-l)):n}(t))}function v(t){return s=void 0,d&&r?h(t):(r=o=void 0,a)}function g(){var t=Sd(),n=f(t);if(r=arguments,o=this,u=t,n){if(void 0===s)return function(t){return l=t,s=setTimeout(y,e),c?h(t):a}(u);if(p)return clearTimeout(s),s=setTimeout(y,e),h(u)}return void 0===s&&(s=setTimeout(y,e)),a}return e=ni(e)||0,Zo(n)&&(c=!!n.leading,i=(p="maxWait"in n)?Pd(ni(n.maxWait)||0,e):i,d="trailing"in n?!!n.trailing:d),g.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=u=o=s=void 0},g.flush=function(){return void 0===s?a:v(Sd())},g}var Dd=Object.prototype,jd=Dd.hasOwnProperty,Cd=ls((function(t,e){t=Object(t);var n=-1,r=e.length,o=r>2?e[2]:void 0;for(o&&hs(e[0],e[1],o)&&(r=1);++n<r;)for(var i=e[n],a=Vs(i),s=-1,u=a.length;++s<u;){var l=a[s],c=t[l];(void 0===c||rs(c,Dd[l])&&!jd.call(t,l))&&(t[l]=i[l])}return t}));function Id(t,e,n){(void 0!==n&&!rs(t[e],n)||void 0===n&&!(e in t))&&ns(t,e,n)}function kd(t){return Co(t)&&ds(t)}function Rd(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}function Ld(t){return as(t,Vs(t))}function Bd(t,e,n,r,o){t!==e&&vd(e,(function(i,a){if(o||(o=new tc),Zo(i))!function(t,e,n,r,o,i,a){var s=Rd(t,n),u=Rd(e,n),l=a.get(u);if(l)Id(t,n,l);else{var c=i?i(s,u,n+"",t,e,a):void 0,p=void 0===c;if(p){var d=zo(u),h=!d&&As(u),f=!d&&!h&&ks(u);c=u,d||h||f?zo(s)?c=s:kd(s)?c=Vi(s):h?(p=!1,c=ac(u,!0)):f?(p=!1,c=Lc(u,!0)):c=[]:Ru(u)||Es(u)?(c=s,Es(s)?c=Ld(s):Zo(s)&&!di(s)||(c=op(u))):p=!1}p&&(a.set(u,c),o(c,u,r,i,a),a.delete(u)),Id(t,n,c)}}(t,e,a,n,Bd,r,o);else{var s=r?r(Rd(t,a),i,a+"",t,e,o):void 0;void 0===s&&(s=i),Id(t,a,s)}}),Vs)}function zd(t,e,n,r,o,i){return Zo(t)&&Zo(e)&&(i.set(e,t),Bd(t,e,void 0,zd,i),i.delete(e)),t}var Hd=fs((function(t,e,n,r){Bd(t,e,n,r)})),Xd=ls((function(t){return t.push(void 0,zd),Ci(Hd,void 0,t)}));function Gd(t,e,n){if("function"!=typeof t)throw new TypeError("Expected a function");return setTimeout((function(){t.apply(void 0,n)}),e)}var Wd=ls((function(t,e){return Gd(t,1,e)})),Fd=ls((function(t,e,n){return Gd(t,ni(e)||0,n)}));function Ud(t,e,n){for(var r=-1,o=null==t?0:t.length;++r<o;)if(n(e,t[r]))return!0;return!1}var Yd=200;function Vd(t,e,n,r){var o=-1,i=da,a=!0,s=t.length,u=[],l=e.length;if(!s)return u;n&&(e=Bo(e,Ns(n))),r?(i=Ud,a=!1):e.length>=Yd&&(i=xp,a=!1,e=new _p(e));t:for(;++o<s;){var c=t[o],p=null==n?c:n(c);if(c=r||0!==c?c:0,a&&p==p){for(var d=l;d--;)if(e[d]===p)continue t;u.push(c)}else i(e,p,r)||u.push(c)}return u}var Kd=ls((function(t,e){return kd(t)?Vd(t,Mu(e,1,kd,!0)):[]}));function qd(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}var Zd=ls((function(t,e){var n=qd(e);return kd(n)&&(n=void 0),kd(t)?Vd(t,Mu(e,1,kd,!0),dd(n)):[]})),Jd=ls((function(t,e){var n=qd(e);return kd(n)&&(n=void 0),kd(t)?Vd(t,Mu(e,1,kd,!0),void 0,n):[]})),$d=Fo((function(t,e){return t/e}),1);function Qd(t,e,n,r){for(var o=t.length,i=r?o:-1;(r?i--:++i<o)&&e(t[i],i,t););return n?Yu(t,r?0:i,r?i+1:o):Yu(t,r?i+1:0,r?o:i)}function th(t){return"function"==typeof t?t:si}function eh(t,e){return(zo(t)?ua:_d)(t,th(e))}function nh(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}var rh=yd(!0);function oh(t,e){return t&&rh(t,e,Gs)}var ih=md(oh,!0);function ah(t,e){return(zo(t)?nh:ih)(t,th(e))}function sh(t){return function(e){var n=Tc(e);return"[object Map]"==n?Mp(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 Bo(e,(function(e){return[e,t[e]]}))}(e,t(e))}}var uh=sh(Gs),lh=sh(Vs),ch=hl({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),ph=/[&<>"']/g,dh=RegExp(ph.source);function hh(t){return(t=yu(t))&&dh.test(t)?t.replace(ph,ch):t}var fh=/[\\^$.*+?()[\]{}|]/g,yh=RegExp(fh.source);function vh(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 gh(t,e){var n=!0;return _d(t,(function(t,r,o){return n=!!e(t,r,o)})),n}var mh=4294967295;function _h(t){return t?Ql(ai(t),0,mh):0}function bh(t,e){var n=[];return _d(t,(function(t,r,o){e(t,r,o)&&n.push(t)})),n}function xh(t){return function(e,n,r){var o=Object(e);if(!ds(e)){var i=dd(n);e=Gs(e),n=function(t){return i(o[t],t,o)}}var a=t(e,n,r);return a>-1?o[i?e[a]:a]:void 0}}var Eh=Math.max;function wh(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:ai(n);return o<0&&(o=Eh(r+o,0)),la(t,dd(e),o)}var Oh=xh(wh);function Mh(t,e,n){var r;return n(t,(function(t,n,o){if(e(t,n,o))return r=n,!1})),r}var Sh=Math.max,Ah=Math.min;function Ph(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r-1;return void 0!==n&&(o=ai(n),o=n<0?Sh(r+o,0):Ah(o,r-1)),la(t,dd(e),o,!0)}var Nh=xh(Ph);function Th(t){return t&&t.length?t[0]:void 0}function Dh(t,e){var n=-1,r=ds(t)?Array(t.length):[];return _d(t,(function(t,o,i){r[++n]=e(t,o,i)})),r}function jh(t,e){return(zo(t)?Bo:Dh)(t,dd(e))}var Ch=Kl("floor");function Ih(t){return Au((function(e){var n=e.length,r=n,o=Yi.prototype.thru;for(t&&e.reverse();r--;){var i=e[r];if("function"!=typeof i)throw new TypeError("Expected a function");if(o&&!a&&"wrapper"==Ui(i))var a=new Yi([],!0)}for(r=a?r:n;++r<n;){var s=Ui(i=e[r]),u="wrapper"==s?Gi(i):void 0;a=u&&Ji(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?a[Ui(u[0])].apply(a,u[3]):1==i.length&&Ji(i)?a[s]():a.thru(i)}return function(){var t=arguments,r=t[0];if(a&&1==t.length&&zo(r))return a.plant(r).value();for(var o=0,i=n?e[o].apply(this,t):r;++o<n;)i=e[o].call(this,i);return i}}))}var kh=Ih(),Rh=Ih(!0);function Lh(t,e){return sc(e,(function(e){return di(t[e])}))}var Bh=Object.prototype.hasOwnProperty,zh=xd((function(t,e,n){Bh.call(t,n)?t[n].push(e):ns(t,n,[e])}));function Hh(t,e){return t>e}function Xh(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=ni(e),n=ni(n)),t(e,n)}}var Gh=Xh(Hh),Wh=Xh((function(t,e){return t>=e})),Fh=Object.prototype.hasOwnProperty;function Uh(t,e){return null!=t&&Fh.call(t,e)}function Yh(t,e){return null!=t&&id(t,e,Uh)}var Vh=Math.max,Kh=Math.min;var qh="[object String]";function Zh(t){return"string"==typeof t||!zo(t)&&Co(t)&&jo(t)==qh}function Jh(t,e){return Bo(e,(function(e){return t[e]}))}function $h(t){return null==t?[]:Jh(t,Gs(t))}var Qh=Math.max;var tf=Math.max;var ef=Math.min;function nf(t,e,n){for(var r=n?Ud:da,o=t[0].length,i=t.length,a=i,s=Array(i),u=1/0,l=[];a--;){var c=t[a];a&&e&&(c=Bo(c,Ns(e))),u=ef(c.length,u),s[a]=!n&&(e||o>=120&&c.length>=120)?new _p(a&&c):void 0}c=t[0];var p=-1,d=s[0];t:for(;++p<o&&l.length<u;){var h=c[p],f=e?e(h):h;if(h=n||0!==h?h:0,!(d?xp(d,f):r(l,f,n))){for(a=i;--a;){var y=s[a];if(!(y?xp(y,f):r(t[a],f,n)))continue t}d&&d.push(f),l.push(h)}}return l}function rf(t){return kd(t)?t:[]}var of=ls((function(t){var e=Bo(t,rf);return e.length&&e[0]===t[0]?nf(e):[]})),af=ls((function(t){var e=qd(t),n=Bo(t,rf);return e===qd(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?nf(n,dd(e)):[]})),sf=ls((function(t){var e=qd(t),n=Bo(t,rf);return(e="function"==typeof e?e:void 0)&&n.pop(),n.length&&n[0]===t[0]?nf(n,void 0,e):[]}));function uf(t,e){return function(n,r){return function(t,e,n,r){return gd(t,(function(t,o,i){e(r,n(t),o,i)})),r}(n,t,e(r),{})}}var lf=Object.prototype.toString,cf=uf((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=lf.call(e)),t[e]=n}),oa(si)),pf=Object.prototype,df=pf.hasOwnProperty,hf=pf.toString,ff=uf((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=hf.call(e)),df.call(t,e)?t[e].push(n):t[e]=[n]}),dd);function yf(t,e){return e.length<2?t:_u(t,Yu(e,0,-1))}function vf(t,e,n){var r=null==(t=yf(t,e=vu(e,t)))?t:t[mu(qd(e))];return null==r?void 0:Ci(r,t,n)}var gf=ls(vf),mf=ls((function(t,e,n){var r=-1,o="function"==typeof e,i=ds(t)?Array(t.length):[];return _d(t,(function(t){i[++r]=o?Ci(e,t,n):vf(t,e,n)})),i}));var _f=Cs&&Cs.isArrayBuffer,bf=_f?Ns(_f):function(t){return Co(t)&&"[object ArrayBuffer]"==jo(t)};var xf=Cs&&Cs.isDate,Ef=xf?Ns(xf):function(t){return Co(t)&&"[object Date]"==jo(t)};var wf=Object.prototype.hasOwnProperty;function Of(t,e){return Zp(t,e)}var Mf=Eo.isFinite;function Sf(t){return"number"==typeof t&&t==ai(t)}var Af="[object Number]";function Pf(t){return"number"==typeof t||Co(t)&&jo(t)==Af}var Nf=fi?di:ws;function Tf(t){return null==t}var Df=Cs&&Cs.isRegExp,jf=Df?Ns(Df):function(t){return Co(t)&&"[object RegExp]"==jo(t)},Cf=9007199254740991;var If=Array.prototype.join;var kf=Fl((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Rf=xd((function(t,e,n){ns(t,n,e)}));var Lf=Math.max,Bf=Math.min;var zf=Fl((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Hf=ll("toLowerCase");function Xf(t,e){return t<e}var Gf=Xh(Xf),Wf=Xh((function(t,e){return t<=e}));function Ff(t,e){var n={};return e=dd(e),gd(t,(function(t,r,o){ns(n,e(t,r,o),t)})),n}function Uf(t,e,n){for(var r=-1,o=t.length;++r<o;){var i=t[r],a=e(i);if(null!=a&&(void 0===s?a==a&&!ko(a):n(a,s)))var s=a,u=i}return u}function Yf(t,e){for(var n,r=-1,o=t.length;++r<o;){var i=e(t[r]);void 0!==i&&(n=void 0===n?i:n+i)}return n}var Vf=NaN;function Kf(t,e){var n=null==t?0:t.length;return n?Yf(t,e)/n:Vf}var qf=fs((function(t,e,n){Bd(t,e,n)})),Zf=ls((function(t,e){return function(n){return vf(n,t,e)}})),Jf=ls((function(t,e){return function(n){return vf(t,n,e)}}));function $f(t,e,n){var r=Gs(e),o=Lh(e,r),i=!(Zo(n)&&"chain"in n&&!n.chain),a=di(t);return ua(o,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(i||e){var n=t(this.__wrapped__);return(n.__actions__=Vi(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Eu([this.value()],arguments))})})),t}var Qf=Fo((function(t,e){return t*e}),1),ty="Expected a function";function ey(t){if("function"!=typeof t)throw new TypeError(ty);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 ny="[object Map]",ry="[object Set]",oy=wo?wo.iterator:void 0;function iy(t){if(!t)return[];if(ds(t))return Zh(t)?ul(t):Vi(t);if(oy&&t[oy])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[oy]());var e=Tc(t);return(e==ny?Mp:e==ry?Sp:$h)(t)}function ay(t,e){var n=t.length;if(n)return Ma(e+=e<0?n:0,n)?t[e]:void 0}function sy(t,e){return null==(t=yf(t,e=vu(e,t)))||delete t[mu(qd(e))]}function uy(t){return Ru(t)?void 0:t}var ly=Au((function(t,e){var n={};if(null==t)return n;var r=!1;e=Bo(e,(function(e){return e=vu(e,t),r||(r=e.length>1),e})),as(t,yc(t),n),r&&(n=gp(n,7,uy));for(var o=e.length;o--;)sy(n,e[o]);return n}));function cy(t,e,n,r){if(!Zo(t))return t;for(var o=-1,i=(e=vu(e,t)).length,a=i-1,s=t;null!=s&&++o<i;){var u=mu(e[o]),l=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(o!=a){var c=s[u];void 0===(l=r?r(c,u,s):void 0)&&(l=Zo(c)?c:Ma(e[o+1])?[]:{})}is(s,u,l),s=s[u]}return t}function py(t,e,n){for(var r=-1,o=e.length,i={};++r<o;){var a=e[r],s=_u(t,a);n(s,a)&&cy(i,vu(a,t),s)}return i}function dy(t,e){if(null==t)return{};var n=Bo(yc(t),(function(t){return[t]}));return e=dd(e),py(t,n,(function(t,n){return e(t,n[0])}))}function hy(t,e){if(t!==e){var n=void 0!==t,r=null===t,o=t==t,i=ko(t),a=void 0!==e,s=null===e,u=e==e,l=ko(e);if(!s&&!l&&!i&&t>e||i&&a&&u&&!s&&!l||r&&a&&u||!n&&u||!o)return 1;if(!r&&!i&&!l&&t<e||l&&n&&o&&!r&&!i||s&&n&&o||!a&&o||!u)return-1}return 0}function fy(t,e,n){e=e.length?Bo(e,(function(t){return zo(t)?function(e){return _u(e,1===t.length?t[0]:t)}:t})):[si];var r=-1;e=Bo(e,Ns(dd));var o=Dh(t,(function(t,n,o){var i=Bo(e,(function(e){return e(t)}));return{criteria:i,index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(o,(function(t,e){return function(t,e,n){for(var r=-1,o=t.criteria,i=e.criteria,a=o.length,s=n.length;++r<a;){var u=hy(o[r],i[r]);if(u)return r>=s?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function yy(t){return Au((function(e){return e=Bo(e,Ns(dd)),ls((function(n){var r=this;return t(e,(function(t){return Ci(t,r,n)}))}))}))}var vy=yy(Bo),gy=ls,my=Math.min,_y=gy((function(t,e){var n=(e=1==e.length&&zo(e[0])?Bo(e[0],Ns(dd)):Bo(Mu(e,1),Ns(dd))).length;return ls((function(r){for(var o=-1,i=my(r.length,n);++o<i;)r[o]=e[o].call(this,r[o]);return Ci(t,this,r)}))})),by=yy(vh),xy=yy(bp),Ey=9007199254740991,wy=Math.floor;function Oy(t,e){var n="";if(!t||e<1||e>Ey)return n;do{e%2&&(n+=t),(e=wy(e/2))&&(t+=t)}while(e);return n}var My=cd("length"),Sy="\\ud800-\\udfff",Ay="["+Sy+"]",Py="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Ny="\\ud83c[\\udffb-\\udfff]",Ty="[^"+Sy+"]",Dy="(?:\\ud83c[\\udde6-\\uddff]){2}",jy="[\\ud800-\\udbff][\\udc00-\\udfff]",Cy="(?:"+Py+"|"+Ny+")"+"?",Iy="[\\ufe0e\\ufe0f]?",ky=Iy+Cy+("(?:\\u200d(?:"+[Ty,Dy,jy].join("|")+")"+Iy+Cy+")*"),Ry="(?:"+[Ty+Py+"?",Py,Dy,jy,Ay].join("|")+")",Ly=RegExp(Ny+"(?="+Ny+")|"+Ry+ky,"g");function By(t){return qu(t)?function(t){for(var e=Ly.lastIndex=0;Ly.test(t);)++e;return e}(t):My(t)}var zy=Math.ceil;function Hy(t,e){var n=(e=void 0===e?" ":Wo(e)).length;if(n<2)return n?Oy(e,t):e;var r=Oy(e,zy(t/By(e)));return qu(e)?Vu(ul(r),0,t).join(""):r.slice(0,t)}var Xy=Math.ceil,Gy=Math.floor;var Wy=/^\s+/,Fy=Eo.parseInt;var Uy=ls((function(t,e){return Qa(t,32,void 0,e,Pa(e,Ea(Uy)))}));Uy.placeholder={};var Yy=ls((function(t,e){return Qa(t,64,void 0,e,Pa(e,Ea(Yy)))}));Yy.placeholder={};var Vy=xd((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var Ky=Au((function(t,e){return null==t?{}:function(t,e){return py(t,e,(function(e,n){return ad(t,n)}))}(t,e)}));function qy(t,e,n,r){for(var o=n-1,i=t.length;++o<i;)if(r(t[o],e))return o;return-1}var Zy=Array.prototype.splice;function Jy(t,e,n,r){var o=r?qy:pa,i=-1,a=e.length,s=t;for(t===e&&(e=Vi(e)),n&&(s=Bo(t,Ns(n)));++i<a;)for(var u=0,l=e[i],c=n?n(l):l;(u=o(s,c,u,r))>-1;)s!==t&&Zy.call(s,u,1),Zy.call(t,u,1);return t}function $y(t,e){return t&&t.length&&e&&e.length?Jy(t,e):t}var Qy=ls($y);var tv=Array.prototype.splice;function ev(t,e){for(var n=t?e.length:0,r=n-1;n--;){var o=e[n];if(n==r||o!==i){var i=o;Ma(o)?tv.call(t,o,1):sy(t,o)}}return t}var nv=Au((function(t,e){var n=null==t?0:t.length,r=xu(t,e);return ev(t,Bo(e,(function(t){return Ma(t,n)?+t:t})).sort(hy)),r})),rv=Math.floor,ov=Math.random;function iv(t,e){return t+rv(ov()*(e-t+1))}var av=parseFloat,sv=Math.min,uv=Math.random;var lv=Math.ceil,cv=Math.max;function pv(t){return function(e,n,r){return r&&"number"!=typeof r&&hs(e,n,r)&&(n=r=void 0),e=ii(e),void 0===n?(n=e,e=0):n=ii(n),function(t,e,n,r){for(var o=-1,i=cv(lv((e-t)/(n||1)),0),a=Array(i);i--;)a[r?i:++o]=t,t+=n;return a}(e,n,r=void 0===r?e<n?1:-1:ii(r),t)}}var dv=pv(),hv=pv(!0),fv=Au((function(t,e){return Qa(t,256,void 0,void 0,void 0,e)}));function yv(t,e,n,r,o){return o(t,(function(t,o,i){n=r?(r=!1,t):e(n,t,o,i)})),n}function vv(t,e,n){var r=zo(t)?dl:yv,o=arguments.length<3;return r(t,dd(e),n,o,_d)}function gv(t,e,n,r){var o=null==t?0:t.length;for(r&&o&&(n=t[--o]);o--;)n=e(n,t[o],o,t);return n}var mv=Array.prototype.reverse;function _v(t){return null==t?t:mv.call(t)}var bv=Kl("round");function xv(t){var e=t.length;return e?t[iv(0,e-1)]:void 0}function Ev(t){return xv($h(t))}function wv(t,e){var n=-1,r=t.length,o=r-1;for(e=void 0===e?r:e;++n<e;){var i=iv(n,o),a=t[i];t[i]=t[n],t[n]=a}return t.length=e,t}function Ov(t,e){return wv(Vi(t),Ql(e,0,t.length))}function Mv(t,e){var n=$h(t);return wv(n,Ql(e,0,n.length))}function Sv(t){return wv(Vi(t))}function Av(t){return wv($h(t))}var Pv=Fl((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));function Nv(t,e){var n;return _d(t,(function(t,r,o){return!(n=e(t,r,o))})),!!n}var Tv=ls((function(t,e){if(null==t)return[];var n=e.length;return n>1&&hs(t,e[0],e[1])?e=[]:n>2&&hs(e[0],e[1],e[2])&&(e=[e[0]]),fy(t,Mu(e,1),[])})),Dv=4294967294,jv=Math.floor,Cv=Math.min;function Iv(t,e,n,r){var o=0,i=null==t?0:t.length;if(0===i)return 0;for(var a=(e=n(e))!=e,s=null===e,u=ko(e),l=void 0===e;o<i;){var c=jv((o+i)/2),p=n(t[c]),d=void 0!==p,h=null===p,f=p==p,y=ko(p);if(a)var v=r||f;else v=l?f&&(r||d):s?f&&d&&(r||!h):u?f&&d&&!h&&(r||!y):!h&&!y&&(r?p<=e:p<e);v?o=c+1:i=c}return Cv(i,Dv)}var kv=2147483647;function Rv(t,e,n){var r=0,o=null==t?r:t.length;if("number"==typeof e&&e==e&&o<=kv){for(;r<o;){var i=r+o>>>1,a=t[i];null!==a&&!ko(a)&&(n?a<=e:a<e)?r=i+1:o=i}return o}return Iv(t,e,si,n)}function Lv(t,e){for(var n=-1,r=t.length,o=0,i=[];++n<r;){var a=t[n],s=e?e(a):a;if(!n||!rs(s,u)){var u=s;i[o++]=0===a?0:a}}return i}var Bv=Math.max;var zv=Fl((function(t,e,n){return t+(n?" ":"")+cl(e)}));var Hv=Fo((function(t,e){return t-e}),0);var Xv=Object.prototype,Gv=Xv.hasOwnProperty;function Wv(t,e,n,r){return void 0===t||rs(t,Xv[n])&&!Gv.call(r,n)?e:t}var Fv={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function Uv(t){return"\\"+Fv[t]}var Yv=/<%=([\s\S]+?)%>/g,Vv={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:Yv,variable:"",imports:{_:{escape:hh}}},Kv=/\b__p \+= '';/g,qv=/\b(__p \+=) '' \+/g,Zv=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Jv=/[()=,{}\[\]\/\s]/,$v=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Qv=/($^)/,tg=/['\n\r\u2028\u2029\\]/g,eg=Object.prototype.hasOwnProperty;function ng(t,e){return e(t)}var rg=4294967295,og=Math.min;function ig(t,e){var n=t;return n instanceof Hi&&(n=n.value()),dl(e,(function(t,e){return e.func.apply(e.thisArg,Eu([t],e.args))}),n)}function ag(){return ig(this.__wrapped__,this.__actions__)}var sg=9007199254740991;function ug(t,e){for(var n=t.length;n--&&pa(e,t[n],0)>-1;);return n}function lg(t,e){for(var n=-1,r=t.length;++n<r&&pa(e,t[n],0)>-1;);return n}var cg=/^\s+/;var pg=/\w*$/;var dg=hl({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),hg=/&(?:amp|lt|gt|quot|#39);/g,fg=RegExp(hg.source);var yg=mc&&1/Sp(new mc([,-0]))[1]==1/0?function(t){return new mc(t)}:Xi,vg=200;function gg(t,e,n){var r=-1,o=da,i=t.length,a=!0,s=[],u=s;if(n)a=!1,o=Ud;else if(i>=vg){var l=e?null:yg(t);if(l)return Sp(l);a=!1,o=xp,u=new _p}else u=e?[]:s;t:for(;++r<i;){var c=t[r],p=e?e(c):c;if(c=n||0!==c?c:0,a&&p==p){for(var d=u.length;d--;)if(u[d]===p)continue t;e&&u.push(p),s.push(c)}else o(u,p,n)||(u!==s&&u.push(p),s.push(c))}return s}var mg=ls((function(t){return gg(Mu(t,1,kd,!0))})),_g=ls((function(t){var e=qd(t);return kd(e)&&(e=void 0),gg(Mu(t,1,kd,!0),dd(e))})),bg=ls((function(t){var e=qd(t);return e="function"==typeof e?e:void 0,gg(Mu(t,1,kd,!0),void 0,e)}));var xg=0;var Eg=Math.max;function wg(t){if(!t||!t.length)return[];var e=0;return t=sc(t,(function(t){if(kd(t))return e=Eg(t.length,e),!0})),gs(e,(function(e){return Bo(t,cd(e))}))}function Og(t,e){if(!t||!t.length)return[];var n=wg(t);return null==e?n:Bo(n,(function(t){return Ci(e,void 0,t)}))}function Mg(t,e,n,r){return cy(t,e,n(_u(t,e)),r)}var Sg=Fl((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}));var Ag=ls((function(t,e){return kd(t)?Vd(t,e):[]}));var Pg=Au((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,o=function(e){return xu(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Hi&&Ma(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:ng,args:[o],thisArg:void 0}),new Yi(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(o)}));function Ng(t,e,n){var r=t.length;if(r<2)return r?gg(t[0]):[];for(var o=-1,i=Array(r);++o<r;)for(var a=t[o],s=-1;++s<r;)s!=o&&(i[o]=Vd(i[o]||a,t[s],e,n));return gg(Mu(i,1),e,n)}var Tg=ls((function(t){return Ng(sc(t,kd))})),Dg=ls((function(t){var e=qd(t);return kd(e)&&(e=void 0),Ng(sc(t,kd),dd(e))})),jg=ls((function(t){var e=qd(t);return e="function"==typeof e?e:void 0,Ng(sc(t,kd),void 0,e)})),Cg=ls(wg);function Ig(t,e,n){for(var r=-1,o=t.length,i=e.length,a={};++r<o;){var s=r<i?e[r]:void 0;n(a,t[r],s)}return a}var kg=ls((function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,Og(t,n)})),Rg={chunk:function(t,e,n){e=(n?hs(t,e,n):void 0===e)?1:$l(ai(e),0);var r=null==t?0:t.length;if(!r||e<1)return[];for(var o=0,i=0,a=Array(Jl(r/e));o<r;)a[i++]=Yu(t,o,o+=e);return a},compact:function(t){for(var e=-1,n=null==t?0:t.length,r=0,o=[];++e<n;){var i=t[e];i&&(o[r++]=i)}return o},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 Eu(zo(n)?Vi(n):[n],Mu(e,1))},difference:Kd,differenceBy:Zd,differenceWith:Jd,drop:function(t,e,n){var r=null==t?0:t.length;return r?Yu(t,(e=n||void 0===e?1:ai(e))<0?0:e,r):[]},dropRight:function(t,e,n){var r=null==t?0:t.length;return r?Yu(t,0,(e=r-(e=n||void 0===e?1:ai(e)))<0?0:e):[]},dropRightWhile:function(t,e){return t&&t.length?Qd(t,dd(e),!0,!0):[]},dropWhile:function(t,e){return t&&t.length?Qd(t,dd(e),!0):[]},fill:function(t,e,n,r){var o=null==t?0:t.length;return o?(n&&"number"!=typeof n&&hs(t,e,n)&&(n=0,r=o),function(t,e,n,r){var o=t.length;for((n=ai(n))<0&&(n=-n>o?0:o+n),(r=void 0===r||r>o?o:ai(r))<0&&(r+=o),r=n>r?0:_h(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},findIndex:wh,findLastIndex:Ph,first:Th,flatten:Su,flattenDeep:function(t){return(null==t?0:t.length)?Mu(t,Infinity):[]},flattenDepth:function(t,e){return(null==t?0:t.length)?Mu(t,e=void 0===e?1:ai(e)):[]},fromPairs:function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var o=t[e];r[o[0]]=o[1]}return r},head:Th,indexOf:function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=null==n?0:ai(n);return o<0&&(o=tf(r+o,0)),pa(t,e,o)},initial:function(t){return(null==t?0:t.length)?Yu(t,0,-1):[]},intersection:of,intersectionBy:af,intersectionWith:sf,join:function(t,e){return null==t?"":If.call(t,e)},last:qd,lastIndexOf:function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var o=r;return void 0!==n&&(o=(o=ai(n))<0?Lf(r+o,0):Bf(o,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,o):la(t,ca,o,!0)},nth:function(t,e){return t&&t.length?ay(t,ai(e)):void 0},pull:Qy,pullAll:$y,pullAllBy:function(t,e,n){return t&&t.length&&e&&e.length?Jy(t,e,dd(n)):t},pullAllWith:function(t,e,n){return t&&t.length&&e&&e.length?Jy(t,e,void 0,n):t},pullAt:nv,remove:function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,o=[],i=t.length;for(e=dd(e);++r<i;){var a=t[r];e(a,r,t)&&(n.push(a),o.push(r))}return ev(t,o),n},reverse:_v,slice:function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&hs(t,e,n)?(e=0,n=r):(e=null==e?0:ai(e),n=void 0===n?r:ai(n)),Yu(t,e,n)):[]},sortedIndex:function(t,e){return Rv(t,e)},sortedIndexBy:function(t,e,n){return Iv(t,e,dd(n))},sortedIndexOf:function(t,e){var n=null==t?0:t.length;if(n){var r=Rv(t,e);if(r<n&&rs(t[r],e))return r}return-1},sortedLastIndex:function(t,e){return Rv(t,e,!0)},sortedLastIndexBy:function(t,e,n){return Iv(t,e,dd(n),!0)},sortedLastIndexOf:function(t,e){if(null==t?0:t.length){var n=Rv(t,e,!0)-1;if(rs(t[n],e))return n}return-1},sortedUniq:function(t){return t&&t.length?Lv(t):[]},sortedUniqBy:function(t,e){return t&&t.length?Lv(t,dd(e)):[]},tail:function(t){var e=null==t?0:t.length;return e?Yu(t,1,e):[]},take:function(t,e,n){return t&&t.length?Yu(t,0,(e=n||void 0===e?1:ai(e))<0?0:e):[]},takeRight:function(t,e,n){var r=null==t?0:t.length;return r?Yu(t,(e=r-(e=n||void 0===e?1:ai(e)))<0?0:e,r):[]},takeRightWhile:function(t,e){return t&&t.length?Qd(t,dd(e),!1,!0):[]},takeWhile:function(t,e){return t&&t.length?Qd(t,dd(e)):[]},union:mg,unionBy:_g,unionWith:bg,uniq:function(t){return t&&t.length?gg(t):[]},uniqBy:function(t,e){return t&&t.length?gg(t,dd(e)):[]},uniqWith:function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?gg(t,void 0,e):[]},unzip:wg,unzipWith:Og,without:Ag,xor:Tg,xorBy:Dg,xorWith:jg,zip:Cg,zipObject:function(t,e){return Ig(t||[],e||[],is)},zipObjectDeep:function(t,e){return Ig(t||[],e||[],cy)},zipWith:kg},Lg={countBy:wd,each:eh,eachRight:ah,every:function(t,e,n){var r=zo(t)?vh:gh;return n&&hs(t,e,n)&&(e=void 0),r(t,dd(e))},filter:function(t,e){return(zo(t)?sc:bh)(t,dd(e))},find:Oh,findLast:Nh,flatMap:function(t,e){return Mu(jh(t,e),1)},flatMapDeep:function(t,e){return Mu(jh(t,e),Infinity)},flatMapDepth:function(t,e,n){return n=void 0===n?1:ai(n),Mu(jh(t,e),n)},forEach:eh,forEachRight:ah,groupBy:zh,includes:function(t,e,n,r){t=ds(t)?t:$h(t),n=n&&!r?ai(n):0;var o=t.length;return n<0&&(n=Qh(o+n,0)),Zh(t)?n<=o&&t.indexOf(e,n)>-1:!!o&&pa(t,e,n)>-1},invokeMap:mf,keyBy:Rf,map:jh,orderBy:function(t,e,n,r){return null==t?[]:(zo(e)||(e=null==e?[]:[e]),zo(n=r?void 0:n)||(n=null==n?[]:[n]),fy(t,e,n))},partition:Vy,reduce:vv,reduceRight:function(t,e,n){var r=zo(t)?gv:yv,o=arguments.length<3;return r(t,dd(e),n,o,ih)},reject:function(t,e){return(zo(t)?sc:bh)(t,ey(dd(e)))},sample:function(t){return(zo(t)?xv:Ev)(t)},sampleSize:function(t,e,n){return e=(n?hs(t,e,n):void 0===e)?1:ai(e),(zo(t)?Ov:Mv)(t,e)},shuffle:function(t){return(zo(t)?Sv:Av)(t)},size:function(t){if(null==t)return 0;if(ds(t))return Zh(t)?By(t):t.length;var e=Tc(t);return"[object Map]"==e||"[object Set]"==e?t.size:Xs(t).length},some:function(t,e,n){var r=zo(t)?bp:Nv;return n&&hs(t,e,n)&&(e=void 0),r(t,dd(e))},sortBy:Tv},Bg=Sd,zg={after:function(t,e){if("function"!=typeof e)throw new TypeError("Expected a function");return t=ai(t),function(){if(--t<1)return e.apply(this,arguments)}},ary:es,before:Gu,bind:Wu,bindKey:Uu,curry:Od,curryRight:Md,debounce:Td,defer:Wd,delay:Fd,flip:function(t){return Qa(t,512)},memoize:pu,negate:ey,once:function(t){return Gu(2,t)},overArgs:_y,partial:Uy,partialRight:Yy,rearg:fv,rest:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return ls(t,e=void 0===e?e:ai(e))},spread:function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");return e=null==e?0:Bv(ai(e),0),ls((function(n){var r=n[e],o=Vu(n,0,e);return r&&Eu(o,r),Ci(t,this,o)}))},throttle:function(t,e,n){var r=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return Zo(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Td(t,e,{leading:r,maxWait:e,trailing:o})},unary:function(t){return es(t,1)},wrap:function(t,e){return Uy(th(e),t)}},Hg={castArray:function(){if(!arguments.length)return[];var t=arguments[0];return zo(t)?t:[t]},clone:function(t){return gp(t,4)},cloneDeep:mp,cloneDeepWith:function(t,e){return gp(t,5,e="function"==typeof e?e:void 0)},cloneWith:function(t,e){return gp(t,4,e="function"==typeof e?e:void 0)},conformsTo:function(t,e){return null==e||hd(t,e,Gs(e))},eq:rs,gt:Gh,gte:Wh,isArguments:Es,isArray:zo,isArrayBuffer:bf,isArrayLike:ds,isArrayLikeObject:kd,isBoolean:function(t){return!0===t||!1===t||Co(t)&&"[object Boolean]"==jo(t)},isBuffer:As,isDate:Ef,isElement:function(t){return Co(t)&&1===t.nodeType&&!Ru(t)},isEmpty:function(t){if(null==t)return!0;if(ds(t)&&(zo(t)||"string"==typeof t||"function"==typeof t.splice||As(t)||ks(t)||Es(t)))return!t.length;var e=Tc(t);if("[object Map]"==e||"[object Set]"==e)return!t.size;if(vs(t))return!Xs(t).length;for(var n in t)if(wf.call(t,n))return!1;return!0},isEqual:Of,isEqualWith:function(t,e,n){var r=(n="function"==typeof n?n:void 0)?n(t,e):void 0;return void 0===r?Zp(t,e,void 0,n):!!r},isError:zu,isFinite:function(t){return"number"==typeof t&&Mf(t)},isFunction:di,isInteger:Sf,isLength:ps,isMap:ap,isMatch:function(t,e){return t===e||Qp(t,e,ed(e))},isMatchWith:function(t,e,n){return n="function"==typeof n?n:void 0,Qp(t,e,ed(e),n)},isNaN:function(t){return Pf(t)&&t!=+t},isNative:function(t){if(Nf(t))throw new Error("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Oi(t)},isNil:Tf,isNull:function(t){return null===t},isNumber:Pf,isObject:Zo,isObjectLike:Co,isPlainObject:Ru,isRegExp:jf,isSafeInteger:function(t){return Sf(t)&&t>=-9007199254740991&&t<=Cf},isSet:up,isString:Zh,isSymbol:ko,isTypedArray:ks,isUndefined:function(t){return void 0===t},isWeakMap:function(t){return Co(t)&&"[object WeakMap]"==Tc(t)},isWeakSet:function(t){return Co(t)&&"[object WeakSet]"==jo(t)},lt:Gf,lte:Wf,toArray:iy,toFinite:ii,toInteger:ai,toLength:_h,toNumber:ni,toPlainObject:Ld,toSafeInteger:function(t){return t?Ql(ai(t),-9007199254740991,sg):0===t?t:0},toString:yu},Xg={add:Uo,ceil:ql,divide:$d,floor:Ch,max:function(t){return t&&t.length?Uf(t,si,Hh):void 0},maxBy:function(t,e){return t&&t.length?Uf(t,dd(e),Hh):void 0},mean:function(t){return Kf(t,si)},meanBy:function(t,e){return Kf(t,dd(e))},min:function(t){return t&&t.length?Uf(t,si,Xf):void 0},minBy:function(t,e){return t&&t.length?Uf(t,dd(e),Xf):void 0},multiply:Qf,round:bv,subtract:Hv,sum:function(t){return t&&t.length?Yf(t,si):0},sumBy:function(t,e){return t&&t.length?Yf(t,dd(e)):0}},Gg=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=ni(n))==n?n:0),void 0!==e&&(e=(e=ni(e))==e?e:0),Ql(ni(t),e,n)},Wg=function(t,e,n){return e=ii(e),void 0===n?(n=e,e=0):n=ii(n),function(t,e,n){return t>=Kh(e,n)&&t<Vh(e,n)}(t=ni(t),e,n)},Fg=function(t,e,n){if(n&&"boolean"!=typeof n&&hs(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=ii(t),void 0===e?(e=t,t=0):e=ii(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var o=uv();return sv(t+o*(e-t+av("1e-"+((o+"").length-1))),e)}return iv(t,e)},Ug={assign:Fs,assignIn:Ks,assignInWith:qs,assignWith:Zs,at:Pu,create:function(t,e){var n=Ti(t);return null==e?n:ec(n,e)},defaults:Cd,defaultsDeep:Xd,entries:uh,entriesIn:lh,extend:Ks,extendWith:qs,findKey:function(t,e){return Mh(t,dd(e),gd)},findLastKey:function(t,e){return Mh(t,dd(e),oh)},forIn:function(t,e){return null==t?t:vd(t,th(e),Vs)},forInRight:function(t,e){return null==t?t:rh(t,th(e),Vs)},forOwn:function(t,e){return t&&gd(t,th(e))},forOwnRight:function(t,e){return t&&oh(t,th(e))},functions:function(t){return null==t?[]:Lh(t,Gs(t))},functionsIn:function(t){return null==t?[]:Lh(t,Vs(t))},get:bu,has:Yh,hasIn:ad,invert:cf,invertBy:ff,invoke:gf,keys:Gs,keysIn:Vs,mapKeys:Ff,mapValues:function(t,e){var n={};return e=dd(e),gd(t,(function(t,r,o){ns(n,r,e(t,r,o))})),n},merge:qf,mergeWith:Hd,omit:ly,omitBy:function(t,e){return dy(t,ey(dd(e)))},pick:Ky,pickBy:dy,result:function(t,e,n){var r=-1,o=(e=vu(e,t)).length;for(o||(o=1,t=void 0);++r<o;){var i=null==t?void 0:t[mu(e[r])];void 0===i&&(r=o,i=n),t=di(i)?i.call(t):i}return t},set:function(t,e,n){return null==t?t:cy(t,e,n)},setWith:function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:cy(t,e,n,r)},toPairs:uh,toPairsIn:lh,transform:function(t,e,n){var r=zo(t),o=r||As(t)||ks(t);if(e=dd(e),null==n){var i=t&&t.constructor;n=o?r?new i:[]:Zo(t)&&di(i)?Ti(Nu(t)):{}}return(o?ua:gd)(t,(function(t,r,o){return e(n,t,r,o)})),n},unset:function(t,e){return null==t||sy(t,e)},update:function(t,e,n){return null==t?t:Mg(t,e,th(n))},updateWith:function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:Mg(t,e,th(n),r)},values:$h,valuesIn:function(t){return null==t?[]:Jh(t,Vs(t))}},Yg={at:Pg,chain:Zl,commit:function(){return new Yi(this.value(),this.__chain__)},lodash:Zi,next:function(){void 0===this.__values__&&(this.__values__=iy(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 Bi;){var r=Ki(n);r.__index__=0,r.__values__=void 0,e?o.__wrapped__=r:e=r;var o=r;n=n.__wrapped__}return o.__wrapped__=t,e},reverse:function(){var t=this.__wrapped__;if(t instanceof Hi){var e=t;return this.__actions__.length&&(e=new Hi(this)),(e=e.reverse()).__actions__.push({func:ng,args:[_v],thisArg:void 0}),new Yi(e,this.__chain__)}return this.thru(_v)},tap:function(t,e){return e(t),t},thru:ng,toIterator:function(){return this},toJSON:ag,value:ag,valueOf:ag,wrapperChain:function(){return Zl(this)}},Vg={camelCase:Ul,capitalize:pl,deburr:gl,endsWith:function(t,e,n){t=yu(t),e=Wo(e);var r=t.length,o=n=void 0===n?r:Ql(ai(n),0,r);return(n-=e.length)>=0&&t.slice(n,o)==e},escape:hh,escapeRegExp:function(t){return(t=yu(t))&&yh.test(t)?t.replace(fh,"\\$&"):t},kebabCase:kf,lowerCase:zf,lowerFirst:Hf,pad:function(t,e,n){t=yu(t);var r=(e=ai(e))?By(t):0;if(!e||r>=e)return t;var o=(e-r)/2;return Hy(Gy(o),n)+t+Hy(Xy(o),n)},padEnd:function(t,e,n){t=yu(t);var r=(e=ai(e))?By(t):0;return e&&r<e?t+Hy(e-r,n):t},padStart:function(t,e,n){t=yu(t);var r=(e=ai(e))?By(t):0;return e&&r<e?Hy(e-r,n)+t:t},parseInt:function(t,e,n){return n||null==e?e=0:e&&(e=+e),Fy(yu(t).replace(Wy,""),e||0)},repeat:function(t,e,n){return e=(n?hs(t,e,n):void 0===e)?1:ai(e),Oy(yu(t),e)},replace:function(){var t=arguments,e=yu(t[0]);return t.length<3?e:e.replace(t[1],t[2])},snakeCase:Pv,split:function(t,e,n){return n&&"number"!=typeof n&&hs(t,e,n)&&(e=n=void 0),(n=void 0===n?4294967295:n>>>0)?(t=yu(t))&&("string"==typeof e||null!=e&&!jf(e))&&!(e=Wo(e))&&qu(t)?Vu(ul(t),0,n):t.split(e,n):[]},startCase:zv,startsWith:function(t,e,n){return t=yu(t),n=null==n?0:Ql(ai(n),0,t.length),e=Wo(e),t.slice(n,n+e.length)==e},template:function(t,e,n){var r=Vv.imports._.templateSettings||Vv;n&&hs(t,e,n)&&(e=void 0),t=yu(t),e=qs({},e,r,Wv);var o,i,a=qs({},e.imports,r.imports,Wv),s=Gs(a),u=Jh(a,s),l=0,c=e.interpolate||Qv,p="__p += '",d=RegExp((e.escape||Qv).source+"|"+c.source+"|"+(c===Yv?$v:Qv).source+"|"+(e.evaluate||Qv).source+"|$","g"),h=eg.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(d,(function(e,n,r,a,s,u){return r||(r=a),p+=t.slice(l,u).replace(tg,Uv),n&&(o=!0,p+="' +\n__e("+n+") +\n'"),s&&(i=!0,p+="';\n"+s+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+e.length,e})),p+="';\n";var f=eg.call(e,"variable")&&e.variable;if(f){if(Jv.test(f))throw new Error("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(i?p.replace(Kv,""):p).replace(qv,"$1").replace(Zv,"$1;"),p="function("+(f||"obj")+") {\n"+(f?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var y=Hu((function(){return Function(s,h+"return "+p).apply(void 0,u)}));if(y.source=p,zu(y))throw y;return y},templateSettings:Vv,toLower:function(t){return yu(t).toLowerCase()},toUpper:function(t){return yu(t).toUpperCase()},trim:function(t,e,n){if((t=yu(t))&&(n||void 0===e))return qo(t);if(!t||!(e=Wo(e)))return t;var r=ul(t),o=ul(e);return Vu(r,lg(r,o),ug(r,o)+1).join("")},trimEnd:function(t,e,n){if((t=yu(t))&&(n||void 0===e))return t.slice(0,Vo(t)+1);if(!t||!(e=Wo(e)))return t;var r=ul(t);return Vu(r,0,ug(r,ul(e))+1).join("")},trimStart:function(t,e,n){if((t=yu(t))&&(n||void 0===e))return t.replace(cg,"");if(!t||!(e=Wo(e)))return t;var r=ul(t);return Vu(r,lg(r,ul(e))).join("")},truncate:function(t,e){var n=30,r="...";if(Zo(e)){var o="separator"in e?e.separator:o;n="length"in e?ai(e.length):n,r="omission"in e?Wo(e.omission):r}var i=(t=yu(t)).length;if(qu(t)){var a=ul(t);i=a.length}if(n>=i)return t;var s=n-By(r);if(s<1)return r;var u=a?Vu(a,0,s).join(""):t.slice(0,s);if(void 0===o)return u+r;if(a&&(s+=u.length-s),jf(o)){if(t.slice(s).search(o)){var l,c=u;for(o.global||(o=RegExp(o.source,yu(pg.exec(o))+"g")),o.lastIndex=0;l=o.exec(c);)var p=l.index;u=u.slice(0,void 0===p?s:p)}}else if(t.indexOf(Wo(o),s)!=s){var d=u.lastIndexOf(o);d>-1&&(u=u.slice(0,d))}return u+r},unescape:function(t){return(t=yu(t))&&fg.test(t)?t.replace(hg,dg):t},upperCase:Sg,upperFirst:cl,words:Gl},Kg={attempt:Hu,bindAll:Fu,cond:function(t){var e=null==t?0:t.length,n=dd;return t=e?Bo(t,(function(t){if("function"!=typeof t[1])throw new TypeError("Expected a function");return[n(t[0]),t[1]]})):[],ls((function(n){for(var r=-1;++r<e;){var o=t[r];if(Ci(o[0],this,n))return Ci(o[1],this,n)}}))},conforms:function(t){return function(t){var e=Gs(t);return function(n){return hd(n,t,e)}}(gp(t,1))},constant:oa,defaultTo:function(t,e){return null==t||t!=t?e:t},flow:kh,flowRight:Rh,identity:si,iteratee:function(t){return dd("function"==typeof t?t:gp(t,1))},matches:function(t){return rd(gp(t,1))},matchesProperty:function(t,e){return ld(t,gp(e,1))},method:Zf,methodOf:Jf,mixin:$f,noop:Xi,nthArg:function(t){return t=ai(t),ls((function(e){return ay(e,t)}))},over:vy,overEvery:by,overSome:xy,property:pd,propertyOf:function(t){return function(e){return null==t?void 0:_u(t,e)}},range:dv,rangeRight:hv,stubArray:uc,stubFalse:ws,stubObject:function(){return{}},stubString:function(){return""},stubTrue:function(){return!0},times:function(t,e){if((t=ai(t))<1||t>9007199254740991)return[];var n=rg,r=og(t,rg);e=th(e),t-=rg;for(var o=gs(r,e);++n<t;)e(n);return o},toPath:function(t){return zo(t)?Bo(t,mu):ko(t)?[t]:Vi(fu(yu(t)))},uniqueId:function(t){var e=++xg;return yu(t)+e}};var qg=Math.max,Zg=Math.min;var Jg=Math.min;
16
- /**
17
- * @license
18
- * Lodash (Custom Build) <https://lodash.com/>
19
- * Build: `lodash modularize exports="es" -o ./`
20
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
21
- * Released under MIT license <https://lodash.com/license>
22
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
23
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
24
- */
25
- var $g,Qg=4294967295,tm=Array.prototype,em=Object.prototype.hasOwnProperty,nm=wo?wo.iterator:void 0,rm=Math.max,om=Math.min,im=function(t){return function(e,n,r){if(null==r){var o=Zo(n),i=o&&Gs(n),a=i&&i.length&&Lh(n,i);(a?a.length:o)||(r=n,n=e,e=this)}return t(e,n,r)}}($f);Zi.after=zg.after,Zi.ary=zg.ary,Zi.assign=Ug.assign,Zi.assignIn=Ug.assignIn,Zi.assignInWith=Ug.assignInWith,Zi.assignWith=Ug.assignWith,Zi.at=Ug.at,Zi.before=zg.before,Zi.bind=zg.bind,Zi.bindAll=Kg.bindAll,Zi.bindKey=zg.bindKey,Zi.castArray=Hg.castArray,Zi.chain=Yg.chain,Zi.chunk=Rg.chunk,Zi.compact=Rg.compact,Zi.concat=Rg.concat,Zi.cond=Kg.cond,Zi.conforms=Kg.conforms,Zi.constant=Kg.constant,Zi.countBy=Lg.countBy,Zi.create=Ug.create,Zi.curry=zg.curry,Zi.curryRight=zg.curryRight,Zi.debounce=zg.debounce,Zi.defaults=Ug.defaults,Zi.defaultsDeep=Ug.defaultsDeep,Zi.defer=zg.defer,Zi.delay=zg.delay,Zi.difference=Rg.difference,Zi.differenceBy=Rg.differenceBy,Zi.differenceWith=Rg.differenceWith,Zi.drop=Rg.drop,Zi.dropRight=Rg.dropRight,Zi.dropRightWhile=Rg.dropRightWhile,Zi.dropWhile=Rg.dropWhile,Zi.fill=Rg.fill,Zi.filter=Lg.filter,Zi.flatMap=Lg.flatMap,Zi.flatMapDeep=Lg.flatMapDeep,Zi.flatMapDepth=Lg.flatMapDepth,Zi.flatten=Rg.flatten,Zi.flattenDeep=Rg.flattenDeep,Zi.flattenDepth=Rg.flattenDepth,Zi.flip=zg.flip,Zi.flow=Kg.flow,Zi.flowRight=Kg.flowRight,Zi.fromPairs=Rg.fromPairs,Zi.functions=Ug.functions,Zi.functionsIn=Ug.functionsIn,Zi.groupBy=Lg.groupBy,Zi.initial=Rg.initial,Zi.intersection=Rg.intersection,Zi.intersectionBy=Rg.intersectionBy,Zi.intersectionWith=Rg.intersectionWith,Zi.invert=Ug.invert,Zi.invertBy=Ug.invertBy,Zi.invokeMap=Lg.invokeMap,Zi.iteratee=Kg.iteratee,Zi.keyBy=Lg.keyBy,Zi.keys=Gs,Zi.keysIn=Ug.keysIn,Zi.map=Lg.map,Zi.mapKeys=Ug.mapKeys,Zi.mapValues=Ug.mapValues,Zi.matches=Kg.matches,Zi.matchesProperty=Kg.matchesProperty,Zi.memoize=zg.memoize,Zi.merge=Ug.merge,Zi.mergeWith=Ug.mergeWith,Zi.method=Kg.method,Zi.methodOf=Kg.methodOf,Zi.mixin=im,Zi.negate=ey,Zi.nthArg=Kg.nthArg,Zi.omit=Ug.omit,Zi.omitBy=Ug.omitBy,Zi.once=zg.once,Zi.orderBy=Lg.orderBy,Zi.over=Kg.over,Zi.overArgs=zg.overArgs,Zi.overEvery=Kg.overEvery,Zi.overSome=Kg.overSome,Zi.partial=zg.partial,Zi.partialRight=zg.partialRight,Zi.partition=Lg.partition,Zi.pick=Ug.pick,Zi.pickBy=Ug.pickBy,Zi.property=Kg.property,Zi.propertyOf=Kg.propertyOf,Zi.pull=Rg.pull,Zi.pullAll=Rg.pullAll,Zi.pullAllBy=Rg.pullAllBy,Zi.pullAllWith=Rg.pullAllWith,Zi.pullAt=Rg.pullAt,Zi.range=Kg.range,Zi.rangeRight=Kg.rangeRight,Zi.rearg=zg.rearg,Zi.reject=Lg.reject,Zi.remove=Rg.remove,Zi.rest=zg.rest,Zi.reverse=Rg.reverse,Zi.sampleSize=Lg.sampleSize,Zi.set=Ug.set,Zi.setWith=Ug.setWith,Zi.shuffle=Lg.shuffle,Zi.slice=Rg.slice,Zi.sortBy=Lg.sortBy,Zi.sortedUniq=Rg.sortedUniq,Zi.sortedUniqBy=Rg.sortedUniqBy,Zi.split=Vg.split,Zi.spread=zg.spread,Zi.tail=Rg.tail,Zi.take=Rg.take,Zi.takeRight=Rg.takeRight,Zi.takeRightWhile=Rg.takeRightWhile,Zi.takeWhile=Rg.takeWhile,Zi.tap=Yg.tap,Zi.throttle=zg.throttle,Zi.thru=ng,Zi.toArray=Hg.toArray,Zi.toPairs=Ug.toPairs,Zi.toPairsIn=Ug.toPairsIn,Zi.toPath=Kg.toPath,Zi.toPlainObject=Hg.toPlainObject,Zi.transform=Ug.transform,Zi.unary=zg.unary,Zi.union=Rg.union,Zi.unionBy=Rg.unionBy,Zi.unionWith=Rg.unionWith,Zi.uniq=Rg.uniq,Zi.uniqBy=Rg.uniqBy,Zi.uniqWith=Rg.uniqWith,Zi.unset=Ug.unset,Zi.unzip=Rg.unzip,Zi.unzipWith=Rg.unzipWith,Zi.update=Ug.update,Zi.updateWith=Ug.updateWith,Zi.values=Ug.values,Zi.valuesIn=Ug.valuesIn,Zi.without=Rg.without,Zi.words=Vg.words,Zi.wrap=zg.wrap,Zi.xor=Rg.xor,Zi.xorBy=Rg.xorBy,Zi.xorWith=Rg.xorWith,Zi.zip=Rg.zip,Zi.zipObject=Rg.zipObject,Zi.zipObjectDeep=Rg.zipObjectDeep,Zi.zipWith=Rg.zipWith,Zi.entries=Ug.toPairs,Zi.entriesIn=Ug.toPairsIn,Zi.extend=Ug.assignIn,Zi.extendWith=Ug.assignInWith,im(Zi,Zi),Zi.add=Xg.add,Zi.attempt=Kg.attempt,Zi.camelCase=Vg.camelCase,Zi.capitalize=Vg.capitalize,Zi.ceil=Xg.ceil,Zi.clamp=Gg,Zi.clone=Hg.clone,Zi.cloneDeep=Hg.cloneDeep,Zi.cloneDeepWith=Hg.cloneDeepWith,Zi.cloneWith=Hg.cloneWith,Zi.conformsTo=Hg.conformsTo,Zi.deburr=Vg.deburr,Zi.defaultTo=Kg.defaultTo,Zi.divide=Xg.divide,Zi.endsWith=Vg.endsWith,Zi.eq=Hg.eq,Zi.escape=Vg.escape,Zi.escapeRegExp=Vg.escapeRegExp,Zi.every=Lg.every,Zi.find=Lg.find,Zi.findIndex=Rg.findIndex,Zi.findKey=Ug.findKey,Zi.findLast=Lg.findLast,Zi.findLastIndex=Rg.findLastIndex,Zi.findLastKey=Ug.findLastKey,Zi.floor=Xg.floor,Zi.forEach=Lg.forEach,Zi.forEachRight=Lg.forEachRight,Zi.forIn=Ug.forIn,Zi.forInRight=Ug.forInRight,Zi.forOwn=Ug.forOwn,Zi.forOwnRight=Ug.forOwnRight,Zi.get=Ug.get,Zi.gt=Hg.gt,Zi.gte=Hg.gte,Zi.has=Ug.has,Zi.hasIn=Ug.hasIn,Zi.head=Rg.head,Zi.identity=si,Zi.includes=Lg.includes,Zi.indexOf=Rg.indexOf,Zi.inRange=Wg,Zi.invoke=Ug.invoke,Zi.isArguments=Hg.isArguments,Zi.isArray=zo,Zi.isArrayBuffer=Hg.isArrayBuffer,Zi.isArrayLike=Hg.isArrayLike,Zi.isArrayLikeObject=Hg.isArrayLikeObject,Zi.isBoolean=Hg.isBoolean,Zi.isBuffer=Hg.isBuffer,Zi.isDate=Hg.isDate,Zi.isElement=Hg.isElement,Zi.isEmpty=Hg.isEmpty,Zi.isEqual=Hg.isEqual,Zi.isEqualWith=Hg.isEqualWith,Zi.isError=Hg.isError,Zi.isFinite=Hg.isFinite,Zi.isFunction=Hg.isFunction,Zi.isInteger=Hg.isInteger,Zi.isLength=Hg.isLength,Zi.isMap=Hg.isMap,Zi.isMatch=Hg.isMatch,Zi.isMatchWith=Hg.isMatchWith,Zi.isNaN=Hg.isNaN,Zi.isNative=Hg.isNative,Zi.isNil=Hg.isNil,Zi.isNull=Hg.isNull,Zi.isNumber=Hg.isNumber,Zi.isObject=Zo,Zi.isObjectLike=Hg.isObjectLike,Zi.isPlainObject=Hg.isPlainObject,Zi.isRegExp=Hg.isRegExp,Zi.isSafeInteger=Hg.isSafeInteger,Zi.isSet=Hg.isSet,Zi.isString=Hg.isString,Zi.isSymbol=Hg.isSymbol,Zi.isTypedArray=Hg.isTypedArray,Zi.isUndefined=Hg.isUndefined,Zi.isWeakMap=Hg.isWeakMap,Zi.isWeakSet=Hg.isWeakSet,Zi.join=Rg.join,Zi.kebabCase=Vg.kebabCase,Zi.last=qd,Zi.lastIndexOf=Rg.lastIndexOf,Zi.lowerCase=Vg.lowerCase,Zi.lowerFirst=Vg.lowerFirst,Zi.lt=Hg.lt,Zi.lte=Hg.lte,Zi.max=Xg.max,Zi.maxBy=Xg.maxBy,Zi.mean=Xg.mean,Zi.meanBy=Xg.meanBy,Zi.min=Xg.min,Zi.minBy=Xg.minBy,Zi.stubArray=Kg.stubArray,Zi.stubFalse=Kg.stubFalse,Zi.stubObject=Kg.stubObject,Zi.stubString=Kg.stubString,Zi.stubTrue=Kg.stubTrue,Zi.multiply=Xg.multiply,Zi.nth=Rg.nth,Zi.noop=Kg.noop,Zi.now=Bg,Zi.pad=Vg.pad,Zi.padEnd=Vg.padEnd,Zi.padStart=Vg.padStart,Zi.parseInt=Vg.parseInt,Zi.random=Fg,Zi.reduce=Lg.reduce,Zi.reduceRight=Lg.reduceRight,Zi.repeat=Vg.repeat,Zi.replace=Vg.replace,Zi.result=Ug.result,Zi.round=Xg.round,Zi.sample=Lg.sample,Zi.size=Lg.size,Zi.snakeCase=Vg.snakeCase,Zi.some=Lg.some,Zi.sortedIndex=Rg.sortedIndex,Zi.sortedIndexBy=Rg.sortedIndexBy,Zi.sortedIndexOf=Rg.sortedIndexOf,Zi.sortedLastIndex=Rg.sortedLastIndex,Zi.sortedLastIndexBy=Rg.sortedLastIndexBy,Zi.sortedLastIndexOf=Rg.sortedLastIndexOf,Zi.startCase=Vg.startCase,Zi.startsWith=Vg.startsWith,Zi.subtract=Xg.subtract,Zi.sum=Xg.sum,Zi.sumBy=Xg.sumBy,Zi.template=Vg.template,Zi.times=Kg.times,Zi.toFinite=Hg.toFinite,Zi.toInteger=ai,Zi.toLength=Hg.toLength,Zi.toLower=Vg.toLower,Zi.toNumber=Hg.toNumber,Zi.toSafeInteger=Hg.toSafeInteger,Zi.toString=Hg.toString,Zi.toUpper=Vg.toUpper,Zi.trim=Vg.trim,Zi.trimEnd=Vg.trimEnd,Zi.trimStart=Vg.trimStart,Zi.truncate=Vg.truncate,Zi.unescape=Vg.unescape,Zi.uniqueId=Kg.uniqueId,Zi.upperCase=Vg.upperCase,Zi.upperFirst=Vg.upperFirst,Zi.each=Lg.forEach,Zi.eachRight=Lg.forEachRight,Zi.first=Rg.head,im(Zi,($g={},gd(Zi,(function(t,e){em.call(Zi.prototype,e)||($g[e]=t)})),$g),{chain:!1}),Zi.VERSION="4.17.21",(Zi.templateSettings=Vg.templateSettings).imports._=Zi,ua(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Zi[t].placeholder=Zi})),ua(["drop","take"],(function(t,e){Hi.prototype[t]=function(n){n=void 0===n?1:rm(ai(n),0);var r=this.__filtered__&&!e?new Hi(this):this.clone();return r.__filtered__?r.__takeCount__=om(n,r.__takeCount__):r.__views__.push({size:om(n,Qg),type:t+(r.__dir__<0?"Right":"")}),r},Hi.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),ua(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Hi.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:dd(t),type:n}),e.__filtered__=e.__filtered__||r,e}})),ua(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Hi.prototype[t]=function(){return this[n](1).value()[0]}})),ua(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Hi.prototype[t]=function(){return this.__filtered__?new Hi(this):this[n](1)}})),Hi.prototype.compact=function(){return this.filter(si)},Hi.prototype.find=function(t){return this.filter(t).head()},Hi.prototype.findLast=function(t){return this.reverse().find(t)},Hi.prototype.invokeMap=ls((function(t,e){return"function"==typeof t?new Hi(this):this.map((function(n){return vf(n,t,e)}))})),Hi.prototype.reject=function(t){return this.filter(ey(dd(t)))},Hi.prototype.slice=function(t,e){t=ai(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Hi(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=ai(e))<0?n.dropRight(-e):n.take(e-t)),n)},Hi.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Hi.prototype.toArray=function(){return this.take(Qg)},gd(Hi.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),o=Zi[r?"take"+("last"==e?"Right":""):e],i=r||/^find/.test(e);o&&(Zi.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,s=e instanceof Hi,u=a[0],l=s||zo(e),c=function(t){var e=o.apply(Zi,Eu([t],a));return r&&p?e[0]:e};l&&n&&"function"==typeof u&&1!=u.length&&(s=l=!1);var p=this.__chain__,d=!!this.__actions__.length,h=i&&!p,f=s&&!d;if(!i&&l){e=f?e:new Hi(this);var y=t.apply(e,a);return y.__actions__.push({func:ng,args:[c],thisArg:void 0}),new Yi(y,p)}return h&&f?t.apply(this,a):(y=this.thru(c),h?r?y.value()[0]:y.value():y)})})),ua(["pop","push","shift","sort","splice","unshift"],(function(t){var e=tm[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Zi.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(zo(o)?o:[],t)}return this[n]((function(n){return e.apply(zo(n)?n:[],t)}))}})),gd(Hi.prototype,(function(t,e){var n=Zi[e];if(n){var r=n.name+"";em.call(Wi,r)||(Wi[r]=[]),Wi[r].push({name:e,func:n})}})),Wi[ka(void 0,2).name]=[{name:"wrapper",func:void 0}],Hi.prototype.clone=function(){var t=new Hi(this.__wrapped__);return t.__actions__=Vi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Vi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Vi(this.__views__),t},Hi.prototype.reverse=function(){if(this.__filtered__){var t=new Hi(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Hi.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=zo(t),r=e<0,o=n?t.length:0,i=function(t,e,n){for(var r=-1,o=n.length;++r<o;){var i=n[r],a=i.size;switch(i.type){case"drop":t+=a;break;case"dropRight":e-=a;break;case"take":e=Zg(e,t+a);break;case"takeRight":t=qg(t,e-a)}}return{start:t,end:e}}(0,o,this.__views__),a=i.start,s=i.end,u=s-a,l=r?s:a-1,c=this.__iteratees__,p=c.length,d=0,h=Jg(u,this.__takeCount__);if(!n||!r&&o==u&&h==u)return ig(t,this.__actions__);var f=[];t:for(;u--&&d<h;){for(var y=-1,v=t[l+=e];++y<p;){var g=c[y],m=g.iteratee,_=g.type,b=m(v);if(2==_)v=b;else if(!b){if(1==_)continue t;break t}}f[d++]=v}return f},Zi.prototype.at=Yg.at,Zi.prototype.chain=Yg.wrapperChain,Zi.prototype.commit=Yg.commit,Zi.prototype.next=Yg.next,Zi.prototype.plant=Yg.plant,Zi.prototype.reverse=Yg.reverse,Zi.prototype.toJSON=Zi.prototype.valueOf=Zi.prototype.value=Yg.value,Zi.prototype.first=Zi.prototype.head,nm&&(Zi.prototype[nm]=Yg.toIterator);var am,sm,um,lm,cm,pm,dm=200;!function(t){t[t.DEFAULT=1]="DEFAULT",t[t.TEXT_EDIT=2]="TEXT_EDIT",t[t.SHOW_MENU=3]="SHOW_MENU",t[t.ALLOW_CONNECT=4]="ALLOW_CONNECT",t[t.NOT_ALLOW_CONNECT=5]="NOT_ALLOW_CONNECT"}(am||(am={})),function(t){t.NODE="node",t.EDGE="edge",t.GRAPH="graph"}(sm||(sm={})),function(t){t.NODE="node",t.CIRCLE_NODE="circle-node",t.POLYGON_NODE="polygon-node",t.RECT_NODE="rect-node",t.TEXT_NODE="text-node",t.ELLIPSE_NODE="ellipse-node",t.DIAMOND_NODE="diamond-node",t.HTML_NODE="html-node",t.CUSTOM_HTML_NODE="custom-html-node",t.EDGE="edge",t.LINE_EDGE="line-edge",t.POLYLINE_EDGE="polyline-edge",t.BEZIER_EDGE="bezier-edge",t.GRAPH="graph"}(um||(um={})),function(t){t.ELEMENT_CLICK="element:click",t.NODE_ADD="node:add",t.NODE_DELETE="node:delete",t.NODE_CLICK="node:click",t.NODE_DBCLICK="node:dbclick",t.NODE_GROUP_COPY="node:group-copy-add",t.NODE_DND_ADD="node:dnd-add",t.NODE_DND_DRAG="node:dnd-drag",t.NODE_MOUSEDOWN="node:mousedown",t.NODE_DRAGSTART="node:dragstart",t.NODE_DRAG="node:drag",t.NODE_DROP="node:drop",t.NODE_MOUSEUP="node:mouseup",t.NODE_MOUSEMOVE="node:mousemove",t.NODE_MOUSEENTER="node:mouseenter",t.NODE_MOUSELEAVE="node:mouseleave",t.NODE_CONTEXTMENU="node:contextmenu",t.NODE_ROTATE="node:rotate",t.NODE_RESIZE="node:resize",t.NODE_PROPERTIES_CHANGE="node:properties-change",t.NODE_PROPERTIES_DELETE="node:properties-delete",t.EDGE_ADD="edge:add",t.EDGE_DELETE="edge:delete",t.EDGE_CLICK="edge:click",t.EDGE_DBCLICK="edge:dbclick",t.EDGE_MOUSEENTER="edge:mouseenter",t.EDGE_MOUSELEAVE="edge:mouseleave",t.EDGE_CONTEXTMENU="edge:contextmenu",t.EDGE_ADJUST="edge:adjust",t.EDGE_EXCHANGE_NODE="edge:exchange-node",t.ANCHOR_DRAGSTART="anchor:dragstart",t.ANCHOR_DRAG="anchor:drag",t.ANCHOR_DROP="anchor:drop",t.ANCHOR_DRAGEND="anchor:dragend",t.ADJUST_POINT_MOUSEDOWN="adjustPoint:mousedown",t.ADJUST_POINT_MOUSEUP="adjustPoint:mouseup",t.ADJUST_POINT_MOUSEMOVE="adjustPoint:mousemove",t.ADJUST_POINT_DRAGSTART="adjustPoint:dragstart",t.ADJUST_POINT_DRAG="adjustPoint:drag",t.ADJUST_POINT_DROP="adjustPoint:drop",t.ADJUST_POINT_DRAGEND="adjustPoint:dragend",t.BLANK_MOUSEDOWN="blank:mousedown",t.BLANK_DRAGSTART="blank:dragstart",t.BLANK_DRAG="blank:drag",t.BLANK_DROP="blank:drop",t.BLANK_MOUSEMOVE="blank:mousemove",t.BLANK_MOUSEUP="blank:mouseup",t.BLANK_CLICK="blank:click",t.BLANK_CONTEXTMENU="blank:contextmenu",t.SELECTION_MOUSEDOWN="selection:mousedown",t.SELECTION_DRAGSTART="selection:dragstart",t.SELECTION_DRAG="selection:drag",t.SELECTION_DROP="selection:drop",t.SELECTION_MOUSEMOVE="selection:mousemove",t.SELECTION_MOUSEUP="selection:mouseup",t.SELECTION_CONTEXTMENU="selection:contextmenu",t.CONNECTION_NOT_ALLOWED="connection:not-allowed",t.HISTORY_CHANGE="history:change",t.TEXT_UPDATE="text:update",t.GRAPH_TRANSFORM="graph:transform",t.GRAPH_RENDERED="graph:rendered"}(lm||(lm={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.INCREASE=1]="INCREASE"}(cm||(cm={})),function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}(pm||(pm={}));var hm,fm=function(){return fm=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},fm.apply(this,arguments)},ym=function(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 o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n};!function(t){t.get=function(e){var n=e.grid,r=ym(e,["grid"]),o=e.container;if(null==o)throw new Error("Ensure the container of LogicFlow is specified and valid.");null==e.width&&(r.width=o.clientWidth),null==e.height&&(r.height=o.clientHeight);var i=Fs({},t.defaults,r),a={size:10,type:"dot",visible:!0,config:{color:"#ababab",thickness:1}};return i.grid=fm(fm({},a),"number"==typeof n?{size:n}:"boolean"==typeof n?{visible:n}:n),i}}(hm||(hm={})),function(t){t.defaults={background:!1,grid:!1,textEdit:!0,snapline:!0,outline:!1,disabledTools:[]}}(hm||(hm={}));var vm={node:!1,edge:!1},gm={node:!0,edge:!0},mm=null!==bu(window,"navigator.userAgent","").match(/MSIE|Trident/);function _m(t){try{return JSON.parse(JSON.stringify(t))}catch(e){return t}}var bm=function(){function t(t){var e=t.onDragStart,n=void 0===e?Xi:e,r=t.onDragging,o=void 0===r?Xi:r,i=t.onDragEnd,a=void 0===i?Xi:i,s=t.eventType,u=void 0===s?"":s,l=t.eventCenter,c=t.step,p=void 0===c?1:c,d=t.isStopPropagation,h=void 0===d||d,f=t.model,y=t.data,v=this;this.isDragging=!1,this.isStartDragging=!1,this.startX=0,this.startY=0,this.sumDeltaX=0,this.sumDeltaY=0,this.handleMouseDown=function(t){var e,n,r=null===window||void 0===window?void 0:window.document;if(0===t.button){v.isStopPropagation&&t.stopPropagation(),v.isStartDragging=!0,v.startX=t.clientX,v.startY=t.clientY,r.addEventListener("mousemove",v.handleMouseMove,!1),r.addEventListener("mouseup",v.handleMouseUp,!1);var o=null===(e=v.model)||void 0===e?void 0:e.getData();null===(n=v.eventCenter)||void 0===n||n.emit(lm["".concat(v.eventType,"_MOUSEDOWN")],{e:t,data:v.data||o}),v.startTime=(new Date).getTime()}},this.handleMouseMove=function(t){var e,n;if(v.isStopPropagation&&t.stopPropagation(),v.isStartDragging&&(v.sumDeltaX+=t.clientX-v.startX,v.sumDeltaY+=t.clientY-v.startY,v.startX=t.clientX,v.startY=t.clientY,v.step<=1||Math.abs(v.sumDeltaX)>v.step||Math.abs(v.sumDeltaY)>v.step)){var r=v.sumDeltaX%v.step,o=v.sumDeltaY%v.step,i=v.sumDeltaX-r,a=v.sumDeltaY-o;v.sumDeltaX=r,v.sumDeltaY=o;var s=null===(e=v.model)||void 0===e?void 0:e.getData();v.isDragging||(null===(n=v.eventCenter)||void 0===n||n.emit(lm["".concat(v.eventType,"_DRAGSTART")],{e:t,data:v.data||s}),v.onDragStart({event:t})),v.isDragging=!0,Promise.resolve().then((function(){var e,n;v.onDragging({deltaX:i,deltaY:a,event:t}),null===(e=v.eventCenter)||void 0===e||e.emit(lm["".concat(v.eventType,"_MOUSEMOVE")],{e:t,data:v.data||s}),null===(n=v.eventCenter)||void 0===n||n.emit(lm["".concat(v.eventType,"_DRAG")],{e:t,data:v.data||s})}))}},this.handleMouseUp=function(t){var e=window.document;v.isStartDragging=!1,v.isStopPropagation&&t.stopPropagation(),Promise.resolve().then((function(){var n,r,o;e.removeEventListener("mousemove",v.handleMouseMove,!1),e.removeEventListener("mouseup",v.handleMouseUp,!1);var i=null===(n=v.model)||void 0===n?void 0:n.getData();null===(r=v.eventCenter)||void 0===r||r.emit(lm["".concat(v.eventType,"_MOUSEUP")],{e:t,data:v.data||i}),v.isDragging&&(v.isDragging=!1,v.onDragEnd({event:t}),null===(o=v.eventCenter)||void 0===o||o.emit(lm["".concat(v.eventType,"_DROP")],{e:t,data:v.data||i}))}))},this.cancelDrag=function(){var t=null===window||void 0===window?void 0:window.document;t.removeEventListener("mousemove",v.handleMouseMove,!1),t.removeEventListener("mouseup",v.handleMouseUp,!1),v.onDragEnd({event:null}),v.isDragging=!1},this.onDragStart=n,this.onDragging=o,this.onDragEnd=a,this.step=p,this.isStopPropagation=h,this.eventType=u,this.eventCenter=l,this.model=f,this.data=y}return t.prototype.setStep=function(t){this.step=t},t.prototype.setModel=function(t){this.model=t},t}(),xm=function(t){var e=t.start,n=t.end,r=t.offset,o=t.verticalLength,i=t.type,a={leftX:0,leftY:0,rightX:0,rightY:0},s=Math.atan((n.y-e.y)/(n.x-e.x)),u=Math.atan(r/o),l=Math.sqrt(o*o+r*r);return"start"===i?n.x>=e.x?(a.leftX=e.x+l*Math.sin(s+u),a.leftY=e.y-l*Math.cos(s+u),a.rightX=e.x-l*Math.sin(s-u),a.rightY=e.y+l*Math.cos(s-u)):(a.leftX=e.x-l*Math.sin(s+u),a.leftY=e.y+l*Math.cos(s+u),a.rightX=e.x+l*Math.sin(s-u),a.rightY=e.y-l*Math.cos(s-u)):"end"===i&&(n.x>=e.x?(a.leftX=n.x+l*Math.sin(s-u),a.leftY=n.y-l*Math.cos(s-u),a.rightX=n.x-l*Math.sin(s+u),a.rightY=n.y+l*Math.cos(s+u)):(a.leftX=n.x-l*Math.sin(s-u),a.leftY=n.y+l*Math.cos(s-u),a.rightX=n.x+l*Math.sin(s+u),a.rightY=n.y-l*Math.cos(s+u))),a},Em=function(t,e,n){var r=t.x,o=t.y,i=e.x,a=e.y,s=n.x,u=n.y,l=(u-a)/(s-i),c=a-l*i;return r>=i&&r<=s&&o>=a&&o<=u&&Math.abs(o-l*r+c)<Number.EPSILON},wm=function(){return wm=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},wm.apply(this,arguments)},Om=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Mm=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},Sm=function(t){var e=[],n={};return t.forEach((function(t){var e="".concat(t.x,"-").concat(t.y);t.id=e,n[e]=t})),Object.keys(n).forEach((function(t){e.push(n[t])})),e},Am=function(t,e){return 0===t.width&&0===t.height?t:{x:t.x,y:t.y,centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}},Pm=function(t,e,n){var r=function(t,e){var n=Math.abs(t.x-e.centerX),r=Math.abs(t.y-e.centerY);return n/e.width>r/e.height?pm.HORIZONTAL:pm.VERTICAL}(n,e);return r===pm.HORIZONTAL?{x:n.x>t.centerX?t.maxX:t.minX,y:n.y}:{x:n.x,y:n.y>t.centerY?t.maxY:t.minY}},Nm=function(t,e){var n=Math.min(t.minX,e.minX),r=Math.min(t.minY,e.minY),o=Math.max(t.maxX,e.maxX),i=Math.max(t.maxY,e.maxY);return{x:(n+o)/2,y:(r+i)/2,centerX:(n+o)/2,centerY:(r+i)/2,minX:n,minY:r,maxX:o,maxY:i,height:i-r,width:o-n}},Tm=function(t,e){void 0===t&&(t=[]);var n=[],r=[];t.forEach((function(t){n.push(t.x),r.push(t.y)}));var o=Math.min.apply(Math,Mm([],Om(n),!1)),i=Math.max.apply(Math,Mm([],Om(n),!1)),a=Math.min.apply(Math,Mm([],Om(r),!1)),s=Math.max.apply(Math,Mm([],Om(r),!1)),u=i-o,l=s-a;return e&&(u+=e,l+=e),{centerX:(o+i)/2,centerY:(a+s)/2,maxX:i,maxY:s,minX:o,minY:a,x:(o+i)/2,y:(a+s)/2,height:l,width:u}},Dm=function(t){var e=t.minX,n=t.minY,r=t.maxX,o=t.maxY;return[{x:e,y:n},{x:r,y:n},{x:r,y:o},{x:e,y:o}]},jm=function(t,e){var n=t.x,r=t.y;return n<e.minX||n>e.maxX||r<e.minY||r>e.maxY},Cm=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},Im=function(t,e,n,r,o){return Cm(t,e)+Cm(t,n)+function(t,e){var n=0;return e.forEach((function(e){e&&(t.x===e.x&&(n+=-2),t.y===e.y&&(n+=-2))})),n}(t,[e,n,r,o])},km=function(t,e,n,r,o){o||(o=0),t.unshift(e[r]),n[r]&&n[r]!==r&&o<=100&&km(t,e,n,n[r],o+1)},Rm=function(t,e,n,r){var o=e.x-t.x,i=e.y-t.y,a=r.x-n.x,s=r.y-n.y,u=(-i*(t.x-n.x)+o*(t.y-n.y))/(-a*i+o*s),l=(a*(t.y-n.y)-s*(t.x-n.x))/(-a*i+o*s);return u>=0&&u<=1&&l>=0&&l<=1},Lm=function(t,e,n){if(0===n.width&&0===n.height)return!1;var r=Om(Dm(n),4),o=r[0],i=r[1],a=r[2],s=r[3];return Rm(t,e,o,i)||Rm(t,e,o,s)||Rm(t,e,i,a)||Rm(t,e,a,s)},Bm=function(t,e,n,r,o,i,a){var s=[],u=[e],l={},c={},p={};e.id&&(c[e.id]=0,p[e.id]=Im(e,n,e));var d={};t.forEach((function(t){t.id&&(d[t.id]=t)}));for(var h=function(){var h,f,y,v,g=1/0;if(u.forEach((function(t){t.id&&p[t.id]<g&&(g=p[t.id],h=t)})),h===n&&n.id){var m=[];return km(m,d,l,n.id),{value:m}}if(!h)return{value:[e,n]};y=h,(v=(f=u).indexOf(y))>-1&&f.splice(v,1),s.push(h),function(t,e,n,r){var o=[];return t.forEach((function(t){t!==e&&(t.x!==e.x&&t.y!==e.y||Lm(t,e,n)||Lm(t,e,r)||o.push(t))})),Sm(o)}(t,h,r,o).forEach((function(t){if(-1===s.indexOf(t)&&(-1===u.indexOf(t)&&u.push(t),(null==h?void 0:h.id)&&(null==t?void 0:t.id))){var r=p[h.id]+Cm(h,t);if(c[t.id]&&r>=c[t.id])return;l[t.id]=h.id,c[t.id]=r,p[t.id]=c[t.id]+Im(t,n,e,i,a)}}))};u.length;){var f=h();if("object"==typeof f)return f.value}return[e,n]},zm=function(t){return A_(t)},Hm=function(t){for(var e=1;e<t.length-1;){var n=t[e-1],r=t[e],o=t[e+1];n.x===r.x&&r.x===o.x||n.y===r.y&&r.y===o.y?t.splice(e,1):e++}return t},Xm=function(t,e,n,r,o){var i,a,s=zm(n),u=zm(r),l=Am(s,o),c=Am(u,o),p=Pm(l,s,t),d=Pm(c,u,e);if(i=l,a=c,2*Math.abs(i.centerX-a.centerX)<i.width+a.width&&2*Math.abs(i.centerY-a.centerY)<i.height+a.height){var h=Vm(t,e,p,d);return Mm(Mm([t,p],Om(h),!1),[d,e],!1)}var f=Tm([p,d]),y=Nm(l,f),v=Nm(c,f),g=[];g=(g=g.concat(Dm(y))).concat(Dm(v));var m={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[f,y,v].forEach((function(t){g=g.concat(function(t,e){return Mm(Mm([],Om(function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]}(t,e.x)),!1),Om(function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]}(t,e.y)),!1)}(t,m).filter((function(t){return jm(t,l)&&jm(t,c)})))})),[{x:p.x,y:d.y},{x:d.x,y:p.y}].forEach((function(t){jm(t,l)&&jm(t,c)&&g.push(t)})),g.unshift(p),g.push(d),g=Sm(g);var _=Bm(g,p,d,s,u,t,e);return _.unshift(t),_.push(e),_.length>2&&(_=Hm(_)),Sm(_)},Gm=function(t,e,n){var r=M_(t,n),o=M_(e,n);return r&&o},Wm=function(t,e,n){var r=M_(t,n),o=M_(e,n);return!(r&&o)&&(r||o)},Fm=function(t,e,n){for(var r,o=void 0,i=A_(n),a=Dm(i),s=0;s<a.length;s++){Rm(t,e,a[s],a[(s+1)%a.length])&&(o=[a[s],a[(s+1)%a.length]])}return o&&(r=function(t,e,n,r){var o=(e.y-t.y)*(r.x-n.x)-(t.x-e.x)*(n.y-r.y);if(0===o)return!1;var i=((e.x-t.x)*(r.x-n.x)*(n.y-t.y)+(e.y-t.y)*(r.x-n.x)*t.x-(r.y-n.y)*(e.x-t.x)*n.x)/o,a=-((e.y-t.y)*(r.y-n.y)*(n.x-t.x)+(e.x-t.x)*(r.y-n.y)*t.y-(r.x-n.x)*(e.y-t.y)*n.y)/o;return(i-t.x)*(i-e.x)<=0&&(a-t.y)*(a-e.y)<=0&&(i-n.x)*(i-r.x)<=0&&(a-n.y)*(a-r.y)<=0&&{x:i,y:a}}(t,e,o[0],o[1])),r},Um=function(t,e){var n=void 0;return t.x===e.x?n=pm.VERTICAL:t.y===e.y&&(n=pm.HORIZONTAL),n},Ym=function(t){var e=t.split(" "),n=[];return e&&e.forEach((function(t){var e=Om(t.split(","),2),r=e[0],o=e[1];n.push({x:Number(r),y:Number(o)})})),n},Vm=function(t,e,n,r){var o=[];if(Um(t,n)===Um(e,r))t.y===n.y?(o.push({x:n.x,y:(n.y+r.y)/2}),o.push({x:r.x,y:(n.y+r.y)/2})):(o.push({x:(n.x+r.x)/2,y:n.y}),o.push({x:(n.x+r.x)/2,y:r.y}));else{var i={x:n.x,y:r.y},a=Em(i,t,n),s=Em(i,e,r);if(a||s)i={x:r.x,y:n.y};else{var u=Km(i,t,n),l=Km(i,e,r);u&&l&&(i={x:r.x,y:n.y})}o.push(i)}return o},Km=function(t,e,n){return t.x===e.x&&t.x===n.x||t.y===e.y&&t.y===n.y},qm=function(t){if(!t)return 0;for(var e=0,n=0;n<t.length;n++){var r=t.charCodeAt(n);t.match(/[A-Z]/)?e+=1.5:e+=r>=1&&r<=126||r>=65376&&r<=65439?1:2}return e},Zm=function(t){var e=t.start,n=t.end,r=t.sourceNode,o=t.targetNode,i=t.offset,a=A_(r),s=A_(o),u=Am(a,i),l=Am(s,i);return{sNext:Pm(u,a,e),ePre:Pm(l,s,n)}},Jm=function(t){var e=t.replace(/M/g,"").replace(/C/g,",").split(",");return[$m(e[0]),$m(e[1]),$m(e[2]),$m(e[3])]},$m=function(t){var e=Om(t.replace(/(^\s*)/g,"").split(" "),2);return{x:+e[0],y:+e[1]}},Qm=function(t,e){var n=Om(t,4),r=function(t,e,n,r,o){var i=function(o){if(o<0||o>1)throw new RangeError('The value range of parameter "t" is [0,1]');return{x:t.x*Math.pow(1-o,3)+3*e.x*o*Math.pow(1-o,2)+3*n.x*Math.pow(o,2)*(1-o)+r.x*Math.pow(o,3),y:t.y*Math.pow(1-o,3)+3*e.y*o*Math.pow(1-o,2)+3*n.y*Math.pow(o,2)*(1-o)+r.y*Math.pow(o,3)}},a=0,s=2,u=r.x,l=r.y,c=r;for(;a<o&&s<50;){var p=(c=i(1-s/ab)).x,d=c.y;a=O_(u,l,p,d),s++}return c}(n[0],n[1],n[2],n[3],e);return[r,t[3]]},t_=function(t,e){for(var n,r=t.x,o=t.y,i=Ym(e),a=Number.MAX_SAFE_INTEGER,s=[],u=0;u<i.length;u++)s.push({start:i[u],end:i[(u+1)%i.length]});if(s.forEach((function(t){var e=t.start,i=t.end;if(e.x===i.x){var s={x:e.x,y:o};if(Em(s,e,i))(u=Math.abs(e.x-r))<a&&(a=u,n=s)}else if(e.y===i.y){var u;s={x:r,y:e.y};if(Em(s,e,i))(u=Math.abs(e.y-o))<a&&(a=u,n=s)}})),!n){var l=s[0],c=l.start,p=l.end;n={x:c.x+(p.x-c.x)/2,y:c.y+(p.y-c.y)/2}}return n},e_=function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};var n_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},r_=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))};function o_(t,e){return e*Math.round(t/e)||t}var i_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},a_=function(t,e,n){var r=i_(t,2),o=r[0],i=r[1],a=i_(e,2),s=a[0],u=a[1],l=i_(n,2),c=l[0],p=l[1];return o>s&&o<c&&i>u&&i<p},s_=function(t,e){var n=!1;switch(e.multipleSelectKey){case"meta":n=t.metaKey;break;case"alt":n=t.altKey;break;case"shift":n=t.shiftKey;break;case"ctrl":n=t.ctrlKey;break;default:n=!1}return n},u_=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function l_(t,e){return!!(t instanceof p_&&e instanceof p_)}var c_=function(t){function e(n,r,o){var i=t.call(this,3)||this;return i[0]=n,i[1]=r,i[2]=o,i.x=n,i.y=r,i.z=o,Object.setPrototypeOf(i,e.prototype),i}return u_(e,t),e.prototype.add=function(t){if(l_(this,t))return new p_(this.x+t.x,this.y+t.y);var e=this.z+t.z;return new d_((this.x+t.x)/e,(this.y+t.y)/e)},e.prototype.subtract=function(t){if(l_(this,t))return new p_(this.x-t.x,this.y-t.y);var e=this.z-t.z;return 0===e?new p_(this.x-t.x,this.y-t.y):new d_((this.x-t.x)/e,(this.y-t.y)/e)},e}(Array),p_=function(t){function e(n,r,o){var i=t.call(this,n,r,null!=o?o:0)||this;return Object.setPrototypeOf(i,e.prototype),i}return u_(e,t),e.prototype.toString=function(){return"Vector"},e.prototype.dot=function(t){var e=this;return t.reduce((function(t,n,r){return t+n*e[r]}))},e.prototype.cross=function(t){return new e(this.y*t.z-this.z*t.y,this.z*t.x-this.x*t.z,this.x*t.y-this.y*t.x)},e.prototype.getLength=function(){return Math.hypot(this.x,this.y)},e.prototype.normalize=function(){var t=this.getLength();return new e(this.x/t,this.y/t)},e.prototype.crossZ=function(t){return this.x*t.y-this.y*t.x},e.prototype.angle=function(t){var e=this.crossZ(t),n=Math.acos(this.normalize().dot(t.normalize()));return e>=0?n:-n},e}(c_),d_=function(t){function e(n,r){var o=t.call(this,n,r,1)||this;return Object.setPrototypeOf(o,e.prototype),o}return u_(e,t),e.prototype.toString=function(){return"Point"},e}(c_),h_=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),f_=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},y_=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},v_=function(t){function e(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=t.call(this,n.length)||this;return o.fill(new Array(3)),n.forEach((function(t,e){o[e]=t})),o.columns=n[0].length,o.rows=n.length,Object.setPrototypeOf(o,e.prototype),o}return h_(e,t),e.prototype.getRow=function(t){return this[t]},e.prototype.getColumn=function(t){return y_([],f_(this.map((function(e){return e[t]}))),!1)},e.prototype.transpose=function(){for(var t=[],n=0;n<this.columns;n++)t.push(this.getColumn(n));return new(e.bind.apply(e,y_([void 0],f_(t),!1)))},e.prototype.cross=function(t){var n=new Array(this.rows).fill("").map((function(){return[]}));if(this.columns===t.rows)for(var r=0;r<this.rows;r++)for(var o=this.getRow(r),i=function(e){var i=t.getColumn(e);n[r][e]=o.reduce((function(t,e,n){return t+e*i[n]}),0)},a=0;a<t.columns;a++)i(a);return new(e.bind.apply(e,y_([void 0],f_(n),!1)))},e.prototype.to2D=function(){return this.map((function(t){return[t[0],t[1]]}))},e.prototype.toPoints=function(){return this.map((function(t){return new d_(t[0],t[1])}))},e.prototype.toString=function(){var t=f_(this[0],2),e=t[0],n=t[1],r=f_(this[1],2),o=r[0],i=r[1],a=f_(this[2],2),s=a[0],u=a[1];return"matrix(".concat(e," ").concat(n," ").concat(o," ").concat(i," ").concat(s," ").concat(u,")")},e.prototype.translate=function(t,e){return this.cross(new __(t,e))},e.prototype.rotate=function(t){return this.cross(new g_(t))},e.prototype.scale=function(t,e){return this.cross(new m_(t,e))},e}(Array),g_=function(t){function e(n){var r=t.call(this,new p_(+Math.cos(n).toFixed(2),+Math.sin(n).toFixed(2),0),new p_(-Math.sin(n).toFixed(2),+Math.cos(n).toFixed(2),0),new p_(0,0,1))||this;return Object.setPrototypeOf(r,e.prototype),r}return h_(e,t),e.prototype.inverse=function(){return this.transpose()},e}(v_),m_=function(t){function e(n,r){var o=t.call(this,new p_(n,0,0),new p_(0,r,0),new p_(0,0,1))||this;return o.sx=n,o.sy=r,Object.setPrototypeOf(o,e.prototype),o}return h_(e,t),e.prototype.inverse=function(){return new e(1/this.sx,1/this.sy)},e}(v_),__=function(t){function e(n,r){var o=t.call(this,new p_(1,0,0),new p_(0,1,0),new p_(n,r,1))||this;return o.tx=n,o.ty=r,Object.setPrototypeOf(o,e.prototype),o}return h_(e,t),e.prototype.inverse=function(){return new e(-this.tx,-this.ty)},e}(v_);Pe({isolateGlobalState:!0});var b_=function(){return b_=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},b_.apply(this,arguments)},x_=function(t){return t.anchors},E_=function(t,e){for(var n,r=e.nodes,o=r.length-1;o>=0;o--){var i=r[o];if(S_(t,i)){var a=i.getTargetAnchor(t);if(a){var s={node:i,anchorIndex:a.index,anchor:a.anchor};n&&!w_(i,n.node,e)||(n=s)}}}return n},w_=function(t,e,n){return t.zIndex>e.zIndex||n.nodesMap[t.id].index>n.nodesMap[e.id].index},O_=function(t,e,n,r){return Math.hypot(t-n,e-r)},M_=function(t,e){var n=!1,r=A_(e);return t.x>=r.minX-0&&t.x<=r.maxX+0&&t.y>=r.minY-0&&t.y<=r.maxY+0&&(n=!0),n},S_=function(t,e){var n=!1,r=A_(e);return t.x>=r.minX-5&&t.x<=r.maxX+5&&t.y>=r.minY-5&&t.y<=r.maxY+5&&(n=!0),n},A_=function(t){var e=t.x,n=t.y,r=t.width,o=t.height;return{minX:e-r/2,minY:n-o/2,maxX:e+r/2,maxY:n+o/2,x:e,y:n,width:r,height:o,centerX:e,centerY:n}},P_=function(t,e,n){var r,o=function(t){var e=t,n=e.x,r=e.y,o=e.width,i=e.height,a=e.radius;return[{x:n-o/2+a,y:r-i/2+a,r:a},{x:n+o/2-a,y:r-i/2+a,r:a},{x:n-o/2+a,y:r+i/2-a,r:a},{x:n+o/2-a,y:r+i/2-a,r:a}]}(n),i=Number.MAX_SAFE_INTEGER;return o.forEach((function(e){var n=O_(t.x,t.y,e.x,e.y);n<i&&(i=n,r=e)})),N_(t,e,r)},N_=function(t,e,n){var r,o=n.x,i=n.y,a=n.r;if(e===pm.HORIZONTAL){var s=o-Math.sqrt(a*a-(t.y-i)*(t.y-i)),u=o+Math.sqrt(a*a-(t.y-i)*(t.y-i));r={x:Math.abs(s-t.x)<Math.abs(u-t.x)?s:u,y:t.y}}else if(e===pm.VERTICAL){var l=i-Math.sqrt(a*a-(t.x-o)*(t.x-o)),c=i+Math.sqrt(a*a-(t.x-o)*(t.x-o)),p=Math.abs(l-t.y)<Math.abs(c-t.y)?l:c;r={x:t.x,y:p}}return r},T_=function(t,e){var n=e,r=!1,o=n.x,i=n.y,a=n.width,s=n.height,u=n.radius,l=o-a/2+u,c=o+a/2-u,p=i-s/2+u,d=i+s/2-u;return t.y===i+s/2||t.y===i-s/2?r=t.x>l&&t.x<c:t.x!==o+a/2&&t.x!==o-a/2||(r=t.y>p&&t.y<d),r},D_=function(t,e,n){var r,o=n,i=o.x,a=o.y,s=o.rx,u=o.ry;if(e===pm.HORIZONTAL){var l=i-Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(u*u)),c=i+Math.sqrt(s*s-(t.y-a)*(t.y-a)*s*s/(u*u));r={x:Math.abs(l-t.x)<Math.abs(c-t.x)?l:c,y:t.y}}else if(e===pm.VERTICAL){var p=a-Math.sqrt(u*u-(t.x-i)*(t.x-i)*u*u/(s*s)),d=a+Math.sqrt(u*u-(t.x-i)*(t.x-i)*u*u/(s*s)),h=Math.abs(p-t.y)<Math.abs(d-t.y)?p:d;r={x:t.x,y:h}}return r},j_=function(t,e,n){for(var r,o=n.pointsPosition,i=Number.MAX_SAFE_INTEGER,a=[],s=0;s<o.length;s++)a.push({start:o[s],end:o[(s+1)%o.length]});return a.forEach((function(n){var o=n.start,a=n.end,s=o,u=a;o.x>a.x&&(s=a,u=o);var l={x:t.x,y:t.y};if(s.x===u.x&&e===pm.HORIZONTAL&&(l={x:s.x,y:t.y}),s.y===u.y&&e===pm.VERTICAL&&(l={x:t.x,y:s.y}),s.x!==u.x&&s.y!==u.y){var c=(u.y-s.y)/(u.x-s.x),p=(s.x*u.y-u.x*s.y)/(s.x-u.x);e===pm.HORIZONTAL?l={x:(t.y-p)/c,y:t.y}:e===pm.VERTICAL&&(l={x:t.x,y:c*t.x+p})}if(Em(l,o,a)){var d=O_(l.x,l.y,t.x,t.y);d<i&&(i=d,r=l)}})),r},C_=function(t,e,n,r){var o=t.x,i=t.y;return e.x>t.x?o=t.x+n/2:e.x<t.x&&(o=t.x-n/2),e.y>t.y?i=t.y+r/2:e.y<t.y&&(i=t.y-r/2),{x:o,y:i}},I_=function(t){var e=t.rows,n=t.style,r=t.rowsLength,o=t.className,i=document.createElement("div");i.style.fontSize=n.fontSize,i.style.width=n.width,i.className=o,i.style.lineHeight=n.lineHeight,i.style.padding=n.padding,n.fontFamily&&(i.style.fontFamily=n.fontFamily),r>1?e.forEach((function(t){var e=document.createElement("div");e.textContent=t,i.appendChild(e)})):i.textContent=e[0],document.body.appendChild(i);var a=i.clientHeight;return document.body.removeChild(i),a},k_=function(t){var e=t.rows,n=t.rowsLength,r=t.fontSize,o=0;return e&&e.forEach((function(t){var e=qm(t);o=e>o?e:o})),{width:Math.ceil(o/2)*r+r/4,height:n*(r+2)+r/4}},R_=function(t){return"object"!=typeof t?{isAllPass:!!t,msg:t?"":"不允许连接"}:t};let L_;const B_=new Uint8Array(16);function z_(){if(!L_&&(L_="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!L_))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return L_(B_)}var H_=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const X_=[];for(let t=0;t<256;++t)X_.push((t+256).toString(16).slice(1));function G_(t,e=0){return X_[t[e+0]]+X_[t[e+1]]+X_[t[e+2]]+X_[t[e+3]]+"-"+X_[t[e+4]]+X_[t[e+5]]+"-"+X_[t[e+6]]+X_[t[e+7]]+"-"+X_[t[e+8]]+X_[t[e+9]]+"-"+X_[t[e+10]]+X_[t[e+11]]+X_[t[e+12]]+X_[t[e+13]]+X_[t[e+14]]+X_[t[e+15]]}function W_(t){if(!function(t){return"string"==typeof t&&H_.test(t)}(t))throw TypeError("Invalid UUID");let e;const n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=255&e,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=255&e,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=255&e,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=255&e,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=255&e,n}function F_(t,e,n){function r(t,r,o,i){var a;if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));const e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e}(t)),"string"==typeof r&&(r=W_(r)),16!==(null===(a=r)||void 0===a?void 0:a.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let s=new Uint8Array(16+t.length);if(s.set(r),s.set(t,r.length),s=n(s),s[6]=15&s[6]|e,s[8]=63&s[8]|128,o){i=i||0;for(let t=0;t<16;++t)o[i+t]=s[t];return o}return G_(s)}try{r.name=t}catch(t){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}function U_(t){return 14+(t+64>>>9<<4)+1}function Y_(t,e){const n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function V_(t,e,n,r,o,i){return Y_((a=Y_(Y_(e,t),Y_(r,i)))<<(s=o)|a>>>32-s,n);var a,s}function K_(t,e,n,r,o,i,a){return V_(e&n|~e&r,t,e,o,i,a)}function q_(t,e,n,r,o,i,a){return V_(e&r|n&~r,t,e,o,i,a)}function Z_(t,e,n,r,o,i,a){return V_(e^n^r,t,e,o,i,a)}function J_(t,e,n,r,o,i,a){return V_(n^(e|~r),t,e,o,i,a)}F_("v3",48,(function(t){if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n)}return function(t){const e=[],n=32*t.length,r="0123456789abcdef";for(let o=0;o<n;o+=8){const n=t[o>>5]>>>o%32&255,i=parseInt(r.charAt(n>>>4&15)+r.charAt(15&n),16);e.push(i)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[U_(e)-1]=e;let n=1732584193,r=-271733879,o=-1732584194,i=271733878;for(let e=0;e<t.length;e+=16){const a=n,s=r,u=o,l=i;n=K_(n,r,o,i,t[e],7,-680876936),i=K_(i,n,r,o,t[e+1],12,-389564586),o=K_(o,i,n,r,t[e+2],17,606105819),r=K_(r,o,i,n,t[e+3],22,-1044525330),n=K_(n,r,o,i,t[e+4],7,-176418897),i=K_(i,n,r,o,t[e+5],12,1200080426),o=K_(o,i,n,r,t[e+6],17,-1473231341),r=K_(r,o,i,n,t[e+7],22,-45705983),n=K_(n,r,o,i,t[e+8],7,1770035416),i=K_(i,n,r,o,t[e+9],12,-1958414417),o=K_(o,i,n,r,t[e+10],17,-42063),r=K_(r,o,i,n,t[e+11],22,-1990404162),n=K_(n,r,o,i,t[e+12],7,1804603682),i=K_(i,n,r,o,t[e+13],12,-40341101),o=K_(o,i,n,r,t[e+14],17,-1502002290),r=K_(r,o,i,n,t[e+15],22,1236535329),n=q_(n,r,o,i,t[e+1],5,-165796510),i=q_(i,n,r,o,t[e+6],9,-1069501632),o=q_(o,i,n,r,t[e+11],14,643717713),r=q_(r,o,i,n,t[e],20,-373897302),n=q_(n,r,o,i,t[e+5],5,-701558691),i=q_(i,n,r,o,t[e+10],9,38016083),o=q_(o,i,n,r,t[e+15],14,-660478335),r=q_(r,o,i,n,t[e+4],20,-405537848),n=q_(n,r,o,i,t[e+9],5,568446438),i=q_(i,n,r,o,t[e+14],9,-1019803690),o=q_(o,i,n,r,t[e+3],14,-187363961),r=q_(r,o,i,n,t[e+8],20,1163531501),n=q_(n,r,o,i,t[e+13],5,-1444681467),i=q_(i,n,r,o,t[e+2],9,-51403784),o=q_(o,i,n,r,t[e+7],14,1735328473),r=q_(r,o,i,n,t[e+12],20,-1926607734),n=Z_(n,r,o,i,t[e+5],4,-378558),i=Z_(i,n,r,o,t[e+8],11,-2022574463),o=Z_(o,i,n,r,t[e+11],16,1839030562),r=Z_(r,o,i,n,t[e+14],23,-35309556),n=Z_(n,r,o,i,t[e+1],4,-1530992060),i=Z_(i,n,r,o,t[e+4],11,1272893353),o=Z_(o,i,n,r,t[e+7],16,-155497632),r=Z_(r,o,i,n,t[e+10],23,-1094730640),n=Z_(n,r,o,i,t[e+13],4,681279174),i=Z_(i,n,r,o,t[e],11,-358537222),o=Z_(o,i,n,r,t[e+3],16,-722521979),r=Z_(r,o,i,n,t[e+6],23,76029189),n=Z_(n,r,o,i,t[e+9],4,-640364487),i=Z_(i,n,r,o,t[e+12],11,-421815835),o=Z_(o,i,n,r,t[e+15],16,530742520),r=Z_(r,o,i,n,t[e+2],23,-995338651),n=J_(n,r,o,i,t[e],6,-198630844),i=J_(i,n,r,o,t[e+7],10,1126891415),o=J_(o,i,n,r,t[e+14],15,-1416354905),r=J_(r,o,i,n,t[e+5],21,-57434055),n=J_(n,r,o,i,t[e+12],6,1700485571),i=J_(i,n,r,o,t[e+3],10,-1894986606),o=J_(o,i,n,r,t[e+10],15,-1051523),r=J_(r,o,i,n,t[e+1],21,-2054922799),n=J_(n,r,o,i,t[e+8],6,1873313359),i=J_(i,n,r,o,t[e+15],10,-30611744),o=J_(o,i,n,r,t[e+6],15,-1560198380),r=J_(r,o,i,n,t[e+13],21,1309151649),n=J_(n,r,o,i,t[e+4],6,-145523070),i=J_(i,n,r,o,t[e+11],10,-1120210379),o=J_(o,i,n,r,t[e+2],15,718787259),r=J_(r,o,i,n,t[e+9],21,-343485551),n=Y_(n,a),r=Y_(r,s),o=Y_(o,u),i=Y_(i,l)}return[n,r,o,i]}(function(t){if(0===t.length)return[];const e=8*t.length,n=new Uint32Array(U_(e));for(let r=0;r<e;r+=8)n[r>>5]|=(255&t[r/8])<<r%32;return n}(t),8*t.length))}));var $_={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Q_(t,e,n){if($_.randomUUID&&!e&&!t)return $_.randomUUID();const r=(t=t||{}).random||(t.rng||z_)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=r[t];return e}return G_(r)}function tb(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:case 3:return e^n^r;case 2:return e&n^e&r^n&r}}function eb(t,e){return t<<e|t>>>32-e}F_("v5",80,(function(t){const e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);const r=t.length/4+2,o=Math.ceil(r/16),i=new Array(o);for(let e=0;e<o;++e){const n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=t[64*e+4*r]<<24|t[64*e+4*r+1]<<16|t[64*e+4*r+2]<<8|t[64*e+4*r+3];i[e]=n}i[o-1][14]=8*(t.length-1)/Math.pow(2,32),i[o-1][14]=Math.floor(i[o-1][14]),i[o-1][15]=8*(t.length-1)&4294967295;for(let t=0;t<o;++t){const r=new Uint32Array(80);for(let e=0;e<16;++e)r[e]=i[t][e];for(let t=16;t<80;++t)r[t]=eb(r[t-3]^r[t-8]^r[t-14]^r[t-16],1);let o=n[0],a=n[1],s=n[2],u=n[3],l=n[4];for(let t=0;t<80;++t){const n=Math.floor(t/20),i=eb(o,5)+tb(n,a,s,u)+l+e[n]+r[t]>>>0;l=u,u=s,s=eb(a,30)>>>0,a=o,o=i}n[0]=n[0]+o>>>0,n[1]=n[1]+a>>>0,n[2]=n[2]+s>>>0,n[3]=n[3]+u>>>0,n[4]=n[4]+l>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));var nb=function(){return Q_()},rb=new Map,ob=function(t){var e=nb();var n=window.requestAnimationFrame((function n(){if(t(),rb.get(e)){var r=window.requestAnimationFrame(n);rb.set(e,r)}}));return rb.set(e,n),e},ib=function(t){var e=rb.get(t);e&&(window.cancelAnimationFrame(e),rb.delete(t))},ab=100,sb={x:1,y:0,z:0};function ub(t){var e=Math.hypot(t.x,t.y);return{x:t.x/e,y:t.y/e,z:0}}function lb(t){return function(t,e){var n=function(t,e){return t.x*e.y-t.y*e.x}(t,e),r=Math.acos(function(t,e){var n=[t.x,t.y,t.z];return[e.x,e.y,e.z].reduce((function(t,e,r){return t+e*n[r]}))}(ub(t),ub(e)));return n>=0?r:-r}(sb,t)}var cb={baseNode:{fill:"#fff",stroke:"#000",strokeWidth:2},baseEdge:{stroke:"#000",strokeWidth:2},rect:{},circle:{},diamond:{},ellipse:{},polygon:{},text:{color:"#000",stroke:"none",fontSize:12,background:{fill:"transparent"}},anchor:{stroke:"#000",fill:"#fff",r:4,hover:{r:10,fill:"#949494",fillOpacity:.5,stroke:"#949494"}},anchorLine:{stroke:"#000",strokeWidth:2,strokeDasharray:"3,2"},nodeText:{color:"#000",overflowMode:"default",fontSize:12,lineHeight:1.2},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"#fff"}},line:{},polyline:{},bezier:{fill:"none",adjustLine:{stroke:"#949494"},adjustAnchor:{r:4,fill:"#949494",fillOpacity:1,stroke:"#949494"}},arrow:{offset:10,verticalLength:5},snapline:{stroke:"#949494",strokeWidth:1},edgeAdjust:{r:4,fill:"#fff",stroke:"#949494",strokeWidth:2},outline:{fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},edgeAnimation:{stroke:"red",strokeDasharray:"10,10",strokeDashoffset:"100%",animationName:"lf_animate_dash",animationDuration:"20s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"normal"},rotateControl:{stroke:"#000",fill:"#fff",strokeWidth:1.5},resizeControl:{width:7,height:7,fill:"#fff",stroke:"#000"},resizeOutline:{fill:"none",stroke:"transparent",strokeWidth:1,strokeDasharray:"3,3"}},pb=function(t){var e=mp(cb);return t&&(e=qf(e,t)),e},db=pb,hb=1e3,fb=999,yb=function(){return++hb},vb=function(){return vb=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},vb.apply(this,arguments)},gb=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},mb=function(){function t(t,e){this.BaseType=sm.EDGE,this.id="",this.type="",this.sourceNodeId="",this.targetNodeId="",this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this.properties={},this.points="",this.pointsList=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.isAnimation=!1,this.isShowAdjustPoint=!1,this.zIndex=0,this.state=am.DEFAULT,this.modelType=um.EDGE,this.customTextPosition=!1,this.style={},this.arrowConfig={markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")},this.graphModel=e,this.initEdgeData(t),this.setAttributes()}return t.prototype.initEdgeData=function(t){if(t.properties||(t.properties={}),!t.id){var e=this.graphModel.idGenerator,n=e&&e(t.type),r=this.createId();t.id=r||n||nb()}this.arrowConfig.markerEnd="url(#marker-end-".concat(t.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(t.id,")");var o=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=o,Fs(this,function(t){return Ky(t,["id","type","sourceNodeId","sourceAnchorId","targetNodeId","targetAnchorId","pointsList","startPoint","endPoint","properties"])}(t)),this.graphModel.overlapMode===cm.INCREASE&&(this.zIndex=t.zIndex||yb()),this.setAnchors(),this.initPoints(),this.formatText(t)},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.getEdgeStyle=function(){return vb(vb({},this.graphModel.theme.baseEdge),this.style)},t.prototype.getAdjustPointStyle=function(){return vb({},this.graphModel.theme.edgeAdjust)},t.prototype.getTextStyle=function(){return mp(this.graphModel.theme.edgeText)},t.prototype.getEdgeAnimationStyle=function(){return mp(this.graphModel.theme.edgeAnimation)},t.prototype.getArrowStyle=function(){var t=this.getEdgeStyle(),e=this.getEdgeAnimationStyle(),n=this.graphModel.theme.arrow,r=this.isAnimation?e.stroke:t.stroke;return vb(vb(vb({},t),{fill:r,stroke:r}),n)},t.prototype.getOutlineStyle=function(){return mp(this.graphModel.theme.outline)},t.prototype.getTextPosition=function(){return{x:0,y:0}},Object.defineProperty(t.prototype,"sourceNode",{get:function(){var t,e;return null===(e=null===(t=this.graphModel)||void 0===t?void 0:t.nodesMap[this.sourceNodeId])||void 0===e?void 0:e.model},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"targetNode",{get:function(){var t,e;return null===(e=null===(t=this.graphModel)||void 0===t?void 0:t.nodesMap[this.targetNodeId])||void 0===e?void 0:e.model},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textPosition",{get:function(){return this.getTextPosition()},enumerable:!1,configurable:!0}),t.prototype.getBeginAnchor=function(t,e,n){var r,o,i=x_(t);if(n){if(r=Oh(i,(function(t){return t.id===n})))return r;console.warn("未在节点上找到指定的起点锚点".concat(n,",已使用默认锚点作为起点"))}return i.forEach((function(t){var n=e_(t,e);(void 0===o||n<o)&&(o=n,r=t)})),r},t.prototype.getEndAnchor=function(t,e){var n,r,o=this,i=x_(t);if(e){if(n=Oh(i,(function(t){return t.id===e})))return n;console.warn("未在节点上找到指定的终点锚点".concat(e,",已使用默认锚点作为终点"))}return i.forEach((function(t){if(o.startPoint){var e=e_(t,o.startPoint);(void 0===r||e<r)&&(r=e,n=t)}})),n},t.prototype.getProperties=function(){return $e(this.properties)},t.prototype.getData=function(){var t=this.text,e=t.x,n=t.y,r=t.value,o={id:this.id,type:this.type,sourceNodeId:this.sourceNode.id,targetNodeId:this.targetNode.id,startPoint:Fs({},this.startPoint),endPoint:Fs({},this.endPoint),properties:$e(this.properties)};return r&&(o.text={x:e,y:n,value:r}),this.graphModel.overlapMode===cm.INCREASE&&(o.zIndex=this.zIndex),o},t.prototype.getHistoryData=function(){return this.getData()},t.prototype.setProperty=function(t,e){this.properties[t]=_m(e),this.setAttributes()},t.prototype.deleteProperty=function(t){delete this.properties[t],this.setAttributes()},t.prototype.setProperties=function(t){this.properties=vb(vb({},$e(this.properties)),_m(t)),this.setAttributes()},t.prototype.changeEdgeId=function(t){var e=this.arrowConfig,n=e.markerEnd,r=e.markerStart;r&&r==="url(#marker-start-".concat(this.id,")")&&(this.arrowConfig.markerStart="url(#marker-start-".concat(t,")")),n&&n==="url(#marker-end-".concat(this.id,")")&&(this.arrowConfig.markerEnd="url(#marker-end-".concat(t,")")),this.id=t},t.prototype.setStyle=function(t,e){var n;this.style=vb(vb({},this.style),((n={})[t]=_m(e),n))},t.prototype.setStyles=function(t){this.style=vb(vb({},this.style),_m(t))},t.prototype.updateStyles=function(t){this.style=vb({},_m(t))},t.prototype.formatText=function(t){var e=this.textPosition,n=e.x,r=e.y;t.text&&"string"!=typeof t.text?"[object Object]"===Object.prototype.toString.call(t.text)&&(this.text={x:t.text.x||n,y:t.text.y||r,value:t.text.value||"",draggable:this.text.draggable,editable:this.text.editable}):this.text={value:t.text||"",x:n,y:r,draggable:this.text.draggable,editable:this.text.editable}},t.prototype.resetTextPosition=function(){var t=this.textPosition,e=t.x,n=t.y;this.text.x=e,this.text.y=n},t.prototype.moveText=function(t,e){if(this.text){var n=this.text,r=n.x,o=n.y,i=n.value,a=n.draggable,s=n.editable;this.text={value:i,draggable:a,x:r+t,y:o+e,editable:s}}},t.prototype.setText=function(t){t&&Fs(this.text,t)},t.prototype.updateText=function(t){this.text=vb(vb({},$e(this.text)),{value:t})},t.prototype.setAnchors=function(){if(!this.sourceAnchorId||!this.startPoint){if(!(t=this.getBeginAnchor(this.sourceNode,this.targetNode,this.sourceAnchorId)))throw new Error("无法获取beginAnchor,请检查anchors相关逻辑,anchors不能为空");this.startPoint||(this.startPoint={x:t.x,y:t.y}),this.sourceAnchorId||(this.sourceAnchorId=t.id)}if(!this.targetAnchorId||!this.endPoint){var t;if(!(t=this.getEndAnchor(this.targetNode,this.targetAnchorId)))throw new Error("无法获取endAnchor,请检查anchors相关逻辑,anchors不能为空");this.endPoint||(this.endPoint={x:t.x,y:t.y}),this.targetAnchorId||(this.targetAnchorId=t.id)}},t.prototype.setSelected=function(t){void 0===t&&(t=!0),this.isSelected=t},t.prototype.setHovered=function(t){void 0===t&&(t=!0),this.isHovered=t},t.prototype.setHitable=function(t){void 0===t&&(t=!0),this.isHitable=t},t.prototype.setHittable=function(t){void 0===t&&(t=!0),this.isHittable=t},t.prototype.openEdgeAnimation=function(){this.isAnimation=!0},t.prototype.closeEdgeAnimation=function(){this.isAnimation=!1},t.prototype.setElementState=function(t,e){this.state=t,this.additionStateData=e},t.prototype.updateStartPoint=function(t){this.startPoint=t},t.prototype.moveStartPoint=function(t,e){this.startPoint&&(this.startPoint.x+=t,this.startPoint.y+=e)},t.prototype.updateEndPoint=function(t){this.endPoint=t},t.prototype.moveEndPoint=function(t,e){this.endPoint&&(this.endPoint.x+=t,this.endPoint.y+=e)},t.prototype.setZIndex=function(t){void 0===t&&(t=0),this.zIndex=t},t.prototype.initPoints=function(){},t.prototype.updateAttributes=function(t){Fs(this,t)},t.prototype.getAdjustStart=function(){return this.startPoint},t.prototype.getAdjustEnd=function(){return this.endPoint},t.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint;this.updateStartPoint({x:e.x,y:e.y}),this.updateEndPoint({x:n.x,y:n.y})},t.BaseType=sm.EDGE,gb([yt],t.prototype,"type",void 0),gb([yt],t.prototype,"sourceNodeId",void 0),gb([yt],t.prototype,"targetNodeId",void 0),gb([yt],t.prototype,"startPoint",void 0),gb([yt],t.prototype,"endPoint",void 0),gb([yt],t.prototype,"text",void 0),gb([yt],t.prototype,"properties",void 0),gb([yt],t.prototype,"points",void 0),gb([yt],t.prototype,"pointsList",void 0),gb([yt],t.prototype,"isSelected",void 0),gb([yt],t.prototype,"isHovered",void 0),gb([yt],t.prototype,"isHitable",void 0),gb([yt],t.prototype,"isHittable",void 0),gb([yt],t.prototype,"draggable",void 0),gb([yt],t.prototype,"visible",void 0),gb([yt],t.prototype,"isAnimation",void 0),gb([yt],t.prototype,"isShowAdjustPoint",void 0),gb([yt],t.prototype,"zIndex",void 0),gb([yt],t.prototype,"state",void 0),gb([yt],t.prototype,"style",void 0),gb([yt],t.prototype,"arrowConfig",void 0),gb([xt],t.prototype,"sourceNode",null),gb([xt],t.prototype,"targetNode",null),gb([xt],t.prototype,"textPosition",null),gb([me],t.prototype,"setProperty",null),gb([me],t.prototype,"deleteProperty",null),gb([me],t.prototype,"setProperties",null),gb([me],t.prototype,"changeEdgeId",null),gb([me],t.prototype,"setStyle",null),gb([me],t.prototype,"setStyles",null),gb([me],t.prototype,"updateStyles",null),gb([me],t.prototype,"formatText",null),gb([me],t.prototype,"resetTextPosition",null),gb([me],t.prototype,"moveText",null),gb([me],t.prototype,"setText",null),gb([me],t.prototype,"updateText",null),gb([me],t.prototype,"setAnchors",null),gb([me],t.prototype,"setSelected",null),gb([me],t.prototype,"setHovered",null),gb([me],t.prototype,"setHitable",null),gb([me],t.prototype,"setHittable",null),gb([me],t.prototype,"openEdgeAnimation",null),gb([me],t.prototype,"closeEdgeAnimation",null),gb([me],t.prototype,"setElementState",null),gb([me],t.prototype,"updateStartPoint",null),gb([me],t.prototype,"moveStartPoint",null),gb([me],t.prototype,"updateEndPoint",null),gb([me],t.prototype,"moveEndPoint",null),gb([me],t.prototype,"setZIndex",null),gb([me],t.prototype,"initPoints",null),gb([me],t.prototype,"updateAttributes",null),gb([me],t.prototype,"getAdjustStart",null),gb([me],t.prototype,"getAdjustEnd",null),gb([me],t.prototype,"updateAfterAdjustStartAndEnd",null),t}(),_b=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),bb=function(){return bb=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},bb.apply(this,arguments)},xb=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},Eb=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},wb=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.modelType=um.BEZIER_EDGE,r.path="",r.initEdgeData(e),r.setAttributes(),r}return _b(e,t),e.prototype.initEdgeData=function(e){this.offset=100,t.prototype.initEdgeData.call(this,e)},e.prototype.getEdgeStyle=function(){var e=this.graphModel.theme.bezier,n=t.prototype.getEdgeStyle.call(this);return bb(bb({},n),mp(e))},e.prototype.getTextPosition=function(){if(this.pointsList&&this.pointsList.length>0){var t=0,e=0;return this.pointsList.forEach((function(n){var r=n.x,o=n.y;t+=r,e+=o})),{x:t/this.pointsList.length,y:e/this.pointsList.length}}return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},e.prototype.getData=function(){var e=t.prototype.getData.call(this),n=this.pointsList.map((function(t){return{x:t.x,y:t.y}}));return bb(bb({},e),{pointsList:n})},e.prototype.getControls=function(){var t=this.startPoint,e=this.endPoint;return Zm({start:t,end:e,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset})},e.prototype.getPath=function(t){var e=Eb(t,4),n=e[0],r=e[1],o=e[2],i=e[3];return"M ".concat(n.x," ").concat(n.y,"\n C ").concat(r.x," ").concat(r.y,",\n ").concat(o.x," ").concat(o.y,",\n ").concat(i.x," ").concat(i.y)},e.prototype.initPoints=function(){this.pointsList.length>0?this.path=this.getPath(this.pointsList):this.updatePoints()},e.prototype.updatePoints=function(){var t=this.getControls(),e=t.sNext,n=t.ePre;this.updatePath(e,n)},e.prototype.updatePath=function(t,e){t=mp(t),e=mp(e);var n={x:this.startPoint.x,y:this.startPoint.y},r={x:this.endPoint.x,y:this.endPoint.y};if(!t||!e){var o=this.getControls();t=o.sNext,e=o.ePre}this.pointsList=[n,t,e,r],this.path=this.getPath(this.pointsList)},e.prototype.updateStartPoint=function(t){this.startPoint=Object.assign({},t),this.updatePoints()},e.prototype.updateEndPoint=function(t){this.endPoint=Object.assign({},t),this.updatePoints()},e.prototype.moveStartPoint=function(t,e){this.startPoint.x+=t,this.startPoint.y+=e;var n=Eb(this.pointsList,3),r=n[1],o=n[2];r.x+=t,r.y+=e,this.updatePath(r,o)},e.prototype.moveEndPoint=function(t,e){this.endPoint.x+=t,this.endPoint.y+=e;var n=Eb(this.pointsList,3),r=n[1],o=n[2];o.x+=t,o.y+=e,this.updatePath(r,o)},e.prototype.updateAdjustAnchor=function(t,e){"sNext"===e?this.pointsList[1]=t:"ePre"===e&&(this.pointsList[2]=t),this.path=this.getPath(this.pointsList),this.setText(Object.assign({},this.text,this.textPosition))},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var t=this.pointsList;return t[t.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint,r=t.sourceNode,o=t.targetNode,i=Zm({start:e,end:n,sourceNode:r,targetNode:o,offset:this.offset}),a=i.sNext,s=i.ePre;this.pointsList=[e,a,s,n],this.initPoints()},xb([yt],e.prototype,"path",void 0),xb([me],e.prototype,"initPoints",null),xb([me],e.prototype,"updatePoints",null),xb([me],e.prototype,"updateStartPoint",null),xb([me],e.prototype,"updateEndPoint",null),xb([me],e.prototype,"moveStartPoint",null),xb([me],e.prototype,"moveEndPoint",null),xb([me],e.prototype,"updateAdjustAnchor",null),xb([me],e.prototype,"getAdjustStart",null),xb([me],e.prototype,"getAdjustEnd",null),xb([me],e.prototype,"updateAfterAdjustStartAndEnd",null),e}(mb),Ob=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mb=function(){return Mb=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Mb.apply(this,arguments)},Sb=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Ab=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},Pb=function(t){function e(){var e=t.apply(this,Ab([],Sb(arguments),!1))||this;return e.modelType=um.LINE_EDGE,e}return Ob(e,t),e.prototype.getEdgeStyle=function(){var e=this.graphModel.theme.line,n=t.prototype.getEdgeStyle.call(this);return Mb(Mb({},n),mp(e))},e.prototype.getTextPosition=function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},e}(mb),Nb=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tb=function(){return Tb=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Tb.apply(this,arguments)},Db=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},jb=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Cb=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},Ib=function(t){function e(){var e=t.apply(this,Cb([],jb(arguments),!1))||this;return e.modelType=um.POLYLINE_EDGE,e.draggingPointList=[],e}return Nb(e,t),e.prototype.initEdgeData=function(e){this.offset=30,t.prototype.initEdgeData.call(this,e)},e.prototype.getEdgeStyle=function(){var e=this.graphModel.theme.polyline,n=t.prototype.getEdgeStyle.call(this);return Tb(Tb({},n),mp(e))},e.prototype.getTextPosition=function(){var t,e=null===(t=this.text)||void 0===t?void 0:t.value;if(this.dbClickPosition&&!e){var n=this.dbClickPosition;return{x:n.x,y:n.y}}var r=Ym(this.points),o=jb(function(t){var e;if(1===t.length)e=[t[0],t[0]];else if(t.length>=2){for(var n=t[0],r=t[1],o=O_(n.x,n.y,r.x,r.y),i=1;i<t.length-1;i++){var a=t[i],s=t[i+1],u=O_(a.x,a.y,s.x,s.y);u>o&&(o=u,n=a,r=s)}e=[n,r]}return e}(r),2),i=o[0],a=o[1];return{x:(i.x+a.x)/2,y:(i.y+a.y)/2}},e.prototype.getAfterAnchor=function(t,e,n){var r,o;return n.forEach((function(n){var i;t===pm.HORIZONTAL?i=Math.abs(e.y-n.y):t===pm.VERTICAL&&(i=Math.abs(e.x-n.x)),(!o||o>i)&&(o=i,r=n)})),r},e.prototype.getCrossPoint=function(t,e,n){var r;return t===pm.HORIZONTAL?r={x:n.x,y:e.y}:t===pm.VERTICAL&&(r={x:e.x,y:n.y}),r},e.prototype.removeCrossPoints=function(t,e,n){var r=n.map((function(t){return t}));if(1===t){var o=r[t],i=r[e],a=r[t-1];if(Gm(a,o,this.sourceNode)){if(Wm(o,i,this.sourceNode))(s=Fm(o,i,this.sourceNode))&&(r[t]=s,r.splice(t-1,1),t--,e--)}else this.sourceNode.anchors.forEach((function(e){(e.x===a.x&&e.x===o.x||e.y===a.y&&e.y===o.y)&&(O_(e.x,e.y,o.x,o.y)<O_(a.x,a.y,o.x,o.y)&&(r[t-1]=e))}))}if(e===n.length-2){var s,u=r[t],l=r[e],c=r[e+1];if(Gm(l,c,this.targetNode)){if(Wm(u,l,this.targetNode))(s=Fm(u,l,this.targetNode))&&(r[e]=s,r.splice(e+1,1))}else this.targetNode.anchors.forEach((function(t){(t.x===c.x&&t.x===l.x||t.y===c.y&&t.y===l.y)&&(O_(t.x,t.y,l.x,l.y)<O_(c.x,c.y,l.x,l.y)&&(r[e+1]=t))}))}return r},e.prototype.getDraggingPoints=function(t,e,n,r,o){var i=o.map((function(t){return t})),a=this.getAfterAnchor(t,n,r),s=this.getCrossPoint(t,n,a);return"start"===e?(i.unshift(s),i.unshift(a)):(i.push(s),i.push(a)),i},e.prototype.updateCrossPoints=function(t){var e=t.map((function(t){return t})),n=t[0],r=t[1],o=t[e.length-2],i=t[e.length-1],a=this.sourceNode,s=this.targetNode,u=a.modelType,l=s.modelType,c=Um(n,r),p=e[0];switch(u){case um.RECT_NODE:if(0!==a.radius)T_(n,a)||(p=P_(n,c,a));break;case um.CIRCLE_NODE:p=N_(n,c,a);break;case um.ELLIPSE_NODE:p=D_(n,c,a);break;case um.DIAMOND_NODE:case um.POLYGON_NODE:p=j_(n,c,a)}p&&(e[0]=p);var d=Um(o,i),h=e[e.length-1];switch(l){case um.RECT_NODE:if(0!==s.radius)T_(i,s)||(h=P_(i,d,s));break;case um.CIRCLE_NODE:h=N_(i,d,s);break;case um.ELLIPSE_NODE:h=D_(i,d,s);break;case um.DIAMOND_NODE:case um.POLYGON_NODE:h=j_(i,d,s)}return h&&(e[e.length-1]=h),e},e.prototype.getData=function(){var e=t.prototype.getData.call(this),n=this.pointsList.map((function(t){return{x:t.x,y:t.y}}));return Object.assign({},e,{pointsList:n})},e.prototype.initPoints=function(){this.pointsList.length>0?this.points=this.pointsList.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" "):this.updatePoints()},e.prototype.updatePoints=function(){var t=Xm({x:this.startPoint.x,y:this.startPoint.y},{x:this.endPoint.x,y:this.endPoint.y},this.sourceNode,this.targetNode,this.offset||0);this.pointsList=t,this.points=t.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" ")},e.prototype.updateStartPoint=function(t){this.startPoint=Object.assign({},t),this.updatePoints()},e.prototype.moveStartPoint=function(t,e){this.startPoint.x+=t,this.startPoint.y+=e,this.updatePoints()},e.prototype.updateEndPoint=function(t){this.endPoint=Object.assign({},t),this.updatePoints()},e.prototype.moveEndPoint=function(t,e){this.endPoint.x+=t,this.endPoint.y+=e,this.updatePoints()},e.prototype.updatePointsList=function(t,e){this.pointsList.forEach((function(n){n.x+=t,n.y+=e}));var n=this.pointsList[0];this.startPoint=Object.assign({},n);var r=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},r),this.initPoints()},e.prototype.dragAppendStart=function(){this.draggingPointList=this.pointsList.map((function(t){return t}))},e.prototype.dragAppendSimple=function(t,e){this.isDragging=!0;var n=t.start,r=t.end,o=t.startIndex,i=t.endIndex,a=t.direction,s=this.pointsList,u=s;return a===pm.HORIZONTAL?(s[o]={x:n.x,y:n.y+e.y},s[i]={x:r.x,y:r.y+e.y},u=this.pointsList.map((function(t){return t}))):a===pm.VERTICAL&&(s[o]={x:n.x+e.x,y:n.y},s[i]={x:r.x+e.x,y:r.y},u=this.pointsList.map((function(t){return t}))),this.updatePointsAfterDrag(u),this.draggingPointList=u,this.setText(Object.assign({},this.text,this.textPosition)),{start:Object.assign({},s[o]),end:Object.assign({},s[i]),startIndex:o,endIndex:i,direction:a}},e.prototype.dragAppend=function(t,e){this.isDragging=!0;var n=t.start,r=t.end,o=t.startIndex,i=t.endIndex,a=t.direction,s=this.pointsList;if(a===pm.HORIZONTAL){s[o]={x:n.x,y:n.y+e.y},s[i]={x:r.x,y:r.y+e.y};var u=this.pointsList.map((function(t){return t}));if(0!==o&&i!==this.pointsList.length-1&&(u=this.removeCrossPoints(o,i,u)),0===o){var l={x:n.x,y:n.y+e.y};if(!M_(l,this.sourceNode)){var c=this.sourceNode.anchors;u=this.getDraggingPoints(a,"start",l,c,u)}}if(i===this.pointsList.length-1){var p={x:r.x,y:r.y+e.y};if(!M_(p,this.targetNode)){c=this.targetNode.anchors;u=this.getDraggingPoints(a,"end",p,c,u)}}this.updatePointsAfterDrag(u),this.draggingPointList=u}else if(a===pm.VERTICAL){s[o]={x:n.x+e.x,y:n.y},s[i]={x:r.x+e.x,y:r.y};u=this.pointsList.map((function(t){return t}));if(0!==o&&i!==this.pointsList.length-1&&(u=this.removeCrossPoints(o,i,u)),0===o){l={x:n.x+e.x,y:n.y};if(!M_(l,this.sourceNode)){c=this.sourceNode.anchors;u=this.getDraggingPoints(a,"start",l,c,u)}}if(i===this.pointsList.length-1){p={x:r.x+e.x,y:r.y};if(!M_(p,this.targetNode)){c=this.targetNode.anchors;u=this.getDraggingPoints(a,"end",p,c,u)}}this.updatePointsAfterDrag(u),this.draggingPointList=u}return this.setText(Object.assign({},this.text,this.textPosition)),{start:Object.assign({},s[o]),end:Object.assign({},s[i]),startIndex:o,endIndex:i,direction:a}},e.prototype.dragAppendEnd=function(){if(this.draggingPointList){var t=Hm(Ym(this.points));this.pointsList=t.map((function(t){return t})),this.draggingPointList=[];var e=t[0];this.startPoint=Object.assign({},e);var n=t[t.length-1];this.endPoint=Object.assign({},n)}this.isDragging=!1},e.prototype.updatePointsAfterDrag=function(t){var e=this.updateCrossPoints(t);this.points=e.map((function(t){return"".concat(t.x,",").concat(t.y)})).join(" ")},e.prototype.getAdjustStart=function(){return this.pointsList[0]||this.startPoint},e.prototype.getAdjustEnd=function(){var t=this.pointsList;return t[t.length-1]||this.endPoint},e.prototype.updateAfterAdjustStartAndEnd=function(t){var e=t.startPoint,n=t.endPoint,r=t.sourceNode,o=t.targetNode;this.pointsList=Xm({x:e.x,y:e.y},{x:n.x,y:n.y},r,o,this.offset||0),this.initPoints()},Db([yt],e.prototype,"dbClickPosition",void 0),Db([me],e.prototype,"initPoints",null),Db([me],e.prototype,"updatePoints",null),Db([me],e.prototype,"updateStartPoint",null),Db([me],e.prototype,"moveStartPoint",null),Db([me],e.prototype,"updateEndPoint",null),Db([me],e.prototype,"moveEndPoint",null),Db([me],e.prototype,"updatePointsList",null),Db([me],e.prototype,"dragAppendStart",null),Db([me],e.prototype,"dragAppendSimple",null),Db([me],e.prototype,"dragAppend",null),Db([me],e.prototype,"dragAppendEnd",null),Db([me],e.prototype,"updatePointsAfterDrag",null),Db([me],e.prototype,"getAdjustStart",null),Db([me],e.prototype,"getAdjustEnd",null),Db([me],e.prototype,"updateAfterAdjustStartAndEnd",null),e}(mb),kb=function(){return kb=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},kb.apply(this,arguments)},Rb=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},Lb=function(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.")},Bb=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},zb=function(){function t(t,e){this.BaseType=sm.NODE,this.id="",this.type="",this.x=0,this.y=0,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},this.properties={},this._width=100,this._height=80,this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.anchorsOffset=[],this.virtual=!1,this.isSelected=!1,this.isHovered=!1,this.isShowAnchor=!1,this.isDragging=!1,this.isHitable=!0,this.isHittable=!0,this.draggable=!0,this.visible=!0,this.enableRotate=!0,this.enableResize=!0,this.zIndex=1,this.state=am.DEFAULT,this.autoToFront=!0,this.style={},this._rotate=0,this.modelType=um.NODE,this.additionStateData={},this.targetRules=[],this.sourceRules=[],this.moveRules=[],this.hasSetTargetRules=!1,this.hasSetSourceRules=!1,this.graphModel=e,this.properties=t.properties||{},this.initNodeData(t),this.setAttributes()}return Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotate",{get:function(){return this._rotate},set:function(t){this._rotate=t;var e=this.x,n=void 0===e?0:e,r=this.y,o=void 0===r?0:r;this.transform=new __(-n,-o).rotate(t).translate(n,o).toString()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"incoming",{get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"outgoing",{get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}},enumerable:!1,configurable:!0}),t.prototype.initNodeData=function(t){if(t.properties||(t.properties={}),!t.id){var e=this.graphModel.idGenerator,n=e&&e(t.type),r=this.createId();t.id=r||n||nb()}this.formatText(t),Fs(this,function(t){return Ky(t,["id","type","x","y","text","properties","virtual","rotate"])}(t)),this.graphModel.overlapMode===cm.INCREASE&&(this.zIndex=t.zIndex||yb())},t.prototype.setAttributes=function(){},t.prototype.createId=function(){return null},t.prototype.formatText=function(t){var e;t.text?"string"==typeof t.text?t.text={value:t.text,x:t.x,y:t.y,draggable:!1,editable:!0}:t.text.editable=null===(e=t.text.editable)||void 0===e||e:t.text={value:"",x:t.x,y:t.y,draggable:!1,editable:!0}},t.prototype.resize=function(t){var e=t.width,n=t.height,r=t.deltaX,o=t.deltaY;return this.move(r/2,o/2),this.width=e,this.height=n,this.setProperties({width:e,height:n}),this.getData()},t.prototype.proportionalResize=function(){},t.prototype.getData=function(){var t=this.text,e=t.x,n=t.y,r=t.value,o=this.properties;Ge(o)&&(o=$e(o));var i={id:this.id,type:this.type,x:this.x,y:this.y,properties:o};return this.rotate&&(i.rotate=this.rotate),this.graphModel.overlapMode===cm.INCREASE&&(i.zIndex=this.zIndex),r&&(i.text={x:e,y:n,value:r}),i},t.prototype.getHistoryData=function(){return this.getData()},t.prototype.getProperties=function(){return $e(this.properties)},t.prototype.getOuterGAttributes=function(){return{className:""}},t.prototype.getNodeStyle=function(){return kb(kb({},this.graphModel.theme.baseNode),this.style)},t.prototype.getTextStyle=function(){return mp(this.graphModel.theme.nodeText)},t.prototype.getRotateControlStyle=function(){return mp(this.graphModel.theme.rotateControl)},t.prototype.getResizeControlStyle=function(){return mp(this.graphModel.theme.resizeControl)},t.prototype.getResizeOutlineStyle=function(){return mp(this.graphModel.theme.resizeOutline)},t.prototype.getAnchorStyle=function(t){return mp(this.graphModel.theme.anchor)},t.prototype.getAnchorLineStyle=function(t){return mp(this.graphModel.theme.anchorLine)},t.prototype.getOutlineStyle=function(){return mp(this.graphModel.theme.outline)},t.prototype.isAllowConnectedAsSource=function(t,e,n,r){var o=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var i=!0,a="",s=0;s<o.length;s++){var u=o[s];if(!u.validate.call(this,this,t,e,n,r)){i=!1,a=u.message;break}}return{isAllPass:i,msg:a}},t.prototype.getConnectedSourceRules=function(){return this.sourceRules},t.prototype.isAllowConnectedAsTarget=function(t,e,n,r){var o=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var i=!0,a="",s=0;s<o.length;s++){var u=o[s];if(!u.validate.call(this,t,this,e,n,r)){i=!1,a=u.message;break}}return{isAllPass:i,msg:a}},t.prototype.isAllowMoveNode=function(t,e){var n,r,o=!0,i=!0,a=this.moveRules.concat(this.graphModel.nodeMoveRules);try{for(var s=Lb(a),u=s.next();!u.done;u=s.next()){var l=(0,u.value)(this,t,e);if(!l)return!1;if("object"==typeof l){var c=l;if(!c.x&&!c.y)return!1;o=o&&c.x,i=i&&c.y}}}catch(t){n={error:t}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return{x:o,y:i}},t.prototype.getConnectedTargetRules=function(){return this.targetRules},t.prototype.getAnchorsByOffset=function(){var t=this,e=t.anchorsOffset,n=t.id,r=t.x,o=t.y;return e&&e.length>0?e.map((function(t,e){return t.length?{id:"".concat(n,"_").concat(e),x:r+t[0],y:o+t[1]}:kb(kb({},t),{x:r+t.x,y:o+t.y,id:t.id||"".concat(n,"_").concat(e)})})):this.getDefaultAnchor()},t.prototype.getDefaultAnchor=function(){return[]},t.prototype.getTargetAnchor=function(t){return function(t,e){for(var n,r=x_(e),o=Number.MAX_SAFE_INTEGER,i=0;i<r.length;i++){var a=O_(t.x,t.y,r[i].x,r[i].y);a<o&&(o=a,n={index:i,anchor:b_(b_({},r[i]),{x:r[i].x,y:r[i].y,id:r[i].id})})}return n}(t,this)},t.prototype.getBounds=function(){return{x1:this.x-this.width/2,y1:this.y-this.height/2,x2:this.x+this.width/2,y2:this.y+this.height/2}},Object.defineProperty(t.prototype,"anchors",{get:function(){var t=this.getAnchorsByOffset(),e=this,n=e.x,r=e.y,o=e.rotate;return t.forEach((function(t){var e=t.x,i=t.y,a=Bb(new v_([e,i,1]).translate(-n,-r).rotate(o).translate(n,r)[0],2),s=a[0],u=a[1];t.x=s,t.y=u})),t},enumerable:!1,configurable:!0}),t.prototype.getAnchorInfo=function(t){if(!Tf(t))for(var e=0;e<this.anchors.length;e++){var n=this.anchors[e];if(n.id===t)return n}},t.prototype.addNodeMoveRules=function(t){this.moveRules.includes(t)||this.moveRules.push(t)},t.prototype.isAllowMoveByXORY=function(t,e,n){var r,o;if(n)r=!0,o=!0;else{var i=this.isAllowMoveNode(t,e);"boolean"==typeof i?(r=i,o=i):(r=i.x,o=i.y)}return{isAllowMoveX:r,isAllowMoveY:o}},t.prototype.move=function(t,e,n){void 0===n&&(n=!1);var r=this.isAllowMoveByXORY(t,e,n),o=r.isAllowMoveX,i=r.isAllowMoveY;return o&&(this.x=this.x+t,this.text&&this.moveText(t,0)),i&&(this.y=this.y+e,this.text&&this.moveText(0,e)),o||i},t.prototype.getMoveDistance=function(t,e,n){void 0===n&&(n=!1);var r=this.isAllowMoveByXORY(t,e,n),o=r.isAllowMoveX,i=r.isAllowMoveY,a=0,s=0;return o&&t&&(this.x=this.x+t,this.text&&this.moveText(t,0),a=t),i&&e&&(this.y=this.y+e,this.text&&this.moveText(0,e),s=e),[a,s]},t.prototype.moveTo=function(t,e,n){void 0===n&&(n=!1);var r=t-this.x,o=e-this.y;return!(!n&&!this.isAllowMoveNode(r,o))&&(this.text&&this.text&&this.moveText(r,o),this.x=t,this.y=e,!0)},t.prototype.moveText=function(t,e){var n=this.text,r=n.x,o=n.y,i=n.value,a=n.draggable,s=n.editable;this.text={value:i,editable:s,draggable:a,x:r+t,y:o+e}},t.prototype.updateText=function(t){this.text=kb(kb({},$e(this.text)),{value:t})},t.prototype.setSelected=function(t){void 0===t&&(t=!0),this.isSelected=t},t.prototype.setHovered=function(t){void 0===t&&(t=!0),this.isHovered=t,this.setIsShowAnchor(t)},t.prototype.setIsShowAnchor=function(t){void 0===t&&(t=!0),this.isShowAnchor=t},t.prototype.setEnableRotate=function(t){void 0===t&&(t=!0),this.enableRotate=t},t.prototype.setEnableResize=function(t){void 0===t&&(t=!0),this.enableResize=t},t.prototype.setHitable=function(t){void 0===t&&(t=!0),this.isHitable=t},t.prototype.setHittable=function(t){void 0===t&&(t=!0),this.isHittable=t},t.prototype.setElementState=function(t,e){this.state=t,this.additionStateData=e},t.prototype.setProperty=function(t,e){var n,r=$e(this.properties),o=kb(kb({},r),((n={})[t]=_m(e),n));this.properties=o,this.setAttributes(),this.graphModel.eventCenter.emit(lm.NODE_PROPERTIES_CHANGE,{id:this.id,keys:[t],preProperties:r,properties:o})},t.prototype.setProperties=function(t){var e=$e(this.properties),n=kb(kb({},e),_m(t));this.properties=n,this.setAttributes();var r=[];Ff(t,(function(t,n){(Yh(e,n)&&e[n]!==t||!Yh(e,n))&&r.push(n)})),this.graphModel.eventCenter.emit(lm.NODE_PROPERTIES_CHANGE,{id:this.id,keys:r,preProperties:e,properties:n})},t.prototype.deleteProperty=function(t){delete this.properties[t],this.setAttributes()},t.prototype.setStyle=function(t,e){var n;this.style=kb(kb({},this.style),((n={})[t]=_m(e),n))},t.prototype.setStyles=function(t){this.style=kb(kb({},this.style),_m(t))},t.prototype.updateStyles=function(t){this.style=kb({},_m(t))},t.prototype.setZIndex=function(t){void 0===t&&(t=1),this.zIndex=t},t.prototype.updateAttributes=function(t){Fs(this,t)},t.BaseType=sm.NODE,Rb([yt],t.prototype,"type",void 0),Rb([yt],t.prototype,"x",void 0),Rb([yt],t.prototype,"y",void 0),Rb([yt],t.prototype,"text",void 0),Rb([yt],t.prototype,"properties",void 0),Rb([yt],t.prototype,"_width",void 0),Rb([yt],t.prototype,"_height",void 0),Rb([yt],t.prototype,"anchorsOffset",void 0),Rb([yt],t.prototype,"isSelected",void 0),Rb([yt],t.prototype,"isHovered",void 0),Rb([yt],t.prototype,"isShowAnchor",void 0),Rb([yt],t.prototype,"isDragging",void 0),Rb([yt],t.prototype,"isHitable",void 0),Rb([yt],t.prototype,"isHittable",void 0),Rb([yt],t.prototype,"draggable",void 0),Rb([yt],t.prototype,"visible",void 0),Rb([yt],t.prototype,"enableRotate",void 0),Rb([yt],t.prototype,"enableResize",void 0),Rb([yt],t.prototype,"zIndex",void 0),Rb([yt],t.prototype,"state",void 0),Rb([yt],t.prototype,"autoToFront",void 0),Rb([yt],t.prototype,"style",void 0),Rb([yt],t.prototype,"transform",void 0),Rb([yt],t.prototype,"_rotate",void 0),Rb([xt],t.prototype,"incoming",null),Rb([xt],t.prototype,"outgoing",null),Rb([me],t.prototype,"addNodeMoveRules",null),Rb([me],t.prototype,"move",null),Rb([me],t.prototype,"getMoveDistance",null),Rb([me],t.prototype,"moveTo",null),Rb([me],t.prototype,"moveText",null),Rb([me],t.prototype,"updateText",null),Rb([me],t.prototype,"setSelected",null),Rb([me],t.prototype,"setHovered",null),Rb([me],t.prototype,"setIsShowAnchor",null),Rb([me],t.prototype,"setEnableRotate",null),Rb([me],t.prototype,"setEnableResize",null),Rb([me],t.prototype,"setHitable",null),Rb([me],t.prototype,"setHittable",null),Rb([me],t.prototype,"setElementState",null),Rb([me],t.prototype,"setProperty",null),Rb([me],t.prototype,"setProperties",null),Rb([me],t.prototype,"deleteProperty",null),Rb([me],t.prototype,"setStyle",null),Rb([me],t.prototype,"setStyles",null),Rb([me],t.prototype,"updateStyles",null),Rb([me],t.prototype,"setZIndex",null),Rb([me],t.prototype,"updateAttributes",null),t}(),Hb=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xb=function(){return Xb=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Xb.apply(this,arguments)},Gb=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},Wb=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.modelType=um.CIRCLE_NODE,r.properties={},r.r=50,r.properties=e.properties||{},r.setAttributes(),r}return Hb(e,t),Object.defineProperty(e.prototype,"width",{get:function(){return 2*this.r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return 2*this.r},enumerable:!1,configurable:!0}),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties.r;e&&(this.r=e)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.circle,r=this.properties.style;return Xb(Xb(Xb({},e),null!=r?r:{}),mp(n))},e.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,r=t.r;return[{x:e,y:n-r,id:"".concat(this.id,"_0")},{x:e+r,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+r,id:"".concat(this.id,"_2")},{x:e-r,y:n,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(t){var e=t.width,n=t.deltaX,r=t.deltaY;return this.move(n/2,r/2),this.r=e,this.setProperties({r:e}),this.getData()},Gb([yt],e.prototype,"properties",void 0),Gb([yt],e.prototype,"r",void 0),Gb([xt],e.prototype,"width",null),Gb([xt],e.prototype,"height",null),e}(zb),Fb=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ub=function(){return Ub=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ub.apply(this,arguments)},Yb=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},Vb=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Kb=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.modelType=um.DIAMOND_NODE,r.rx=30,r.ry=50,r.properties={},r.properties=e.properties||{},r.setAttributes(),r}return Fb(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.rx,r=e.ry;n&&(this.rx=n),r&&(this.ry=r)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.diamond;return Ub(Ub({},e),mp(n))},Object.defineProperty(e.prototype,"points",{get:function(){var t=this,e=t.x,n=t.y,r=t.rx,o=t.ry;return[[e,n-o],[e+r,n],[e,n+o],[e-r,n]]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pointsPosition",{get:function(){return jh(this.points,(function(t){var e=Vb(t,2);return{x:e[0],y:e[1]}}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return eh(this.points,(function(n){var r=Vb(n,1)[0];r<t&&(t=r),r>e&&(e=r)})),e-t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return eh(this.points,(function(n){var r=Vb(n,2)[1];r<t&&(t=r),r>e&&(e=r)})),e-t},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var t=this;return jh(this.points,(function(e,n){var r=Vb(e,2);return{x:r[0],y:r[1],id:"".concat(t.id,"_").concat(n)}}))},e.prototype.resize=function(t){var e=t.width,n=t.height,r=t.deltaX,o=t.deltaY;return this.move(r/2,o/2),this.rx=e,this.ry=n,this.setProperties({rx:e,ry:n}),this.getData()},Yb([yt],e.prototype,"rx",void 0),Yb([yt],e.prototype,"ry",void 0),Yb([yt],e.prototype,"properties",void 0),Yb([xt],e.prototype,"points",null),Yb([xt],e.prototype,"pointsPosition",null),Yb([xt],e.prototype,"width",null),Yb([xt],e.prototype,"height",null),e}(zb),qb=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zb=function(){return Zb=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Zb.apply(this,arguments)},Jb=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},$b=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.modelType=um.ELLIPSE_NODE,r.rx=30,r.ry=45,r.properties={},r.properties=e.properties||{},r.setAttributes(),r}return qb(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.rx,r=e.ry;n&&(this.rx=n),r&&(this.ry=r)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.ellipse;return Zb(Zb({},e),mp(n))},Object.defineProperty(e.prototype,"width",{get:function(){return 2*this.rx},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return 2*this.ry},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,r=t.rx,o=t.ry;return[{x:e,y:n-o,id:"".concat(this.id,"_0")},{x:e+r,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+o,id:"".concat(this.id,"_2")},{x:e-r,y:n,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(t){var e=t.width,n=t.height,r=t.deltaX,o=t.deltaY;return this.move(r/2,o/2),this.rx=e,this.ry=n,this.setProperties({rx:e,ry:n}),this.getData()},Jb([yt],e.prototype,"rx",void 0),Jb([yt],e.prototype,"ry",void 0),Jb([yt],e.prototype,"properties",void 0),Jb([xt],e.prototype,"width",null),Jb([xt],e.prototype,"height",null),e}(zb),Qb=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),tx=function(){return tx=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},tx.apply(this,arguments)},ex=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},nx=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},rx=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.modelType=um.POLYGON_NODE,r.points=[[50,0],[100,50],[50,100],[0,50]],r.properties={},r.properties=e.properties||{},r.setAttributes(),r}return Qb(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.points,r=e.width,o=e.height,i=n||this.points;this.points=function(t,e,n){if(!t)return[];var r=Math.min.apply(Math,r_([],n_(t.map((function(t){return t[0]}))),!1)),o=Math.max.apply(Math,r_([],n_(t.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,r_([],n_(t.map((function(t){return t[1]}))),!1)),a=Math.max.apply(Math,r_([],n_(t.map((function(t){return t[1]}))),!1)),s=-r,u=-i,l=t.map((function(t){var e=n_(t,2),n=e[0],r=e[1];return[n+s,r+u]})),c=e?e/(o-r):1,p=n?n/(a-i):1,d=Math.min(c,p);return l.map((function(t){var e=n_(t,2),n=e[0],r=e[1];return[n*d,r*d]}))}(i,r,o)},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.polygon,r=this.properties.style;return tx(tx(tx({},e),mp(n)),mp(r)||{})},Object.defineProperty(e.prototype,"pointsPosition",{get:function(){var t=this,e=t.x,n=t.y,r=t.width,o=t.height;return this.points.map((function(t){return{x:t[0]+e-r/2,y:t[1]+n-o/2}}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(n){var r=nx(n,1)[0];r<t&&(t=r),r>e&&(e=r)})),e-t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MIN_SAFE_INTEGER;return this.points.forEach((function(n){var r=nx(n,2)[1];r<t&&(t=r),r>e&&(e=r)})),e-t},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var t=this,e=this,n=e.x,r=e.y,o=e.width,i=e.height;return e.points.map((function(e,a){var s=nx(e,2),u=s[0],l=s[1];return{x:n+u-o/2,y:r+l-i/2,id:"".concat(t.id,"_").concat(a)}}))},e.prototype.resize=function(t){var e=this,n=t.width,r=t.height,o=t.deltaX,i=t.deltaY;this.move(o/2,i/2);var a=jh(this.points,(function(t){var o=nx(t,2),i=o[0],a=o[1];return[i*n/e.width,a*r/e.height]}));return this.points=a,this.properties.points=a,this.getData()},ex([yt],e.prototype,"points",void 0),ex([yt],e.prototype,"properties",void 0),ex([xt],e.prototype,"pointsPosition",null),ex([xt],e.prototype,"width",null),ex([xt],e.prototype,"height",null),e}(zb),ox=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ix=function(){return ix=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ix.apply(this,arguments)},ax=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},sx=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.modelType=um.RECT_NODE,r.radius=0,r.properties={},r.properties=e.properties||{},r.setAttributes(),r}return ox(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.width,r=e.height;n&&(this.width=n),r&&(this.height=r)},e.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,r=t.width,o=t.height;return[{x:e,y:n-o/2,id:"".concat(this.id,"_0")},{x:e+r/2,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+o/2,id:"".concat(this.id,"_2")},{x:e-r/2,y:n,id:"".concat(this.id,"_3")}]},e.prototype.getNodeStyle=function(){var e=t.prototype.getNodeStyle.call(this),n=this.graphModel.theme.rect;return ix(ix({},e),mp(n))},ax([yt],e.prototype,"radius",void 0),ax([yt],e.prototype,"properties",void 0),e}(zb),ux=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),lx=function(){return lx=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},lx.apply(this,arguments)},cx=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},px=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},dx=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},hx=function(t){function e(){var e=t.apply(this,dx([],px(arguments),!1))||this;return e.modelType=um.TEXT_NODE,e}return ux(e,t),e.prototype.getTextStyle=function(){var e=t.prototype.getTextStyle.call(this),n=this.graphModel.theme.text;return lx(lx({},e),mp(n))},Object.defineProperty(e.prototype,"width",{get:function(){var t=String(this.text.value).split(/[\r\n]/g),e=this.getTextStyle().fontSize;return k_({rows:t,fontSize:e,rowsLength:t.length}).width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var t=String(this.text.value).split(/[\r\n]/g),e=this.getTextStyle().fontSize;return k_({rows:t,fontSize:e,rowsLength:t.length}).height},enumerable:!1,configurable:!0}),cx([xt],e.prototype,"width",null),cx([xt],e.prototype,"height",null),e}(zb),fx=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yx=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},vx=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.modelType=um.HTML_NODE,r.properties={},r.properties=e.properties||{},r.setAttributes(),r}return fx(e,t),e.prototype.setAttributes=function(){t.prototype.setAttributes.call(this);var e=this.properties,n=e.width,r=e.height;n&&(this.width=n),r&&(this.height=r)},e.prototype.getDefaultAnchor=function(){var t=this,e=t.x,n=t.y,r=t.width,o=t.height;return[{x:e,y:n-o/2,id:"".concat(this.id,"_0")},{x:e+r/2,y:n,id:"".concat(this.id,"_1")},{x:e,y:n+o/2,id:"".concat(this.id,"_2")},{x:e-r/2,y:n,id:"".concat(this.id,"_3")}]},yx([yt],e.prototype,"properties",void 0),e}(zb),gx=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},mx={stopZoomGraph:!1,stopScrollGraph:!1,stopMoveGraph:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,adjustNodePosition:!1,hideAnchors:!0,allowRotate:!1,allowResize:!1,nodeSelectedOutline:!0,nodeTextEdit:!1,edgeTextEdit:!1,nodeTextDraggable:!1,edgeTextDraggable:!1},_x=["isSilentMode","stopZoomGraph","stopScrollGraph","stopMoveGraph","adjustEdge","adjustEdgeMiddle","adjustEdgeStartAndEnd","adjustNodePosition","hideAnchors","allowRotate","allowResize","hoverOutline","nodeSelectedOutline","edgeSelectedOutline","nodeTextEdit","edgeTextEdit","nodeTextDraggable","edgeTextDraggable","multipleSelectKey","autoExpand"],bx=function(){function t(t){this.isSilentMode=!1,this.stopZoomGraph=!1,this.stopScrollGraph=!1,this.stopMoveGraph=!1,this.adjustEdge=!0,this.adjustEdgeMiddle=!1,this.adjustEdgeStartAndEnd=!1,this.adjustNodePosition=!0,this.hideAnchors=!1,this.allowRotate=!1,this.allowResize=!1,this.hoverOutline=!0,this.nodeSelectedOutline=!0,this.edgeSelectedOutline=!0,this.nodeTextEdit=!0,this.edgeTextEdit=!0,this.nodeTextDraggable=!1,this.edgeTextDraggable=!1,this.autoExpand=!1,this.multipleSelectKey="",this.defaultConfig={},Fs(this,this.getConfigDetail(t))}return t.prototype.updateEditConfig=function(t){var e=this.getConfigDetail(t);Fs(this,e)},t.prototype.getConfigDetail=function(t){var e=t.isSilentMode,n=t.textEdit,r={};if(!1===e&&Fs(r,this.defaultConfig),!0===e&&e!==this.isSilentMode){var o=Ky(mx,_x);this.defaultConfig={stopZoomGraph:this.stopZoomGraph,stopScrollGraph:this.stopScrollGraph,stopMoveGraph:this.stopMoveGraph,adjustEdge:this.adjustEdge,adjustEdgeMiddle:this.adjustEdgeMiddle,adjustEdgeStartAndEnd:this.adjustEdgeStartAndEnd,adjustNodePosition:this.adjustNodePosition,hideAnchors:this.hideAnchors,allowRotate:this.allowRotate,allowResize:this.allowResize,hoverOutline:this.hoverOutline,nodeSelectedOutline:this.nodeSelectedOutline,edgeSelectedOutline:this.edgeSelectedOutline,nodeTextEdit:this.nodeTextEdit,edgeTextEdit:this.edgeTextEdit,nodeTextDraggable:this.nodeTextDraggable,edgeTextDraggable:this.edgeTextDraggable,autoExpand:this.autoExpand},Fs(r,o)}!1===n&&Fs(r,{nodeTextEdit:!1,edgeTextEdit:!1});var i=Ky(t,_x);return Fs(r,i)},t.prototype.getConfig=function(){return Ky(this,_x)},gx([yt],t.prototype,"isSilentMode",void 0),gx([yt],t.prototype,"stopZoomGraph",void 0),gx([yt],t.prototype,"stopScrollGraph",void 0),gx([yt],t.prototype,"stopMoveGraph",void 0),gx([yt],t.prototype,"adjustEdge",void 0),gx([yt],t.prototype,"adjustEdgeMiddle",void 0),gx([yt],t.prototype,"adjustEdgeStartAndEnd",void 0),gx([yt],t.prototype,"adjustNodePosition",void 0),gx([yt],t.prototype,"hideAnchors",void 0),gx([yt],t.prototype,"allowRotate",void 0),gx([yt],t.prototype,"allowResize",void 0),gx([yt],t.prototype,"hoverOutline",void 0),gx([yt],t.prototype,"nodeSelectedOutline",void 0),gx([yt],t.prototype,"edgeSelectedOutline",void 0),gx([yt],t.prototype,"nodeTextEdit",void 0),gx([yt],t.prototype,"edgeTextEdit",void 0),gx([yt],t.prototype,"nodeTextDraggable",void 0),gx([yt],t.prototype,"edgeTextDraggable",void 0),gx([yt],t.prototype,"autoExpand",void 0),gx([me],t.prototype,"updateEditConfig",null),t}(),xx=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){var r=this;null==t||t.split(",").forEach((function(t){t=t.trim(),r._events[t]||(r._events[t]=[]),r._events[t].push({callback:e,once:!!n})}))},t.prototype.once=function(t,e){var n=this;null==t||t.split(",").forEach((function(t){t=t.trim(),n.on(t,e,!0)}))},t.prototype.emit=function(t,e){var n=this;null==t||t.split(",").forEach((function(t){var r=n._events[t]||[],o=n._events["*"]||[],i=function(r){for(var o=r.length,i=0;i<o;i++)if(r[i]){var a=r[i],s=a.callback;a.once&&(r.splice(i,1),0===r.length&&delete n._events[t],o--,i--),s.apply(n,[e])}};i(r),i(o)}))},t.prototype.off=function(t,e){var n=this;t||(this._events={}),t.split(",").forEach((function(t){if(e){for(var r=n._events[t]||[],o=r.length,i=0;i<o;i++)r[i].callback===e&&(r.splice(i,1),o--,i--);0===r.length&&delete n._events[t]}else delete n._events[t]}))},t.prototype.getEvents=function(){return this._events},t}(),Ex=function(){return Ex=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ex.apply(this,arguments)},wx=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},Ox=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Mx=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},Sx=function(){function t(t){this.modelMap=new Map,this.nodeMoveRules=[],this.nodes=[],this.edges=[],this.overlapMode=cm.DEFAULT,this.gridSize=1,this.partial=!1;var e,n,r,o=t.container,i=t.partial,a=t.background,s=void 0===a?{}:a,u=t.grid,l=t.idGenerator,c=t.edgeGenerator,p=t.animation,d=t.customTrajectory;this.rootEl=o,this.partial=!!i,this.background=s,"object"==typeof u&&(this.gridSize=u.size||1),this.theme=pb(t.style),this.edgeType=t.edgeType||"polyline",this.animation=(e=p)&&"boolean"!=typeof e?qf(mp(vm),e):mp(!0===e?gm:vm),this.overlapMode=t.overlapMode||cm.DEFAULT,this.width=t.width||this.rootEl.getBoundingClientRect().width,this.height=t.height||this.rootEl.getBoundingClientRect().height,this.eventCenter=new xx,this.editConfigModel=new bx(t),this.transformModel=new Cx(this.eventCenter,t),this.flowId=nb(),this.idGenerator=l,this.edgeGenerator=(n=this,"function"!=typeof(r=c)?function(t,e,r){return Object.assign({type:n.edgeType},r)}:function(t,e,o){var i=r(t,e,o);return i?"string"==typeof i?Object.assign({},o,{type:i}):Object.assign({type:i},o):{type:n.edgeType}}),this.customTrajectory=d}return Object.defineProperty(t.prototype,"nodesMap",{get:function(){return this.nodes.reduce((function(t,e,n){return t[e.id]={index:n,model:e},t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edgesMap",{get:function(){return this.edges.reduce((function(t,e,n){return t[e.id]={index:n,model:e},t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"modelsMap",{get:function(){return Mx(Mx([],Ox(this.nodes),!1),Ox(this.edges),!1).reduce((function(t,e){return t[e.id]=e,t}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sortElements",{get:function(){for(var t=Mx(Mx([],Ox(this.nodes),!1),Ox(this.edges),!1).sort((function(t,e){return t.zIndex-e.zIndex})),e=[],n=[-200,-200],r=[this.width+dm,this.height+dm],o=0;o<t.length;o++){var i=t[o];i.visible&&(!this.partial||i.isSelected||this.isElementInArea(i,n,r,!1,!1))&&e.push(i)}return e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textEditElement",{get:function(){var t=this.nodes.find((function(t){return t.state===am.TEXT_EDIT})),e=this.edges.find((function(t){return t.state===am.TEXT_EDIT}));return t||e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectElements",{get:function(){var t=new Map;return this.nodes.forEach((function(e){e.isSelected&&t.set(e.id,e)})),this.edges.forEach((function(e){e.isSelected&&t.set(e.id,e)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectNodes",{get:function(){var t=[];return this.nodes.forEach((function(e){e.isSelected&&t.push(e)})),t},enumerable:!1,configurable:!0}),t.prototype.getAreaElement=function(t,e,n,r,o){var i=this;void 0===n&&(n=!0),void 0===r&&(r=!0),void 0===o&&(o=!1);var a=[];return eh(Mx(Mx([],Ox(this.nodes),!1),Ox(this.edges),!1),(function(s){var u=i.isElementInArea(s,t,e,n,r);o&&!s.visible||!u||a.push(s)})),a},t.prototype.getModel=function(t){return this.modelMap.get(t)},t.prototype.getNodeModelById=function(t){var e;return this.fakeNode&&t===this.fakeNode.id?this.fakeNode:null===(e=this.nodesMap[t])||void 0===e?void 0:e.model},t.prototype.getPointByClient=function(t){var e=t.x,n=t.y,r=this.rootEl.getBoundingClientRect(),o={x:e-r.left,y:n-r.top},i=Ox(this.transformModel.HtmlPointToCanvasPoint([o.x,o.y]),2);return{domOverlayPosition:o,canvasOverlayPosition:{x:i[0],y:i[1]}}},t.prototype.isElementInArea=function(t,e,n,r,o){var i;if(void 0===r&&(r=!0),void 0===o&&(o=!0),t.BaseType===sm.NODE){for(var a=A_(t),s=a.minX,u=a.minY,l=a.maxX,c=a.maxY,p=[{x:s,y:u},{x:l,y:u},{x:l,y:c},{x:s,y:c}],d=o,h=0;h<p.length;h++){var f=p[h],y=f.x,v=f.y;if(y=(i=Ox(this.transformModel.CanvasPointToHtmlPoint([y,v]),2))[0],v=i[1],a_([y,v],e,n)!==o){d=!o;break}}return d}if(t.BaseType===sm.EDGE){var g=t.startPoint,m=t.endPoint,_=this.transformModel.CanvasPointToHtmlPoint([g.x,g.y]),b=this.transformModel.CanvasPointToHtmlPoint([m.x,m.y]),x=a_(_,e,n),E=a_(b,e,n);return r?x&&E:x||E}return!1},t.prototype.graphDataToModel=function(t){var e=this;if(this.width&&this.height||this.resize(),!t)return this.nodes=[],void(this.edges=[]);t.nodes?this.nodes=jh(t.nodes,(function(t){return e.getModelAfterSnapToGrid(t)})):this.nodes=[],t.edges?this.edges=jh(t.edges,(function(t){var n,r=e.getModel(null!==(n=t.type)&&void 0!==n?n:"");if(!r)throw new Error("找不到".concat(t.type,"对应的边。"));return new r(t,e)})):this.edges=[]},t.prototype.modelToGraphData=function(){var t=[];this.edges.forEach((function(e){var n=e.getData();n&&!e.virtual&&t.push(n)}));var e=[];return this.nodes.forEach((function(t){var n=t.getData();n&&!t.virtual&&e.push(n)})),{nodes:e,edges:t}},t.prototype.modelToHistoryData=function(){for(var t=!1,e=[],n=0;n<this.nodes.length;n++){var r=this.nodes[n];if(r.isDragging){t=!0;break}e.push(r.getHistoryData())}if(t)return!1;for(var o=!1,i=[],a=0;a<this.edges.length;a++){var s=this.edges[a];if(s.isDragging){o=!0;break}i.push(s.getHistoryData())}return!o&&{nodes:e,edges:i}},t.prototype.getEdgeModelById=function(t){var e;return null===(e=this.edgesMap[t])||void 0===e?void 0:e.model},t.prototype.getElement=function(t){return this.modelsMap[t]},t.prototype.getNodeEdges=function(t){for(var e=[],n=0;n<this.edges.length;n++){var r=this.edges[n],o=r.sourceNodeId===t,i=r.targetNodeId===t;(o||i)&&e.push(r)}return e},t.prototype.getSelectElements=function(t){void 0===t&&(t=!0);var e=this.selectElements,n={nodes:[],edges:[]};return e.forEach((function(r){if(r.BaseType===sm.NODE&&n.nodes.push(r.getData()),r.BaseType===sm.EDGE){var o=r.getData(),i=e.get(o.sourceNodeId)&&e.get(o.targetNodeId);(t||i)&&n.edges.push(o)}})),n},t.prototype.updateAttributes=function(t,e){var n=this.getElement(t);null==n||n.updateAttributes(e)},t.prototype.changeNodeId=function(t,e){return e||(e=nb()),this.nodesMap[e]?(console.warn("当前流程图已存在节点".concat(e,", 修改失败")),""):this.nodesMap[t]?(this.edges.forEach((function(n){n.sourceNodeId===t&&(n.sourceNodeId=e),n.targetNodeId===t&&(n.targetNodeId=e)})),this.nodesMap[t].model.id=e,this.nodesMap[e]=this.nodesMap[t],e):(console.warn("当前流程图找不到节点".concat(t,", 修改失败")),"")},t.prototype.changeEdgeId=function(t,e){return e||(e=nb()),this.edgesMap[e]?(console.warn("当前流程图已存在边: ".concat(e,", 修改失败")),""):this.edgesMap[t]?(this.edges.forEach((function(n){n.id===t&&n.changeEdgeId(e)})),e):(console.warn("当前流程图找不到边: ".concat(e,", 修改失败")),"")},t.prototype.setFakeNode=function(t){this.fakeNode=t},t.prototype.removeFakeNode=function(){this.fakeNode=null},t.prototype.setModel=function(t,e){return this.modelMap.set(t,e)},t.prototype.toFront=function(t){var e,n,r,o=(null===(e=this.nodesMap[t])||void 0===e?void 0:e.model)||(null===(n=this.edgesMap[t])||void 0===n?void 0:n.model);o&&(this.overlapMode===cm.DEFAULT&&(null===(r=this.topElement)||void 0===r||r.setZIndex(),o.setZIndex(9999),this.topElement=o),this.overlapMode===cm.INCREASE&&this.setElementZIndex(t,"top"))},t.prototype.setElementZIndex=function(t,e){var n,r,o=(null===(n=this.nodesMap[t])||void 0===n?void 0:n.model)||(null===(r=this.edgesMap[t])||void 0===r?void 0:r.model);if(o){var i=void 0;"number"==typeof e?i=e:("top"===e&&(i=yb()),"bottom"===e&&(i=--fb)),o.setZIndex(i)}},t.prototype.deleteNode=function(t){var e=this.nodesMap[t].model.getData();this.deleteEdgeBySource(t),this.deleteEdgeByTarget(t),this.nodes.splice(this.nodesMap[t].index,1),this.eventCenter.emit(lm.NODE_DELETE,{data:e})},t.prototype.addNode=function(t,e,n){void 0===e&&(e=lm.NODE_ADD);var r=_m(t),o=r.id;o&&this.nodesMap[o]&&delete r.id;var i=this.getModelAfterSnapToGrid(r);this.nodes.push(i);var a={data:i.getData()};return n&&(a.e=n),this.eventCenter.emit(e,a),i},t.prototype.getModelAfterSnapToGrid=function(t){var e=this.getModel(t.type);if(!e)throw new Error("找不到".concat(t.type,"对应的节点,请确认是否已注册此类型节点。"));var n=t.x,r=t.y;return n&&r&&(t.x=o_(n,this.gridSize),t.y=o_(r,this.gridSize),"object"==typeof t.text&&(t.text.x+=t.x-n,t.text.y+=t.y-r)),new e(t,this)},t.prototype.cloneNode=function(t){var e=this.getNodeModelById(t),n=null==e?void 0:e.getData();if(n){n.x+=30,n.y+=30,n.id="",n.text&&(n.text.x+=30,n.text.y+=30);var r=this.addNode(n);return r.setSelected(!0),null==e||e.setSelected(!1),r.getData()}},t.prototype.moveNode=function(t,e,n,r){var o;void 0===r&&(r=!1);var i=this.nodesMap[t];if(i){var a=i.model;e=(o=Ox(a.getMoveDistance(e,n,r),2))[0],n=o[1],this.moveEdge(t,e,n)}else console.warn("不存在id为".concat(t,"的节点"))},t.prototype.moveNode2Coordinate=function(t,e,n,r){void 0===r&&(r=!1);var o=this.nodesMap[t];if(o){var i=o.model,a=e-i.x,s=n-i.y;this.moveNode(t,a,s,r)}else console.warn("不存在id为".concat(t,"的节点"))},t.prototype.editText=function(t){this.setElementStateById(t,am.TEXT_EDIT)},t.prototype.addEdge=function(t){var e=_m(t),n=e.type;n||(n=this.edgeType),e.id&&this.edgesMap[e.id]&&delete e.id;var r=this.getModel(n);if(!r)throw new Error("找不到".concat(n,"对应的边,请确认是否已注册此类型边。"));var o=new r(Ex(Ex({},e),{type:n}),this),i=o.getData();return this.edges.push(o),this.eventCenter.emit(lm.EDGE_ADD,{data:i}),o},t.prototype.moveEdge=function(t,e,n){for(var r=0;r<this.edges.length;r++){var o=this.edges[r],i=o.textPosition,a=i.x,s=i.y,u=this.edges[r].sourceNodeId===t,l=this.edges[r].targetNodeId===t;u&&o.moveStartPoint(e,n),l&&o.moveEndPoint(e,n),(u||l)&&this.handleEdgeTextMove(o,a,s)}},t.prototype.handleEdgeTextMove=function(t,e,n){var r;if(t.customTextPosition)t.resetTextPosition();else if(t.modelType===um.POLYLINE_EDGE&&(null===(r=t.text)||void 0===r?void 0:r.value)){var o=t.text,i=t_(o,t.points);t.moveText(i.x-o.x,i.y-o.y)}else{var a=t.textPosition,s=a.x,u=a.y;t.moveText(s-e,u-n)}},t.prototype.deleteEdgeBySourceAndTarget=function(t,e){for(var n=0;n<this.edges.length;n++)if(this.edges[n].sourceNodeId===t&&this.edges[n].targetNodeId===e){var r=this.edges[n].getData();this.edges.splice(n,1),n--,this.eventCenter.emit(lm.EDGE_DELETE,{data:r})}},t.prototype.deleteEdgeById=function(t){if(this.edgesMap[t]){var e=this.edgesMap[t].index,n=this.edgesMap[t].model.getData();this.edges.splice(e,1),this.eventCenter.emit(lm.EDGE_DELETE,{data:n})}},t.prototype.deleteEdgeBySource=function(t){for(var e=0;e<this.edges.length;e++)if(this.edges[e].sourceNodeId===t){var n=this.edges[e].getData();this.edges.splice(e,1),e--,this.eventCenter.emit(lm.EDGE_DELETE,{data:n})}},t.prototype.deleteEdgeByTarget=function(t){for(var e=0;e<this.edges.length;e++)if(this.edges[e].targetNodeId===t){var n=this.edges[e].getData();this.edges.splice(e,1),e--,this.eventCenter.emit(lm.EDGE_DELETE,{data:n})}},t.prototype.setElementStateById=function(t,e,n){this.nodes.forEach((function(r){r.id===t?r.setElementState(e,n):r.setElementState(am.DEFAULT)})),this.edges.forEach((function(r){r.id===t?r.setElementState(e,n):r.setElementState(am.DEFAULT)}))},t.prototype.updateText=function(t,e){var n=Oh(Mx(Mx([],Ox(this.nodes),!1),Ox(this.edges),!1),(function(e){return e.id===t}));null==n||n.updateText(e)},t.prototype.selectNodeById=function(t,e){var n;void 0===e&&(e=!1),e||this.clearSelectElements();var r=null===(n=this.nodesMap[t])||void 0===n?void 0:n.model;null==r||r.setSelected(!0)},t.prototype.selectEdgeById=function(t,e){var n;void 0===e&&(e=!1),e||this.clearSelectElements();var r=null===(n=this.edgesMap[t])||void 0===n?void 0:n.model;null==r||r.setSelected(!0)},t.prototype.selectElementById=function(t,e){void 0===e&&(e=!1),e||this.clearSelectElements();var n=this.getElement(t);null==n||n.setSelected(!0)},t.prototype.clearSelectElements=function(){var t;this.selectElements.forEach((function(t){null==t||t.setSelected(!1)})),this.selectElements.clear(),this.overlapMode===cm.DEFAULT&&(null===(t=this.topElement)||void 0===t||t.setZIndex())},t.prototype.moveNodes=function(t,e,n,r){var o,i,a,s=this;void 0===r&&(r=!1);for(var u=t.reduce((function(t,o){var i=s.nodesMap[o].model;return t[o]=i.getMoveDistance(e,n,r),t}),{}),l=0;l<this.edges.length;l++){var c=this.edges[l],p=c.textPosition,d=p.x,h=p.y,f=u[c.sourceNodeId],y=u[c.targetNodeId],v=void 0,g=void 0;f&&y&&c.modelType===um.POLYLINE_EDGE?(v=(o=Ox(f,2))[0],g=o[1],c.updatePointsList(v,g)):(f&&(v=(i=Ox(f,2))[0],g=i[1],c.moveStartPoint(v,g)),y&&(v=(a=Ox(y,2))[0],g=a[1],c.moveEndPoint(v,g))),(f||y)&&this.handleEdgeTextMove(c,d,h)}},t.prototype.addNodeMoveRules=function(t){this.nodeMoveRules.includes(t)||this.nodeMoveRules.push(t)},t.prototype.setDefaultEdgeType=function(t){this.edgeType=t},t.prototype.changeNodeType=function(t,e){var n=this.getNodeModelById(t);if(n){var r=n.getData();r.type=e;var o=this.getModel(e);if(!o)throw new Error("找不到".concat(e,"对应的节点,请确认是否已注册此类型节点。"));var i=new o(r,this);this.nodes.splice(this.nodesMap[t].index,1,i),this.getNodeEdges(t).forEach((function(e){if(e.sourceNodeId===t){var n=C_(i,e.startPoint,i.width,i.height);e.updateStartPoint(n)}if(e.targetNodeId===t){n=C_(i,e.endPoint,i.width,i.height);e.updateEndPoint(n)}}))}else console.warn("找不到id为".concat(t,"的节点"))},t.prototype.changeEdgeType=function(t,e){var n=this.getEdgeModelById(t);if(n){if(n.type!==e){var r=n.getData();r.type=e;var o=this.getModel(e);if(!o)throw new Error("找不到".concat(e,"对应的节点,请确认是否已注册此类型节点。"));delete r.pointsList;var i=new o(r,this);this.edges.splice(this.edgesMap[t].index,1,i)}}else console.warn("找不到id为".concat(t,"的边"))},t.prototype.getNodeIncomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.targetNodeId===t&&e.push(n)})),e},t.prototype.getNodeOutgoingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.sourceNodeId===t&&e.push(n)})),e},t.prototype.getAnchorIncomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.targetAnchorId===t&&e.push(n)})),e},t.prototype.getAnchorOutcomingEdge=function(t){var e=[];return this.edges.forEach((function(n){n.sourceAnchorId===t&&e.push(n)})),e},t.prototype.getNodeIncomingNode=function(t){var e=this,n=[];return this.edges.forEach((function(r){var o;r.targetNodeId===t&&n.push(null===(o=e.nodesMap[r.sourceNodeId])||void 0===o?void 0:o.model)})),n},t.prototype.getNodeOutgoingNode=function(t){var e=this,n=[];return this.edges.forEach((function(r){r.sourceNodeId===t&&n.push(e.nodesMap[r.targetNodeId].model)})),n},t.prototype.setTheme=function(t){this.theme=db(Ex(Ex({},this.theme),t))},t.prototype.resize=function(t,e){this.width=t||this.rootEl.getBoundingClientRect().width,this.height=e||this.rootEl.getBoundingClientRect().height,this.width&&this.height||console.warn("渲染画布的时候无法获取画布宽高,请确认在container已挂载到DOM。@see https://github.com/didi/LogicFlow/issues/675")},t.prototype.clearData=function(){this.nodes=[],this.edges=[]},t.prototype.getVirtualRectSize=function(){var t=this.nodes,e=[],n=[];t.forEach((function(t){var r=t.x,o=t.y,i=t.width,a=t.height,s=t.getNodeStyle().strokeWidth,u=void 0===s?0:s,l=r+i/2+u,c=r-i/2-u,p=o+a/2+u,d=o-a/2-u;e=e.concat([l,c].filter((function(t){return!Number.isNaN(t)}))),n=n.concat([p,d].filter((function(t){return!Number.isNaN(t)})))}));var r=Math.min.apply(Math,Mx([],Ox(e),!1)),o=Math.max.apply(Math,Mx([],Ox(e),!1)),i=Math.min.apply(Math,Mx([],Ox(n),!1)),a=o-r||0,s=Math.max.apply(Math,Mx([],Ox(n),!1))-i||0;return{width:a,height:s,x:r+a/2,y:i+s/2}},t.prototype.translateCenter=function(){var t=this,e=t.nodes,n=t.width,r=t.height,o=t.rootEl,i=t.transformModel;if(e.length){var a=n||o.clientWidth,s=r||o.clientHeight,u=this.getVirtualRectSize(),l=u.x,c=u.y;i.focusOn(l,c,a,s)}},t.prototype.fitView=function(t,e){void 0===t&&(t=20),void 0===e&&(e=20);var n=this,r=n.nodes,o=n.width,i=n.height,a=n.rootEl,s=n.transformModel;if(r.length){var u=o||a.clientWidth,l=i||a.clientHeight,c=this.getVirtualRectSize(),p=c.width,d=c.height,h=c.x,f=c.y,y=(p+e)/u,v=(d+t)/l,g=1/Math.max(y,v),m=[u/2,l/2];s.zoom(g,m),s.focusOn(h,f,u,l)}},t.prototype.openEdgeAnimation=function(t){var e=this.getEdgeModelById(t);null==e||e.openEdgeAnimation()},t.prototype.closeEdgeAnimation=function(t){var e=this.getEdgeModelById(t);null==e||e.closeEdgeAnimation()},wx([yt],t.prototype,"width",void 0),wx([yt],t.prototype,"height",void 0),wx([yt],t.prototype,"edgeType",void 0),wx([yt],t.prototype,"nodes",void 0),wx([yt],t.prototype,"edges",void 0),wx([yt],t.prototype,"fakeNode",void 0),wx([yt],t.prototype,"overlapMode",void 0),wx([yt],t.prototype,"background",void 0),wx([yt],t.prototype,"gridSize",void 0),wx([yt],t.prototype,"transformModel",void 0),wx([yt],t.prototype,"editConfigModel",void 0),wx([yt],t.prototype,"partial",void 0),wx([xt],t.prototype,"nodesMap",null),wx([xt],t.prototype,"edgesMap",null),wx([xt],t.prototype,"modelsMap",null),wx([xt],t.prototype,"sortElements",null),wx([xt],t.prototype,"textEditElement",null),wx([xt],t.prototype,"selectElements",null),wx([xt],t.prototype,"selectNodes",null),wx([me],t.prototype,"setFakeNode",null),wx([me],t.prototype,"removeFakeNode",null),wx([me],t.prototype,"setModel",null),wx([me],t.prototype,"toFront",null),wx([me],t.prototype,"setElementZIndex",null),wx([me],t.prototype,"deleteNode",null),wx([me],t.prototype,"addNode",null),wx([me],t.prototype,"cloneNode",null),wx([me],t.prototype,"moveNode",null),wx([me],t.prototype,"moveNode2Coordinate",null),wx([me],t.prototype,"editText",null),wx([me],t.prototype,"addEdge",null),wx([me],t.prototype,"moveEdge",null),wx([me],t.prototype,"deleteEdgeBySourceAndTarget",null),wx([me],t.prototype,"deleteEdgeById",null),wx([me],t.prototype,"deleteEdgeBySource",null),wx([me],t.prototype,"deleteEdgeByTarget",null),wx([me],t.prototype,"setElementStateById",null),wx([me],t.prototype,"updateText",null),wx([me],t.prototype,"selectNodeById",null),wx([me],t.prototype,"selectEdgeById",null),wx([me],t.prototype,"selectElementById",null),wx([me],t.prototype,"clearSelectElements",null),wx([me],t.prototype,"moveNodes",null),wx([me],t.prototype,"setDefaultEdgeType",null),wx([me],t.prototype,"changeNodeType",null),wx([me],t.prototype,"changeEdgeType",null),wx([me],t.prototype,"getNodeIncomingEdge",null),wx([me],t.prototype,"getNodeOutgoingEdge",null),wx([me],t.prototype,"getAnchorIncomingEdge",null),wx([me],t.prototype,"getAnchorOutcomingEdge",null),wx([me],t.prototype,"getNodeIncomingNode",null),wx([me],t.prototype,"getNodeOutgoingNode",null),wx([me],t.prototype,"setTheme",null),wx([me],t.prototype,"resize",null),wx([me],t.prototype,"clearData",null),wx([me],t.prototype,"translateCenter",null),wx([me],t.prototype,"fitView",null),wx([me],t.prototype,"openEdgeAnimation",null),wx([me],t.prototype,"closeEdgeAnimation",null),t}(),Ax=function(){return Ax=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ax.apply(this,arguments)},Px=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},Nx=function(){function t(t){this.isShowHorizontal=!1,this.isShowVertical=!1,this.position={x:0,y:0},this.graphModel=t}return t.prototype.getStyle=function(){return Ax({},this.graphModel.theme.snapline)},t.prototype.getCenterSnapLine=function(t,e){for(var n=t.x,r=t.y,o=!1,i=!1,a=0;a<e.length;a++){var s=e[a];if(s.id!==t.id&&(n===s.x&&(o=!0),r===s.y&&(i=!0),o&&i))break}return{isShowVertical:o,isShowHorizontal:i,position:{x:n,y:r}}},t.prototype.getHorizontalSnapline=function(t,e){var n,r=!1,o=0,i=t.id;if(i){var a=this.graphModel.fakeNode;if(a&&a.id===i)n=A_(a);else{var s=this.graphModel.getNodeModelById(i);s&&(n=A_(s))}}for(var u=0;u<e.length;u++){var l=e[u];if(l.id!==t.id){var c=A_(l);if(c.minY===(null==n?void 0:n.minY)||c.maxY===(null==n?void 0:n.minY)){r=!0,o=n.minY;break}if(c.minY===(null==n?void 0:n.maxY)||c.maxY===(null==n?void 0:n.maxY)){r=!0,o=n.maxY;break}}}return{isShowHorizontal:r,isShowVertical:this.isShowVertical,position:Ax(Ax({},this.position),{y:o})}},t.prototype.getVerticalSnapline=function(t,e){var n,r=!1,o=0,i=t.id;if(i){var a=this.graphModel.fakeNode;if(a&&a.id===i)n=A_(a);else{var s=this.graphModel.getNodeModelById(i);s&&(n=A_(s))}}for(var u=0;u<e.length;u++){var l=e[u];if(l.id!==t.id){var c=A_(l);if(c.minX===(null==n?void 0:n.minX)||c.maxX===(null==n?void 0:n.minX)){r=!0,o=n.minX;break}if(c.minX===(null==n?void 0:n.maxX)||c.maxX===(null==n?void 0:n.maxX)){r=!0,o=n.maxX;break}}}return{isShowHorizontal:this.isShowHorizontal,isShowVertical:r,position:Ax(Ax({},this.position),{x:o})}},t.prototype.getSnapLinePosition=function(t,e){var n=this.getCenterSnapLine(t,e),r=n.isShowHorizontal,o=n.isShowVertical;if(!r){var i=this.getHorizontalSnapline(t,e);i.isShowHorizontal&&(n.isShowHorizontal=i.isShowHorizontal,n.position.y=i.position.y)}if(!o){var a=this.getVerticalSnapline(t,e);a.isShowVertical&&(n.isShowVertical=a.isShowVertical,n.position.x=a.position.x)}return n},t.prototype.setSnaplineInfo=function(t){var e=t.isShowHorizontal,n=t.isShowVertical,r=t.position;this.position=r,this.isShowHorizontal=e,this.isShowVertical=n},t.prototype.clearSnapline=function(){this.position={x:0,y:0},this.isShowHorizontal=!1,this.isShowVertical=!1},t.prototype.setNodeSnapLine=function(t){var e=this.graphModel.nodes,n=this.getSnapLinePosition(t,e);this.setSnaplineInfo(n)},Px([yt],t.prototype,"isShowHorizontal",void 0),Px([yt],t.prototype,"isShowVertical",void 0),Px([yt],t.prototype,"position",void 0),Px([me],t.prototype,"clearSnapline",null),Px([me],t.prototype,"setNodeSnapLine",null),t}(),Tx=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},Dx=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},jx={false:[-1/0,-1/0,1/0,1/0],true:[0,0,0,0],vertical:[-1/0,0,1/0,0],horizontal:[0,-1/0,0,1/0]},Cx=function(){function t(t,e){this.MINI_SCALE_SIZE=.2,this.MAX_SCALE_SIZE=16,this.SCALE_X=1,this.SKEW_Y=0,this.SKEW_X=0,this.SCALE_Y=1,this.TRANSLATE_X=0,this.TRANSLATE_Y=0,this.ZOOM_SIZE=.04,this.translateLimitMinX=-1/0,this.translateLimitMinY=-1/0,this.translateLimitMaxX=1/0,this.translateLimitMaxY=1/0,this.eventCenter=t;var n=e.stopMoveGraph,r=void 0!==n&&n;this.updateTranslateLimits(r)}return t.prototype.setZoomMiniSize=function(t){this.MINI_SCALE_SIZE=t},t.prototype.setZoomMaxSize=function(t){this.MAX_SCALE_SIZE=t},t.prototype.HtmlPointToCanvasPoint=function(t){var e=Dx(t,2),n=e[0],r=e[1];return[(n-this.TRANSLATE_X)/this.SCALE_X,(r-this.TRANSLATE_Y)/this.SCALE_Y]},t.prototype.CanvasPointToHtmlPoint=function(t){var e=Dx(t,2),n=e[0],r=e[1];return[n*this.SCALE_X+this.TRANSLATE_X,r*this.SCALE_Y+this.TRANSLATE_Y]},t.prototype.moveCanvasPointByHtml=function(t,e,n){var r=Dx(t,2),o=r[0],i=r[1];return[o+e/this.SCALE_X,i+n/this.SCALE_Y]},t.prototype.fixDeltaXY=function(t,e){return[t/this.SCALE_X,e/this.SCALE_Y]},t.prototype.getTransformStyle=function(){var t=[this.SCALE_X,this.SKEW_Y,this.SKEW_X,this.SCALE_Y,this.TRANSLATE_X,this.TRANSLATE_Y].join(",");return{transform:"matrix(".concat(t,")")}},t.prototype.zoom=function(t,e){void 0===t&&(t=!1);var n=this.SCALE_X,r=this.SCALE_Y;return"number"==typeof t?(n=t,r=t):t?(n+=this.ZOOM_SIZE,r+=this.ZOOM_SIZE):(n-=this.ZOOM_SIZE,r-=this.ZOOM_SIZE),n<this.MINI_SCALE_SIZE||n>this.MAX_SCALE_SIZE||(e&&(this.TRANSLATE_X-=(n-this.SCALE_X)*e[0],this.TRANSLATE_Y-=(r-this.SCALE_Y)*e[1]),this.SCALE_X=n,this.SCALE_Y=r,this.emitGraphTransform("zoom")),"".concat(100*this.SCALE_X,"%")},t.prototype.emitGraphTransform=function(t){this.eventCenter.emit(lm.GRAPH_TRANSFORM,{type:t,transform:{SCALE_X:this.SCALE_X,SKEW_Y:this.SKEW_Y,SKEW_X:this.SKEW_X,SCALE_Y:this.SCALE_Y,TRANSLATE_X:this.TRANSLATE_X,TRANSLATE_Y:this.TRANSLATE_Y}})},t.prototype.resetZoom=function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")},t.prototype.translate=function(t,e){this.TRANSLATE_X+t<=this.translateLimitMaxX&&this.TRANSLATE_X+t>=this.translateLimitMinX&&(this.TRANSLATE_X+=t),this.TRANSLATE_Y+e<=this.translateLimitMaxY&&this.TRANSLATE_Y+e>=this.translateLimitMinY&&(this.TRANSLATE_Y+=e),this.emitGraphTransform("translate")},t.prototype.focusOn=function(t,e,n,r){var o=Dx(this.CanvasPointToHtmlPoint([t,e]),2),i=o[0],a=o[1],s=Dx([n/2-i,r/2-a],2),u=s[0],l=s[1];this.TRANSLATE_X+=u,this.TRANSLATE_Y+=l,this.emitGraphTransform("focusOn")},t.prototype.updateTranslateLimits=function(t){var e;e=Dx(Array.isArray(t)&&4===t.length?t:jx[t.toString()],4),this.translateLimitMinX=e[0],this.translateLimitMinY=e[1],this.translateLimitMaxX=e[2],this.translateLimitMaxY=e[3]},Tx([yt],t.prototype,"SCALE_X",void 0),Tx([yt],t.prototype,"SKEW_Y",void 0),Tx([yt],t.prototype,"SKEW_X",void 0),Tx([yt],t.prototype,"SCALE_Y",void 0),Tx([yt],t.prototype,"TRANSLATE_X",void 0),Tx([yt],t.prototype,"TRANSLATE_Y",void 0),Tx([yt],t.prototype,"ZOOM_SIZE",void 0),Tx([me],t.prototype,"zoom",null),Tx([me],t.prototype,"resetZoom",null),Tx([me],t.prototype,"translate",null),Tx([me],t.prototype,"focusOn",null),t}(),Ix=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),kx=function(){return kx=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},kx.apply(this,arguments)},Rx=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},Lx=function(t){function e(e){var n=t.call(this)||this;n.stepScrollX=0,n.stepScrollY=0,n.onDragging=function(t){var e=t.deltaX,r=t.deltaY;n.setState({isDragging:!0});var o=n.props.graphModel,i=o.transformModel;!0!==o.editConfigModel.stopMoveGraph&&i.translate(e,r)},n.onDragEnd=function(){n.setState({isDragging:!1})},n.zoomHandler=function(t){var e=n.props,r=e.graphModel,o=r.editConfigModel,i=r.transformModel,a=r.gridSize,s=e.graphModel,u=t.deltaX,l=t.deltaY;if(o.stopScrollGraph||!0===t.ctrlKey){if(!o.stopZoomGraph){t.preventDefault();var c=s.getPointByClient({x:t.clientX,y:t.clientY}).canvasOverlayPosition,p=c.x,d=c.y;i.zoom(t.deltaY<0,[p,d])}}else{if(t.preventDefault(),n.stepScrollX+=u,n.stepScrollY+=l,Math.abs(n.stepScrollX)>=a){var h=n.stepScrollX%a,f=n.stepScrollX-h;i.translate(-f*i.SCALE_X,0),n.stepScrollX=h}if(Math.abs(n.stepScrollY)>=a){var y=n.stepScrollY%a,v=n.stepScrollY-y;i.translate(0,-v*i.SCALE_Y),n.stepScrollY=y}}},n.clickHandler=function(t){if("canvas-overlay"===t.target.getAttribute("name")){var e=n.props.graphModel;e.selectElements.size>0&&e.clearSelectElements(),e.eventCenter.emit(lm.BLANK_CLICK,{e:t})}},n.handleContextMenu=function(t){if("canvas-overlay"===t.target.getAttribute("name")){t.preventDefault();var e=n.props.graphModel,r=e.getPointByClient({x:t.clientX,y:t.clientY});e.eventCenter.emit(lm.BLANK_CONTEXTMENU,{e:t,position:r})}},n.mouseDownHandler=function(t){var e=n.props.graphModel,r=e.eventCenter,o=e.editConfigModel,i=e.transformModel.SCALE_X,a=e.gridSize,s=t.target,u=!o.adjustEdge&&!o.adjustNodePosition;("canvas-overlay"===s.getAttribute("name")||u)&&(!0!==o.stopMoveGraph?(n.stepDrag.setStep(a*i),n.stepDrag.handleMouseDown(t)):r.emit(lm.BLANK_MOUSEDOWN,{e:t}),n.clickHandler(t))};var r=e.graphModel,o=r.gridSize,i=r.eventCenter;return n.stepDrag=new bm({onDragging:n.onDragging,onDragEnd:n.onDragEnd,step:o,eventType:"BLANK",isStopPropagation:!1,eventCenter:i,model:void 0}),n.state={isDragging:!1},n}return Ix(e,t),e.prototype.render=function(){var t=this.props.graphModel.transformModel.getTransformStyle().transform,e=this.props,n=e.children,r=e.dnd,o=this.state.isDragging;return _o("svg",kx({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onMouseDown:this.mouseDownHandler,onContextMenu:this.handleContextMenu,className:o?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able"},r.eventMap(),{children:_o("g",{transform:t,children:n})}))},e=Rx([KO],e)}(lr),Bx=function(){return Bx=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Bx.apply(this,arguments)},zx=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};function Hx(t){var e=t.x,n=void 0===e?0:e,r=t.y,o=void 0===r?0:r,i=t.value,a=t.fontSize,s=t.fill,u=void 0===s?"currentColor":s,l=t.overflowMode,c=void 0===l?"default":l,p=t.textWidth,d=void 0===p?"":p,h=t.model,f={textAnchor:"middle","dominant-baseline":"middle",x:n,y:o,fill:u};if(Object.entries(t).forEach((function(t){var e=zx(t,2),n=e[0],r=e[1];"object"!==typeof r&&(f[n]=r)})),i){var y=String(i).split(/[\r\n]/g),v=y.length;if("default"!==c){var g=h.BaseType,m=h.modelType;if(g===sm.NODE&&m!==um.TEXT_NODE||g===sm.EDGE&&d)return function(t){var e=t.value,n=t.fontSize,r=t.model,o=t.fontFamily,i=void 0===o?"":o,a=t.lineHeight,s=t.wrapPadding,u=void 0===s?"0, 0":s,l=t.overflowMode,c=t.x,p=t.y,d=r.width,h=r.textHeight,f=t.textWidth||d,y=String(e).split(/[\r\n]/g),v=y.length,g=I_({rows:y,style:{fontSize:"".concat(n,"px"),width:"".concat(f,"px"),fontFamily:i,lineHeight:a,padding:u},rowsLength:v,className:"lf-get-text-height"}),m=r.height>g?r.height:g;h&&(m=h);var _="ellipsis"===l;_&&(m=n+2);return _o("g",{children:_o("foreignObject",{width:f,height:m,x:c-f/2,y:p-m/2,children:_o("div",{className:"lf-node-text-auto-wrap",style:{minHeight:m,width:f,padding:u},children:_o("div",{className:_?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:_?y.join(""):"",style:Bx({},t),children:y.map((function(t){return _o("div",{className:"lf-node-text--auto-wrap-inner",children:t})}))})})})})}(t)}if(v>1){var _=y.map((function(t,e){return _o("tspan",{className:"lf-text-tspan",x:n,y:o+(e-(v-1)/2)*(a+2),children:t})}));return _o("text",Bx({},f,{children:_}))}return _o("text",Bx({},f,{children:i}))}return null}var Xx=function(){return Xx=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Xx.apply(this,arguments)},Gx=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};function Wx(t){var e={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return Object.entries(t).forEach((function(t){var n=Gx(t,2),r=n[0],o=n[1];"style"===r?e[r]=o:"object"!==typeof o&&(e[r]=o)})),_o("line",Xx({},e))}var Fx=function(){return Fx=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Fx.apply(this,arguments)},Ux=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};function Yx(t){var e=t.x,n=t.y,r=t.width,o=t.height,i=t.className,a=t.radius,s=e-r/2,u=n-o/2,l={};return Object.entries(t).forEach((function(t){var e=Ux(t,2),n=e[0],r=e[1];"object"!==typeof r&&(l[n]=r)})),l.className=i?"lf-basic-shape ".concat(i):"lf-shape",a&&(l.rx=a,l.ry=a),l.x=s,l.y=u,_o("rect",Fx({},l))}Yx.defaultProps={className:"",radius:""};var Vx=function(){return Vx=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Vx.apply(this,arguments)},Kx=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};function qx(t){var e={d:""};return Object.entries(t).forEach((function(t){var n=Kx(t,2),r=n[0],o=n[1];"style"!==r&&"object"===typeof o||(e[r]=o)})),_o("path",Vx({},e))}var Zx=function(){return Zx=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Zx.apply(this,arguments)},Jx=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};function $x(t){var e=t.x,n=void 0===e?0:e,r=t.y,o=void 0===r?0:r,i=t.r,a=void 0===i?4:i,s=t.className,u={cx:n,cy:o,r:a,fill:"transparent",fillOpacity:1,strokeWidth:"1",stroke:"#000",strokeOpacity:1};return Object.entries(t).forEach((function(t){var e=Jx(t,2),n=e[0],r=e[1];"object"!==typeof r&&(u[n]=r)})),u.className=s?"lf-basic-shape ".concat(s):"lf-shape",_o("circle",Zx({},u))}var Qx=function(){return Qx=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Qx.apply(this,arguments)},tE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};function eE(t){var e=t.x,n=void 0===e?0:e,r=t.y,o=void 0===r?0:r,i=t.rx,a=void 0===i?4:i,s=t.ry,u=void 0===s?4:s,l=t.className,c={cx:n,cy:o,rx:a,ry:u,fill:"transparent",fillOpacity:1,strokeWidth:"1",stroke:"#000",strokeOpacity:1};return Object.entries(t).forEach((function(t){var e=tE(t,2),n=e[0],r=e[1];"object"!==typeof r&&(c[n]=r)})),c.className=l?"lf-basic-shape ".concat(l):"lf-shape",_o("ellipse",Qx({},c))}var nE=function(){return nE=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},nE.apply(this,arguments)},rE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};function oE(t){var e=t.points,n=t.className,r={fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1,points:""};return Object.entries(t).forEach((function(t){var e=rE(t,2),n=e[0],o=e[1];"object"!==typeof o&&(r[n]=o)})),r.className=n?"lf-basic-shape ".concat(n):"lf-shape",r.points=e.map((function(t){return t.join(",")})).join(" "),_o("polygon",nE({},r))}var iE=function(){return iE=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},iE.apply(this,arguments)},aE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};function sE(t){var e={points:"",fill:"none"};return Object.entries(t).forEach((function(t){var n=aE(t,2),r=n[0],o=n[1];"style"===r?e[r]=o:"object"!==typeof o&&(e[r]=o)})),_o("polyline",iE({},e))}var uE=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),lE=function(){return lE=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},lE.apply(this,arguments)},cE=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},pE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},dE=function(t){function e(){var e=t.call(this)||this;return e.onDragging=function(t){var n=t.event,r=e.props,o=r.graphModel,i=r.bezierModel,a=r.type,s=o.getPointByClient({x:n.clientX,y:n.clientY}).canvasOverlayPosition,u=s.x,l=s.y;i.updateAdjustAnchor({x:u,y:l},a),o.eventCenter.emit(lm.EDGE_ADJUST,{data:i.getData()})},e.onDragEnd=function(){e.props.bezierModel.isDragging=!1},e.dragHandler=new bm({onDragging:e.onDragging,onDragEnd:e.onDragEnd}),e}return uE(e,t),e.prototype.render=function(){var t=this,e=this.props.position,n=e.x,r=e.y,o=this.props.bezierModel.getEdgeStyle().adjustAnchor;return _o($x,lE({className:"lf-bezier-adjust-anchor",x:n,y:r},o,{onMouseDown:function(e){t.dragHandler.handleMouseDown(e)}}))},e}(lr),hE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return uE(e,t),e.prototype.getBezierAdjust=function(t,e){var n=t.path,r=t.id,o=Jm(n),i=pE(o,4),a=i[0],s=i[1],u=i[2],l=i[3],c=t.getEdgeStyle().adjustLine,p=[];return p.push(_o(Wx,lE({x1:a.x,y1:a.y,x2:s.x,y2:s.y},c))),p.push(_o(dE,{position:s,bezierModel:t,graphModel:e,type:"sNext"},"".concat(r,"_ePre"))),p.push(_o(Wx,lE({x1:l.x,y1:l.y,x2:u.x,y2:u.y},c))),p.push(_o(dE,{position:u,bezierModel:t,graphModel:e,type:"ePre"},"".concat(r,"_sNext"))),p},e.prototype.selectedBezierEdge=function(){for(var t=this.props.graphModel,e=t.edges,n=[],r=0;r<e.length;r++){var o=e[r];o.isSelected&&o.modelType===um.BEZIER_EDGE&&o.draggable&&n.push(this.getBezierAdjust(o,t))}return n},e.prototype.render=function(){return _o("g",{className:"lf-bezier-adjust",children:this.selectedBezierEdge()})},e=cE([KO],e)}(lr),fE=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fE(e,t),e.prototype.render=function(){return _o("div",{className:"lf-background",children:_o("div",{style:this.props.background,className:"lf-background-area"})})},e}(lr),vE=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),gE=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},mE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},_E=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},bE=function(t){function e(){var e=t.apply(this,_E([],mE(arguments),!1))||this;return e.id=nb(),e}return vE(e,t),e.prototype.renderDot=function(){var t=this.props,e=t.config,n=t.size,r=void 0===n?1:n,o=t.visible,i=null!=e?e:{},a=i.color,s=i.thickness,u=void 0===s?2:s,l=Math.min(Math.max(1.5,u),r/2),c=1;return o||(c=0),_o("rect",{width:l,height:l,rx:l/2,ry:l/2,fill:a,opacity:c})},e.prototype.renderMesh=function(){var t=this.props,e=t.config,n=t.size,r=void 0===n?1:n,o=t.visible,i=null!=e?e:{},a=i.color,s=i.thickness,u=void 0===s?1:s,l=Math.min(Math.max(1,u),r/2),c=1;return o||(c=0),_o("path",{d:"M ".concat(r," 0 H0 M0 0 V0 ").concat(r),stroke:a,strokeWidth:l,opacity:c})},e.prototype.render=function(){var t=this.props,e=t.type,n=t.size,r=t.graphModel.transformModel,o=[r.SCALE_X,r.SKEW_Y,r.SKEW_X,r.SCALE_Y,r.TRANSLATE_X,r.TRANSLATE_Y].join(","),i="matrix(".concat(o,")");return _o("div",{className:"lf-grid",children:_o("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",children:[_o("defs",{children:_o("pattern",{id:this.id,patternUnits:"userSpaceOnUse",patternTransform:i,x:"0",y:"0",width:n,height:n,children:["dot"===e&&this.renderDot(),"mesh"===e&&this.renderMesh()]})}),_o("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")})]})})},e=gE([KO],e)}(lr);bE.defaultProps={size:10,visible:!0,type:"dot",config:{color:"#ababab",thickness:1}};var xE,EE=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wE=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},OE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return EE(e,t),e.prototype.render=function(){return _o("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",className:"modification-overlay",children:_o("g",{transform:this.props.graphModel.transformModel.getTransformStyle().transform,children:this.props.children})})},e=wE([KO],e)}(lr),ME=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),SE=function(){return SE=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},SE.apply(this,arguments)},AE=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},PE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ME(e,t),e.prototype.getNodesOutline=function(){var t=this.props.graphModel,e=t.nodes,n=t.editConfigModel,r=n.hoverOutline,o=n.nodeSelectedOutline,i=[];return e.forEach((function(t){if(t.isHovered||t.isSelected){var e=t.isHovered,n=t.isSelected,a=t.x,s=t.y,u=t.width,l=t.height;if(o&&n||r&&e){var c=t.getOutlineStyle(),p={};if(Object.keys(c).forEach((function(t){"hover"!==t&&(p[t]=c[t])})),e){var d=c.hover;p=SE(SE({},p),d)}i.push(_o(Yx,SE({transform:t.transform,className:"lf-outline-node",x:a,y:s,width:u+10,height:l+10},p)))}}})),i},e.prototype.getEdgeOutline=function(){for(var t=this.props.graphModel,e=t.edges,n=t.editConfigModel,r=n.edgeSelectedOutline,o=n.hoverOutline,i=[],a=0;a<e.length;a++){var s=e[a];(r&&s.isSelected||o&&s.isHovered)&&(s.modelType===um.LINE_EDGE?i.push(this.getLineOutline(s)):s.modelType===um.POLYLINE_EDGE?i.push(this.getPolylineOutline(s)):s.modelType===um.BEZIER_EDGE&&i.push(this.getBezierOutline(s)))}return i},e.prototype.getLineOutline=function(t){var e=t.startPoint,n=t.endPoint,r=(e.x+n.x)/2,o=(e.y+n.y)/2,i=Math.abs(e.x-n.x)+10,a=Math.abs(e.y-n.y)+10,s=t.getOutlineStyle();return _o(Yx,SE({className:"lf-outline-edge",x:r,y:o,width:i,height:a},s))},e.prototype.getPolylineOutline=function(t){var e=t.points,n=Ym(e),r=Tm(n,8),o=r.x,i=r.y,a=r.width,s=r.height,u=t.getOutlineStyle();return _o(Yx,SE({className:"lf-outline",x:o,y:i,width:a,height:s},u))},e.prototype.getBezierOutline=function(t){var e=t.path,n=Jm(e),r=Tm(n,8),o=r.x,i=r.y,a=r.width,s=r.height,u=t.getOutlineStyle();return _o(Yx,SE({className:"lf-outline",x:o,y:i,width:a,height:s},u))},e.prototype.render=function(){return _o("g",{className:"lf-outline",children:[this.getNodesOutline(),this.getEdgeOutline()]})},e=AE([KO],e)}(lr),NE=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),TE=function(){return TE=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},TE.apply(this,arguments)},DE=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},jE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return NE(e,t),e.prototype.render=function(){var t=this.props.snaplineModel,e=null!=t?t:{},n=e.position,r=e.isShowHorizontal,o=e.isShowVertical,i=null==t?void 0:t.getStyle(),a=null!=n?n:{},s=a.x,u=void 0===s?0:s,l=a.y,c=void 0===l?0:l,p=TE(TE({x1:-1e5,y1:c,x2:1e5,y2:c},i),{stroke:r?null==i?void 0:i.stroke:"none"}),d=TE(TE({x1:u,y1:-1e5,x2:u,y2:1e5},i),{stroke:o?null==i?void 0:i.stroke:"none"});return _o("g",{className:"lf-snapline",children:[_o(Wx,TE({},p)),_o(Wx,TE({},d))]})},e=DE([KO],e)}(lr),CE=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),IE=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},kE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return CE(e,t),e.prototype.componentDidMount=function(){this.triggerToolRender()},e.prototype.componentDidUpdate=function(){this.triggerToolRender()},e.prototype.getTools=function(){var t=this.props,e=t.tool,n=t.graphModel,r=n.textEditElement,o=e.getTools().map((function(t){return ar(t,{textEditElement:r,graphModel:n,logicFlow:e.instance})}));return e.components=o,o},e.prototype.triggerToolRender=function(){var t=this.props,e=t.tool,n=t.graphModel,r=document.querySelector("#ToolOverlay_".concat(n.flowId)),o=e.getInstance();o.components.forEach((function(t){return t(o,r)})),o.components=[]},e.prototype.render=function(){var t=this.props.graphModel;return _o("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(t.flowId),children:this.getTools()})},e=IE([KO],e)}(lr),RE=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),LE=function(){return LE=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},LE.apply(this,arguments)},BE=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},zE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return RE(e,t),e.prototype.getComponent=function(t,e,n){void 0===n&&(n="canvas-overlay");var r=(0,this.props.getView)(t.type);return r?_o(r,{model:t,graphModel:e,overlay:n},t.id):null},e.prototype.render=function(){var t=this,e=this.props,n=e.graphModel,r=e.tool,o=e.options,i=e.dnd,a=e.snaplineModel,s={};o.width&&(s.width="".concat(n.width,"px")),o.height&&(s.height="".concat(n.height,"px"));var u=o.grid,l=n.fakeNode,c=n.editConfigModel.adjustEdge;return _o("div",{className:"lf-graph","flow-id":n.flowId,style:s,children:[_o(Lx,{graphModel:n,dnd:i,children:[_o("g",{className:"lf-base",children:jh(n.sortElements,(function(e){return t.getComponent(e,n)}))}),l?this.getComponent(l,n):""]}),_o(OE,{graphModel:n,children:[_o(PE,{graphModel:n}),c?_o(hE,{graphModel:n}):"",!1!==o.snapline?_o(jE,{snaplineModel:a}):""]}),_o(kE,{graphModel:n,tool:r}),o.background&&_o(yE,{background:o.background}),o.grid&&_o(bE,LE({},u,{graphModel:n}))]})},e=BE([KO],e)}(lr),HE=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),XE=function(){return XE=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},XE.apply(this,arguments)},GE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},WE=function(t){function e(){var e=t.call(this)||this;return e.onDragStart=function(t){var n=t.event,r=e.props,o=r.anchorData,i=r.nodeModel,a=r.graphModel;a.selectNodeById(i.id),i.autoToFront&&a.toFront(i.id),a.eventCenter.emit(lm.ANCHOR_DRAGSTART,{data:o,e:n,nodeModel:i}),e.setState({startX:o.x,startY:o.y,endX:o.x,endY:o.y})},e.onDragging=function(t){var n=t.event,r=e.props,o=r.graphModel,i=r.nodeModel,a=r.anchorData,s=o.transformModel,u=o.eventCenter,l=o.width,c=o.height,p=o.editConfigModel,d=p.autoExpand,h=p.stopMoveGraph,f=n.clientX,y=n.clientY,v=o.getPointByClient({x:f,y:y}),g=v.domOverlayPosition,m=g.x,_=g.y,b=v.canvasOverlayPosition,x=b.x,E=b.y;e.t&&ib(e.t);var w=[];m<10?w=[10,0]:m+10>l?w=[-10,0]:_<10?w=[0,10]:_+10>c&&(w=[0,-10]),e.setState({endX:x,endY:E,dragging:!0}),e.moveAnchorEnd(x,E),w.length>0&&!h&&d&&(e.t=ob((function(){var t=GE(w,2),n=t[0],r=t[1];s.translate(n,r);var o=e.state,i=o.endX,a=o.endY;e.setState({endX:i-n,endY:a-r}),e.moveAnchorEnd(i-n,a-r)}))),u.emit(lm.ANCHOR_DRAG,{data:a,e:n,nodeModel:i})},e.onDragEnd=function(t){var n=t.event;e.t&&ib(e.t);var r=e.checkEnd(n);e.setState({startX:0,startY:0,endX:0,endY:0,dragging:!1}),e.sourceRuleResults.clear(),e.targetRuleResults.clear();var o=e.props,i=o.graphModel,a=o.nodeModel,s=o.anchorData;r&&i.eventCenter.emit(lm.ANCHOR_DRAGEND,{data:s,e:n,nodeModel:a,edgeModel:r})},e.checkEnd=function(t){var n,r=e.props,o=r.graphModel,i=r.nodeModel,a=r.anchorData,s=a.x,u=a.y,l=a.id,c=e.state,p=c.endX,d=c.endY,h=c.dragging,f=E_({x:p,y:d},o);if(e.preTargetNode&&e.preTargetNode.state!==am.DEFAULT&&e.preTargetNode.setElementState(am.DEFAULT),h&&f&&f.node){var y=f.node,v=f.anchor.id,g="".concat(i.id,"_").concat(y.id,"_").concat(v,"_").concat(l),m=e.sourceRuleResults.get(g)||{},_=m.isAllPass,b=m.msg,x=e.targetRuleResults.get(g)||{},E=x.isAllPass,w=x.msg;if(_&&E){y.setElementState(am.DEFAULT);var O=o.getNodeModelById(f.node.id),M=null===(n=o.edgeGenerator)||void 0===n?void 0:n.call(o,i.getData(),null==O?void 0:O.getData()),S=o.addEdge(XE(XE({},M),{sourceNodeId:i.id,sourceAnchorId:l,startPoint:{x:s,y:u},targetNodeId:f.node.id,targetAnchorId:f.anchor.id,endPoint:{x:f.anchor.x,y:f.anchor.y}})),A=e.props.anchorData;return o.eventCenter.emit(lm.ANCHOR_DROP,{data:A,e:t,nodeModel:i,edgeModel:S}),S}var P=y.getData();return o.eventCenter.emit(lm.CONNECTION_NOT_ALLOWED,{data:P,msg:w||b||"不允许添加连线"}),null}},e.sourceRuleResults=new Map,e.targetRuleResults=new Map,e.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},e.dragHandler=new bm({onDragStart:e.onDragStart,onDragging:e.onDragging,onDragEnd:e.onDragEnd}),e}return HE(e,t),e.prototype.getAnchorShape=function(){var t=this.props,e=t.anchorData,n=t.style,r=t.node.getAnchorShape(e);if(r)return r;var o=e.x,i=e.y,a=XE(XE({},n),null==n?void 0:n.hover);return _o("g",{children:[_o($x,XE({className:"lf-node-anchor-hover"},a,{x:o,y:i})),_o($x,XE({className:"lf-node-anchor"},n,{x:o,y:i}))]})},Object.defineProperty(e.prototype,"customTrajectory",{get:function(){return this.props.graphModel.customTrajectory},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"relateEdges",{get:function(){var t=this.props,e=t.graphModel,n=e.getAnchorIncomingEdge,r=e.getAnchorOutcomingEdge,o=t.anchorData.id;return{incomingEdgeList:n(o),outcomingEdgeList:r(o)}},enumerable:!1,configurable:!0}),e.prototype.moveAnchorEnd=function(t,e){var n,r,o=this.props,i=o.graphModel,a=o.nodeModel,s=o.anchorData,u=E_({x:t,y:e},i);if(u){var l=u.node,c=u.anchor.id;if(this.preTargetNode&&this.preTargetNode!==u.node&&this.preTargetNode.setElementState(am.DEFAULT),s.id===c)return;this.preTargetNode=l;var p="".concat(a.id,"_").concat(l.id,"_").concat(c,"_").concat(s.id);if(!this.targetRuleResults.has(p)){var d=u.anchor,h=a.isAllowConnectedAsSource(l,s,d),f=l.isAllowConnectedAsTarget(a,s,d);this.sourceRuleResults.set(p,R_(h)),this.targetRuleResults.set(p,R_(f))}var y=(null!==(n=this.sourceRuleResults.get(p))&&void 0!==n?n:{}).isAllPass,v=(null!==(r=this.targetRuleResults.get(p))&&void 0!==r?r:{}).isAllPass;y&&v?l.setElementState(am.ALLOW_CONNECT):l.setElementState(am.NOT_ALLOW_CONNECT)}else this.preTargetNode&&this.preTargetNode.state!==am.DEFAULT&&this.preTargetNode.setElementState(am.DEFAULT)},e.prototype.isShowLine=function(){var t=this.state,e=t.startX,n=t.startY,r=t.endX,o=t.endY;return O_(e,n,r,o)>10},e.prototype.render=function(){var t=this,e=this.state,n=e.startX,r=e.startY,o=e.endX,i=e.endY,a=this.props,s=a.anchorData.edgeAddable,u=a.edgeStyle;return _o("g",{className:"lf-anchor",children:[_o("g",{onMouseDown:function(e){!1!==s&&t.dragHandler.handleMouseDown(e)},children:this.getAnchorShape()}),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(XE({sourcePoint:{x:n,y:r},targetPoint:{x:o,y:i}},u)):_o(Wx,XE({x1:n,y1:r,x2:o,y2:i},u,{"pointer-events":"none"})))]})},e}(lr),FE=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),UE=function(){return UE=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},UE.apply(this,arguments)},YE=function(t){function e(e){var n=t.call(this,e)||this;return n.style={},n.onDragging=function(t){var e,r=t.event,o=n.props,i=o.graphModel,a=o.nodeModel,s=o.eventCenter,u=i.selectNodes,l=a.x,c=a.y,p=r.clientX,d=r.clientY,h=i.getPointByClient({x:p,y:d}).canvasOverlayPosition,f=h.x,y=h.y,v=new p_(f-l,y-c),g=(null===(e=n.normal)||void 0===e?void 0:e.angle(v))-n.defaultAngle,m=new __(-l,-c).rotate(g).translate(l,c).toString();a.transform=m,a.rotate=g;var _=jh(u,(function(t){return t.id}));-1===_.indexOf(a.id)&&(_=[a.id]);var b=vv(_,(function(t,e){var n=i.getNodeModelById(e);return t[e]=null==n?void 0:n.getMoveDistance(0,0,!1),t}),{});_.forEach((function(t){i.getNodeEdges(t).forEach((function(t){if(b[t.sourceNodeId]){var e=i.getNodeModelById(t.sourceNodeId).anchors.find((function(e){return e.id===t.sourceAnchorId}));t.updateStartPoint(e)}if(b[t.targetNodeId]){e=i.getNodeModelById(t.targetNodeId).anchors.find((function(e){return e.id===t.targetAnchorId}));t.updateEndPoint(e)}}))})),s.emit(lm.NODE_ROTATE,{e:r,nodeModel:a})},n.style=e.style,n.stepperDrag=new bm({onDragging:n.onDragging}),n}return FE(e,t),e.prototype.render=function(){var t=this,e=this.props.nodeModel,n=e.x,r=e.y,o=n+e.width/2+20,i=r-e.height/2-20;return this.normal=new p_(1,0),this.defaultAngle=this.normal.angle(new p_(o-n,i-r)),e.defaultAngle=this.defaultAngle,_o("g",{className:"lf-rotate-control",children:_o("g",{onMouseDown:function(e){t.stepperDrag.handleMouseDown(e)},children:_o($x,UE({},this.style,{cx:o,cy:i}))})})},e}(lr),VE=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),KE=function(){return KE=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},KE.apply(this,arguments)},qE=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},ZE=function(t){function e(e){var n=t.call(this)||this;n.onDragging=function(t){var e=t.deltaX,r=t.deltaY,o=n.props,i=o.model,a=o.graphModel.transformModel,s=qE(a.fixDeltaXY(e,r),2),u=s[0],l=s[1];i.moveText(u,l)},n.dblClickHandler=function(){n.props.editable&&n.props.model.setElementState(am.TEXT_EDIT)},n.mouseDownHandle=function(t){var e=n.props,r=e.draggable,o=e.model,i=e.graphModel.editConfigModel.nodeTextDraggable;(r||i)&&(n.stepDrag.model=o,n.stepDrag.handleMouseDown(t))};var r=e.draggable;return n.stepDrag=new bm({onDragging:n.onDragging,step:1,isStopPropagation:r}),n}return VE(e,t),e.prototype.getShape=function(){var t=this.props,e=t.model,n=t.graphModel,r=e.text,o=n.editConfigModel,i=r.value,a=r.x,s=r.y,u=r.editable,l=r.draggable,c={x:a,y:s,className:"",value:i};u?c.className="lf-element-text":l||o.nodeTextDraggable?c.className="lf-text-draggable":c.className="lf-text-disabled";var p=e.getTextStyle();return _o(Hx,KE({},c,p,{model:e}))},e.prototype.render=function(){if(this.props.model.text)return _o("g",{onMouseDown:this.mouseDownHandle,onDblClick:this.dblClickHandler,children:this.getShape()})},e}(lr),JE=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$E=function(){return $E=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},$E.apply(this,arguments)},QE=function(t){function e(e){var n=t.call(this,e)||this;return n.setHoverON=function(){n.setState({isHovered:!0})},n.setHoverOFF=function(){n.setState({isHovered:!1})},n.state={isHovered:!1},n}return JE(e,t),e.prototype.getBackground=function(){var t=this.props.model,e=t.getTextStyle(),n=t.text,r=t.width,o=e.background||{};if(this.state.isHovered&&(null==e?void 0:e.hover)&&(null==e?void 0:e.hover.background)&&(o=$E($E({},o),null==e?void 0:e.hover.background)),n&&n.value&&"transparent"!==o.fill){var i=null!=e?e:{},a=i.fontSize,s=i.overflowMode,u=i.lineHeight,l=i.wrapPadding,c=i.textWidth,p=n.value,d=n.x,h=n.y,f=String(p).split(/[\r\n]/g),y=f.length,v=void 0;if("autoWrap"===s&&c){var g=I_({rows:f,style:{fontSize:"".concat(a,"px"),width:"".concat(c,"px"),lineHeight:u,padding:l},rowsLength:y,className:"lf-get-text-height"});v=$E($E({},o),{x:d-1,y:h-1,width:c,height:g})}else{f&&f.forEach((function(t){qm(t)}));var m=k_({rows:f,fontSize:a,rowsLength:y}),_=m.width,b=m.height;if("ellipsis"===s&&(_=c||r,b=a+2),"string"==typeof o.wrapPadding){var x=o.wrapPadding.split(",").filter((function(t){return t.trim()})).map((function(t){return parseFloat(t.trim())}));x.length>0&&x.length<=4&&(1===x.length?x=[x[0],x[0],x[0],x[0]]:2===x.length?x=[x[0],x[1],x[0],x[1]]:3===x.length&&(x=[x[0],x[1],x[2],x[1]]),_+=x[1]+x[3],b+=x[0]+x[2],d+=(x[1]-x[3])/2,h+=(x[2]-x[0])/2)}v=$E($E({},o),{x:d-1,y:h-1,width:_,height:b})}return _o(Yx,$E({},v))}},e.prototype.getShape=function(){var t=this.props.model,e=t.text,n=e.value,r=e.x,o=e.y;if(!n)return null;var i=t.getTextStyle(),a=$E({x:r,y:o,className:"lf-element-text",value:n},i);return _o("g",{className:"lf-line-text",onMouseEnter:this.setHoverON,onMouseLeave:this.setHoverOFF,children:[this.getBackground(),_o(Hx,$E({},a,{model:t}))]})},e}(ZE),tw=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ew=function(){return ew=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ew.apply(this,arguments)},nw=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};!function(t){t[t.LEFT_TOP=0]="LEFT_TOP",t[t.RIGHT_TOP=1]="RIGHT_TOP",t[t.RIGHT_BOTTOM=2]="RIGHT_BOTTOM",t[t.LEFT_BOTTOM=3]="LEFT_BOTTOM"}(xE||(xE={}));var rw,ow=function(t){function e(e){var n=t.call(this)||this;n.updateEdgePointByAnchors=function(){var t=n.nodeModel,e=t.id,r=t.anchors;eh(n.graphModel.getNodeEdges(e),(function(t){if(t.sourceNodeId===e)(n=Oh(r,(function(e){return e.id===t.sourceAnchorId})))&&t.updateStartPoint({x:n.x,y:n.y});else if(t.targetNodeId===e){var n;(n=Oh(r,(function(e){return e.id===t.targetAnchorId})))&&t.updateEndPoint({x:n.x,y:n.y})}}))},n.triggerResizeEvent=function(t,e){n.graphModel.eventCenter.emit(lm.NODE_RESIZE,{preNodeData:t,nextNodeData:e})},n.recalcResizeInfo=function(t,e,n,r,o){void 0===n&&(n=1),void 0===r&&(r=!1),void 0===o&&(o=!1);var i=mp(e),a=i.deltaX,s=i.deltaY,u=i.width,l=i.height,c=i.PCTResizeInfo;if(c){var p=0,d=0;switch(t){case xE.LEFT_TOP:d=(-1*a-s)/4;break;case xE.RIGHT_TOP:d=(a-s)/4;break;case xE.RIGHT_BOTTOM:d=(a+s)/4;break;case xE.LEFT_BOTTOM:d=(-1*a+s)/4}0!==d&&(p=Math.round(d/c.ResizeBasis.basisHeight*1e5)/1e3),c.ResizePCT.widthPCT=Math.max(Math.min(c.ResizePCT.widthPCT+p,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit),c.ResizePCT.heightPCT=Math.max(Math.min(c.ResizePCT.heightPCT+p,c.ScaleLimit.maxScaleLimit),c.ScaleLimit.minScaleLimit);var h=Math.round(c.ResizePCT.widthPCT*c.ResizeBasis.basisWidth/100),f=Math.round(c.ResizePCT.heightPCT*c.ResizeBasis.basisHeight/100);switch(t){case xE.LEFT_TOP:a=u-h,s=l-f;break;case xE.RIGHT_TOP:a=h-u,s=l-f;break;case xE.RIGHT_BOTTOM:a=h-u,s=f-l;break;case xE.LEFT_BOTTOM:a=u-h,s=f-l}return i}switch(t){case xE.LEFT_TOP:i.width=r?u:u-a*n,i.height=o?l:l-s*n;break;case xE.RIGHT_TOP:i.width=r?u:u+a*n,i.height=o?l:l-s*n;break;case xE.RIGHT_BOTTOM:i.width=r?u:u+a*n,i.height=o?l:l+s*n;break;case xE.LEFT_BOTTOM:i.width=r?u:u-a*n,i.height=o?l:l+s*n}return i},n.resizeNode=function(t){var e=t.deltaX,r=t.deltaY,o=n.nodeModel,i=o.r,a=o.rx,s=o.ry,u=o.width,l=o.height,c=o.PCTResizeInfo,p=o.minWidth,d=o.minHeight,h=o.maxWidth,f=o.maxHeight,y=p===h,v=d===f,g={width:i||a||u,height:i||s||l,deltaX:e,deltaY:r,PCTResizeInfo:c},m=i||a&&s?.5:1,_=n.recalcResizeInfo(n.index,g,m,y,v);if(_.width<p||_.width>h||_.height<d||_.height>f)n.dragHandler.cancelDrag();else{_.deltaX=y?0:_.deltaX,_.deltaY=y?0:_.deltaY;var b=n.nodeModel.getData(),x=n.nodeModel.resize(_);console.log("nextNodeData ===>>>",x),n.updateEdgePointByAnchors(),n.triggerResizeEvent(b,x)}},n.onDragging=function(t){var e=t.deltaX,r=t.deltaY,o=n.graphModel.transformModel,i=nw(o.fixDeltaXY(e,r),2),a=i[0],s=i[1];n.resizeNode({deltaX:a,deltaY:s})},n.onDragEnd=function(){var t=n.nodeModel.x,e=n.nodeModel.y;n.nodeModel.moveTo(t,e),n.updateEdgePointByAnchors()};var r=e.index,o=e.model,i=e.graphModel;return n.index=r,n.nodeModel=o,n.graphModel=i,n.dragHandler=new bm({onDragging:n.onDragging,onDragEnd:n.onDragEnd,step:i.gridSize}),n}return tw(e,t),e.prototype.render=function(){var t=this.props,e=t.x,n=t.y,r=t.direction,o=t.model.getResizeControlStyle();return _o("g",{className:"lf-resize-control lf-resize-control-".concat(r),children:_o(Yx,ew({className:"lf-resize-control-content",x:e,y:n},o,{onMouseDown:this.dragHandler.handleMouseDown}))})},e}(lr),iw=function(t){function e(){return t.call(this)||this}return tw(e,t),e.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,r=A_(e),o=r.minX,i=r.minY,a=r.maxX,s=r.maxY;return jh([{index:xE.LEFT_TOP,direction:"nw",x:o,y:i},{index:xE.RIGHT_TOP,direction:"ne",x:a,y:i},{index:xE.RIGHT_BOTTOM,direction:"se",x:a,y:s},{index:xE.LEFT_BOTTOM,direction:"sw",x:o,y:s}],(function(t){return _o(ow,ew({},t,{model:e,graphModel:n}))}))},e.prototype.getResizeOutline=function(){var t=this.props.model,e=t.x,n=t.y,r=t.width,o=t.height,i=t.getResizeOutlineStyle();return _o(Yx,ew({},i,{x:e,y:n,width:r,height:o}))},e.prototype.render=function(){return _o("g",{className:"lf-resize-control-group",children:[this.getResizeOutline(),this.getResizeControl()]})},e}(lr),aw=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),sw=function(){return sw=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},sw.apply(this,arguments)},uw=function(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 o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n},lw=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},cw=function(t){function e(e){var n=t.call(this)||this;n.onDragStart=function(t){var e=t.event,r=n.props,o=r.model,i=r.graphModel;if(e){var a=i.getPointByClient({x:e.clientX,y:e.clientY}).canvasOverlayPosition,s=a.x,u=a.y;n.moveOffset={dx:o.x-s,dy:o.y-u}}},n.onDragging=function(t){var e,r,o,i,a=t.event,s=n.props,u=s.model,l=s.graphModel,c=l.editConfigModel,p=c.stopMoveGraph,d=c.autoExpand,h=l.transformModel,f=l.selectNodes,y=l.width,v=l.height,g=l.gridSize;u.isDragging=!0;var m=a,_=m.clientX,b=m.clientY,x=l.getPointByClient({x:_,y:b}).canvasOverlayPosition,E=x.x,w=x.y,O=lw(h.CanvasPointToHtmlPoint([E,w]),2),M=O[0],S=O[1];if(E+=null!==(r=null===(e=n.moveOffset)||void 0===e?void 0:e.dx)&&void 0!==r?r:0,w+=null!==(i=null===(o=n.moveOffset)||void 0===o?void 0:o.dy)&&void 0!==i?i:0,E=o_(E,g),w=o_(w,g),y&&v){if(!d||p||!(M<0||S<0||M>y||S>v)){var A=lw(h.CanvasPointToHtmlPoint([E-u.width/2,w-u.height/2]),2),P=A[0],N=A[1],T=lw(h.CanvasPointToHtmlPoint([E+u.width/2,w+u.height/2]),2),D=T[0],j=T[1],C=Math.max(g,20),I=[];P<0?I=[C,0]:D>l.width?I=[-C,0]:N<0?I=[0,C]:j>l.height&&(I=[0,-C]),n.t&&ib(n.t),u.transform=new __(-E,-w).rotate(u.rotate).translate(E,w).toString();var k=f.map((function(t){return t.id}));-1===k.indexOf(u.id)&&(k=[u.id]),I.length>0&&!p&&d?n.t=ob((function(){var t=lw(I,2),e=t[0],n=t[1];h.translate(null!=e?e:0,null!=n?n:0);var r=-(null!=e?e:0)/h.SCALE_X,o=-(null!=n?n:0)/h.SCALE_X;l.moveNodes(k,r,o)})):l.moveNodes(k,E-u.x,w-u.y)}}else l.moveNode2Coordinate(u.id,E,w)},n.onDragEnd=function(){n.t&&ib(n.t),n.props.model.isDragging=!1},n.handleMouseUp=function(){var t=n.props.model;n.mouseUpDrag=t.isDragging},n.handleClick=function(t){var e=!1===n.mouseUpDrag;if(n.startTime){var r=n.props,o=r.model,i=r.graphModel;if(e){var a={data:o.getData(),e:t,position:i.getPointByClient({x:t.clientX,y:t.clientY}),isSelected:!1,isMultiple:!1},s=2===t.button,u=2===t.detail;if(!s){var l=i.editConfigModel,c=s_(t,l);a.isMultiple=c,o.isSelected&&!u&&c?(a.isSelected=!1,o.setSelected(!1)):(i.selectNodeById(o.id,c),a.isSelected=!0,n.toFront()),u?(l.nodeTextEdit&&o.text.editable&&(o.setSelected(!1),i.setElementStateById(o.id,am.TEXT_EDIT)),i.eventCenter.emit(lm.NODE_DBCLICK,a)):(i.eventCenter.emit(lm.ELEMENT_CLICK,a),i.eventCenter.emit(lm.NODE_CLICK,a))}}}},n.handleContextMenu=function(t){t.preventDefault();var e=n.props,r=e.model,o=e.graphModel,i=r.getData(),a=o.getPointByClient({x:t.clientX,y:t.clientY});o.setElementStateById(r.id,am.SHOW_MENU,a.domOverlayPosition),r.isSelected||o.selectNodeById(r.id),o.eventCenter.emit(lm.NODE_CONTEXTMENU,{data:i,e:t,position:a}),n.toFront()},n.handleMouseDown=function(t){var e=n.props,r=e.model,o=e.graphModel;n.startTime=(new Date).getTime(),o.editConfigModel.adjustNodePosition&&r.draggable&&n.stepDrag&&n.stepDrag.handleMouseDown(t)},n.setHoverON=function(t){var e=n.props,r=e.model,o=e.graphModel;if(!r.isHovered){var i=r.getData();r.setHovered(!0),o.eventCenter.emit(lm.NODE_MOUSEENTER,{data:i,e:t})}},n.setHoverOFF=function(t){var e=n.props,r=e.model,o=e.graphModel,i=r.getData();r.isHovered&&(r.setHovered(!1),o.eventCenter.emit(lm.NODE_MOUSELEAVE,{data:i,e:t}))},n.onMouseOut=function(t){mm&&n.setHoverOFF(t)};var r=e.graphModel,o=r.gridSize,i=r.eventCenter,a=e.model;return n.stepDrag=new bm({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd,step:o,eventType:"NODE",isStopPropagation:!1,eventCenter:i,model:a}),n.modelDisposer=Oe((function(){return n.props}),(function(t){t&&t.model&&n.stepDrag.setModel(t.model)})),n}return aw(e,t),e.prototype.componentWillUnmount=function(){this.modelDisposer&&this.modelDisposer()},e.prototype.componentDidMount=function(){},e.prototype.componentDidUpdate=function(){},e.prototype.getAnchorShape=function(t){return null},e.prototype.getAnchors=function(){var t=this,e=this.props,n=e.model,r=e.graphModel,o=n.isSelected,i=n.isHitable,a=n.isDragging,s=n.isShowAnchor;return i&&(o||s)&&!a?jh(n.anchors,(function(e,o){var i=n.getAnchorLineStyle(e),a=n.getAnchorStyle(e);return _o(WE,{anchorData:e,node:t,style:a,edgeStyle:i,anchorIndex:o,nodeModel:n,graphModel:r,setHoverOFF:t.setHoverOFF})})):[]},e.prototype.getRotateControl=function(){var t=this.props,e=t.model,n=t.graphModel,r=e.isSelected,o=e.isHitable,i=e.enableRotate,a=e.isHovered,s=e.getRotateControlStyle();if(o&&(r||a)&&i)return _o(YE,{graphModel:n,nodeModel:e,eventCenter:n.eventCenter,style:s})},e.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,r=e.isSelected,o=e.isHitable,i=e.enableResize,a=e.isHovered,s=e.getResizeControlStyle();return o&&(r||a)&&i?_o(iw,{style:s,model:e,graphModel:n}):null},e.prototype.getText=function(){var t,e=this.props,n=e.model,r=e.graphModel;if(n.state===am.TEXT_EDIT)return null;if(n.text){var o=r.editConfigModel,i=!1;return(n.text.draggable||o.nodeTextDraggable)&&(i=!0),_o(ZE,{editable:o.nodeTextEdit&&(null===(t=n.text.editable)||void 0===t||t),model:n,graphModel:r,draggable:i})}return null},e.prototype.getStateClassName=function(){var t=this.props.model,e=t.state,n=t.isDragging,r=t.isSelected,o="lf-node";switch(e){case am.ALLOW_CONNECT:o+=" lf-node-allow";break;case am.NOT_ALLOW_CONNECT:o+=" lf-node-not-allow";break;default:o+=" lf-node-default"}return n&&(o+=" lf-isDragging"),r&&(o+=" lf-node-selected"),o},e.prototype.toFront=function(){var t=this.props,e=t.model,n=t.graphModel;e.autoToFront&&n.toFront(e.id)},e.prototype.render=function(){var t,e=this.props,n=e.model,r=e.graphModel,o=r.editConfigModel,i=o.hideAnchors,a=o.adjustNodePosition,s=o.allowRotate,u=o.allowResize,l=r.gridSize,c=r.transformModel.SCALE_X,p=n.isHitable,d=n.draggable,h=n.transform,f=n.getOuterGAttributes(),y=f.className,v=void 0===y?"":y,g=uw(f,["className"]),m=_o("g",{className:"lf-node-content",children:[_o("g",{transform:h,children:[this.getShape(),this.getText(),s&&this.getRotateControl(),u&&this.getResizeControl()]}),!i&&this.getAnchors()]});return p?(a&&d&&this.stepDrag.setStep(l*c),t=_o("g",sw({className:"".concat(this.getStateClassName()," ").concat(v),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onClick:this.handleClick,onMouseEnter:this.setHoverON,onMouseOver:this.setHoverON,onMouseLeave:this.setHoverOFF,onMouseOut:this.onMouseOut,onContextMenu:this.handleContextMenu},g,{children:m}))):t=_o("g",sw({className:"".concat(this.getStateClassName()," ").concat(v)},g,{children:m})),t},e.isObserved=!1,e}(lr),pw=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),dw=function(){return dw=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},dw.apply(this,arguments)},hw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return pw(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.getNodeStyle();return _o(Yx,dw({},e,{x:t.x,y:t.y,width:t.width,height:t.height,radius:t.radius}))},e}(cw),fw=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yw=function(){return yw=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},yw.apply(this,arguments)},vw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return fw(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,r=t.r,o=t.getNodeStyle();return _o($x,yw({},o,{x:e,y:n,r:r}))},e}(cw),gw=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),mw=function(){return mw=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},mw.apply(this,arguments)},_w=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return gw(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t,n=e.x,r=e.y,o=e.width,i=e.height,a=e.points,s=t.getNodeStyle(),u={transform:"matrix(1 0 0 1 ".concat(n-o/2," ").concat(r-i/2,")")};return _o("g",mw({},u,{children:_o(oE,mw({},s,{points:a,x:n,y:r}))}))},e}(cw),bw=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xw=function(){return xw=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},xw.apply(this,arguments)},Ew=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return bw(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.getNodeStyle();return _o("g",{children:_o(oE,xw({},e,{points:t.points,x:t.x,y:t.y}))})},e}(cw),ww=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ow=function(){return Ow=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Ow.apply(this,arguments)},Mw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ww(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t.getNodeStyle();return _o(eE,Ow({},e,{x:t.x,y:t.y,rx:t.rx,ry:t.ry}))},e}(cw),Sw=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Aw=function(){return Aw=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Aw.apply(this,arguments)},Pw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Sw(e,t),e.prototype.getBackground=function(){var t=this.props.model,e=t.getTextStyle(),n=t.width,r=t.height,o=t.x,i=t.y,a=Aw(Aw({},e.background),{x:o,y:i-1,width:n,height:r});return _o(Yx,Aw({},a))},e.prototype.getResizeControl=function(){return null},e.prototype.getShape=function(){return _o("g",{children:this.getBackground()})},e}(cw),Nw=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tw=function(){return Tw=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Tw.apply(this,arguments)},Dw=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},jw=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},Cw=function(t){function e(){var e=t.apply(this,jw([],Dw(arguments),!1))||this;return e.ref={current:null},e}return Nw(e,t),Object.defineProperty(e.prototype,"rootEl",{get:function(){return this.ref.current},enumerable:!1,configurable:!0}),e.prototype.setHtml=function(t){t.appendChild(document.createElement("div"))},e.prototype.confirmUpdate=function(t){this.setHtml(t)},e.prototype.shouldUpdate=function(){return(!this.preProperties||this.preProperties!==this.currentProperties)&&(this.preProperties=this.currentProperties,!0)},e.prototype.componentDidMount=function(){console.log("HtmlNode ---\x3e>> componentDidMount - 初始化内容"),this.shouldUpdate()&&this.rootEl&&this.setHtml(this.rootEl)},e.prototype.componentDidUpdate=function(){console.log("HtmlNode ---\x3e>> componentDidUpdate - 更新节点内容"),this.shouldUpdate()&&this.rootEl&&this.confirmUpdate(this.rootEl)},e.prototype.componentWillUnmount=function(){this.rootEl.innerHTML=""},e.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,r=t.height,o=t.width,i=t.getNodeStyle();return this.currentProperties=JSON.stringify(t.properties),_o("foreignObject",Tw({},i,{x:e-o/2,y:n-r/2,width:o,height:r,ref:this.ref}))},e}(cw),Iw=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),kw=function(){return kw=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},kw.apply(this,arguments)},Rw=function(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 o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n},Lw=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};!function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"}(rw||(rw={}));var Bw=function(t){function e(e){var n=t.call(this)||this;n.handleMouseDown=function(t){n.stepDrag&&n.stepDrag.handleMouseDown(t)},n.onDragStart=function(){var t=n.props,e=t.x,r=t.y,o=t.edgeModel,i=o.startPoint,a=o.endPoint,s=o.pointsList;n.oldEdge={startPoint:i,endPoint:a,pointsList:s},n.setState({endX:e,endY:r,dragging:!0})},n.onDragging=function(t){var e=t.deltaX,r=t.deltaY,o=n.state,i=o.endX,a=o.endY,s=n.props,u=s.graphModel,l=s.type,c=u.transformModel,p=u.editConfigModel,d=Lw(c.moveCanvasPointByHtml([i,a],e,r),2),h=d[0],f=d[1];n.setState({endX:h,endY:f,dragging:!0});var y=n.props.edgeModel,v=E_({x:i,y:a},u);if(v&&v.node&&n.isAllowAdjust(v).pass){var g=void 0,m=y.startPoint,_=y.endPoint,b=y.sourceNode,x=y.targetNode;l===rw.SOURCE?g={startPoint:{x:v.anchor.x,y:v.anchor.y},endPoint:{x:_.x,y:_.y},sourceNode:v.node,targetNode:x}:l===rw.TARGET&&(g={startPoint:{x:m.x,y:m.y},endPoint:{x:v.anchor.x,y:v.anchor.y},sourceNode:b,targetNode:v.node}),y.updateAfterAdjustStartAndEnd(g)}else l===rw.SOURCE?y.updateStartPoint({x:h,y:f}):l===rw.TARGET&&y.updateEndPoint({x:h,y:f});y.text.value&&p.adjustEdge&&y.setText(Object.assign({},y.text,y.textPosition))},n.onDragEnd=function(t){var e,r,o,i=t.event;try{n.setState({dragging:!1});var a=n.props,s=a.graphModel,u=a.edgeModel,l=a.type,c=n.state,p=c.endX,d=c.endY,h=c.dragging,f=E_({x:p,y:d},s);if(!h)return;var y=!1,v=void 0;if(f&&f.node){var g=n.isAllowAdjust(f),m=g.pass,_=g.msg,b=g.newTargetNode;if(m){var x=u.getData(),E=x.text,w=x.sourceAnchorId,O=void 0===w?"":w,M=x.targetAnchorId,S=void 0===M?"":M,A=Rw(x,["text","sourceAnchorId","targetAnchorId"]);if(v=kw(kw({sourceAnchorId:O,targetAnchorId:S},A),{text:(null==E?void 0:E.value)||""}),l===rw.SOURCE){var P=s.getNodeModelById(f.node.id),N=s.getNodeModelById(u.targetNodeId),T=null===(e=s.edgeGenerator)||void 0===e?void 0:e.call(s,null==P?void 0:P.getData(),null==N?void 0:N.getData(),v);v=kw(kw({},T),{sourceNodeId:f.node.id,sourceAnchorId:f.anchor.id,startPoint:{x:f.anchor.x,y:f.anchor.y},targetNodeId:u.targetNodeId,endPoint:kw({},u.endPoint)}),u.sourceNodeId===f.node.id&&u.sourceAnchorId===f.anchor.id&&(y=!0)}else if(l===rw.TARGET){P=s.getNodeModelById(u.sourceNodeId),N=s.getNodeModelById(f.node.id),T=null===(r=s.edgeGenerator)||void 0===r?void 0:r.call(s,null==P?void 0:P.getData(),null==N?void 0:N.getData(),v);v=kw(kw({},T),{sourceNodeId:u.sourceNodeId,startPoint:kw({},u.startPoint),targetNodeId:f.node.id,targetAnchorId:f.anchor.id,endPoint:{x:f.anchor.x,y:f.anchor.y}}),u.targetNodeId===f.node.id&&u.targetAnchorId===f.anchor.id&&(y=!0)}}else{y=!0;var D=b.getData();s.eventCenter.emit(lm.CONNECTION_NOT_ALLOWED,{data:D,msg:_})}}else y=!0;if(y)n.recoveryEdge();else{var j=u.getData();s.deleteEdgeById(u.id);var C=s.addEdge(kw({},v));s.eventCenter.emit(lm.EDGE_EXCHANGE_NODE,{data:{newEdge:C.getData(),oldEdge:j}})}null===(o=n.preTargetNode)||void 0===o||o.setElementState(am.DEFAULT)}finally{(s=n.props.graphModel).eventCenter.emit(lm.ADJUST_POINT_DRAGEND,{e:i,data:n.stepDragData})}},n.recoveryEdge=function(){var t=n.props.edgeModel,e=n.oldEdge,r=e.startPoint,o=e.endPoint,i=e.pointsList;t.updateStartPoint(r),t.updateEndPoint(o),t.modelType!==um.LINE_EDGE&&(t.pointsList=null!=i?i:[],t.initPoints())},n.getAdjustPointStyle=function(){return n.props.graphModel.theme.edgeAdjust},n.state={dragging:!1,endX:0,endY:0},n.targetRuleResults=new Map,n.sourceRuleResults=new Map;var r=e.type,o=e.edgeModel,i=e.graphModel.eventCenter;return n.stepDragData={type:r,edgeData:o.getData()},n.stepDrag=new bm({onDragStart:n.onDragStart,onDragging:n.onDragging,onDragEnd:n.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:i,data:n.stepDragData}),n}return Iw(e,t),e.prototype.isAllowAdjust=function(t){var e,n,r,o,i=this.props,a=i.edgeModel,s=a.id,u=a.sourceNode,l=a.targetNode,c=a.sourceAnchorId,p=a.targetAnchorId,d=i.type;if(d===rw.SOURCE?(e=t.node,n=l,r=t.anchor,o=l.getAnchorInfo(p)):(e=u,n=t.node,o=t.anchor,r=u.getAnchorInfo(c)),this.preTargetNode&&this.preTargetNode!==t.node&&this.preTargetNode.setElementState(am.DEFAULT),this.preTargetNode=t.node,o.id===r.id)return{pass:!1,msg:"",newTargetNode:n};var h="".concat(e.id,"_").concat(n.id,"_").concat(r.id,"_").concat(o.id);if(!this.targetRuleResults.has(h)){var f=e.isAllowConnectedAsSource(n,r,o,s),y=n.isAllowConnectedAsTarget(e,r,o,s);this.sourceRuleResults.set(h,R_(f)),this.targetRuleResults.set(h,R_(y))}var v=this.sourceRuleResults.get(h),g=v.isAllPass,m=v.msg,_=this.targetRuleResults.get(h),b=_.isAllPass,x=_.msg,E=g&&b?am.ALLOW_CONNECT:am.NOT_ALLOW_CONNECT;return d===rw.SOURCE?e.setElementState(E):n.setElementState(E),{pass:g&&b,msg:x||m,newTargetNode:n}},e.prototype.render=function(){var t=this.props,e=t.x,n=t.y,r=t.getAdjustPointShape,o=t.edgeModel,i=this.state.dragging;return _o("g",{pointerEvents:i?"none":"",onMouseDown:this.handleMouseDown,children:i?"":r(e,n,o)})},e}(lr),zw=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Hw=function(){return Hw=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Hw.apply(this,arguments)};!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}zw(e,t),e.prototype.getArrowAttributes=function(){var t=this.props,e=t.arrowInfo,n=t.style,r=e.start,o=e.end,i={start:r,end:o,offset:n.offset,verticalLength:n.verticalLength,type:"end"},a=xm(i),s=a.leftX,u=a.leftY,l=a.rightX,c=a.rightY;return Hw({d:"M".concat(s," ").concat(u," L").concat(o.x," ").concat(o.y," L").concat(l," ").concat(c," z")},n)},e.prototype.getShape=function(){var t=this.getArrowAttributes(),e=t.d,n=t.strokeWidth,r=t.stroke;return _o(qx,{d:e,fill:t.fill,strokeWidth:n,stroke:r})},e.prototype.render=function(){return _o("g",{className:"lf-arrow",children:this.getShape()})}}(lr);var Xw=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gw=function(){return Gw=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Gw.apply(this,arguments)},Ww=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Fw=function(t){function e(){var e=t.call(this)||this;return e.textRef={current:null},e.handleHover=function(t,n){var r=e.props,o=r.model,i=r.graphModel.eventCenter;o.setHovered(t);var a=t?lm.EDGE_MOUSEENTER:lm.EDGE_MOUSELEAVE,s=o.getData();i.emit(a,{data:s,e:n})},e.setHoverON=function(t){e.props.model.isHovered||(e.textRef&&e.textRef.current&&e.textRef.current.setHoverON(),e.handleHover(!0,t))},e.setHoverOFF=function(t){e.props.model.isHovered&&(e.textRef&&e.textRef.current&&e.textRef.current.setHoverOFF(),e.handleHover(!1,t))},e.handleContextMenu=function(t){t.preventDefault(),e.contextMenuTime=(new Date).getTime(),e.clickTimer&&clearTimeout(e.clickTimer);var n=e.props,r=n.model,o=n.graphModel,i=o.getPointByClient({x:t.clientX,y:t.clientY});o.setElementStateById(r.id,am.SHOW_MENU,i.domOverlayPosition),e.toFront(),r.isSelected||o.selectEdgeById(r.id);var a=null==r?void 0:r.getData();o.eventCenter.emit(lm.EDGE_CONTEXTMENU,{data:a,e:t,position:i})},e.handleMouseDown=function(t){t.stopPropagation(),e.startTime=(new Date).getTime()},e.handleMouseUp=function(t){if(e.startTime&&!((new Date).getTime()-e.startTime>200||2===t.button)){var n=2===t.detail,r=e.props,o=r.model,i=r.graphModel,a=null==o?void 0:o.getData(),s=i.getPointByClient({x:t.clientX,y:t.clientY});if(n){var u=i.editConfigModel,l=i.textEditElement;if(l&&l.id===o.id&&i.setElementStateById(o.id,am.DEFAULT),u.edgeTextEdit&&o.text.editable&&i.setElementStateById(o.id,am.TEXT_EDIT),o.modelType===um.POLYLINE_EDGE){var c=o,p=i.getPointByClient({x:t.x,y:t.y}).canvasOverlayPosition,d=p.x,h=p.y,f=t_({x:d,y:h},c.points);c.dbClickPosition=f}i.eventCenter.emit(lm.EDGE_DBCLICK,{data:a,e:t,position:s})}else i.eventCenter.emit(lm.ELEMENT_CLICK,{data:a,e:t,position:s}),i.eventCenter.emit(lm.EDGE_CLICK,{data:a,e:t,position:s});var y=i.editConfigModel;i.selectEdgeById(o.id,s_(t,y)),e.toFront()}},e}return Xw(e,t),e.prototype.getShape=function(){return _o("g",{children:this.getEdge()})},e.prototype.getTextStyle=function(){},e.prototype.getText=function(){var t=this.props,e=t.model,n=t.graphModel;if(e.state===am.TEXT_EDIT)return null;var r=!1,o=n.editConfigModel;return(e.text.draggable||o.edgeTextDraggable)&&(r=!0),_o(QE,{ref:this.textRef,editable:o.edgeTextEdit&&e.text.editable,model:e,graphModel:n,draggable:r})},e.prototype.getArrowInfo=function(){var t=this.props.model,e=t.startPoint,n=t.endPoint,r=t.isSelected;return{start:e,end:n,hover:this.state.hover,isSelected:r}},e.prototype.getLastTwoPoints=function(){var t=this.props.model;return[t.startPoint,t.endPoint]},e.prototype.getArrowStyle=function(){return console.error("getArrowStyle is deprecated in 1.2.0, please use model.getArrowStyle"),null},e.prototype.getArrow=function(){var t=this.props.model,e=t.id,n=t.getArrowStyle(),r=n.refY,o=void 0===r?0:r,i=n.refX,a=void 0===i?2:i,s=Ww(this.getLastTwoPoints(),2),u=s[0],l=s[1],c="auto";return null!==u&&null!==l&&(c=lb({x:l.x-u.x,y:l.y-u.y,z:0})*(180/Math.PI)),_o("g",{children:_o("defs",{children:[_o("marker",{id:"marker-start-".concat(e),refX:-a,refY:o,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse",children:this.getStartArrow()}),_o("marker",{id:"marker-end-".concat(e),refX:a,refY:o,overflow:"visible",orient:c,markerUnits:"userSpaceOnUse",children:this.getEndArrow()})]})})},e.prototype.getStartArrow=function(){return _o("path",{})},e.prototype.getEndArrow=function(){var t=this.props.model.getArrowStyle(),e=t.stroke,n=t.strokeWidth,r=t.offset,o=t.verticalLength;return _o("path",{stroke:e,fill:e,strokeWidth:n,transform:"rotate(180)",d:"M 0 0 L ".concat(r," -").concat(o," L ").concat(r," ").concat(o," Z")})},e.prototype.getAdjustPointShape=function(t,e,n){var r=n.getAdjustPointStyle();return _o($x,Gw({className:"lf-edge-adjust-point"},r,{x:t,y:e}))},e.prototype.getAdjustPoints=function(){var t=this.props,e=t.model,n=t.graphModel,r=e.getAdjustStart(),o=e.getAdjustEnd();return _o("g",{children:[_o(Bw,Gw({type:rw.SOURCE},r,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:e,graphModel:n})),_o(Bw,Gw({type:rw.TARGET},o,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:e,graphModel:n}))]})},e.prototype.getAnimation=function(){console.error("getAnimation is deprecated in 1.2.0, please use model.getEdgeAnimationStyle")},e.prototype.getAppendWidth=function(){return _o("g",{})},e.prototype.getAppend=function(){return _o("g",{className:"lf-edge-append",children:this.getAppendWidth()})},e.prototype.getEdge=function(){return null},e.prototype.toFront=function(){var t=this.props,e=t.graphModel,n=t.model;e.toFront(n.id)},e.prototype.render=function(){var t=this.props.model,e=t.isSelected,n=t.isHitable,r=t.isShowAdjustPoint;return _o("g",{children:[_o("g",{className:["lf-edge",!n&&"pointer-none",e&&"lf-edge-selected"].filter(Boolean).join(" "),onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onContextMenu:this.handleContextMenu,onMouseOver:this.setHoverON,onMouseEnter:this.setHoverON,onMouseLeave:this.setHoverOFF,children:[this.getShape(),this.getAppend(),this.getText(),this.getArrow()]}),r&&e?this.getAdjustPoints():""]})},e.isObserved=!1,e}(lr),Uw=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yw=function(){return Yw=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Yw.apply(this,arguments)},Vw=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},Kw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Uw(e,t),e.prototype.getEdge=function(){var t=this.props.model,e=t.getEdgeStyle(),n=t,r=n.path,o=n.isAnimation,i=n.arrowConfig,a=t.getEdgeAnimationStyle(),s=a.strokeDasharray,u=a.stroke,l=a.strokeDashoffset,c=a.animationName,p=a.animationDuration,d=a.animationIterationCount,h=a.animationTimingFunction,f=a.animationDirection;return _o(qx,Yw({d:r},e,i,o?{strokeDasharray:s,stroke:u,style:{strokeDashoffset:l,animationName:c,animationDuration:p,animationIterationCount:d,animationTimingFunction:h,animationDirection:f}}:{}))},e.prototype.getAppendWidth=function(){return _o(qx,{d:this.props.model.path,strokeWidth:10,stroke:"transparent",fill:"none"})},e.prototype.getArrowInfo=function(){var t=this.props.model,e=this.state.hover,n=t.isSelected,r=t.getArrowStyle().offset,o=t.pointsList.map((function(t){return{x:t.x,y:t.y}})),i=Vw(Qm(o,r),2);return{start:i[0],end:i[1],hover:e,isSelected:n}},e.prototype.getLastTwoPoints=function(){var t=this.props.model,e=t.getArrowStyle().offset,n=t.pointsList.map((function(t){return{x:t.x,y:t.y}}));return Qm(n,e)},e}(Fw),qw=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zw=function(){return Zw=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Zw.apply(this,arguments)},Jw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return qw(e,t),e.prototype.getEdge=function(){var t=this.props.model,e=t.startPoint,n=t.endPoint,r=t.isAnimation,o=t.arrowConfig,i=t.getEdgeStyle(),a=t.getEdgeAnimationStyle(),s=a.strokeDasharray,u=a.stroke,l=a.strokeDashoffset,c=a.animationName,p=a.animationDuration,d=a.animationIterationCount,h=a.animationTimingFunction,f=a.animationDirection;return _o(Wx,Zw({},i,{x1:e.x,y1:e.y,x2:n.x,y2:n.y},o,r?{strokeDasharray:s,stroke:u,style:{strokeDashoffset:l,animationName:c,animationDuration:p,animationIterationCount:d,animationTimingFunction:h,animationDirection:f}}:{}))},e.prototype.getAppendWidth=function(){var t=this.props.model,e=function(t){var e,n=t.start,r=t.end;if(n.x===r.x&&n.y===r.y)e="";else{var o={start:n,end:r,offset:10,verticalLength:5},i=xm(wm(wm({},o),{type:"start"})),a=xm(wm(wm({},o),{type:"end"}));e="M".concat(i.leftX," ").concat(i.leftY,"\n L").concat(i.rightX," ").concat(i.rightY,"\n L").concat(a.rightX," ").concat(a.rightY,"\n L").concat(a.leftX," ").concat(a.leftY," z")}return{d:e,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}}({start:t.startPoint,end:t.endPoint}),n=e.d,r=e.strokeWidth,o=e.fill,i=e.strokeDasharray;return _o(qx,{d:n,fill:o,strokeWidth:r,stroke:e.stroke,strokeDasharray:i})},e}(Fw),$w=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qw=function(){return Qw=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},Qw.apply(this,arguments)},tO=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},eO=function(t){function e(){var e=t.call(this)||this;return e.onDragStart=function(){var t=e.props.model;t.dragAppendStart(),e.isShowAdjustPointTemp=t.isShowAdjustPoint,t.isShowAdjustPoint=!1},e.onDragging=function(t){var n=t.deltaX,r=t.deltaY,o=e.props,i=o.model,a=o.graphModel;e.isDragging=!0;var s=a.transformModel,u=a.editConfigModel,l=tO(s.fixDeltaXY(n,r),2),c=l[0],p=l[1],d=i,h=u.adjustEdgeMiddle;e.appendInfo=h?d.dragAppendSimple(e.appendInfo,{x:c,y:p}):d.dragAppend(e.appendInfo,{x:c,y:p})},e.onDragEnd=function(){var t,n=e.props,r=n.model,o=n.graphModel.eventCenter,i=r;i.dragAppendEnd(),e.isDragging=!1,i.isShowAdjustPoint=null!==(t=e.isShowAdjustPointTemp)&&void 0!==t&&t,e.appendInfo=void 0,o.emit(lm.EDGE_ADJUST,{data:i.getData()})},e.beforeDragStart=function(t,n){n.draggable&&e.drag.handleMouseDown(t),e.appendInfo=n},e.drag=new bm({onDragStart:e.onDragStart,onDragging:e.onDragging,onDragEnd:e.onDragEnd,isStopPropagation:!1}),e}return $w(e,t),e.prototype.getEdge=function(){var t=this.props.model,e=t.points,n=t.isAnimation,r=t.arrowConfig,o=t.getEdgeStyle(),i=t.getEdgeAnimationStyle(),a=i.strokeDasharray,s=i.stroke,u=i.strokeDashoffset,l=i.animationName,c=i.animationDuration,p=i.animationIterationCount,d=i.animationTimingFunction,h=i.animationDirection;return _o(sE,Qw({points:e},o,r,n?{strokeDasharray:a,stroke:s,style:{strokeDashoffset:u,animationName:l,animationDuration:c,animationIterationCount:p,animationTimingFunction:d,animationDirection:h}}:{}))},e.prototype.getArrowInfo=function(){var t=this.props.model,e=t.points,n=t.isSelected,r=this.state.hover,o=Ym(e),i=o[0],a=o[0];return o.length>=2&&(i=o[o.length-2],a=o[o.length-1]),{start:i,end:a,hover:r,isSelected:n}},e.prototype.getLastTwoPoints=function(){var t=this.props.model.points,e=Ym(t),n=e[0],r=e[0];return e.length>=2&&(n=e[e.length-2],r=e[e.length-1]),[n,r]},e.prototype.getAppendAttributes=function(t){var e,n=t.start,r=t.end;if(n.x===r.x&&n.y===r.y)e="";else{var o={start:n,end:r,offset:10,verticalLength:5},i=xm(Qw(Qw({},o),{type:"start"})),a=xm(Qw(Qw({},o),{type:"end"}));e="M".concat(i.leftX," ").concat(i.leftY,"\n L").concat(i.rightX," ").concat(i.rightY,"\n L").concat(a.rightX," ").concat(a.rightY,"\n L").concat(a.leftX," ").concat(a.leftY," z")}return{d:e,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},e.prototype.getAppendShape=function(t){var e=this.getAppendAttributes(t),n=e.d,r=e.strokeWidth,o=e.fill,i=e.strokeDasharray;return _o(qx,{d:n,fill:o,strokeWidth:r,stroke:e.stroke,strokeDasharray:i})},e.prototype.getAppendWidth=function(){for(var t=this,e=this.props,n=e.model,r=e.graphModel,o=n.pointsList,i=n.draggable,a=[],s=o.length,u=function(e){var n="lf-polyline-append",u={start:{x:o[e].x,y:o[e].y},end:{x:o[e+1].x,y:o[e+1].y},startIndex:e,endIndex:e+1,direction:pm.HORIZONTAL,draggable:!0},c=_o("g",{className:n,children:l.getAppendShape(u)}),p=r.editConfigModel,d=p.adjustEdge,h=p.adjustEdgeMiddle;if(d&&i){var f=u.startIndex,y=u.endIndex,v=h&&(0===f||y===s-1);u.draggable=!v,u.start.x===u.end.x?(u.draggable&&(n+="-ew-resize"),u.direction=pm.VERTICAL):u.start.y===u.end.y&&(u.draggable&&(n+="-ns-resize"),u.direction=pm.HORIZONTAL),c=_o("g",{className:l.isDragging?"lf-dragging":"lf-drag-able",onMouseDown:function(e){return t.beforeDragStart(e,u)},children:_o("g",{className:n,children:l.getAppendShape(u)})})}a.push(c)},l=this,c=0;c<s-1;c++)u(c);return _o("g",{children:a})},e}(Fw),nO=function(){return nO=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},nO.apply(this,arguments)},rO=function(){function t(t){var e=this;this.nodeConfig=null,this.fakeNode=null,this.stopDrag=function(){e.nodeConfig=null,window.document.removeEventListener("mouseup",e.stopDrag)},this.dragEnter=function(t){e.nodeConfig&&!e.fakeNode&&(e.fakeNode=e.lf.createFakeNode(nO(nO({},e.nodeConfig),e.clientToLocalPoint({x:t.clientX,y:t.clientY}))))},this.onDragOver=function(t){if(t.preventDefault(),e.fakeNode){var n=e.clientToLocalPoint({x:t.clientX,y:t.clientY}),r=n.x,o=n.y;e.fakeNode.moveTo(r,o);var i=e.fakeNode.getData();e.lf.setNodeSnapLine(i),e.lf.graphModel.eventCenter.emit(lm.NODE_DND_DRAG,{data:i})}return!1},this.onDragLeave=function(){e.fakeNode&&(e.lf.removeNodeSnapLine(),e.lf.graphModel.removeFakeNode(),e.fakeNode=null)},this.onDrop=function(t){e.lf.graphModel&&t&&e.nodeConfig&&(e.lf.addNode(nO(nO({},e.nodeConfig),e.clientToLocalPoint({x:t.clientX,y:t.clientY})),lm.NODE_DND_ADD,t),t.preventDefault(),t.stopPropagation(),e.nodeConfig=null,e.lf.removeNodeSnapLine(),e.lf.graphModel.removeFakeNode(),e.fakeNode=null)};var n=t.lf;this.lf=n}return t.prototype.clientToLocalPoint=function(t){var e=t.x,n=t.y,r=bu(this.lf.options,["grid","size"]),o=this.lf.graphModel.getPointByClient({x:e,y:n}).canvasOverlayPosition,i=o.x,a=o.y;return{x:o_(i,r),y:o_(a,r)}},t.prototype.startDrag=function(t){var e=this.lf.graphModel.editConfigModel;(null==e?void 0:e.isSilentMode)||(this.nodeConfig=t,window.document.addEventListener("mouseup",this.stopDrag))},t.prototype.eventMap=function(){return{onMouseEnter:this.dragEnter,onMouseOver:this.dragEnter,onMouseMove:this.onDragOver,onMouseLeave:this.onDragLeave,onMouseUp:this.onDrop}},t}(),oO=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),iO=function(){return iO=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},iO.apply(this,arguments)},aO=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},sO=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},uO=function(t){function e(e){var n=t.call(this,e)||this;return n.ref={current:null},n.__prevText={type:"",text:"",id:""},n.keyupHandler=function(t){var e=n.props.graphModel.textEditElement;"Enter"===t.key&&t.altKey&&(null==e||e.setElementState(am.DEFAULT))},n.inputHandler=function(t){var e=t.target.innerText,r=n.props.graphModel.textEditElement;r&&(n.__prevText={type:r.type,text:e.replace(/(\r\n)+$|(\n)+$/,""),id:r.id})},n.keydownHandler=function(t){t.stopPropagation()},n.state={style:{left:0,top:0}},n}return oO(e,t),e.getDerivedStateFromProps=function(t){var e,n,r=t.textEditElement,o=t.graphModel,i=o.transformModel,a=o.theme,s=a.inputText;if(r){if(!(null===(e=r.text)||void 0===e?void 0:e.value)&&r.BaseType===sm.EDGE){var u=r.text,l=r.textPosition,c=l.x,p=l.y;u.x=c,u.y=p,r.setText(u)}var d={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(r.BaseType===sm.EDGE){var h=a.edgeText,f=h.overflowMode,y=h.lineHeight,v=h.wrapPadding;(m=h.textWidth)&&"autoWrap"===f&&(n=iO(iO({},d),{width:m,minWidth:m,lineHeight:y,padding:v}))}else if(r.BaseType===sm.NODE){var g=a.nodeText,m=(f=g.overflowMode,y=g.lineHeight,v=g.wrapPadding,g.textWidth),_=r.width,b=r.modelType,x=r.textWidth||m||_;(b!==um.TEXT_NODE&&"autoWrap"===f||b===um.TEXT_NODE&&m)&&(n=iO(iO({},d),{width:x,minWidth:x,lineHeight:y,padding:v}))}var E=r.text,w=E.x,O=E.y,M=sO(i.CanvasPointToHtmlPoint([w,O]),2),S=M[0],A=M[1];return{style:iO(iO({left:S,top:A},n),s)}}return null},e.prototype.componentDidUpdate=function(){var t=this.props.graphModel;if(this.ref.current&&(this.ref.current.focus(),this.placeCaretAtEnd(this.ref.current)),""!==this.__prevText.id){var e=this.__prevText,n=e.text,r=e.id;t.updateText(r,n),t.eventCenter.emit(lm.TEXT_UPDATE,{data:iO({},this.__prevText)}),this.__prevText.id="",this.__prevText.text="",this.__prevText.type=""}},e.prototype.placeCaretAtEnd=function(t){if(void 0!==window.getSelection&&void 0!==document.createRange){var e=document.createRange();e.selectNodeContents(t),e.collapse(!1);var n=window.getSelection();null==n||n.removeAllRanges(),null==n||n.addRange(e)}},e.prototype.render=function(){var t,e=this.props.graphModel.textEditElement,n=this.state.style;return e?_o("div",{contentEditable:!0,className:"lf-text-input",style:n,ref:this.ref,onKeyUp:this.keyupHandler,onKeyDown:this.keydownHandler,onKeyPress:this.keydownHandler,onInput:this.inputHandler,children:null===(t=e.text)||void 0===t?void 0:t.value},e.id):null},e.toolName="textEdit",e=aO([KO],e)}(lr),lO=function(t){return t.modelType===um.LINE_EDGE?function(t){var e=t.startPoint,n=t.endPoint,r=(e.x+n.x)/2,o=(e.y+n.y)/2,i=Math.abs(e.x-n.x)+10,a=Math.abs(e.y-n.y)+10;return{x:r-i/2,y:o-a/2,x1:r+i/2,y1:o+a/2}}(t):t.modelType===um.POLYLINE_EDGE?function(t){var e=t.points,n=Ym(e),r=Tm(n,8),o=r.x,i=r.y,a=r.width,s=r.height;return{x:o-a/2,y:i-s/2,x1:o+a/2,y1:i+s/2}}(t):t.modelType===um.BEZIER_EDGE?function(t){var e=t.path,n=Jm(e),r=Tm(n,8),o=r.x,i=r.y,a=r.width,s=r.height;return{x:o-a/2,y:i-s/2,x1:o+a/2,y1:i+s/2}}(t):void 0},cO=function(){var t=function(e,n){return t=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])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),pO=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},dO=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},hO=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},fO=function(t){function e(e){var n=t.call(this,e)||this;n.handleMouseDown=function(t){n.stepDrag.handleMouseDown(t)},n.handleWheelEvent=function(t){var e,r;t.preventDefault();var o=t.deltaX,i=t.deltaY,a=t.clientX,s=t.clientY,u=t.ctrlKey,l=new WheelEvent("wheel",{deltaX:o,deltaY:i,clientX:a,clientY:s,ctrlKey:u});null===(r=null===(e=n.props.logicFlow.container)||void 0===e?void 0:e.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))||void 0===r||r.dispatchEvent(l)},n.onDragging=function(t){var e=t.deltaX,r=t.deltaY,o=n.props,i=o.graphModel,a=o.logicFlow.getTransform(),s=a.SCALE_X,u=a.SCALE_Y,l=i.getSelectElements(!0);i.moveNodes(l.nodes.map((function(t){return t.id})),e/s,r/u)},n.handleContextMenu=function(t){t.preventDefault();var e=n.props,r=e.graphModel,o=e.graphModel,i=o.eventCenter,a=o.selectElements,s=r.getPointByClient({x:t.clientX,y:t.clientY}),u={nodes:[],edges:[]};hO([],dO(a.values()),!1).forEach((function(t){t.BaseType===sm.NODE&&u.nodes.push(t.getData()),t.BaseType===sm.EDGE&&u.edges.push(t.getData())})),i.emit(lm.SELECTION_CONTEXTMENU,{data:u,e:t,position:s})};var r=e.graphModel,o=r.gridSize,i=r.eventCenter;return n.stepDrag=new bm({onDragging:n.onDragging,step:o,eventType:"SELECTION",eventCenter:i}),n}return cO(e,t),e.prototype.render=function(){var t,e,n=this.props.graphModel,r=n.selectElements,o=n.transformModel,i=this.props.logicFlow.getTransform(),a=i.SCALE_X,s=i.SCALE_Y;if(!(r.size<=1)){var u=Number.MAX_SAFE_INTEGER,l=Number.MAX_SAFE_INTEGER,c=Number.MIN_SAFE_INTEGER,p=Number.MIN_SAFE_INTEGER;return r.forEach((function(t){var e;t.BaseType===sm.NODE&&(e=function(t){var e=t.x,n=t.y,r=t.width,o=t.height;return{x:e-r/2,y:n-o/2,x1:e+r/2,y1:n+o/2}}(t)),t.BaseType===sm.EDGE&&(e=lO(t)),void 0!==e&&(u=Math.min(u,e.x),l=Math.min(l,e.y),c=Math.max(c,e.x1),p=Math.max(p,e.y1))})),t=dO(o.CanvasPointToHtmlPoint([u,l]),2),u=t[0],l=t[1],e=dO(o.CanvasPointToHtmlPoint([c,p]),2),c=e[0],p=e[1],_o("div",{className:"lf-multiple-select",style:{left:"".concat(u-20*a/2,"px"),top:"".concat(l-20*s/2,"px"),width:"".concat(c-u+20*a,"px"),height:"".concat(p-l+20*s,"px"),"border-width":"".concat(2*a,"px")},onMouseDown:this.handleMouseDown,onContextMenu:this.handleContextMenu,onWheel:this.handleWheelEvent})}},e.toolName="multipleSelect",e=pO([KO],e)}(lr),yO=function(){function t(t){this.toolMap=new Map,this.instance=t,this.isDisabledTool(uO.toolName)||this.registerTool(uO.toolName,uO),this.isDisabledTool(fO.toolName)||this.registerTool(fO.toolName,fO);var e=t.graphModel;e.eventCenter.on("".concat(lm.GRAPH_TRANSFORM,",").concat(lm.NODE_CLICK,",").concat(lm.BLANK_CLICK," "),(function(){var t,n=e.textEditElement,r=e.editConfigModel,o=r.edgeTextEdit,i=r.nodeTextEdit;(o||i)&&n&&(null===(t=e.textEditElement)||void 0===t||t.setElementState(am.DEFAULT))}))}return t.prototype.isDisabledTool=function(t){var e;return-1!==(null===(e=this.instance.options.disabledTools)||void 0===e?void 0:e.indexOf(t))},t.prototype.registerTool=function(t,e){this.toolMap.set(t,e)},t.prototype.getTools=function(){return Array.from(this.toolMap.values())},t.prototype.getInstance=function(){return this.instance},t}();var vO={},gO={get exports(){return vO},set exports(t){vO=t}};!function(t){!function(e,n,r){if(e){for(var o,i={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},a={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},s={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},u={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l=1;l<20;++l)i[111+l]="f"+l;for(l=0;l<=9;++l)i[l+96]=l.toString();v.prototype.bind=function(t,e,n){var r=this;return t=t instanceof Array?t:[t],r._bindMultiple.call(r,t,e,n),r},v.prototype.unbind=function(t,e){return this.bind.call(this,t,(function(){}),e)},v.prototype.trigger=function(t,e){var n=this;return n._directMap[t+":"+e]&&n._directMap[t+":"+e]({},t),n},v.prototype.reset=function(){var t=this;return t._callbacks={},t._directMap={},t},v.prototype.stopCallback=function(t,e){if((" "+e.className+" ").indexOf(" mousetrap ")>-1)return!1;if(y(e,this.target))return!1;if("composedPath"in t&&"function"==typeof t.composedPath){var n=t.composedPath()[0];n!==t.target&&(e=n)}return"INPUT"==e.tagName||"SELECT"==e.tagName||"TEXTAREA"==e.tagName||e.isContentEditable},v.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},v.addKeycodes=function(t){for(var e in t)t.hasOwnProperty(e)&&(i[e]=t[e]);o=null},v.init=function(){var t=v(n);for(var e in t)"_"!==e.charAt(0)&&(v[e]=function(e){return function(){return t[e].apply(t,arguments)}}(e))},v.init(),e.Mousetrap=v,t.exports&&(t.exports=v)}function c(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function p(t){if("keypress"==t.type){var e=String.fromCharCode(t.which);return t.shiftKey||(e=e.toLowerCase()),e}return i[t.which]?i[t.which]:a[t.which]?a[t.which]:String.fromCharCode(t.which).toLowerCase()}function d(t){return"shift"==t||"ctrl"==t||"alt"==t||"meta"==t}function h(t,e,n){return n||(n=function(){if(!o)for(var t in o={},i)t>95&&t<112||i.hasOwnProperty(t)&&(o[i[t]]=t);return o}()[t]?"keydown":"keypress"),"keypress"==n&&e.length&&(n="keydown"),n}function f(t,e){var n,r,o,i=[];for(n=function(t){return"+"===t?["+"]:(t=t.replace(/\+{2}/g,"+plus")).split("+")}(t),o=0;o<n.length;++o)r=n[o],u[r]&&(r=u[r]),e&&"keypress"!=e&&s[r]&&(r=s[r],i.push("shift")),d(r)&&i.push(r);return{key:r,modifiers:i,action:e=h(r,i,e)}}function y(t,e){return null!==t&&t!==n&&(t===e||y(t.parentNode,e))}function v(t){var e=this;if(t=t||n,!(e instanceof v))return new v(t);e.target=t,e._callbacks={},e._directMap={};var r,o={},i=!1,a=!1,s=!1;function u(t){t=t||{};var e,n=!1;for(e in o)t[e]?n=!0:o[e]=0;n||(s=!1)}function l(t,n,r,i,a,s){var u,l,c,p,h=[],f=r.type;if(!e._callbacks[t])return[];for("keyup"==f&&d(t)&&(n=[t]),u=0;u<e._callbacks[t].length;++u)if(l=e._callbacks[t][u],(i||!l.seq||o[l.seq]==l.level)&&f==l.action&&("keypress"==f&&!r.metaKey&&!r.ctrlKey||(c=n,p=l.modifiers,c.sort().join(",")===p.sort().join(",")))){var y=!i&&l.combo==a,v=i&&l.seq==i&&l.level==s;(y||v)&&e._callbacks[t].splice(u,1),h.push(l)}return h}function h(t,n,r,o){e.stopCallback(n,n.target||n.srcElement,r,o)||!1===t(n,r)&&(function(t){t.preventDefault?t.preventDefault():t.returnValue=!1}(n),function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}(n))}function y(t){"number"!=typeof t.which&&(t.which=t.keyCode);var n=p(t);n&&("keyup"!=t.type||i!==n?e.handleKey(n,function(t){var e=[];return t.shiftKey&&e.push("shift"),t.altKey&&e.push("alt"),t.ctrlKey&&e.push("ctrl"),t.metaKey&&e.push("meta"),e}(t),t):i=!1)}function g(t,e,n,a){function l(e){return function(){s=e,++o[t],clearTimeout(r),r=setTimeout(u,1e3)}}function c(e){h(n,e,t),"keyup"!==a&&(i=p(e)),setTimeout(u,10)}o[t]=0;for(var d=0;d<e.length;++d){var y=d+1===e.length?c:l(a||f(e[d+1]).action);m(e[d],y,a,t,d)}}function m(t,n,r,o,i){e._directMap[t+":"+r]=n;var a,s=(t=t.replace(/\s+/g," ")).split(" ");s.length>1?g(t,s,n,r):(a=f(t,r),e._callbacks[a.key]=e._callbacks[a.key]||[],l(a.key,a.modifiers,{type:a.action},o,t,i),e._callbacks[a.key][o?"unshift":"push"]({callback:n,modifiers:a.modifiers,action:a.action,seq:o,level:i,combo:t}))}e._handleKey=function(t,e,n){var r,o=l(t,e,n),i={},c=0,p=!1;for(r=0;r<o.length;++r)o[r].seq&&(c=Math.max(c,o[r].level));for(r=0;r<o.length;++r)if(o[r].seq){if(o[r].level!=c)continue;p=!0,i[o[r].seq]=1,h(o[r].callback,n,o[r].combo,o[r].seq)}else p||h(o[r].callback,n,o[r].combo);var f="keypress"==n.type&&a;n.type!=s||d(t)||f||u(i),a=p&&"keydown"==n.type},e._bindMultiple=function(t,e,n){for(var r=0;r<t.length;++r)m(t[r],e,n)},c(t,"keypress",y),c(t,"keydown",y),c(t,"keyup",y)}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null)}(gO);var mO=vO,_O=function(){function t(t){t.keyboard||(t.keyboard={enabled:!1}),this.options=t;var e=t.lf;this.target=e.container,this.mousetrap=new mO(this.target),t.keyboard.enabled&&!e.options.isSilentMode&&this.enable(!0)}return t.prototype.initShortcuts=function(){var t,e=this,n=(null!==(t=this.options.keyboard)&&void 0!==t?t:{}).shortcuts;if(n)if(zo(n))n.forEach((function(t){var n=t.keys,r=t.callback,o=t.action;return e.on(n,r,o)}));else{var r=n.keys,o=n.callback,i=n.action;this.on(r,o,i)}},t.prototype.on=function(t,e,n){this.mousetrap.bind(this.getKeys(t),e,n)},Object.defineProperty(t.prototype,"disabled",{get:function(){var t,e;return!0!==(null===(e=null===(t=this.options)||void 0===t?void 0:t.keyboard)||void 0===e?void 0:e.enabled)},enumerable:!1,configurable:!0}),t.prototype.off=function(t,e){this.mousetrap.unbind(this.getKeys(t),e)},t.prototype.enable=function(t){(this.disabled||t)&&(this.options.keyboard&&(this.options.keyboard.enabled=!0),this.target instanceof HTMLElement&&(this.target.setAttribute("tabindex","-1"),this.target.style.outline="none"))},t.prototype.disable=function(){this.disabled||(this.options.keyboard&&(this.options.keyboard.enabled=!1),this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))},t.prototype.getKeys=function(t){var e=this;return(Array.isArray(t)?t:[t]).map((function(t){return e.formatKey(t)}))},t.prototype.formatKey=function(t){return t.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command")},t}();function bO(t,e){void 0===e&&(e="Illegal state"),t||function(t){throw new Error("[mobx-utils] "+t)}(e)}var xO=function(t){return t&&t!==Object.prototype&&Object.getOwnPropertyNames(t).concat(xO(Object.getPrototypeOf(t))||[])},EO=function(t){return function(t){var e=xO(t);return e.filter((function(t,n){return e.indexOf(t)===n}))}(t).filter((function(t){return"constructor"!==t&&!~t.indexOf("__")}))},wO="pending",OO="fulfilled",MO="rejected";function SO(t){switch(this.state){case wO:return t.pending&&t.pending(this.value);case MO:return t.rejected&&t.rejected(this.value);case OO:return t.fulfilled?t.fulfilled(this.value):this.value}}function AO(t,e){if(bO(arguments.length<=2,"fromPromise expects up to two arguments"),bO("function"==typeof t||"object"==typeof t&&t&&"function"==typeof t.then,"Please pass a promise or function to fromPromise"),!0===t.isPromiseBasedObservable)return t;"function"==typeof t&&(t=new Promise(t));var n=t;t.then(me("observableFromPromise-resolve",(function(t){n.value=t,n.state=OO})),me("observableFromPromise-reject",(function(t){n.value=t,n.state=MO}))),n.isPromiseBasedObservable=!0,n.case=SO;var r=e&&e.state===OO?e.value:void 0;return Ne(n,{value:r,state:wO},{},{deep:!1}),n}!function(t){t.reject=me("fromPromise.reject",(function(e){var n=t(Promise.reject(e));return n.state=MO,n.value=e,n})),t.resolve=me("fromPromise.resolve",(function(e){void 0===e&&(e=void 0);var n=t(Promise.resolve(e));return n.state=OO,n.value=e,n}))}(AO||(AO={}));var PO=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a};!function(){function t(t,e){var n=this;_e((function(){n.current=e,n.subscription=t.subscribe(n)}))}t.prototype.dispose=function(){this.subscription&&this.subscription.unsubscribe()},t.prototype.next=function(t){this.current=t},t.prototype.complete=function(){this.dispose()},t.prototype.error=function(t){this.current=t,this.dispose()},PO([yt.ref],t.prototype,"current",void 0),PO([me.bound],t.prototype,"next",null),PO([me.bound],t.prototype,"complete",null),PO([me.bound],t.prototype,"error",null)}();var NO=function(){return NO=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},NO.apply(this,arguments)},TO=function(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a},DO=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];function jO(t){if(!t)return"ROOT";for(var e=[];t.parent;)e.push(t.path),t=t.parent;return e.reverse().join("/")}function CO(t){return Dn(t)||gn(t)||xn(t)}function IO(t,e){var n=new WeakMap;function r(r){var a=n.get(r.object);!function(t,e){switch(t.type){case"add":o(t.newValue,e,t.name);break;case"update":i(t.oldValue),o(t.newValue,e,t.name||""+t.index);break;case"remove":case"delete":i(t.oldValue);break;case"splice":t.removed.map(i),t.added.forEach((function(n,r){return o(n,e,""+(t.index+r))}));for(var r=t.index+t.addedCount;r<t.object.length;r++)if(CO(t.object[r])){var a=n.get(t.object[r]);a&&(a.path=""+r)}}}(r,a),e(r,jO(a),t)}function o(t,e,i){if(CO(t)){var a=n.get(t);if(a){if(a.parent!==e||a.path!==i)throw new Error("The same observable object cannot appear twice in the same tree, trying to assign it to '"+jO(e)+"/"+i+"', but it already exists at '"+jO(a.parent)+"/"+a.path+"'")}else{var s={parent:e,path:i,dispose:Ke(t,r)};n.set(t,s),Ue(t).forEach((function(t){var e=t[0];return o(t[1],s,e)}))}}}function i(t){if(CO(t)){var e=n.get(t);if(!e)return;n.delete(t),e.dispose(),Fe(t).forEach(i)}}return o(t,void 0,""),function(){i(t)}}!function(){function t(t){var e=this;this.model=t,this.localValues=yt.map({}),this.localComputedValues=yt.map({}),this.isPropertyDirty=function(t){return e.localValues.has(t)},bO(Dn(t),"createViewModel expects an observable object"),EO(t).forEach((function(n){if(n!==G&&"__mobxDidRunLazyInitializers"!==n){if(bO(-1===DO.indexOf(n),"The propertyname "+n+" is reserved and cannot be used with viewModels"),He(t,n)){var r=Cn(t,n).derivation;e.localComputedValues.set(n,xt(r.bind(e)))}var o=Object.getOwnPropertyDescriptor(t,n),i=o?{enumerable:o.enumerable}:{};Object.defineProperty(e,n,NO(NO({},i),{configurable:!0,get:function(){return He(t,n)?e.localComputedValues.get(n).get():e.isPropertyDirty(n)?e.localValues.get(n):e.model[n]},set:me((function(t){t!==e.model[n]?e.localValues.set(n,t):e.localValues.delete(n)}))}))}}))}Object.defineProperty(t.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"changedValues",{get:function(){return this.localValues.toJS()},enumerable:!1,configurable:!0}),t.prototype.submit=function(){var t=this;We(this.localValues).forEach((function(e){var n=t.localValues.get(e),r=t.model[e];gn(r)?r.replace(n):xn(r)?(r.clear(),r.merge(n)):ze(n)||(t.model[e]=n)})),this.localValues.clear()},t.prototype.reset=function(){this.localValues.clear()},t.prototype.resetProperty=function(t){this.localValues.delete(t)},TO([xt],t.prototype,"isDirty",null),TO([xt],t.prototype,"changedValues",null),TO([me.bound],t.prototype,"submit",null),TO([me.bound],t.prototype,"reset",null),TO([me.bound],t.prototype,"resetProperty",null)}();var kO=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(t){function e(e,n,r){var o=void 0===r?{}:r,i=o.name,a=void 0===i?"ogm"+(1e3*Math.random()|0):i,s=o.keyToName,u=void 0===s?function(t){return""+t}:s,l=t.call(this)||this;l._keyToName=u,l._groupBy=n,l._ogmInfoKey=Symbol("ogmInfo"+a),l._base=e;for(var c=0;c<e.length;c++)l._addItem(e[c]);return l._disposeBaseObserver=Ke(l._base,(function(t){if("splice"===t.type)tn((function(){for(var e=0,n=t.removed;e<n.length;e++){var r=n[e];l._removeItem(r)}for(var o=0,i=t.added;o<i.length;o++){var a=i[o];l._addItem(a)}}));else{if("update"!==t.type)throw new Error("illegal state");tn((function(){l._removeItem(t.oldValue),l._addItem(t.newValue)}))}})),l}kO(e,t),e.prototype.clear=function(){throw new Error("not supported")},e.prototype.delete=function(t){throw new Error("not supported")},e.prototype.set=function(t,e){throw new Error("not supported")},e.prototype.dispose=function(){this._disposeBaseObserver();for(var t=0;t<this._base.length;t++){var e=this._base[t];e[this._ogmInfoKey].reaction(),delete e[this._ogmInfoKey]}},e.prototype._getGroupArr=function(e){var n=t.prototype.get.call(this,e);return void 0===n&&(n=yt([],{name:"GroupArray["+this._keyToName(e)+"]",deep:!1}),t.prototype.set.call(this,e,n)),n},e.prototype._removeFromGroupArr=function(e,n){var r=t.prototype.get.call(this,e);1===r.length?t.prototype.delete.call(this,e):(n===r.length-1||(r[n]=r[r.length-1],r[n][this._ogmInfoKey].groupArrIndex=n),r.length--)},e.prototype._addItem=function(t){var e=this,n=this._groupBy(t),r=this._getGroupArr(n),o={groupByValue:n,groupArrIndex:r.length,reaction:Oe((function(){return e._groupBy(t)}),(function(n,r){var o=t[e._ogmInfoKey];e._removeFromGroupArr(o.groupByValue,o.groupArrIndex);var i=e._getGroupArr(n),a=i.length;i.push(t),o.groupByValue=n,o.groupArrIndex=a}))};Object.defineProperty(t,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:o}),r.push(t)},e.prototype._removeItem=function(t){var e=t[this._ogmInfoKey];this._removeFromGroupArr(e.groupByValue,e.groupArrIndex),e.reaction(),delete t[this._ogmInfoKey]}}(bn),Promise.resolve(),"undefined"!=typeof queueMicrotask||"undefined"!=typeof process&&process.nextTick;var RO=function(){return RO=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},RO.apply(this,arguments)},LO=function(){function t(t){this.undos=[],this.redos=[],this.callbacks=[],this.stopWatch=null,this.curData=null,this.maxSize=50,this.waitTime=100,this.eventCenter=t}return t.prototype.add=function(t){Of(qd(this.undos),t)||(this.undos.push(t),Of(this.curData,t)||(this.redos=[]),this.eventCenter.emit(lm.HISTORY_CHANGE,{data:{undos:this.undos,redos:this.redos,undoAble:this.undoAble(),redoAble:this.redoAble()}}),this.undos.length>this.maxSize&&this.undos.shift())},t.prototype.undoAble=function(){return this.undos.length>1},t.prototype.undo=function(){if(this.undoAble()){var t=this.undos.pop();this.redos.push(t);var e=this.undos.pop();return this.curData=mp(e),e}},t.prototype.redoAble=function(){return this.redos.length>0},t.prototype.redo=function(){if(this.redoAble()){var t=this.redos.pop();return this.curData=mp(t),t}},t.prototype.watch=function(t){var e=this;this.stopWatch&&this.stopWatch(),this.undos.push(t.modelToGraphData()),this.stopWatch=IO(t,Td((function(){var n=t.modelToHistoryData();n&&e.add(RO({},n))}),this.waitTime))},t}(),BO=null;function zO(t,e){return t.x+=e,t.y+=e,t.text&&(t.text.x+=e,t.text.y+=e),t}function HO(t,e){return t.startPoint&&(t.startPoint.x+=e,t.startPoint.y+=e),t.endPoint&&(t.endPoint.x+=e,t.endPoint.y+=e),t.pointsList&&t.pointsList.length>0&&t.pointsList.forEach((function(t){t.x+=e,t.y+=e})),t.text&&(t.text.x+=e,t.text.y+=e),t}var XO=40,GO=40;var WO=function(){return WO=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},WO.apply(this,arguments)},FO=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},UO=function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))},YO=Symbol("plugin registered by Logicflow.use"),VO=function(){function t(t){var e,n=this;this.viewMap=new Map,this.components=[],this.extension={},this.setView=function(t,e){return n.viewMap.set(t,e)},this.getView=function(t){return n.viewMap.get(t)};var r=hm.get(t);this.options=r,this.container=this.initContainer(r.container),this.graphModel=new Sx(WO(WO({},r),{container:this.container})),this.plugins=null!==(e=r.plugins)&&void 0!==e?e:[];var o,i,a,s,u=this.graphModel.eventCenter;this.tool=new yO(this),this.dnd=new rO({lf:this}),this.history=new LO(u),this.keyboard=new _O({lf:this,keyboard:r.keyboard}),!1!==r.snapline&&(this.snaplineModel=new Nx(this.graphModel),function(t,e){t.on("node:mousemove",(function(t){var n=t.data;e.setNodeSnapLine(n)})),t.on("node:mouseup",(function(){e.clearSnapline()}))}(u,this.snaplineModel)),r.isSilentMode||(o=this,i=this.graphModel,a=o.keyboard,s=a.options.keyboard,a.on(["cmd + c","ctrl + c"],(function(){if(GO=XO,!(null==s?void 0:s.enabled))return!0;if(i.textEditElement)return!0;var t=o.options.guards,e=i.getSelectElements(!1);return t&&t.beforeClone&&!t.beforeClone(e)||0===e.nodes.length&&0===e.edges.length?(BO=null,!0):((BO=e).nodes.forEach((function(t){return zO(t,XO)})),BO.edges.forEach((function(t){return HO(t,XO)})),!1)})),a.on(["cmd + v","ctrl + v"],(function(){if(!(null==s?void 0:s.enabled))return!0;if(i.textEditElement)return!0;if(BO&&(BO.nodes||BO.edges)){o.clearSelectElements();var t=o.addElements(BO,GO);if(!t)return!0;t.nodes.forEach((function(t){return o.selectElementById(t.id,!0)})),t.edges.forEach((function(t){return o.selectElementById(t.id,!0)})),BO.nodes.forEach((function(t){return zO(t,XO)})),BO.edges.forEach((function(t){return HO(t,XO)})),GO+=XO}return!1})),a.on(["cmd + z","ctrl + z"],(function(){return!(null==s?void 0:s.enabled)||!!i.textEditElement||(o.undo(),!1)})),a.on(["cmd + y","ctrl + y"],(function(){return!(null==s?void 0:s.enabled)||!!i.textEditElement||(o.redo(),!1)})),a.on(["backspace"],(function(){if(!(null==s?void 0:s.enabled))return!0;if(i.textEditElement)return!0;var t=i.getSelectElements(!0);return o.clearSelectElements(),t.edges.forEach((function(t){return t.id&&o.deleteEdge(t.id)})),t.nodes.forEach((function(t){return t.id&&o.deleteNode(t.id)})),!1})),this.keyboard.initShortcuts()),this.defaultRegister(),this.installPlugins(r.disabledPlugins)}return t.prototype.initContainer=function(t){var e=document.createElement("div");return e.style.position="relative",e.style.width="100%",e.style.height="100%",t.innerHTML="",t.appendChild(e),e},Object.defineProperty(t.prototype,Symbol.toStringTag,{get:function(){return t.toStringTag},enumerable:!1,configurable:!0}),t.prototype.register=function(t,e,n){if(void 0===n&&(n=!0),"string"==typeof t){var r={BaseEdge:Fw,BaseEdgeModel:mb,BaseNode:cw,BaseNodeModel:zb,RectNode:hw,RectNodeModel:sx,CircleNode:vw,CircleNodeModel:Wb,PolygonNode:_w,PolygonNodeModel:rx,TextNode:Pw,TextNodeModel:hx,LineEdge:Jw,LineEdgeModel:Pb,DiamondNode:Ew,DiamondNodeModel:Kb,PolylineEdge:eO,PolylineEdgeModel:Ib,BezierEdge:Kw,BezierEdgeModel:wb,EllipseNode:Mw,EllipseNodeModel:$b,HtmlNode:Cw,HtmlNodeModel:vx,h:ar,type:t};if(this.viewMap.forEach((function(t){var e=t.extendKey;e&&(r[e]=t)})),this.graphModel.modelMap.forEach((function(t){var e=t.extendKey;e&&(r[e]=t)})),e){var o=e(r),i=o.view,a=o.model,s=i;n&&!s.isObserved&&(s.isObserved=!0,s=KO(s)),this.setView(t,s),this.graphModel.setModel(t,a)}}else this.registerElement(t)},t.prototype.registerElement=function(t){var e=t.view;!1===t.isObserverView||e.isObserved||(e.isObserved=!0,e=KO(e)),this.setView(t.type,e),this.graphModel.setModel(t.type,t.model)},t.prototype.batchRegister=function(t){var e=this;void 0===t&&(t=[]),eh(t,(function(t){e.registerElement(t)}))},t.prototype.defaultRegister=function(){var t=[{type:"rect",view:hw,model:sx},{type:"circle",view:vw,model:Wb},{type:"polygon",view:_w,model:rx},{type:"text",view:Pw,model:hx},{type:"ellipse",view:Mw,model:$b},{type:"diamond",view:Ew,model:Kb},{type:"html",view:Cw,model:vx},{type:"line",view:Jw,model:Pb},{type:"polyline",view:eO,model:Ib},{type:"bezier",view:Kw,model:wb}];this.batchRegister(t)},t.prototype.addNode=function(t,e,n){return void 0===e&&(e=lm.NODE_ADD),this.graphModel.addNode(t,e,n)},t.prototype.deleteNode=function(t){var e=this.graphModel.getNodeModelById(t);if(!e)return!1;var n=e.getData(),r=this.options.guards,o=!(null==r?void 0:r.beforeDelete)||r.beforeDelete(n);return o&&this.graphModel.deleteNode(t),o},t.prototype.cloneNode=function(t){var e=this.graphModel.getNodeModelById(t),n=null==e?void 0:e.getData();if(n){var r=this.options.guards;if(!(null==r?void 0:r.beforeClone)||r.beforeClone(n))return this.graphModel.cloneNode(t)}},t.prototype.changeNodeId=function(t,e){return this.graphModel.changeNodeId(t,e)},t.prototype.changeNodeType=function(t,e){this.graphModel.changeNodeType(t,e)},t.prototype.getNodeModelById=function(t){return this.graphModel.getNodeModelById(t)},t.prototype.getNodeDataById=function(t){var e=this.getNodeModelById(t);return null==e?void 0:e.getData()},t.prototype.getNodeIncomingEdge=function(t){return this.graphModel.getNodeIncomingEdge(t)},t.prototype.getNodeOutgoingEdge=function(t){return this.graphModel.getNodeOutgoingEdge(t)},t.prototype.getNodeIncomingNode=function(t){return this.graphModel.getNodeIncomingNode(t)},t.prototype.getNodeOutgoingNode=function(t){return this.graphModel.getNodeOutgoingNode(t)},t.prototype.createFakeNode=function(t){var e=this.graphModel.modelMap.get(t.type);if(!e)return console.warn("不存在为".concat(t.type,"类型的节点")),null;var n=new e(WO(WO({},t),{virtual:!0}),this.graphModel);return this.graphModel.setFakeNode(n),n},t.prototype.removeFakeNode=function(){this.graphModel.removeFakeNode()},t.prototype.setNodeSnapLine=function(t){var e;null===(e=this.snaplineModel)||void 0===e||e.setNodeSnapLine(t)},t.prototype.removeNodeSnapLine=function(){var t;null===(t=this.snaplineModel)||void 0===t||t.clearSnapline()},t.prototype.setDefaultEdgeType=function(t){this.graphModel.setDefaultEdgeType(t)},t.prototype.addEdge=function(t){return this.graphModel.addEdge(t)},t.prototype.getEdgeDataById=function(t){var e=this.getEdgeModelById(t);return null==e?void 0:e.getData()},t.prototype.getEdgeModelById=function(t){return this.graphModel.getEdgeModelById(t)},t.prototype.getEdgeModels=function(t){var e=t.sourceNodeId,n=t.targetNodeId,r=[],o=this.graphModel.edges;return e&&n?eh(o,(function(t){t.sourceNodeId===e&&t.targetNodeId===n&&r.push(t)})):e?eh(o,(function(t){t.sourceNodeId===e&&r.push(t)})):n&&eh(o,(function(t){t.targetNodeId===n&&r.push(t)})),r},t.prototype.changeEdgeId=function(t,e){return this.graphModel.changeEdgeId(t,e)},t.prototype.changeEdgeType=function(t,e){this.graphModel.changeEdgeType(t,e)},t.prototype.deleteEdge=function(t){var e=this.graphModel.getEdgeModelById(t);if(!e)return!1;var n=e.getData(),r=this.options.guards,o=!(null==r?void 0:r.beforeDelete)||r.beforeDelete(n);return o&&this.graphModel.deleteEdgeById(t),o},t.prototype.deleteEdgeByNodeId=function(t){var e=t.sourceNodeId,n=t.targetNodeId;e&&n?this.graphModel.deleteEdgeBySourceAndTarget(e,n):e?this.graphModel.deleteEdgeBySource(e):n&&this.graphModel.deleteEdgeByTarget(n)},t.prototype.getNodeEdges=function(t){return this.graphModel.getNodeEdges(t)},t.prototype.addElements=function(t,e){var n=this,r=t.nodes,o=t.edges;void 0===e&&(e=40),console.log("addElements",r,o,e);var i={},a={nodes:[],edges:[]};return eh(r,(function(t){var e=t.id,r=n.addNode(t);e&&(i[e]=r.id),a.nodes.push(r)})),eh(o,(function(t){var e=t.sourceNodeId,r=t.targetNodeId;i[e]&&(e=i[e]),i[r]&&(r=i[r]);var o=n.graphModel.addEdge(WO(WO({},t),{sourceNodeId:e,targetNodeId:r}));a.edges.push(o)})),a},t.prototype.selectElementById=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!0),this.graphModel.selectElementById(t,e),!e&&n&&this.graphModel.toFront(t)},t.prototype.getSelectElements=function(t){return void 0===t&&(t=!0),this.graphModel.getSelectElements(t)},t.prototype.clearSelectElements=function(){this.graphModel.clearSelectElements()},t.prototype.getModelById=function(t){return this.graphModel.getElement(t)},t.prototype.getDataById=function(t){var e;return null===(e=this.graphModel.getElement(t))||void 0===e?void 0:e.getData()},t.prototype.deleteElement=function(t){var e,n,r,o=this.getModelById(t);return!!o&&(null!==(r=null===(n=((e={})[sm.NODE]=this.deleteNode,e[sm.EDGE]=this.deleteEdge,e)[o.BaseType])||void 0===n?void 0:n.call(this,t))&&void 0!==r&&r)},t.prototype.setElementZIndex=function(t,e){return this.graphModel.setElementZIndex(t,e)},t.prototype.getAreaElement=function(t,e,n,r,o){return void 0===n&&(n=!0),void 0===r&&(r=!0),void 0===o&&(o=!1),this.graphModel.getAreaElement(t,e,n,r,o).map((function(t){return t.getData()}))},t.prototype.setProperties=function(t,e){var n;null===(n=this.graphModel.getElement(t))||void 0===n||n.setProperties(_m(e))},t.prototype.getProperties=function(t){var e;return null===(e=this.graphModel.getElement(t))||void 0===e?void 0:e.getProperties()},t.prototype.deleteProperty=function(t,e){var n;null===(n=this.graphModel.getElement(t))||void 0===n||n.deleteProperty(e)},t.prototype.updateAttributes=function(t,e){this.graphModel.updateAttributes(t,e)},t.prototype.editText=function(t){this.graphModel.editText(t)},t.prototype.updateText=function(t,e){this.graphModel.updateText(t,e)},t.prototype.updateEditConfig=function(t){var e=this.graphModel,n=e.editConfigModel,r=e.transformModel;n.updateEditConfig(t),void 0!==(null==t?void 0:t.stopMoveGraph)&&r.updateTranslateLimits(t.stopMoveGraph),(null==t?void 0:t.isSilentMode)?this.keyboard.disable():this.keyboard.enable(!0)},t.prototype.getEditConfig=function(){return this.graphModel.editConfigModel.getConfig()},t.prototype.setTheme=function(t){this.graphModel.setTheme(t)},t.prototype.focusByElement=function(t){var e=void 0,n=this.getNodeModelById(t);if(n){var r=n.getData();e={x:r.x,y:r.y}}var o=this.getEdgeModelById(t);if(o){var i=o.textPosition;e={x:i.x,y:i.y}}e&&this.focusByCoordinate(e)},t.prototype.focusByCoordinate=function(t){var e=this.graphModel,n=e.transformModel,r=e.width,o=e.height,i=t.x,a=t.y;n.focusOn(i,a,r,o)},t.prototype.focusOn=function(t){if("string"==typeof t)this.focusByElement(t);else if("x"in t&&"y"in t)this.focusByCoordinate(t);else{var e=t.id,n=t.coordinate;e&&this.focusByElement(e),n&&this.focusByCoordinate(n)}},t.prototype.resize=function(t,e){this.graphModel.resize(t,e),this.options.width=this.graphModel.width,this.options.height=this.graphModel.height},t.prototype.toFront=function(t){this.graphModel.toFront(t)},t.prototype.getPointByClient=function(t,e){return"object"==typeof t?this.graphModel.getPointByClient(t):"number"==typeof e?this.graphModel.getPointByClient({x:t,y:e}):void 0},t.prototype.getGraphData=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.getGraphRawData();return this.adapterOut?this.adapterOut.apply(this,UO([n],FO(t),!1)):n},t.prototype.getGraphRawData=function(){return this.graphModel.modelToGraphData()},t.prototype.clearData=function(){this.graphModel.clearData()},t.prototype.renderRawData=function(t){this.graphModel.graphDataToModel(_m(t)),!1!==this.options.history&&this.history.watch(this.graphModel),function(t,e,n){null==e.__k&&(e.textContent=""),Pr(t,e),"function"==typeof n&&n(),t&&t.__c}(_o(zE,{getView:this.getView,tool:this.tool,options:this.options,dnd:this.dnd,snaplineModel:this.snaplineModel,graphModel:this.graphModel}),this.container),this.emit(lm.GRAPH_RENDERED,{data:this.graphModel.modelToGraphData()})},t.prototype.render=function(t){var e=mp(t);this.adapterIn&&(e=this.adapterIn(e)),this.renderRawData(e)},t.prototype.undo=function(){if(this.history.undoAble()){var t=_m(this.history.undo());this.clearSelectElements(),this.graphModel.graphDataToModel(t)}},t.prototype.redo=function(){if(this.history.redoAble()){var t=_m(this.history.redo());this.clearSelectElements(),this.graphModel.graphDataToModel(t)}},t.prototype.zoom=function(t,e){return this.graphModel.transformModel.zoom(t,e)},t.prototype.resetZoom=function(){this.graphModel.transformModel.resetZoom()},t.prototype.setZoomMiniSize=function(t){this.graphModel.transformModel.setZoomMiniSize(t)},t.prototype.setZoomMaxSize=function(t){this.graphModel.transformModel.setZoomMaxSize(t)},t.prototype.getTransform=function(){var t=this.graphModel.transformModel;return{SCALE_X:t.SCALE_X,SCALE_Y:t.SCALE_Y,TRANSLATE_X:t.TRANSLATE_X,TRANSLATE_Y:t.TRANSLATE_Y}},t.prototype.translate=function(t,e){this.graphModel.transformModel.translate(t,e)},t.prototype.resetTranslate=function(){var t=this.graphModel.transformModel,e=t.TRANSLATE_X,n=t.TRANSLATE_Y;this.translate(-e,-n)},t.prototype.translateCenter=function(){this.graphModel.translateCenter()},t.prototype.fitView=function(t,e){void 0===e&&(e=t),this.graphModel.fitView(t,e)},t.prototype.openEdgeAnimation=function(t){this.graphModel.openEdgeAnimation(t)},t.prototype.closeEdgeAnimation=function(t){this.graphModel.closeEdgeAnimation(t)},t.prototype.on=function(t,e){this.graphModel.eventCenter.on(t,e)},t.prototype.off=function(t,e){this.graphModel.eventCenter.off(t,e)},t.prototype.once=function(t,e){this.graphModel.eventCenter.once(t,e)},t.prototype.emit=function(t,e){this.graphModel.eventCenter.emit(t,e)},t.use=function(t,e){var n,r=t.pluginName;r||(console.warn("请给插件".concat(t.name||t.constructor.name,"指定pluginName!")),r=t.name),this.extensions.set(r,((n={})[YO]=YO,n.extension=t,n.props=e,n))},t.prototype.installPlugins=function(e){var n,r=this;void 0===e&&(e=[]),(null!==(n=this.plugins)&&void 0!==n?n:t.extensions).forEach((function(t){var n,o=null;t[YO]?(n=t.extension,o=t.props):n=t;var i=(null==n?void 0:n.pluginName)||(null==n?void 0:n.name);-1===e.indexOf(i)&&r.installPlugin(n,o)}))},t.prototype.installPlugin=function(e,n){var r;if("object"!=typeof e){var o=e,i=new o({lf:this,LogicFlow:t,options:null!==(r=this.options.pluginsOptions)&&void 0!==r?r:{},props:n});i.render&&this.components.push(i.render.bind(i)),this.extension[o.pluginName]=i}else{var a=e.pluginName,s=e.install,u=e.render;a&&(s&&s.call(e,this,t),u&&this.components.push(u.bind(e)),this.extension[a]=e)}},t.extensions=new Map,t}();function KO(t){return E.observer(t)}!function(t){t.toStringTag="LF.".concat(t.name)}(VO||(VO={}));var qO=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}(),ZO=(null===globalThis||void 0===globalThis?void 0:globalThis._ids)||new qO;function JO(){return ZO.next()}var $O=function(t){function e(e,n){return e.id||(e.id="Event_".concat(JO())),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 h(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}(Wb),QO=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.extendKey="StartEventNode",e}(vw),tM={type:"bpmn:startEvent",view:QO,model:$O},eM=function(t){function e(e,n){return e.id||(e.id="Event_".concat(JO())),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 h(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}(Wb),nM=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},e.prototype.getShape=function(){var e=this.props.model,n=e.getNodeStyle(),r=e,o=r.x,i=r.y,a=r.r;return ar("g",{},t.prototype.getShape.call(this),ar("circle",f(f({},n),{cx:o,cy:i,r:a-5})))},e.extendKey="EndEventView",e}(vw),rM={type:"bpmn:endEvent",view:nM,model:eM},oM=function(t){function e(e,n){return e.id||(e.id="Flow_".concat(JO())),t.call(this,e,n)||this}return h(e,t),e.extendKey="SequenceFlowModel",e}(Ib),iM=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.extendKey="SequenceFlowEdge",e}(eO),aM={type:"bpmn:sequenceFlow",view:iM,model:oM},sM=function(t){function e(e,n){var r=this;return e.id||(e.id="Gateway_".concat(JO())),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 h(e,t),e.extendKey="ExclusiveGatewayModel",e}(rx),uM=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getShape=function(){var t=this.props.model,e=t,n=e.x,r=e.y,o=e.width,i=e.height,a=e.points,s=t.getNodeStyle();return ar("g",{transform:"matrix(1 0 0 1 ".concat(n-o/2," ").concat(r-i/2,")")},ar("polygon",f(f({},s),{x:n,y:r,points:a})),ar("path",f({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)))},e.extendKey="ExclusiveGatewayNode",e}(_w),lM={type:"bpmn:exclusiveGateway",view:uM,model:sM},cM=function(t){function e(e,n){return e.id||(e.id="Activity_".concat(JO())),t.call(this,e,n)||this}return h(e,t),e.extendKey="ServiceTaskModel",e}(sx),pM=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getLabelShape=function(){var t=this.props.model,e=t.x,n=t.y;return ar("svg",{x:e-t.width/2+5,y:n-t.height/2+5,width:30,height:30,viewBox:"0 0 1274 1024"},ar("path",{fill:t.getNodeStyle().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"}))},e.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,r=t.width,o=t.height,i=t.radius,a=t.getNodeStyle();return ar("g",{},[ar("rect",f({x:e-r/2,y:n-o/2,rx:i,ry:i,width:r,height:o},a)),this.getLabelShape()])},e.extendKey="ServiceTaskNode",e}(hw),dM={type:"bpmn:serviceTask",view:pM,model:cM},hM=function(t){function e(e,n){return e.id||(e.id="Activity_".concat(JO())),t.call(this,e,n)||this}return h(e,t),e.extendKey="UserTaskModel",e}(sx),fM=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getLabelShape=function(){var t=this.props.model,e=t.x,n=t.y;return ar("svg",{x:e-t.width/2+5,y:n-t.height/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},ar("path",{fill:t.getNodeStyle().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"}))},e.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,r=t.width,o=t.height,i=t.radius,a=t.getNodeStyle();return ar("g",{},[ar("rect",f(f({},a),{x:e-r/2,y:n-o/2,rx:i,ry:i,width:r,height:o})),this.getLabelShape()])},e.extendKey="UserTaskNode",e}(hw),yM={type:"bpmn:userTask",view:fM,model:hM},vM=function(){function t(t){var e=t.lf;e.setTheme(p),e.register(tM),e.register(rM),e.register(lM),e.register(yM),e.register(dM),e.options.customBpmnEdge||(e.register(aM),e.setDefaultEdgeType("bpmn:sequenceFlow"))}return t.pluginName="bpmnElement",t}(),gM=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}(),mM=(null===globalThis||void 0===globalThis?void 0:globalThis._ids)||new gM;function _M(){return mM.next()}function bM(t){return Object.prototype.toString.call(t)}function xM(t){var e=t;return"[object Object]"===bM(t)?(e={},Object.keys(t).forEach((function(n){var r=n;"-"===n.charAt(0)&&(r=n.substring(1)),e[r]=xM(t[n])}))):Array.isArray(t)&&(e=[],t.forEach((function(t,n){e[n]=xM(t)}))),e}var EM="\t\n";function wM(t,e,n){var r=function(t){return" ".repeat(t)}(n),o="";if("#text"===e)return EM+r+t;if("#cdata-section"===e)return EM+r+"<![CDATA["+t+"]]>";if("#comment"===e)return EM+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(xM(t)).replace(/"/g,"'")}return e}(t)+'"';if(Array.isArray(t))t.forEach((function(t){o+=wM(t,e,n+1)}));else if("[object Object]"===bM(t)){var i=Object.keys(t),a="",s="";o+=(0===n?"":EM+r)+"<"+e,i.forEach((function(e){"-"===e.charAt(0)?a+=wM(t[e],e,n+1):s+=wM(t[e],e,n+1)})),o+=a+(""!==s?">".concat(s).concat(EM+r,"</").concat(e,">"):" />")}else o+=EM+r+"<".concat(e,">").concat(t.toString(),"</").concat(e,">");return o}function OM(t){var e="";for(var n in t)e+=wM(t[n],n,0);return e}var MM=function(){};(MM.ObjTree=function(){return this}).VERSION="0.23",MM.ObjTree.prototype.xmlDecl='<?xml version="1.0" encoding="UTF-8" ?>\n',MM.ObjTree.prototype.attr_prefix="-",MM.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)},MM.ObjTree.prototype.parseHTTP=function(t,e,n){var r,o={};for(var i in e)o[i]=e[i];if(o.method||(void 0===o.postBody&&void 0===o.postbody&&void 0===o.parameters?o.method="get":o.method="post"),n){o.asynchronous=!0;var a=this,s=n,u=o.onComplete;o.onComplete=function(t){var e;t&&t.responseXML&&t.responseXML.documentElement&&(e=a.parseDOM(t.responseXML.documentElement)),s(e,t),u&&u(t)}}else o.asynchronous=!1;if("undefined"!=typeof HTTP&&HTTP.Request)o.uri=t,(l=new HTTP.Request(o))&&(r=l.transport);else if("undefined"!=typeof Ajax&&Ajax.Request){var l;(l=new Ajax.Request(t,o))&&(r=l.transport)}return n?r:r&&r.responseXML&&r.responseXML.documentElement?this.parseDOM(r.responseXML.documentElement):void 0},MM.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}},MM.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(s=t.attributes[r].nodeName)){var o=t.attributes[r].nodeValue;try{o=JSON.parse(t.attributes[r].nodeValue.replace(/'/g,'"'))}catch(e){o=t.attributes[r].nodeValue}o&&(void 0===n[s=this.attr_prefix+s]&&(n[s]=0),n[s]++,this.addNode(e,s,n[s],o))}}}if(t.childNodes&&t.childNodes.length){var i=!0;e&&(i=!1);for(r=0;r<t.childNodes.length&&i;r++){var a=t.childNodes[r].nodeType;3!=a&&4!=a&&8!=a&&(i=!1)}if(i){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 s;if("string"==typeof(s=t.childNodes[r].nodeName))(o=this.parseElement(t.childNodes[r]))&&(void 0===n[s]&&(n[s]=0),n[s]++,this.addNode(e,s,n[s],o))}}}else null===e&&(e={});return e}},MM.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},MM.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e},MM.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],r=[];for(var o in e)if(e.hasOwnProperty(o)){var i=e[o];o.charAt(0)!=this.attr_prefix?void 0===i||null==i?n[n.length]="<"+o+" />":"object"==typeof i&&i.constructor==Array?n[n.length]=this.array_to_xml(o,i):n[n.length]="object"==typeof i?this.hash_to_xml(o,i):this.scalar_to_xml(o,i):r[r.length]=" "+o.substring(1)+'="'+this.xml_escape(i)+'"'}var a=r.join(""),s=n.join("");return void 0===t||null==t||(s=n.length>0?s.match(/\n/)?"<"+t+a+">\n"+s+"</"+t+">\n":"<"+t+a+">"+s+"</"+t+">\n":"<"+t+a+" />\n"),s},MM.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],r=0;r<e.length;r++){var o=e[r];void 0===o||null==o?n[n.length]="<"+t+" />":"object"==typeof o&&o.constructor==Array?n[n.length]=this.array_to_xml(t,o):n[n.length]="object"==typeof o?this.hash_to_xml(t,o):this.scalar_to_xml(t,o)}return n.join("")},MM.ObjTree.prototype.scalar_to_xml=function(t,e){return"#text"==t?this.xml_escape(e):"<"+t+">"+this.xml_escape(e)+"</"+t+">\n"},MM.ObjTree.prototype.xml_escape=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};var SM,AM=function(t){return(new MM.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"}(SM||(SM={}));var PM=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef"],NM=["properties","startPoint","endPoint","pointsList"];function TM(t){var e=t?NM.concat(t):NM;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 o=g(n,2),i=o[0],a=o[1];"object"!=typeof a?0===i.indexOf("-")||["#text","#cdata-section","#comment"].includes(i)?r[i]=a:r["-".concat(i)]=a:e.includes(i)?r["-".concat(i)]=t(a):r[i]=t(a)})),r)}(t)}}function DM(t){var e={};return Object.entries(t).forEach((function(t){var n=g(t,2),r=n[0],o=n[1];0===r.indexOf("-")?e[r.substring(1)]=xM(o):"string"==typeof o?e[r]=o:"[object Object]"===Object.prototype.toString.call(o)?e[r]=DM(o):Array.isArray(o)?e[r]=o.map((function(t){return DM(t)})):e[r]=o})),e}function jM(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}})),o={"-id":"".concat(n,"_di"),"-bpmnElement":n,"di:waypoint":r};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(o["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}}),o})),t["bpmndi:BPMNShape"]=e.nodes.map((function(t){var e,n=t.id,r=100,o=80,i=t.x,a=t.y,s=RM.shapeConfigMap.get(t.type);s&&(r=s.width,o=s.height),i-=r/2,a-=o/2;var u={"-id":"".concat(n,"_di"),"-bpmnElement":n,"dc:Bounds":{"-x":i,"-y":a,"-width":r,"-height":o}};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(u["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}}),u}))}function CM(t){var e=[],n=[],r=t["bpmn:definitions"];if(r){var o=r["bpmn:process"];Object.keys(o).forEach((function(t){if(0===t.indexOf("bpmn:")){var i=o[t];if(t===SM.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(kM(r,t))}));else{var r=void 0;r=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(kM(r,t))}return n}(i,a)}else{var s=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 o=IM(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);r.push(o)}));else{var o=IM(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);r.push(o)}return r}(i,s,t))}}}))}return{nodes:e,edges:n}}function IM(t,e,n){var r,o,i=Number(t["dc:Bounds"]["-x"]),a=Number(t["dc:Bounds"]["-y"]),s=n["-name"],u=RM.shapeConfigMap.get(e);if(u&&(i+=u.width/2,a+=u.height/2),Object.entries(n).forEach((function(t){var e=g(t,2),n=e[0],o=e[1];-1===PM.indexOf(n)&&(r||(r={}),r[n]=o)})),r&&(r=DM(r)),s&&(o={x:i,y:a,value:s},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var l=t["bpmndi:BPMNLabel"]["dc:Bounds"];o.x=Number(l["-x"])+Number(l["-width"])/2,o.y=Number(l["-y"])+Number(l["-height"])/2}var c={id:t["-bpmnElement"],type:e,x:i,y:a,properties:r};return o&&(c.text=o),c}function kM(t,e){var n,r,o=e["-name"];if(o){var i=t["bpmndi:BPMNLabel"]["dc:Bounds"],a=0;o.split("\n").forEach((function(t){a<t.length&&(a=t.length)})),n={value:o,x:Number(i["-x"])+10*a/2,y:Number(i["-y"])+7}}Object.entries(e).forEach((function(t){var e=g(t,2),n=e[0],o=e[1];-1===PM.indexOf(n)&&(r||(r={}),r[n]=o)})),r&&(r=DM(r));var s={id:e["-id"],type:SM.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&&(s.text=n),s}var RM=function(){function t(t){var e=t.lf,n=this;this.adapterOut=function(t,e){var r=f({},n.processAttributes);!function(t,e,n){var r=new Map;e.nodes.forEach((function(e){var o,i={"-id":e.id};if((null===(o=e.text)||void 0===o?void 0:o.value)&&(i["-name"]=e.text.value),e.properties){var a=TM(n)(e.properties);Object.assign(i,a)}r.set(e.id,i),t[e.type]?Array.isArray(t[e.type])?t[e.type].push(i):t[e.type]=[t[e.type],i]:t[e.type]=i}));var o=e.edges.map((function(t){var e,o,i=r.get(t.targetNodeId);i["bpmn:incoming"]?Array.isArray(i["bpmn:incoming"])?i["bpmn:incoming"].push(t.id):i["bpmn:incoming"]=[i["bpmn:incoming"],t.id]:i["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===(o=t.text)||void 0===o?void 0:o.value),t.properties){var s=TM(n)(t.properties);Object.assign(a,s)}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[SM.FLOW]=o}(r,t,e);var o={"-id":"BPMNPlane_1","-bpmnElement":r["-id"]};jM(o,t);var i=n.definitionAttributes;return i["bpmn:process"]=r,i["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":o},{"bpmn:definitions":i}},this.adapterIn=function(t){if(t)return CM(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(_M())},this.definitionAttributes={"-id":"Definitions_".concat(_M()),"-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}();RM.shapeConfigMap.set(SM.START,{width:e,height:n}),RM.shapeConfigMap.set(SM.END,{width:r,height:o}),RM.shapeConfigMap.set(SM.GATEWAY,{width:i,height:a}),RM.shapeConfigMap.set(SM.SYSTEM,{width:s,height:u}),RM.shapeConfigMap.set(SM.USER,{width:l,height:c});var LM=function(t){function e(e){var n=t.call(this,e)||this;n.adapterXmlIn=function(t){var e=AM(t);return n.adapterIn(e)},n.adapterXmlOut=function(t,e){return OM(n.adapterOut(t,e))};var r=e.lf;return r.adapterIn=n.adapterXmlIn,r.adapterOut=n.adapterXmlOut,n}return h(e,t),e.pluginName="bpmnXmlAdapter",e}(RM);function BM(){this.targetRules.push({message:"分组外的节点不允许连接分组内的",validate:function(t,e){var n=!!t.properties.parent,r=!!e.properties.parent;return!(!n&&r)}})}var zM=function(){function t(){globalThis._ids=this,this._ids=new Set}return t.prototype.generateId=function(){var t="xxxxxxx".replace(/[x]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}));return t},t.prototype.next=function(){for(var t=this.generateId();this._ids.has(t);)t=this.generateId();return this._ids.add(t),t},t}(),HM=(null===globalThis||void 0===globalThis?void 0:globalThis._ids)||new zM;function XM(){return HM.next()}var GM=Object.freeze({__proto__:null,genBpmnId:XM,groupRule:BM});function WM(t){var e=g(t.useDefinition(),1)[0],n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return h(n,t),n.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},n.prototype.getShape=function(){var n,r=this.props.model,o=r.getNodeStyle(),i=r,a=i.x,s=i.y,u=i.r,l=i.width,c=i.height,p=i.properties,d=t.prototype.getShape.call(this),h=p.definitionType,y=((null===(n=e.endEvent)||void 0===n?void 0:n.get(h))||{}).icon,v=Array.isArray(y)?ar.apply(void 0,m(["g",{transform:"matrix(1 0 0 1 ".concat(a-l/2," ").concat(s-c/2,")")}],g(y),!1)):ar("path",{transform:"matrix(1 0 0 1 ".concat(a-l/2," ").concat(s-c/2,")"),d:y,style:"fill: black; stroke-linecap: round; stroke-linejoin: round; stroke: white; stroke-width: 1px;"});return ar("g",{},d,ar("circle",f(f({},o),{strokeWidth:2,cx:a,cy:s,r:u-2})),v)},n}(vw),r=function(t){function n(n,r){var o,i,a,s;n.id||(n.id="Event_".concat(XM())),n.text||(n.text=""),n.text&&"string"==typeof n.text&&(n.text={value:n.text,x:n.x,y:n.y+40});var u=((null===(i=e.endEvent)||void 0===i?void 0:i.get(null===(a=n.properties)||void 0===a?void 0:a.definitionType))||{}).properties,l=void 0===u?{}:u;return n.properties=f(f({},l),n.properties),(null===(s=n.properties)||void 0===s?void 0:s.definitionType)&&(n.properties.definitionId="Definition_".concat(XM())),o=t.call(this,n,r)||this,BM.call(o),o}return h(n,t),n.prototype.setAttributes=function(){this.r=18},n.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},n}(Wb);return{type:"bpmn:endEvent",view:n,model:r}}function FM(t){var e=g(t.useDefinition(),1)[0],n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return h(n,t),n.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},n.prototype.getShape=function(){var t,n=this.props.model,r=n.getNodeStyle(),o=n,i=o.x,a=o.y,s=o.r,u=o.width,l=o.height,c=o.properties.definitionType,p=((null===(t=e.intermediateCatchEvent)||void 0===t?void 0:t.get(c))||{}).icon,d=Array.isArray(p)?ar.apply(void 0,m(["g",{transform:"matrix(1 0 0 1 ".concat(i-u/2," ").concat(a-l/2,")")}],g(p),!1)):ar("path",{transform:"matrix(1 0 0 1 ".concat(i-u/2," ").concat(a-l/2,")"),d:p});return ar("g",{},ar("circle",f(f({},r),{cx:i,cy:a,r:s,strokeWidth:1.5})),ar("circle",f(f({},r),{cx:i,cy:a,r:s-3,strokeWidth:1.5})),d)},n}(vw),r=function(t){function n(n,r){var o,i,a,s;n.id||(n.id="Event_".concat(XM())),n.text||(n.text=""),n.text&&"string"==typeof n.text&&(n.text={value:n.text,x:n.x,y:n.y+40});var u=((null===(i=e.intermediateCatchEvent)||void 0===i?void 0:i.get(null===(a=n.properties)||void 0===a?void 0:a.definitionType))||{}).properties,l=void 0===u?{}:u;return n.properties=f(f({},l),n.properties),(null===(s=n.properties)||void 0===s?void 0:s.definitionType)&&(n.properties.definitionId="Definition_".concat(XM())),o=t.call(this,n,r)||this,BM.call(o),o}return h(n,t),n.prototype.setAttributes=function(){this.r=18},n}(Wb);return{type:"bpmn:intermediateCatchEvent",view:n,model:r}}function UM(t){var e=g(t.useDefinition(),1)[0],n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return h(n,t),n.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},n.prototype.getShape=function(){var t,n=this.props.model,r=n.getNodeStyle(),o=n,i=o.x,a=o.y,s=o.r,u=o.width,l=o.height,c=o.properties,p=c.definitionType,d=c.isInterrupting,h=((null===(t=e.startEvent)||void 0===t?void 0:t.get(p))||{}).icon,y=Array.isArray(h)?ar.apply(void 0,m(["g",{transform:"matrix(1 0 0 1 ".concat(i-u/2," ").concat(a-l/2,")")}],g(h),!1)):ar("path",{transform:"matrix(1 0 0 1 ".concat(i-u/2," ").concat(a-l/2,")"),d:h,style:"fill: white; stroke-linecap: round; stroke-linejoin: round; stroke: rgb(34, 36, 42); stroke-width: 1px;"});return ar("g",{},ar("circle",f(f({},r),{cx:i,cy:a,r:s,strokeDasharray:d?"5,5":"",strokeWidth:2})),y)},n}(vw),r=function(t){function n(n,r){var o,i,a;n.id||(n.id="Event_".concat(XM())),n.text||(n.text=""),n.text&&"string"==typeof n.text&&(n.text={value:n.text,x:n.x,y:n.y+40});var s=((null===(o=e.startEvent)||void 0===o?void 0:o.get(null===(i=n.properties)||void 0===i?void 0:i.definitionType))||{}).properties,u=void 0===s?{}:s;return n.properties=f(f({},u),n.properties),(null===(a=n.properties)||void 0===a?void 0:a.definitionType)&&(n.properties.definitionId="Definition_".concat(XM())),t.call(this,n,r)||this}return h(n,t),n.prototype.setAttributes=function(){this.r=18},n.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},n}(Wb);return{type:"bpmn:startEvent",view:n,model:r}}function YM(t){var e=g(t.useDefinition(),1)[0],n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return h(n,t),n.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},n.prototype.getShape=function(){var t,n=this.props.model,r=n.getNodeStyle(),o=n,i=o.x,a=o.y,s=o.r,u=o.width,l=o.height,c=o.properties,p=c.definitionType,d=c.cancelActivity,h=((null===(t=e.boundaryEvent)||void 0===t?void 0:t.get(p))||{}).icon,y=Array.isArray(h)?ar.apply(void 0,m(["g",{transform:"matrix(1 0 0 1 ".concat(i-u/2," ").concat(a-l/2,")")}],g(h),!1)):ar("path",{transform:"matrix(1 0 0 1 ".concat(i-u/2," ").concat(a-l/2,")"),d:h});return ar("g",{},ar("circle",f(f({},r),{cx:i,cy:a,r:s,strokeDasharray:d?"":"5,5",strokeWidth:1.5})),ar("circle",f(f({},r),{cx:i,cy:a,r:s-3,strokeDasharray:d?"":"5,5",strokeWidth:1.5})),y)},n}(vw),r=function(t){function n(n,r){var o,i,a,s;n.id||(n.id="Event_".concat(XM())),n.text||(n.text=""),n.text&&"string"==typeof n.text&&(n.text={value:n.text,x:n.x,y:n.y+40});var u=((null===(i=e.boundaryEvent)||void 0===i?void 0:i.get(null===(a=n.properties)||void 0===a?void 0:a.definitionType))||{}).properties,l=void 0===u?{}:u;return n.properties=f(f({attachedToRef:"",cancelActivity:!0},l),n.properties),(null===(s=n.properties)||void 0===s?void 0:s.definitionType)&&(n.properties.definitionId="Definition_".concat(XM())),o=t.call(this,n,r)||this,BM.call(o),o}return h(n,t),n.prototype.initNodeData=function(e){t.prototype.initNodeData.call(this,e),this.r=20,this.autoToFront=!1,this.zIndex=99999},n.prototype.setAttributes=function(){this.r=18},n}(Wb);return{type:"bpmn:boundaryEvent",view:n,model:r}}function VM(t){var e=g(t.useDefinition(),1)[0],n=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return h(n,t),n.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},n.prototype.getShape=function(){var t,n=this.props.model,r=n.getNodeStyle(),o=n,i=o.x,a=o.y,s=o.r,u=o.width,l=o.height,c=o.properties.definitionType,p=((null===(t=e.intermediateThrowEvent)||void 0===t?void 0:t.get(c))||{}).icon,d=Array.isArray(p)?ar.apply(void 0,m(["g",{transform:"matrix(1 0 0 1 ".concat(i-u/2," ").concat(a-l/2,")")}],g(p),!1)):ar("path",{transform:"matrix(1 0 0 1 ".concat(i-u/2," ").concat(a-l/2,")"),d:p,style:"fill: black"});return ar("g",{},ar("circle",f(f({},r),{cx:i,cy:a,r:s,strokeWidth:1.5})),ar("circle",f(f({},r),{cx:i,cy:a,r:s-3,strokeWidth:1.5})),d)},n}(vw),r=function(t){function n(n,r){var o,i,a,s;n.id||(n.id="Event_".concat(XM())),n.text||(n.text=""),n.text&&"string"==typeof n.text&&(n.text={value:n.text,x:n.x,y:n.y+40});var u=((null===(i=e.intermediateThrowEvent)||void 0===i?void 0:i.get(null===(a=n.properties)||void 0===a?void 0:a.definitionType))||{}).properties,l=void 0===u?{}:u;return n.properties=f(f({},l),n.properties),(null===(s=n.properties)||void 0===s?void 0:s.definitionType)&&(n.properties.definitionId="Definition_".concat(XM())),o=t.call(this,n,r)||this,BM.call(o),o}return h(n,t),n.prototype.setAttributes=function(){this.r=18},n}(Wb);return{type:"bpmn:intermediateThrowEvent",view:n,model:r}}var KM=[ar("circle",{cx:18,cy:18,r:11,style:"stroke-linecap: round;stroke-linejoin: round;stroke: rgb(34, 36, 42);stroke-width: 2px;fill: white"}),ar("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;"}),ar("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;"}),ar("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;"}),ar("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;"}),ar("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;"}),ar("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;"}),ar("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;"}),ar("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;"}),ar("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;"}),ar("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;"}),ar("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;"}),ar("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;"}),ar("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;"})],qM=[ar("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);"})],ZM="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",JM="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",$M=ar("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;"}),QM="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",tS="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",eS="m44,60 m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",nS="m47,61 m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",rS="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",oS=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:ZM,inclusiveIcon:$M,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:rS,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:JM,parallelMarker:eS,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:nS,serviceTaskIcon:QM,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:qM,timerIcon:KM,userTaskIcon:tS});function iS(t,e,n){var r=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return h(n,t),n.prototype.getShape=function(){var t=this.props.model,n=t,r=n.x,o=n.y,i=n.width,a=n.height,s=n.points,u=t.getNodeStyle();return ar("g",{transform:"matrix(1 0 0 1 ".concat(r-i/2," ").concat(o-a/2,")")},ar(oE,f(f({},u),{x:r,y:o,points:s})),"string"==typeof e?ar("path",f(f({d:e},u),{fill:"rgb(34, 36, 42)",strokeWidth:1})):e)},n}(_w);return{type:t,view:r,model:function(t){function e(e,r){var o=this;return e.id||(e.id="Gateway_".concat(XM())),e.text||(e.text=""),e.text&&"string"==typeof e.text&&(e.text={value:e.text,x:e.x,y:e.y+40}),e.properties=f(f({},n||{}),e.properties),(o=t.call(this,e,r)||this).points=[[25,0],[50,25],[25,50],[0,25]],BM.call(o),o}return h(e,t),e}(rx)}}var aS={parallel:eS,sequential:nS,loop:rS};function sS(t,e,n){var r=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return h(n,t),n.prototype.getLabelShape=function(){var t=this.props.model,n=t.x,r=t.y,o=t.width,i=t.height,a=t.getNodeStyle(),s=Array.isArray(e)?ar.apply(void 0,m(["g",{transform:"matrix(1 0 0 1 ".concat(n-o/2," ").concat(r-i/2,")")}],g(e),!1)):ar("path",{fill:a.stroke,d:e});return ar("svg",{x:n-o/2+5,y:r-i/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},s)},n.prototype.getShape=function(){var t=this.props.model,e=t.x,n=t.y,r=t.width,o=t.height,i=t.radius,a=t.properties,s=t.getNodeStyle();return ar("g",{},[ar("rect",f(f({},s),{x:e-r/2,y:n-o/2,rx:i,ry:i,width:r,height:o,opacity:.95})),this.getLabelShape(),ar("g",{transform:"matrix(1 0 0 1 ".concat(e-r/2," ").concat(n-o/2,")")},ar("path",{fill:"white",strokeLinecap:"round",strokeLinejoin:"round",stroke:"rgb(34, 36, 42)",strokeWidth:"2",d:aS[a.multiInstanceType]||""}))])},n}(hw),o=function(t){function e(e,r){var o,i=this;e.id||(e.id="Activity_".concat(XM()));var a=f(f({},n||{}),e.properties);return e.properties=a,i=t.call(this,e,r)||this,null===(o=null==a?void 0:a.boundaryEvents)||void 0===o||o.forEach((function(t){i.addBoundaryEvent(t)})),i.deleteProperty("boundaryEvents"),BM.call(i),i}return h(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}(sx);return{type:t,view:r,model:o}}var uS=bm,lS=function(t){function e(e){var n=t.call(this)||this;return n.updatePosition=function(t){var e=t.deltaX,r=t.deltaY,o=n.nodeModel,i=o.x,a=o.y;n.nodeModel.x=i+e/2,n.nodeModel.y=a+r/2,n.nodeModel.moveText(e/2,r/2)},n.getResize=function(t){var e=t.index,n=t.deltaX,r=t.deltaY,o=t.width,i=t.height,a=t.PCTResizeInfo,s=t.pct,u=void 0===s?1:s,l=t.freezeWidth,c=void 0!==l&&l,p=t.freezeHeight,d=void 0!==p&&p,h={width:o,height:i,deltaX:n,deltaY:r};if(a){var f=0,y=0;switch(e){case 0:y=(-1*n-r)/4;break;case 1:y=(n-r)/4;break;case 2:y=(n+r)/4;break;case 3:y=(-1*n+r)/4}0!==y&&(f=Math.round(y/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 v=Math.round(a.ResizePCT.widthPCT*a.ResizeBasis.basisWidth/100),g=Math.round(a.ResizePCT.heightPCT*a.ResizeBasis.basisHeight/100);switch(e){case 0:n=o-v,r=i-g;break;case 1:n=v-o,r=i-g;break;case 2:n=v-o,r=g-i;break;case 3:n=o-v,r=g-i}return h.width=v,h.height=g,h.deltaX=n/u,h.deltaY=r/u,h}switch(e){case 0:h.width=c?o:o-n*u,h.height=d?i:i-r*u;break;case 1:h.width=c?o:o+n*u,h.height=d?i:i-r*u;break;case 2:h.width=c?o:o+n*u,h.height=d?i:i+r*u;break;case 3:h.width=c?o:o-n*u,h.height=d?i:i+r*u}return h},n.updateEdgePointByAnchors=function(){var t=n.nodeModel,e=t.id,r=t.anchors,o=n.getNodeEdges(e);o.sourceEdges.forEach((function(t){var e=r.find((function(e){return e.id===t.sourceAnchorId}));e&&t.updateStartPoint({x:e.x,y:e.y})})),o.targetEdges.forEach((function(t){var e=r.find((function(e){return e.id===t.targetAnchorId}));e&&t.updateEndPoint({x:e.x,y:e.y})}))},n.updateRect=function(t){var e=t.deltaX,r=t.deltaY,o=n.nodeModel,i=o.x,a=o.y,s=o.width,u=o.height,l=o.radius,c=o.PCTResizeInfo,p=n.nodeModel,d=p.minWidth,h=p.minHeight,f=p.maxWidth,y=p.maxHeight,v=n.index,g=d===f,m=h===y,_=n.getResize({index:v,deltaX:e,deltaY:r,width:s,height:u,PCTResizeInfo:c,pct:1,freezeWidth:g,freezeHeight:m});if(_.width<d||_.width>f||_.height<h||_.height>y)n.dragHandler.cancelDrag();else{n.updatePosition({deltaX:g?0:_.deltaX,deltaY:m?0:_.deltaY}),n.nodeModel.width=_.width,n.nodeModel.height=_.height,n.nodeModel.setProperties({nodeSize:{width:_.width,height:_.height}});var b={x:i,y:a,width:s,height:u,radius:l},x={x:n.nodeModel.x,y:n.nodeModel.y,width:n.nodeModel.width,height:n.nodeModel.height,radius:l};n.updateEdgePointByAnchors(),n.eventEmit({beforeNode:b,afterNode:x})}},n.updateEllipse=function(t){var e=t.deltaX,r=t.deltaY,o=n.nodeModel,i=o.rx,a=o.ry,s=o.x,u=o.y,l=o.PCTResizeInfo,c=n.index,p=n.nodeModel,d=p.minWidth,h=p.minHeight,y=p.maxWidth,v=p.maxHeight,g=d===y,m=h===v,_=i,b=a,x=n.getResize({index:c,deltaX:e,deltaY:r,width:_,height:b,PCTResizeInfo:l,pct:.5,freezeWidth:g,freezeHeight:m});if(x.width<d/2||x.width>y/2||x.height<h/2||x.height>v/2)n.dragHandler.cancelDrag();else{n.updatePosition({deltaX:g?0:x.deltaX,deltaY:m?0:x.deltaY}),n.nodeModel.rx=x.width,n.nodeModel.ry=x.height,n.nodeModel.setProperties({nodeSize:{rx:x.width,ry:x.height}});var E={x:s,y:u},w={rx:x.width,ry:x.height,x:n.nodeModel.x,y:n.nodeModel.y};n.updateEdgePointByAnchors(),n.eventEmit({beforeNode:f(f({},E),{rx:i,ry:a}),afterNode:w})}},n.updateDiamond=function(t){var e=t.deltaX,r=t.deltaY,o=n.nodeModel,i=o.rx,a=o.ry,s=o.x,u=o.y,l=o.PCTResizeInfo,c=n.index,p=n.nodeModel,d=p.minWidth,h=p.minHeight,f=p.maxWidth,y=p.maxHeight,v=d===f,g=h===y,m=i,_=a,b=n.getResize({index:c,deltaX:e,deltaY:r,width:m,height:_,PCTResizeInfo:l,pct:.5,freezeWidth:v,freezeHeight:g});if(b.width<d/2||b.width>f/2||b.height<h/2||b.height>y/2)n.dragHandler.cancelDrag();else{n.updatePosition({deltaX:v?0:b.deltaX,deltaY:g?0:b.deltaY}),n.nodeModel.rx=b.width,n.nodeModel.ry=b.height,n.nodeModel.setProperties({nodeSize:{rx:b.width,ry:b.height}});var x={x:s,y:u,rx:i,ry:a},E={rx:b.width,ry:b.height,x:n.nodeModel.x,y:n.nodeModel.y};n.updateEdgePointByAnchors(),n.eventEmit({beforeNode:x,afterNode:E})}},n.eventEmit=function(t){var e=t.beforeNode,r=t.afterNode,o=n.nodeModel,i=o.id,a=o.modelType,s=o.type,u=f({id:i,modelType:a,type:s},e),l=f({id:i,modelType:a,type:s},r);n.graphModel.eventCenter.emit("node:resize",{oldNodeSize:u,newNodeSize:l})},n.onDragging=function(t){var e,r=t.deltaX,o=t.deltaY,i=n.graphModel.transformModel,a=n.nodeModel.modelType;r=(e=g(i.fixDeltaXY(r,o),2))[0],o=e[1],a===um.RECT_NODE||a===um.HTML_NODE?n.updateRect({deltaX:r,deltaY:o}):a===um.ELLIPSE_NODE?n.updateEllipse({deltaX:r,deltaY:o}):a===um.DIAMOND_NODE&&n.updateDiamond({deltaX:r,deltaY:o})},n.onDragEnd=function(){var t=n.graphModel.gridSize,e=void 0===t?1:t,r=e*Math.round(n.nodeModel.x/e),o=e*Math.round(n.nodeModel.y/e);n.nodeModel.moveTo(r,o),n.updateEdgePointByAnchors()},n.index=e.index,n.nodeModel=e.model,n.graphModel=e.graphModel,n.dragHandler=new uS({onDragging:n.onDragging,onDragEnd:n.onDragEnd,step:1}),n}return h(e,t),e.prototype.getNodeEdges=function(t){for(var e=this.graphModel.edges,n=[],r=[],o=0;o<e.length;o++){var i=e[o];i.sourceNodeId===t?n.push(i):e[o].targetNodeId===t&&r.push(i)}return{sourceEdges:n,targetEdges:r}},e.prototype.render=function(){var t=this.props,e=t.x,n=t.y,r=t.index,o=t.model.getControlPointStyle();return _o("g",{className:"lf-resize-control-".concat(r),children:_o(Yx,f({className:"lf-node-control",x:e,y:n},o,{onMouseDown:this.dragHandler.handleMouseDown}))})},e}(lr),cS=function(t){function e(){var e=t.call(this)||this;return e.state={},e}return h(e,t),e.prototype.getResizeControl=function(){var t=this.props,e=t.model,n=t.graphModel,r=e.x,o=e.y,i=e.width,a=e.height,s={minX:r-i/2,minY:o-a/2,maxX:r+i/2,maxY:o+a/2},u=s.minX,l=s.minY,c=s.maxX,p=s.maxY;return[{x:u,y:l},{x:c,y:l},{x:c,y:p},{x:u,y:p}].map((function(t,r){return _o(lS,f({index:r},t,{model:e,graphModel:n}))}))},e.prototype.getGroupSolid=function(){var t=this.props.model,e=t.x,n=t.y,r=t.width,o=t.height,i=t.getResizeOutlineStyle();return _o(Yx,f({},i,{x:e,y:n,width:r,height:o}))},e.prototype.render=function(){return _o("g",{className:"lf-resize-control",children:[this.getGroupSolid(),this.getResizeControl()]})},e}(lr),pS=function(t){function e(e,n){var r=t.call(this,e,n)||this,o=e.properties.nodeSize;return o&&(r.rx=o.rx,r.ry=o.ry),r}return h(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{stroke:"#000000",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}($b),dS=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return _o(cS,{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 _o("g",{children:[this.getResizeShape(),e.isSelected&&!n?this.getControlGroup():""]})},e}(Mw),hS={type:"ellipse",view:dS,model:pS},fS=function(t){function e(e,n){var r=t.call(this,e,n)||this,o=e.properties.nodeSize;return o&&(r.rx=o.rx,r.ry=o.ry),r}return h(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{stroke:"#000000",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}(Kb),yS=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return _o(cS,{model:e,graphModel:n})},e.prototype.getResizeShape=function(){var t=this.props.model,e=t.points,n=t.getNodeStyle();return _o("g",{children:_o(oE,f({},n,{points:e}))})},e.prototype.getShape=function(){var t=this.props,e=t.model.isSelected,n=t.graphModel.editConfigModel.isSilentMode;return _o("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},e}(Ew),vS={type:"diamond",view:yS,model:fS},gS=function(t){function e(e,n){var r=t.call(this,e,n)||this,o=e.properties.nodeSize;return o&&(r.width=o.width,r.height=o.height),r}return h(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{stroke:"#000000",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}(vx),mS=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return _o(cS,{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 _o("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},e}(Cw),_S={type:"html",view:mS,model:gS},bS=function(t){function e(e,n){var r=t.call(this,e,n)||this,o=e.properties.nodeSize;return o&&(r.width=o.width,r.height=o.height),r}return h(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}(sx),xS=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getControlGroup=function(){var t=this.props,e=t.model,n=t.graphModel;return _o(cS,{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 _o("g",{children:[this.getResizeShape(),e&&!n?this.getControlGroup():""]})},e}(hw),ES={type:"rect",view:xS,model:bS},wS={pluginName:"nodeResize",step:0,install:function(t){t.register(hS),t.register(vS),t.register(_S),t.register(ES)}},OS=function(t){function e(){var e=t.apply(this,m([],g(arguments),!1))||this;return e.isGroup=!0,e.isFolded=!1,e.unfoldedWidth=500,e.unfoldedHeight=300,e.childrenLastFoldStatus={},e}return h(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=m(m([],g(this.incoming.edges),!1),g(this.outgoing.edges),!1);this.children.forEach((function(r){var o=e.graphModel.getElement(r);if(o){var i=o.isFolded;if(o.isGroup&&!o.isFolded&&o.foldGroup(t),o.isGroup&&!t){var a=e.childrenLastFoldStatus[r];void 0!==a&&a!==o.isFolded&&o.foldGroup(a)}e.childrenLastFoldStatus[r]=!!i,o.visible=!t;var s=o.incoming.edges,u=o.outgoing.edges;n=m(m(m([],g(n),!1),g(s),!1),g(u),!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 o=e.id,i=e.sourceNodeId,a=e.targetNodeId,s=e.startPoint,u=e.endPoint,l=e.type,c=e.text,p=e.getProperties(),d={id:"".concat(o,"__").concat(r),sourceNodeId:i,targetNodeId:a,startPoint:s,endPoint:u,type:l,properties:p,text:null==c?void 0:c.value};e.virtual&&n.graphModel.deleteEdgeById(e.id);var h=n.graphModel.group.getNodeGroup(a);h||(h=n.graphModel.getNodeModelById(a));var f=n.graphModel.group.getNodeGroup(i);f||(f=n.graphModel.getNodeModelById(i)),t&&!1!==e.visible&&(n.children.has(i)||n.id===i?(d.startPoint=void 0,d.sourceNodeId=n.id):(d.endPoint=void 0,d.targetNodeId=n.id),h.id===n.id&&f.id===n.id||n.createVirtualEdge(d),e.visible=!1),t||!1!==e.visible||(h&&h.isGroup&&h.isFolded?(d.targetNodeId=h.id,d.endPoint=void 0,n.createVirtualEdge(d)):f&&f.isGroup&&f.isFolded?(d.sourceNodeId=f.id,d.startPoint=void 0,n.createVirtualEdge(d)):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,o=t.y2;return e>=this.x-this.width/2&&r<=this.x+this.width/2&&n>=this.y-this.height/2&&o<=this.y+this.height/2},e.prototype.isAllowMoveTo=function(t){var e=t.x1,n=t.y1,r=t.x2,o=t.y2;return{x:e>=this.x-this.width/2&&r<=this.x+this.width/2,y:n>=this.y-this.height/2&&o<=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=m([],g(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}(bS),MS=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getControlGroup=function(){var e=this.props.model,n=e.resizable,r=e.properties;return n&&!r.isFolded?t.prototype.getControlGroup.call(this):null},e.prototype.getAddableShape=function(){var t=this.props.model,e=t.width,n=t.height,r=t.x,o=t.y,i=t.radius,a=t.properties,s=t.getAddableOutlineStyle;if(!a.groupAddable)return null;var u=this.props.model.getNodeStyle().strokeWidth,l=void 0===u?0:u,c=s(),p=e+l+8,d=n+l+8;return ar("rect",f(f({},c),{width:p,height:d,x:r-p/2,y:o-d/2,rx:i,ry:i}))},e.prototype.getFoldIcon=function(){var t=this.props.model,e=t.x-t.width/2+5,n=t.y-t.height/2+5;if(!t.foldable)return null;var r=ar("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:t.properties.isFolded?"M ".concat(e+3,",").concat(n+6," ").concat(e+11,",").concat(n+6," M").concat(e+7,",").concat(n+2," ").concat(e+7,",").concat(n+10):"M ".concat(e+3,",").concat(n+6," ").concat(e+11,",").concat(n+6," ")});return ar("g",{},[ar("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)}}),r])},e.prototype.getResizeShape=function(){return ar("g",{},[this.getAddableShape(),t.prototype.getResizeShape.call(this),this.getFoldIcon()])},e}(xS),SS={type:"group",view:MS,model:OS},AS=-1e4,PS=function(){function t(t){var e=t.lf,n=this;this.topGroupZIndex=AS,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 o=n.lf.getNodeModelById(r);o.removeChild(e.id),n.nodeGroupMap.delete(e.id),o.setAllowAppendChild(!1)}var i=n.lf.getNodeModelById(e.id),a=null==i?void 0:i.getBounds();if(a&&i){var s=n.getGroup(a,e);if(i.isGroup&&(e.children.forEach((function(t){n.nodeGroupMap.set(t,e.id)})),n.checkAndCorrectTopGroupZIndex([e]),n.nodeSelected({data:e,isSelected:!1,isMultiple:!1})),!s)return;if(!s.isAllowAppendIn(e))return void n.lf.emit("group:not-allowed",{group:s.getData(),node:e});s.addChild(e.id),n.nodeGroupMap.set(e.id,s.id),s.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),o=null==r?void 0:r.getBounds();if(r&&o){var i=n.getGroup(o,e);if(n.activeGroup&&n.activeGroup.setAllowAppendChild(!1),!i||r.isGroup&&i.id===e.id)return;if(!i.isAllowAppendIn(e))return;n.activeGroup=i,n.activeGroup.setAllowAppendChild(!0)}},this.findNodeAndChildMaxZIndex=function(t){var e=AS;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 o=n.findNodeAndChildMaxZIndex(r);e=Math.max(o,e)}})),e},this.checkAndCorrectTopGroupZIndex=function(t){var e=AS;if(t.forEach((function(t){var r=n.lf.getNodeModelById(t.id);if(r){var o=n.findNodeAndChildMaxZIndex(r);o>e&&(e=o)}})),!(n.topGroupZIndex>=e)){for(var r=n.lf.graphModel.nodes.filter((function(t){return t.isGroup})),o=n.topGroupZIndex,i=0;i<r.length;i++){var a=r[i];a.zIndex>o&&(o=a.zIndex)}n.topGroupZIndex=o}},this.nodeSelected=function(t){var e=t.data,r=t.isMultiple,o=t.isSelected,i=n.lf.getNodeModelById(e.id);if(n.toFrontGroup(i),n.topGroupZIndex>-1e3){n.topGroupZIndex=AS;for(var a=n.lf.graphModel.nodes.filter((function(t){return t.isGroup})).sort((function(t,e){return t.zIndex-e.zIndex})),s=0,u=0;u<a.length;u++){var l=a[u];l.zIndex!==s&&(n.topGroupZIndex++,s=l.zIndex),l.setZIndex(n.topGroupZIndex)}}if(r&&o)if(null==i?void 0:i.isGroup)i.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 p=n.lf.getNodeModelById(c);(null==p?void 0:p.isSelected)&&(null==i||i.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(SS),this.lf=e,e.graphModel.addNodeMoveRules((function(t,r,o){if(t.isGroup){var i=n.getNodeAllChild(t);return e.graphModel.moveNodes(i,r,o,!0),!0}var a=e.getNodeModelById(n.nodeGroupMap.get(t.id));if(a&&a.isRestrict){var s=t.getBounds(),u=s.x1,l=s.y1,c=s.x2,p=s.y2;return a.isAllowMoveTo({x1:u+r,y1:l+o,x2:c+r,y2:p+o})}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 o=t.nodes,i=t.edges,a={},s={nodes:[],edges:[]},u=[];return eh(o,(function(t){var o=t.id,i=t.children,l=y(t,["children"]),c=e.addNode(l);if(!c)return{nodes:[],edges:[]};o&&(a[o]=c.id),s.nodes.push(c);var p=n.createAllChildNodes(a,i,c,r).edgesArray;u.push.apply(u,m([],g(p),!1))})),u.forEach((function(t){n.createEdgeModel(t,a,r)})),eh(i,(function(t){var e=n.createEdgeModel(t,a,0);s.edges.push(e)})),s}}return t.prototype.createAllChildNodes=function(t,e,n,r){var o=this,i=this.lf,a=[],s=[],u=[];null==e||e.forEach((function(e){var l=i.getNodeModelById(e);if(l){var c=l.x,p=l.y,d=l.properties,h=l.type,y=l.text,v=l.rotate,_=l.children,b=lm.NODE_GROUP_COPY||"node:group-copy-add",x=i.addNode({x:c+r,y:p+r,properties:d,type:h,text:f(f({},y),{x:y.x+r,y:y.y+r}),rotate:v},b);if(n.addChild(x.id),t[e]=x.id,u.push(x),l.incoming.edges.forEach((function(t){s.push(t)})),l.outgoing.edges.forEach((function(t){s.push(t)})),_ instanceof Set){var E=o.createAllChildNodes(t,_,x,r),w=E.nodesArray,O=E.edgesArray;u.push.apply(u,m([],g(w),!1)),a.push.apply(a,m([],g(O),!1))}}}));var l=s.filter((function(e){return t[e.sourceNodeId]&&t[e.targetNodeId]})).map((function(t){return t.getData()}));return{nodesArray:u,edgesArray:a.concat(l)}},t.prototype.createEdgeModel=function(t,e,n){var r=this.lf,o=t.sourceNodeId,i=t.targetNodeId;e[o]&&(o=e[o]),e[i]&&(i=e[i]);var a=t.type,s=t.startPoint,u=t.endPoint,l=t.pointsList,c=t.text,p={x:((null==s?void 0:s.x)||0)+n,y:((null==s?void 0:s.y)||0)+n},d={x:((null==u?void 0:u.x)||0)+n,y:((null==u?void 0:u.y)||0)+n},h=[];l&&l.length>0&&(h=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:p,endPoint:d,sourceNodeId:o,targetNodeId:i,pointsList:h,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],o=n.length-2;o>=0;o--)n[o].zIndex>r.zIndex&&(r=n[o]);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 NS(){var t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getFoldIcon=function(){var t=this.props.model,e=t,n=e.x,r=e.y,o=e.width,i=e.height,a=e.properties,s=e.foldable,u=t.x-t.width/2+5,l=t.y-t.height/2+5;if(!s)return null;var c=ar("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:a.isFolded?"M ".concat(u+3,",").concat(l+6," ").concat(u+11,",").concat(l+6," M").concat(u+7,",").concat(l+2," ").concat(u+7,",").concat(l+10):"M ".concat(u+3,",").concat(l+6," ").concat(u+11,",").concat(l+6," ")});return ar("g",{},[ar("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#F4F5F6",stroke:"#CECECE",cursor:"pointer",x:n-o/2+5,y:r-i/2+5,onClick:function(e){var n,r;null===(r=(n=e.stopPropagation()(t)).foldGroup)||void 0===r||r.call(n,!a.isFolded)}}),c])},e.prototype.getResizeShape=function(){var t=this.props.model,e=t.x,n=t.y,r=t.width,o=t.height,i=t.getNodeStyle(),a=f(f({},i),{x:e-r/2,y:n-o/2,width:r,height:o,stroke:"black",strokeWidth:2,strokeDasharray:"0 0"});return ar("g",{},[ar("rect",f({},a)),this.getFoldIcon()])},e}(MS),e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(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}(OS);return{type:"bpmn:subProcess",view:t,model:e}}function TS(t){var e=sS("bpmn:serviceTask",QM),n=sS("bpmn:userTask",tS);t.register(e),t.register(n),t.register(NS()),function(t){function e(t,e){var n=t.x,r=t.y,o=t.width,i=t.height,a=t.id,s=n-o/2,u=n+o/2,l=r-i/2,c=r+i/2,p=e.x,d=e.y;return p>s-5&&p<u+5&&d>l-5&&d<c+5&&!(p>s+5&&p<u-5&&d>l+5&&d<c-5)?a:null}t.on("node:drag,node:dnd-drag",(function(n){var r,o,i=n.data;if("bpmn:boundaryEvent"===i.type){var a=t.graphModel.nodes;try{for(var s=v(a),u=s.next();!u.done;u=s.next()){var l=u.value;l.isTaskNode&&(e(l,i)?l.setTouching(!0):l.setTouching(!1))}}catch(t){r={error:t}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}}})),t.on("node:drop,node:dnd-add",(function(n){var r,o,i=n.data,a=i.type,s=i.id;if("bpmn:boundaryEvent"===a){var u=t.graphModel.nodes;try{for(var l=v(u),c=l.next();!c.done;c=l.next()){var p,d=c.value;if(d.isTaskNode)if(null!==(p=e(d,i))){var h=t.graphModel.getNodeModelById(s),f=t.graphModel.getNodeModelById(p),y=h.properties.attachedToRef;return y&&y!==p&&t.graphModel.getNodeModelById(y).deleteBoundaryEvent(s),void f.addBoundaryEvent(s)}}}catch(t){r={error:t}}finally{try{c&&!c.done&&(o=l.return)&&o.call(l)}finally{if(r)throw r.error}}}})),t.graphModel.addNodeMoveRules((function(e,n,r){if(e.isTaskNode){var o=e.boundaryEvents;return t.graphModel.moveNodes(o,n,r,!0),!0}return!0}))}(t)}function DS(t){var e=function(e){function n(n,r){n.id||(n.id="Flow_".concat(XM()));var o=f(f(f({},t||{}),n.properties),{isDefaultFlow:!1});return n.properties=o,e.call(this,n,r)||this}return h(n,e),n.extendKey="SequenceFlowModel",n}(Ib),n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getStartArrow=function(){return ar("path",this.props.model.properties.isDefaultFlow?{refX:15,stroke:"#000000",strokeWidth:2,d:"M 20 5 10 -5 z"}:{d:""})},e.extendKey="SequenceFlowEdge",e}(eO);return{type:"bpmn:sequenceFlow",view:n,model:e}}var jS=DS();var CS=[{nodes:["startEvent","intermediateCatchEvent","boundaryEvent"],definition:[{type:"bpmn:timerEventDefinition",icon:KM,properties:{definitionType:"bpmn:timerEventDefinition",timerValue:"",timerType:""}}]}];function IS(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 kS=function(){function t(t){var e=t.lf;e.definition={},e.useDefinition=IS(e.definition);var n=g(e.useDefinition(),2),r=n[0],o=n[1];console.log("_definition",r),o(CS),function(t){t.register(UM(t)),t.register(WM(t)),t.register(FM(t)),t.register(VM(t)),t.register(YM(t))}(e),function(t){var e=iS("bpmn:exclusiveGateway",ZM),n=iS("bpmn:parallelGateway",JM),r=iS("bpmn:inclusiveGateway",$M);t.register(e),t.register(r),t.register(n)}(e),function(t){t.register(jS)}(e),TS(e),e.setDefaultEdgeType("bpmn:sequenceFlow")}return t.pluginName="BpmnElementsPlugin",t}(),RS=40,LS=40,BS=40,zS=40,HS=100,XS=80,GS=100,WS=80,FS=100,US=80,YS=100,VS=80,KS=100,qS=80,ZS=100,JS=80,$S=100,QS=80,tA=100,eA=80,nA=function(){};(nA.ObjTree=function(){return this}).VERSION="0.23",nA.ObjTree.prototype.xmlDecl='<?xml version="1.0" encoding="UTF-8" ?>\n',nA.ObjTree.prototype.attr_prefix="-",nA.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)},nA.ObjTree.prototype.parseHTTP=function(t,e,n){var r,o={};for(var i in e)o[i]=e[i];if(o.method||(void 0===o.postBody&&void 0===o.postbody&&void 0===o.parameters?o.method="get":o.method="post"),n){o.asynchronous=!0;var a=this,s=n,u=o.onComplete;o.onComplete=function(t){var e;t&&t.responseXML&&t.responseXML.documentElement&&(e=a.parseDOM(t.responseXML.documentElement)),s(e,t),u&&u(t)}}else o.asynchronous=!1;if("undefined"!=typeof HTTP&&HTTP.Request)o.uri=t,(l=new HTTP.Request(o))&&(r=l.transport);else if("undefined"!=typeof Ajax&&Ajax.Request){var l;(l=new Ajax.Request(t,o))&&(r=l.transport)}return n?r:r&&r.responseXML&&r.responseXML.documentElement?this.parseDOM(r.responseXML.documentElement):void 0},nA.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}},nA.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(s=t.attributes[r].nodeName)){var o=t.attributes[r].nodeValue;try{o=JSON.parse(t.attributes[r].nodeValue.replace(/'/g,'"'))}catch(e){o=t.attributes[r].nodeValue}null!=o&&(void 0===n[s=this.attr_prefix+s]&&(n[s]=0),n[s]++,this.addNode(e,s,n[s],o))}}}if(t.childNodes&&t.childNodes.length){var i=!0;e&&(i=!1);for(r=0;r<t.childNodes.length&&i;r++){var a=t.childNodes[r].nodeType;3!==a&&4!==a&&8!==a&&(i=!1)}if(i){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 s;if("string"==typeof(s=t.childNodes[r].nodeName))(o=this.parseElement(t.childNodes[r]))&&(void 0===n[s]&&(n[s]=0),n[s]++,this.addNode(e,s,n[s],o))}}}else null===e&&(e={});return e}},nA.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},nA.ObjTree.prototype.writeXML=function(t){var e=this.hash_to_xml(null,t);return this.xmlDecl+e},nA.ObjTree.prototype.hash_to_xml=function(t,e){var n=[],r=[];for(var o in e)if(Yh(e,o)){var i=e[o];o.charAt(0)!==this.attr_prefix?void 0===i||null==i?n[n.length]="<".concat(o," />"):"object"==typeof i&&i.constructor===Array?n[n.length]=this.array_to_xml(o,i):n[n.length]="object"==typeof i?this.hash_to_xml(o,i):this.scalar_to_xml(o,i):r[r.length]=" ".concat(o.substring(1),'="').concat(this.xml_escape(i),'"')}var a=r.join(""),s=n.join("");return void 0===t||null==t||(s=n.length>0?s.match(/\n/)?"<".concat(t).concat(a,">\n").concat(s,"</").concat(t,">\n"):"<".concat(t).concat(a,">").concat(s,"</").concat(t,">\n"):"<".concat(t).concat(a," />\n")),s},nA.ObjTree.prototype.array_to_xml=function(t,e){for(var n=[],r=0;r<e.length;r++){var o=e[r];void 0===o||null==o?n[n.length]="<".concat(t," />"):"object"==typeof o&&o.constructor===Array?n[n.length]=this.array_to_xml(t,o):n[n.length]="object"==typeof o?this.hash_to_xml(t,o):this.scalar_to_xml(t,o)}return n.join("")},nA.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")},nA.ObjTree.prototype.xml_escape=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"')};function rA(t){return Object.prototype.toString.call(t)}function oA(t){return" ".repeat(t)}function iA(t){return"[object Object]"===rA(t)?Object.keys(t).reduce((function(e,n){var r=n;return"-"===n.charAt(0)&&(r=n.substring(1)),e[r]=iA(t[n]),e}),{}):Array.isArray(t)?t.map((function(t){return iA(t)})):t}var aA,sA="\t\n";function uA(t,e,n){var r=oA(n),o="",i=sA+r;if("-json"===e)return"";if("#text"===e)return i+t;if("#cdata-section"===e)return"".concat(i,"<![CDATA[").concat(t,"]]>");if("#comment"===e)return"".concat(i,"\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(iA(t)).replace(/"/g,"'")}return e}(t),'"');if(Array.isArray(t))o+=t.map((function(t){return uA(t,e,n+1)})).join("");else if("[object Object]"===rA(t)){var a=Object.keys(t),s="",u=t["-json"]?sA+oA(n+1)+t["-json"]:"";o+="".concat(0===n?"":i,"<").concat(e),a.forEach((function(e){"-"===e.charAt(0)?s+=uA(t[e],e,n+1):u+=uA(t[e],e,n+1)})),o+=s+(""!==u?">".concat(u).concat(i,"</").concat(e,">"):" />")}else o+="".concat(i,"<").concat(e,">").concat(t.toString(),"</").concat(e,">");return o}!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"}(aA||(aA={}));var lA=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef","-children"],cA=["properties","startPoint","endPoint","pointsList"],pA={in:[],out:["properties.panels","properties.nodeSize","properties.definitionId","properties.timerValue","properties.timerType","properties.definitionType","properties.parent","properties.isBoundaryEventTouchingTask"]},dA=function(t,e){return Object.keys(e||{}).forEach((function(n){if(t[n]){var r=e[n],o=r.in,i=r.out;o&&(t[n].in=o),i&&(t[n].out=i)}else t[n]=e[n]})),t},hA={"bpmn:startEvent":{out:function(t){var e,n,r=t.properties;return(null===(n=null===(e=hA[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=hA[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=hA[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=hA[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,o=e.definitionId;return{json:'<bpmn:timerEventDefinition id="'.concat(o,'"').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,o,i=t,a=e["-id"],s="",u="";try{for(var l=v(Object.keys(e)),c=l.next();!c.done;c=l.next()){var p=c.value;p.includes("bpmn:")&&(s=g(p.split(":"),2)[1],u=null===(o=e[p])||void 0===o?void 0:o["#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":i,"-timerType":s,"-timerValue":u}}},"bpmn:conditionExpression":{in:function(t,e){var n,r="",o="";return e["#cdata-section"]?(o="cdata",r=(null===(n=/^\$\{(.*)\}$/g.exec(e["#cdata-section"]))||void 0===n?void 0:n[1])||""):e["#text"]&&(o="normal",r=e["#text"]),{"-condition":r,"-expressionType":o}}}};function fA(t){var e=null!=t?t:{},n=e.retainedAttrsFields,r=e.excludeFields,o=e.transformer,i=new Set(m(m([],g(cA),!1),g(n||[]),!1)),a={in:new Set(m(m([],g(pA.in),!1),g((null==r?void 0:r.in)||[]),!1)),out:new Set(m(m([],g(pA.out),!1),g((null==r?void 0:r.out)||[]),!1))};return hA=dA(hA,o),function(t){var e=t.nodes,n=t.edges;return function t(r,o){var s,u;if(1!==(null==r?void 0:r.flag)){var l;if((l=hA[r.type])&&l.out){var c=l.out(r),p=Object.keys(c);p.length>0&&p.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 d={};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 h=v(Object.entries(r)),f=h.next();!f.done;f=h.next()){var y=g(f.value,2),m=y[0],_=y[1];if(1===(null==_?void 0:_.flag))return;var b=[o,m].filter((function(t){return t})).join(".");a.out.has(b)||("object"!=typeof _?0===m.indexOf("-")||["#text","#cdata-section","#comment"].includes(m)?d[m]=_:d["-".concat(m)]=_:i.has(b)?d["-".concat(m)]=t(_,b):d[m]=t(_,b))}}catch(t){s={error:t}}finally{try{f&&!f.done&&(u=h.return)&&u.call(h)}finally{if(s)throw s.error}}return d}}(t,"")}}function yA(t){var e,n,r={};try{for(var o=v(Object.entries(t)),i=o.next();!i.done;i=o.next()){var a=g(i.value,2),s=a[0],u=a[1];0===s.indexOf("-")?r[s.substring(1)]=iA(u):"string"==typeof u?r[s]=u:"[object Object]"===Object.prototype.toString.call(u)?r[s]=yA(u):Array.isArray(u)?r[s]=u.map((function(t){return yA(t)})):r[s]=u}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return r}function vA(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}})),o={"-id":"".concat(n,"_di"),"-bpmnElement":n,"di:waypoint":r};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(o["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}}),o})),t["bpmndi:BPMNShape"]=e.nodes.map((function(t){var e,n=t.id,r=100,o=80,i=t.x,a=t.y,s=xA.shapeConfigMap.get(t.type);s&&(r=s.width,o=s.height),i-=r/2,a-=o/2;var u={"-id":"".concat(n,"_di"),"-bpmnElement":n,"dc:Bounds":{"-x":i,"-y":a,"-width":r,"-height":o}};return(null===(e=t.text)||void 0===e?void 0:e.value)&&(u["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}}),u}))}var gA=["bpmn:incoming","bpmn:outgoing"];function mA(t,e){var n=[],r=[],o=new Map,i=null!=e?e:{},a=i.transformer,s=i.excludeFields,u={in:new Set(m(m([],g(pA.in),!1),g((null==s?void 0:s.in)||[]),!1)),out:new Set(m(m([],g(pA.out),!1),g((null==s?void 0:s.out)||[]),!1))};hA=dA(hA,a);var l,c,p=t["bpmn:definitions"];if(p){var d=p["bpmn:process"];l=d,c=[function(t){function e(t){t["-children"]||(t["-children"]=[]),Object.keys(t).forEach((function(e){var n;0!==e.indexOf("bpmn:")||gA.includes(e)||(d[e]||(d[e]=[]),!Array.isArray(d[e])&&(d[e]=[d[e]]),Array.isArray(t[e])?(n=d[e]).push.apply(n,m([],g(t[e]),!1)):d[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=d[t];Array.isArray(n)?n.forEach((function(n){"bpmn:subProcess"===t&&e(n)})):e(n)}},function(t){function e(t){var n;o.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,o;if(t.includes("bpmn:")){var i={};hA[t]&&hA[t].in?(i=null===(o=(r=hA[t]).in)||void 0===o?void 0:o.call(r,t,Zi.cloneDeep(n[t])),delete n[t]):e(n[t]);var a=void 0;(a=Reflect.ownKeys(i)).length>0&&a.forEach((function(t){Reflect.set(n,t,i[t])}))}})))}e(d[t])},function(t){if(0===t.indexOf("bpmn:")){var e=d[t];if("bpmn:sequenceFlow"===t){var i=p["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(bA(r,t))}));else{var r=void 0;r=Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n.push(bA(r,t))}return n}(e,i)}else{var a=p["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];if("bpmn:boundaryEvent"===t){var s=d[t],u=function(t){var e=t["-attachedToRef"],n=o.get(e);n["-boundaryEvents"]||(n["-boundaryEvents"]=[]),n["-boundaryEvents"].push(t["-id"])};Array.isArray(s)?s.forEach((function(t){u(t)})):u(s)}n=n.concat(function(t,e,n){var r=[];if(Array.isArray(t))t.forEach((function(t){var o=_A(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);r.push(o)}));else{var o=_A(Array.isArray(e)?e.find((function(e){return e["-bpmnElement"]===t["-id"]})):e,n,t);r.push(o)}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 h=function(t,e,n){Object.keys(t).forEach((function(r){var o=n?"".concat(n,".").concat(r):r;e.has(o)?delete t[r]:"object"==typeof t[r]&&h(t[r],e,o)}))};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 o=null===(r=null==e?void 0:e.mapping)||void 0===r?void 0:r.in,i=t.type;o[i]&&(t.type=o[i])}h(t,u.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 o=null===(r=null==e?void 0:e.mapping)||void 0===r?void 0:r.in,i=t.type;o[i]&&(t.type=o[i])}h(t,u.in,"")})),{nodes:n,edges:r}}function _A(t,e,n){var r=Number(t["dc:Bounds"]["-x"]),o=Number(t["dc:Bounds"]["-y"]),i=n["-children"],a=n["-name"],s=xA.shapeConfigMap.get(e);s&&(r+=s.width/2,o+=s.height/2);var u,l={};if(Object.entries(n).forEach((function(t){var e=g(t,2),n=e[0],r=e[1];lA.includes(n)||(l[n]=r)})),l=yA(l),a&&(u={x:r,y:o,value:a},t["bpmndi:BPMNLabel"]&&t["bpmndi:BPMNLabel"]["dc:Bounds"])){var c=t["bpmndi:BPMNLabel"]["dc:Bounds"];u.x=Number(c["-x"])+Number(c["-width"])/2,u.y=Number(c["-y"])+Number(c["-height"])/2}var p={id:t["-bpmnElement"],type:e,x:r,y:o,properties:l};return i&&(p.children=i),u&&(p.text=u),p}function bA(t,e){var n,r=e["-name"];if(r){var o=t["bpmndi:BPMNLabel"]["dc:Bounds"],i=0;r.split("\n").forEach((function(t){i<t.length&&(i=t.length)})),n={value:r,x:Number(o["-x"])+10*i/2,y:Number(o["-y"])+7}}var a={};Object.entries(e).forEach((function(t){var e=g(t,2),n=e[0],r=e[1];lA.includes(n)||(a[n]=r)})),a=yA(a);var s=t["di:waypoint"].map((function(t){return{x:Number(t["-x"]),y:Number(t["-y"])}})),u={id:e["-id"],type:aA.FLOW,pointsList:s,sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:a};return n&&(u.text=n),u}var xA=function(){function t(t){var e=t.lf,n=this;this.adapterOut=function(t,e){var r,o,i=f({},n.processAttributes);!function(t,e,n){var r,o=new Map,i=fA(n)(e);i.nodes.forEach((function(e){var n=e["-id"],r=e["-type"],i=e.text,a=e.children,s=y(e,["-id","-type","text","children"]),u={"-id":n};(null==i?void 0:i["-value"])&&(u["-name"]=i["-value"]),s["-json"]&&(u["-json"]=s["-json"]),s["-properties"]&&Object.assign(u,s["-properties"]),a&&(u.children=a),t[r]||(t[r]=[]),t[r].push(u),o.set(n,u)}));var a=i.edges.map((function(t){var e=t["-id"],n=t["-sourceNodeId"],r=t["-targetNodeId"],i=t.text,a=y(t,["-id","-sourceNodeId","-targetNodeId","text"]),s=o.get(r);s["bpmn:incoming"]||(s["bpmn:incoming"]=[]),s["bpmn:incoming"].push(e);var u={"-id":e,"-sourceRef":n,"-targetRef":r};return(null==i?void 0:i["-value"])&&(u["-name"]=i["-value"]),a["-json"]&&(u["-json"]=a["-json"]),a["-properties"]&&Object.assign(u,a["-properties"]),u}));e.edges.forEach((function(t){var e=t.sourceNodeId,n=t.id,r=o.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 i,a=o.get(r["-id"]);["bpmn:incoming","bpmn:outgoing"].forEach((function(t){a[t]&&a[t].forEach((function(e){n[t].add(e)}))}));var s=null===(i=t[r["-type"]])||void 0===i?void 0:i.findIndex((function(t){return t["-id"]===r["-id"]}));s>=0&&t[r["-type"]].splice(s,1),o.delete(r["-id"]),e[r["-type"]]||(e[r["-type"]]=[]),e[r["-type"]].push(a)}));var i=n["bpmn:incoming"];n["bpmn:outgoing"].forEach((function(t){i.has(t)&&r.push(t)}));for(var s,u=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++,s=t},l=0;l<r.length;)u(l),l=s;delete e.children})),t[aA.FLOW]=a}(i,t,e);var a={"-id":"BPMNPlane_1","-bpmnElement":i["-id"]};vA(a,t);var s=n.definitionAttributes;s["bpmn:process"]=i,s["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":a};var u={"bpmn:definitions":s};if(null===(r=null==e?void 0:e.mapping)||void 0===r?void 0:r.out){var l=null===(o=null==e?void 0:e.mapping)||void 0===o?void 0:o.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]=Zi.cloneDeep(t[e]),delete t[e],c(t[n])):c(t[e])}))};c(u)}return u},this.adapterIn=function(t,e){if(t)return mA(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}();xA.shapeConfigMap.set(aA.START,{width:RS,height:LS}),xA.shapeConfigMap.set(aA.END,{width:BS,height:zS}),xA.shapeConfigMap.set(aA.INTERMEDIATE_CATCH,{width:GS,height:WS}),xA.shapeConfigMap.set(aA.INTERMEDIATE_THROW,{width:GS,height:WS}),xA.shapeConfigMap.set(aA.BOUNDARY,{width:HS,height:XS}),xA.shapeConfigMap.set(aA.PARALLEL_GATEWAY,{width:FS,height:US}),xA.shapeConfigMap.set(aA.INCLUSIVE_GATEWAY,{width:YS,height:VS}),xA.shapeConfigMap.set(aA.EXCLUSIVE_GATEWAY,{width:KS,height:qS}),xA.shapeConfigMap.set(aA.SYSTEM,{width:ZS,height:JS}),xA.shapeConfigMap.set(aA.USER,{width:$S,height:QS}),xA.shapeConfigMap.set(aA.SUBPROCESS,{width:tA,height:eA});var EA,wA=function(t){function e(e){var n=t.call(this,e)||this;n.adapterXmlIn=function(t){var e,r=(e=t,(new nA.ObjTree).parseXML(e));return n.adapterIn(r,n.props)},n.adapterXmlOut=function(t){return function(t){var e="";for(var n in t)e+=uA(t[n],n,0);return e}(n.adapterOut(t,n.props))};var r=e.lf,o=e.props;return r.adapterIn=n.adapterXmlIn,r.adapterOut=n.adapterXmlOut,n.props=o,n}return h(e,t),e.pluginName="BPMNAdapter",e}(xA),OA=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 o=e[r];(o.classList&&Array.from(o.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 o=e[r];(o.classList&&Array.from(o.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],o=0;o<r.cssRules.length;o++)t+=r.cssRules[o].cssText;return this.customCssRules&&(t+=this.customCssRules),t},t.prototype.getCanvasData=function(t,e){var n,r=this,o=t.cloneNode(!0),i=o.lastChild,a=null===(n=null==i?void 0:i.childNodes)||void 0===n?void 0:n.length;if(a)for(var s=0;s<a;s++){var u=null==i?void 0:i.childNodes[s],l=u.classList&&Array.from(u.classList);if(l&&l.indexOf("lf-base")<0)null==i||i.removeChild(i.childNodes[s]),a--,s--;else{var c=null==i?void 0:i.childNodes[s];c&&c.childNodes.forEach((function(t){var e=t;r.removeAnchor(e.firstChild),r.removeRotateControl(e.firstChild)}))}}var p=window.devicePixelRatio||1;p<1&&(p=1);var d=document.createElement("canvas"),h=this.lf.graphModel.rootEl.querySelector(".lf-base").getBoundingClientRect(),f=this.lf.container.querySelector(".lf-canvas-overlay").getBoundingClientRect(),y=h.x-f.x,v=h.y-f.y,g=this.lf.graphModel.transformModel,m=g.SCALE_X,_=g.SCALE_Y,b=g.TRANSLATE_X,x=g.TRANSLATE_Y;o.lastChild.style.transform="matrix(1, 0, 0, 1, ".concat((-y+b)*(1/m)+10,", ").concat((-v+x)*(1/_)+10,")");var E=Math.ceil(h.width/m),w=Math.ceil(h.height/_);d.style.width="".concat(E,"px"),d.style.height="".concat(w,"px"),d.width=E*p+80,d.height=w*p+80;var O=d.getContext("2d");O&&(O.clearRect(0,0,d.width,d.height),O.scale(p,p),e?(O.fillStyle=e,O.fillRect(0,0,E*p+80,w*p+80)):O.clearRect(0,0,E,w));var M=new Image,S=document.createElement("style");S.innerHTML=this.getClassRules();var A=document.createElement("foreignObject");return A.appendChild(S),o.appendChild(A),new Promise((function(t){M.onload=function(){var e=navigator.userAgent.indexOf("Firefox")>-1;try{e?createImageBitmap(M,{resizeWidth:d.width,resizeHeight:d.height}).then((function(e){null==O||O.drawImage(e,0,0),t(d)})):(null==O||O.drawImage(M,0,0),t(d))}catch(e){null==O||O.drawImage(M,0,0),t(d)}};var e="data:image/svg+xml;charset=utf-8,".concat((new XMLSerializer).serializeToString(o)).replace(/\n/g,"").replace(/\t/g,"").replace(/#/g,"%23");M.src=e}))},t.pluginName="snapshot",t}(),MA={SEQUENCE_FLOW:1,START_EVENT:2,END_EVENT:3,USER_TASK:4,EXCLUSIVE_GATEWAY:6},SA={1:"bpmn:sequenceFlow",2:"bpmn:startEvent",3:"bpmn:endEvent",4:"bpmn:userTask",6:"bpmn:exclusiveGateway"};function AA(t){switch(t){case"bpmn:sequenceFlow":return MA.SEQUENCE_FLOW;case"bpmn:startEvent":return MA.START_EVENT;case"bpmn:endEvent":return MA.END_EVENT;case"bpmn:userTask":return MA.USER_TASK;case"bpmn:exclusiveGateway":return MA.EXCLUSIVE_GATEWAY;default:return t}}!function(t){t.HORIZONTAL="horizontal",t.VERTICAL="vertical"}(EA||(EA={}));var PA=function(t,e,n,r){return void 0===r&&(r=0),DA(t,e,n)<=r};function NA(t){return t*t}function TA(t,e){return NA(t.x-e.x)+NA(t.y-e.y)}var DA=function(t,e,n){return Math.sqrt(function(t,e,n){var r=TA(e,n);if(0===r)return TA(t,e);var o=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/r;return o=Math.max(0,Math.min(1,o)),TA(t,{x:e.x+o*(n.x-e.x),y:e.y+o*(n.y-e.y)})}(t,e,n))},jA=function(t,e,n){var r=function(t){var e=t.x,n=t.y,r=t.width,o=t.height;return{minX:e-r/2,minY:n-o/2,maxX:e+r/2,maxY:n+o/2,x:e,y:n,width:r,height:o,centerX:e,centerY:n}}(t),o=function(t,e){var n;return t.x===e.x?n=EA.VERTICAL:t.y===e.y&&(n=EA.HORIZONTAL),n}(e,n),i=Math.max(e.x,n.x),a=Math.min(e.x,n.x),s=Math.max(e.y,n.y),u=Math.min(e.y,n.y),l=t.x,c=t.y,p=t.width,d=t.height;if(o===EA.HORIZONTAL){if(i>=r.maxX&&a<=r.minX)return{startCrossPoint:{x:e.x>n.x?l+p/2:l-p/2,y:e.y},endCrossPoint:{x:e.x>n.x?l-p/2:l+p/2,y:e.y}}}else if(o===EA.VERTICAL&&s>=r.maxY&&u<=r.minY)return{startCrossPoint:{x:e.x,y:e.y>n.y?c+d/2:c-d/2},endCrossPoint:{x:e.x,y:e.y>n.y?c-d/2:c+d/2}}},CA=function(t,e,n){void 0===n&&(n=0);for(var r=t.x,o=t.y,i=e.pointsList,a=0;a<i.length-1;a++)if(PA({x:r,y:o},i[a],i[a+1],n)){var s=jA(t,i[a],i[a+1]);if(s)return{crossIndex:a+1,crossPoints:s}}return{crossIndex:-1,crossPoints:{startCrossPoint:{x:0,y:0},endCrossPoint:{x:0,y:0}}}},IA=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,o=n.id,i=!0,a=0;a<r.length;a++)if(r[a].sourceNodeId===o||r[a].targetNodeId===o){i=!1;break}i&&t.insetNode(n)}))},t.prototype.checkRuleBeforeInsetNode=function(t,e,n,r,o){var i=this._lf.getNodeModelById(t),a=this._lf.getNodeModelById(e),s=i.getAnchorInfo(n),u=a.getAnchorInfo(r),l=i.isAllowConnectedAsSource(o,s,u),c=a.isAllowConnectedAsTarget(o,s,u),p=R_(l),d=p.isAllPass,h=p.msg,f=R_(c),y=f.isAllPass;return{isPass:d&&y,sourceMsg:h,targetMsg:f.msg}},t.prototype.insetNode=function(t){var e=this,n=this._lf.graphModel.edges,r=this._lf.getNodeModelById(t.id),o=null==r?void 0:r.getDefaultAnchor();if(!o||0===o.length)this._lf.graphModel.eventCenter.emit(lm.CONNECTION_NOT_ALLOWED,{data:t,msg:"自定义类型节点不显示锚点,也不允许其他节点连接到此节点"});else if(r)for(var i=0;i<n.length;i++){var a=CA(r,n[i],this.deviation),s=a.crossIndex,u=a.crossPoints;if(s>=0){var l=n[i],c=l.sourceNodeId,p=l.targetNodeId,d=l.id,h=l.type,f=l.pointsList,y=l.sourceAnchorId,v=l.targetAnchorId,_=mp(f[0]),b=mp(u.startCrossPoint);this._lf.deleteEdge(d);var x=this.checkRuleBeforeInsetNode(c,p,y,v,t);if(this._lf.addEdge({type:h,sourceNodeId:c,targetNodeId:t.id,startPoint:_,endPoint:b,pointsList:m(m([],g(f.slice(0,s)),!1),[u.startCrossPoint],!1)}),this._lf.addEdge({type:h,sourceNodeId:t.id,targetNodeId:p,startPoint:mp(u.endCrossPoint),endPoint:mp(f[f.length-1]),pointsList:m([u.endCrossPoint],g(f.slice(s)),!1)}),x.isPass)break;this._lf.graphModel.eventCenter.emit(lm.CONNECTION_NOT_ALLOWED,{data:t,msg:x.targetMsg||x.sourceMsg}),setTimeout((function(){e._lf.undo()}),200);break}}},t.pluginName="insertNodeInPolyline",t}(),kA=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"),o=[];return r.className="lf-control",this.controlItems.forEach((function(r){var i=document.createElement("div"),a=document.createElement("i"),s=document.createElement("span");switch(i.className=n,r.onClick&&(i.onclick=r.onClick.bind(null,t.lf)),r.onMouseEnter&&(i.onmouseenter=r.onMouseEnter.bind(null,t.lf)),r.onMouseLeave&&(i.onmouseleave=r.onMouseLeave.bind(null,t.lf)),a.className=r.iconClass,s.className="lf-control-text",s.title=r.title,s.innerText=r.text,i.append(a,s),r.text){case"上一步":t.lf.on("history:change",(function(t){var r=t.data.undoAble;i.className=r?e:n}));break;case"下一步":t.lf.on("history:change",(function(t){var r=t.data.redoAble;i.className=r?e:n}));break;default:i.className=e}o.push(i)})),r.append.apply(r,m([],g(o),!1)),r},t.pluginName="control",t}(),RA="lf:defaultNodeMenu",LA="lf:defaultEdgeMenu",BA="lf:defaultGraphMenu",zA="lf:defaultSelectionMenu",HA=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,o=this,i=[{text:"删除",callback:function(t){o.lf.deleteNode(t.id)}},{text:"编辑文本",callback:function(t){o.lf.graphModel.editText(t.id)}},{text:"复制",callback:function(t){o.lf.cloneNode(t.id)}}];null===(t=this.menuTypeMap)||void 0===t||t.set(RA,i);var a=[{text:"删除",callback:function(t){o.lf.deleteEdge(t.id)}},{text:"编辑文本",callback:function(t){o.lf.graphModel.editText(t.id)}}];null===(e=this.menuTypeMap)||void 0===e||e.set(LA,a),null===(n=this.menuTypeMap)||void 0===n||n.set(BA,[]);var s=[{text:"删除",callback:function(t){o.lf.clearSelectElements(),t.edges.forEach((function(t){return o.lf.deleteEdge(t.id)})),t.nodes.forEach((function(t){return o.lf.deleteNode(t.id)}))}}];null===(r=this.menuTypeMap)||void 0===r||r.set(zA,s)},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,o=t.data,i=t.position,a=t.e,s=i.domOverlayPosition,u=s.x,l=s.y,c=o.id,p=n.lf.graphModel.getNodeModelById(c);if(p){var d=[],h=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(p.type);d=p&&p.menu&&Array.isArray(p.menu)?p.menu:h||(null===(r=n.menuTypeMap)||void 0===r?void 0:r.get(RA)),n.__currentData=o,n.showMenu(u,l,d,{width:p.width,height:p.height,clientX:a.clientX,clientY:a.clientY})}})),this.lf.on("edge:contextmenu",(function(t){var e,r,o,i,a=t.data,s=t.position,u=t.e,l=s.domOverlayPosition,c=l.x,p=l.y,d=a.id,h=n.lf.graphModel.getEdgeModelById(d);if(h){var f=[],y=null!==(r=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(h.type))&&void 0!==r?r:[];f=h&&h.menu&&Array.isArray(h.menu)?h.menu:y||(null!==(i=null===(o=n.menuTypeMap)||void 0===o?void 0:o.get(LA))&&void 0!==i?i:[]),n.__currentData=a,n.showMenu(c,p,f,{width:h.width,height:h.height,clientX:u.clientX,clientY:u.clientY})}})),this.lf.on("blank:contextmenu",(function(t){var e,r,o=t.position,i=null!==(r=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(BA))&&void 0!==r?r:[],a=o.domOverlayPosition,s=a.x,u=a.y;n.showMenu(s,u,i)})),this.lf.on("selection:contextmenu",(function(t){var e,r=t.data,o=t.position,i=null===(e=n.menuTypeMap)||void 0===e?void 0:e.get(zA),a=o.domOverlayPosition,s=a.x,u=a.y;n.__currentData=r,n.showMenu(s,u,i)})),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 o=this.__menuDOM;if(o){if(o.innerHTML="",o.append.apply(o,m([],g(this.__getMenuDom(n)),!1)),!o.children.length)return;if(o.style.display="block",!r)return o.style.top="".concat(e,"px"),void(o.style.left="".concat(t,"px"));var i=r.width,a=r.height,s=r.clientX,u=r.clientY,l=this.lf.graphModel,c=o.offsetWidth,p=!0,d=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,h=d-s,f=l.rootEl.getBoundingClientRect(),y=f.left+f.width;y<d&&(h=y-s),h<c&&(p=!1),o.style.left="".concat(p?t:t-i,"px");var v=o.offsetHeight,_=!0,b=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,x=b-u,E=f.top+f.height;E<b&&(x=E-u),x<v&&(_=!1),o.style.top="".concat(_?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 o=document.createElement("span");o.className="lf-menu-item-text",t.text&&(o.innerText=t.text),n.appendChild(o),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(RA,t.nodeMenu?t.nodeMenu:[])),void 0!==t.edgeMenu&&(null===(n=this.menuTypeMap)||void 0===n||n.set(LA,t.edgeMenu?t.edgeMenu:[])),void 0!==t.graphMenu&&(null===(r=this.menuTypeMap)||void 0===r||r.set(BA,t.graphMenu?t.graphMenu:[])))},t.prototype.addMenuConfig=function(t){var e,n,r,o,i,a,s,u,l;if(t){if(Array.isArray(t.nodeMenu)){var c=null!==(n=null===(e=this.menuTypeMap)||void 0===e?void 0:e.get(RA))&&void 0!==n?n:[];null===(r=this.menuTypeMap)||void 0===r||r.set(RA,c.concat(t.nodeMenu))}if(Array.isArray(t.edgeMenu)){c=null!==(i=null===(o=this.menuTypeMap)||void 0===o?void 0:o.get(LA))&&void 0!==i?i:[];null===(a=this.menuTypeMap)||void 0===a||a.set(LA,c.concat(t.edgeMenu))}if(Array.isArray(t.graphMenu)){c=null!==(u=null===(s=this.menuTypeMap)||void 0===s?void 0:s.get(BA))&&void 0!==u?u:[];null===(l=this.menuTypeMap)||void 0===l||l.set(BA,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}(),XA="menu-common",GA=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(XA,[]),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(XA,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 o=e.getData();n=Math.max(o.startPoint.x,n),r=Math.min(o.startPoint.y,r),n=Math.max(o.endPoint.x,n),r=Math.min(o.endPoint.y,r),o.pointsList&&o.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=m(m([],g(this.menuTypeMap.get(this._activeData.type)||[]),!1),g(this.menuTypeMap.get(XA)||[]),!1),n=document.createDocumentFragment();e.forEach((function(e){var r=document.createElement("div");r.className="lf-context-item";var o=document.createElement("img");o.src=e.icon,o.className="lf-context-img",e.className&&(r.className="".concat(r.className," ").concat(e.className)),o.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(o),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 o=t.x-r.width+200,i=e-t.y/2-20,a=t.x+r.width+200,s=e+t.y/2+20;if(this.lf.getAreaElement([o,i],[a,s]).length)return e+=100,void this.addNode(t,e);if(t.type){var u=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:u.x-u.width/2,y:u.y}),this.lf.addEdge({sourceNodeId:t.sourceId,targetNodeId:u.id,startPoint:l,endPoint:c})}}},t.prototype.showMenu=function(){var t=this.getContextMenuPosition();if(t){var e=g(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}(),WA=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 o=document.createElement("div");o.innerText=t.label,o.className="lf-dnd-text",n.appendChild(o)}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}(),FA=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,o=e.y;if(n.endPoint={x:r,y:o},n.startPoint){var i=n.startPoint,a=i.x,s=i.y,u=a,l=s,c=r-a,p=o-s;r<a&&(u=r,c=a-r),o<s&&(l=o,p=s-o),n.wrapper&&(n.wrapper.style.left="".concat(u,"px"),n.wrapper.style.top="".concat(l,"px"),n.wrapper.style.width="".concat(c,"px"),n.wrapper.style.height="".concat(p,"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,o=e.y,i=n.endPoint,a=i.x,s=i.y,u=[Math.min(r,a),Math.min(o,s)],l=[Math.max(r,a),Math.max(o,s)];if(n.lf.emit("selection:selected-area",{topLeft:u,bottomRight:l}),Math.abs(a-r)<10&&Math.abs(s-o)<10)return;var c=n.lf.graphModel.getAreaElement(u,l,n.isWholeEdge,n.isWholeNode,!0),p=n.lf.graphModel.group;c.forEach((function(t){p&&p.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 o=r.e;if(t.getEditConfig().stopMoveGraph&&!n.disabled&&!(2===o.button)){var i=t.getPointByClient(o.clientX,o.clientY).domOverlayPosition,a=i.x,s=i.y;n.startPoint={x:a,y:s},n.endPoint={x:a,y:s};var u=document.createElement("div");u.className="lf-selection-select",u.oncontextmenu=function(t){t.preventDefault()},u.style.top="".concat(n.startPoint.y,"px"),u.style.left="".concat(n.startPoint.x,"px"),e.appendChild(u),n.wrapper=u,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}(),UA=function(){function t(t){var e=t.lf,n=t.LogicFlow,r=t.options,o=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){o.container=e,o.lf.on("history:change",(function(){o.isShow&&o.setView()})),o.lf.on("graph:transform",(function(){o.isShow&&o.setView(!1)}))},this.show=function(t,e){o.isShow||(o.createMiniMap(t,e),o.setView()),o.isShow=!0},this.hide=function(){o.isShow&&(o.removeMiniMap(),o.lf.emit("miniMap:close",{})),o.isShow=!1},this.updatePosition=function(t){if("object"==typeof t)void 0===t.left&&void 0===t.right||(o.leftPosition=t.left,o.rightPosition=t.right),void 0===t.top&&void 0===t.bottom||(o.topPosition=t.top,o.bottomPosition=t.bottom);else switch(t){case"left-top":o.leftPosition=0,o.rightPosition=void 0,o.topPosition=0,o.bottomPosition=void 0;break;case"right-top":o.leftPosition=void 0,o.rightPosition=0,o.topPosition=0,o.bottomPosition=void 0;break;case"left-bottom":o.leftPosition=0,o.rightPosition=void 0,o.topPosition=void 0,o.bottomPosition=0;break;case"right-bottom":o.leftPosition=void 0,o.rightPosition=0,o.topPosition=void 0,o.bottomPosition=0}o.updateMiniMapPosition()},this.reset=function(){o.lf.resetTranslate(),o.lf.resetZoom()},this.setShowEdge=function(t){o.showEdge!==t&&(o.showEdge=t,o.setView())},this.startDrag=function(t){document.addEventListener("mousemove",o.drag),document.addEventListener("mouseup",o.drop);var e=t.x,n=t.y;o.startPosition={x:e,y:n}},this.drag=function(t){var e=t.x,n=t.y,r=(e-o.startPosition.x)/o.scale,i=(n-o.startPosition.y)/o.scale,a=o.viewPortLeft+r+o.viewPortWidth/o.scale/2,s=o.viewPortTop+i+o.viewPortHeight/o.scale/2;o.startPosition={x:e,y:n},o.lf.focusOn({coordinate:{x:a,y:s}})},this.drop=function(){document.removeEventListener("mousemove",o.drag),document.removeEventListener("mouseup",o.drop)},this.mapClick=function(t){var e=t.offsetX,n=t.offsetY,r=o.translateX+e/o.scale,i=o.translateY+n/o.scale;o.lf.focusOn({coordinate:{x:r,y:i}})},this.lf=e,this.LFCtor=n,r&&r.MiniMap&&this.setOption(r.MiniMap),this.viewPortWidth=e.graphModel.width,this.viewPortHeight=e.graphModel.height;var i={left:0,right:this.viewPortWidth,top:0,bottom:this.viewPortHeight};this.bounds=i,this.elementAreaBounds=i,this.viewPortBounds=i,this.initMiniMap()}return t.prototype.setOption=function(t){var e=t.width,n=void 0===e?150:e,r=t.height,o=void 0===r?220:r,i=t.showEdge,a=void 0!==i&&i,s=t.isShowHeader,u=void 0!==s&&s,l=t.isShowCloseIcon,c=void 0!==l&&l,p=t.leftPosition,d=t.topPosition,h=t.rightPosition,f=void 0===h?0:h,y=t.bottomPosition,v=void 0===y?0:y,g=t.headerTitle,m=void 0===g?"导航":g;this.width=n,this.height=o,this.showEdge=a,this.isShowHeader=u,this.isShowCloseIcon=c,this.leftPosition=p,this.rightPosition=void 0!==p?void 0:f,this.topPosition=d,this.bottomPosition=void 0!==d?void 0:v,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 o=document.createElement("div");o.className="lf-mini-map-header",o.innerText=this.headerTitle,r.appendChild(o);var i=document.createElement("span");i.className="lf-mini-map-close",i.addEventListener("click",this.hide),r.appendChild(i)},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,o=t.x,i=t.y,a=null!==(n=t.width)&&void 0!==n?n:200,s=null!==(r=t.height)&&void 0!==r?r:200,u=o-a/2,l=o+a/2,c=i-s/2,p=i+s/2;e.left=Math.min(u,e.left),e.right=Math.max(l,e.right),e.top=Math.min(c,e.top),e.bottom=Math.max(p,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,o=t.SCALE_Y,i=this.lf.graphModel,a=i.width,s=i.height;this.viewPortBounds={left:-e/r,right:(-e+a)/r,top:-n/o,bottom:(-n+s)/o}},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(),o=this.resetData(r),i=this.lf.viewMap,a=this.lf.graphModel.modelMap,s=this.lfMap.viewMap;try{for(var u=v(i.keys()),l=u.next();!l.done;l=u.next()){var c=l.value;s.has(c)||this.lfMap.register({type:c,view:i.get(c),model:a.get(c)})}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}this.lfMap.render(o),this.updateBounds(o)}else this.updateBounds();var p=this.bounds,d=p.left,h=p.top,f=p.right-d,y=p.bottom-h,g=this.width/f,m=this.height/y,_=Math.min(g,m);this.scale=_;var b=d-(this.width/_-f)/2,x=h-(this.height/_-y)/2;if(this.lfMap.graphModel.transformModel.translate(-b+this.translateX,-x+this.translateY),this.translateX=b,this.translateY=x,this.miniMapWrap.firstChild){var E=this.miniMapWrap.firstChild.style;E.pointerEvents="none",E.transform="matrix(".concat(_,", 0, 0, ").concat(_,", 0, 0)"),E.transformOrigin="left top",E.height="".concat(this.height/_,"px"),E.width="".concat(this.width/_,"px"),this.updateViewPort()}},t.prototype.updateViewPort=function(){var t=this.viewport.style,e=this.lf.getTransform(),n=e.TRANSLATE_X,r=e.TRANSLATE_Y,o=e.SCALE_X,i=e.SCALE_Y,a=this.lf.graphModel,s=a.width,u=a.height;this.viewPortLeft=-n/o,this.viewPortTop=-r/i,this.viewPortWidth=s/o*this.scale,this.viewPortHeight=u/i*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}(),YA={tr:"tl",lb:"tl",tl:"tr",rb:"tr",br:"bl",lt:"bl",bl:"br",rt:"br"};function VA(t,e,n,r){var o,i="",a="";t[0]===e[0]?i=t[1]>e[1]?"t":"b":t[1]===e[1]&&(i=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 s=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,u="".concat(i).concat(a),l=YA[u]||"-",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 p=g(function(t,e,n,r){var o=[t[0],t[1]],i=[t[0],t[1]];switch(n){case"tl":return"tr"===e?(o[1]+=r,i[0]+=r):"lb"===e&&(o[0]+=r,i[1]+=r),[o,i];case"tr":return"tl"===e?(o[1]+=r,i[0]-=r):"rb"===e&&(o[0]-=r,i[1]+=r),[o,i];case"bl":return"br"===e?(o[1]-=r,i[0]+=r):"lt"===e&&(o[0]+=r,i[1]-=r),[o,i];case"br":return"bl"===e?(o[1]-=r,i[0]-=r):"rt"===e&&(o[0]-=r,i[1]-=r),[o,i];default:return[]}}(e,u,l,s),2),d=p[0],h=p[1];d&&h&&(c+="L ".concat(d[0]," ").concat(d[1]," Q ").concat(e[0]," ").concat(e[1]," ").concat(h[0]," ").concat(h[1]),o=g(h,2),e[0]=o[0],e[1]=o[1])}return c}function KA(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+=VA(t[n-1],t[n],t[1+n++],e)}r+="L ".concat(t[n][0]," ").concat(t[n][1])}return r}var qA=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e.prototype.getEdge=function(){var t=this.props.model,e=t.points,n=t.isAnimation,r=t.arrowConfig,o=t.radius,i=void 0===o?5:o,a=t.getEdgeStyle(),s=t.getEdgeAnimationStyle(),u=function(t){for(var e=t,n=1;n<e.length-1;){var r=g(e[n-1],2),o=r[0],i=r[1],a=g(e[n],2),s=a[0],u=a[1],l=g(e[n+1],2),c=l[0],p=l[1];o===s&&s===c||i===u&&u===p?e.splice(n,1):n++}return e}(e.split(" ").map((function(t){return t.split(",").map((function(t){return+t}))}))),l=KA(u,i),c=f(f(f({style:n?s:{}},a),r),{fill:"none"});return ar("path",f({d:l},c))},e}(eO),ZA=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return h(e,t),e}(Ib),JA=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 o=[];return r.forEach((function(e){var r=n.get(e);r&&(o=o.concat(t.findPathElements(r,n,[])))})),this.getNewPathes(o)},t.prototype.findPathElements=function(t,e,n){void 0===n&&(n=[]);var r=m([],g(n),!1);if(r.push(t.id),0===t.nextNodes.length)return[r];for(var o=[],i=0;i<t.nextNodes.length;i++){var a=e.get(t.nextNodes[i]),s=void 0;if(a){var u=r.indexOf(a.id);s=-1!==u?[m(m([],g(r.slice(u)),!1),[a.id],!1)]:this.findPathElements(a,e,m([],g(r),!1)),o=o.concat(s)}}return o},t.prototype.getNewPathes=function(t){var e=this,n=[],r=new Set;t.forEach((function(t){console.log("elements",t);var o=e.getNewId("path"),i=e.getNewId("路径"),a=e.isLoopPath(t),s=t.join(",");r.has(s)||(r.add(s),n.push({routeId:o,name:i,elements:t,type:a,weight:0,similarElement:""}))}));var o=JSON.parse(JSON.stringify(this.paths));return n.forEach((function(t){for(var n=0;n<o.length;n++){var r=o[n],i=e.similar2Path(m([],g(t.elements),!1),m([],g(r.elements),!1));i>t.weight&&r.weight<=i&&(t.weight=i,t.similarElement=r,i===r.weight&&r.similarElement?(r.similarElement.similarElement=null,r.similarElement.weight=0,r.similarElement=null,r.weight=0):(r.similarElement=t,r.weight=i))}})),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 o=t.shift(),i=e.shift();void 0!==o&&void 0!==i;)o===i?(n++,o=t.shift(),i=e.shift()):o<i?o=t.shift():o>i&&(i=e.shift());return n/r*200},t.prototype.getNewId=function(t){return"".concat(t,"_").concat(JO())},t.prototype.isLoopPath=function(t){var e=t.length;return t.indexOf(t[e-1])!==e-1?1:0},t.pluginName="flowPath",t}(),$A=-1,QA=0,tP=1,eP=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 o=this.formatData(t),i={nodes:[],edges:[]},a=r.length-1;a>=0;a--)this.setNodePosition(r[a],o,i,a,1);this.lf.graphModel.graphDataToModel(i)},t.prototype.setNodePosition=function(t,e,n,r,o){var i=this,a=e[t],s=a.text,u=a.type,l=a.next,c=a.properties,p=160*r+40,d=120*o,h={id:t,x:p,text:s,y:d,type:u,properties:c};return s&&"object"==typeof s&&(h.text=f(f({},s),{x:p+s.x,y:d+s.y})),this.newNodeMap.set(h.id,{x:h.x,y:h.y,type:u}),n.nodes.push(h),a.isFixed=!0,this.addLevelHeight(r,1),l&&l.length>0&&l.forEach((function(o){if(!e[o.nodeId].isFixed){var a=i.getLevelHeight(r+1);i.addLevelHeight(r,1),i.setNodePosition(o.nodeId,e,n,r+1,a+1)}n.edges.push(f({id:o.edgeId,type:o.edgeType,sourceNodeId:t,targetNodeId:o.nodeId,properties:o.properties,text:o.text},i.getEdgeDataPoints(t,o.nodeId)))})),h},t.prototype.getEdgeDataPoints=function(t,e){var n=this.newNodeMap.get(t),r=this.newNodeMap.get(e),o=this.getShape(t),i=o.width,a=o.height,s=this.getShape(e),u=s.width,l=s.height,c=this.getRelativePosition(n,r),p={x:n.x,y:n.y},d={x:r.x,y:r.y};switch(c){case QA:p.x=n.x+i/2,d.x=r.x-u/2;break;case $A:p.y=n.y+a/2,d.x=r.x-u/2;break;case tP:p.x=n.x+i/2,d.y=r.y+l/2}return{startPoint:p,endPoint:d}},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,o=e.text,i=e.x,a=e.y;return o&&"object"==typeof o&&(o.x=o.x-i,o.y=o.y-a),t[e.id]={type:n,properties:r,text:o,prev:[],next:[]},t}),{});return t.edges.forEach((function(t){var n=t.sourceNodeId,r=t.targetNodeId,o=t.id,i=t.properties,a=t.text,s=a;"object"==typeof a&&(s=a.value),e[n].next.push({edgeId:o,nodeId:r,edgeType:t.type,properties:i,text:s}),e[r].prev.push({edgeId:o,nodeId:n,properties:i,text:s})})),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}(),nP=function(t,e){var n=[],r=[],o=function(t,r,i){i&&r.unshift.apply(r,m([],g(e.getEdgeModels({sourceNodeId:t.id,targetNodeId:null==i?void 0:i.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){o(e,r.slice(),t)})):n.push(r))},i=function(t,n,o){o&&n.push.apply(n,m([],g(e.getEdgeModels({sourceNodeId:null==o?void 0:o.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){i(e,n.slice(),t)})):r.push(n))};return o(t,[]),i(t,[]),m([],g(new Set(m(m([],g(n.flat()),!1),g(r.flat()),!1))),!1)},rP=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 nP("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]=f({},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(f({},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=eP,t.BPMNAdapter=wA,t.BPMNBaseAdapter=xA,t.BPMNElements=kS,t.BoundaryEventFactory=YM,t.BpmnAdapter=RM,t.BpmnElement=vM,t.BpmnXmlAdapter=LM,t.ContextMenu=GA,t.Control=kA,t.CurvedEdge=qA,t.CurvedEdgeModel=ZA,t.DiamondResize=vS,t.DiamondResizeModel=fS,t.DiamondResizeView=yS,t.DndPanel=WA,t.EllipseResize=hS,t.EllipseResizeModel=pS,t.EllipseResizeView=dS,t.EndEventFactory=WM,t.EndEventModel=eM,t.EndEventView=nM,t.ExclusiveGatewayModel=sM,t.ExclusiveGatewayView=uM,t.FlowPath=JA,t.GatewayNodeFactory=iS,t.Group=PS,t.GroupNode=MS,t.GroupNodeModel=OS,t.Highlight=rP,t.HtmlResize=_S,t.HtmlResizeModel=gS,t.HtmlResizeView=mS,t.InsertNodeInPolyline=IA,t.IntermediateCatchEventFactory=FM,t.IntermediateThrowEventFactory=VM,t.Menu=HA,t.MiniMap=UA,t.NodeResize=wS,t.RectResize=ES,t.RectResizeModel=bS,t.RectResizeView=xS,t.SelectionSelect=FA,t.SequenceFlowModel=oM,t.SequenceFlowView=iM,t.ServiceTaskModel=cM,t.ServiceTaskView=pM,t.Snapshot=OA,t.StartEventFactory=UM,t.StartEventModel=$O,t.StartEventView=QO,t.SubProcessFactory=NS,t.TaskNodeFactory=sS,t.UserTaskModel=hM,t.UserTaskView=fM,t.bpmnUtils=GM,t.convertNormalToXml=fA,t.convertXmlToNormal=yA,t.gateway={exclusive:0,inclusive:1,parallel:2},t.gatewayComposable=[[1,1,0],[0,0,1],[0,1,1]],t.getCurvedEdgePath=KA,t.handleAttributes=xM,t.icons=oS,t.lfJson2Xml=OM,t.lfXml2Json=AM,t.multiInstanceIcon=aS,t.sequenceFlowFactory=DS,t.toLogicflowData=function(t){var e={nodes:[],edges:[]},n=t.flowElementList;return n&&n.length>0&&n.forEach((function(t){if(t.type===MA.SEQUENCE_FLOW){var n=function(t){var e=t.incoming,n=t.outgoing,r=t.properties,o=t.key,i=t.type,a=r.text,s=r.name,u=r.startPoint,l=r.endPoint,c=r.pointsList,p={id:o,type:SA[i],sourceNodeId:e[0],targetNodeId:n[0],text:a||s,properties:{}};u&&(p.startPoint=JSON.parse(u)),l&&(p.endPoint=JSON.parse(l)),c&&(p.pointsList=JSON.parse(c));var d=["startPoint","endPoint","pointsList","text"];return Object.keys(t.properties).forEach((function(e){-1===d.indexOf(e)&&(p.properties[e]=t.properties[e])})),p}(t);e.edges.push(n)}else{var r=function(t){var e=t.properties,n=t.key,r=t.type,o=t.bounds,i=e.x,a=e.y,s=e.text;if(void 0===i){var u=g(o,2),l=u[0],c=l.x,p=l.y,d=u[1];i=(c+d.x)/2,a=(p+d.y)/2}var h={id:n,type:SA[r],x:i,y:a,text:s,properties:{}},f=["x","y","text"];return Object.keys(t.properties).forEach((function(e){-1===f.indexOf(e)&&(h.properties[e]=t.properties[e])})),h}(t);e.nodes.push(r)}})),e},t.toNormalJson=DM,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,o=t.y,i=t.text,a=void 0===i?"":i,s=t.properties;return{incoming:[],outgoing:[],dockers:[],type:AA(n),properties:f(f({},s),{name:a&&a.value||"",x:r,y:o,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,o=t.targetNodeId,i=t.startPoint,a=t.endPoint,s=t.pointsList,u=t.text,l=void 0===u?"":u,c=t.properties;return{incoming:[r],outgoing:[o],type:AA(n),dockers:[],properties:f(f({},c),{name:l&&l.value||"",text:l,startPoint:JSON.stringify(i),endPoint:JSON.stringify(a),pointsList:JSON.stringify(s)}),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=TM,t.useDefinition=IS}));
26
- //# sourceMappingURL=index.js.map