@yuku123/z-wf-frontend-component 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -0
- package/dist/z-wf-frontend-component.css +1 -0
- package/dist/z-wf_frontend_component.es.js +30846 -0
- package/dist/z-wf_frontend_component.umd.js +114 -0
- package/package.json +62 -0
- package/src/components/FlowDesigner/index.module.css +137 -0
- package/src/components/FlowDesigner/index.tsx +133 -0
- package/src/components/FlowDesigner/nodes/index.ts +157 -0
- package/src/index.ts +2 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
(function(Bt,Wn){typeof exports=="object"&&typeof module<"u"?Wn(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],Wn):(Bt=typeof globalThis<"u"?globalThis:Bt||self,Wn(Bt.ZWfFrontendComponent={},Bt.React))})(this,(function(Bt,Wn){"use strict";function ps(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var vs={exports:{}},ta={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var dh;function lb(){if(dh)return ta;dh=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(r,i,o){var a=null;if(o!==void 0&&(a=""+o),i.key!==void 0&&(a=""+i.key),"key"in i){o={};for(var s in i)s!=="key"&&(o[s]=i[s])}else o=i;return i=o.ref,{$$typeof:n,type:r,key:a,ref:i!==void 0?i:null,props:o}}return ta.Fragment=e,ta.jsx=t,ta.jsxs=t,ta}var na={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var fh;function ub(){return fh||(fh=1,process.env.NODE_ENV!=="production"&&(function(){function n(F){if(F==null)return null;if(typeof F=="function")return F.$$typeof===ue?null:F.displayName||F.name||null;if(typeof F=="string")return F;switch(F){case g:return"Fragment";case m:return"Profiler";case y:return"StrictMode";case A:return"Suspense";case E:return"SuspenseList";case Z:return"Activity"}if(typeof F=="object")switch(typeof F.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),F.$$typeof){case v:return"Portal";case T:return F.displayName||"Context";case O:return(F._context.displayName||"Context")+".Consumer";case C:var ne=F.render;return F=F.displayName,F||(F=ne.displayName||ne.name||"",F=F!==""?"ForwardRef("+F+")":"ForwardRef"),F;case N:return ne=F.displayName||null,ne!==null?ne:n(F.type)||"Memo";case B:ne=F._payload,F=F._init;try{return n(F(ne))}catch{}}return null}function e(F){return""+F}function t(F){try{e(F);var ne=!1}catch{ne=!0}if(ne){ne=console;var _e=ne.error,fe=typeof Symbol=="function"&&Symbol.toStringTag&&F[Symbol.toStringTag]||F.constructor.name||"Object";return _e.call(ne,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",fe),e(F)}}function r(F){if(F===g)return"<>";if(typeof F=="object"&&F!==null&&F.$$typeof===B)return"<...>";try{var ne=n(F);return ne?"<"+ne+">":"<...>"}catch{return"<...>"}}function i(){var F=me.A;return F===null?null:F.getOwner()}function o(){return Error("react-stack-top-frame")}function a(F){if(S.call(F,"key")){var ne=Object.getOwnPropertyDescriptor(F,"key").get;if(ne&&ne.isReactWarning)return!1}return F.key!==void 0}function s(F,ne){function _e(){Y||(Y=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",ne))}_e.isReactWarning=!0,Object.defineProperty(F,"key",{get:_e,configurable:!0})}function l(){var F=n(this.type);return se[F]||(se[F]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),F=this.props.ref,F!==void 0?F:null}function u(F,ne,_e,fe,Fe,R){var W=_e.ref;return F={$$typeof:p,type:F,key:ne,props:_e,_owner:fe},(W!==void 0?W:null)!==null?Object.defineProperty(F,"ref",{enumerable:!1,get:l}):Object.defineProperty(F,"ref",{enumerable:!1,value:null}),F._store={},Object.defineProperty(F._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(F,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(F,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Fe}),Object.defineProperty(F,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:R}),Object.freeze&&(Object.freeze(F.props),Object.freeze(F)),F}function d(F,ne,_e,fe,Fe,R){var W=ne.children;if(W!==void 0)if(fe)if(D(W)){for(fe=0;fe<W.length;fe++)f(W[fe]);Object.freeze&&Object.freeze(W)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else f(W);if(S.call(ne,"key")){W=n(F);var G=Object.keys(ne).filter(function(oe){return oe!=="key"});fe=0<G.length?"{key: someKey, "+G.join(": ..., ")+": ...}":"{key: someKey}",He[W+fe]||(G=0<G.length?"{"+G.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
+
let props = %s;
|
|
19
|
+
<%s {...props} />
|
|
20
|
+
React keys must be passed directly to JSX without using spread:
|
|
21
|
+
let props = %s;
|
|
22
|
+
<%s key={someKey} {...props} />`,fe,W,G,W),He[W+fe]=!0)}if(W=null,_e!==void 0&&(t(_e),W=""+_e),a(ne)&&(t(ne.key),W=""+ne.key),"key"in ne){_e={};for(var te in ne)te!=="key"&&(_e[te]=ne[te])}else _e=ne;return W&&s(_e,typeof F=="function"?F.displayName||F.name||"Unknown":F),u(F,W,_e,i(),Fe,R)}function f(F){c(F)?F._store&&(F._store.validated=1):typeof F=="object"&&F!==null&&F.$$typeof===B&&(F._payload.status==="fulfilled"?c(F._payload.value)&&F._payload.value._store&&(F._payload.value._store.validated=1):F._store&&(F._store.validated=1))}function c(F){return typeof F=="object"&&F!==null&&F.$$typeof===p}var h=Wn,p=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),T=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),ue=Symbol.for("react.client.reference"),me=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,S=Object.prototype.hasOwnProperty,D=Array.isArray,L=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(F){return F()}};var Y,se={},ce=h.react_stack_bottom_frame.bind(h,o)(),Ue=L(r(o)),He={};na.Fragment=g,na.jsx=function(F,ne,_e){var fe=1e4>me.recentlyCreatedOwnerStacks++;return d(F,ne,_e,!1,fe?Error("react-stack-top-frame"):ce,fe?L(r(F)):Ue)},na.jsxs=function(F,ne,_e){var fe=1e4>me.recentlyCreatedOwnerStacks++;return d(F,ne,_e,!0,fe?Error("react-stack-top-frame"):ce,fe?L(r(F)):Ue)}})()),na}var ch;function db(){return ch||(ch=1,process.env.NODE_ENV==="production"?vs.exports=lb():vs.exports=ub()),vs.exports}var ra=db();const Hu={designerContainer:"_designerContainer_1js4a_1",canvas:"_canvas_1js4a_8",dndItem:"_dndItem_1js4a_14"};var gs,Xe,hh,ri,ph,vh,gh,zu,ys,ia,yh,Wu,Xu,Gu,ms={},_s=[],fb=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,oa=Array.isArray;function Wr(n,e){for(var t in e)n[t]=e[t];return n}function Uu(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function ae(n,e,t){var r,i,o,a={};for(o in e)o=="key"?r=e[o]:o=="ref"?i=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?gs.call(arguments,2):t),typeof n=="function"&&n.defaultProps!=null)for(o in n.defaultProps)a[o]===void 0&&(a[o]=n.defaultProps[o]);return bs(n,a,r,i,null)}function bs(n,e,t,r,i){var o={type:n,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++hh,__i:-1,__u:0};return i==null&&Xe.vnode!=null&&Xe.vnode(o),o}function xs(){return{current:null}}function no(n){return n.children}function Ye(n,e){this.props=n,this.context=e}function ro(n,e){if(e==null)return n.__?ro(n.__,n.__i+1):null;for(var t;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null)return t.__e;return typeof n.type=="function"?ro(n):null}function cb(n){if(n.__P&&n.__d){var e=n.__v,t=e.__e,r=[],i=[],o=Wr({},e);o.__v=e.__v+1,Xe.vnode&&Xe.vnode(o),Yu(n.__P,o,e,n.__n,n.__P.namespaceURI,32&e.__u?[t]:null,r,t??ro(e),!!(32&e.__u),i),o.__v=e.__v,o.__.__k[o.__i]=o,Sh(r,o,i),e.__e=e.__=null,o.__e!=t&&mh(o)}}function mh(n){if((n=n.__)!=null&&n.__c!=null)return n.__e=n.__c.base=null,n.__k.some(function(e){if(e!=null&&e.__e!=null)return n.__e=n.__c.base=e.__e}),mh(n)}function _h(n){(!n.__d&&(n.__d=!0)&&ri.push(n)&&!Es.__r++||ph!=Xe.debounceRendering)&&((ph=Xe.debounceRendering)||vh)(Es)}function Es(){try{for(var n,e=1;ri.length;)ri.length>e&&ri.sort(gh),n=ri.shift(),e=ri.length,cb(n)}finally{ri.length=Es.__r=0}}function bh(n,e,t,r,i,o,a,s,l,u,d){var f,c,h,p,v,g,y,m=r&&r.__k||_s,O=e.length;for(l=hb(t,e,m,l,O),f=0;f<O;f++)(h=t.__k[f])!=null&&(c=h.__i!=-1&&m[h.__i]||ms,h.__i=f,g=Yu(n,h,c,i,o,a,s,l,u,d),p=h.__e,h.ref&&c.ref!=h.ref&&(c.ref&&Ku(c.ref,null,h),d.push(h.ref,h.__c||p,h)),v==null&&p!=null&&(v=p),(y=!!(4&h.__u))||c.__k===h.__k?(l=xh(h,l,n,y),y&&c.__e&&(c.__e=null)):typeof h.type=="function"&&g!==void 0?l=g:p&&(l=p.nextSibling),h.__u&=-7);return t.__e=v,l}function hb(n,e,t,r,i){var o,a,s,l,u,d=t.length,f=d,c=0;for(n.__k=new Array(i),o=0;o<i;o++)(a=e[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=n.__k[o]=bs(null,a,null,null,null):oa(a)?a=n.__k[o]=bs(no,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=n.__k[o]=bs(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):n.__k[o]=a,l=o+c,a.__=n,a.__b=n.__b+1,s=null,(u=a.__i=pb(a,t,l,f))!=-1&&(f--,(s=t[u])&&(s.__u|=2)),s==null||s.__v==null?(u==-1&&(i>d?c--:i<d&&c++),typeof a.type!="function"&&(a.__u|=4)):u!=l&&(u==l-1?c--:u==l+1?c++:(u>l?c--:c++,a.__u|=4))):n.__k[o]=null;if(f)for(o=0;o<d;o++)(s=t[o])!=null&&(2&s.__u)==0&&(s.__e==r&&(r=ro(s)),Ah(s,s));return r}function xh(n,e,t,r){var i,o;if(typeof n.type=="function"){for(i=n.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=n,e=xh(i[o],e,t,r));return e}n.__e!=e&&(r&&(e&&n.type&&!e.parentNode&&(e=ro(n)),t.insertBefore(n.__e,e||null)),e=n.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function ws(n,e){return e=e||[],n==null||typeof n=="boolean"||(oa(n)?n.some(function(t){ws(t,e)}):e.push(n)),e}function pb(n,e,t,r){var i,o,a,s=n.key,l=n.type,u=e[t],d=u!=null&&(2&u.__u)==0;if(u===null&&s==null||d&&s==u.key&&l==u.type)return t;if(r>(d?1:0)){for(i=t-1,o=t+1;i>=0||o<e.length;)if((u=e[a=i>=0?i--:o++])!=null&&(2&u.__u)==0&&s==u.key&&l==u.type)return a}return-1}function Eh(n,e,t){e[0]=="-"?n.setProperty(e,t??""):n[e]=t==null?"":typeof t!="number"||fb.test(e)?t:t+"px"}function Ss(n,e,t,r,i){var o,a;e:if(e=="style")if(typeof t=="string")n.style.cssText=t;else{if(typeof r=="string"&&(n.style.cssText=r=""),r)for(e in r)t&&e in t||Eh(n.style,e,"");if(t)for(e in t)r&&t[e]==r[e]||Eh(n.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(yh,"$1")),a=e.toLowerCase(),e=a in n||e=="onFocusOut"||e=="onFocusIn"?a.slice(2):e.slice(2),n.l||(n.l={}),n.l[e+o]=t,t?r?t[ia]=r[ia]:(t[ia]=Wu,n.addEventListener(e,o?Gu:Xu,o)):n.removeEventListener(e,o?Gu:Xu,o);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in n)try{n[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?n.removeAttribute(e):n.setAttribute(e,e=="popover"&&t==1?"":t))}}function wh(n){return function(e){if(this.l){var t=this.l[e.type+n];if(e[ys]==null)e[ys]=Wu++;else if(e[ys]<t[ia])return;return t(Xe.event?Xe.event(e):e)}}}function Yu(n,e,t,r,i,o,a,s,l,u){var d,f,c,h,p,v,g,y,m,O,T,C,A,E,N,B=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(l=!!(32&t.__u),o=[s=e.__e=t.__e]),(d=Xe.__b)&&d(e);e:if(typeof B=="function")try{if(y=e.props,m=B.prototype&&B.prototype.render,O=(d=B.contextType)&&r[d.__c],T=d?O?O.props.value:d.__:r,t.__c?g=(f=e.__c=t.__c).__=f.__E:(m?e.__c=f=new B(y,T):(e.__c=f=new Ye(y,T),f.constructor=B,f.render=gb),O&&O.sub(f),f.state||(f.state={}),f.__n=r,c=f.__d=!0,f.__h=[],f._sb=[]),m&&f.__s==null&&(f.__s=f.state),m&&B.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Wr({},f.__s)),Wr(f.__s,B.getDerivedStateFromProps(y,f.__s))),h=f.props,p=f.state,f.__v=e,c)m&&B.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),m&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(m&&B.getDerivedStateFromProps==null&&y!==h&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(y,T),e.__v==t.__v||!f.__e&&f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(y,f.__s,T)===!1){e.__v!=t.__v&&(f.props=y,f.state=f.__s,f.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(Z){Z&&(Z.__=e)}),_s.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&a.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(y,f.__s,T),m&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(h,p,v)})}if(f.context=T,f.props=y,f.__P=n,f.__e=!1,C=Xe.__r,A=0,m)f.state=f.__s,f.__d=!1,C&&C(e),d=f.render(f.props,f.state,f.context),_s.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,C&&C(e),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++A<25);f.state=f.__s,f.getChildContext!=null&&(r=Wr(Wr({},r),f.getChildContext())),m&&!c&&f.getSnapshotBeforeUpdate!=null&&(v=f.getSnapshotBeforeUpdate(h,p)),E=d!=null&&d.type===no&&d.key==null?Oh(d.props.children):d,s=bh(n,oa(E)?E:[E],e,t,r,i,o,a,s,l,u),f.base=e.__e,e.__u&=-161,f.__h.length&&a.push(f),g&&(f.__E=f.__=null)}catch(Z){if(e.__v=null,l||o!=null)if(Z.then){for(e.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,e.__e=s}else{for(N=o.length;N--;)Uu(o[N]);Vu(e)}else e.__e=t.__e,e.__k=t.__k,Z.then||Vu(e);Xe.__e(Z,e,t)}else o==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):s=e.__e=vb(t.__e,e,t,r,i,o,a,l,u);return(d=Xe.diffed)&&d(e),128&e.__u?void 0:s}function Vu(n){n&&(n.__c&&(n.__c.__e=!0),n.__k&&n.__k.some(Vu))}function Sh(n,e,t){for(var r=0;r<t.length;r++)Ku(t[r],t[++r],t[++r]);Xe.__c&&Xe.__c(e,n),n.some(function(i){try{n=i.__h,i.__h=[],n.some(function(o){o.call(i)})}catch(o){Xe.__e(o,i.__v)}})}function Oh(n){return typeof n!="object"||n==null||n.__b>0?n:oa(n)?n.map(Oh):n.constructor!==void 0?null:Wr({},n)}function vb(n,e,t,r,i,o,a,s,l){var u,d,f,c,h,p,v,g=t.props||ms,y=e.props,m=e.type;if(m=="svg"?i="http://www.w3.org/2000/svg":m=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(u=0;u<o.length;u++)if((h=o[u])&&"setAttribute"in h==!!m&&(m?h.localName==m:h.nodeType==3)){n=h,o[u]=null;break}}if(n==null){if(m==null)return document.createTextNode(y);n=document.createElementNS(i,m,y.is&&y),s&&(Xe.__m&&Xe.__m(e,o),s=!1),o=null}if(m==null)g===y||s&&n.data==y||(n.data=y);else{if(o=m=="textarea"&&y.defaultValue!=null?null:o&&gs.call(n.childNodes),!s&&o!=null)for(g={},u=0;u<n.attributes.length;u++)g[(h=n.attributes[u]).name]=h.value;for(u in g)h=g[u],u=="dangerouslySetInnerHTML"?f=h:u=="children"||u in y||u=="value"&&"defaultValue"in y||u=="checked"&&"defaultChecked"in y||Ss(n,u,null,h,i);for(u in y)h=y[u],u=="children"?c=h:u=="dangerouslySetInnerHTML"?d=h:u=="value"?p=h:u=="checked"?v=h:s&&typeof h!="function"||g[u]===h||Ss(n,u,h,g[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==n.innerHTML)||(n.innerHTML=d.__html),e.__k=[];else if(f&&(n.innerHTML=""),bh(e.type=="template"?n.content:n,oa(c)?c:[c],e,t,r,m=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:t.__k&&ro(t,0),s,l),o!=null)for(u=o.length;u--;)Uu(o[u]);s&&m!="textarea"||(u="value",m=="progress"&&p==null?n.removeAttribute("value"):p!=null&&(p!==n[u]||m=="progress"&&!p||m=="option"&&p!=g[u])&&Ss(n,u,p,g[u],i),u="checked",v!=null&&v!=n[u]&&Ss(n,u,v,g[u],i))}return n}function Ku(n,e,t){try{if(typeof n=="function"){var r=typeof n.__u=="function";r&&n.__u(),r&&e==null||(n.__u=n(e))}else n.current=e}catch(i){Xe.__e(i,t)}}function Ah(n,e,t){var r,i;if(Xe.unmount&&Xe.unmount(n),(r=n.ref)&&(r.current&&r.current!=n.__e||Ku(r,null,e)),(r=n.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){Xe.__e(o,e)}r.base=r.__P=null}if(r=n.__k)for(i=0;i<r.length;i++)r[i]&&Ah(r[i],e,t||typeof n.type!="function");t||Uu(n.__e),n.__c=n.__=n.__e=void 0}function gb(n,e,t){return this.constructor(n,t)}function yb(n,e,t){var r,i,o,a;e==document&&(e=document.documentElement),Xe.__&&Xe.__(n,e),i=(r=!1)?null:e.__k,o=[],a=[],Yu(e,n=e.__k=ae(no,null,[n]),i||ms,ms,e.namespaceURI,i?null:e.firstChild?gs.call(e.childNodes):null,o,i?i.__e:e.firstChild,r,a),Sh(o,n,a)}gs=_s.slice,Xe={__e:function(n,e,t,r){for(var i,o,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(n)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(n,r||{}),a=i.__d),a)return i.__E=i}catch(s){n=s}throw n}},hh=0,Ye.prototype.setState=function(n,e){var t;t=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Wr({},this.state),typeof n=="function"&&(n=n(Wr({},t),this.props)),n&&Wr(t,n),n!=null&&this.__v&&(e&&this._sb.push(e),_h(this))},Ye.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),_h(this))},Ye.prototype.render=no,ri=[],vh=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,gh=function(n,e){return n.__v.__b-e.__v.__b},Es.__r=0,zu=Math.random().toString(8),ys="__d"+zu,ia="__a"+zu,yh=/(PointerCapture)$|Capture$/i,Wu=0,Xu=wh(!1),Gu=wh(!0);var mb="An invariant failed, however the error is obfuscated because this is a production build.",Os=[];Object.freeze(Os);var qu={};Object.freeze(qu);function xn(){return++le.mobxGuid}function Ie(n){throw Ot(!1,n),"X"}function Ot(n,e){if(!n)throw new Error("[mobx] "+(e||mb))}var Ch=[];function _b(n,e){return process.env.NODE_ENV==="production"||Ch.indexOf(n)!==-1?!1:(Ch.push(n),console.error("[mobx] Deprecated: "+n),!0)}function Zu(n){var e=!1;return function(){if(!e)return e=!0,n.apply(this,arguments)}}var As=function(){};function bb(n){var e=[];return n.forEach(function(t){e.indexOf(t)===-1&&e.push(t)}),e}function Qu(n){return n!==null&&typeof n=="object"}function Ni(n){if(n===null||typeof n!="object")return!1;var e=Object.getPrototypeOf(n);return e===Object.prototype||e===null}function xb(n){if(oo(n)||dn(n))return n;if(Array.isArray(n))return new Map(n);if(Ni(n)){var e=new Map;for(var t in n)e.set(t,n[t]);return e}else return Ie("Cannot convert to map from '"+n+"'")}function io(n,e,t){Object.defineProperty(n,e,{enumerable:!1,writable:!0,configurable:!0,value:t})}function Eb(n,e,t){Object.defineProperty(n,e,{enumerable:!1,writable:!1,configurable:!0,value:t})}function Th(n,e){var t=Object.getOwnPropertyDescriptor(n,e);return!t||t.configurable!==!1&&t.writable!==!1}function wb(n,e){process.env.NODE_ENV!=="production"&&!Th(n,e)&&Ie("Cannot make property '"+e.toString()+"' observable, it is not configurable and writable in the target object")}function ii(n,e){var t="isMobX"+n;return e.prototype[t]=!0,function(r){return Qu(r)&&r[t]===!0}}function oo(n){return n instanceof Map}function aa(n){return n instanceof Set}function Ju(n){var e=new Set;for(var t in n)e.add(t);return Object.getOwnPropertySymbols(n).forEach(function(r){Object.getOwnPropertyDescriptor(n,r).enumerable&&e.add(r)}),Array.from(e)}function Xn(n){return n&&n.toString?n.toString():new String(n).toString()}function Mh(n){return n===null?null:typeof n=="object"?""+n:n}var Sb=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,Re=Symbol("mobx administration"),ao=(function(){function n(e){e===void 0&&(e="Atom@"+xn()),this.name=e,this.isPendingUnobservation=!1,this.isBeingObserved=!1,this.observers=new Set,this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=ft.NOT_TRACKING}return n.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach(function(e){return e()})},n.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach(function(e){return e()})},n.prototype.reportObserved=function(){return Wh(this)},n.prototype.reportChanged=function(){ar(),Kb(this),sr()},n.prototype.toString=function(){return this.name},n})(),ed=ii("Atom",ao);function td(n,e,t){e===void 0&&(e=As),t===void 0&&(t=As);var r=new ao(n);return e!==As&&dx(r,e),t!==As&&Zh(r,t),r}function Ob(n,e){return vp(n,e)}function Ab(n,e){return Object.is(n,e)}var so={structural:Ob,default:Ab};/*! *****************************************************************************
|
|
23
|
+
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
24
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
25
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
26
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
27
|
+
|
|
28
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
29
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
30
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
31
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
32
|
+
|
|
33
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
34
|
+
and limitations under the License.
|
|
35
|
+
***************************************************************************** */var nd=function(n,e){return nd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])},nd(n,e)};function Cb(n,e){nd(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var wt=function(){return wt=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},wt.apply(this,arguments)};function ir(n){var e=typeof Symbol=="function"&&n[Symbol.iterator],t=0;return e?e.call(n):{next:function(){return n&&t>=n.length&&(n=void 0),{value:n&&n[t++],done:!n}}}}function lo(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o}function rd(){for(var n=[],e=0;e<arguments.length;e++)n=n.concat(lo(arguments[e]));return n}var Cs=Symbol("mobx did run lazy initializers"),sa=Symbol("mobx pending decorators"),Tb={},Mb={};function Nb(n,e){var t=e?Tb:Mb;return t[n]||(t[n]={configurable:!0,enumerable:e,get:function(){return Pi(this),this[n]},set:function(r){Pi(this),this[n]=r}})}function Pi(n){var e,t;if(n[Cs]!==!0){var r=n[sa];if(r){io(n,Cs,!0);var i=rd(Object.getOwnPropertySymbols(r),Object.keys(r));try{for(var o=ir(i),a=o.next();!a.done;a=o.next()){var s=a.value,l=r[s];l.propertyCreator(n,l.prop,l.descriptor,l.decoratorTarget,l.decoratorArguments)}}catch(u){e={error:u}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}}}function Nh(n,e){return function(){var r,i=function(a,s,l,u){if(u===!0)return e(a,s,l,a,r),null;if(process.env.NODE_ENV!=="production"&&!Ph(arguments)&&Ie("This function is a decorator, but it wasn't invoked like a decorator"),!Object.prototype.hasOwnProperty.call(a,sa)){var d=a[sa];io(a,sa,wt({},d))}return a[sa][s]={prop:s,propertyCreator:e,descriptor:l,decoratorTarget:a,decoratorArguments:r},Nb(s,n)};return Ph(arguments)?(r=Os,i.apply(null,arguments)):(r=Array.prototype.slice.call(arguments),i)}}function Ph(n){return(n.length===2||n.length===3)&&(typeof n[1]=="string"||typeof n[1]=="symbol")||n.length===4&&n[3]===!0}function la(n,e,t){return ai(n)?n:Array.isArray(n)?z.array(n,{name:t}):Ni(n)?z.object(n,void 0,{name:t}):oo(n)?z.map(n,{name:t}):aa(n)?z.set(n,{name:t}):n}function Pb(n,e,t){return n==null||cr(n)||Cr(n)||dn(n)||Gn(n)?n:Array.isArray(n)?z.array(n,{name:t,deep:!1}):Ni(n)?z.object(n,void 0,{name:t,deep:!1}):oo(n)?z.map(n,{name:t,deep:!1}):aa(n)?z.set(n,{name:t,deep:!1}):Ie(process.env.NODE_ENV!=="production"&&"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets")}function Ts(n){return n}function Db(n,e,t){if(process.env.NODE_ENV!=="production"&&ai(n))throw"observable.struct should not be used with observable values";return vp(n,e)?e:n}function Ms(n){Ot(n);var e=Nh(!0,function(r,i,o,a,s){process.env.NODE_ENV!=="production"&&Ot(!o||!o.get,'@observable cannot be used on getter (property "'+Xn(i)+'"), use @computed instead.');var l=o?o.initializer?o.initializer.call(r):o.value:void 0;pd(r).addObservableProp(i,l,n)}),t=typeof process<"u"&&process.env&&process.env.NODE_ENV!=="production"?function(){return arguments.length<2?Ie("Incorrect decorator invocation. @observable decorator doesn't expect any arguments"):e.apply(null,arguments)}:e;return t.enhancer=n,t}var Dh={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Dh);function Rb(n){/^(deep|name|equals|defaultDecorator|proxy)$/.test(n)||Ie("invalid option for (extend)observable: "+n)}function uo(n){if(n==null)return Dh;if(typeof n=="string")return{name:n,deep:!0,proxy:!0};if(process.env.NODE_ENV!=="production"){if(typeof n!="object")return Ie("expected options object");Object.keys(n).forEach(Rb)}return n}var id=Ms(la),Lb=Ms(Pb),Rh=Ms(Ts),Ib=Ms(Db);function Ns(n){return n.defaultDecorator?n.defaultDecorator.enhancer:n.deep===!1?Ts:la}function kb(n,e,t){if(typeof arguments[1]=="string"||typeof arguments[1]=="symbol")return id.apply(null,arguments);if(ai(n))return n;var r=Ni(n)?z.object(n,e,t):Array.isArray(n)?z.array(n,e):oo(n)?z.map(n,e):aa(n)?z.set(n,e):n;if(r!==n)return r;Ie(process.env.NODE_ENV!=="production"&&"The provided value could not be converted into an observable. If you want just create an observable reference to the object use 'observable.box(value)'")}var Lh={box:function(n,e){arguments.length>2&&ua("box");var t=uo(e);return new Ri(n,Ns(t),t.name,!0,t.equals)},array:function(n,e){arguments.length>2&&ua("array");var t=uo(e);return Sx(n,Ns(t),t.name)},map:function(n,e){arguments.length>2&&ua("map");var t=uo(e);return new hd(n,Ns(t),t.name)},set:function(n,e){arguments.length>2&&ua("set");var t=uo(e);return new up(n,Ns(t),t.name)},object:function(n,e,t){typeof arguments[1]=="string"&&ua("object");var r=uo(t);if(r.proxy===!1)return fd({},n,e,r);var i=Jh(r),o=fd({},void 0,void 0,r),a=xx(o);return ep(a,n,e,i),a},ref:Rh,shallow:Lb,deep:id,struct:Ib},z=kb;Object.keys(Lh).forEach(function(n){return z[n]=Lh[n]});function ua(n){Ie("Expected one or two arguments to observable."+n+". Did you accidentally try to use observable."+n+" as decorator?")}var Ps=Nh(!1,function(n,e,t,r,i){process.env.NODE_ENV!=="production"&&Ot(t&&t.get,"Trying to declare a computed value for unspecified getter '"+Xn(e)+"'");var o=t.get,a=t.set,s=i[0]||{};pd(n).addComputedProp(n,e,wt({get:o,set:a,context:n},s))}),jb=Ps({equals:so.structural}),gt=function(e,t,r){if(typeof t=="string"||e!==null&&typeof e=="object"&&arguments.length===1)return Ps.apply(null,arguments);process.env.NODE_ENV!=="production"&&(Ot(typeof e=="function","First argument to `computed` should be an expression."),Ot(arguments.length<3,"Computed takes one or two arguments if used as function"));var i=typeof t=="object"?t:{};return i.get=e,i.set=typeof t=="function"?t:i.set,i.name=i.name||e.name||"",new ho(i)};gt.struct=jb;var ft;(function(n){n[n.NOT_TRACKING=-1]="NOT_TRACKING",n[n.UP_TO_DATE=0]="UP_TO_DATE",n[n.POSSIBLY_STALE=1]="POSSIBLY_STALE",n[n.STALE=2]="STALE"})(ft||(ft={}));var or;(function(n){n[n.NONE=0]="NONE",n[n.LOG=1]="LOG",n[n.BREAK=2]="BREAK"})(or||(or={}));var Ds=(function(){function n(e){this.cause=e}return n})();function da(n){return n instanceof Ds}function od(n){switch(n.dependenciesState){case ft.UP_TO_DATE:return!1;case ft.NOT_TRACKING:case ft.STALE:return!0;case ft.POSSIBLY_STALE:{for(var e=sd(!0),t=co(),r=n.observing,i=r.length,o=0;o<i;o++){var a=r[o];if(po(a)){if(le.disableErrorBoundaries)a.get();else try{a.get()}catch{return oi(t),fa(e),!0}if(n.dependenciesState===ft.STALE)return oi(t),fa(e),!0}}return jh(n),oi(t),fa(e),!1}}}function fo(n){var e=n.observers.size>0;le.computationDepth>0&&e&&Ie(process.env.NODE_ENV!=="production"&&"Computed values are not allowed to cause side effects by changing observables that are already being observed. Tried to modify: "+n.name),!le.allowStateChanges&&(e||le.enforceActions==="strict")&&Ie(process.env.NODE_ENV!=="production"&&(le.enforceActions?"Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: ":"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, the render function of a React component? Tried to modify: ")+n.name)}function Bb(n){process.env.NODE_ENV!=="production"&&!le.allowStateReads&&le.observableRequiresReaction&&console.warn("[mobx] Observable "+n.name+" being read outside a reactive context")}function Ih(n,e,t){var r=sd(!0);jh(n),n.newObserving=new Array(n.observing.length+100),n.unboundDepsCount=0,n.runId=++le.runId;var i=le.trackingDerivation;le.trackingDerivation=n;var o;if(le.disableErrorBoundaries===!0)o=e.call(t);else try{o=e.call(t)}catch(a){o=new Ds(a)}return le.trackingDerivation=i,$b(n),Fb(n),fa(r),o}function Fb(n){process.env.NODE_ENV!=="production"&&n.observing.length===0&&(le.reactionRequiresObservable||n.requiresObservable)&&console.warn("[mobx] Derivation "+n.name+" is created/updated without reading any observable value")}function $b(n){for(var e=n.observing,t=n.observing=n.newObserving,r=ft.UP_TO_DATE,i=0,o=n.unboundDepsCount,a=0;a<o;a++){var s=t[a];s.diffValue===0&&(s.diffValue=1,i!==a&&(t[i]=s),i++),s.dependenciesState>r&&(r=s.dependenciesState)}for(t.length=i,n.newObserving=null,o=e.length;o--;){var s=e[o];s.diffValue===0&&Hh(s,n),s.diffValue=0}for(;i--;){var s=t[i];s.diffValue===1&&(s.diffValue=0,Vb(s,n))}r!==ft.UP_TO_DATE&&(n.dependenciesState=r,n.onBecomeStale())}function ad(n){var e=n.observing;n.observing=[];for(var t=e.length;t--;)Hh(e[t],n);n.dependenciesState=ft.NOT_TRACKING}function kh(n){var e=co();try{return n()}finally{oi(e)}}function co(){var n=le.trackingDerivation;return le.trackingDerivation=null,n}function oi(n){le.trackingDerivation=n}function sd(n){var e=le.allowStateReads;return le.allowStateReads=n,e}function fa(n){le.allowStateReads=n}function jh(n){if(n.dependenciesState!==ft.UP_TO_DATE){n.dependenciesState=ft.UP_TO_DATE;for(var e=n.observing,t=e.length;t--;)e[t].lowestObserverState=ft.UP_TO_DATE}}var Rs=0,Hb=1,Bh=Object.getOwnPropertyDescriptor(function(){},"name"),zb=Bh&&Bh.configurable;function Di(n,e,t){process.env.NODE_ENV!=="production"&&(Ot(typeof e=="function","`action` can only be invoked on functions"),(typeof n!="string"||!n)&&Ie("actions should have valid names, got: '"+n+"'"));var r=function(){return Fh(n,e,t||this,arguments)};return r.isMobxAction=!0,process.env.NODE_ENV!=="production"&&zb&&Object.defineProperty(r,"name",{value:n}),r}function Fh(n,e,t,r){var i=Wb(n,t,r);try{return e.apply(t,r)}catch(o){throw i.error=o,o}finally{Xb(i)}}function Wb(n,e,t){var r=Ut()&&!!n,i=0;if(r&&process.env.NODE_ENV!=="production"){i=Date.now();var o=t&&t.length||0,a=new Array(o);if(o>0)for(var s=0;s<o;s++)a[s]=t[s];Mn({type:"action",name:n,object:e,arguments:a})}var l=co();ar();var u=Ls(!0),d=sd(!0),f={prevDerivation:l,prevAllowStateChanges:u,prevAllowStateReads:d,notifySpy:r,startTime:i,actionId:Hb++,parentActionId:Rs};return Rs=f.actionId,f}function Xb(n){Rs!==n.actionId&&Ie("invalid action stack. did you forget to finish an action?"),Rs=n.parentActionId,n.error!==void 0&&(le.suppressReactionErrors=!0),Is(n.prevAllowStateChanges),fa(n.prevAllowStateReads),sr(),oi(n.prevDerivation),n.notifySpy&&process.env.NODE_ENV!=="production"&&Nn({time:Date.now()-n.startTime}),le.suppressReactionErrors=!1}function Ls(n){var e=le.allowStateChanges;return le.allowStateChanges=n,e}function Is(n){le.allowStateChanges=n}var Ri=(function(n){Cb(e,n);function e(t,r,i,o,a){i===void 0&&(i="ObservableValue@"+xn()),o===void 0&&(o=!0),a===void 0&&(a=so.default);var s=n.call(this,i)||this;return s.enhancer=r,s.name=i,s.equals=a,s.hasUnreportedChange=!1,s.value=r(t,void 0,i),o&&Ut()&&process.env.NODE_ENV!=="production"&&Li({type:"create",name:s.name,newValue:""+s.value}),s}return e.prototype.dehanceValue=function(t){return this.dehancer!==void 0?this.dehancer(t):t},e.prototype.set=function(t){var r=this.value;if(t=this.prepareNewValue(t),t!==le.UNCHANGED){var i=Ut();i&&process.env.NODE_ENV!=="production"&&Mn({type:"update",name:this.name,newValue:t,oldValue:r}),this.setNewValue(t),i&&process.env.NODE_ENV!=="production"&&Nn()}},e.prototype.prepareNewValue=function(t){if(fo(this),Or(this)){var r=Ar(this,{object:this,type:"update",newValue:t});if(!r)return le.UNCHANGED;t=r.newValue}return t=this.enhancer(t,this.value,this.name),this.equals(this.value,t)?le.UNCHANGED:t},e.prototype.setNewValue=function(t){var r=this.value;this.value=t,this.reportChanged(),dr(this)&&fr(this,{type:"update",object:this,newValue:t,oldValue:r})},e.prototype.get=function(){return this.reportObserved(),this.dehanceValue(this.value)},e.prototype.intercept=function(t){return ha(this,t)},e.prototype.observe=function(t,r){return r&&t({object:this,type:"update",newValue:this.value,oldValue:void 0}),pa(this,t)},e.prototype.toJSON=function(){return this.get()},e.prototype.toString=function(){return this.name+"["+this.value+"]"},e.prototype.valueOf=function(){return Mh(this.get())},e.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},e})(ao),Gb=ii("ObservableValue",Ri),ho=(function(){function n(e){this.dependenciesState=ft.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=ft.UP_TO_DATE,this.unboundDepsCount=0,this.__mapid="#"+xn(),this.value=new Ds(null),this.isComputing=!1,this.isRunningSetter=!1,this.isTracing=or.NONE,Ot(e.get,"missing option for computed: get"),this.derivation=e.get,this.name=e.name||"ComputedValue@"+xn(),e.set&&(this.setter=Di(this.name+"-setter",e.set)),this.equals=e.equals||(e.compareStructural||e.struct?so.structural:so.default),this.scope=e.context,this.requiresReaction=!!e.requiresReaction,this.keepAlive=!!e.keepAlive}return n.prototype.onBecomeStale=function(){Zb(this)},n.prototype.onBecomeObserved=function(){this.onBecomeObservedListeners&&this.onBecomeObservedListeners.forEach(function(e){return e()})},n.prototype.onBecomeUnobserved=function(){this.onBecomeUnobservedListeners&&this.onBecomeUnobservedListeners.forEach(function(e){return e()})},n.prototype.get=function(){this.isComputing&&Ie("Cycle detected in computation "+this.name+": "+this.derivation),le.inBatch===0&&this.observers.size===0&&!this.keepAlive?od(this)&&(this.warnAboutUntrackedRead(),ar(),this.value=this.computeValue(!1),sr()):(Wh(this),od(this)&&this.trackAndCompute()&&qb(this));var e=this.value;if(da(e))throw e.cause;return e},n.prototype.peek=function(){var e=this.computeValue(!1);if(da(e))throw e.cause;return e},n.prototype.set=function(e){if(this.setter){Ot(!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,e)}finally{this.isRunningSetter=!1}}else Ot(!1,process.env.NODE_ENV!=="production"&&"[ComputedValue '"+this.name+"'] It is not possible to assign a new value to a computed value.")},n.prototype.trackAndCompute=function(){Ut()&&process.env.NODE_ENV!=="production"&&Li({object:this.scope,type:"compute",name:this.name});var e=this.value,t=this.dependenciesState===ft.NOT_TRACKING,r=this.computeValue(!0),i=t||da(e)||da(r)||!this.equals(e,r);return i&&(this.value=r),i},n.prototype.computeValue=function(e){this.isComputing=!0,le.computationDepth++;var t;if(e)t=Ih(this,this.derivation,this.scope);else if(le.disableErrorBoundaries===!0)t=this.derivation.call(this.scope);else try{t=this.derivation.call(this.scope)}catch(r){t=new Ds(r)}return le.computationDepth--,this.isComputing=!1,t},n.prototype.suspend=function(){this.keepAlive||(ad(this),this.value=void 0)},n.prototype.observe=function(e,t){var r=this,i=!0,o=void 0;return sx(function(){var a=r.get();if(!i||t){var s=co();e({type:"update",object:r,newValue:a,oldValue:o}),oi(s)}i=!1,o=a})},n.prototype.warnAboutUntrackedRead=function(){process.env.NODE_ENV!=="production"&&(this.requiresReaction===!0&&Ie("[mobx] Computed value "+this.name+" is read outside a reactive context"),this.isTracing!==or.NONE&&console.log("[mobx.trace] '"+this.name+"' is being read outside a reactive context. Doing a full recompute"),le.computedRequiresReaction&&console.warn("[mobx] Computed value "+this.name+" is being read outside a reactive context. Doing a full recompute"))},n.prototype.toJSON=function(){return this.get()},n.prototype.toString=function(){return this.name+"["+this.derivation.toString()+"]"},n.prototype.valueOf=function(){return Mh(this.get())},n.prototype[Symbol.toPrimitive]=function(){return this.valueOf()},n})(),po=ii("ComputedValue",ho),ks=(function(){function n(){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}return n})(),Ub={};function js(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Ub}var Bs=!0,$h=!1,le=(function(){var n=js();return n.__mobxInstanceCount>0&&!n.__mobxGlobals&&(Bs=!1),n.__mobxGlobals&&n.__mobxGlobals.version!==new ks().version&&(Bs=!1),Bs?n.__mobxGlobals?(n.__mobxInstanceCount+=1,n.__mobxGlobals.UNCHANGED||(n.__mobxGlobals.UNCHANGED={}),n.__mobxGlobals):(n.__mobxInstanceCount=1,n.__mobxGlobals=new ks):(setTimeout(function(){$h||Ie("There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`")},1),new ks)})();function Yb(){(le.pendingReactions.length||le.inBatch||le.isRunningReactions)&&Ie("isolateGlobalState should be called before MobX is running any reactions"),$h=!0,Bs&&(--js().__mobxInstanceCount===0&&(js().__mobxGlobals=void 0),le=new ks)}function ld(){return le}function Vb(n,e){n.observers.add(e),n.lowestObserverState>e.dependenciesState&&(n.lowestObserverState=e.dependenciesState)}function Hh(n,e){n.observers.delete(e),n.observers.size===0&&zh(n)}function zh(n){n.isPendingUnobservation===!1&&(n.isPendingUnobservation=!0,le.pendingUnobservations.push(n))}function ar(){le.inBatch++}function sr(){if(--le.inBatch===0){Yh();for(var n=le.pendingUnobservations,e=0;e<n.length;e++){var t=n[e];t.isPendingUnobservation=!1,t.observers.size===0&&(t.isBeingObserved&&(t.isBeingObserved=!1,t.onBecomeUnobserved()),t instanceof ho&&t.suspend())}le.pendingUnobservations=[]}}function Wh(n){Bb(n);var e=le.trackingDerivation;return e!==null?(e.runId!==n.lastAccessedBy&&(n.lastAccessedBy=e.runId,e.newObserving[e.unboundDepsCount++]=n,n.isBeingObserved||(n.isBeingObserved=!0,n.onBecomeObserved())),!0):(n.observers.size===0&&le.inBatch>0&&zh(n),!1)}function Kb(n){n.lowestObserverState!==ft.STALE&&(n.lowestObserverState=ft.STALE,n.observers.forEach(function(e){e.dependenciesState===ft.UP_TO_DATE&&(e.isTracing!==or.NONE&&Xh(e,n),e.onBecomeStale()),e.dependenciesState=ft.STALE}))}function qb(n){n.lowestObserverState!==ft.STALE&&(n.lowestObserverState=ft.STALE,n.observers.forEach(function(e){e.dependenciesState===ft.POSSIBLY_STALE?e.dependenciesState=ft.STALE:e.dependenciesState===ft.UP_TO_DATE&&(n.lowestObserverState=ft.UP_TO_DATE)}))}function Zb(n){n.lowestObserverState===ft.UP_TO_DATE&&(n.lowestObserverState=ft.POSSIBLY_STALE,n.observers.forEach(function(e){e.dependenciesState===ft.UP_TO_DATE&&(e.dependenciesState=ft.POSSIBLY_STALE,e.isTracing!==or.NONE&&Xh(e,n),e.onBecomeStale())}))}function Xh(n,e){if(console.log("[mobx.trace] '"+n.name+"' is invalidated due to a change in: '"+e.name+"'"),n.isTracing===or.BREAK){var t=[];Gh(cx(n),t,1),new Function(`debugger;
|
|
36
|
+
/*
|
|
37
|
+
Tracing '`+n.name+`'
|
|
38
|
+
|
|
39
|
+
You are entering this break point because derivation '`+n.name+"' is being traced and '"+e.name+`' is now forcing it to update.
|
|
40
|
+
Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update
|
|
41
|
+
The stackframe you are looking for is at least ~6-8 stack-frames up.
|
|
42
|
+
|
|
43
|
+
`+(n instanceof ho?n.derivation.toString().replace(/[*]\//g,"/"):"")+`
|
|
44
|
+
|
|
45
|
+
The dependencies for this derivation are:
|
|
46
|
+
|
|
47
|
+
`+t.join(`
|
|
48
|
+
`)+`
|
|
49
|
+
*/
|
|
50
|
+
`)()}}function Gh(n,e,t){if(e.length>=1e3){e.push("(and many more)");return}e.push(""+new Array(t).join(" ")+n.name),n.dependencies&&n.dependencies.forEach(function(r){return Gh(r,e,t+1)})}var ca=(function(){function n(e,t,r,i){e===void 0&&(e="Reaction@"+xn()),i===void 0&&(i=!1),this.name=e,this.onInvalidate=t,this.errorHandler=r,this.requiresObservable=i,this.observing=[],this.newObserving=[],this.dependenciesState=ft.NOT_TRACKING,this.diffValue=0,this.runId=0,this.unboundDepsCount=0,this.__mapid="#"+xn(),this.isDisposed=!1,this._isScheduled=!1,this._isTrackPending=!1,this._isRunning=!1,this.isTracing=or.NONE}return n.prototype.onBecomeStale=function(){this.schedule()},n.prototype.schedule=function(){this._isScheduled||(this._isScheduled=!0,le.pendingReactions.push(this),Yh())},n.prototype.isScheduled=function(){return this._isScheduled},n.prototype.runReaction=function(){if(!this.isDisposed){if(ar(),this._isScheduled=!1,od(this)){this._isTrackPending=!0;try{this.onInvalidate(),this._isTrackPending&&Ut()&&process.env.NODE_ENV!=="production"&&Li({name:this.name,type:"scheduled-reaction"})}catch(e){this.reportExceptionInDerivation(e)}}sr()}},n.prototype.track=function(e){if(!this.isDisposed){ar();var t=Ut(),r;t&&process.env.NODE_ENV!=="production"&&(r=Date.now(),Mn({name:this.name,type:"reaction"})),this._isRunning=!0;var i=Ih(this,e,void 0);this._isRunning=!1,this._isTrackPending=!1,this.isDisposed&&ad(this),da(i)&&this.reportExceptionInDerivation(i.cause),t&&process.env.NODE_ENV!=="production"&&Nn({time:Date.now()-r}),sr()}},n.prototype.reportExceptionInDerivation=function(e){var t=this;if(this.errorHandler){this.errorHandler(e,this);return}if(le.disableErrorBoundaries)throw e;var r="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";le.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name+"' suppressed, fix error of causing action below)"):console.error(r,e),Ut()&&Li({type:"error",name:this.name,message:r,error:""+e}),le.globalReactionErrorHandlers.forEach(function(i){return i(e,t)})},n.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._isRunning||(ar(),ad(this),sr()))},n.prototype.getDisposer=function(){var e=this.dispose.bind(this);return e[Re]=this,e},n.prototype.toString=function(){return"Reaction["+this.name+"]"},n.prototype.trace=function(e){e===void 0&&(e=!1),mx(this,e)},n})(),Uh=100,ud=function(n){return n()};function Yh(){le.inBatch>0||le.isRunningReactions||ud(Qb)}function Qb(){le.isRunningReactions=!0;for(var n=le.pendingReactions,e=0;n.length>0;){++e===Uh&&(console.error("Reaction doesn't converge to a stable state after "+Uh+" iterations."+(" Probably there is a cycle in the reactive function: "+n[0])),n.splice(0));for(var t=n.splice(0),r=0,i=t.length;r<i;r++)t[r].runReaction()}le.isRunningReactions=!1}var Fs=ii("Reaction",ca);function Jb(n){var e=ud;ud=function(t){return n(function(){return e(t)})}}function Ut(){return process.env.NODE_ENV!=="production"&&!!le.spyListeners.length}function Li(n){if(process.env.NODE_ENV!=="production"&&le.spyListeners.length)for(var e=le.spyListeners,t=0,r=e.length;t<r;t++)e[t](n)}function Mn(n){if(process.env.NODE_ENV!=="production"){var e=wt(wt({},n),{spyReportStart:!0});Li(e)}}var ex={spyReportEnd:!0};function Nn(n){process.env.NODE_ENV!=="production"&&Li(n?wt(wt({},n),{spyReportEnd:!0}):ex)}function tx(n){return process.env.NODE_ENV==="production"?(console.warn("[mobx.spy] Is a no-op in production builds"),function(){}):(le.spyListeners.push(n),Zu(function(){le.spyListeners=le.spyListeners.filter(function(e){return e!==n})}))}function nx(){Ie(process.env.NODE_ENV!=="production"&&"@action fields are not reassignable")}function Vh(n){return function(e,t,r){if(r){if(process.env.NODE_ENV!=="production"&&r.get!==void 0)return Ie("@action cannot be used with getters");if(r.value)return{value:Di(n,r.value),enumerable:!1,configurable:!0,writable:!0};var i=r.initializer;return{enumerable:!1,configurable:!0,writable:!0,initializer:function(){return Di(n,i.call(this))}}}return rx(n).apply(this,arguments)}}function rx(n){return function(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get:function(){},set:function(i){io(this,t,H(n,i))}})}}function ix(n,e,t,r){return r===!0?(dd(n,e,t.value),null):t?{configurable:!0,enumerable:!1,get:function(){return dd(this,e,t.value||t.initializer.call(this)),this[e]},set:nx}:{enumerable:!1,configurable:!0,set:function(i){dd(this,e,i)},get:function(){}}}var H=function(e,t,r,i){if(arguments.length===1&&typeof e=="function")return Di(e.name||"<unnamed action>",e);if(arguments.length===2&&typeof t=="function")return Di(e,t);if(arguments.length===1&&typeof e=="string")return Vh(e);if(i===!0)io(e,t,Di(e.name||t,r.value,this));else return Vh(t).apply(null,arguments)};H.bound=ix;function ox(n,e){var t=typeof n=="string"?n:n.name||"<unnamed action>",r=typeof n=="function"?n:e;return process.env.NODE_ENV!=="production"&&(Ot(typeof r=="function"&&r.length===0,"`runInAction` expects a function without arguments"),(typeof t!="string"||!t)&&Ie("actions should have valid names, got: '"+t+"'")),Fh(t,r,this,void 0)}function ax(n){return typeof n=="function"&&n.isMobxAction===!0}function dd(n,e,t){io(n,e,Di(e,t.bind(n)))}function sx(n,e){e===void 0&&(e=qu),process.env.NODE_ENV!=="production"&&(Ot(typeof n=="function","Autorun expects a function as first argument"),Ot(ax(n)===!1,"Autorun does not accept actions since actions are untrackable"));var t=e&&e.name||n.name||"Autorun@"+xn(),r=!e.scheduler&&!e.delay,i;if(r)i=new ca(t,function(){this.track(s)},e.onError,e.requiresObservable);else{var o=Kh(e),a=!1;i=new ca(t,function(){a||(a=!0,o(function(){a=!1,i.isDisposed||i.track(s)}))},e.onError,e.requiresObservable)}function s(){n(i)}return i.schedule(),i.getDisposer()}var lx=function(n){return n()};function Kh(n){return n.scheduler?n.scheduler:n.delay?function(e){return setTimeout(e,n.delay)}:lx}function qh(n,e,t){t===void 0&&(t=qu),process.env.NODE_ENV!=="production"&&(Ot(typeof n=="function","First argument to reaction should be a function"),Ot(typeof t=="object","Third argument of reactions should be an object"));var r=t.name||"Reaction@"+xn(),i=H(r,t.onError?ux(t.onError,e):e),o=!t.scheduler&&!t.delay,a=Kh(t),s=!0,l=!1,u,d=t.compareStructural?so.structural:t.equals||so.default,f=new ca(r,function(){s||o?c():l||(l=!0,a(c))},t.onError,t.requiresObservable);function c(){if(l=!1,!f.isDisposed){var h=!1;f.track(function(){var p=n(f);h=s||!d(u,p),u=p}),s&&t.fireImmediately&&i(u,f),!s&&h===!0&&i(u,f),s&&(s=!1)}}return f.schedule(),f.getDisposer()}function ux(n,e){return function(){try{return e.apply(this,arguments)}catch(t){n.call(this,t)}}}function dx(n,e,t){return Qh("onBecomeObserved",n,e)}function Zh(n,e,t){return Qh("onBecomeUnobserved",n,e)}function Qh(n,e,t,r){var i=li(e),o=t,a=n+"Listeners";i[a]?i[a].add(o):i[a]=new Set([o]);var s=i[n];return typeof s!="function"?Ie(process.env.NODE_ENV!=="production"&&"Not an atom that can be (un)observed"):function(){var l=i[a];l&&(l.delete(o),l.size===0&&delete i[a])}}function fx(n){var e=n.enforceActions,t=n.computedRequiresReaction,r=n.computedConfigurable,i=n.disableErrorBoundaries,o=n.reactionScheduler,a=n.reactionRequiresObservable,s=n.observableRequiresReaction;if(Yb(),e!==void 0){(typeof e=="boolean"||e==="strict")&&_b(`Deprecated value for 'enforceActions', use 'false' => '"never"', 'true' => '"observed"', '"strict"' => "'always'" instead`);var l=void 0;switch(e){case!0:case"observed":l=!0;break;case!1:case"never":l=!1;break;case"strict":case"always":l="strict";break;default:Ie("Invalid value for 'enforceActions': '"+e+"', expected 'never', 'always' or 'observed'")}le.enforceActions=l,le.allowStateChanges=!(l===!0||l==="strict")}t!==void 0&&(le.computedRequiresReaction=!!t),a!==void 0&&(le.reactionRequiresObservable=!!a),s!==void 0&&(le.observableRequiresReaction=!!s,le.allowStateReads=!le.observableRequiresReaction),r!==void 0&&(le.computedConfigurable=!!r),i!==void 0&&(i===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),le.disableErrorBoundaries=!!i),o&&Jb(o)}function fd(n,e,t,r){process.env.NODE_ENV!=="production"&&(Ot(arguments.length>=2&&arguments.length<=4,"'extendObservable' expected 2-4 arguments"),Ot(typeof n=="object","'extendObservable' expects an object as first argument"),Ot(!dn(n),"'extendObservable' should not be used on maps, use map.merge instead")),r=uo(r);var i=Jh(r);return Pi(n),pd(n,r.name,i.enhancer),e&&ep(n,e,t,i),n}function Jh(n){return n.defaultDecorator||(n.deep===!1?Rh:id)}function ep(n,e,t,r){var i,o,a,s;if(process.env.NODE_ENV!=="production"&&(Ot(!ai(e),"Extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540"),t)){var l=Ju(t);try{for(var u=ir(l),d=u.next();!d.done;d=u.next()){var f=d.value;f in e||Ie("Trying to declare a decorator for unspecified property '"+Xn(f)+"'")}}catch(y){i={error:y}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(i)throw i.error}}}ar();try{var l=Sb(e);try{for(var c=ir(l),h=c.next();!h.done;h=c.next()){var f=h.value,p=Object.getOwnPropertyDescriptor(e,f);process.env.NODE_ENV!=="production"&&(Ni(e)||Ie("'extendObservable' only accepts plain objects as second argument"),rp(p.value)&&Ie("Passing a 'computed' as initial property value is no longer supported by extendObservable. Use a getter or decorator instead"));var v=t&&f in t?t[f]:p.get?Ps:r;process.env.NODE_ENV!=="production"&&typeof v!="function"&&Ie("Not a valid decorator for '"+Xn(f)+"', got: "+v);var g=v(n,f,p,!0);g&&Object.defineProperty(n,f,g)}}catch(m){a={error:m}}finally{try{h&&!h.done&&(s=c.return)&&s.call(c)}finally{if(a)throw a.error}}}finally{sr()}}function cx(n,e){return tp(li(n,e))}function tp(n){var e={name:n.name};return n.observing&&n.observing.length>0&&(e.dependencies=bb(n.observing).map(tp)),e}function np(n,e){if(n==null)return!1;if(e!==void 0){if(cr(n)===!1||!n[Re].values.has(e))return!1;var t=li(n,e);return po(t)}return po(n)}function rp(n){return arguments.length>1?Ie(process.env.NODE_ENV!=="production"&&"isComputed expects only 1 argument. Use isObservableProp to inspect the observability of a property"):np(n)}function ip(n,e){return typeof e!="string"?Ie(process.env.NODE_ENV!=="production"&&"isComputed expected a property name as second argument"):np(n,e)}function hx(n,e){return n==null?!1:cr(n)||!!n[Re]||ed(n)||Fs(n)||po(n)}function ai(n){return arguments.length!==1&&Ie(process.env.NODE_ENV!=="production"&&"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),hx(n)}function vo(n){return cr(n)?n[Re].getKeys():dn(n)||Gn(n)?Array.from(n.keys()):Cr(n)?n.map(function(e,t){return t}):Ie(process.env.NODE_ENV!=="production"&&"'keys()' can only be used on observable objects, arrays, sets and maps")}function px(n){return cr(n)?vo(n).map(function(e){return n[e]}):dn(n)?vo(n).map(function(e){return n.get(e)}):Gn(n)?Array.from(n.values()):Cr(n)?n.slice():Ie(process.env.NODE_ENV!=="production"&&"'values()' can only be used on observable objects, arrays, sets and maps")}function vx(n){return cr(n)?vo(n).map(function(e){return[e,n[e]]}):dn(n)?vo(n).map(function(e){return[e,n.get(e)]}):Gn(n)?Array.from(n.entries()):Cr(n)?n.map(function(e,t){return[t,e]}):Ie(process.env.NODE_ENV!=="production"&&"'entries()' can only be used on observable objects, arrays and maps")}function cd(n,e,t){if(arguments.length===2&&!Gn(n)){ar();var r=e;try{for(var i in r)cd(n,i,r[i])}finally{sr()}return}if(cr(n)){var o=n[Re],a=o.values.get(e);a?o.write(e,t):o.addObservableProp(e,t,o.defaultEnhancer)}else if(dn(n))n.set(e,t);else if(Gn(n))n.add(e);else if(Cr(n))typeof e!="number"&&(e=parseInt(e,10)),Ot(e>=0,"Not a valid index: '"+e+"'"),ar(),e>=n.length&&(n.length=e+1),n[e]=t,sr();else return Ie(process.env.NODE_ENV!=="production"&&"'set()' can only be used on observable objects, arrays and maps")}function op(n,e,t,r){return gx(n,e,t)}function gx(n,e,t){return zs(n).observe(e,t)}var yx={detectCycles:!0,exportMapsAsObjects:!0,recurseEverything:!1};function go(n,e,t,r){return r.detectCycles&&n.set(e,t),t}function si(n,e,t){if(!e.recurseEverything&&!ai(n)||typeof n!="object")return n;if(n===null)return null;if(n instanceof Date)return n;if(Gb(n))return si(n.get(),e,t);ai(n)&&vo(n);var r=e.detectCycles===!0;if(r&&n!==null&&t.has(n))return t.get(n);if(Cr(n)||Array.isArray(n)){var i=go(t,n,[],e),o=n.map(function(h){return si(h,e,t)});i.length=o.length;for(var a=0,s=o.length;a<s;a++)i[a]=o[a];return i}if(Gn(n)||Object.getPrototypeOf(n)===Set.prototype)if(e.exportMapsAsObjects===!1){var l=go(t,n,new Set,e);return n.forEach(function(h){l.add(si(h,e,t))}),l}else{var u=go(t,n,[],e);return n.forEach(function(h){u.push(si(h,e,t))}),u}if(dn(n)||Object.getPrototypeOf(n)===Map.prototype)if(e.exportMapsAsObjects===!1){var d=go(t,n,new Map,e);return n.forEach(function(h,p){d.set(p,si(h,e,t))}),d}else{var f=go(t,n,{},e);return n.forEach(function(h,p){f[p]=si(h,e,t)}),f}var c=go(t,n,{},e);return Ju(n).forEach(function(h){c[h]=si(n[h],e,t)}),c}function lr(n,e){typeof e=="boolean"&&(e={detectCycles:e}),e||(e=yx),e.detectCycles=e.detectCycles===void 0?e.recurseEverything===!0:e.detectCycles===!0;var t;return e.detectCycles&&(t=new Map),si(n,e,t)}function mx(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=!1;typeof n[n.length-1]=="boolean"&&(t=n.pop());var r=_x(n);if(!r)return Ie(process.env.NODE_ENV!=="production"&&"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");r.isTracing===or.NONE&&console.log("[mobx.trace] '"+r.name+"' tracing enabled"),r.isTracing=t?or.BREAK:or.LOG}function _x(n){switch(n.length){case 0:return le.trackingDerivation;case 1:return li(n[0]);case 2:return li(n[0],n[1])}}function ur(n,e){e===void 0&&(e=void 0),ar();try{return n.apply(e)}finally{sr()}}function $s(n){return n[Re]}function Hs(n){return typeof n=="string"||typeof n=="number"||typeof n=="symbol"}var bx={has:function(n,e){if(e===Re||e==="constructor"||e===Cs)return!0;var t=$s(n);return Hs(e)?t.has(e):e in n},get:function(n,e){if(e===Re||e==="constructor"||e===Cs)return n[e];var t=$s(n),r=t.values.get(e);if(r instanceof ao){var i=r.get();return i===void 0&&t.has(e),i}return Hs(e)&&t.has(e),n[e]},set:function(n,e,t){return Hs(e)?(cd(n,e,t),!0):!1},deleteProperty:function(n,e){if(!Hs(e))return!1;var t=$s(n);return t.remove(e),!0},ownKeys:function(n){var e=$s(n);return e.keysAtom.reportObserved(),Reflect.ownKeys(n)},preventExtensions:function(n){return Ie("Dynamic observable objects cannot be frozen"),!1}};function xx(n){var e=new Proxy(n,bx);return n[Re].proxy=e,e}function Or(n){return n.interceptors!==void 0&&n.interceptors.length>0}function ha(n,e){var t=n.interceptors||(n.interceptors=[]);return t.push(e),Zu(function(){var r=t.indexOf(e);r!==-1&&t.splice(r,1)})}function Ar(n,e){var t=co();try{for(var r=rd(n.interceptors||[]),i=0,o=r.length;i<o&&(e=r[i](e),Ot(!e||e.type,"Intercept handlers should return nothing or a change object"),!!e);i++);return e}finally{oi(t)}}function dr(n){return n.changeListeners!==void 0&&n.changeListeners.length>0}function pa(n,e){var t=n.changeListeners||(n.changeListeners=[]);return t.push(e),Zu(function(){var r=t.indexOf(e);r!==-1&&t.splice(r,1)})}function fr(n,e){var t=co(),r=n.changeListeners;if(r){r=r.slice();for(var i=0,o=r.length;i<o;i++)r[i](e);oi(t)}}var Ex=1e4,wx={get:function(n,e){return e===Re?n[Re]:e==="length"?n[Re].getArrayLength():typeof e=="number"?Xr.get.call(n,e):typeof e=="string"&&!isNaN(e)?Xr.get.call(n,parseInt(e)):Xr.hasOwnProperty(e)?Xr[e]:n[e]},set:function(n,e,t){return e==="length"&&n[Re].setArrayLength(t),typeof e=="number"&&Xr.set.call(n,e,t),typeof e=="symbol"||isNaN(e)?n[e]=t:Xr.set.call(n,parseInt(e),t),!0},preventExtensions:function(n){return Ie("Observable arrays cannot be frozen"),!1}};function Sx(n,e,t,r){t===void 0&&(t="ObservableArray@"+xn()),r===void 0&&(r=!1);var i=new ap(t,e,r);Eb(i.values,Re,i);var o=new Proxy(i.values,wx);if(i.proxy=o,n&&n.length){var a=Ls(!0);i.spliceWithArray(0,0,n),Is(a)}return o}var ap=(function(){function n(e,t,r){this.owned=r,this.values=[],this.proxy=void 0,this.lastKnownLength=0,this.atom=new ao(e||"ObservableArray@"+xn()),this.enhancer=function(i,o){return t(i,o,e+"[..]")}}return n.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},n.prototype.dehanceValues=function(e){return this.dehancer!==void 0&&e.length>0?e.map(this.dehancer):e},n.prototype.intercept=function(e){return ha(this,e)},n.prototype.observe=function(e,t){return t===void 0&&(t=!1),t&&e({object:this.proxy,type:"splice",index:0,added:this.values.slice(),addedCount:this.values.length,removed:[],removedCount:0}),pa(this,e)},n.prototype.getArrayLength=function(){return this.atom.reportObserved(),this.values.length},n.prototype.setArrayLength=function(e){if(typeof e!="number"||e<0)throw new Error("[mobx.array] Out of range: "+e);var t=this.values.length;if(e!==t)if(e>t){for(var r=new Array(e-t),i=0;i<e-t;i++)r[i]=void 0;this.spliceWithArray(t,0,r)}else this.spliceWithArray(e,t-e)},n.prototype.updateArrayLength=function(e,t){if(e!==this.lastKnownLength)throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed.");this.lastKnownLength+=t},n.prototype.spliceWithArray=function(e,t,r){var i=this;fo(this.atom);var o=this.values.length;if(e===void 0?e=0:e>o?e=o:e<0&&(e=Math.max(0,o+e)),arguments.length===1?t=o-e:t==null?t=0:t=Math.max(0,Math.min(t,o-e)),r===void 0&&(r=Os),Or(this)){var a=Ar(this,{object:this.proxy,type:"splice",index:e,removedCount:t,added:r});if(!a)return Os;t=a.removedCount,r=a.added}if(r=r.length===0?r:r.map(function(u){return i.enhancer(u,void 0)}),process.env.NODE_ENV!=="production"){var s=r.length-t;this.updateArrayLength(o,s)}var l=this.spliceItemsIntoValues(e,t,r);return(t!==0||r.length!==0)&&this.notifyArraySplice(e,r,l),this.dehanceValues(l)},n.prototype.spliceItemsIntoValues=function(e,t,r){var i;if(r.length<Ex)return(i=this.values).splice.apply(i,rd([e,t],r));var o=this.values.slice(e,e+t);return this.values=this.values.slice(0,e).concat(r,this.values.slice(e+t)),o},n.prototype.notifyArrayChildUpdate=function(e,t,r){var i=!this.owned&&Ut(),o=dr(this),a=o||i?{object:this.proxy,type:"update",index:e,newValue:t,oldValue:r}:null;i&&process.env.NODE_ENV!=="production"&&Mn(wt(wt({},a),{name:this.atom.name})),this.atom.reportChanged(),o&&fr(this,a),i&&process.env.NODE_ENV!=="production"&&Nn()},n.prototype.notifyArraySplice=function(e,t,r){var i=!this.owned&&Ut(),o=dr(this),a=o||i?{object:this.proxy,type:"splice",index:e,removed:r,added:t,removedCount:r.length,addedCount:t.length}:null;i&&process.env.NODE_ENV!=="production"&&Mn(wt(wt({},a),{name:this.atom.name})),this.atom.reportChanged(),o&&fr(this,a),i&&process.env.NODE_ENV!=="production"&&Nn()},n})(),Xr={intercept:function(n){return this[Re].intercept(n)},observe:function(n,e){e===void 0&&(e=!1);var t=this[Re];return t.observe(n,e)},clear:function(){return this.splice(0)},replace:function(n){var e=this[Re];return e.spliceWithArray(0,e.values.length,n)},toJS:function(){return this.slice()},toJSON:function(){return this.toJS()},splice:function(n,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];var i=this[Re];switch(arguments.length){case 0:return[];case 1:return i.spliceWithArray(n);case 2:return i.spliceWithArray(n,e)}return i.spliceWithArray(n,e,t)},spliceWithArray:function(n,e,t){var r=this[Re];return r.spliceWithArray(n,e,t)},push:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=this[Re];return t.spliceWithArray(t.values.length,0,n),t.values.length},pop:function(){return this.splice(Math.max(this[Re].values.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=this[Re];return t.spliceWithArray(0,0,n),t.values.length},reverse:function(){process.env.NODE_ENV!=="production"&&console.warn("[mobx] `observableArray.reverse()` will not update the array in place. Use `observableArray.slice().reverse()` to suppress this warning and perform the operation on a copy, or `observableArray.replace(observableArray.slice().reverse())` to reverse & update in place");var n=this.slice();return n.reverse.apply(n,arguments)},sort:function(n){process.env.NODE_ENV!=="production"&&console.warn("[mobx] `observableArray.sort()` will not update the array in place. Use `observableArray.slice().sort()` to suppress this warning and perform the operation on a copy, or `observableArray.replace(observableArray.slice().sort())` to sort & update in place");var e=this.slice();return e.sort.apply(e,arguments)},remove:function(n){var e=this[Re],t=e.dehanceValues(e.values).indexOf(n);return t>-1?(this.splice(t,1),!0):!1},get:function(n){var e=this[Re];if(e){if(n<e.values.length)return e.atom.reportObserved(),e.dehanceValue(e.values[n]);console.warn("[mobx.array] Attempt to read an array index ("+n+") that is out of bounds ("+e.values.length+"). Please check length first. Out of bound indices will not be tracked by MobX")}},set:function(n,e){var t=this[Re],r=t.values;if(n<r.length){fo(t.atom);var i=r[n];if(Or(t)){var o=Ar(t,{type:"update",object:t.proxy,index:n,newValue:e});if(!o)return;e=o.newValue}e=t.enhancer(e,i);var a=e!==i;a&&(r[n]=e,t.notifyArrayChildUpdate(n,e,i))}else if(n===r.length)t.spliceWithArray(n,0,[e]);else throw new Error("[mobx.array] Index out of bounds, "+n+" is larger than "+r.length)}};["concat","flat","includes","indexOf","join","lastIndexOf","slice","toString","toLocaleString"].forEach(function(n){typeof Array.prototype[n]=="function"&&(Xr[n]=function(){var e=this[Re];e.atom.reportObserved();var t=e.dehanceValues(e.values);return t[n].apply(t,arguments)})}),["every","filter","find","findIndex","flatMap","forEach","map","some"].forEach(function(n){typeof Array.prototype[n]=="function"&&(Xr[n]=function(e,t){var r=this,i=this[Re];i.atom.reportObserved();var o=i.dehanceValues(i.values);return o[n](function(a,s){return e.call(t,a,s,r)},t)})}),["reduce","reduceRight"].forEach(function(n){Xr[n]=function(){var e=this,t=this[Re];t.atom.reportObserved();var r=arguments[0];return arguments[0]=function(i,o,a){return o=t.dehanceValue(o),r(i,o,a,e)},t.values[n].apply(t.values,arguments)}});var Ox=ii("ObservableArrayAdministration",ap);function Cr(n){return Qu(n)&&Ox(n[Re])}var sp,Ax={},hd=(function(){function n(e,t,r){if(t===void 0&&(t=la),r===void 0&&(r="ObservableMap@"+xn()),this.enhancer=t,this.name=r,this[sp]=Ax,this._keysAtom=td(this.name+".keys()"),this[Symbol.toStringTag]="Map",typeof Map!="function")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(e)}return n.prototype._has=function(e){return this._data.has(e)},n.prototype.has=function(e){var t=this;if(!le.trackingDerivation)return this._has(e);var r=this._hasMap.get(e);if(!r){var i=r=new Ri(this._has(e),Ts,this.name+"."+Xn(e)+"?",!1);this._hasMap.set(e,i),Zh(i,function(){return t._hasMap.delete(e)})}return r.get()},n.prototype.set=function(e,t){var r=this._has(e);if(Or(this)){var i=Ar(this,{type:r?"update":"add",object:this,newValue:t,name:e});if(!i)return this;t=i.newValue}return r?this._updateValue(e,t):this._addValue(e,t),this},n.prototype.delete=function(e){var t=this;if(fo(this._keysAtom),Or(this)){var r=Ar(this,{type:"delete",object:this,name:e});if(!r)return!1}if(this._has(e)){var i=Ut(),o=dr(this),r=o||i?{type:"delete",object:this,oldValue:this._data.get(e).value,name:e}:null;return i&&process.env.NODE_ENV!=="production"&&Mn(wt(wt({},r),{name:this.name,key:e})),ur(function(){t._keysAtom.reportChanged(),t._updateHasMapEntry(e,!1);var s=t._data.get(e);s.setNewValue(void 0),t._data.delete(e)}),o&&fr(this,r),i&&process.env.NODE_ENV!=="production"&&Nn(),!0}return!1},n.prototype._updateHasMapEntry=function(e,t){var r=this._hasMap.get(e);r&&r.setNewValue(t)},n.prototype._updateValue=function(e,t){var r=this._data.get(e);if(t=r.prepareNewValue(t),t!==le.UNCHANGED){var i=Ut(),o=dr(this),a=o||i?{type:"update",object:this,oldValue:r.value,name:e,newValue:t}:null;i&&process.env.NODE_ENV!=="production"&&Mn(wt(wt({},a),{name:this.name,key:e})),r.setNewValue(t),o&&fr(this,a),i&&process.env.NODE_ENV!=="production"&&Nn()}},n.prototype._addValue=function(e,t){var r=this;fo(this._keysAtom),ur(function(){var s=new Ri(t,r.enhancer,r.name+"."+Xn(e),!1);r._data.set(e,s),t=s.value,r._updateHasMapEntry(e,!0),r._keysAtom.reportChanged()});var i=Ut(),o=dr(this),a=o||i?{type:"add",object:this,name:e,newValue:t}:null;i&&process.env.NODE_ENV!=="production"&&Mn(wt(wt({},a),{name:this.name,key:e})),o&&fr(this,a),i&&process.env.NODE_ENV!=="production"&&Nn()},n.prototype.get=function(e){return this.has(e)?this.dehanceValue(this._data.get(e).get()):this.dehanceValue(void 0)},n.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},n.prototype.keys=function(){return this._keysAtom.reportObserved(),this._data.keys()},n.prototype.values=function(){var e=this,t=this.keys();return Ws({next:function(){var r=t.next(),i=r.done,o=r.value;return{done:i,value:i?void 0:e.get(o)}}})},n.prototype.entries=function(){var e=this,t=this.keys();return Ws({next:function(){var r=t.next(),i=r.done,o=r.value;return{done:i,value:i?void 0:[o,e.get(o)]}}})},n.prototype[sp=Re,Symbol.iterator]=function(){return this.entries()},n.prototype.forEach=function(e,t){var r,i;try{for(var o=ir(this),a=o.next();!a.done;a=o.next()){var s=lo(a.value,2),l=s[0],u=s[1];e.call(t,u,l,this)}}catch(d){r={error:d}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},n.prototype.merge=function(e){var t=this;return dn(e)&&(e=e.toJS()),ur(function(){var r=Ls(!0);try{Ni(e)?Ju(e).forEach(function(i){return t.set(i,e[i])}):Array.isArray(e)?e.forEach(function(i){var o=lo(i,2),a=o[0],s=o[1];return t.set(a,s)}):oo(e)?(e.constructor!==Map&&Ie("Cannot initialize from classes that inherit from Map: "+e.constructor.name),e.forEach(function(i,o){return t.set(o,i)})):e!=null&&Ie("Cannot initialize map from "+e)}finally{Is(r)}}),this},n.prototype.clear=function(){var e=this;ur(function(){kh(function(){var t,r;try{for(var i=ir(e.keys()),o=i.next();!o.done;o=i.next()){var a=o.value;e.delete(a)}}catch(s){t={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}})})},n.prototype.replace=function(e){var t=this;return ur(function(){var r,i,o,a,s=xb(e),l=new Map,u=!1;try{for(var d=ir(t._data.keys()),f=d.next();!f.done;f=d.next()){var c=f.value;if(!s.has(c)){var h=t.delete(c);if(h)u=!0;else{var p=t._data.get(c);l.set(c,p)}}}}catch(N){r={error:N}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}try{for(var v=ir(s.entries()),g=v.next();!g.done;g=v.next()){var y=lo(g.value,2),c=y[0],p=y[1],m=t._data.has(c);if(t.set(c,p),t._data.has(c)){var O=t._data.get(c);l.set(c,O),m||(u=!0)}}}catch(N){o={error:N}}finally{try{g&&!g.done&&(a=v.return)&&a.call(v)}finally{if(o)throw o.error}}if(!u)if(t._data.size!==l.size)t._keysAtom.reportChanged();else for(var T=t._data.keys(),C=l.keys(),A=T.next(),E=C.next();!A.done;){if(A.value!==E.value){t._keysAtom.reportChanged();break}A=T.next(),E=C.next()}t._data=l}),this},Object.defineProperty(n.prototype,"size",{get:function(){return this._keysAtom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),n.prototype.toPOJO=function(){var e,t,r={};try{for(var i=ir(this),o=i.next();!o.done;o=i.next()){var a=lo(o.value,2),s=a[0],l=a[1];r[typeof s=="symbol"?s:Xn(s)]=l}}catch(u){e={error:u}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r},n.prototype.toJS=function(){return new Map(this)},n.prototype.toJSON=function(){return this.toPOJO()},n.prototype.toString=function(){var e=this;return this.name+"[{ "+Array.from(this.keys()).map(function(t){return Xn(t)+": "+(""+e.get(t))}).join(", ")+" }]"},n.prototype.observe=function(e,t){return process.env.NODE_ENV!=="production"&&Ot(t!==!0,"`observe` doesn't support fireImmediately=true in combination with maps."),pa(this,e)},n.prototype.intercept=function(e){return ha(this,e)},n})(),dn=ii("ObservableMap",hd),lp,Cx={},up=(function(){function n(e,t,r){if(t===void 0&&(t=la),r===void 0&&(r="ObservableSet@"+xn()),this.name=r,this[lp]=Cx,this._data=new Set,this._atom=td(this.name),this[Symbol.toStringTag]="Set",typeof Set!="function")throw new Error("mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js");this.enhancer=function(i,o){return t(i,o,r)},e&&this.replace(e)}return n.prototype.dehanceValue=function(e){return this.dehancer!==void 0?this.dehancer(e):e},n.prototype.clear=function(){var e=this;ur(function(){kh(function(){var t,r;try{for(var i=ir(e._data.values()),o=i.next();!o.done;o=i.next()){var a=o.value;e.delete(a)}}catch(s){t={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}})})},n.prototype.forEach=function(e,t){var r,i;try{for(var o=ir(this),a=o.next();!a.done;a=o.next()){var s=a.value;e.call(t,s,s,this)}}catch(l){r={error:l}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},Object.defineProperty(n.prototype,"size",{get:function(){return this._atom.reportObserved(),this._data.size},enumerable:!0,configurable:!0}),n.prototype.add=function(e){var t=this;if(fo(this._atom),Or(this)){var r=Ar(this,{type:"add",object:this,newValue:e});if(!r)return this}if(!this.has(e)){ur(function(){t._data.add(t.enhancer(e,void 0)),t._atom.reportChanged()});var i=Ut(),o=dr(this),r=o||i?{type:"add",object:this,newValue:e}:null;i&&process.env.NODE_ENV!=="production"&&Mn(r),o&&fr(this,r),i&&process.env.NODE_ENV!=="production"&&Nn()}return this},n.prototype.delete=function(e){var t=this;if(Or(this)){var r=Ar(this,{type:"delete",object:this,oldValue:e});if(!r)return!1}if(this.has(e)){var i=Ut(),o=dr(this),r=o||i?{type:"delete",object:this,oldValue:e}:null;return i&&process.env.NODE_ENV!=="production"&&Mn(wt(wt({},r),{name:this.name})),ur(function(){t._atom.reportChanged(),t._data.delete(e)}),o&&fr(this,r),i&&process.env.NODE_ENV!=="production"&&Nn(),!0}return!1},n.prototype.has=function(e){return this._atom.reportObserved(),this._data.has(this.dehanceValue(e))},n.prototype.entries=function(){var e=0,t=Array.from(this.keys()),r=Array.from(this.values());return Ws({next:function(){var i=e;return e+=1,i<r.length?{value:[t[i],r[i]],done:!1}:{done:!0}}})},n.prototype.keys=function(){return this.values()},n.prototype.values=function(){this._atom.reportObserved();var e=this,t=0,r=Array.from(this._data.values());return Ws({next:function(){return t<r.length?{value:e.dehanceValue(r[t++]),done:!1}:{done:!0}}})},n.prototype.replace=function(e){var t=this;return Gn(e)&&(e=e.toJS()),ur(function(){var r=Ls(!0);try{Array.isArray(e)?(t.clear(),e.forEach(function(i){return t.add(i)})):aa(e)?(t.clear(),e.forEach(function(i){return t.add(i)})):e!=null&&Ie("Cannot initialize set from "+e)}finally{Is(r)}}),this},n.prototype.observe=function(e,t){return process.env.NODE_ENV!=="production"&&Ot(t!==!0,"`observe` doesn't support fireImmediately=true in combination with sets."),pa(this,e)},n.prototype.intercept=function(e){return ha(this,e)},n.prototype.toJS=function(){return new Set(this)},n.prototype.toString=function(){return this.name+"[ "+Array.from(this).join(", ")+" ]"},n.prototype[lp=Re,Symbol.iterator]=function(){return this.values()},n})(),Gn=ii("ObservableSet",up),dp=(function(){function n(e,t,r,i){t===void 0&&(t=new Map),this.target=e,this.values=t,this.name=r,this.defaultEnhancer=i,this.keysAtom=new ao(r+".keys")}return n.prototype.read=function(e){return this.values.get(e).get()},n.prototype.write=function(e,t){var r=this.target,i=this.values.get(e);if(i instanceof ho){i.set(t);return}if(Or(this)){var o=Ar(this,{type:"update",object:this.proxy||r,name:e,newValue:t});if(!o)return;t=o.newValue}if(t=i.prepareNewValue(t),t!==le.UNCHANGED){var a=dr(this),s=Ut(),o=a||s?{type:"update",object:this.proxy||r,oldValue:i.value,name:e,newValue:t}:null;s&&process.env.NODE_ENV!=="production"&&Mn(wt(wt({},o),{name:this.name,key:e})),i.setNewValue(t),a&&fr(this,o),s&&process.env.NODE_ENV!=="production"&&Nn()}},n.prototype.has=function(e){var t=this.pendingKeys||(this.pendingKeys=new Map),r=t.get(e);if(r)return r.get();var i=!!this.values.get(e);return r=new Ri(i,Ts,this.name+"."+Xn(e)+"?",!1),t.set(e,r),r.get()},n.prototype.addObservableProp=function(e,t,r){r===void 0&&(r=this.defaultEnhancer);var i=this.target;if(wb(i,e),Or(this)){var o=Ar(this,{object:this.proxy||i,name:e,type:"add",newValue:t});if(!o)return;t=o.newValue}var a=new Ri(t,r,this.name+"."+Xn(e),!1);this.values.set(e,a),t=a.value,Object.defineProperty(i,e,Tx(e)),this.notifyPropertyAddition(e,t)},n.prototype.addComputedProp=function(e,t,r){var i=this.target;r.name=r.name||this.name+"."+Xn(t),this.values.set(t,new ho(r)),(e===i||Th(e,t))&&Object.defineProperty(e,t,Mx(t))},n.prototype.remove=function(e){if(this.values.has(e)){var t=this.target;if(Or(this)){var r=Ar(this,{object:this.proxy||t,name:e,type:"remove"});if(!r)return}try{ar();var i=dr(this),o=Ut(),a=this.values.get(e),s=a&&a.get();if(a&&a.set(void 0),this.keysAtom.reportChanged(),this.values.delete(e),this.pendingKeys){var l=this.pendingKeys.get(e);l&&l.set(!1)}delete this.target[e];var r=i||o?{type:"remove",object:this.proxy||t,oldValue:s,name:e}:null;o&&process.env.NODE_ENV!=="production"&&Mn(wt(wt({},r),{name:this.name,key:e})),i&&fr(this,r),o&&process.env.NODE_ENV!=="production"&&Nn()}finally{sr()}}},n.prototype.illegalAccess=function(e,t){console.warn("Property '"+t+"' of '"+e+"' was accessed through the prototype chain. Use 'decorate' instead to declare the prop or access it statically through it's owner")},n.prototype.observe=function(e,t){return process.env.NODE_ENV!=="production"&&Ot(t!==!0,"`observe` doesn't support the fire immediately property for observable objects."),pa(this,e)},n.prototype.intercept=function(e){return ha(this,e)},n.prototype.notifyPropertyAddition=function(e,t){var r=dr(this),i=Ut(),o=r||i?{type:"add",object:this.proxy||this.target,name:e,newValue:t}:null;if(i&&process.env.NODE_ENV!=="production"&&Mn(wt(wt({},o),{name:this.name,key:e})),r&&fr(this,o),i&&process.env.NODE_ENV!=="production"&&Nn(),this.pendingKeys){var a=this.pendingKeys.get(e);a&&a.set(!0)}this.keysAtom.reportChanged()},n.prototype.getKeys=function(){var e,t;this.keysAtom.reportObserved();var r=[];try{for(var i=ir(this.values),o=i.next();!o.done;o=i.next()){var a=lo(o.value,2),s=a[0],l=a[1];l instanceof Ri&&r.push(s)}}catch(u){e={error:u}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r},n})();function pd(n,e,t){if(e===void 0&&(e=""),t===void 0&&(t=la),Object.prototype.hasOwnProperty.call(n,Re))return n[Re];process.env.NODE_ENV!=="production"&&Ot(Object.isExtensible(n),"Cannot make the designated object observable; it is not extensible"),Ni(n)||(e=(n.constructor.name||"ObservableObject")+"@"+xn()),e||(e="ObservableObject@"+xn());var r=new dp(n,new Map,Xn(e),t);return io(n,Re,r),r}var fp=Object.create(null),cp=Object.create(null);function Tx(n){return fp[n]||(fp[n]={configurable:!0,enumerable:!0,get:function(){return this[Re].read(n)},set:function(e){this[Re].write(n,e)}})}function hp(n){var e=n[Re];return e||(Pi(n),n[Re])}function Mx(n){return cp[n]||(cp[n]={configurable:le.computedConfigurable,enumerable:!1,get:function(){return hp(this).read(n)},set:function(e){hp(this).write(n,e)}})}var Nx=ii("ObservableObjectAdministration",dp);function cr(n){return Qu(n)?(Pi(n),Nx(n[Re])):!1}function li(n,e){if(typeof n=="object"&&n!==null){if(Cr(n))return e!==void 0&&Ie(process.env.NODE_ENV!=="production"&&"It is not possible to get index atoms from arrays"),n[Re].atom;if(Gn(n))return n[Re];if(dn(n)){var t=n;if(e===void 0)return t._keysAtom;var r=t._data.get(e)||t._hasMap.get(e);return r||Ie(process.env.NODE_ENV!=="production"&&"the entry '"+e+"' does not exist in the observable map '"+vd(n)+"'"),r}if(Pi(n),e&&!n[Re]&&n[e],cr(n)){if(!e)return Ie(process.env.NODE_ENV!=="production"&&"please specify a property");var r=n[Re].values.get(e);return r||Ie(process.env.NODE_ENV!=="production"&&"no observable property '"+e+"' found on the observable object '"+vd(n)+"'"),r}if(ed(n)||po(n)||Fs(n))return n}else if(typeof n=="function"&&Fs(n[Re]))return n[Re];return Ie(process.env.NODE_ENV!=="production"&&"Cannot obtain atom from "+n)}function zs(n,e){if(n||Ie("Expecting some object"),e!==void 0)return zs(li(n,e));if(ed(n)||po(n)||Fs(n)||dn(n)||Gn(n))return n;if(Pi(n),n[Re])return n[Re];Ie(process.env.NODE_ENV!=="production"&&"Cannot obtain administration from "+n)}function vd(n,e){var t;return e!==void 0?t=li(n,e):cr(n)||dn(n)||Gn(n)?t=zs(n):t=li(n),t.name}var pp=Object.prototype.toString;function vp(n,e,t){return t===void 0&&(t=-1),gd(n,e,t)}function gd(n,e,t,r,i){if(n===e)return n!==0||1/n===1/e;if(n==null||e==null)return!1;if(n!==n)return e!==e;var o=typeof n;if(o!=="function"&&o!=="object"&&typeof e!="object")return!1;var a=pp.call(n);if(a!==pp.call(e))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+n==""+e;case"[object Number]":return+n!=+n?+e!=+e:+n==0?1/+n===1/e:+n==+e;case"[object Date]":case"[object Boolean]":return+n==+e;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(n)===Symbol.valueOf.call(e);case"[object Map]":case"[object Set]":t>=0&&t++;break}n=gp(n),e=gp(e);var s=a==="[object Array]";if(!s){if(typeof n!="object"||typeof e!="object")return!1;var l=n.constructor,u=e.constructor;if(l!==u&&!(typeof l=="function"&&l instanceof l&&typeof u=="function"&&u instanceof u)&&"constructor"in n&&"constructor"in e)return!1}if(t===0)return!1;t<0&&(t=-1),r=r||[],i=i||[];for(var d=r.length;d--;)if(r[d]===n)return i[d]===e;if(r.push(n),i.push(e),s){if(d=n.length,d!==e.length)return!1;for(;d--;)if(!gd(n[d],e[d],t-1,r,i))return!1}else{var f=Object.keys(n),c=void 0;if(d=f.length,Object.keys(e).length!==d)return!1;for(;d--;)if(c=f[d],!(Px(e,c)&&gd(n[c],e[c],t-1,r,i)))return!1}return r.pop(),i.pop(),!0}function gp(n){return Cr(n)?n.slice():oo(n)||dn(n)||aa(n)||Gn(n)?Array.from(n.entries()):n}function Px(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Ws(n){return n[Symbol.iterator]=Dx,n}function Dx(){return this}if(typeof Proxy>"u"||typeof Symbol>"u")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.");try{process.env.NODE_ENV}catch{var yp=js();typeof process>"u"&&(yp.process={}),yp.process.env={}}(function(){function n(){}if(n.name!=="testCodeMinification"&&process.env.NODE_ENV!=="production"&&typeof process<"u"&&process.env.IGNORE_MOBX_MINIFY_WARNING!=="true"){var e=["process","env","NODE_ENV"].join(".");console.warn("[mobx] you are running a minified build, but '"+e+"' was not set to 'production' in your bundler. This results in an unnecessarily large and slow bundle")}})(),typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:tx,extras:{getDebugName:vd},$mobx:Re});function Rx(n){return!(n.prototype&&n.prototype.render)&&!Ye.isPrototypeOf(n)}function mp(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.prefix,r=t===void 0?"":t,i=e.suffix,o=i===void 0?"":i,a=n.displayName||n.name||n.constructor&&n.constructor.name||"<component>";return r+a+o}var _p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},bp=function(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")},xp=(function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}})(),Ep=function(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(n,e):n.__proto__=e)},wp=function(n,e){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:n},Sp=console;function Lx(n){var e=ld().allowStateChanges;return ld().allowStateChanges=n,e}function Ix(n){ld().allowStateChanges=n}function kx(n,e,t,r,i){var o=Lx(n),a=void 0;try{a=e(t,r,i)}finally{Ix(o)}return a}function Op(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=n[e],i=Cp[e],o=r?t===!0?function(){i.apply(this,arguments),r.apply(this,arguments)}:function(){r.apply(this,arguments),i.apply(this,arguments)}:i;n[e]=o}function Ap(n,e){if(n==null||e==null||(typeof n>"u"?"undefined":_p(n))!=="object"||(typeof e>"u"?"undefined":_p(e))!=="object")return n!==e;var t=Object.keys(n);if(t.length!==Object.keys(e).length)return!0;for(var r=void 0,i=t.length-1;r=t[i];i--)if(e[r]!==n[r])return!0;return!1}var Cp={componentWillMount:function(){var e=this,t=mp(this),r=!1,i=!1;function o(f){var c=this[f],h=td("reactive "+f);Object.defineProperty(this,f,{configurable:!0,enumerable:!0,get:function(){return h.reportObserved(),c},set:function(v){!i&&Ap(c,v)?(c=v,r=!0,h.reportChanged(),r=!1):c=v}})}o.call(this,"props"),o.call(this,"state");var a=this.render.bind(this),s=null,l=!1,u=function(){return s=new ca(t+".render()",function(){if(!l&&(l=!0,typeof e.componentWillReact=="function"&&e.componentWillReact(),e.__$mobxIsUnmounted!==!0)){var c=!0;try{i=!0,r||Ye.prototype.forceUpdate.call(e),c=!1}finally{i=!1,c&&s.dispose()}}}),s.reactComponent=e,d.$mobx=s,e.render=d,d(e.props,e.state,e.context)},d=function(c,h,p){l=!1;var v=void 0,g=void 0;if(s.track(function(){try{g=kx(!1,a,c,h,p)}catch(y){v=y}}),v)throw v;return g};this.render=u},componentWillUnmount:function(){this.render.$mobx&&this.render.$mobx.dispose(),this.__$mobxIsUnmounted=!0},componentDidMount:function(){},componentDidUpdate:function(){},shouldComponentUpdate:function(e,t){return this.state!==t?!0:Ap(this.props,e)}};function yd(n){if(arguments.length>1&&Sp.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))``'),n.isMobxInjector===!0&&Sp.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),Rx(n)){var e,t;return yd((t=e=(function(i){Ep(o,i);function o(){return bp(this,o),wp(this,(o.__proto__||Object.getPrototypeOf(o)).apply(this,arguments))}return xp(o,[{key:"render",value:function(){return n.call(this,this.props,this.context)}}]),o})(Ye),e.displayName=mp(n),t))}if(!n)throw new Error("Please pass a valid component to 'observer'");var r=n.prototype||n;return jx(r),n.isMobXReactObserver=!0,n}function jx(n){Op(n,"componentWillMount",!0),Op(n,"componentDidMount"),n.shouldComponentUpdate||(n.shouldComponentUpdate=Cp.shouldComponentUpdate)}var Bx=yd(function(n){var e=n.children;return e[0]()});Bx.displayName="Observer";var Fx=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $x(n,e){return e={exports:{}},n(e,e.exports),e.exports}$x(function(n,e){(function(t,r){n.exports=r()})(Fx,(function(){var t={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i=Object.defineProperty,o=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols,s=Object.getOwnPropertyDescriptor,l=Object.getPrototypeOf,u=l&&l(Object);return function d(f,c,h){if(typeof c!="string"){if(u){var p=l(c);p&&p!==u&&d(f,p,h)}var v=o(c);a&&(v=v.concat(a(c)));for(var g=0;g<v.length;++g){var y=v[g];if(!t[y]&&!r[y]&&(!h||!h[y])){var m=s(c,y);try{i(f,y,m)}catch{}}}return f}return f}}))});var Tp={children:!0,key:!0,ref:!0},Mp=console;if((function(n){Ep(e,n);function e(){return bp(this,e),wp(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return xp(e,[{key:"render",value:function(r){var i=r.children;return i.length>1?ae("div",null," ",i," "):i[0]}},{key:"getChildContext",value:function(){var r={},i=this.context.mobxStores;if(i)for(var o in i)r[o]=i[o];for(var a in this.props)!Tp[a]&&a!=="suppressChangedStoreWarning"&&(r[a]=this.props[a]);return{mobxStores:r}}},{key:"componentWillReceiveProps",value:function(r){if(Object.keys(r).length!==Object.keys(this.props).length&&Mp.warn("MobX Provider: The set of provided stores has changed. Please avoid changing stores as the change might not propagate to all children"),!r.suppressChangedStoreWarning)for(var i in r)!Tp[i]&&this.props[i]!==r[i]&&Mp.warn("MobX Provider: Provided store '"+i+"' has changed. Please avoid replacing stores as the change might not propagate to all children")}}]),e})(Ye),!Ye)throw new Error("mobx-preact requires Preact to be available");var Tr,md,Np,Pp=[],Yt=Xe,Dp=Yt.__b,Rp=Yt.__r,Lp=Yt.diffed,Ip=Yt.__c,kp=Yt.unmount,jp=Yt.__;function Hx(){for(var n;n=Pp.shift();){var e=n.__H;if(n.__P&&e)try{e.__h.some(Xs),e.__h.some(_d),e.__h=[]}catch(t){e.__h=[],Yt.__e(t,n.__v)}}}Yt.__b=function(n){Tr=null,Dp&&Dp(n)},Yt.__=function(n,e){n&&e.__k&&e.__k.__m&&(n.__m=e.__k.__m),jp&&jp(n,e)},Yt.__r=function(n){Rp&&Rp(n);var e=(Tr=n.__c).__H;e&&(md===Tr?(e.__h=[],Tr.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.some(Xs),e.__h.some(_d),e.__h=[])),md=Tr},Yt.diffed=function(n){Lp&&Lp(n);var e=n.__c;e&&e.__H&&(e.__H.__h.length&&(Pp.push(e)!==1&&Np===Yt.requestAnimationFrame||((Np=Yt.requestAnimationFrame)||zx)(Hx)),e.__H.__.some(function(t){t.u&&(t.__H=t.u),t.u=void 0})),md=Tr=null},Yt.__c=function(n,e){e.some(function(t){try{t.__h.some(Xs),t.__h=t.__h.filter(function(r){return!r.__||_d(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Yt.__e(r,t.__v)}}),Ip&&Ip(n,e)},Yt.unmount=function(n){kp&&kp(n);var e,t=n.__c;t&&t.__H&&(t.__H.__.some(function(r){try{Xs(r)}catch(i){e=i}}),t.__H=void 0,e&&Yt.__e(e,t.__v))};var Bp=typeof requestAnimationFrame=="function";function zx(n){var e,t=function(){clearTimeout(r),Bp&&cancelAnimationFrame(e),setTimeout(n)},r=setTimeout(t,35);Bp&&(e=requestAnimationFrame(t))}function Xs(n){var e=Tr,t=n.__c;typeof t=="function"&&(n.__c=void 0,t()),Tr=e}function _d(n){var e=Tr;n.__c=n.__(),Tr=e}function Wx(n,e){for(var t in e)n[t]=e[t];return n}function Fp(n,e){for(var t in n)if(t!=="__source"&&!(t in e))return!0;for(var r in e)if(r!=="__source"&&n[r]!==e[r])return!0;return!1}function $p(n,e){this.props=n,this.context=e}($p.prototype=new Ye).isPureReactComponent=!0,$p.prototype.shouldComponentUpdate=function(n,e){return Fp(this.props,n)||Fp(this.state,e)};var Hp=Xe.__b;Xe.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),Hp&&Hp(n)};var Xx=Xe.__e;Xe.__e=function(n,e,t,r){if(n.then){for(var i,o=e;o=o.__;)if((i=o.__c)&&i.__c)return e.__e==null&&(e.__e=t.__e,e.__k=t.__k),i.__c(n,e)}Xx(n,e,t,r)};var zp=Xe.unmount;function Wp(n,e,t){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),n.__c.__H=null),(n=Wx({},n)).__c!=null&&(n.__c.__P===t&&(n.__c.__P=e),n.__c.__e=!0,n.__c=null),n.__k=n.__k&&n.__k.map(function(r){return Wp(r,e,t)})),n}function Xp(n,e,t){return n&&t&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(r){return Xp(r,e,t)}),n.__c&&n.__c.__P===e&&(n.__e&&t.appendChild(n.__e),n.__c.__e=!0,n.__c.__P=t)),n}function bd(){this.__u=0,this.o=null,this.__b=null}function Gp(n){var e=n.__&&n.__.__c;return e&&e.__a&&e.__a(n)}function Gs(){this.i=null,this.l=null}Xe.unmount=function(n){var e=n.__c;e&&(e.__z=!0),e&&e.__R&&e.__R(),e&&32&n.__u&&(n.type=null),zp&&zp(n)},(bd.prototype=new Ye).__c=function(n,e){var t=e.__c,r=this;r.o==null&&(r.o=[]),r.o.push(t);var i=Gp(r.__v),o=!1,a=function(){o||r.__z||(o=!0,t.__R=null,i?i(l):l())};t.__R=a;var s=t.__P;t.__P=null;var l=function(){if(!--r.__u){if(r.state.__a){var u=r.state.__a;r.__v.__k[0]=Xp(u,u.__c.__P,u.__c.__O)}var d;for(r.setState({__a:r.__b=null});d=r.o.pop();)d.__P=s,d.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(a,a)},bd.prototype.componentWillUnmount=function(){this.o=[]},bd.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Wp(this.__b,t,r.__O=r.__P)}this.__b=null}var i=e.__a&&ae(no,null,n.fallback);return i&&(i.__u&=-33),[ae(no,null,e.__a?null:n.children),i]};var Up=function(n,e,t){if(++t[1]===t[0]&&n.l.delete(e),n.props.revealOrder&&(n.props.revealOrder[0]!=="t"||!n.l.size))for(t=n.i;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;n.i=t=t[2]}};(Gs.prototype=new Ye).__a=function(n){var e=this,t=Gp(e.__v),r=e.l.get(n);return r[0]++,function(i){var o=function(){e.props.revealOrder?(r.push(i),Up(e,n,r)):i()};t?t(o):o()}},Gs.prototype.render=function(n){this.i=null,this.l=new Map;var e=ws(n.children);n.revealOrder&&n.revealOrder[0]==="b"&&e.reverse();for(var t=e.length;t--;)this.l.set(e[t],this.i=[1,0,this.i]);return n.children},Gs.prototype.componentDidUpdate=Gs.prototype.componentDidMount=function(){var n=this;this.l.forEach(function(e,t){Up(n,t,e)})};var Gx=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Ux=/^(?: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]/,Yx=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Vx=/[A-Z0-9]/g,Kx=typeof document<"u",qx=function(n){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(n)};function Yp(n,e,t){return e.__k==null&&(e.textContent=""),yb(n,e),typeof t=="function"&&t(),n?n.__c:null}Ye.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(Ye.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(e){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:e})}})});var Vp=Xe.event;Xe.event=function(n){return Vp&&(n=Vp(n)),n.persist=function(){},n.isPropagationStopped=function(){return this.cancelBubble},n.isDefaultPrevented=function(){return this.defaultPrevented},n.nativeEvent=n};var Zx={configurable:!0,get:function(){return this.class}},Kp=Xe.vnode;Xe.vnode=function(n){typeof n.type=="string"&&(function(e){var t=e.props,r=e.type,i={},o=r.indexOf("-")==-1;for(var a in t){var s=t[a];if(!(a==="value"&&"defaultValue"in t&&s==null||Kx&&a==="children"&&r==="noscript"||a==="class"||a==="className")){var l=a.toLowerCase();a==="defaultValue"&&"value"in t&&t.value==null?a="value":a==="download"&&s===!0?s="":l==="translate"&&s==="no"?s=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?a="ondblclick":l!=="onchange"||r!=="input"&&r!=="textarea"||qx(t.type)?l==="onfocus"?a="onfocusin":l==="onblur"?a="onfocusout":Yx.test(a)&&(a=l):l=a="oninput":o&&Ux.test(a)?a=a.replace(Vx,"-$&").toLowerCase():s===null&&(s=void 0),l==="oninput"&&i[a=l]&&(a="oninputCapture"),i[a]=s}}r=="select"&&(i.multiple&&Array.isArray(i.value)&&(i.value=ws(t.children).forEach(function(u){u.props.selected=i.value.indexOf(u.props.value)!=-1})),i.defaultValue!=null&&(i.value=ws(t.children).forEach(function(u){u.props.selected=i.multiple?i.defaultValue.indexOf(u.props.value)!=-1:i.defaultValue==u.props.value}))),t.class&&!t.className?(i.class=t.class,Object.defineProperty(i,"className",Zx)):t.className&&(i.class=i.className=t.className),e.props=i})(n),n.$$typeof=Gx,Kp&&Kp(n)};var qp=Xe.__r;Xe.__r=function(n){qp&&qp(n),n.__c};var Zp=Xe.diffed;Xe.diffed=function(n){Zp&&Zp(n);var e=n.props,t=n.__e;t!=null&&n.type==="textarea"&&"value"in e&&e.value!==t.value&&(t.value=e.value==null?"":e.value)};var Qx=0;function $(n,e,t,r,i,o){e||(e={});var a,s,l=e;if("ref"in l)for(s in l={},e)s=="ref"?a=e[s]:l[s]=e[s];var u={type:n,props:l,key:t,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Qx,__i:-1,__u:0,__source:i,__self:o};if(typeof n=="function"&&(a=n.defaultProps))for(s in a)l[s]===void 0&&(l[s]=a[s]);return Xe.vnode&&Xe.vnode(u),u}var Qp=typeof global=="object"&&global&&global.Object===Object&&global,Jx=typeof self=="object"&&self&&self.Object===Object&&self,zt=Qp||Jx||Function("return this")(),rn=zt.Symbol,Jp=Object.prototype,eE=Jp.hasOwnProperty,tE=Jp.toString,va=rn?rn.toStringTag:void 0;function nE(n){var e=eE.call(n,va),t=n[va];try{n[va]=void 0;var r=!0}catch{}var i=tE.call(n);return r&&(e?n[va]=t:delete n[va]),i}var rE=Object.prototype,iE=rE.toString;function oE(n){return iE.call(n)}var aE="[object Null]",sE="[object Undefined]",ev=rn?rn.toStringTag:void 0;function fn(n){return n==null?n===void 0?sE:aE:ev&&ev in Object(n)?nE(n):oE(n)}function Rt(n){return n!=null&&typeof n=="object"}var lE="[object Symbol]";function Pn(n){return typeof n=="symbol"||Rt(n)&&fn(n)==lE}var uE=NaN;function tv(n){return typeof n=="number"?n:Pn(n)?uE:+n}function Tt(n,e){for(var t=-1,r=n==null?0:n.length,i=Array(r);++t<r;)i[t]=e(n[t],t,n);return i}var je=Array.isArray,nv=rn?rn.prototype:void 0,rv=nv?nv.toString:void 0;function Dn(n){if(typeof n=="string")return n;if(je(n))return Tt(n,Dn)+"";if(Pn(n))return rv?rv.call(n):"";var e=n+"";return e=="0"&&1/n==-1/0?"-0":e}function Us(n,e){return function(t,r){var i;if(t===void 0&&r===void 0)return e;if(t!==void 0&&(i=t),r!==void 0){if(i===void 0)return r;typeof t=="string"||typeof r=="string"?(t=Dn(t),r=Dn(r)):(t=tv(t),r=tv(r)),i=n(t,r)}return i}}var dE=Us(function(n,e){return n+e},0),fE=/\s/;function iv(n){for(var e=n.length;e--&&fE.test(n.charAt(e)););return e}var cE=/^\s+/;function ov(n){return n&&n.slice(0,iv(n)+1).replace(cE,"")}function Mt(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var av=NaN,hE=/^[-+]0x[0-9a-f]+$/i,pE=/^0b[01]+$/i,vE=/^0o[0-7]+$/i,gE=parseInt;function Un(n){if(typeof n=="number")return n;if(Pn(n))return av;if(Mt(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Mt(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=ov(n);var t=pE.test(n);return t||vE.test(n)?gE(n.slice(2),t?2:8):hE.test(n)?av:+n}var sv=1/0,yE=17976931348623157e292;function Gr(n){if(!n)return n===0?n:0;if(n=Un(n),n===sv||n===-sv){var e=n<0?-1:1;return e*yE}return n===n?n:0}function Ge(n){var e=Gr(n),t=e%1;return e===e?t?e-t:e:0}var mE="Expected a function";function _E(n,e){if(typeof e!="function")throw new TypeError(mE);return n=Ge(n),function(){if(--n<1)return e.apply(this,arguments)}}function En(n){return n}var bE="[object AsyncFunction]",xE="[object Function]",EE="[object GeneratorFunction]",wE="[object Proxy]";function hr(n){if(!Mt(n))return!1;var e=fn(n);return e==xE||e==EE||e==bE||e==wE}var Ys=zt["__core-js_shared__"],lv=(function(){var n=/[^.]+$/.exec(Ys&&Ys.keys&&Ys.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function SE(n){return!!lv&&lv in n}var OE=Function.prototype,AE=OE.toString;function Ii(n){if(n!=null){try{return AE.call(n)}catch{}try{return n+""}catch{}}return""}var CE=/[\\^$.*+?()[\]{}|]/g,TE=/^\[object .+?Constructor\]$/,ME=Function.prototype,NE=Object.prototype,PE=ME.toString,DE=NE.hasOwnProperty,RE=RegExp("^"+PE.call(DE).replace(CE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function uv(n){if(!Mt(n)||SE(n))return!1;var e=hr(n)?RE:TE;return e.test(Ii(n))}function LE(n,e){return n==null?void 0:n[e]}function ki(n,e){var t=LE(n,e);return uv(t)?t:void 0}var ga=ki(zt,"WeakMap"),Vs=ga&&new ga,dv=Vs?function(n,e){return Vs.set(n,e),n}:En,fv=Object.create,yo=(function(){function n(){}return function(e){if(!Mt(e))return{};if(fv)return fv(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}})();function ya(n){return function(){var e=arguments;switch(e.length){case 0:return new n;case 1:return new n(e[0]);case 2:return new n(e[0],e[1]);case 3:return new n(e[0],e[1],e[2]);case 4:return new n(e[0],e[1],e[2],e[3]);case 5:return new n(e[0],e[1],e[2],e[3],e[4]);case 6:return new n(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new n(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=yo(n.prototype),r=n.apply(t,e);return Mt(r)?r:t}}var IE=1;function kE(n,e,t){var r=e&IE,i=ya(n);function o(){var a=this&&this!==zt&&this instanceof o?i:n;return a.apply(r?t:this,arguments)}return o}function Rn(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}var jE=Math.max;function cv(n,e,t,r){for(var i=-1,o=n.length,a=t.length,s=-1,l=e.length,u=jE(o-a,0),d=Array(l+u),f=!r;++s<l;)d[s]=e[s];for(;++i<a;)(f||i<o)&&(d[t[i]]=n[i]);for(;u--;)d[s++]=n[i++];return d}var BE=Math.max;function hv(n,e,t,r){for(var i=-1,o=n.length,a=-1,s=t.length,l=-1,u=e.length,d=BE(o-s,0),f=Array(d+u),c=!r;++i<d;)f[i]=n[i];for(var h=i;++l<u;)f[h+l]=e[l];for(;++a<s;)(c||i<o)&&(f[h+t[a]]=n[i++]);return f}function FE(n,e){for(var t=n.length,r=0;t--;)n[t]===e&&++r;return r}function Ks(){}var $E=4294967295;function tt(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=$E,this.__views__=[]}tt.prototype=yo(Ks.prototype),tt.prototype.constructor=tt;function mo(){}var xd=Vs?function(n){return Vs.get(n)}:mo,_o={},HE=Object.prototype,zE=HE.hasOwnProperty;function qs(n){for(var e=n.name+"",t=_o[e],r=zE.call(_o,e)?t.length:0;r--;){var i=t[r],o=i.func;if(o==null||o==n)return i.name}return e}function Yn(n,e){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}Yn.prototype=yo(Ks.prototype),Yn.prototype.constructor=Yn;function wn(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}function pv(n){if(n instanceof tt)return n.clone();var e=new Yn(n.__wrapped__,n.__chain__);return e.__actions__=wn(n.__actions__),e.__index__=n.__index__,e.__values__=n.__values__,e}var WE=Object.prototype,XE=WE.hasOwnProperty;function _(n){if(Rt(n)&&!je(n)&&!(n instanceof tt)){if(n instanceof Yn)return n;if(XE.call(n,"__wrapped__"))return pv(n)}return new Yn(n)}_.prototype=Ks.prototype,_.prototype.constructor=_;function Ed(n){var e=qs(n),t=_[e];if(typeof t!="function"||!(e in tt.prototype))return!1;if(n===t)return!0;var r=xd(t);return!!r&&n===r[0]}var GE=800,UE=16,YE=Date.now;function vv(n){var e=0,t=0;return function(){var r=YE(),i=UE-(r-t);if(t=r,i>0){if(++e>=GE)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}var gv=vv(dv),VE=/\{\n\/\* \[wrapped with (.+)\] \*/,KE=/,? & /;function qE(n){var e=n.match(VE);return e?e[1].split(KE):[]}var ZE=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function QE(n,e){var t=e.length;if(!t)return n;var r=t-1;return e[r]=(t>1?"& ":"")+e[r],e=e.join(t>2?", ":" "),n.replace(ZE,`{
|
|
51
|
+
/* [wrapped with `+e+`] */
|
|
52
|
+
`)}function wd(n){return function(){return n}}var Zs=(function(){try{var n=ki(Object,"defineProperty");return n({},"",{}),n}catch{}})(),JE=Zs?function(n,e){return Zs(n,"toString",{configurable:!0,enumerable:!1,value:wd(e),writable:!0})}:En,Sd=vv(JE);function Ln(n,e){for(var t=-1,r=n==null?0:n.length;++t<r&&e(n[t],t,n)!==!1;);return n}function Qs(n,e,t,r){for(var i=n.length,o=t+(r?1:-1);r?o--:++o<i;)if(e(n[o],o,n))return o;return-1}function yv(n){return n!==n}function ew(n,e,t){for(var r=t-1,i=n.length;++r<i;)if(n[r]===e)return r;return-1}function bo(n,e,t){return e===e?ew(n,e,t):Qs(n,yv,t)}function Js(n,e){var t=n==null?0:n.length;return!!t&&bo(n,e,0)>-1}var tw=1,nw=2,rw=8,iw=16,ow=32,aw=64,sw=128,lw=256,uw=512,dw=[["ary",sw],["bind",tw],["bindKey",nw],["curry",rw],["curryRight",iw],["flip",uw],["partial",ow],["partialRight",aw],["rearg",lw]];function fw(n,e){return Ln(dw,function(t){var r="_."+t[0];e&t[1]&&!Js(n,r)&&n.push(r)}),n.sort()}function mv(n,e,t){var r=e+"";return Sd(n,QE(r,fw(qE(r),t)))}var cw=4,hw=8,_v=32,bv=64;function xv(n,e,t,r,i,o,a,s,l,u){var d=e&hw,f=d?a:void 0,c=d?void 0:a,h=d?o:void 0,p=d?void 0:o;e|=d?_v:bv,e&=~(d?bv:_v),e&cw||(e&=-4);var v=[n,e,i,h,f,p,c,s,l,u],g=t.apply(void 0,v);return Ed(n)&&gv(g,v),g.placeholder=r,mv(g,n,e)}function xo(n){var e=n;return e.placeholder}var pw=9007199254740991,vw=/^(?:0|[1-9]\d*)$/;function Ur(n,e){var t=typeof n;return e=e??pw,!!e&&(t=="number"||t!="symbol"&&vw.test(n))&&n>-1&&n%1==0&&n<e}var gw=Math.min;function yw(n,e){for(var t=n.length,r=gw(e.length,t),i=wn(n);r--;){var o=e[r];n[r]=Ur(o,t)?i[o]:void 0}return n}var Ev="__lodash_placeholder__";function ui(n,e){for(var t=-1,r=n.length,i=0,o=[];++t<r;){var a=n[t];(a===e||a===Ev)&&(n[t]=Ev,o[i++]=t)}return o}var mw=1,_w=2,bw=8,xw=16,Ew=128,ww=512;function el(n,e,t,r,i,o,a,s,l,u){var d=e&Ew,f=e&mw,c=e&_w,h=e&(bw|xw),p=e&ww,v=c?void 0:ya(n);function g(){for(var y=arguments.length,m=Array(y),O=y;O--;)m[O]=arguments[O];if(h)var T=xo(g),C=FE(m,T);if(r&&(m=cv(m,r,i,h)),o&&(m=hv(m,o,a,h)),y-=C,h&&y<u){var A=ui(m,T);return xv(n,e,el,g.placeholder,t,m,A,s,l,u-y)}var E=f?t:this,N=c?E[n]:n;return y=m.length,s?m=yw(m,s):p&&y>1&&m.reverse(),d&&l<y&&(m.length=l),this&&this!==zt&&this instanceof g&&(N=v||ya(N)),N.apply(E,m)}return g}function Sw(n,e,t){var r=ya(n);function i(){for(var o=arguments.length,a=Array(o),s=o,l=xo(i);s--;)a[s]=arguments[s];var u=o<3&&a[0]!==l&&a[o-1]!==l?[]:ui(a,l);if(o-=u.length,o<t)return xv(n,e,el,i.placeholder,void 0,a,u,void 0,void 0,t-o);var d=this&&this!==zt&&this instanceof i?r:n;return Rn(d,this,a)}return i}var Ow=1;function Aw(n,e,t,r){var i=e&Ow,o=ya(n);function a(){for(var s=-1,l=arguments.length,u=-1,d=r.length,f=Array(d+l),c=this&&this!==zt&&this instanceof a?o:n;++u<d;)f[u]=r[u];for(;l--;)f[u++]=arguments[++s];return Rn(c,i?t:this,f)}return a}var wv="__lodash_placeholder__",Od=1,Cw=2,Tw=4,Sv=8,ma=128,Ov=256,Mw=Math.min;function Nw(n,e){var t=n[1],r=e[1],i=t|r,o=i<(Od|Cw|ma),a=r==ma&&t==Sv||r==ma&&t==Ov&&n[7].length<=e[8]||r==(ma|Ov)&&e[7].length<=e[8]&&t==Sv;if(!(o||a))return n;r&Od&&(n[2]=e[2],i|=t&Od?0:Tw);var s=e[3];if(s){var l=n[3];n[3]=l?cv(l,s,e[4]):s,n[4]=l?ui(n[3],wv):e[4]}return s=e[5],s&&(l=n[5],n[5]=l?hv(l,s,e[6]):s,n[6]=l?ui(n[5],wv):e[6]),s=e[7],s&&(n[7]=s),r&ma&&(n[8]=n[8]==null?e[8]:Mw(n[8],e[8])),n[9]==null&&(n[9]=e[9]),n[0]=e[0],n[1]=i,n}var Pw="Expected a function",Av=1,Dw=2,Cv=8,Tv=16,Mv=32,Rw=64,Nv=Math.max;function Yr(n,e,t,r,i,o,a,s){var l=e&Dw;if(!l&&typeof n!="function")throw new TypeError(Pw);var u=r?r.length:0;if(u||(e&=-97,r=i=void 0),a=a===void 0?a:Nv(Ge(a),0),s=s===void 0?s:Ge(s),u-=i?i.length:0,e&Rw){var d=r,f=i;r=i=void 0}var c=l?void 0:xd(n),h=[n,e,t,r,i,d,f,o,a,s];if(c&&Nw(h,c),n=h[0],e=h[1],t=h[2],r=h[3],i=h[4],s=h[9]=h[9]===void 0?l?0:n.length:Nv(h[9]-u,0),!s&&e&(Cv|Tv)&&(e&=-25),!e||e==Av)var p=kE(n,e,t);else e==Cv||e==Tv?p=Sw(n,e,s):(e==Mv||e==(Av|Mv))&&!i.length?p=Aw(n,e,t,r):p=el.apply(void 0,h);var v=c?dv:gv;return mv(v(p,h),n,e)}var Lw=128;function Pv(n,e,t){return e=t?void 0:e,e=n&&e==null?n.length:e,Yr(n,Lw,void 0,void 0,void 0,void 0,e)}function Mr(n,e,t){e=="__proto__"&&Zs?Zs(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function pr(n,e){return n===e||n!==n&&e!==e}var Iw=Object.prototype,kw=Iw.hasOwnProperty;function _a(n,e,t){var r=n[e];(!(kw.call(n,e)&&pr(r,t))||t===void 0&&!(e in n))&&Mr(n,e,t)}function Nr(n,e,t,r){var i=!t;t||(t={});for(var o=-1,a=e.length;++o<a;){var s=e[o],l=r?r(t[s],n[s],s,t,n):void 0;l===void 0&&(l=n[s]),i?Mr(t,s,l):_a(t,s,l)}return t}var Dv=Math.max;function Rv(n,e,t){return e=Dv(e===void 0?n.length-1:e,0),function(){for(var r=arguments,i=-1,o=Dv(r.length-e,0),a=Array(o);++i<o;)a[i]=r[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=r[i];return s[e]=t(a),Rn(n,this,s)}}function Ve(n,e){return Sd(Rv(n,e,En),n+"")}var jw=9007199254740991;function tl(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=jw}function Sn(n){return n!=null&&tl(n.length)&&!hr(n)}function cn(n,e,t){if(!Mt(t))return!1;var r=typeof e;return(r=="number"?Sn(t)&&Ur(e,t.length):r=="string"&&e in t)?pr(t[e],n):!1}function Eo(n){return Ve(function(e,t){var r=-1,i=t.length,o=i>1?t[i-1]:void 0,a=i>2?t[2]:void 0;for(o=n.length>3&&typeof o=="function"?(i--,o):void 0,a&&cn(t[0],t[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++r<i;){var s=t[r];s&&n(e,s,r,o)}return e})}var Bw=Object.prototype;function ba(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||Bw;return n===t}function Ad(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var Fw="[object Arguments]";function Lv(n){return Rt(n)&&fn(n)==Fw}var Iv=Object.prototype,$w=Iv.hasOwnProperty,Hw=Iv.propertyIsEnumerable,ji=Lv((function(){return arguments})())?Lv:function(n){return Rt(n)&&$w.call(n,"callee")&&!Hw.call(n,"callee")};function Cd(){return!1}var kv=typeof Bt=="object"&&Bt&&!Bt.nodeType&&Bt,jv=kv&&typeof module=="object"&&module&&!module.nodeType&&module,zw=jv&&jv.exports===kv,Bv=zw?zt.Buffer:void 0,Ww=Bv?Bv.isBuffer:void 0,di=Ww||Cd,Xw="[object Arguments]",Gw="[object Array]",Uw="[object Boolean]",Yw="[object Date]",Vw="[object Error]",Kw="[object Function]",qw="[object Map]",Zw="[object Number]",Qw="[object Object]",Jw="[object RegExp]",e1="[object Set]",t1="[object String]",n1="[object WeakMap]",r1="[object ArrayBuffer]",i1="[object DataView]",o1="[object Float32Array]",a1="[object Float64Array]",s1="[object Int8Array]",l1="[object Int16Array]",u1="[object Int32Array]",d1="[object Uint8Array]",f1="[object Uint8ClampedArray]",c1="[object Uint16Array]",h1="[object Uint32Array]",At={};At[o1]=At[a1]=At[s1]=At[l1]=At[u1]=At[d1]=At[f1]=At[c1]=At[h1]=!0,At[Xw]=At[Gw]=At[r1]=At[Uw]=At[i1]=At[Yw]=At[Vw]=At[Kw]=At[qw]=At[Zw]=At[Qw]=At[Jw]=At[e1]=At[t1]=At[n1]=!1;function p1(n){return Rt(n)&&tl(n.length)&&!!At[fn(n)]}function In(n){return function(e){return n(e)}}var Fv=typeof Bt=="object"&&Bt&&!Bt.nodeType&&Bt,xa=Fv&&typeof module=="object"&&module&&!module.nodeType&&module,v1=xa&&xa.exports===Fv,Td=v1&&Qp.process,Vn=(function(){try{var n=xa&&xa.require&&xa.require("util").types;return n||Td&&Td.binding&&Td.binding("util")}catch{}})(),$v=Vn&&Vn.isTypedArray,wo=$v?In($v):p1,g1=Object.prototype,y1=g1.hasOwnProperty;function Hv(n,e){var t=je(n),r=!t&&ji(n),i=!t&&!r&&di(n),o=!t&&!r&&!i&&wo(n),a=t||r||i||o,s=a?Ad(n.length,String):[],l=s.length;for(var u in n)(e||y1.call(n,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Ur(u,l)))&&s.push(u);return s}function zv(n,e){return function(t){return n(e(t))}}var m1=zv(Object.keys,Object),_1=Object.prototype,b1=_1.hasOwnProperty;function Md(n){if(!ba(n))return m1(n);var e=[];for(var t in Object(n))b1.call(n,t)&&t!="constructor"&&e.push(t);return e}function Wt(n){return Sn(n)?Hv(n):Md(n)}var x1=Object.prototype,E1=x1.hasOwnProperty,Je=Eo(function(n,e){if(ba(e)||Sn(e)){Nr(e,Wt(e),n);return}for(var t in e)E1.call(e,t)&&_a(n,t,e[t])});function w1(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var S1=Object.prototype,O1=S1.hasOwnProperty;function A1(n){if(!Mt(n))return w1(n);var e=ba(n),t=[];for(var r in n)r=="constructor"&&(e||!O1.call(n,r))||t.push(r);return t}function On(n){return Sn(n)?Hv(n,!0):A1(n)}var C1=Eo(function(n,e){Nr(e,On(e),n)}),T1=Eo(function(n,e,t,r){Nr(e,On(e),n,r)}),Nd=Eo(function(n,e,t,r){Nr(e,Wt(e),n,r)}),M1=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,N1=/^\w*$/;function Pd(n,e){if(je(n))return!1;var t=typeof n;return t=="number"||t=="symbol"||t=="boolean"||n==null||Pn(n)?!0:N1.test(n)||!M1.test(n)||e!=null&&n in Object(e)}var Ea=ki(Object,"create");function P1(){this.__data__=Ea?Ea(null):{},this.size=0}function D1(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var R1="__lodash_hash_undefined__",L1=Object.prototype,I1=L1.hasOwnProperty;function k1(n){var e=this.__data__;if(Ea){var t=e[n];return t===R1?void 0:t}return I1.call(e,n)?e[n]:void 0}var j1=Object.prototype,B1=j1.hasOwnProperty;function F1(n){var e=this.__data__;return Ea?e[n]!==void 0:B1.call(e,n)}var $1="__lodash_hash_undefined__";function H1(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=Ea&&e===void 0?$1:e,this}function Bi(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Bi.prototype.clear=P1,Bi.prototype.delete=D1,Bi.prototype.get=k1,Bi.prototype.has=F1,Bi.prototype.set=H1;function z1(){this.__data__=[],this.size=0}function nl(n,e){for(var t=n.length;t--;)if(pr(n[t][0],e))return t;return-1}var W1=Array.prototype,X1=W1.splice;function G1(n){var e=this.__data__,t=nl(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():X1.call(e,t,1),--this.size,!0}function U1(n){var e=this.__data__,t=nl(e,n);return t<0?void 0:e[t][1]}function Y1(n){return nl(this.__data__,n)>-1}function V1(n,e){var t=this.__data__,r=nl(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function Vr(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Vr.prototype.clear=z1,Vr.prototype.delete=G1,Vr.prototype.get=U1,Vr.prototype.has=Y1,Vr.prototype.set=V1;var wa=ki(zt,"Map");function K1(){this.size=0,this.__data__={hash:new Bi,map:new(wa||Vr),string:new Bi}}function q1(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function rl(n,e){var t=n.__data__;return q1(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Z1(n){var e=rl(this,n).delete(n);return this.size-=e?1:0,e}function Q1(n){return rl(this,n).get(n)}function J1(n){return rl(this,n).has(n)}function eS(n,e){var t=rl(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function Kr(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Kr.prototype.clear=K1,Kr.prototype.delete=Z1,Kr.prototype.get=Q1,Kr.prototype.has=J1,Kr.prototype.set=eS;var tS="Expected a function";function il(n,e){if(typeof n!="function"||e!=null&&typeof e!="function")throw new TypeError(tS);var t=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=t.cache;if(o.has(i))return o.get(i);var a=n.apply(this,r);return t.cache=o.set(i,a)||o,a};return t.cache=new(il.Cache||Kr),t}il.Cache=Kr;var nS=500;function rS(n){var e=il(n,function(r){return t.size===nS&&t.clear(),r}),t=e.cache;return e}var iS=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oS=/\\(\\)?/g,Wv=rS(function(n){var e=[];return n.charCodeAt(0)===46&&e.push(""),n.replace(iS,function(t,r,i,o){e.push(i?o.replace(oS,"$1"):r||t)}),e});function yt(n){return n==null?"":Dn(n)}function fi(n,e){return je(n)?n:Pd(n,e)?[n]:Wv(yt(n))}function vr(n){if(typeof n=="string"||Pn(n))return n;var e=n+"";return e=="0"&&1/n==-1/0?"-0":e}function Fi(n,e){e=fi(e,n);for(var t=0,r=e.length;n!=null&&t<r;)n=n[vr(e[t++])];return t&&t==r?n:void 0}function ci(n,e,t){var r=n==null?void 0:Fi(n,e);return r===void 0?t:r}function Dd(n,e){for(var t=-1,r=e.length,i=Array(r),o=n==null;++t<r;)i[t]=o?void 0:ci(n,e[t]);return i}function hi(n,e){for(var t=-1,r=e.length,i=n.length;++t<r;)n[i+t]=e[t];return n}var Xv=rn?rn.isConcatSpreadable:void 0;function aS(n){return je(n)||ji(n)||!!(Xv&&n&&n[Xv])}function Vt(n,e,t,r,i){var o=-1,a=n.length;for(t||(t=aS),i||(i=[]);++o<a;){var s=n[o];e>0&&t(s)?e>1?Vt(s,e-1,t,r,i):hi(i,s):r||(i[i.length]=s)}return i}function Gv(n){var e=n==null?0:n.length;return e?Vt(n,1):[]}function qr(n){return Sd(Rv(n,void 0,Gv),n+"")}var sS=qr(Dd),ol=zv(Object.getPrototypeOf,Object),lS="[object Object]",uS=Function.prototype,dS=Object.prototype,Uv=uS.toString,fS=dS.hasOwnProperty,cS=Uv.call(Object);function Sa(n){if(!Rt(n)||fn(n)!=lS)return!1;var e=ol(n);if(e===null)return!0;var t=fS.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Uv.call(t)==cS}var hS="[object DOMException]",pS="[object Error]";function Rd(n){if(!Rt(n))return!1;var e=fn(n);return e==pS||e==hS||typeof n.message=="string"&&typeof n.name=="string"&&!Sa(n)}var Yv=Ve(function(n,e){try{return Rn(n,void 0,e)}catch(t){return Rd(t)?t:new Error(t)}}),vS="Expected a function";function Vv(n,e){var t;if(typeof e!="function")throw new TypeError(vS);return n=Ge(n),function(){return--n>0&&(t=e.apply(this,arguments)),n<=1&&(e=void 0),t}}var gS=1,yS=32,al=Ve(function(n,e,t){var r=gS;if(t.length){var i=ui(t,xo(al));r|=yS}return Yr(n,r,e,t,i)});al.placeholder={};var mS=qr(function(n,e){return Ln(e,function(t){t=vr(t),Mr(n,t,al(n[t],n))}),n}),_S=1,bS=2,xS=32,Ld=Ve(function(n,e,t){var r=_S|bS;if(t.length){var i=ui(t,xo(Ld));r|=xS}return Yr(e,r,n,t,i)});Ld.placeholder={};function Kn(n,e,t){var r=-1,i=n.length;e<0&&(e=-e>i?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=n[r+e];return o}function pi(n,e,t){var r=n.length;return t=t===void 0?r:t,!e&&t>=r?n:Kn(n,e,t)}var ES="\\ud800-\\udfff",wS="\\u0300-\\u036f",SS="\\ufe20-\\ufe2f",OS="\\u20d0-\\u20ff",AS=wS+SS+OS,CS="\\ufe0e\\ufe0f",TS="\\u200d",MS=RegExp("["+TS+ES+AS+CS+"]");function So(n){return MS.test(n)}function NS(n){return n.split("")}var Kv="\\ud800-\\udfff",PS="\\u0300-\\u036f",DS="\\ufe20-\\ufe2f",RS="\\u20d0-\\u20ff",LS=PS+DS+RS,IS="\\ufe0e\\ufe0f",kS="["+Kv+"]",Id="["+LS+"]",kd="\\ud83c[\\udffb-\\udfff]",jS="(?:"+Id+"|"+kd+")",qv="[^"+Kv+"]",Zv="(?:\\ud83c[\\udde6-\\uddff]){2}",Qv="[\\ud800-\\udbff][\\udc00-\\udfff]",BS="\\u200d",Jv=jS+"?",eg="["+IS+"]?",FS="(?:"+BS+"(?:"+[qv,Zv,Qv].join("|")+")"+eg+Jv+")*",$S=eg+Jv+FS,HS="(?:"+[qv+Id+"?",Id,Zv,Qv,kS].join("|")+")",zS=RegExp(kd+"(?="+kd+")|"+HS+$S,"g");function WS(n){return n.match(zS)||[]}function gr(n){return So(n)?WS(n):NS(n)}function tg(n){return function(e){e=yt(e);var t=So(e)?gr(e):void 0,r=t?t[0]:e.charAt(0),i=t?pi(t,1).join(""):e.slice(1);return r[n]()+i}}var jd=tg("toUpperCase");function ng(n){return jd(yt(n).toLowerCase())}function Bd(n,e,t,r){var i=-1,o=n==null?0:n.length;for(r&&o&&(t=n[++i]);++i<o;)t=e(t,n[i],i,n);return t}function Fd(n){return function(e){return n==null?void 0:n[e]}}var XS={À:"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"},GS=Fd(XS),US=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,YS="\\u0300-\\u036f",VS="\\ufe20-\\ufe2f",KS="\\u20d0-\\u20ff",qS=YS+VS+KS,ZS="["+qS+"]",QS=RegExp(ZS,"g");function rg(n){return n=yt(n),n&&n.replace(US,GS).replace(QS,"")}var JS=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function eO(n){return n.match(JS)||[]}var tO=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function nO(n){return tO.test(n)}var ig="\\ud800-\\udfff",rO="\\u0300-\\u036f",iO="\\ufe20-\\ufe2f",oO="\\u20d0-\\u20ff",aO=rO+iO+oO,og="\\u2700-\\u27bf",ag="a-z\\xdf-\\xf6\\xf8-\\xff",sO="\\xac\\xb1\\xd7\\xf7",lO="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",uO="\\u2000-\\u206f",dO=" \\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",sg="A-Z\\xc0-\\xd6\\xd8-\\xde",fO="\\ufe0e\\ufe0f",lg=sO+lO+uO+dO,ug="['’]",dg="["+lg+"]",cO="["+aO+"]",fg="\\d+",hO="["+og+"]",cg="["+ag+"]",hg="[^"+ig+lg+fg+og+ag+sg+"]",pO="\\ud83c[\\udffb-\\udfff]",vO="(?:"+cO+"|"+pO+")",gO="[^"+ig+"]",pg="(?:\\ud83c[\\udde6-\\uddff]){2}",vg="[\\ud800-\\udbff][\\udc00-\\udfff]",Oo="["+sg+"]",yO="\\u200d",gg="(?:"+cg+"|"+hg+")",mO="(?:"+Oo+"|"+hg+")",yg="(?:"+ug+"(?:d|ll|m|re|s|t|ve))?",mg="(?:"+ug+"(?:D|LL|M|RE|S|T|VE))?",_g=vO+"?",bg="["+fO+"]?",_O="(?:"+yO+"(?:"+[gO,pg,vg].join("|")+")"+bg+_g+")*",bO="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xO="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",EO=bg+_g+_O,wO="(?:"+[hO,pg,vg].join("|")+")"+EO,SO=RegExp([Oo+"?"+cg+"+"+yg+"(?="+[dg,Oo,"$"].join("|")+")",mO+"+"+mg+"(?="+[dg,Oo+gg,"$"].join("|")+")",Oo+"?"+gg+"+"+yg,Oo+"+"+mg,xO,bO,fg,wO].join("|"),"g");function OO(n){return n.match(SO)||[]}function xg(n,e,t){return n=yt(n),e=t?void 0:e,e===void 0?nO(n)?OO(n):eO(n):n.match(e)||[]}var AO="['’]",CO=RegExp(AO,"g");function Ao(n){return function(e){return Bd(xg(rg(e).replace(CO,"")),n,"")}}var TO=Ao(function(n,e,t){return e=e.toLowerCase(),n+(t?ng(e):e)});function MO(){if(!arguments.length)return[];var n=arguments[0];return je(n)?n:[n]}var NO=zt.isFinite,PO=Math.min;function $d(n){var e=Math[n];return function(t,r){if(t=Un(t),r=r==null?0:PO(Ge(r),292),r&&NO(t)){var i=(yt(t)+"e").split("e"),o=e(i[0]+"e"+(+i[1]+r));return i=(yt(o)+"e").split("e"),+(i[0]+"e"+(+i[1]-r))}return e(t)}}var DO=$d("ceil");function Eg(n){var e=_(n);return e.__chain__=!0,e}var RO=Math.ceil,LO=Math.max;function IO(n,e,t){(t?cn(n,e,t):e===void 0)?e=1:e=LO(Ge(e),0);var r=n==null?0:n.length;if(!r||e<1)return[];for(var i=0,o=0,a=Array(RO(r/e));i<r;)a[o++]=Kn(n,i,i+=e);return a}function $i(n,e,t){return n===n&&(t!==void 0&&(n=n<=t?n:t),e!==void 0&&(n=n>=e?n:e)),n}function kO(n,e,t){return t===void 0&&(t=e,e=void 0),t!==void 0&&(t=Un(t),t=t===t?t:0),e!==void 0&&(e=Un(e),e=e===e?e:0),$i(Un(n),e,t)}function jO(){this.__data__=new Vr,this.size=0}function BO(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function FO(n){return this.__data__.get(n)}function $O(n){return this.__data__.has(n)}var HO=200;function zO(n,e){var t=this.__data__;if(t instanceof Vr){var r=t.__data__;if(!wa||r.length<HO-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new Kr(r)}return t.set(n,e),this.size=t.size,this}function yr(n){var e=this.__data__=new Vr(n);this.size=e.size}yr.prototype.clear=jO,yr.prototype.delete=BO,yr.prototype.get=FO,yr.prototype.has=$O,yr.prototype.set=zO;function wg(n,e){return n&&Nr(e,Wt(e),n)}function WO(n,e){return n&&Nr(e,On(e),n)}var Sg=typeof Bt=="object"&&Bt&&!Bt.nodeType&&Bt,Og=Sg&&typeof module=="object"&&module&&!module.nodeType&&module,XO=Og&&Og.exports===Sg,Ag=XO?zt.Buffer:void 0,Cg=Ag?Ag.allocUnsafe:void 0;function Tg(n,e){if(e)return n.slice();var t=n.length,r=Cg?Cg(t):new n.constructor(t);return n.copy(r),r}function vi(n,e){for(var t=-1,r=n==null?0:n.length,i=0,o=[];++t<r;){var a=n[t];e(a,t,n)&&(o[i++]=a)}return o}function Hd(){return[]}var GO=Object.prototype,UO=GO.propertyIsEnumerable,Mg=Object.getOwnPropertySymbols,zd=Mg?function(n){return n==null?[]:(n=Object(n),vi(Mg(n),function(e){return UO.call(n,e)}))}:Hd;function YO(n,e){return Nr(n,zd(n),e)}var VO=Object.getOwnPropertySymbols,Ng=VO?function(n){for(var e=[];n;)hi(e,zd(n)),n=ol(n);return e}:Hd;function KO(n,e){return Nr(n,Ng(n),e)}function Pg(n,e,t){var r=e(n);return je(n)?r:hi(r,t(n))}function Wd(n){return Pg(n,Wt,zd)}function Xd(n){return Pg(n,On,Ng)}var Gd=ki(zt,"DataView"),Ud=ki(zt,"Promise"),Co=ki(zt,"Set"),Dg="[object Map]",qO="[object Object]",Rg="[object Promise]",Lg="[object Set]",Ig="[object WeakMap]",kg="[object DataView]",ZO=Ii(Gd),QO=Ii(wa),JO=Ii(Ud),eA=Ii(Co),tA=Ii(ga),on=fn;(Gd&&on(new Gd(new ArrayBuffer(1)))!=kg||wa&&on(new wa)!=Dg||Ud&&on(Ud.resolve())!=Rg||Co&&on(new Co)!=Lg||ga&&on(new ga)!=Ig)&&(on=function(n){var e=fn(n),t=e==qO?n.constructor:void 0,r=t?Ii(t):"";if(r)switch(r){case ZO:return kg;case QO:return Dg;case JO:return Rg;case eA:return Lg;case tA:return Ig}return e});var nA=Object.prototype,rA=nA.hasOwnProperty;function iA(n){var e=n.length,t=new n.constructor(e);return e&&typeof n[0]=="string"&&rA.call(n,"index")&&(t.index=n.index,t.input=n.input),t}var sl=zt.Uint8Array;function Yd(n){var e=new n.constructor(n.byteLength);return new sl(e).set(new sl(n)),e}function oA(n,e){var t=e?Yd(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.byteLength)}var aA=/\w*$/;function sA(n){var e=new n.constructor(n.source,aA.exec(n));return e.lastIndex=n.lastIndex,e}var jg=rn?rn.prototype:void 0,Bg=jg?jg.valueOf:void 0;function lA(n){return Bg?Object(Bg.call(n)):{}}function Fg(n,e){var t=e?Yd(n.buffer):n.buffer;return new n.constructor(t,n.byteOffset,n.length)}var uA="[object Boolean]",dA="[object Date]",fA="[object Map]",cA="[object Number]",hA="[object RegExp]",pA="[object Set]",vA="[object String]",gA="[object Symbol]",yA="[object ArrayBuffer]",mA="[object DataView]",_A="[object Float32Array]",bA="[object Float64Array]",xA="[object Int8Array]",EA="[object Int16Array]",wA="[object Int32Array]",SA="[object Uint8Array]",OA="[object Uint8ClampedArray]",AA="[object Uint16Array]",CA="[object Uint32Array]";function TA(n,e,t){var r=n.constructor;switch(e){case yA:return Yd(n);case uA:case dA:return new r(+n);case mA:return oA(n,t);case _A:case bA:case xA:case EA:case wA:case SA:case OA:case AA:case CA:return Fg(n,t);case fA:return new r;case cA:case vA:return new r(n);case hA:return sA(n);case pA:return new r;case gA:return lA(n)}}function $g(n){return typeof n.constructor=="function"&&!ba(n)?yo(ol(n)):{}}var MA="[object Map]";function NA(n){return Rt(n)&&on(n)==MA}var Hg=Vn&&Vn.isMap,zg=Hg?In(Hg):NA,PA="[object Set]";function DA(n){return Rt(n)&&on(n)==PA}var Wg=Vn&&Vn.isSet,Xg=Wg?In(Wg):DA,RA=1,LA=2,IA=4,Gg="[object Arguments]",kA="[object Array]",jA="[object Boolean]",BA="[object Date]",FA="[object Error]",Ug="[object Function]",$A="[object GeneratorFunction]",HA="[object Map]",zA="[object Number]",Yg="[object Object]",WA="[object RegExp]",XA="[object Set]",GA="[object String]",UA="[object Symbol]",YA="[object WeakMap]",VA="[object ArrayBuffer]",KA="[object DataView]",qA="[object Float32Array]",ZA="[object Float64Array]",QA="[object Int8Array]",JA="[object Int16Array]",eC="[object Int32Array]",tC="[object Uint8Array]",nC="[object Uint8ClampedArray]",rC="[object Uint16Array]",iC="[object Uint32Array]",St={};St[Gg]=St[kA]=St[VA]=St[KA]=St[jA]=St[BA]=St[qA]=St[ZA]=St[QA]=St[JA]=St[eC]=St[HA]=St[zA]=St[Yg]=St[WA]=St[XA]=St[GA]=St[UA]=St[tC]=St[nC]=St[rC]=St[iC]=!0,St[FA]=St[Ug]=St[YA]=!1;function qn(n,e,t,r,i,o){var a,s=e&RA,l=e&LA,u=e&IA;if(t&&(a=i?t(n,r,i,o):t(n)),a!==void 0)return a;if(!Mt(n))return n;var d=je(n);if(d){if(a=iA(n),!s)return wn(n,a)}else{var f=on(n),c=f==Ug||f==$A;if(di(n))return Tg(n,s);if(f==Yg||f==Gg||c&&!i){if(a=l||c?{}:$g(n),!s)return l?KO(n,WO(a,n)):YO(n,wg(a,n))}else{if(!St[f])return i?n:{};a=TA(n,f,s)}}o||(o=new yr);var h=o.get(n);if(h)return h;o.set(n,a),Xg(n)?n.forEach(function(g){a.add(qn(g,e,t,g,n,o))}):zg(n)&&n.forEach(function(g,y){a.set(y,qn(g,e,t,y,n,o))});var p=u?l?Xd:Wd:l?On:Wt,v=d?void 0:p(n);return Ln(v||n,function(g,y){v&&(y=g,g=n[y]),_a(a,y,qn(g,e,t,y,n,o))}),a}var oC=4;function aC(n){return qn(n,oC)}var sC=1,lC=4;function Ee(n){return qn(n,sC|lC)}var uC=1,dC=4;function fC(n,e){return e=typeof e=="function"?e:void 0,qn(n,uC|dC,e)}var cC=4;function hC(n,e){return e=typeof e=="function"?e:void 0,qn(n,cC,e)}function pC(){return new Yn(this.value(),this.__chain__)}function vC(n){for(var e=-1,t=n==null?0:n.length,r=0,i=[];++e<t;){var o=n[e];o&&(i[r++]=o)}return i}function gC(){var n=arguments.length;if(!n)return[];for(var e=Array(n-1),t=arguments[0],r=n;r--;)e[r-1]=arguments[r];return hi(je(t)?wn(t):[t],Vt(e,1))}var yC="__lodash_hash_undefined__";function mC(n){return this.__data__.set(n,yC),this}function _C(n){return this.__data__.has(n)}function Hi(n){var e=-1,t=n==null?0:n.length;for(this.__data__=new Kr;++e<t;)this.add(n[e])}Hi.prototype.add=Hi.prototype.push=mC,Hi.prototype.has=_C;function Vd(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(e(n[t],t,n))return!0;return!1}function Oa(n,e){return n.has(e)}var bC=1,xC=2;function Vg(n,e,t,r,i,o){var a=t&bC,s=n.length,l=e.length;if(s!=l&&!(a&&l>s))return!1;var u=o.get(n),d=o.get(e);if(u&&d)return u==e&&d==n;var f=-1,c=!0,h=t&xC?new Hi:void 0;for(o.set(n,e),o.set(e,n);++f<s;){var p=n[f],v=e[f];if(r)var g=a?r(v,p,f,e,n,o):r(p,v,f,n,e,o);if(g!==void 0){if(g)continue;c=!1;break}if(h){if(!Vd(e,function(y,m){if(!Oa(h,m)&&(p===y||i(p,y,t,r,o)))return h.push(m)})){c=!1;break}}else if(!(p===v||i(p,v,t,r,o))){c=!1;break}}return o.delete(n),o.delete(e),c}function Kd(n){var e=-1,t=Array(n.size);return n.forEach(function(r,i){t[++e]=[i,r]}),t}function ll(n){var e=-1,t=Array(n.size);return n.forEach(function(r){t[++e]=r}),t}var EC=1,wC=2,SC="[object Boolean]",OC="[object Date]",AC="[object Error]",CC="[object Map]",TC="[object Number]",MC="[object RegExp]",NC="[object Set]",PC="[object String]",DC="[object Symbol]",RC="[object ArrayBuffer]",LC="[object DataView]",Kg=rn?rn.prototype:void 0,qd=Kg?Kg.valueOf:void 0;function IC(n,e,t,r,i,o,a){switch(t){case LC:if(n.byteLength!=e.byteLength||n.byteOffset!=e.byteOffset)return!1;n=n.buffer,e=e.buffer;case RC:return!(n.byteLength!=e.byteLength||!o(new sl(n),new sl(e)));case SC:case OC:case TC:return pr(+n,+e);case AC:return n.name==e.name&&n.message==e.message;case MC:case PC:return n==e+"";case CC:var s=Kd;case NC:var l=r&EC;if(s||(s=ll),n.size!=e.size&&!l)return!1;var u=a.get(n);if(u)return u==e;r|=wC,a.set(n,e);var d=Vg(s(n),s(e),r,i,o,a);return a.delete(n),d;case DC:if(qd)return qd.call(n)==qd.call(e)}return!1}var kC=1,jC=Object.prototype,BC=jC.hasOwnProperty;function FC(n,e,t,r,i,o){var a=t&kC,s=Wd(n),l=s.length,u=Wd(e),d=u.length;if(l!=d&&!a)return!1;for(var f=l;f--;){var c=s[f];if(!(a?c in e:BC.call(e,c)))return!1}var h=o.get(n),p=o.get(e);if(h&&p)return h==e&&p==n;var v=!0;o.set(n,e),o.set(e,n);for(var g=a;++f<l;){c=s[f];var y=n[c],m=e[c];if(r)var O=a?r(m,y,c,e,n,o):r(y,m,c,n,e,o);if(!(O===void 0?y===m||i(y,m,t,r,o):O)){v=!1;break}g||(g=c=="constructor")}if(v&&!g){var T=n.constructor,C=e.constructor;T!=C&&"constructor"in n&&"constructor"in e&&!(typeof T=="function"&&T instanceof T&&typeof C=="function"&&C instanceof C)&&(v=!1)}return o.delete(n),o.delete(e),v}var $C=1,qg="[object Arguments]",Zg="[object Array]",ul="[object Object]",HC=Object.prototype,Qg=HC.hasOwnProperty;function zC(n,e,t,r,i,o){var a=je(n),s=je(e),l=a?Zg:on(n),u=s?Zg:on(e);l=l==qg?ul:l,u=u==qg?ul:u;var d=l==ul,f=u==ul,c=l==u;if(c&&di(n)){if(!di(e))return!1;a=!0,d=!1}if(c&&!d)return o||(o=new yr),a||wo(n)?Vg(n,e,t,r,i,o):IC(n,e,l,t,r,i,o);if(!(t&$C)){var h=d&&Qg.call(n,"__wrapped__"),p=f&&Qg.call(e,"__wrapped__");if(h||p){var v=h?n.value():n,g=p?e.value():e;return o||(o=new yr),i(v,g,t,r,o)}}return c?(o||(o=new yr),FC(n,e,t,r,i,o)):!1}function Aa(n,e,t,r,i){return n===e?!0:n==null||e==null||!Rt(n)&&!Rt(e)?n!==n&&e!==e:zC(n,e,t,r,Aa,i)}var WC=1,XC=2;function Zd(n,e,t,r){var i=t.length,o=i,a=!r;if(n==null)return!o;for(n=Object(n);i--;){var s=t[i];if(a&&s[2]?s[1]!==n[s[0]]:!(s[0]in n))return!1}for(;++i<o;){s=t[i];var l=s[0],u=n[l],d=s[1];if(a&&s[2]){if(u===void 0&&!(l in n))return!1}else{var f=new yr;if(r)var c=r(u,d,l,n,e,f);if(!(c===void 0?Aa(d,u,WC|XC,r,f):c))return!1}}return!0}function Jg(n){return n===n&&!Mt(n)}function Qd(n){for(var e=Wt(n),t=e.length;t--;){var r=e[t],i=n[r];e[t]=[r,i,Jg(i)]}return e}function ey(n,e){return function(t){return t==null?!1:t[n]===e&&(e!==void 0||n in Object(t))}}function ty(n){var e=Qd(n);return e.length==1&&e[0][2]?ey(e[0][0],e[0][1]):function(t){return t===n||Zd(t,n,e)}}function GC(n,e){return n!=null&&e in Object(n)}function ny(n,e,t){e=fi(e,n);for(var r=-1,i=e.length,o=!1;++r<i;){var a=vr(e[r]);if(!(o=n!=null&&t(n,a)))break;n=n[a]}return o||++r!=i?o:(i=n==null?0:n.length,!!i&&tl(i)&&Ur(a,i)&&(je(n)||ji(n)))}function Jd(n,e){return n!=null&&ny(n,e,GC)}var UC=1,YC=2;function ry(n,e){return Pd(n)&&Jg(e)?ey(vr(n),e):function(t){var r=ci(t,n);return r===void 0&&r===e?Jd(t,n):Aa(e,r,UC|YC)}}function ef(n){return function(e){return e==null?void 0:e[n]}}function VC(n){return function(e){return Fi(e,n)}}function iy(n){return Pd(n)?ef(vr(n)):VC(n)}function Be(n){return typeof n=="function"?n:n==null?En:typeof n=="object"?je(n)?ry(n[0],n[1]):ty(n):iy(n)}var KC="Expected a function";function qC(n){var e=n==null?0:n.length,t=Be;return n=e?Tt(n,function(r){if(typeof r[1]!="function")throw new TypeError(KC);return[t(r[0]),r[1]]}):[],Ve(function(r){for(var i=-1;++i<e;){var o=n[i];if(Rn(o[0],this,r))return Rn(o[1],this,r)}})}function oy(n,e,t){var r=t.length;if(n==null)return!r;for(n=Object(n);r--;){var i=t[r],o=e[i],a=n[i];if(a===void 0&&!(i in n)||!o(a))return!1}return!0}function ZC(n){var e=Wt(n);return function(t){return oy(t,n,e)}}var QC=1;function JC(n){return ZC(qn(n,QC))}function eT(n,e){return e==null||oy(n,e,Wt(e))}function tT(n,e,t,r){for(var i=-1,o=n==null?0:n.length;++i<o;){var a=n[i];e(r,a,t(a),n)}return r}function ay(n){return function(e,t,r){for(var i=-1,o=Object(e),a=r(e),s=a.length;s--;){var l=a[n?s:++i];if(t(o[l],l,o)===!1)break}return e}}var tf=ay();function Pr(n,e){return n&&tf(n,e,Wt)}function sy(n,e){return function(t,r){if(t==null)return t;if(!Sn(t))return n(t,r);for(var i=t.length,o=e?i:-1,a=Object(t);(e?o--:++o<i)&&r(a[o],o,a)!==!1;);return t}}var gi=sy(Pr);function nT(n,e,t,r){return gi(n,function(i,o,a){e(r,i,t(i),a)}),r}function dl(n,e){return function(t,r){var i=je(t)?tT:nT,o=e?e():{};return i(t,n,Be(r),o)}}var rT=Object.prototype,iT=rT.hasOwnProperty,oT=dl(function(n,e,t){iT.call(n,t)?++n[t]:Mr(n,t,1)});function aT(n,e){var t=yo(n);return e==null?t:wg(t,e)}var sT=8;function nf(n,e,t){e=t?void 0:e;var r=Yr(n,sT,void 0,void 0,void 0,void 0,void 0,e);return r.placeholder=nf.placeholder,r}nf.placeholder={};var lT=16;function rf(n,e,t){e=t?void 0:e;var r=Yr(n,lT,void 0,void 0,void 0,void 0,void 0,e);return r.placeholder=rf.placeholder,r}rf.placeholder={};var fl=function(){return zt.Date.now()},uT="Expected a function",dT=Math.max,fT=Math.min;function cl(n,e,t){var r,i,o,a,s,l,u=0,d=!1,f=!1,c=!0;if(typeof n!="function")throw new TypeError(uT);e=Un(e)||0,Mt(t)&&(d=!!t.leading,f="maxWait"in t,o=f?dT(Un(t.maxWait)||0,e):o,c="trailing"in t?!!t.trailing:c);function h(A){var E=r,N=i;return r=i=void 0,u=A,a=n.apply(N,E),a}function p(A){return u=A,s=setTimeout(y,e),d?h(A):a}function v(A){var E=A-l,N=A-u,B=e-E;return f?fT(B,o-N):B}function g(A){var E=A-l,N=A-u;return l===void 0||E>=e||E<0||f&&N>=o}function y(){var A=fl();if(g(A))return m(A);s=setTimeout(y,v(A))}function m(A){return s=void 0,c&&r?h(A):(r=i=void 0,a)}function O(){s!==void 0&&clearTimeout(s),u=0,r=l=i=s=void 0}function T(){return s===void 0?a:m(fl())}function C(){var A=fl(),E=g(A);if(r=arguments,i=this,l=A,E){if(s===void 0)return p(l);if(f)return clearTimeout(s),s=setTimeout(y,e),h(l)}return s===void 0&&(s=setTimeout(y,e)),a}return C.cancel=O,C.flush=T,C}function cT(n,e){return n==null||n!==n?e:n}var ly=Object.prototype,hT=ly.hasOwnProperty,pT=Ve(function(n,e){n=Object(n);var t=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&cn(e[0],e[1],i)&&(r=1);++t<r;)for(var o=e[t],a=On(o),s=-1,l=a.length;++s<l;){var u=a[s],d=n[u];(d===void 0||pr(d,ly[u])&&!hT.call(n,u))&&(n[u]=o[u])}return n});function of(n,e,t){(t!==void 0&&!pr(n[e],t)||t===void 0&&!(e in n))&&Mr(n,e,t)}function jt(n){return Rt(n)&&Sn(n)}function af(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function uy(n){return Nr(n,On(n))}function vT(n,e,t,r,i,o,a){var s=af(n,t),l=af(e,t),u=a.get(l);if(u){of(n,t,u);return}var d=o?o(s,l,t+"",n,e,a):void 0,f=d===void 0;if(f){var c=je(l),h=!c&&di(l),p=!c&&!h&&wo(l);d=l,c||h||p?je(s)?d=s:jt(s)?d=wn(s):h?(f=!1,d=Tg(l,!0)):p?(f=!1,d=Fg(l,!0)):d=[]:Sa(l)||ji(l)?(d=s,ji(s)?d=uy(s):(!Mt(s)||hr(s))&&(d=$g(l))):f=!1}f&&(a.set(l,d),i(d,l,r,o,a),a.delete(l)),of(n,t,d)}function hl(n,e,t,r,i){n!==e&&tf(e,function(o,a){if(i||(i=new yr),Mt(o))vT(n,e,a,t,hl,r,i);else{var s=r?r(af(n,a),o,a+"",n,e,i):void 0;s===void 0&&(s=o),of(n,a,s)}},On)}function dy(n,e,t,r,i,o){return Mt(n)&&Mt(e)&&(o.set(e,n),hl(n,e,void 0,dy,o),o.delete(e)),n}var fy=Eo(function(n,e,t,r){hl(n,e,t,r)}),gT=Ve(function(n){return n.push(void 0,dy),Rn(fy,void 0,n)}),yT="Expected a function";function cy(n,e,t){if(typeof n!="function")throw new TypeError(yT);return setTimeout(function(){n.apply(void 0,t)},e)}var mT=Ve(function(n,e){return cy(n,1,e)}),_T=Ve(function(n,e,t){return cy(n,Un(e)||0,t)});function sf(n,e,t){for(var r=-1,i=n==null?0:n.length;++r<i;)if(t(e,n[r]))return!0;return!1}var bT=200;function Ca(n,e,t,r){var i=-1,o=Js,a=!0,s=n.length,l=[],u=e.length;if(!s)return l;t&&(e=Tt(e,In(t))),r?(o=sf,a=!1):e.length>=bT&&(o=Oa,a=!1,e=new Hi(e));e:for(;++i<s;){var d=n[i],f=t==null?d:t(d);if(d=r||d!==0?d:0,a&&f===f){for(var c=u;c--;)if(e[c]===f)continue e;l.push(d)}else o(e,f,r)||l.push(d)}return l}var xT=Ve(function(n,e){return jt(n)?Ca(n,Vt(e,1,jt,!0)):[]});function kn(n){var e=n==null?0:n.length;return e?n[e-1]:void 0}var ET=Ve(function(n,e){var t=kn(e);return jt(t)&&(t=void 0),jt(n)?Ca(n,Vt(e,1,jt,!0),Be(t)):[]}),wT=Ve(function(n,e){var t=kn(e);return jt(t)&&(t=void 0),jt(n)?Ca(n,Vt(e,1,jt,!0),void 0,t):[]}),ST=Us(function(n,e){return n/e},1);function OT(n,e,t){var r=n==null?0:n.length;return r?(e=t||e===void 0?1:Ge(e),Kn(n,e<0?0:e,r)):[]}function AT(n,e,t){var r=n==null?0:n.length;return r?(e=t||e===void 0?1:Ge(e),e=r-e,Kn(n,0,e<0?0:e)):[]}function pl(n,e,t,r){for(var i=n.length,o=r?i:-1;(r?o--:++o<i)&&e(n[o],o,n););return t?Kn(n,r?0:o,r?o+1:i):Kn(n,r?o+1:0,r?i:o)}function CT(n,e){return n&&n.length?pl(n,Be(e),!0,!0):[]}function TT(n,e){return n&&n.length?pl(n,Be(e),!0):[]}function Dr(n){return typeof n=="function"?n:En}function nt(n,e){var t=je(n)?Ln:gi;return t(n,Dr(e))}function MT(n,e){for(var t=n==null?0:n.length;t--&&e(n[t],t,n)!==!1;);return n}var hy=ay(!0);function lf(n,e){return n&&hy(n,e,Wt)}var py=sy(lf,!0);function NT(n,e){var t=je(n)?MT:py;return t(n,Dr(e))}function PT(n,e,t){n=yt(n),e=Dn(e);var r=n.length;t=t===void 0?r:$i(Ge(t),0,r);var i=t;return t-=e.length,t>=0&&n.slice(t,i)==e}function DT(n,e){return Tt(e,function(t){return[t,n[t]]})}function RT(n){var e=-1,t=Array(n.size);return n.forEach(function(r){t[++e]=[r,r]}),t}var LT="[object Map]",IT="[object Set]";function vy(n){return function(e){var t=on(e);return t==LT?Kd(e):t==IT?RT(e):DT(e,n(e))}}var Zr=vy(Wt),kT=vy(On),jT={"&":"&","<":"<",">":">",'"':""","'":"'"},BT=Fd(jT),gy=/[&<>"']/g,FT=RegExp(gy.source);function yy(n){return n=yt(n),n&&FT.test(n)?n.replace(gy,BT):n}var my=/[\\^$.*+?()[\]{}|]/g,$T=RegExp(my.source);function HT(n){return n=yt(n),n&&$T.test(n)?n.replace(my,"\\$&"):n}function _y(n,e){for(var t=-1,r=n==null?0:n.length;++t<r;)if(!e(n[t],t,n))return!1;return!0}function zT(n,e){var t=!0;return gi(n,function(r,i,o){return t=!!e(r,i,o),t}),t}function WT(n,e,t){var r=je(n)?_y:zT;return t&&cn(n,e,t)&&(e=void 0),r(n,Be(e))}var XT=4294967295;function by(n){return n?$i(Ge(n),0,XT):0}function GT(n,e,t,r){var i=n.length;for(t=Ge(t),t<0&&(t=-t>i?0:i+t),r=r===void 0||r>i?i:Ge(r),r<0&&(r+=i),r=t>r?0:by(r);t<r;)n[t++]=e;return n}function UT(n,e,t,r){var i=n==null?0:n.length;return i?(t&&typeof t!="number"&&cn(n,e,t)&&(t=0,r=i),GT(n,e,t,r)):[]}function xy(n,e){var t=[];return gi(n,function(r,i,o){e(r,i,o)&&t.push(r)}),t}function YT(n,e){var t=je(n)?vi:xy;return t(n,Be(e))}function Ey(n){return function(e,t,r){var i=Object(e);if(!Sn(e)){var o=Be(t);e=Wt(e),t=function(s){return o(i[s],s,i)}}var a=n(e,t,r);return a>-1?i[o?e[a]:a]:void 0}}var VT=Math.max;function uf(n,e,t){var r=n==null?0:n.length;if(!r)return-1;var i=t==null?0:Ge(t);return i<0&&(i=VT(r+i,0)),Qs(n,Be(e),i)}var yi=Ey(uf);function wy(n,e,t){var r;return t(n,function(i,o,a){if(e(i,o,a))return r=o,!1}),r}function KT(n,e){return wy(n,Be(e),Pr)}var qT=Math.max,ZT=Math.min;function Sy(n,e,t){var r=n==null?0:n.length;if(!r)return-1;var i=r-1;return t!==void 0&&(i=Ge(t),i=t<0?qT(r+i,0):ZT(i,r-1)),Qs(n,Be(e),i,!0)}var QT=Ey(Sy);function JT(n,e){return wy(n,Be(e),lf)}function eM(n){return n&&n.length?n[0]:void 0}function Oy(n,e){var t=-1,r=Sn(n)?Array(n.length):[];return gi(n,function(i,o,a){r[++t]=e(i,o,a)}),r}function jn(n,e){var t=je(n)?Tt:Oy;return t(n,Be(e))}function tM(n,e){return Vt(jn(n,e),1)}var nM=1/0;function rM(n,e){return Vt(jn(n,e),nM)}function iM(n,e,t){return t=t===void 0?1:Ge(t),Vt(jn(n,e),t)}var oM=1/0;function aM(n){var e=n==null?0:n.length;return e?Vt(n,oM):[]}function sM(n,e){var t=n==null?0:n.length;return t?(e=e===void 0?1:Ge(e),Vt(n,e)):[]}var lM=512;function uM(n){return Yr(n,lM)}var dM=$d("floor"),fM="Expected a function",cM=8,hM=32,pM=128,vM=256;function Ay(n){return qr(function(e){var t=e.length,r=t,i=Yn.prototype.thru;for(n&&e.reverse();r--;){var o=e[r];if(typeof o!="function")throw new TypeError(fM);if(i&&!a&&qs(o)=="wrapper")var a=new Yn([],!0)}for(r=a?r:t;++r<t;){o=e[r];var s=qs(o),l=s=="wrapper"?xd(o):void 0;l&&Ed(l[0])&&l[1]==(pM|cM|hM|vM)&&!l[4].length&&l[9]==1?a=a[qs(l[0])].apply(a,l[3]):a=o.length==1&&Ed(o)?a[s]():a.thru(o)}return function(){var u=arguments,d=u[0];if(a&&u.length==1&&je(d))return a.plant(d).value();for(var f=0,c=t?e[f].apply(this,u):d;++f<t;)c=e[f].call(this,c);return c}})}var gM=Ay(),yM=Ay(!0);function mM(n,e){return n==null?n:tf(n,Dr(e),On)}function _M(n,e){return n==null?n:hy(n,Dr(e),On)}function bM(n,e){return n&&Pr(n,Dr(e))}function xM(n,e){return n&&lf(n,Dr(e))}function EM(n){for(var e=-1,t=n==null?0:n.length,r={};++e<t;){var i=n[e];Mr(r,i[0],i[1])}return r}function vl(n,e){return vi(e,function(t){return hr(n[t])})}function wM(n){return n==null?[]:vl(n,Wt(n))}function SM(n){return n==null?[]:vl(n,On(n))}var OM=Object.prototype,AM=OM.hasOwnProperty,CM=dl(function(n,e,t){AM.call(n,t)?n[t].push(e):Mr(n,t,[e])});function df(n,e){return n>e}function gl(n){return function(e,t){return typeof e=="string"&&typeof t=="string"||(e=Un(e),t=Un(t)),n(e,t)}}var TM=gl(df),MM=gl(function(n,e){return n>=e}),NM=Object.prototype,PM=NM.hasOwnProperty;function DM(n,e){return n!=null&&PM.call(n,e)}function yl(n,e){return n!=null&&ny(n,e,DM)}var RM=Math.max,LM=Math.min;function IM(n,e,t){return n>=LM(e,t)&&n<RM(e,t)}function kM(n,e,t){return e=Gr(e),t===void 0?(t=e,e=0):t=Gr(t),n=Un(n),IM(n,e,t)}var jM="[object String]";function ml(n){return typeof n=="string"||!je(n)&&Rt(n)&&fn(n)==jM}function ff(n,e){return Tt(e,function(t){return n[t]})}function To(n){return n==null?[]:ff(n,Wt(n))}var BM=Math.max;function FM(n,e,t,r){n=Sn(n)?n:To(n),t=t&&!r?Ge(t):0;var i=n.length;return t<0&&(t=BM(i+t,0)),ml(n)?t<=i&&n.indexOf(e,t)>-1:!!i&&bo(n,e,t)>-1}var $M=Math.max;function Cy(n,e,t){var r=n==null?0:n.length;if(!r)return-1;var i=t==null?0:Ge(t);return i<0&&(i=$M(r+i,0)),bo(n,e,i)}function HM(n){var e=n==null?0:n.length;return e?Kn(n,0,-1):[]}var zM=Math.min;function cf(n,e,t){for(var r=t?sf:Js,i=n[0].length,o=n.length,a=o,s=Array(o),l=1/0,u=[];a--;){var d=n[a];a&&e&&(d=Tt(d,In(e))),l=zM(d.length,l),s[a]=!t&&(e||i>=120&&d.length>=120)?new Hi(a&&d):void 0}d=n[0];var f=-1,c=s[0];e:for(;++f<i&&u.length<l;){var h=d[f],p=e?e(h):h;if(h=t||h!==0?h:0,!(c?Oa(c,p):r(u,p,t))){for(a=o;--a;){var v=s[a];if(!(v?Oa(v,p):r(n[a],p,t)))continue e}c&&c.push(p),u.push(h)}}return u}function hf(n){return jt(n)?n:[]}var WM=Ve(function(n){var e=Tt(n,hf);return e.length&&e[0]===n[0]?cf(e):[]}),XM=Ve(function(n){var e=kn(n),t=Tt(n,hf);return e===kn(t)?e=void 0:t.pop(),t.length&&t[0]===n[0]?cf(t,Be(e)):[]}),GM=Ve(function(n){var e=kn(n),t=Tt(n,hf);return e=typeof e=="function"?e:void 0,e&&t.pop(),t.length&&t[0]===n[0]?cf(t,void 0,e):[]});function UM(n,e,t,r){return Pr(n,function(i,o,a){e(r,t(i),o,a)}),r}function Ty(n,e){return function(t,r){return UM(t,n,e(r),{})}}var YM=Object.prototype,VM=YM.toString,KM=Ty(function(n,e,t){e!=null&&typeof e.toString!="function"&&(e=VM.call(e)),n[e]=t},wd(En)),My=Object.prototype,qM=My.hasOwnProperty,ZM=My.toString,QM=Ty(function(n,e,t){e!=null&&typeof e.toString!="function"&&(e=ZM.call(e)),qM.call(n,e)?n[e].push(t):n[e]=[t]},Be);function Ny(n,e){return e.length<2?n:Fi(n,Kn(e,0,-1))}function Ta(n,e,t){e=fi(e,n),n=Ny(n,e);var r=n==null?n:n[vr(kn(e))];return r==null?void 0:Rn(r,n,t)}var JM=Ve(Ta),eN=Ve(function(n,e,t){var r=-1,i=typeof e=="function",o=Sn(n)?Array(n.length):[];return gi(n,function(a){o[++r]=i?Rn(e,a,t):Ta(a,e,t)}),o}),tN="[object ArrayBuffer]";function nN(n){return Rt(n)&&fn(n)==tN}var Py=Vn&&Vn.isArrayBuffer,rN=Py?In(Py):nN,iN="[object Boolean]";function _l(n){return n===!0||n===!1||Rt(n)&&fn(n)==iN}var oN="[object Date]";function aN(n){return Rt(n)&&fn(n)==oN}var Dy=Vn&&Vn.isDate,sN=Dy?In(Dy):aN;function lN(n){return Rt(n)&&n.nodeType===1&&!Sa(n)}var uN="[object Map]",dN="[object Set]",fN=Object.prototype,cN=fN.hasOwnProperty;function Ma(n){if(n==null)return!0;if(Sn(n)&&(je(n)||typeof n=="string"||typeof n.splice=="function"||di(n)||wo(n)||ji(n)))return!n.length;var e=on(n);if(e==uN||e==dN)return!n.size;if(ba(n))return!Md(n).length;for(var t in n)if(cN.call(n,t))return!1;return!0}function pf(n,e){return Aa(n,e)}function hN(n,e,t){t=typeof t=="function"?t:void 0;var r=t?t(n,e):void 0;return r===void 0?Aa(n,e,void 0,t):!!r}var pN=zt.isFinite;function vN(n){return typeof n=="number"&&pN(n)}function Ry(n){return typeof n=="number"&&n==Ge(n)}function gN(n,e){return n===e||Zd(n,e,Qd(e))}function yN(n,e,t){return t=typeof t=="function"?t:void 0,Zd(n,e,Qd(e),t)}var mN="[object Number]";function Ly(n){return typeof n=="number"||Rt(n)&&fn(n)==mN}function _N(n){return Ly(n)&&n!=+n}var bN=Ys?hr:Cd,xN="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.";function EN(n){if(bN(n))throw new Error(xN);return uv(n)}function Kt(n){return n==null}function wN(n){return n===null}var SN="[object RegExp]";function ON(n){return Rt(n)&&fn(n)==SN}var Iy=Vn&&Vn.isRegExp,vf=Iy?In(Iy):ON,ky=9007199254740991;function AN(n){return Ry(n)&&n>=-ky&&n<=ky}function zi(n){return n===void 0}var CN="[object WeakMap]";function TN(n){return Rt(n)&&on(n)==CN}var MN="[object WeakSet]";function NN(n){return Rt(n)&&fn(n)==MN}var PN=1;function DN(n){return Be(typeof n=="function"?n:qn(n,PN))}var RN=Array.prototype,LN=RN.join;function IN(n,e){return n==null?"":LN.call(n,e)}var kN=Ao(function(n,e,t){return n+(t?"-":"")+e.toLowerCase()}),jN=dl(function(n,e,t){Mr(n,t,e)});function BN(n,e,t){for(var r=t+1;r--;)if(n[r]===e)return r;return r}var FN=Math.max,$N=Math.min;function HN(n,e,t){var r=n==null?0:n.length;if(!r)return-1;var i=r;return t!==void 0&&(i=Ge(t),i=i<0?FN(r+i,0):$N(i,r-1)),e===e?BN(n,e,i):Qs(n,yv,i,!0)}var zN=Ao(function(n,e,t){return n+(t?" ":"")+e.toLowerCase()}),WN=tg("toLowerCase");function gf(n,e){return n<e}var XN=gl(gf),GN=gl(function(n,e){return n<=e});function jy(n,e){var t={};return e=Be(e),Pr(n,function(r,i,o){Mr(t,e(r,i,o),r)}),t}function UN(n,e){var t={};return e=Be(e),Pr(n,function(r,i,o){Mr(t,i,e(r,i,o))}),t}var YN=1;function VN(n){return ty(qn(n,YN))}var KN=1;function qN(n,e){return ry(n,qn(e,KN))}function bl(n,e,t){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=e(o);if(a!=null&&(s===void 0?a===a&&!Pn(a):t(a,s)))var s=a,l=o}return l}function ZN(n){return n&&n.length?bl(n,En,df):void 0}function QN(n,e){return n&&n.length?bl(n,Be(e),df):void 0}function yf(n,e){for(var t,r=-1,i=n.length;++r<i;){var o=e(n[r]);o!==void 0&&(t=t===void 0?o:t+o)}return t}var JN=NaN;function By(n,e){var t=n==null?0:n.length;return t?yf(n,e)/t:JN}function eP(n){return By(n,En)}function tP(n,e){return By(n,Be(e))}var Qr=Eo(function(n,e,t){hl(n,e,t)}),nP=Ve(function(n,e){return function(t){return Ta(t,n,e)}}),rP=Ve(function(n,e){return function(t){return Ta(n,t,e)}});function iP(n){return n&&n.length?bl(n,En,gf):void 0}function oP(n,e){return n&&n.length?bl(n,Be(e),gf):void 0}function aP(n,e,t){var r=Wt(e),i=vl(e,r),o=!(Mt(t)&&"chain"in t)||!!t.chain,a=hr(n);return Ln(i,function(s){var l=e[s];n[s]=l,a&&(n.prototype[s]=function(){var u=this.__chain__;if(o||u){var d=n(this.__wrapped__),f=d.__actions__=wn(this.__actions__);return f.push({func:l,args:arguments,thisArg:n}),d.__chain__=u,d}return l.apply(n,hi([this.value()],arguments))})}),n}var sP=Us(function(n,e){return n*e},1),lP="Expected a function";function xl(n){if(typeof n!="function")throw new TypeError(lP);return function(){var e=arguments;switch(e.length){case 0:return!n.call(this);case 1:return!n.call(this,e[0]);case 2:return!n.call(this,e[0],e[1]);case 3:return!n.call(this,e[0],e[1],e[2])}return!n.apply(this,e)}}function uP(n){for(var e,t=[];!(e=n.next()).done;)t.push(e.value);return t}var dP="[object Map]",fP="[object Set]",mf=rn?rn.iterator:void 0;function Fy(n){if(!n)return[];if(Sn(n))return ml(n)?gr(n):wn(n);if(mf&&n[mf])return uP(n[mf]());var e=on(n),t=e==dP?Kd:e==fP?ll:To;return t(n)}function cP(){this.__values__===void 0&&(this.__values__=Fy(this.value()));var n=this.__index__>=this.__values__.length,e=n?void 0:this.__values__[this.__index__++];return{done:n,value:e}}function $y(n,e){var t=n.length;if(t)return e+=e<0?t:0,Ur(e,t)?n[e]:void 0}function hP(n,e){return n&&n.length?$y(n,Ge(e)):void 0}function pP(n){return n=Ge(n),Ve(function(e){return $y(e,n)})}var vP=Object.prototype,gP=vP.hasOwnProperty;function _f(n,e){e=fi(e,n);var t=-1,r=e.length;if(!r)return!0;for(;++t<r;){var i=vr(e[t]);if(i==="__proto__"&&!gP.call(n,"__proto__")||(i==="constructor"||i==="prototype")&&t<r-1)return!1}var o=Ny(n,e);return o==null||delete o[vr(kn(e))]}function yP(n){return Sa(n)?void 0:n}var mP=1,_P=2,bP=4,xP=qr(function(n,e){var t={};if(n==null)return t;var r=!1;e=Tt(e,function(o){return o=fi(o,n),r||(r=o.length>1),o}),Nr(n,Xd(n),t),r&&(t=qn(t,mP|_P|bP,yP));for(var i=e.length;i--;)_f(t,e[i]);return t});function Na(n,e,t,r){if(!Mt(n))return n;e=fi(e,n);for(var i=-1,o=e.length,a=o-1,s=n;s!=null&&++i<o;){var l=vr(e[i]),u=t;if(l==="__proto__"||l==="constructor"||l==="prototype")return n;if(i!=a){var d=s[l];u=r?r(d,l,s):void 0,u===void 0&&(u=Mt(d)?d:Ur(e[i+1])?[]:{})}_a(s,l,u),s=s[l]}return n}function Hy(n,e,t){for(var r=-1,i=e.length,o={};++r<i;){var a=e[r],s=Fi(n,a);t(s,a)&&Na(o,fi(a,n),s)}return o}function zy(n,e){if(n==null)return{};var t=Tt(Xd(n),function(r){return[r]});return e=Be(e),Hy(n,t,function(r,i){return e(r,i[0])})}function EP(n,e){return zy(n,xl(Be(e)))}function wP(n){return Vv(2,n)}function SP(n,e){var t=n.length;for(n.sort(e);t--;)n[t]=n[t].value;return n}function Wy(n,e){if(n!==e){var t=n!==void 0,r=n===null,i=n===n,o=Pn(n),a=e!==void 0,s=e===null,l=e===e,u=Pn(e);if(!s&&!u&&!o&&n>e||o&&a&&l&&!s&&!u||r&&a&&l||!t&&l||!i)return 1;if(!r&&!o&&!u&&n<e||u&&t&&i&&!r&&!o||s&&t&&i||!a&&i||!l)return-1}return 0}function OP(n,e,t){for(var r=-1,i=n.criteria,o=e.criteria,a=i.length,s=t.length;++r<a;){var l=Wy(i[r],o[r]);if(l){if(r>=s)return l;var u=t[r];return l*(u=="desc"?-1:1)}}return n.index-e.index}function Xy(n,e,t){e.length?e=Tt(e,function(o){return je(o)?function(a){return Fi(a,o.length===1?o[0]:o)}:o}):e=[En];var r=-1;e=Tt(e,In(Be));var i=Oy(n,function(o,a,s){var l=Tt(e,function(u){return u(o)});return{criteria:l,index:++r,value:o}});return SP(i,function(o,a){return OP(o,a,t)})}function AP(n,e,t,r){return n==null?[]:(je(e)||(e=e==null?[]:[e]),t=r?void 0:t,je(t)||(t=t==null?[]:[t]),Xy(n,e,t))}function bf(n){return qr(function(e){return e=Tt(e,In(Be)),Ve(function(t){var r=this;return n(e,function(i){return Rn(i,r,t)})})})}var CP=bf(Tt),TP=Ve,MP=Math.min,NP=TP(function(n,e){e=e.length==1&&je(e[0])?Tt(e[0],In(Be)):Tt(Vt(e,1),In(Be));var t=e.length;return Ve(function(r){for(var i=-1,o=MP(r.length,t);++i<o;)r[i]=e[i].call(this,r[i]);return Rn(n,this,r)})}),PP=bf(_y),DP=bf(Vd),RP=9007199254740991,LP=Math.floor;function xf(n,e){var t="";if(!n||e<1||e>RP)return t;do e%2&&(t+=n),e=LP(e/2),e&&(n+=n);while(e);return t}var IP=ef("length"),Gy="\\ud800-\\udfff",kP="\\u0300-\\u036f",jP="\\ufe20-\\ufe2f",BP="\\u20d0-\\u20ff",FP=kP+jP+BP,$P="\\ufe0e\\ufe0f",HP="["+Gy+"]",Ef="["+FP+"]",wf="\\ud83c[\\udffb-\\udfff]",zP="(?:"+Ef+"|"+wf+")",Uy="[^"+Gy+"]",Yy="(?:\\ud83c[\\udde6-\\uddff]){2}",Vy="[\\ud800-\\udbff][\\udc00-\\udfff]",WP="\\u200d",Ky=zP+"?",qy="["+$P+"]?",XP="(?:"+WP+"(?:"+[Uy,Yy,Vy].join("|")+")"+qy+Ky+")*",GP=qy+Ky+XP,UP="(?:"+[Uy+Ef+"?",Ef,Yy,Vy,HP].join("|")+")",Zy=RegExp(wf+"(?="+wf+")|"+UP+GP,"g");function YP(n){for(var e=Zy.lastIndex=0;Zy.test(n);)++e;return e}function Mo(n){return So(n)?YP(n):IP(n)}var VP=Math.ceil;function El(n,e){e=e===void 0?" ":Dn(e);var t=e.length;if(t<2)return t?xf(e,n):e;var r=xf(e,VP(n/Mo(e)));return So(e)?pi(gr(r),0,n).join(""):r.slice(0,n)}var KP=Math.ceil,qP=Math.floor;function ZP(n,e,t){n=yt(n),e=Ge(e);var r=e?Mo(n):0;if(!e||r>=e)return n;var i=(e-r)/2;return El(qP(i),t)+n+El(KP(i),t)}function QP(n,e,t){n=yt(n),e=Ge(e);var r=e?Mo(n):0;return e&&r<e?n+El(e-r,t):n}function JP(n,e,t){n=yt(n),e=Ge(e);var r=e?Mo(n):0;return e&&r<e?El(e-r,t)+n:n}var e2=/^\s+/,t2=zt.parseInt;function n2(n,e,t){return t||e==null?e=0:e&&(e=+e),t2(yt(n).replace(e2,""),e||0)}var r2=32,wl=Ve(function(n,e){var t=ui(e,xo(wl));return Yr(n,r2,void 0,e,t)});wl.placeholder={};var i2=64,Sf=Ve(function(n,e){var t=ui(e,xo(Sf));return Yr(n,i2,void 0,e,t)});Sf.placeholder={};var o2=dl(function(n,e,t){n[t?0:1].push(e)},function(){return[[],[]]});function a2(n,e){return Hy(n,e,function(t,r){return Jd(n,r)})}var Wi=qr(function(n,e){return n==null?{}:a2(n,e)});function s2(n){for(var e,t=this;t instanceof Ks;){var r=pv(t);r.__index__=0,r.__values__=void 0,e?i.__wrapped__=r:e=r;var i=r;t=t.__wrapped__}return i.__wrapped__=n,e}function l2(n){return function(e){return n==null?void 0:Fi(n,e)}}function u2(n,e,t,r){for(var i=t-1,o=n.length;++i<o;)if(r(n[i],e))return i;return-1}var d2=Array.prototype,Qy=d2.splice;function Of(n,e,t,r){var i=r?u2:bo,o=-1,a=e.length,s=n;for(n===e&&(e=wn(e)),t&&(s=Tt(n,In(t)));++o<a;)for(var l=0,u=e[o],d=t?t(u):u;(l=i(s,d,l,r))>-1;)s!==n&&Qy.call(s,l,1),Qy.call(n,l,1);return n}function Jy(n,e){return n&&n.length&&e&&e.length?Of(n,e):n}var f2=Ve(Jy);function c2(n,e,t){return n&&n.length&&e&&e.length?Of(n,e,Be(t)):n}function h2(n,e,t){return n&&n.length&&e&&e.length?Of(n,e,void 0,t):n}var p2=Array.prototype,v2=p2.splice;function em(n,e){for(var t=n?e.length:0,r=t-1;t--;){var i=e[t];if(t==r||i!==o){var o=i;Ur(i)?v2.call(n,i,1):_f(n,i)}}return n}var g2=qr(function(n,e){var t=n==null?0:n.length,r=Dd(n,e);return em(n,Tt(e,function(i){return Ur(i,t)?+i:i}).sort(Wy)),r}),y2=Math.floor,m2=Math.random;function Af(n,e){return n+y2(m2()*(e-n+1))}var _2=parseFloat,b2=Math.min,x2=Math.random;function E2(n,e,t){if(t&&typeof t!="boolean"&&cn(n,e,t)&&(e=t=void 0),t===void 0&&(typeof e=="boolean"?(t=e,e=void 0):typeof n=="boolean"&&(t=n,n=void 0)),n===void 0&&e===void 0?(n=0,e=1):(n=Gr(n),e===void 0?(e=n,n=0):e=Gr(e)),n>e){var r=n;n=e,e=r}if(t||n%1||e%1){var i=x2();return b2(n+i*(e-n+_2("1e-"+((i+"").length-1))),e)}return Af(n,e)}var w2=Math.ceil,S2=Math.max;function O2(n,e,t,r){for(var i=-1,o=S2(w2((e-n)/(t||1)),0),a=Array(o);o--;)a[r?o:++i]=n,n+=t;return a}function tm(n){return function(e,t,r){return r&&typeof r!="number"&&cn(e,t,r)&&(t=r=void 0),e=Gr(e),t===void 0?(t=e,e=0):t=Gr(t),r=r===void 0?e<t?1:-1:Gr(r),O2(e,t,r,n)}}var A2=tm(),C2=tm(!0),T2=256,M2=qr(function(n,e){return Yr(n,T2,void 0,void 0,void 0,e)});function nm(n,e,t,r,i){return i(n,function(o,a,s){t=r?(r=!1,o):e(t,o,a,s)}),t}function rm(n,e,t){var r=je(n)?Bd:nm,i=arguments.length<3;return r(n,Be(e),t,i,gi)}function N2(n,e,t,r){var i=n==null?0:n.length;for(r&&i&&(t=n[--i]);i--;)t=e(t,n[i],i,n);return t}function P2(n,e,t){var r=je(n)?N2:nm,i=arguments.length<3;return r(n,Be(e),t,i,py)}function D2(n,e){var t=je(n)?vi:xy;return t(n,xl(Be(e)))}function R2(n,e){var t=[];if(!(n&&n.length))return t;var r=-1,i=[],o=n.length;for(e=Be(e);++r<o;){var a=n[r];e(a,r,n)&&(t.push(a),i.push(r))}return em(n,i),t}function L2(n,e,t){return(t?cn(n,e,t):e===void 0)?e=1:e=Ge(e),xf(yt(n),e)}function I2(){var n=arguments,e=yt(n[0]);return n.length<3?e:e.replace(n[1],n[2])}var k2="Expected a function";function j2(n,e){if(typeof n!="function")throw new TypeError(k2);return e=e===void 0?e:Ge(e),Ve(n,e)}function B2(n,e,t){e=fi(e,n);var r=-1,i=e.length;for(i||(i=1,n=void 0);++r<i;){var o=n==null?void 0:n[vr(e[r])];o===void 0&&(r=i,o=t),n=hr(o)?o.call(n):o}return n}var F2=Array.prototype,$2=F2.reverse;function Cf(n){return n==null?n:$2.call(n)}var H2=$d("round");function im(n){var e=n.length;return e?n[Af(0,e-1)]:void 0}function z2(n){return im(To(n))}function W2(n){var e=je(n)?im:z2;return e(n)}function Sl(n,e){var t=-1,r=n.length,i=r-1;for(e=e===void 0?r:e;++t<e;){var o=Af(t,i),a=n[o];n[o]=n[t],n[t]=a}return n.length=e,n}function X2(n,e){return Sl(wn(n),$i(e,0,n.length))}function G2(n,e){var t=To(n);return Sl(t,$i(e,0,t.length))}function U2(n,e,t){(t?cn(n,e,t):e===void 0)?e=1:e=Ge(e);var r=je(n)?X2:G2;return r(n,e)}function om(n,e,t){return n==null?n:Na(n,e,t)}function Y2(n,e,t,r){return r=typeof r=="function"?r:void 0,n==null?n:Na(n,e,t,r)}function V2(n){return Sl(wn(n))}function K2(n){return Sl(To(n))}function q2(n){var e=je(n)?V2:K2;return e(n)}var Z2="[object Map]",Q2="[object Set]";function J2(n){if(n==null)return 0;if(Sn(n))return ml(n)?Mo(n):n.length;var e=on(n);return e==Z2||e==Q2?n.size:Md(n).length}function eD(n,e,t){var r=n==null?0:n.length;return r?(t&&typeof t!="number"&&cn(n,e,t)?(e=0,t=r):(e=e==null?0:Ge(e),t=t===void 0?r:Ge(t)),Kn(n,e,t)):[]}var tD=Ao(function(n,e,t){return n+(t?"_":"")+e.toLowerCase()});function nD(n,e){var t;return gi(n,function(r,i,o){return t=e(r,i,o),!t}),!!t}function rD(n,e,t){var r=je(n)?Vd:nD;return t&&cn(n,e,t)&&(e=void 0),r(n,Be(e))}var iD=Ve(function(n,e){if(n==null)return[];var t=e.length;return t>1&&cn(n,e[0],e[1])?e=[]:t>2&&cn(e[0],e[1],e[2])&&(e=[e[0]]),Xy(n,Vt(e,1),[])}),oD=4294967295,aD=oD-1,sD=Math.floor,lD=Math.min;function Tf(n,e,t,r){var i=0,o=n==null?0:n.length;if(o===0)return 0;e=t(e);for(var a=e!==e,s=e===null,l=Pn(e),u=e===void 0;i<o;){var d=sD((i+o)/2),f=t(n[d]),c=f!==void 0,h=f===null,p=f===f,v=Pn(f);if(a)var g=r||p;else u?g=p&&(r||c):s?g=p&&c&&(r||!h):l?g=p&&c&&!h&&(r||!v):h||v?g=!1:g=r?f<=e:f<e;g?i=d+1:o=d}return lD(o,aD)}var uD=4294967295,dD=uD>>>1;function Ol(n,e,t){var r=0,i=n==null?r:n.length;if(typeof e=="number"&&e===e&&i<=dD){for(;r<i;){var o=r+i>>>1,a=n[o];a!==null&&!Pn(a)&&(t?a<=e:a<e)?r=o+1:i=o}return i}return Tf(n,e,En,t)}function fD(n,e){return Ol(n,e)}function cD(n,e,t){return Tf(n,e,Be(t))}function hD(n,e){var t=n==null?0:n.length;if(t){var r=Ol(n,e);if(r<t&&pr(n[r],e))return r}return-1}function pD(n,e){return Ol(n,e,!0)}function vD(n,e,t){return Tf(n,e,Be(t),!0)}function gD(n,e){var t=n==null?0:n.length;if(t){var r=Ol(n,e,!0)-1;if(pr(n[r],e))return r}return-1}function am(n,e){for(var t=-1,r=n.length,i=0,o=[];++t<r;){var a=n[t],s=e?e(a):a;if(!t||!pr(s,l)){var l=s;o[i++]=a===0?0:a}}return o}function yD(n){return n&&n.length?am(n):[]}function mD(n,e){return n&&n.length?am(n,Be(e)):[]}var _D=4294967295;function bD(n,e,t){return t&&typeof t!="number"&&cn(n,e,t)&&(e=t=void 0),t=t===void 0?_D:t>>>0,t?(n=yt(n),n&&(typeof e=="string"||e!=null&&!vf(e))&&(e=Dn(e),!e&&So(n))?pi(gr(n),0,t):n.split(e,t)):[]}var xD="Expected a function",ED=Math.max;function wD(n,e){if(typeof n!="function")throw new TypeError(xD);return e=e==null?0:ED(Ge(e),0),Ve(function(t){var r=t[e],i=pi(t,0,e);return r&&hi(i,r),Rn(n,this,i)})}var SD=Ao(function(n,e,t){return n+(t?" ":"")+jd(e)});function OD(n,e,t){return n=yt(n),t=t==null?0:$i(Ge(t),0,n.length),e=Dn(e),n.slice(t,t+e.length)==e}function AD(){return{}}function CD(){return""}function TD(){return!0}var MD=Us(function(n,e){return n-e},0);function ND(n){return n&&n.length?yf(n,En):0}function PD(n,e){return n&&n.length?yf(n,Be(e)):0}function DD(n){var e=n==null?0:n.length;return e?Kn(n,1,e):[]}function RD(n,e,t){return n&&n.length?(e=t||e===void 0?1:Ge(e),Kn(n,0,e<0?0:e)):[]}function LD(n,e,t){var r=n==null?0:n.length;return r?(e=t||e===void 0?1:Ge(e),e=r-e,Kn(n,e<0?0:e,r)):[]}function ID(n,e){return n&&n.length?pl(n,Be(e),!1,!0):[]}function kD(n,e){return n&&n.length?pl(n,Be(e)):[]}function jD(n,e){return e(n),n}var sm=Object.prototype,BD=sm.hasOwnProperty;function lm(n,e,t,r){return n===void 0||pr(n,sm[t])&&!BD.call(r,t)?e:n}var FD={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function $D(n){return"\\"+FD[n]}var um=/<%=([\s\S]+?)%>/g,HD=/<%-([\s\S]+?)%>/g,zD=/<%([\s\S]+?)%>/g,Mf={escape:HD,evaluate:zD,interpolate:um,variable:"",imports:{_:{escape:yy}}},WD="Invalid `variable` option passed into `_.template`",XD="Invalid `imports` option passed into `_.template`",GD=/\b__p \+= '';/g,UD=/\b(__p \+=) '' \+/g,YD=/(__e\(.*?\)|\b__t\)) \+\n'';/g,dm=/[()=,{}\[\]\/\s]/,VD=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Al=/($^)/,KD=/['\n\r\u2028\u2029\\]/g,qD=Object.prototype,fm=qD.hasOwnProperty;function ZD(n,e,t){var r=Mf.imports._.templateSettings||Mf;t&&cn(n,e,t)&&(e=void 0),n=yt(n),e=Nd({},e,r,lm);var i=Nd({},e.imports,r.imports,lm),o=Wt(i),a=ff(i,o);Ln(o,function(g){if(dm.test(g))throw new Error(XD)});var s,l,u=0,d=e.interpolate||Al,f="__p += '",c=RegExp((e.escape||Al).source+"|"+d.source+"|"+(d===um?VD:Al).source+"|"+(e.evaluate||Al).source+"|$","g"),h=fm.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+`
|
|
53
|
+
`:"";n.replace(c,function(g,y,m,O,T,C){return m||(m=O),f+=n.slice(u,C).replace(KD,$D),y&&(s=!0,f+=`' +
|
|
54
|
+
__e(`+y+`) +
|
|
55
|
+
'`),T&&(l=!0,f+=`';
|
|
56
|
+
`+T+`;
|
|
57
|
+
__p += '`),m&&(f+=`' +
|
|
58
|
+
((__t = (`+m+`)) == null ? '' : __t) +
|
|
59
|
+
'`),u=C+g.length,g}),f+=`';
|
|
60
|
+
`;var p=fm.call(e,"variable")&&e.variable;if(!p)f=`with (obj) {
|
|
61
|
+
`+f+`
|
|
62
|
+
}
|
|
63
|
+
`;else if(dm.test(p))throw new Error(WD);f=(l?f.replace(GD,""):f).replace(UD,"$1").replace(YD,"$1;"),f="function("+(p||"obj")+`) {
|
|
64
|
+
`+(p?"":`obj || (obj = {});
|
|
65
|
+
`)+"var __t, __p = ''"+(s?", __e = _.escape":"")+(l?`, __j = Array.prototype.join;
|
|
66
|
+
function print() { __p += __j.call(arguments, '') }
|
|
67
|
+
`:`;
|
|
68
|
+
`)+f+`return __p
|
|
69
|
+
}`;var v=Yv(function(){return Function(o,h+"return "+f).apply(void 0,a)});if(v.source=f,Rd(v))throw v;return v}var QD="Expected a function";function cm(n,e,t){var r=!0,i=!0;if(typeof n!="function")throw new TypeError(QD);return Mt(t)&&(r="leading"in t?!!t.leading:r,i="trailing"in t?!!t.trailing:i),cl(n,e,{leading:r,maxWait:e,trailing:i})}function Cl(n,e){return e(n)}var JD=9007199254740991,Nf=4294967295,eR=Math.min;function tR(n,e){if(n=Ge(n),n<1||n>JD)return[];var t=Nf,r=eR(n,Nf);e=Dr(e),n-=Nf;for(var i=Ad(r,e);++t<n;)e(t);return i}function nR(){return this}function hm(n,e){var t=n;return t instanceof tt&&(t=t.value()),Bd(e,function(r,i){return i.func.apply(i.thisArg,hi([r],i.args))},t)}function rR(){return hm(this.__wrapped__,this.__actions__)}function iR(n){return yt(n).toLowerCase()}function oR(n){return je(n)?Tt(n,vr):Pn(n)?[n]:wn(Wv(yt(n)))}var pm=9007199254740991;function aR(n){return n?$i(Ge(n),-pm,pm):n===0?n:0}function sR(n){return yt(n).toUpperCase()}function lR(n,e,t){var r=je(n),i=r||di(n)||wo(n);if(e=Be(e),t==null){var o=n&&n.constructor;i?t=r?new o:[]:Mt(n)?t=hr(o)?yo(ol(n)):{}:t={}}return(i?Ln:Pr)(n,function(a,s,l){return e(t,a,s,l)}),t}function vm(n,e){for(var t=n.length;t--&&bo(e,n[t],0)>-1;);return t}function gm(n,e){for(var t=-1,r=n.length;++t<r&&bo(e,n[t],0)>-1;);return t}function uR(n,e,t){if(n=yt(n),n&&(t||e===void 0))return ov(n);if(!n||!(e=Dn(e)))return n;var r=gr(n),i=gr(e),o=gm(r,i),a=vm(r,i)+1;return pi(r,o,a).join("")}function dR(n,e,t){if(n=yt(n),n&&(t||e===void 0))return n.slice(0,iv(n)+1);if(!n||!(e=Dn(e)))return n;var r=gr(n),i=vm(r,gr(e))+1;return pi(r,0,i).join("")}var fR=/^\s+/;function cR(n,e,t){if(n=yt(n),n&&(t||e===void 0))return n.replace(fR,"");if(!n||!(e=Dn(e)))return n;var r=gr(n),i=gm(r,gr(e));return pi(r,i).join("")}var hR=30,pR="...",vR=/\w*$/;function gR(n,e){var t=hR,r=pR;if(Mt(e)){var i="separator"in e?e.separator:i;t="length"in e?Ge(e.length):t,r="omission"in e?Dn(e.omission):r}n=yt(n);var o=n.length;if(So(n)){var a=gr(n);o=a.length}if(t>=o)return n;var s=t-Mo(r);if(s<1)return r;var l=a?pi(a,0,s).join(""):n.slice(0,s);if(i===void 0)return l+r;if(a&&(s+=l.length-s),vf(i)){if(n.slice(s).search(i)){var u,d=l;for(i.global||(i=RegExp(i.source,yt(vR.exec(i))+"g")),i.lastIndex=0;u=i.exec(d);)var f=u.index;l=l.slice(0,f===void 0?s:f)}}else if(n.indexOf(Dn(i),s)!=s){var c=l.lastIndexOf(i);c>-1&&(l=l.slice(0,c))}return l+r}function yR(n){return Pv(n,1)}var mR={"&":"&","<":"<",">":">",""":'"',"'":"'"},_R=Fd(mR),ym=/&(?:amp|lt|gt|quot|#39);/g,bR=RegExp(ym.source);function xR(n){return n=yt(n),n&&bR.test(n)?n.replace(ym,_R):n}var ER=1/0,wR=Co&&1/ll(new Co([,-0]))[1]==ER?function(n){return new Co(n)}:mo,SR=200;function mi(n,e,t){var r=-1,i=Js,o=n.length,a=!0,s=[],l=s;if(t)a=!1,i=sf;else if(o>=SR){var u=e?null:wR(n);if(u)return ll(u);a=!1,i=Oa,l=new Hi}else l=e?[]:s;e:for(;++r<o;){var d=n[r],f=e?e(d):d;if(d=t||d!==0?d:0,a&&f===f){for(var c=l.length;c--;)if(l[c]===f)continue e;e&&l.push(f),s.push(d)}else i(l,f,t)||(l!==s&&l.push(f),s.push(d))}return s}var OR=Ve(function(n){return mi(Vt(n,1,jt,!0))}),AR=Ve(function(n){var e=kn(n);return jt(e)&&(e=void 0),mi(Vt(n,1,jt,!0),Be(e))}),CR=Ve(function(n){var e=kn(n);return e=typeof e=="function"?e:void 0,mi(Vt(n,1,jt,!0),void 0,e)});function TR(n){return n&&n.length?mi(n):[]}function MR(n,e){return n&&n.length?mi(n,Be(e)):[]}function NR(n,e){return e=typeof e=="function"?e:void 0,n&&n.length?mi(n,void 0,e):[]}var PR=0;function DR(n){var e=++PR;return yt(n)+e}function RR(n,e){return n==null?!0:_f(n,e)}var LR=Math.max;function Pf(n){if(!(n&&n.length))return[];var e=0;return n=vi(n,function(t){if(jt(t))return e=LR(t.length,e),!0}),Ad(e,function(t){return Tt(n,ef(t))})}function mm(n,e){if(!(n&&n.length))return[];var t=Pf(n);return e==null?t:Tt(t,function(r){return Rn(e,void 0,r)})}function _m(n,e,t,r){return Na(n,e,t(Fi(n,e)),r)}function IR(n,e,t){return n==null?n:_m(n,e,Dr(t))}function kR(n,e,t,r){return r=typeof r=="function"?r:void 0,n==null?n:_m(n,e,Dr(t),r)}var jR=Ao(function(n,e,t){return n+(t?" ":"")+e.toUpperCase()});function BR(n){return n==null?[]:ff(n,On(n))}var FR=Ve(function(n,e){return jt(n)?Ca(n,e):[]});function $R(n,e){return wl(Dr(e),n)}var HR=qr(function(n){var e=n.length,t=e?n[0]:0,r=this.__wrapped__,i=function(o){return Dd(o,n)};return e>1||this.__actions__.length||!(r instanceof tt)||!Ur(t)?this.thru(i):(r=r.slice(t,+t+(e?1:0)),r.__actions__.push({func:Cl,args:[i],thisArg:void 0}),new Yn(r,this.__chain__).thru(function(o){return e&&!o.length&&o.push(void 0),o}))});function zR(){return Eg(this)}function WR(){var n=this.__wrapped__;if(n instanceof tt){var e=n;return this.__actions__.length&&(e=new tt(this)),e=e.reverse(),e.__actions__.push({func:Cl,args:[Cf],thisArg:void 0}),new Yn(e,this.__chain__)}return this.thru(Cf)}function Df(n,e,t){var r=n.length;if(r<2)return r?mi(n[0]):[];for(var i=-1,o=Array(r);++i<r;)for(var a=n[i],s=-1;++s<r;)s!=i&&(o[i]=Ca(o[i]||a,n[s],e,t));return mi(Vt(o,1),e,t)}var XR=Ve(function(n){return Df(vi(n,jt))}),GR=Ve(function(n){var e=kn(n);return jt(e)&&(e=void 0),Df(vi(n,jt),Be(e))}),UR=Ve(function(n){var e=kn(n);return e=typeof e=="function"?e:void 0,Df(vi(n,jt),void 0,e)}),YR=Ve(Pf);function bm(n,e,t){for(var r=-1,i=n.length,o=e.length,a={};++r<i;){var s=r<o?e[r]:void 0;t(a,n[r],s)}return a}function VR(n,e){return bm(n||[],e||[],_a)}function KR(n,e){return bm(n||[],e||[],Na)}var qR=Ve(function(n){var e=n.length,t=e>1?n[e-1]:void 0;return t=typeof t=="function"?(n.pop(),t):void 0,mm(n,t)});const ye={chunk:IO,compact:vC,concat:gC,difference:xT,differenceBy:ET,differenceWith:wT,drop:OT,dropRight:AT,dropRightWhile:CT,dropWhile:TT,fill:UT,findIndex:uf,findLastIndex:Sy,flatten:Gv,flattenDeep:aM,flattenDepth:sM,fromPairs:EM,head:eM,indexOf:Cy,initial:HM,intersection:WM,intersectionBy:XM,intersectionWith:GM,join:IN,lastIndexOf:HN,nth:hP,pull:f2,pullAll:Jy,pullAllBy:c2,pullAllWith:h2,pullAt:g2,remove:R2,reverse:Cf,slice:eD,sortedIndex:fD,sortedIndexBy:cD,sortedIndexOf:hD,sortedLastIndex:pD,sortedLastIndexBy:vD,sortedLastIndexOf:gD,sortedUniq:yD,sortedUniqBy:mD,tail:DD,take:RD,takeRight:LD,takeRightWhile:ID,takeWhile:kD,union:OR,unionBy:AR,unionWith:CR,uniq:TR,uniqBy:MR,uniqWith:NR,unzip:Pf,unzipWith:mm,without:FR,xor:XR,xorBy:GR,xorWith:UR,zip:YR,zipObject:VR,zipObjectDeep:KR,zipWith:qR},Et={countBy:oT,every:WT,filter:YT,find:yi,findLast:QT,flatMap:tM,flatMapDeep:rM,flatMapDepth:iM,forEach:nt,forEachRight:NT,groupBy:CM,includes:FM,invokeMap:eN,keyBy:jN,map:jn,orderBy:AP,partition:o2,reduce:rm,reduceRight:P2,reject:D2,sample:W2,sampleSize:U2,shuffle:q2,size:J2,some:rD,sortBy:iD},ZR={now:fl},Lt={after:_E,ary:Pv,before:Vv,bind:al,bindKey:Ld,curry:nf,curryRight:rf,debounce:cl,defer:mT,delay:_T,flip:uM,memoize:il,once:wP,overArgs:NP,partial:wl,partialRight:Sf,rearg:M2,rest:j2,spread:wD,throttle:cm,unary:yR,wrap:$R},Me={castArray:MO,clone:aC,cloneDeep:Ee,cloneDeepWith:fC,cloneWith:hC,conformsTo:eT,eq:pr,gt:TM,gte:MM,isArguments:ji,isArrayBuffer:rN,isArrayLike:Sn,isArrayLikeObject:jt,isBoolean:_l,isBuffer:di,isDate:sN,isElement:lN,isEmpty:Ma,isEqual:pf,isEqualWith:hN,isError:Rd,isFinite:vN,isFunction:hr,isInteger:Ry,isLength:tl,isMap:zg,isMatch:gN,isMatchWith:yN,isNaN:_N,isNative:EN,isNil:Kt,isNull:wN,isNumber:Ly,isObjectLike:Rt,isPlainObject:Sa,isRegExp:vf,isSafeInteger:AN,isSet:Xg,isString:ml,isSymbol:Pn,isTypedArray:wo,isUndefined:zi,isWeakMap:TN,isWeakSet:NN,lt:XN,lte:GN,toArray:Fy,toFinite:Gr,toLength:by,toNumber:Un,toPlainObject:uy,toSafeInteger:aR,toString:yt},hn={add:dE,ceil:DO,divide:ST,floor:dM,max:ZN,maxBy:QN,mean:eP,meanBy:tP,min:iP,minBy:oP,multiply:sP,round:H2,subtract:MD,sum:ND,sumBy:PD},Rf={clamp:kO,inRange:kM,random:E2},ke={assign:Je,assignIn:C1,assignInWith:T1,assignWith:Nd,at:sS,create:aT,defaults:pT,defaultsDeep:gT,findKey:KT,findLastKey:JT,forIn:mM,forInRight:_M,forOwn:bM,forOwnRight:xM,functions:wM,functionsIn:SM,get:ci,has:yl,hasIn:Jd,invert:KM,invertBy:QM,invoke:JM,keysIn:On,mapKeys:jy,mapValues:UN,merge:Qr,mergeWith:fy,omit:xP,omitBy:EP,pick:Wi,pickBy:zy,result:B2,set:om,setWith:Y2,toPairs:Zr,toPairsIn:kT,transform:lR,unset:RR,update:IR,updateWith:kR,values:To,valuesIn:BR},Rr={at:HR,chain:Eg,commit:pC,next:cP,plant:s2,reverse:WR,tap:jD,toIterator:nR,value:rR,wrapperChain:zR},ht={camelCase:TO,capitalize:ng,deburr:rg,endsWith:PT,escape:yy,escapeRegExp:HT,kebabCase:kN,lowerCase:zN,lowerFirst:WN,pad:ZP,padEnd:QP,padStart:JP,parseInt:n2,repeat:L2,replace:I2,snakeCase:tD,split:bD,startCase:SD,startsWith:OD,template:ZD,templateSettings:Mf,toLower:iR,toUpper:sR,trim:uR,trimEnd:dR,trimStart:cR,truncate:gR,unescape:xR,upperCase:jR,upperFirst:jd,words:xg},mt={attempt:Yv,bindAll:mS,cond:qC,conforms:JC,constant:wd,defaultTo:cT,flow:gM,flowRight:yM,iteratee:DN,matches:VN,matchesProperty:qN,method:nP,methodOf:rP,noop:mo,nthArg:pP,over:CP,overEvery:PP,overSome:DP,property:iy,propertyOf:l2,range:A2,rangeRight:C2,stubArray:Hd,stubFalse:Cd,stubObject:AD,stubString:CD,stubTrue:TD,times:tR,toPath:oR,uniqueId:DR};function QR(){var n=new tt(this.__wrapped__);return n.__actions__=wn(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=wn(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=wn(this.__views__),n}function JR(){if(this.__filtered__){var n=new tt(this);n.__dir__=-1,n.__filtered__=!0}else n=this.clone(),n.__dir__*=-1;return n}var eL=Math.max,tL=Math.min;function nL(n,e,t){for(var r=-1,i=t.length;++r<i;){var o=t[r],a=o.size;switch(o.type){case"drop":n+=a;break;case"dropRight":e-=a;break;case"take":e=tL(e,n+a);break;case"takeRight":n=eL(n,e-a);break}}return{start:n,end:e}}var rL=1,iL=2,oL=Math.min;function aL(){var n=this.__wrapped__.value(),e=this.__dir__,t=je(n),r=e<0,i=t?n.length:0,o=nL(0,i,this.__views__),a=o.start,s=o.end,l=s-a,u=r?s:a-1,d=this.__iteratees__,f=d.length,c=0,h=oL(l,this.__takeCount__);if(!t||!r&&i==l&&h==l)return hm(n,this.__actions__);var p=[];e:for(;l--&&c<h;){u+=e;for(var v=-1,g=n[u];++v<f;){var y=d[v],m=y.iteratee,O=y.type,T=m(g);if(O==iL)g=T;else if(!T){if(O==rL)continue e;break e}}p[c++]=g}return p}/**
|
|
70
|
+
* @license
|
|
71
|
+
* Lodash (Custom Build) <https://lodash.com/>
|
|
72
|
+
* Build: `lodash modularize exports="es" --repo lodash/lodash#4.18.1 -o ./`
|
|
73
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
74
|
+
* Released under MIT license <https://lodash.com/license>
|
|
75
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
76
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
77
|
+
*/var sL="4.18.1",lL=2,uL=1,dL=3,xm=4294967295,fL=Array.prototype,cL=Object.prototype,Em=cL.hasOwnProperty,wm=rn?rn.iterator:void 0,hL=Math.max,Sm=Math.min,Lf=(function(n){return function(e,t,r){if(r==null){var i=Mt(t),o=i&&Wt(t),a=o&&o.length&&vl(t,o);(a?a.length:i)||(r=t,t=e,e=this)}return n(e,t,r)}})(aP);_.after=Lt.after,_.ary=Lt.ary,_.assign=ke.assign,_.assignIn=ke.assignIn,_.assignInWith=ke.assignInWith,_.assignWith=ke.assignWith,_.at=ke.at,_.before=Lt.before,_.bind=Lt.bind,_.bindAll=mt.bindAll,_.bindKey=Lt.bindKey,_.castArray=Me.castArray,_.chain=Rr.chain,_.chunk=ye.chunk,_.compact=ye.compact,_.concat=ye.concat,_.cond=mt.cond,_.conforms=mt.conforms,_.constant=mt.constant,_.countBy=Et.countBy,_.create=ke.create,_.curry=Lt.curry,_.curryRight=Lt.curryRight,_.debounce=Lt.debounce,_.defaults=ke.defaults,_.defaultsDeep=ke.defaultsDeep,_.defer=Lt.defer,_.delay=Lt.delay,_.difference=ye.difference,_.differenceBy=ye.differenceBy,_.differenceWith=ye.differenceWith,_.drop=ye.drop,_.dropRight=ye.dropRight,_.dropRightWhile=ye.dropRightWhile,_.dropWhile=ye.dropWhile,_.fill=ye.fill,_.filter=Et.filter,_.flatMap=Et.flatMap,_.flatMapDeep=Et.flatMapDeep,_.flatMapDepth=Et.flatMapDepth,_.flatten=ye.flatten,_.flattenDeep=ye.flattenDeep,_.flattenDepth=ye.flattenDepth,_.flip=Lt.flip,_.flow=mt.flow,_.flowRight=mt.flowRight,_.fromPairs=ye.fromPairs,_.functions=ke.functions,_.functionsIn=ke.functionsIn,_.groupBy=Et.groupBy,_.initial=ye.initial,_.intersection=ye.intersection,_.intersectionBy=ye.intersectionBy,_.intersectionWith=ye.intersectionWith,_.invert=ke.invert,_.invertBy=ke.invertBy,_.invokeMap=Et.invokeMap,_.iteratee=mt.iteratee,_.keyBy=Et.keyBy,_.keys=Wt,_.keysIn=ke.keysIn,_.map=Et.map,_.mapKeys=ke.mapKeys,_.mapValues=ke.mapValues,_.matches=mt.matches,_.matchesProperty=mt.matchesProperty,_.memoize=Lt.memoize,_.merge=ke.merge,_.mergeWith=ke.mergeWith,_.method=mt.method,_.methodOf=mt.methodOf,_.mixin=Lf,_.negate=xl,_.nthArg=mt.nthArg,_.omit=ke.omit,_.omitBy=ke.omitBy,_.once=Lt.once,_.orderBy=Et.orderBy,_.over=mt.over,_.overArgs=Lt.overArgs,_.overEvery=mt.overEvery,_.overSome=mt.overSome,_.partial=Lt.partial,_.partialRight=Lt.partialRight,_.partition=Et.partition,_.pick=ke.pick,_.pickBy=ke.pickBy,_.property=mt.property,_.propertyOf=mt.propertyOf,_.pull=ye.pull,_.pullAll=ye.pullAll,_.pullAllBy=ye.pullAllBy,_.pullAllWith=ye.pullAllWith,_.pullAt=ye.pullAt,_.range=mt.range,_.rangeRight=mt.rangeRight,_.rearg=Lt.rearg,_.reject=Et.reject,_.remove=ye.remove,_.rest=Lt.rest,_.reverse=ye.reverse,_.sampleSize=Et.sampleSize,_.set=ke.set,_.setWith=ke.setWith,_.shuffle=Et.shuffle,_.slice=ye.slice,_.sortBy=Et.sortBy,_.sortedUniq=ye.sortedUniq,_.sortedUniqBy=ye.sortedUniqBy,_.split=ht.split,_.spread=Lt.spread,_.tail=ye.tail,_.take=ye.take,_.takeRight=ye.takeRight,_.takeRightWhile=ye.takeRightWhile,_.takeWhile=ye.takeWhile,_.tap=Rr.tap,_.throttle=Lt.throttle,_.thru=Cl,_.toArray=Me.toArray,_.toPairs=ke.toPairs,_.toPairsIn=ke.toPairsIn,_.toPath=mt.toPath,_.toPlainObject=Me.toPlainObject,_.transform=ke.transform,_.unary=Lt.unary,_.union=ye.union,_.unionBy=ye.unionBy,_.unionWith=ye.unionWith,_.uniq=ye.uniq,_.uniqBy=ye.uniqBy,_.uniqWith=ye.uniqWith,_.unset=ke.unset,_.unzip=ye.unzip,_.unzipWith=ye.unzipWith,_.update=ke.update,_.updateWith=ke.updateWith,_.values=ke.values,_.valuesIn=ke.valuesIn,_.without=ye.without,_.words=ht.words,_.wrap=Lt.wrap,_.xor=ye.xor,_.xorBy=ye.xorBy,_.xorWith=ye.xorWith,_.zip=ye.zip,_.zipObject=ye.zipObject,_.zipObjectDeep=ye.zipObjectDeep,_.zipWith=ye.zipWith,_.entries=ke.toPairs,_.entriesIn=ke.toPairsIn,_.extend=ke.assignIn,_.extendWith=ke.assignInWith,Lf(_,_),_.add=hn.add,_.attempt=mt.attempt,_.camelCase=ht.camelCase,_.capitalize=ht.capitalize,_.ceil=hn.ceil,_.clamp=Rf.clamp,_.clone=Me.clone,_.cloneDeep=Me.cloneDeep,_.cloneDeepWith=Me.cloneDeepWith,_.cloneWith=Me.cloneWith,_.conformsTo=Me.conformsTo,_.deburr=ht.deburr,_.defaultTo=mt.defaultTo,_.divide=hn.divide,_.endsWith=ht.endsWith,_.eq=Me.eq,_.escape=ht.escape,_.escapeRegExp=ht.escapeRegExp,_.every=Et.every,_.find=Et.find,_.findIndex=ye.findIndex,_.findKey=ke.findKey,_.findLast=Et.findLast,_.findLastIndex=ye.findLastIndex,_.findLastKey=ke.findLastKey,_.floor=hn.floor,_.forEach=Et.forEach,_.forEachRight=Et.forEachRight,_.forIn=ke.forIn,_.forInRight=ke.forInRight,_.forOwn=ke.forOwn,_.forOwnRight=ke.forOwnRight,_.get=ke.get,_.gt=Me.gt,_.gte=Me.gte,_.has=ke.has,_.hasIn=ke.hasIn,_.head=ye.head,_.identity=En,_.includes=Et.includes,_.indexOf=ye.indexOf,_.inRange=Rf.inRange,_.invoke=ke.invoke,_.isArguments=Me.isArguments,_.isArray=je,_.isArrayBuffer=Me.isArrayBuffer,_.isArrayLike=Me.isArrayLike,_.isArrayLikeObject=Me.isArrayLikeObject,_.isBoolean=Me.isBoolean,_.isBuffer=Me.isBuffer,_.isDate=Me.isDate,_.isElement=Me.isElement,_.isEmpty=Me.isEmpty,_.isEqual=Me.isEqual,_.isEqualWith=Me.isEqualWith,_.isError=Me.isError,_.isFinite=Me.isFinite,_.isFunction=Me.isFunction,_.isInteger=Me.isInteger,_.isLength=Me.isLength,_.isMap=Me.isMap,_.isMatch=Me.isMatch,_.isMatchWith=Me.isMatchWith,_.isNaN=Me.isNaN,_.isNative=Me.isNative,_.isNil=Me.isNil,_.isNull=Me.isNull,_.isNumber=Me.isNumber,_.isObject=Mt,_.isObjectLike=Me.isObjectLike,_.isPlainObject=Me.isPlainObject,_.isRegExp=Me.isRegExp,_.isSafeInteger=Me.isSafeInteger,_.isSet=Me.isSet,_.isString=Me.isString,_.isSymbol=Me.isSymbol,_.isTypedArray=Me.isTypedArray,_.isUndefined=Me.isUndefined,_.isWeakMap=Me.isWeakMap,_.isWeakSet=Me.isWeakSet,_.join=ye.join,_.kebabCase=ht.kebabCase,_.last=kn,_.lastIndexOf=ye.lastIndexOf,_.lowerCase=ht.lowerCase,_.lowerFirst=ht.lowerFirst,_.lt=Me.lt,_.lte=Me.lte,_.max=hn.max,_.maxBy=hn.maxBy,_.mean=hn.mean,_.meanBy=hn.meanBy,_.min=hn.min,_.minBy=hn.minBy,_.stubArray=mt.stubArray,_.stubFalse=mt.stubFalse,_.stubObject=mt.stubObject,_.stubString=mt.stubString,_.stubTrue=mt.stubTrue,_.multiply=hn.multiply,_.nth=ye.nth,_.noop=mt.noop,_.now=ZR.now,_.pad=ht.pad,_.padEnd=ht.padEnd,_.padStart=ht.padStart,_.parseInt=ht.parseInt,_.random=Rf.random,_.reduce=Et.reduce,_.reduceRight=Et.reduceRight,_.repeat=ht.repeat,_.replace=ht.replace,_.result=ke.result,_.round=hn.round,_.sample=Et.sample,_.size=Et.size,_.snakeCase=ht.snakeCase,_.some=Et.some,_.sortedIndex=ye.sortedIndex,_.sortedIndexBy=ye.sortedIndexBy,_.sortedIndexOf=ye.sortedIndexOf,_.sortedLastIndex=ye.sortedLastIndex,_.sortedLastIndexBy=ye.sortedLastIndexBy,_.sortedLastIndexOf=ye.sortedLastIndexOf,_.startCase=ht.startCase,_.startsWith=ht.startsWith,_.subtract=hn.subtract,_.sum=hn.sum,_.sumBy=hn.sumBy,_.template=ht.template,_.times=mt.times,_.toFinite=Me.toFinite,_.toInteger=Ge,_.toLength=Me.toLength,_.toLower=ht.toLower,_.toNumber=Me.toNumber,_.toSafeInteger=Me.toSafeInteger,_.toString=Me.toString,_.toUpper=ht.toUpper,_.trim=ht.trim,_.trimEnd=ht.trimEnd,_.trimStart=ht.trimStart,_.truncate=ht.truncate,_.unescape=ht.unescape,_.uniqueId=mt.uniqueId,_.upperCase=ht.upperCase,_.upperFirst=ht.upperFirst,_.each=Et.forEach,_.eachRight=Et.forEachRight,_.first=ye.head,Lf(_,(function(){var n={};return Pr(_,function(e,t){Em.call(_.prototype,t)||(n[t]=e)}),n})(),{chain:!1}),_.VERSION=sL,(_.templateSettings=ht.templateSettings).imports._=_,Ln(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){_[n].placeholder=_}),Ln(["drop","take"],function(n,e){tt.prototype[n]=function(t){t=t===void 0?1:hL(Ge(t),0);var r=this.__filtered__&&!e?new tt(this):this.clone();return r.__filtered__?r.__takeCount__=Sm(t,r.__takeCount__):r.__views__.push({size:Sm(t,xm),type:n+(r.__dir__<0?"Right":"")}),r},tt.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),Ln(["filter","map","takeWhile"],function(n,e){var t=e+1,r=t==uL||t==dL;tt.prototype[n]=function(i){var o=this.clone();return o.__iteratees__.push({iteratee:Be(i),type:t}),o.__filtered__=o.__filtered__||r,o}}),Ln(["head","last"],function(n,e){var t="take"+(e?"Right":"");tt.prototype[n]=function(){return this[t](1).value()[0]}}),Ln(["initial","tail"],function(n,e){var t="drop"+(e?"":"Right");tt.prototype[n]=function(){return this.__filtered__?new tt(this):this[t](1)}}),tt.prototype.compact=function(){return this.filter(En)},tt.prototype.find=function(n){return this.filter(n).head()},tt.prototype.findLast=function(n){return this.reverse().find(n)},tt.prototype.invokeMap=Ve(function(n,e){return typeof n=="function"?new tt(this):this.map(function(t){return Ta(t,n,e)})}),tt.prototype.reject=function(n){return this.filter(xl(Be(n)))},tt.prototype.slice=function(n,e){n=Ge(n);var t=this;return t.__filtered__&&(n>0||e<0)?new tt(t):(n<0?t=t.takeRight(-n):n&&(t=t.drop(n)),e!==void 0&&(e=Ge(e),t=e<0?t.dropRight(-e):t.take(e-n)),t)},tt.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},tt.prototype.toArray=function(){return this.take(xm)},Pr(tt.prototype,function(n,e){var t=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=_[r?"take"+(e=="last"?"Right":""):e],o=r||/^find/.test(e);i&&(_.prototype[e]=function(){var a=this.__wrapped__,s=r?[1]:arguments,l=a instanceof tt,u=s[0],d=l||je(a),f=function(y){var m=i.apply(_,hi([y],s));return r&&c?m[0]:m};d&&t&&typeof u=="function"&&u.length!=1&&(l=d=!1);var c=this.__chain__,h=!!this.__actions__.length,p=o&&!c,v=l&&!h;if(!o&&d){a=v?a:new tt(this);var g=n.apply(a,s);return g.__actions__.push({func:Cl,args:[f],thisArg:void 0}),new Yn(g,c)}return p&&v?n.apply(this,s):(g=this.thru(f),p?r?g.value()[0]:g.value():g)})}),Ln(["pop","push","shift","sort","splice","unshift"],function(n){var e=fL[n],t=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",r=/^(?:pop|shift)$/.test(n);_.prototype[n]=function(){var i=arguments;if(r&&!this.__chain__){var o=this.value();return e.apply(je(o)?o:[],i)}return this[t](function(a){return e.apply(je(a)?a:[],i)})}}),Pr(tt.prototype,function(n,e){var t=_[e];if(t){var r=t.name+"";Em.call(_o,r)||(_o[r]=[]),_o[r].push({name:e,func:t})}}),_o[el(void 0,lL).name]=[{name:"wrapper",func:void 0}],tt.prototype.clone=QR,tt.prototype.reverse=JR,tt.prototype.value=aL,_.prototype.at=Rr.at,_.prototype.chain=Rr.wrapperChain,_.prototype.commit=Rr.commit,_.prototype.next=Rr.next,_.prototype.plant=Rr.plant,_.prototype.reverse=Rr.reverse,_.prototype.toJSON=_.prototype.valueOf=_.prototype.value=Rr.value,_.prototype.first=_.prototype.head,wm&&(_.prototype[wm]=Rr.toIterator);var pL=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},Pa;(function(n){function e(t){var r=pL(t,[]),i=t.container;if(!i)throw new Error("Ensure the container of LogicFlow is specified and valid.");return Je({},n.defaults,r)}n.get=e})(Pa||(Pa={})),(function(n){n.defaults={background:!1,grid:!1,textEdit:!0,snapline:!0,outline:!1,disabledTools:[]}})(Pa||(Pa={}));var Om={node:!1,edge:!1},vL={node:!0,edge:!0},gL=function(n){return!n||typeof n=="boolean"?Ee(n===!0?vL:Om):Qr(Ee(Om),n)},yL=function(){return ci(window,"navigator.userAgent","").match(/MSIE|Trident/)!==null};function an(n){try{return JSON.parse(JSON.stringify(n))}catch{return n}}var Tl=10,mL={baseNode:{fill:"#fff",stroke:"#474747",strokeWidth:2,radius:12},baseEdge:{stroke:"#474747",strokeWidth:2,radius:12},rect:{shadow:{dx:0,dy:0,stdDeviation:4,floodColor:"#9CA1AA55"}},circle:{},diamond:{},ellipse:{},polygon:{},html:{fill:"transparent",stroke:"transparent",shadow:{dx:0,dy:0,stdDeviation:4,floodColor:"#9CA1AA55"}},text:{color:"#474747",stroke:"none",fontSize:12,background:{fill:"transparent"}},nodeText:{color:"#474747",overflowMode:"default",fontSize:12,lineHeight:1.2},anchor:{stroke:"#474747",fill:"#fff",r:4,hover:{r:8,fill:"#707070",fillOpacity:.15,stroke:"transparent"}},anchorLine:{stroke:"#474747",strokeWidth:2,strokeDasharray:"3,2"},line:{},polyline:{},bezier:{fill:"none",adjustLine:{stroke:"#949494"},adjustAnchor:{r:4,fill:"#949494",fillOpacity:1,stroke:"#949494"}},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"#fff"}},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#AAAAAA",strokeWidth:1,strokeDasharray:"3,3"},edgeAdjust:{r:4,fill:"#fff",stroke:"#474747",strokeWidth:1},outline:{fill:"none",stroke:"transparent",strokeWidth:0},edgeOutline:{fill:"transparent",stroke:"#757575",strokeWidth:1.5,strokeDasharray:"4,4",radius:8,hover:{stroke:"#4271DF"}},edgeAnimation:{stroke:"#4271DF",strokeDasharray:"12,4,6,4",strokeDashoffset:"100%",animationName:"lf_animate_dash",animationDuration:"20s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"normal"},rotateControl:{stroke:"#474747",fill:"#fff",strokeWidth:1,hover:{fill:"#707070",fillOpacity:.15,stroke:"transparent"}},resizeControl:{width:8,height:8,radius:2,fill:"#fff",stroke:"#474747",hover:{width:12,height:12,fill:"#707070",fillOpacity:.15,stroke:"transparent"}},resizeOutline:{fill:"transparent",stroke:"#757575",strokeWidth:1.5,strokeDasharray:"4,4",radius:8,hover:{stroke:"#4271DF"}}},_L={baseNode:{fill:"#fff",stroke:"#000",strokeWidth:2},baseEdge:{stroke:"#000",strokeWidth:2},rect:{},circle:{},diamond:{},ellipse:{},polygon:{},html:{fill:"transparent",stroke:"transparent"},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"}},edgeOutline:{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"}},bL={baseNode:{fill:"#33353A",stroke:"#EAEAEA",strokeWidth:2,radius:12},baseEdge:{stroke:"#EAEAEA",strokeWidth:2,radius:12},rect:{},circle:{},diamond:{},ellipse:{},polygon:{},html:{fill:"#33353A",stroke:"transparent",shadow:{dx:0,dy:0,stdDeviation:4,floodColor:"#9CA1AA55"}},text:{color:"#EAEAEA",stroke:"none",fontSize:12,background:{fill:"transparent"}},nodeText:{color:"#EAEAEA",overflowMode:"default",fontSize:12,lineHeight:1.2},anchor:{stroke:"#EAEAEA",fill:"#33353A",r:4,hover:{r:8,fill:"#707070",fillOpacity:.15,stroke:"transparent"}},anchorLine:{stroke:"#EAEAEA",strokeWidth:2,strokeDasharray:"3,2"},line:{},polyline:{},bezier:{fill:"none",adjustLine:{stroke:"#EAEAEA"},adjustAnchor:{r:4,fill:"#33353A",fillOpacity:1,stroke:"#EAEAEA"}},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"#EAEAEA"}},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},edgeAdjust:{r:4,fill:"#33353A",stroke:"#EAEAEA",strokeWidth:1},outline:{fill:"none",stroke:"transparent",strokeWidth:0},edgeOutline:{fill:"transparent",stroke:"#EAEAEA",strokeWidth:1.5,strokeDasharray:"4,4",radius:8,hover:{stroke:"#4271DF"}},edgeAnimation:{stroke:"#4271DF",strokeDasharray:"12,4,6,4",strokeDashoffset:"100%",animationName:"lf_animate_dash",animationDuration:"20s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"normal"},rotateControl:{stroke:"#EAEAEA",fill:"#33353A",strokeWidth:1,hover:{fill:"#707070",fillOpacity:.15,stroke:"transparent"}},resizeControl:{width:8,height:8,radius:2,fill:"#33353A",stroke:"#EAEAEA",hover:{width:12,height:12,fill:"#707070",fillOpacity:.15,stroke:"transparent"}},resizeOutline:{fill:"transparent",stroke:"#EAEAEA",strokeWidth:1.5,strokeDasharray:"4,4",radius:8,hover:{stroke:"#4271DF"}}},xL={baseNode:{fill:"#fff",stroke:"#474747",strokeWidth:2,radius:12},baseEdge:{stroke:"#474747",strokeWidth:2,radius:12},rect:{fill:"#72CBFF",stroke:"#3ABDF9",radius:8},circle:{fill:"#FFE075",stroke:"#F9CE3A",radius:8},ellipse:{fill:"#FFA8A8",stroke:"#FF6B66",radius:8},text:{fill:"#72CBFF",radius:8,fontSize:12},diamond:{fill:"#96F7AF",stroke:"#40EF7E",radius:8},polygon:{fill:"#E0A8FF",stroke:"#C271FF",radius:8},nodeText:{color:"#474747",overflowMode:"default",fontSize:12,lineHeight:1.2},edgeText:{textWidth:100,overflowMode:"default",fontSize:12,background:{fill:"#fff"}},html:{fill:"#fff",stroke:"transparent",strokeWidth:0},anchor:{stroke:"#474747",fill:"#fff",r:4,hover:{r:8,fill:"#707070",fillOpacity:.15,stroke:"transparent"}},anchorLine:{stroke:"#474747",strokeWidth:2,strokeDasharray:"3,2"},line:{},polyline:{radius:8},bezier:{fill:"none",adjustLine:{stroke:"#3ABDF9"},adjustAnchor:{r:4,fill:"#3ABDF9",fillOpacity:1,stroke:"#3ABDF9"}},edgeAdjust:{r:4,fill:"#fff",stroke:"#474747",strokeWidth:1},arrow:{strokeLinecap:"round",strokeLinejoin:"round",offset:10,verticalLength:5},snapline:{strokeLinecap:"round",strokeLinejoin:"round",stroke:"#949494",strokeWidth:1},outline:{radius:8,fill:"transparent",stroke:"#949494",strokeDasharray:"3,3",hover:{stroke:"#949494"}},edgeOutline:{fill:"transparent",stroke:"#757575",strokeWidth:1.5,strokeDasharray:"4,4",radius:8,hover:{stroke:"#4271DF"}},edgeAnimation:{stroke:"#4271DF",strokeDasharray:"12,4,6,4",strokeDashoffset:"100%",animationName:"lf_animate_dash",animationDuration:"20s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"normal"},rotateControl:{stroke:"#474747",fill:"#fff",strokeWidth:1,hover:{fill:"#707070",fillOpacity:.15,stroke:"transparent"}},resizeControl:{width:8,height:8,radius:2,fill:"#fff",stroke:"#474747",hover:{width:12,height:12,fill:"#707070",fillOpacity:.15,stroke:"transparent"}},resizeOutline:{fill:"transparent",stroke:"#757575",strokeWidth:1.5,strokeDasharray:"4,4",radius:8,hover:{stroke:"#4271DF"}}},No={default:mL,colorful:xL,dark:bL,retro:_L},EL={background:"#33353A"},wL={background:"#fefeff"},Am={background:"#FBFCFE"},SL={background:"#ffffff"},Xi={colorful:wL,dark:EL,default:Am,retro:SL},OL={size:Tl,visible:!0,type:"mesh",config:{color:"#83838377",thickness:2},majorBold:!0},AL={size:Tl,visible:!0,type:"dot",config:{color:"#b7c2d9",thickness:2},majorBold:!1},If={size:Tl,visible:!0,type:"mesh",config:{color:"#D7DEEB",thickness:1},majorBold:{opacity:.6,boldIndices:[5],dashArrayConfig:{pattern:[]},customBoldWidth:2}},CL={size:Tl,visible:!0,type:"dot",config:{color:"#ababab",thickness:1},majorBold:!1},Gi={colorful:AL,dark:OL,retro:CL,default:If},Ml=200,TL=9999,it;(function(n){n[n.DEFAULT=1]="DEFAULT",n[n.TEXT_EDIT=2]="TEXT_EDIT",n[n.SHOW_MENU=3]="SHOW_MENU",n[n.ALLOW_CONNECT=4]="ALLOW_CONNECT",n[n.NOT_ALLOW_CONNECT=5]="NOT_ALLOW_CONNECT"})(it||(it={}));var Nt;(function(n){n.NODE="node",n.EDGE="edge",n.GRAPH="graph"})(Nt||(Nt={}));var We;(function(n){n.NODE="node",n.CIRCLE_NODE="circle-node",n.POLYGON_NODE="polygon-node",n.RECT_NODE="rect-node",n.TEXT_NODE="text-node",n.ELLIPSE_NODE="ellipse-node",n.DIAMOND_NODE="diamond-node",n.HTML_NODE="html-node",n.CUSTOM_HTML_NODE="custom-html-node",n.EDGE="edge",n.LINE_EDGE="line-edge",n.POLYLINE_EDGE="polyline-edge",n.BEZIER_EDGE="bezier-edge",n.GRAPH="graph"})(We||(We={}));var ve;(function(n){n.ELEMENT_CLICK="element:click",n.NODE_ADD="node:add",n.NODE_DELETE="node:delete",n.NODE_CLICK="node:click",n.NODE_DBCLICK="node:dbclick",n.NODE_GROUP_COPY="node:group-copy-add",n.NODE_DND_ADD="node:dnd-add",n.NODE_DND_DRAG="node:dnd-drag",n.NODE_MOUSEDOWN="node:mousedown",n.NODE_DRAGSTART="node:dragstart",n.NODE_DRAG="node:drag",n.NODE_DROP="node:drop",n.NODE_MOUSEUP="node:mouseup",n.NODE_MOUSEMOVE="node:mousemove",n.NODE_MOUSEENTER="node:mouseenter",n.NODE_MOUSELEAVE="node:mouseleave",n.NODE_CONTEXTMENU="node:contextmenu",n.NODE_ROTATE="node:rotate",n.NODE_RESIZE="node:resize",n.NODE_FOCUS="node:focus",n.NODE_BLUR="node:blur",n.NODE_PROPERTIES_CHANGE="node:properties-change",n.NODE_PROPERTIES_DELETE="node:properties-delete",n.EDGE_ADD="edge:add",n.EDGE_DELETE="edge:delete",n.EDGE_CLICK="edge:click",n.EDGE_DBCLICK="edge:dbclick",n.EDGE_FOCUS="edge:focus",n.EDGE_BLUR="edge:blur",n.EDGE_MOUSEENTER="edge:mouseenter",n.EDGE_MOUSELEAVE="edge:mouseleave",n.EDGE_CONTEXTMENU="edge:contextmenu",n.EDGE_ADJUST="edge:adjust",n.EDGE_EXCHANGE_NODE="edge:exchange-node",n.ANCHOR_CLICK="anchor:click",n.ANCHOR_MOUSEDOWN="anchor:mousedown",n.ANCHOR_DRAGSTART="anchor:dragstart",n.ANCHOR_DRAG="anchor:drag",n.ANCHOR_DROP="anchor:drop",n.ANCHOR_DRAGEND="anchor:dragend",n.ADJUST_POINT_MOUSEDOWN="adjustPoint:mousedown",n.ADJUST_POINT_MOUSEUP="adjustPoint:mouseup",n.ADJUST_POINT_MOUSEMOVE="adjustPoint:mousemove",n.ADJUST_POINT_DRAGSTART="adjustPoint:dragstart",n.ADJUST_POINT_DRAG="adjustPoint:drag",n.ADJUST_POINT_DROP="adjustPoint:drop",n.ADJUST_POINT_DRAGEND="adjustPoint:dragend",n.BLANK_MOUSEDOWN="blank:mousedown",n.BLANK_DRAGSTART="blank:dragstart",n.BLANK_DRAG="blank:drag",n.BLANK_DROP="blank:drop",n.BLANK_MOUSEMOVE="blank:mousemove",n.BLANK_CANVAS_MOUSEMOVE="blank:canvas-mousemove",n.BLANK_MOUSEUP="blank:mouseup",n.BLANK_CLICK="blank:click",n.BLANK_CONTEXTMENU="blank:contextmenu",n.SELECTION_MOUSEDOWN="selection:mousedown",n.SELECTION_DRAGSTART="selection:dragstart",n.SELECTION_DRAG="selection:drag",n.SELECTION_DROP="selection:drop",n.SELECTION_MOUSEMOVE="selection:mousemove",n.SELECTION_MOUSEUP="selection:mouseup",n.SELECTION_CONTEXTMENU="selection:contextmenu",n.CONNECTION_NOT_ALLOWED="connection:not-allowed",n.TEXT_MOUSEDOWN="text:mousedown",n.TEXT_DRAGSTART="text:dragstart",n.TEXT_DRAG="text:drag",n.TEXT_DROP="text:drop",n.TEXT_CLICK="text:click",n.TEXT_DBCLICK="text:dbclick",n.TEXT_BLUR="text:blur",n.TEXT_MOUSEMOVE="text:mousemove",n.TEXT_MOUSEUP="text:mouseup",n.TEXT_FOCUS="text:focus",n.TEXT_ADD="text:add",n.TEXT_UPDATE="text:update",n.TEXT_CLEAR="text:clear",n.LABEL_MOUSEDOWN="label:mousedown",n.LABEL_DRAGSTART="label:dragstart",n.LABEL_DRAG="label:drag",n.LABEL_DROP="label:drop",n.LABEL_CLICK="label:click",n.LABEL_DBCLICK="label:dbclick",n.LABEL_BLUR="label:blur",n.LABEL_MOUSEMOVE="label:mousemove",n.LABEL_MOUSEUP="label:mouseup",n.LABEL_FOCUS="label:focus",n.LABEL_ADD="label:add",n.LABEL_UPDATE="label:update",n.LABEL_CLEAR="label:clear",n.LABEL_DELETE="label:delete",n.LABEL_SHOULD_ADD="label:should-add",n.LABEL_BATCH_ADD="label:batch-add",n.LABEL_SHOULD_UPDATE="label:should-update",n.LABEL_SHOULD_DELETE="label:should-delete",n.LABEL_BATCH_DELETE="label:batch-delete",n.LABEL_NOT_ALLOWED_ADD="label:not-allowed-add",n.HISTORY_CHANGE="history:change",n.GRAPH_TRANSFORM="graph:transform",n.GRAPH_RENDERED="graph:rendered",n.GRAPH_UPDATED="graph:updated",n.EDIT_CONFIG_CHANGED="editConfig:changed"})(ve||(ve={}));var Xt;(function(n){n[n.STATIC=-1]="STATIC",n[n.DEFAULT=0]="DEFAULT",n[n.INCREASE=1]="INCREASE",n[n.EDGE_TOP=2]="EDGE_TOP"})(Xt||(Xt={}));var ct;(function(n){n.HORIZONTAL="horizontal",n.VERTICAL="vertical"})(ct||(ct={}));var Zn;(function(n){n.TEXT="text",n.LABEL="label"})(Zn||(Zn={}));var ML=0,Qn=(function(){function n(e){var t=e.onDragStart,r=t===void 0?mo:t,i=e.onDragging,o=i===void 0?mo:i,a=e.onDragEnd,s=a===void 0?mo:a,l=e.eventType,u=l===void 0?"":l,d=e.eventCenter,f=e.step,c=f===void 0?1:f,h=e.isStopPropagation,p=h===void 0?!0:h,v=e.model,g=e.data,y=this;this.isDragging=!1,this.isStartDragging=!1,this.startX=0,this.startY=0,this.sumDeltaX=0,this.sumDeltaY=0,this.handleMouseDown=function(m){var O,T,C=window==null?void 0:window.document;if(m.button===ML){y.isStopPropagation&&m.stopPropagation(),y.isStartDragging=!0,y.startX=m.clientX,y.startY=m.clientY,C.addEventListener("pointermove",y.handleMouseMove,!1),C.addEventListener("pointerup",y.handleMouseUp,!1);var A=(O=y.model)===null||O===void 0?void 0:O.getData();(T=y.eventCenter)===null||T===void 0||T.emit(ve["".concat(y.eventType,"_MOUSEDOWN")],{e:m,data:y.data||A}),y.startTime=new Date().getTime()}},this.handleMouseMove=function(m){var O,T;if(y.isStopPropagation&&m.stopPropagation(),m.preventDefault(),!!y.isStartDragging&&(y.sumDeltaX+=m.clientX-y.startX,y.sumDeltaY+=m.clientY-y.startY,y.startX=m.clientX,y.startY=m.clientY,y.step<=1||Math.abs(y.sumDeltaX)>y.step||Math.abs(y.sumDeltaY)>y.step)){var C=y.sumDeltaX%y.step,A=y.sumDeltaY%y.step,E=y.sumDeltaX-C,N=y.sumDeltaY-A;y.sumDeltaX=C,y.sumDeltaY=A;var B=(O=y.model)===null||O===void 0?void 0:O.getData();y.isDragging||((T=y.eventCenter)===null||T===void 0||T.emit(ve["".concat(y.eventType,"_DRAGSTART")],{e:m,data:y.data||B}),y.onDragStart({event:m})),y.isDragging=!0,Promise.resolve().then(function(){var Z,ue;y.onDragging({deltaX:E,deltaY:N,event:m}),(Z=y.eventCenter)===null||Z===void 0||Z.emit(ve["".concat(y.eventType,"_MOUSEMOVE")],{deltaX:E,deltaY:N,e:m,data:y.data||B}),(ue=y.eventCenter)===null||ue===void 0||ue.emit(ve["".concat(y.eventType,"_DRAG")],{e:m,data:y.data||B})})}},this.handleMouseUp=function(m){var O=window.document;y.isStartDragging=!1,y.isStopPropagation&&m.stopPropagation();var T=m.target;T&&typeof T.releasePointerCapture=="function"&&T.releasePointerCapture(m.pointerId),Promise.resolve().then(function(){var C,A,E;O.removeEventListener("pointermove",y.handleMouseMove,!1),O.removeEventListener("pointerup",y.handleMouseUp,!1);var N=(C=y.model)===null||C===void 0?void 0:C.getData();(A=y.eventCenter)===null||A===void 0||A.emit(ve["".concat(y.eventType,"_MOUSEUP")],{e:m,data:y.data||N}),y.isDragging&&(y.isDragging=!1,y.onDragEnd({event:m}),(E=y.eventCenter)===null||E===void 0||E.emit(ve["".concat(y.eventType,"_DROP")],{e:m,data:y.data||N}))})},this.cancelDrag=function(){var m=window==null?void 0:window.document;m.removeEventListener("pointermove",y.handleMouseMove,!1),m.removeEventListener("pointerup",y.handleMouseUp,!1),y.onDragEnd({event:void 0}),y.isDragging=!1},this.destroy=function(){y.isStartDragging&&y.cancelDrag()},this.onDragStart=r,this.onDragging=o,this.onDragEnd=s,this.step=c,this.isStopPropagation=p,this.eventType=u,this.eventCenter=d,this.model=v,this.data=g}return n.prototype.setStep=function(e){this.step=e},n.prototype.setModel=function(e){this.model=e},n})(),NL=function(n){var e=n.x,t=n.y,r=n.width,i=n.height;return{x:e-r/2,y:t-i/2,x1:e+r/2,y1:t+i/2}},PL=function(n){var e=n.startPoint,t=n.endPoint,r=(e.x+t.x)/2,i=(e.y+t.y)/2,o=Math.abs(e.x-t.x)+10,a=Math.abs(e.y-t.y)+10;return{x:r-o/2,y:i-a/2,x1:r+o/2,y1:i+a/2}},DL=function(n){var e=n.points,t=bi(e),r=Dl(t,8),i=r.x,o=r.y,a=r.width,s=r.height;return{x:i-a/2,y:o-s/2,x1:i+a/2,y1:o+s/2}},RL=function(n){var e=n.path,t=Bf(e),r=Dl(t,8),i=r.x,o=r.y,a=r.width,s=r.height;return{x:i-a/2,y:o-s/2,x1:i+a/2,y1:o+s/2}},LL=function(n){if(n.modelType===We.LINE_EDGE)return PL(n);if(n.modelType===We.POLYLINE_EDGE)return DL(n);if(n.modelType===We.BEZIER_EDGE)return RL(n)},IL=function(n,e,t,r){var i=(e.y-n.y)*(r.x-t.x)-(n.x-e.x)*(t.y-r.y);if(i===0)return!1;var o=((e.x-n.x)*(r.x-t.x)*(t.y-n.y)+(e.y-n.y)*(r.x-t.x)*n.x-(r.y-t.y)*(e.x-n.x)*t.x)/i,a=-((e.y-n.y)*(r.y-t.y)*(t.x-n.x)+(e.x-n.x)*(r.y-t.y)*n.y-(r.x-t.x)*(e.y-n.y)*t.y)/i;return(o-n.x)*(o-e.x)<=0&&(a-n.y)*(a-e.y)<=0&&(o-t.x)*(o-r.x)<=0&&(a-t.y)*(a-r.y)<=0?{x:o,y:a}:!1},Da=function(n,e,t){var r=n.x,i=n.y,o=e.x,a=e.y,s=t.x,l=t.y,u=(l-a)/(s-o),d=a-u*o;return(r>=o&&r<=s||r<=o&&r>=s)&&(i>=a&&i<=l||i<=a&&i>=l)&&Math.abs(i-u*r-d)<Number.EPSILON},Ra=function(n){var e=n.start,t=n.end,r=n.offset,i=n.verticalLength,o=n.type,a={leftX:0,leftY:0,rightX:0,rightY:0},s=Math.atan((t.y-e.y)/(t.x-e.x)),l=Math.atan(r/i),u=Math.sqrt(i*i+r*r);return o==="start"?t.x>=e.x?(a.leftX=e.x+u*Math.sin(s+l),a.leftY=e.y-u*Math.cos(s+l),a.rightX=e.x-u*Math.sin(s-l),a.rightY=e.y+u*Math.cos(s-l)):(a.leftX=e.x-u*Math.sin(s+l),a.leftY=e.y+u*Math.cos(s+l),a.rightX=e.x+u*Math.sin(s-l),a.rightY=e.y-u*Math.cos(s-l)):o==="end"&&(t.x>=e.x?(a.leftX=t.x+u*Math.sin(s-l),a.leftY=t.y-u*Math.cos(s-l),a.rightX=t.x-u*Math.sin(s+l),a.rightY=t.y+u*Math.cos(s+l)):(a.leftX=t.x-u*Math.sin(s-l),a.leftY=t.y+u*Math.cos(s-l),a.rightX=t.x+u*Math.sin(s+l),a.rightY=t.y-u*Math.cos(s+l))),a},Po=function(){return Po=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Po.apply(this,arguments)},Jn=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},_i=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))},kL=function(n,e){return Math.abs(n.centerX-e.centerX)*2<n.width+e.width&&Math.abs(n.centerY-e.centerY)*2<n.height+e.height},kf=function(n){var e=[],t={};return n.forEach(function(r){var i="".concat(r.x,"-").concat(r.y);r.id=i,t[i]=r}),Object.keys(t).forEach(function(r){e.push(t[r])}),e},Nl=function(n,e){return n.width===0&&n.height===0?n:{x:n.x,y:n.y,centerX:n.centerX,centerY:n.centerY,minX:n.minX-e,minY:n.minY-e,maxX:n.maxX+e,maxY:n.maxY+e,height:n.height+2*e,width:n.width+2*e}},jL=function(n,e){var t=Math.abs(n.x-e.centerX),r=Math.abs(n.y-e.centerY);return t/e.width>r/e.height?ct.HORIZONTAL:ct.VERTICAL},Pl=function(n,e,t){var r=jL(t,e);return r===ct.HORIZONTAL?{x:t.x>n.centerX?n.maxX:n.minX,y:t.y}:{x:t.x,y:t.y>n.centerY?n.maxY:n.minY}},Cm=function(n,e){var t=Math.min(n.minX,e.minX),r=Math.min(n.minY,e.minY),i=Math.max(n.maxX,e.maxX),o=Math.max(n.maxY,e.maxY);return{x:(t+i)/2,y:(r+o)/2,centerX:(t+i)/2,centerY:(r+o)/2,minX:t,minY:r,maxX:i,maxY:o,height:o-r,width:i-t}},Dl=function(n,e,t){n===void 0&&(n=[]);var r=[],i=[];n.forEach(function(f){r.push(f.x),i.push(f.y)});var o=Math.min.apply(Math,_i([],Jn(r),!1)),a=Math.max.apply(Math,_i([],Jn(r),!1)),s=Math.min.apply(Math,_i([],Jn(i),!1)),l=Math.max.apply(Math,_i([],Jn(i),!1)),u=a-o,d=l-s;return e&&(u+=e,d+=t||e),{centerX:(o+a)/2,centerY:(s+l)/2,maxX:a,maxY:l,minX:o,minY:s,x:(o+a)/2,y:(s+l)/2,height:d,width:u}},Rl=function(n){var e=n.minX,t=n.minY,r=n.maxX,i=n.maxY;return[{x:e,y:t},{x:r,y:t},{x:r,y:i},{x:e,y:i}]},Ll=function(n,e){var t=n.x,r=n.y;return t<e.minX||t>e.maxX||r<e.minY||r>e.maxY},BL=function(n,e){return e<n.minX||e>n.maxX?[]:[{x:e,y:n.minY},{x:e,y:n.maxY}]},FL=function(n,e){return e<n.minY||e>n.maxY?[]:[{x:n.minX,y:e},{x:n.maxX,y:e}]},$L=function(n,e){return _i(_i([],Jn(BL(n,e.x)),!1),Jn(FL(n,e.y)),!1)},jf=function(n,e){return Math.abs(n.x-e.x)+Math.abs(n.y-e.y)},HL=function(n,e){var t=-2,r=0;return e.forEach(function(i){i&&(n.x===i.x&&(r+=t),n.y===i.y&&(r+=t))}),r},Tm=function(n,e,t,r,i){return jf(n,e)+jf(n,t)+HL(n,[e,t,r,i])},Mm=function(n,e,t,r,i){i||(i=0),n.unshift(e[r]),t[r]&&t[r]!==r&&i<=100&&Mm(n,e,t,t[r],i+1)},zL=function(n,e){var t=n.indexOf(e);t>-1&&n.splice(t,1)},La=function(n,e,t,r){var i=e.x-n.x,o=e.y-n.y,a=r.x-t.x,s=r.y-t.y,l=(-o*(n.x-t.x)+i*(n.y-t.y))/(-a*o+i*s),u=(a*(n.y-t.y)-s*(n.x-t.x))/(-a*o+i*s);return l>=0&&l<=1&&u>=0&&u<=1},Nm=function(n,e,t){if(t.width===0&&t.height===0)return!1;var r=Jn(Rl(t),4),i=r[0],o=r[1],a=r[2],s=r[3];return La(n,e,i,o)||La(n,e,i,s)||La(n,e,o,a)||La(n,e,a,s)},WL=function(n,e,t,r){var i=[];return n.forEach(function(o){o!==e&&(o.x===e.x||o.y===e.y)&&!Nm(o,e,t)&&!Nm(o,e,r)&&i.push(o)}),kf(i)},XL=function(n,e,t,r,i,o,a){var s=[],l=[e],u={},d={},f={};e.id&&(d[e.id]=0,f[e.id]=Tm(e,t,e));var c={};n.forEach(function(v){v.id&&(c[v.id]=v)});for(var h=function(){var v,g=1/0;if(l.forEach(function(m){m.id&&f[m.id]<g&&(g=f[m.id],v=m)}),v===t&&t.id){var y=[];return Mm(y,c,u,t.id),{value:y}}if(!v)return{value:[e,t]};zL(l,v),s.push(v),WL(n,v,r,i).forEach(function(m){var O;if(s.indexOf(m)===-1&&(l.indexOf(m)===-1&&l.push(m),v!=null&&v.id&&(m!=null&&m.id))){var T=((O=d[v.id])!==null&&O!==void 0?O:0)+jf(v,m);if(d[m.id]&&T>=d[m.id])return;u[m.id]=v.id,d[m.id]=T,f[m.id]=d[m.id]+Tm(m,t,e,o,a)}})};l.length;){var p=h();if(typeof p=="object")return p.value}return[e,t]},Pm=function(n){return Bn(n)},Dm=function(n){for(var e=1;e<n.length-1;){var t=n[e-1],r=n[e],i=n[e+1];t.x===r.x&&r.x===i.x||t.y===r.y&&r.y===i.y?n.splice(e,1):e++}return n},Rm=function(n,e,t,r,i){var o=Pm(t),a=Pm(r),s=Nl(o,i),l=Nl(a,i),u=Pl(s,o,n),d=Pl(l,a,e);if(kL(s,l)){var f=UL(n,e,u,d);return _i(_i([n,u],Jn(f),!1),[d,e],!1)}var c=Dl([u,d]),h=Cm(s,c),p=Cm(l,c),v=[];v=v.concat(Rl(h)),v=v.concat(Rl(p));var g={x:(n.x+e.x)/2,y:(n.y+e.y)/2};[c,h,p].forEach(function(m){v=v.concat($L(m,g).filter(function(O){return Ll(O,s)&&Ll(O,l)}))}),[{x:u.x,y:d.y},{x:d.x,y:u.y}].forEach(function(m){Ll(m,s)&&Ll(m,l)&&v.push(m)}),v.unshift(u),v.push(d),v=kf(v);var y=XL(v,u,d,o,a,n,e);return y.unshift(n),y.push(e),y.length>2&&(y=Dm(y)),kf(y)},GL=function(n){if(n.length===1){var e=Jn(n,1),t=e[0];return[t,t]}else{for(var r=n[0],i=n[1],o=mr(r.x,r.y,i.x,i.y),a=1;a<n.length-1;a++){var s=n[a],l=n[a+1],u=mr(s.x,s.y,l.x,l.y);u>o&&(o=u,r=s,i=l)}return[r,i]}},Lm=function(n,e,t){var r=Jr(n,t),i=Jr(e,t);return r&&i},Im=function(n,e,t){var r=Jr(n,t),i=Jr(e,t),o=r&&i,a=r||i;return!o&&a},km=function(n,e,t){for(var r=void 0,i=Bn(t),o=Rl(i),a=0;a<o.length;a++){var s=La(n,e,o[a],o[(a+1)%o.length]);s&&(r=[o[a],o[(a+1)%o.length]])}if(r)return IL(n,e,r[0],r[1])},Il=function(n,e){var t=void 0;return n.x===e.x?t=ct.VERTICAL:n.y===e.y&&(t=ct.HORIZONTAL),t},bi=function(n){var e=n.split(" "),t=[];return e&&e.forEach(function(r){var i=Jn(r.split(","),2),o=i[0],a=i[1];t.push({x:Number(o),y:Number(a)})}),t},UL=function(n,e,t,r){var i=[],o=Il(n,t),a=Il(e,r);if(o===a)n.y===t.y?(i.push({x:t.x,y:(t.y+r.y)/2}),i.push({x:r.x,y:(t.y+r.y)/2})):(i.push({x:(t.x+r.x)/2,y:t.y}),i.push({x:(t.x+r.x)/2,y:r.y}));else{var s={x:t.x,y:r.y},l=Da(s,n,t),u=Da(s,e,r);if(l||u)s={x:r.x,y:t.y};else{var d=jm(s,n,t),f=jm(s,e,r);d&&f&&(s={x:r.x,y:t.y})}i.push(s)}return i},jm=function(n,e,t){return n.x===e.x&&n.x===t.x||n.y===e.y&&n.y===t.y},Bm=function(n){if(!n)return 0;for(var e=0,t=0;t<n.length;t++){var r=n.charCodeAt(t);n.match(/[A-Z]/)?e+=1.5:r>=1&&r<=126||r>=65376&&r<=65439?e+=1:e+=2}return e},YL=function(n){var e=n.start,t=n.end,r;if(e.x===t.x&&e.y===t.y)r="";else{var i={start:e,end:t,offset:10,verticalLength:5},o=Ra(Po(Po({},i),{type:"start"})),a=Ra(Po(Po({},i),{type:"end"}));r="M".concat(o.leftX," ").concat(o.leftY,`
|
|
78
|
+
L`).concat(o.rightX," ").concat(o.rightY,`
|
|
79
|
+
L`).concat(a.rightX," ").concat(a.rightY,`
|
|
80
|
+
L`).concat(a.leftX," ").concat(a.leftY," z")}return{d:r,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},Fm=function(n){var e=n.start,t=n.end,r=n.sourceNode,i=n.targetNode,o=n.offset,a=Bn(r),s=Bn(i),l=Nl(a,o),u=Nl(s,o),d=Pl(l,a,e),f=Pl(u,s,t);return{sNext:d,ePre:f}},Bf=function(n){var e=n.replace(/M/g,"").replace(/C/g,",").split(","),t=kl(e[0]),r=kl(e[1]),i=kl(e[2]),o=kl(e[3]);return[t,r,i,o]},kl=function(n){var e=Jn(n.replace(/(^\s*)/g,"").split(" "),2),t=e[0],r=e[1];return{x:+t,y:+r}},$m=function(n,e){var t=Jn(n,4),r=t[0],i=t[1],o=t[2],a=t[3],s=I3(r,i,o,a,e);return[s,n[3]]},Hm=function(n,e){for(var t=n.x,r=n.y,i=bi(e),o=Number.MAX_SAFE_INTEGER,a,s=[],l=0;l<i.length;l++)s.push({start:i[l],end:i[(l+1)%i.length]});if(s.forEach(function(c){var h=c.start,p=c.end;if(h.x===p.x){var v={x:h.x,y:r},g=Da(v,h,p);if(g){var y=Math.abs(h.x-t);y<o&&(o=y,a=v)}}else if(h.y===p.y){var v={x:t,y:h.y},g=Da(v,h,p);if(g){var y=Math.abs(h.y-r);y<o&&(o=y,a=v)}}}),!a){var u=s[0],d=u.start,f=u.end;a={x:d.x+(f.x-d.x)/2,y:d.y+(f.y-d.y)/2}}return a},VL=function(n){return Wi(n,["id","type","sourceNodeId","sourceAnchorId","targetNodeId","targetAnchorId","pointsList","startPoint","endPoint","properties"])},zm=function(n,e){return Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2))};function KL(n,e){return typeof e!="function"?function(t,r,i){return Object.assign({type:n.edgeType},i)}:function(t,r,i){var o=e(t,r,i);return o?typeof o=="string"?Object.assign({},i,{type:o}):Object.assign({type:o},i):{type:n.edgeType}}}var qL=function(n){var e=n.rows,t=n.rowsLength,r=n.fontSize,i=0;return nt(e,function(o){var a=Bm(o);i=a>i?a:i}),{width:Math.ceil(i/2)*r+r/4,height:t*(r+2)+r/4}},Do=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},jl=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))};function Ro(n,e,t){return t&&e*Math.round(n/e)||n}function ZL(n,e,t){if(!n)return[];var r=Math.min.apply(Math,jl([],Do(n.map(function(v){return v[0]})),!1)),i=Math.max.apply(Math,jl([],Do(n.map(function(v){return v[0]})),!1)),o=Math.min.apply(Math,jl([],Do(n.map(function(v){return v[1]})),!1)),a=Math.max.apply(Math,jl([],Do(n.map(function(v){return v[1]})),!1)),s=-r,l=-o,u=n.map(function(v){var g=Do(v,2),y=g[0],m=g[1];return[y+s,m+l]}),d=i-r,f=a-o,c=e?e/d:1,h=t?t/f:1,p=Math.min(c,h);return u.map(function(v){var g=Do(v,2),y=g[0],m=g[1];return[y*p,m*p]})}var Wm=function(n,e,t){var r=n.length;if(r<2||e<=0)return n.slice();for(var i=function(C,A){return{x:A.x-C.x,y:A.y-C.y}},o=function(C){return Math.hypot(C.x,C.y)},a=function(C){var A=o(C)||1;return{x:C.x/A,y:C.y/A}},s=[],l=function(C,A,E){var N=i(A,C),B=i(A,E),Z=o(N),ue=o(B);if(Z<1e-6||ue<1e-6)return[A];for(var me=a(N),S=a(B),D=Math.min(e,Z*.45,ue*.45),L={x:A.x+me.x*D,y:A.y+me.y*D},Y={x:A.x+S.x*D,y:A.y+S.y*D},se=10,ce=[L],Ue=1;Ue<se;Ue++){var He=Ue/se,F=1-He;ce.push({x:F*F*L.x+2*F*He*A.x+He*He*Y.x,y:F*F*L.y+2*F*He*A.y+He*He*Y.y})}return ce.push(Y),ce},u=0;u<r;u++){var d=u===0?t?r-1:0:u-1,f=u===r-1?t?0:r-1:u+1,c=n[d],h=n[u],p=n[f],v=!t&&(u===0||u===r-1);if(v)s.push(h);else{var g=l(c,h,p);g.forEach(function(C){return s.push(C)})}}for(var y=[],u=0;u<s.length;u++){var m=s[u];(y.length===0||Math.hypot(m.x-y[y.length-1].x,m.y-y[y.length-1].y)>1e-6)&&y.push(m)}if(t&&y.length>1){var O=y[0],T=y[y.length-1];Math.hypot(O.x-T.x,O.y-T.y)<1e-6&&y.pop()}return y},Ff=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},$f=function(n,e,t){var r=Ff(n,2),i=r[0],o=r[1],a=Ff(e,2),s=a[0],l=a[1],u=Ff(t,2),d=u[0],f=u[1];return i>s&&i<d&&o>l&&o<f},Xm=function(n,e){var t=e.multipleSelectKey,r=!1;switch(t){case"meta":r=n.metaKey;break;case"alt":r=n.altKey;break;case"shift":r=n.shiftKey;break;case"ctrl":r=n.ctrlKey;break;default:r=!1;break}return r},Hf=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})();function Gm(n,e){return n instanceof qt&&e instanceof qt}var Um=(function(n){Hf(e,n);function e(t,r,i){var o=n.call(this,3)||this;return o[0]=t,o[1]=r,o[2]=i,o.x=t,o.y=r,o.z=i,Object.setPrototypeOf(o,e.prototype),o}return e.prototype.add=function(t){if(Gm(this,t))return new qt(this.x+t.x,this.y+t.y);var r=this.z+t.z;return new zf((this.x+t.x)/r,(this.y+t.y)/r)},e.prototype.subtract=function(t){if(Gm(this,t))return new qt(this.x-t.x,this.y-t.y);var r=this.z-t.z;return r===0?new qt(this.x-t.x,this.y-t.y):new zf((this.x-t.x)/r,(this.y-t.y)/r)},e})(Array),qt=(function(n){Hf(e,n);function e(t,r,i){var o=n.call(this,t,r,i??0)||this;return Object.setPrototypeOf(o,e.prototype),o}return e.prototype.toString=function(){return"Vector"},e.prototype.dot=function(t){var r=this;return t.reduce(function(i,o,a){return i+o*r[a]})},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 r=this.crossZ(t),i=Math.acos(this.normalize().dot(t.normalize()));return r>=0?i:-i},e})(Um),zf=(function(n){Hf(e,n);function e(t,r){var i=n.call(this,t,r,1)||this;return Object.setPrototypeOf(i,e.prototype),i}return e.prototype.toString=function(){return"Point"},e})(Um),Bl=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Lo=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},Wf=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))},Ia=(function(n){Bl(e,n);function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=n.call(this,t.length)||this;return i.fill(new Array(3)),t.forEach(function(o,a){i[a]=o}),i.columns=t[0].length,i.rows=t.length,Object.setPrototypeOf(i,e.prototype),i}return e.prototype.getRow=function(t){return this[t]},e.prototype.getColumn=function(t){return Wf([],Lo(this.map(function(r){return r[t]})),!1)},e.prototype.transpose=function(){for(var t=[],r=0;r<this.columns;r++)t.push(this.getColumn(r));return new(e.bind.apply(e,Wf([void 0],Lo(t),!1)))},e.prototype.cross=function(t){var r=new Array(this.rows).fill("").map(function(){return[]});if(this.columns===t.rows)for(var i=0;i<this.rows;i++)for(var o=this.getRow(i),a=function(l){var u=t.getColumn(l);r[i][l]=o.reduce(function(d,f,c){return d+f*u[c]},0)},s=0;s<t.columns;s++)a(s);return new(e.bind.apply(e,Wf([void 0],Lo(r),!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 zf(t[0],t[1])})},e.prototype.toString=function(){var t=Lo(this[0],2),r=t[0],i=t[1],o=Lo(this[1],2),a=o[0],s=o[1],l=Lo(this[2],2),u=l[0],d=l[1];return"matrix(".concat(r," ").concat(i," ").concat(a," ").concat(s," ").concat(u," ").concat(d,")")},e.prototype.translate=function(t,r){return this.cross(new Fl(t,r))},e.prototype.rotate=function(t){return this.cross(new QL(t))},e.prototype.scale=function(t,r){return this.cross(new JL(t,r))},e})(Array),QL=(function(n){Bl(e,n);function e(t){var r=n.call(this,new qt(+Math.cos(t).toFixed(2),+Math.sin(t).toFixed(2),0),new qt(-Math.sin(t).toFixed(2),+Math.cos(t).toFixed(2),0),new qt(0,0,1))||this;return Object.setPrototypeOf(r,e.prototype),r}return e.prototype.inverse=function(){return this.transpose()},e})(Ia),JL=(function(n){Bl(e,n);function e(t,r){var i=n.call(this,new qt(t,0,0),new qt(0,r,0),new qt(0,0,1))||this;return i.sx=t,i.sy=r,Object.setPrototypeOf(i,e.prototype),i}return e.prototype.inverse=function(){return new e(1/this.sx,1/this.sy)},e})(Ia),Fl=(function(n){Bl(e,n);function e(t,r){var i=n.call(this,new qt(1,0,0),new qt(0,1,0),new qt(t,r,1))||this;return i.tx=t,i.ty=r,Object.setPrototypeOf(i,e.prototype),i}return e.prototype.inverse=function(){return new e(-this.tx,-this.ty)},e})(Ia);fx({});var $l=function(){return $l=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},$l.apply(this,arguments)},e3=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},Xf=function(n){var e=n.anchors;return e},Hl=function(n,e){for(var t=e.nodes,r,i=t.length-1;i>=0;i--){var o=t[i],a=r3(n,o);if(a){var s=o.getTargetAnchor(n);if(s){var l={node:o,anchorIndex:s.index,anchor:s.anchor};(!r||t3(o,r.node,e))&&(r=l)}}}return r},t3=function(n,e,t){return n.zIndex>e.zIndex?!0:t.nodesMap[n.id].index>t.nodesMap[e.id].index},n3=function(n,e){for(var t=Xf(e),r,i=Number.MAX_SAFE_INTEGER,o=0;o<t.length;o++){var a=mr(n.x,n.y,t[o].x,t[o].y);a<i&&(i=a,r={index:o,anchor:$l($l({},t[o]),{x:t[o].x,y:t[o].y,id:t[o].id})})}return r},mr=function(n,e,t,r){return Math.hypot(n-t,e-r)},Jr=function(n,e,t){t===void 0&&(t=0);var r=!1,i=Bn(e),o=e3(new Ia([n.x,n.y,1]).translate(-e.x,-e.y).rotate(-e.rotate).translate(e.x,e.y)[0],2),a=o[0],s=o[1],l={x:a,y:s};return l.x>=i.minX-t&&l.x<=i.maxX+t&&l.y>=i.minY-t&&l.y<=i.maxY+t&&(r=!0),r},r3=function(n,e){return Jr(n,e,5)},Bn=function(n){var e=n.x,t=n.y,r=n.width,i=n.height;return{minX:e-r/2,minY:t-i/2,maxX:e+r/2,maxY:t+i/2,x:e,y:t,width:r,height:i,centerX:e,centerY:t}},i3=function(n){var e=n,t=e.x,r=e.y,i=e.width,o=e.height,a=e.radius;return[{x:t-i/2+a,y:r-o/2+a,r:a},{x:t+i/2-a,y:r-o/2+a,r:a},{x:t-i/2+a,y:r+o/2-a,r:a},{x:t+i/2-a,y:r+o/2-a,r:a}]},Ym=function(n,e,t){var r=i3(t),i,o=Number.MAX_SAFE_INTEGER;return r.forEach(function(a){var s=mr(n.x,n.y,a.x,a.y);s<o&&(o=s,i=a)}),Gf(n,e,i)},Gf=function(n,e,t){var r,i=t.x,o=t.y,a=t.r;if(e===ct.HORIZONTAL){var s=i-Math.sqrt(a*a-(n.y-o)*(n.y-o)),l=i+Math.sqrt(a*a-(n.y-o)*(n.y-o)),u=Math.abs(s-n.x)<Math.abs(l-n.x)?s:l;r={x:u,y:n.y}}else if(e===ct.VERTICAL){var d=o-Math.sqrt(a*a-(n.x-i)*(n.x-i)),f=o+Math.sqrt(a*a-(n.x-i)*(n.x-i)),c=Math.abs(d-n.y)<Math.abs(f-n.y)?d:f;r={x:n.x,y:c}}return r},Vm=function(n,e){var t=e,r=!1,i=t.x,o=t.y,a=t.width,s=t.height,l=t.radius,u={minX:i-a/2+l,maxX:i+a/2-l,minY:o-s/2+l,maxY:o+s/2-l};return n.y===o+s/2||n.y===o-s/2?r=n.x>u.minX&&n.x<u.maxX:(n.x===i+a/2||n.x===i-a/2)&&(r=n.y>u.minY&&n.y<u.maxY),r},Km=function(n,e,t){var r,i=t,o=i.x,a=i.y,s=i.rx,l=i.ry;if(e===ct.HORIZONTAL){var u=o-Math.sqrt(s*s-(n.y-a)*(n.y-a)*s*s/(l*l)),d=o+Math.sqrt(s*s-(n.y-a)*(n.y-a)*s*s/(l*l)),f=Math.abs(u-n.x)<Math.abs(d-n.x)?u:d;r={x:f,y:n.y}}else if(e===ct.VERTICAL){var c=a-Math.sqrt(l*l-(n.x-o)*(n.x-o)*l*l/(s*s)),h=a+Math.sqrt(l*l-(n.x-o)*(n.x-o)*l*l/(s*s)),p=Math.abs(c-n.y)<Math.abs(h-n.y)?c:h;r={x:n.x,y:p}}return r},zl=function(n,e,t){for(var r=t.pointsPosition,i=Number.MAX_SAFE_INTEGER,o,a=[],s=0;s<r.length;s++)a.push({start:r[s],end:r[(s+1)%r.length]});return a.forEach(function(l){var u=l.start,d=l.end,f=u,c=d;u.x>d.x&&(f=d,c=u);var h={x:n.x,y:n.y};if(f.x===c.x&&e===ct.HORIZONTAL&&(h={x:f.x,y:n.y}),f.y===c.y&&e===ct.VERTICAL&&(h={x:n.x,y:f.y}),f.x!==c.x&&f.y!==c.y){var p=(c.y-f.y)/(c.x-f.x),v=(f.x*c.y-c.x*f.y)/(f.x-c.x);e===ct.HORIZONTAL?h={x:(n.y-v)/p,y:n.y}:e===ct.VERTICAL&&(h={x:n.x,y:p*n.x+v})}var g=Da(h,u,d);if(g){var y=mr(h.x,h.y,n.x,n.y);y<i&&(i=y,o=h)}}),o},o3=function(n){var e=Wi(n,["id","type","x","y","text","label","properties","virtual","rotate","resizable","rotatable"]);return e},qm=function(n,e,t,r){var i=n.x,o=n.y;return e.x>n.x?i=n.x+t/2:e.x<n.x&&(i=n.x-t/2),e.y>n.y?o=n.y+r/2:e.y<n.y&&(o=n.y-r/2),{x:i,y:o}},Zm=function(n){var e=n.rows,t=n.style,r=n.rowsLength,i=n.className,o=document.createElement("div");o.className=i,o.style.fontSize="".concat(t.fontSize),o.style.width="".concat(t.width),o.style.lineHeight="".concat(t.lineHeight),o.style.padding="".concat(t.padding),t.fontFamily&&(o.style.fontFamily="".concat(t.fontFamily)),r>1?e.forEach(function(s){var l=document.createElement("div");l.textContent=s,o.appendChild(l)}):o.textContent=e[0],document.body.appendChild(o);var a=o.clientHeight;return document.body.removeChild(o),a},Qm=function(n){var e=n.rows,t=n.rowsLength,r=n.fontSize,i=0;return e&&e.forEach(function(o){var a=Bm(o);i=a>i?a:i}),{width:Math.ceil(i/2)*r+r/4,height:t*(r+2)+r/4}},Wl=function(n){return typeof n!="object"?{isAllPass:!!n,msg:n?"":"不允许连接"}:n};let Xl;const a3=new Uint8Array(16);function s3(){if(!Xl&&(Xl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Xl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Xl(a3)}const Zt=[];for(let n=0;n<256;++n)Zt.push((n+256).toString(16).slice(1));function l3(n,e=0){return Zt[n[e+0]]+Zt[n[e+1]]+Zt[n[e+2]]+Zt[n[e+3]]+"-"+Zt[n[e+4]]+Zt[n[e+5]]+"-"+Zt[n[e+6]]+Zt[n[e+7]]+"-"+Zt[n[e+8]]+Zt[n[e+9]]+"-"+Zt[n[e+10]]+Zt[n[e+11]]+Zt[n[e+12]]+Zt[n[e+13]]+Zt[n[e+14]]+Zt[n[e+15]]}const Jm={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function u3(n,e,t){if(Jm.randomUUID&&!n)return Jm.randomUUID();n=n||{};const r=n.random||(n.rng||s3)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,l3(r)}var xi=function(){return u3()},ka=new Map,e_=function(n){var e=xi();function t(){n();var i=ka.get(e);if(i){var o=window.requestAnimationFrame(t);ka.set(e,o)}}var r=window.requestAnimationFrame(t);return ka.set(e,r),e},Gl=function(n){var e=ka.get(n);e&&(window.cancelAnimationFrame(e),ka.delete(n))},ja=function(){return ja=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},ja.apply(this,arguments)},d3=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o};function t_(n){var e=n.x,t=e===void 0?0:e,r=n.y,i=r===void 0?0:r,o=n.value,a=n.fontSize,s=a===void 0?12:a,l=n.fill,u=l===void 0?"currentColor":l,d=n.overflowMode,f=d===void 0?"default":d,c=n.textWidth,h=c===void 0?void 0:c,p=n.model,v={x:t,y:i,fill:u,fontSize:s,textAnchor:"middle",dominantBaseline:"central"};if(nt(Zr(n),function(C){var A=d3(C,2),E=A[0],N=A[1];typeof N!="object"&&(v[E]=N)}),o){var g=String(o).split(/[\r\n]/g),y=g.length;if(f!=="default"){var m=p.BaseType,O=p.modelType;if(m===Nt.NODE&&O!==We.TEXT_NODE||m===Nt.EDGE&&h)return f3(n)}if(y>1){var T=g.map(function(C,A){var E=s+2,N=(A-(y-1)/2)*E;return $("tspan",{className:"lf-text-tspan",x:t,y:i+N,children:C})});return $("text",ja({},v,{children:T}))}return $("text",ja({},v,{children:o}))}return null}function f3(n){var e=n.x,t=n.y,r=n.value,i=n.model,o=n.textWidth,a=n.fontSize,s=a===void 0?12:a,l=n.lineHeight,u=n.fontFamily,d=u===void 0?"":u,f=n.wrapPadding,c=f===void 0?"0, 0":f,h=n.overflowMode,p=i.width,v=i.height,g=i.textHeight,y=o||p,m=String(r).split(/[\r\n]/g),O=m.length,T=Zm({rows:m,style:{fontSize:"".concat(s,"px"),width:"".concat(y,"px"),fontFamily:d,lineHeight:l,padding:c},rowsLength:O,className:"lf-get-text-height"}),C=v>T?v:T;g&&(C=g);var A=h==="ellipsis";return A&&(C=s+2),$("g",{children:$("foreignObject",{width:y,height:C,x:e-y/2,y:t-C/2,style:{overflow:"visible",textAlign:"left"},children:$("div",{className:"lf-node-text-auto-wrap",style:{minHeight:C,width:y,padding:c},children:$("div",{className:A?"lf-node-text-ellipsis-content":"lf-node-text-auto-wrap-content",title:A?m.join(""):"",style:ja({},n),children:m.map(function(E){return $("div",{className:"lf-node-text--auto-wrap-inner",children:E})})})})})})}var Uf=function(){return Uf=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Uf.apply(this,arguments)},c3=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o};function Io(n){var e={x1:10,y1:10,x2:20,y2:20,stroke:"black"};return nt(Zr(n),function(t){var r=c3(t,2),i=r[0],o=r[1];(i==="style"||typeof o!="object")&&(e[i]=o)}),$("line",Uf({},e))}var Yf=function(){return Yf=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Yf.apply(this,arguments)},h3=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o};function Lr(n){var e=n.x,t=n.y,r=n.width,i=n.height,o=n.className,a=n.strokeWidth,s=n.radius,l=s===void 0?0:s,u=e-r/2,d=t-i/2,f={};return f["stroke-width"]=a,nt(Zr(n),function(c){var h=h3(c,2),p=h[0],v=h[1];typeof v!="object"&&(f[p]=v)}),o?f.className="lf-basic-shape ".concat(o):f.className="lf-basic-shape",l&&(f.rx=l,f.ry=l),f.x=u,f.y=d,$("rect",Yf({},f))}var Vf=function(){return Vf=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Vf.apply(this,arguments)},p3=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o};function Ba(n){var e={d:""};return nt(Zr(n),function(t){var r=p3(t,2),i=r[0],o=r[1];(i==="style"||typeof o!="object")&&(e[i]=o)}),$("path",Vf({},e))}var Kf=function(){return Kf=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Kf.apply(this,arguments)},v3=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o};function ko(n){var e=n.x,t=e===void 0?0:e,r=n.y,i=r===void 0?0:r,o=n.r,a=o===void 0?4:o,s=n.className,l={cx:t,cy:i,r:a,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return nt(Zr(n),function(u){var d=v3(u,2),f=d[0],c=d[1];typeof c!="object"&&(l[f]=c)}),s?l.className="lf-basic-shape ".concat(s):l.className="lf-basic-shape",$("circle",Kf({},l))}var qf=function(){return qf=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},qf.apply(this,arguments)},g3=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o};function y3(n){var e=n.x,t=e===void 0?0:e,r=n.y,i=r===void 0?0:r,o=n.rx,a=o===void 0?4:o,s=n.ry,l=s===void 0?4:s,u=n.className,d={cx:t,cy:i,rx:a,ry:l,fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1};return nt(Zr(n),function(f){var c=g3(f,2),h=c[0],p=c[1];typeof p!="object"&&(d[h]=p)}),u?d.className="lf-basic-shape ".concat(u):d.className="lf-basic-shape",$("ellipse",qf({},d))}var Ul=function(){return Ul=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Ul.apply(this,arguments)},m3=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o};function Zf(n){var e=n.points,t=e===void 0?[]:e,r=n.className,i=n.radius,o={fill:"transparent",fillOpacity:1,strokeWidth:1,stroke:"#000",strokeOpacity:1,points:""};if(nt(Zr(n),function(u){var d=m3(u,2),f=d[0],c=d[1];typeof c!="object"&&(o[f]=c)}),r?o.className="lf-basic-shape ".concat(r):o.className="lf-basic-shape",i){var a=t.map(function(u){return{x:u[0],y:u[1]}}),s=Wm(a,i,!0),l=s.length?"M ".concat(s[0].x," ").concat(s[0].y," ").concat(s.slice(1).map(function(u){return"L ".concat(u.x," ").concat(u.y)}).join(" ")," Z"):"";return o.d=l,delete o.points,$("path",Ul({},o))}else return o.points=t.map(function(u){return u.join(",")}).join(" "),$("polygon",Ul({},o))}var Qf=function(){return Qf=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Qf.apply(this,arguments)},_3=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o};function b3(n){var e=n.className,t={points:"",fill:"none"};return nt(Zr(n),function(r){var i=_3(r,2),o=i[0],a=i[1];(o==="style"||typeof a!="object")&&(t[o]=a)}),e&&(t.className="".concat(e)),$("polyline",Qf({},t))}var n_=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Fa=function(){return Fa=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Fa.apply(this,arguments)},x3=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},E3=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},at;(function(n){n[n.LEFT_TOP=0]="LEFT_TOP",n[n.RIGHT_TOP=1]="RIGHT_TOP",n[n.RIGHT_BOTTOM=2]="RIGHT_BOTTOM",n[n.LEFT_BOTTOM=3]="LEFT_BOTTOM"})(at||(at={}));var w3=(function(n){n_(e,n);function e(t){var r=n.call(this)||this;r.isShiftPressed=!1,r.bindKeyboardEvents=function(){document.addEventListener("keydown",r.handleKeyDown),document.addEventListener("keyup",r.handleKeyUp)},r.handleKeyDown=function(s){s.key==="Shift"&&(r.isShiftPressed=!0)},r.handleKeyUp=function(s){s.key==="Shift"&&(r.isShiftPressed=!1)},r.updateEdgePointByAnchors=function(){var s=r.nodeModel,l=s.id,u=s.anchors,d=r.graphModel.getNodeEdges(l);nt(d,function(f){if(f.sourceNodeId===l){var c=yi(u,function(h){return h.id===f.sourceAnchorId});c&&f.updateStartPoint({x:c.x,y:c.y})}else if(f.targetNodeId===l){var c=yi(u,function(p){return p.id===f.targetAnchorId});c&&f.updateEndPoint({x:c.x,y:c.y})}})},r.triggerResizeEvent=function(s,l,u,d,f,c){r.graphModel.eventCenter.emit(ve.NODE_RESIZE,{preData:s,data:l,deltaX:u,deltaY:d,index:f,model:c})},r.recalcResizeInfo=function(s,l,u,d,f){u===void 0&&(u=1),d===void 0&&(d=!1),f===void 0&&(f=!1);var c=Ee(l),h=c.deltaX,p=c.deltaY,v=c.width,g=c.height,y=c.PCTResizeInfo;if(y){var m=4,O=0,T=0;switch(s){case at.LEFT_TOP:T=(h*-1-p)/m;break;case at.RIGHT_TOP:T=(h-p)/m;break;case at.RIGHT_BOTTOM:T=(h+p)/m;break;case at.LEFT_BOTTOM:T=(h*-1+p)/m;break}T!==0&&(O=Math.round(T/y.ResizeBasis.basisHeight*1e5)/1e3),y.ResizePCT.widthPCT=Math.max(Math.min(y.ResizePCT.widthPCT+O,y.ScaleLimit.maxScaleLimit),y.ScaleLimit.minScaleLimit),y.ResizePCT.heightPCT=Math.max(Math.min(y.ResizePCT.heightPCT+O,y.ScaleLimit.maxScaleLimit),y.ScaleLimit.minScaleLimit);var C=Math.round(y.ResizePCT.widthPCT*y.ResizeBasis.basisWidth/100),A=Math.round(y.ResizePCT.heightPCT*y.ResizeBasis.basisHeight/100);switch(s){case at.LEFT_TOP:h=v-C,p=g-A;break;case at.RIGHT_TOP:h=C-v,p=g-A;break;case at.RIGHT_BOTTOM:h=C-v,p=A-g;break;case at.LEFT_BOTTOM:h=v-C,p=A-g;break}return c}switch(s){case at.LEFT_TOP:c.width=d?v:v-h*u,c.height=f?g:g-p*u;break;case at.RIGHT_TOP:c.width=d?v:v+h*u,c.height=f?g:g-p*u;break;case at.RIGHT_BOTTOM:c.width=d?v:v+h*u,c.height=f?g:g+p*u;break;case at.LEFT_BOTTOM:c.width=d?v:v-h*u,c.height=f?g:g+p*u;break}return c},r.resizeNode=function(s){var l=s.deltaX,u=s.deltaY,d=r.index,f=r.props,c=f.model,h=f.graphModel,p=f.x,v=f.y;r_({x:p,y:v,deltaX:l,deltaY:u,index:d,nodeModel:c,graphModel:h,forceProportional:r.isShiftPressed,cancelCallback:function(){r.dragHandler.cancelDrag()}})},r.onDragStart=function(){r.graphModel.selectNodeById(r.nodeModel.id)},r.onDragging=function(s){var l=s.deltaX,u=s.deltaY,d=r.graphModel.transformModel,f=E3(d.fixDeltaXY(l,u),2),c=f[0],h=f[1];r.resizeNode({deltaX:c,deltaY:h})},r.onDragEnd=function(){var s=r.nodeModel.x,l=r.nodeModel.y;r.nodeModel.moveTo(s,l),r.updateEdgePointByAnchors()},r.onPointerDown=function(s){s.stopPropagation(),r.dragHandler.handleMouseDown(s)};var i=t.index,o=t.model,a=t.graphModel;return r.index=i,r.nodeModel=o,r.graphModel=a,r.dragHandler=new Qn({onDragStart:r.onDragStart,onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:a.gridSize}),r.bindKeyboardEvents(),r}return e.prototype.componentWillUnmount=function(){this.dragHandler.destroy(),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},e.prototype.getViewPosition=function(t,r,i){var o=this.props.model.getResizeControlStyle(),a=o.width,s=a===void 0?8:a,l=o.height,u=l===void 0?8:l;switch(t){case"nw":return{x:r-s/2,y:i-u/2};case"ne":return{x:r+s/2,y:i-u/2};case"se":return{x:r+s/2,y:i+u/2};case"sw":return{x:r-s/2,y:i+u/2};default:return{x:r,y:i}}},e.prototype.render=function(){var t=this.props,r=t.x,i=t.y,o=t.direction,a=t.model,s=a.getResizeControlStyle(),l=s.width,u=s.height,d=x3(s,["width","height"]),f=this.getViewPosition(o,r,i),c=f.x,h=f.y;return $("g",{className:"lf-resize-control lf-resize-control-".concat(o),children:[$(Lr,Fa({className:"lf-resize-control-content",x:c,y:h,width:l??7,height:u??7},d)),$(Lr,{className:"lf-resize-control-content",x:c,y:h,width:l?l+5:25,height:l?l+5:25,fill:"transparent",stroke:"transparent",onPointerDown:this.onPointerDown})]})},e})(Ye),S3=(function(n){n_(e,n);function e(){return n.call(this)||this}return e.prototype.getResizeControl=function(){var t=this.props,r=t.model,i=t.graphModel,o=Bn(r),a=o.minX,s=o.minY,l=o.maxX,u=o.maxY,d=[{index:at.LEFT_TOP,direction:"nw",x:a,y:s},{index:at.RIGHT_TOP,direction:"ne",x:l,y:s},{index:at.RIGHT_BOTTOM,direction:"se",x:l,y:u},{index:at.LEFT_BOTTOM,direction:"sw",x:a,y:u}];return jn(d,function(f){return $(w3,Fa({},f,{model:r,graphModel:i}))})},e.prototype.getResizeOutline=function(){var t=this.props.model,r=t.x,i=t.y,o=t.width,a=t.height,s=t.getResizeOutlineStyle();return $(Lr,Fa({},s,{"pointer-events":"none",x:r,y:i,width:o+10,height:a+10}))},e.prototype.render=function(){return $("g",{className:"lf-resize-control-group",children:[this.getResizeOutline(),this.getResizeControl()]})},e})(Ye);function O3(n,e){var t=n.x,r=n.y,i=e.x,o=e.y,a={x:t+(i-t)/2,y:r+(o-r)/2};return a}function $a(n,e,t){var r=A3(t),i=n.x-e.x,o=n.y-e.y,a=i*Math.cos(r)-o*Math.sin(r)+e.x,s=i*Math.sin(r)+o*Math.cos(r)+e.y;return{x:a,y:s}}function A3(n){return n*Math.PI/180}function C3(n){return n/Math.PI*180}function T3(n,e,t,r,i,o,a,s){i===void 0&&(i=!1),o===void 0&&(o=!1);var l={x:t.x-(n.x-t.x),y:t.y-(n.y-t.y)},u=O3(l,e),d=$a(e,u,-r),f=$a(l,u,-r);if(i){var c=Math.abs(d.x-f.x),h=c-a;u.x>d.x?u.x=u.x+h/2:u.x=u.x-h/2}if(o){var p=Math.abs(d.y-f.y),v=p-s;u.y>d.y?u.y=u.y+v/2:u.y=u.y-v/2}if(i||o){var g=$a(f,u,r),y=g.x-l.x,m=g.y-l.y;u.x=u.x-y,u.y=u.y-m,f=$a(l,u,-r),d={x:u.x-(f.x-u.x),y:u.y-(f.y-u.y)}}var O=Math.abs(d.x-f.x),T=Math.abs(d.y-f.y);return i&&(O=a),o&&(T=s),{width:O,height:T,center:u}}function M3(n,e,t,r,i,o,a,s,l){s===void 0&&(s=!1),l===void 0&&(l=!1);var u=e.deltaX,d=e.deltaY,f=e.width,c=e.height,h=C3(t),p={x:r,y:i},v={x:o,y:a},g=$a(p,v,h),y={x:g.x+u,y:g.y+d},m=T3(g,y,v,h,s,l,f,c),O=m.width,T=m.height,C=m.center;return e.width=O*n,e.height=T*n,e.deltaX=(C.x-v.x)*2,e.deltaY=(C.y-v.y)*2,e}var N3=function(n,e,t,r,i,o,a,s,l,u,d){t===void 0&&(t=1),r===void 0&&(r=!1),i===void 0&&(i=!1),o===void 0&&(o=0),d===void 0&&(d=!1);var f=Ee(e),c=f.deltaX,h=f.deltaY,p=f.width,v=f.height,g=f.PCTResizeInfo;if(g){var y=4,m=0,O=0;switch(n){case at.LEFT_TOP:O=(c*-1-h)/y;break;case at.RIGHT_TOP:O=(c-h)/y;break;case at.RIGHT_BOTTOM:O=(c+h)/y;break;case at.LEFT_BOTTOM:O=(c*-1+h)/y;break}O!==0&&(m=Math.round(O/g.ResizeBasis.basisHeight*1e5)/1e3),g.ResizePCT.widthPCT=Math.max(Math.min(g.ResizePCT.widthPCT+m,g.ScaleLimit.maxScaleLimit),g.ScaleLimit.minScaleLimit),g.ResizePCT.heightPCT=Math.max(Math.min(g.ResizePCT.heightPCT+m,g.ScaleLimit.maxScaleLimit),g.ScaleLimit.minScaleLimit);var T=Math.round(g.ResizePCT.widthPCT*g.ResizeBasis.basisWidth/100),C=Math.round(g.ResizePCT.heightPCT*g.ResizeBasis.basisHeight/100);switch(n){case at.LEFT_TOP:c=p-T,h=v-C;break;case at.RIGHT_TOP:c=T-p,h=v-C;break;case at.RIGHT_BOTTOM:c=T-p,h=C-v;break;case at.LEFT_BOTTOM:c=p-T,h=C-v;break}return f}if(o%(2*Math.PI)!==0&&a!==void 0&&s!==void 0)return M3(t,f,o,a,s,l,u,r,i);if(d){var A=p/v,E=0,N=p,B=v;switch(n){case at.LEFT_TOP:E=Math.abs(c)>Math.abs(h)?-c:-h,A>=1?(N=p+E,B=N/A):(B=v+E,N=B*A),f.width=N,f.height=B,f.deltaX=p-N,f.deltaY=v-B;break;case at.RIGHT_TOP:E=Math.abs(c)>Math.abs(h)?c:-h,A>=1?(N=p+E,B=N/A):(B=v-E,N=B*A),f.width=N,f.height=B,f.deltaX=N-p,f.deltaY=v-B;break;case at.RIGHT_BOTTOM:E=Math.abs(c)>Math.abs(h)?c:h,A>=1?(N=p+E,B=N/A):(B=v+E,N=B*A),f.width=N,f.height=B,f.deltaX=N-p,f.deltaY=B-v;break;case at.LEFT_BOTTOM:E=Math.abs(c)>Math.abs(h)?-c:h,A>=1?(N=p-E,B=N/A):(B=v+E,N=B*A),f.width=N,f.height=B,f.deltaX=p-N,f.deltaY=B-v;break}return f}switch(n){case at.LEFT_TOP:f.width=r?p:p-c*t,f.height=i?v:v-h*t;break;case at.RIGHT_TOP:f.width=r?p:p+c*t,f.height=i?v:v-h*t;break;case at.RIGHT_BOTTOM:f.width=r?p:p+c*t,f.height=i?v:v+h*t;break;case at.LEFT_BOTTOM:f.width=r?p:p-c*t,f.height=i?v:v+h*t;break}return f},P3=function(n,e){var t=n.id,r=n.anchors,i=e.getNodeEdges(t);nt(i,function(o){if(o.sourceNodeId===t){var a=yi(r,function(s){return s.id===o.sourceAnchorId});a&&o.updateStartPoint({x:a.x,y:a.y})}else if(o.targetNodeId===t){var a=yi(r,function(l){return l.id===o.targetAnchorId});a&&o.updateEndPoint({x:a.x,y:a.y})}})},D3=function(n,e,t,r,i,o,a){a.eventCenter.emit(ve.NODE_RESIZE,{preData:n,data:e,deltaX:t,deltaY:r,index:i,model:o})},r_=function(n){var e=n.x,t=n.y,r=n.deltaX,i=n.deltaY,o=n.index,a=n.nodeModel,s=n.graphModel,l=n.cancelCallback,u=n.forceProportional,d=u===void 0?!1:u,f=a.r,c=a.rx,h=a.ry,p=a.width,v=a.height,g=a.PCTResizeInfo,y=a.minWidth,m=a.minHeight,O=a.maxWidth,T=a.maxHeight,C=a.rotate,A=a.x,E=a.y,N=y===O,B=m===T,Z={width:f||c||p,height:f||h||v,deltaX:r,deltaY:i,PCTResizeInfo:g},ue=f||c&&h?1/2:1,me=e,S=t,D=N3(o,Z,ue,N,B,C,me,S,A,E,d);if(D.width<y||D.width>O||D.height<m||D.height>T){l==null||l();return}(C%(2*Math.PI)==0||g||me===void 0||S===void 0)&&(D.deltaX=N?0:D.deltaX,D.deltaY=B?0:D.deltaY);var L=a.getData(),Y=a.resize(D);L.x===Y.x&&L.y===Y.y||(P3(a,s),D3(L,Y,r,i,o,a,s))},R3=100,L3={x:1,y:0};function I3(n,e,t,r,i){for(var o=function(h){if(h<0||h>1)throw new RangeError('The value range of parameter "t" is [0,1]');return{x:n.x*Math.pow(1-h,3)+3*e.x*h*Math.pow(1-h,2)+3*t.x*Math.pow(h,2)*(1-h)+r.x*Math.pow(h,3),y:n.y*Math.pow(1-h,3)+3*e.y*h*Math.pow(1-h,2)+3*t.y*Math.pow(h,2)*(1-h)+r.y*Math.pow(h,3)}},a=0,s=2,l=r.x,u=r.y,d=r;a<i&&s<50;){d=o(1-s/R3);var f=d.x,c=d.y;a=mr(l,u,f,c),s++}return d}function k3(n,e){return n.x*e.y-n.y*e.x}function j3(n,e){var t=[n.x,n.y,n.z],r=[e.x,e.y,e.z];return r.reduce(function(i,o,a){return i+o*t[a]})}function B3(n,e){var t=k3(n,e),r=Math.acos(j3(i_(n),i_(e)));return t>=0?r:-r}function i_(n){var e=Math.hypot(n.x,n.y);return{x:n.x/e,y:n.y/e,z:0}}function F3(n){return B3(L3,n)}function $3(n){return n*(180/Math.PI)}var o_=function(n,e){var t=Ee(No[e||"default"])||Ee(No.default);return n&&(t=Qr(t,n)),t},H3=function(n,e){if(No[n]){console.warn("theme mode ".concat(n," already exists"));return}No[n]=e,Xi[n]=e.background||Am,Gi[n]=e.grid||If},z3=function(n){delete No[n],delete Xi[n],delete Gi[n]},W3=function(){var n={colorful:{},dark:{},retro:{},default:{}};Je(No,n),Je(Xi,n),Je(Gi,n)},X3=o_,G3=1e3,U3=999,Ha=function(){return++G3},Y3=function(){return--U3},Pt=function(){return Pt=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Pt.apply(this,arguments)},we=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},Yl=(function(){function n(e,t){var r;this.BaseType=Nt.EDGE,this.id="",this.type="",this.sourceNodeId="",this.targetNodeId="",this.textMode=Zn.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},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=it.DEFAULT,this.modelType=We.EDGE,this.customTextPosition=!1,this.style={},this.arrowConfig={markerEnd:"url(#marker-end-".concat(this.id,")"),markerStart:"url(#marker-start-".concat(this.id,")")},this.graphModel=t,this.properties=(r=e.properties)!==null&&r!==void 0?r:{},this.initEdgeData(e),this.setAttributes()}return n.prototype.initEdgeData=function(e){var t=this;if(e.properties||(e.properties={}),!e.id){var r=this.graphModel.idGenerator,i=r&&r(e.type),o=this.createId();e.id=o||i||xi()}this.arrowConfig.markerEnd="url(#marker-end-".concat(e.id,")"),this.arrowConfig.markerStart="url(#marker-start-".concat(e.id,")");var a=this.graphModel.editConfigModel.adjustEdgeStartAndEnd;this.isShowAdjustPoint=a,Je(this,VL(e));var s=this.graphModel,l=s.overlapMode,u=s.eventCenter;this.updateZIndexByOverlap(l,e.zIndex||Ha()),this.setAnchors(),this.initPoints(),this.formatText(e),u.on("overlap:change",function(d){var f=d.overlapMode;t.updateZIndexByOverlap(f,t.zIndex||Ha())})},n.prototype.setAttributes=function(){},n.prototype.createId=function(){return null},n.prototype.getEdgeStyle=function(){return Pt(Pt({},this.graphModel.theme.baseEdge),this.style)},n.prototype.getAdjustPointStyle=function(){return Pt({},this.graphModel.theme.edgeAdjust)},n.prototype.getTextStyle=function(){var e=this.graphModel.theme.edgeText;return Ee(e)},n.prototype.getEdgeAnimationStyle=function(){var e=this.graphModel.theme.edgeAnimation;return Ee(e)},n.prototype.getArrowStyle=function(){var e=this.getEdgeStyle(),t=this.getEdgeAnimationStyle(),r=this.graphModel.theme.arrow,i=this.isAnimation?t.stroke:e.stroke;return Pt(Pt(Pt({},e),{fill:i,stroke:i}),r)},n.prototype.getOutlineStyle=function(){var e=this.graphModel,t=e.theme.edgeOutline,r=Pt({},t);if(this.isHovered){var i=t.hover||{};r=Pt(Pt({},r),i)}return Ee(r)},n.prototype.getTextPosition=function(){return{x:0,y:0}},Object.defineProperty(n.prototype,"sourceNode",{get:function(){var e,t;return(t=(e=this.graphModel)===null||e===void 0?void 0:e.nodesMap[this.sourceNodeId])===null||t===void 0?void 0:t.model},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"targetNode",{get:function(){var e,t;return(t=(e=this.graphModel)===null||e===void 0?void 0:e.nodesMap[this.targetNodeId])===null||t===void 0?void 0:t.model},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"textPosition",{get:function(){return this.getTextPosition()},enumerable:!1,configurable:!0}),n.prototype.getBeginAnchor=function(e,t,r){var i,o,a=Xf(e);if(r){if(i=yi(a,function(s){return s.id===r}),i)return i;console.warn("未在节点上找到指定的起点锚点".concat(r,",已使用默认锚点作为起点"))}return a.forEach(function(s){var l=zm(s,t);(o===void 0||l<o)&&(o=l,i=s)}),i},n.prototype.getEndAnchor=function(e,t){var r=this,i,o,a=Xf(e);if(t){if(i=yi(a,function(s){return s.id===t}),i)return i;console.warn("未在节点上找到指定的终点锚点".concat(t,",已使用默认锚点作为终点"))}return a.forEach(function(s){if(r.startPoint){var l=zm(s,r.startPoint);(o===void 0||l<o)&&(o=l,i=s)}}),i},n.prototype.getProperties=function(){return lr(this.properties)},n.prototype.getData=function(){var e=this.properties;ai(e)&&(e=lr(e));var t={id:this.id,type:this.type,properties:e,sourceNodeId:this.sourceNodeId,targetNodeId:this.targetNodeId,sourceAnchorId:this.sourceAnchorId,targetAnchorId:this.targetAnchorId,startPoint:Je({},this.startPoint),endPoint:Je({},this.endPoint)};[Xt.INCREASE,Xt.STATIC].includes(this.graphModel.overlapMode)&&(t.zIndex=this.zIndex);var r=this.text,i=r.x,o=r.y,a=r.value;return a&&(t.text={x:i,y:o,value:a}),t},n.prototype.getHistoryData=function(){return this.getData()},n.prototype.setProperty=function(e,t){cd(this.properties,e,an(t)),this.setAttributes()},n.prototype.deleteProperty=function(e){delete this.properties[e],this.setAttributes()},n.prototype.setProperties=function(e){this.properties=Pt(Pt({},lr(this.properties)),an(e)),this.setAttributes()},n.prototype.changeEdgeId=function(e){var t=this.arrowConfig,r=t.markerEnd,i=t.markerStart;i&&i==="url(#marker-start-".concat(this.id,")")&&(this.arrowConfig.markerStart="url(#marker-start-".concat(e,")")),r&&r==="url(#marker-end-".concat(this.id,")")&&(this.arrowConfig.markerEnd="url(#marker-end-".concat(e,")")),this.id=e},n.prototype.setStyle=function(e,t){var r;this.style=Pt(Pt({},this.style),(r={},r[e]=an(t),r))},n.prototype.setStyles=function(e){this.style=Pt(Pt({},this.style),an(e))},n.prototype.updateStyles=function(e){this.style=Pt({},an(e))},n.prototype.setTextMode=function(e){this.textMode=e},n.prototype.formatText=function(e){var t,r,i,o=this.graphModel.editConfigModel,a=o.edgeTextDraggable,s=o.edgeTextEdit,l=this.textPosition,u=l.x,d=l.y,f=e.text,c={value:"",x:u,y:d,draggable:a,editable:s};f&&(typeof f=="string"?c=Pt(Pt({},c),{value:f}):(c=Pt(Pt({},c),{x:(t=f.x)!==null&&t!==void 0?t:u,y:(r=f.y)!==null&&r!==void 0?r:d,value:(i=f.value)!==null&&i!==void 0?i:""}),zi(f.draggable)||(c.draggable=f.draggable),zi(f.editable)||(c.editable=f.editable))),this.text=c},n.prototype.resetTextPosition=function(){var e=this.textPosition,t=e.x,r=e.y;this.text.x=t,this.text.y=r},n.prototype.moveText=function(e,t){var r=this.text,i=r.x,o=r.y,a=r.value,s=r.draggable,l=r.editable;this.text={value:a,editable:l,draggable:s,x:i+e,y:o+t}},n.prototype.setText=function(e){e&&Je(this.text,e)},n.prototype.updateText=function(e){this.text=Pt(Pt({},lr(this.text)),{value:e})},n.prototype.setAnchors=function(){if(!this.sourceAnchorId||!this.startPoint){var e=this.getBeginAnchor(this.sourceNode,this.targetNode,this.sourceAnchorId);if(!e)throw new Error("无法获取beginAnchor,请检查anchors相关逻辑,anchors不能为空");this.startPoint||(this.startPoint={x:e.x,y:e.y}),this.sourceAnchorId||(this.sourceAnchorId=e.id)}if(!this.targetAnchorId||!this.endPoint){var e=this.getEndAnchor(this.targetNode,this.targetAnchorId);if(!e)throw new Error("无法获取endAnchor,请检查anchors相关逻辑,anchors不能为空");this.endPoint||(this.endPoint={x:e.x,y:e.y}),this.targetAnchorId||(this.targetAnchorId=e.id)}},n.prototype.setSelected=function(e){e===void 0&&(e=!0),this.isSelected=e},n.prototype.setHovered=function(e){e===void 0&&(e=!0),this.isHovered=e},n.prototype.setHitable=function(e){e===void 0&&(e=!0),this.isHitable=e},n.prototype.setHittable=function(e){e===void 0&&(e=!0),this.isHittable=e},n.prototype.openEdgeAnimation=function(){this.isAnimation=!0},n.prototype.closeEdgeAnimation=function(){this.isAnimation=!1},n.prototype.setElementState=function(e,t){this.state=e,this.additionStateData=t},n.prototype.updateStartPoint=function(e){this.startPoint=e},n.prototype.moveStartPoint=function(e,t){this.startPoint&&(this.startPoint.x+=e,this.startPoint.y+=t)},n.prototype.updateEndPoint=function(e){this.endPoint=e},n.prototype.moveEndPoint=function(e,t){this.endPoint&&(this.endPoint.x+=e,this.endPoint.y+=t)},n.prototype.setZIndex=function(e){e===void 0&&(e=0),this.zIndex=e},n.prototype.initPoints=function(){},n.prototype.updateAttributes=function(e){Je(this,e)},n.prototype.getAdjustStart=function(){return this.startPoint},n.prototype.getAdjustEnd=function(){return this.endPoint},n.prototype.updateAfterAdjustStartAndEnd=function(e){var t=e.startPoint,r=e.endPoint;this.updateStartPoint({x:t.x,y:t.y}),this.updateEndPoint({x:r.x,y:r.y})},n.prototype.updateZIndexByOverlap=function(e,t){switch(e){case Xt.DEFAULT:this.zIndex=0;break;case Xt.EDGE_TOP:this.zIndex=1;break;case Xt.INCREASE:this.zIndex=t;break}},n.BaseType=Nt.EDGE,we([z],n.prototype,"type",void 0),we([z],n.prototype,"sourceNodeId",void 0),we([z],n.prototype,"targetNodeId",void 0),we([z],n.prototype,"startPoint",void 0),we([z],n.prototype,"endPoint",void 0),we([z],n.prototype,"textMode",void 0),we([z],n.prototype,"text",void 0),we([z],n.prototype,"properties",void 0),we([z],n.prototype,"points",void 0),we([z],n.prototype,"pointsList",void 0),we([z],n.prototype,"isSelected",void 0),we([z],n.prototype,"isHovered",void 0),we([z],n.prototype,"isHitable",void 0),we([z],n.prototype,"isHittable",void 0),we([z],n.prototype,"draggable",void 0),we([z],n.prototype,"visible",void 0),we([z],n.prototype,"isAnimation",void 0),we([z],n.prototype,"isShowAdjustPoint",void 0),we([z],n.prototype,"zIndex",void 0),we([z],n.prototype,"state",void 0),we([z],n.prototype,"style",void 0),we([z],n.prototype,"arrowConfig",void 0),we([gt],n.prototype,"sourceNode",null),we([gt],n.prototype,"targetNode",null),we([gt],n.prototype,"textPosition",null),we([H],n.prototype,"setProperty",null),we([H],n.prototype,"deleteProperty",null),we([H],n.prototype,"setProperties",null),we([H],n.prototype,"changeEdgeId",null),we([H],n.prototype,"setStyle",null),we([H],n.prototype,"setStyles",null),we([H],n.prototype,"updateStyles",null),we([H],n.prototype,"setTextMode",null),we([H],n.prototype,"formatText",null),we([H],n.prototype,"resetTextPosition",null),we([H],n.prototype,"moveText",null),we([H],n.prototype,"setText",null),we([H],n.prototype,"updateText",null),we([H],n.prototype,"setAnchors",null),we([H],n.prototype,"setSelected",null),we([H],n.prototype,"setHovered",null),we([H],n.prototype,"setHitable",null),we([H],n.prototype,"setHittable",null),we([H],n.prototype,"openEdgeAnimation",null),we([H],n.prototype,"closeEdgeAnimation",null),we([H],n.prototype,"setElementState",null),we([H],n.prototype,"updateStartPoint",null),we([H],n.prototype,"moveStartPoint",null),we([H],n.prototype,"updateEndPoint",null),we([H],n.prototype,"moveEndPoint",null),we([H],n.prototype,"setZIndex",null),we([H],n.prototype,"initPoints",null),we([H],n.prototype,"updateAttributes",null),we([H],n.prototype,"getAdjustStart",null),we([H],n.prototype,"getAdjustEnd",null),we([H],n.prototype,"updateAfterAdjustStartAndEnd",null),we([H],n.prototype,"updateZIndexByOverlap",null),n})(),V3=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Ui=function(){return Ui=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Ui.apply(this,arguments)},er=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},Jf=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},a_=(function(n){V3(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.modelType=We.BEZIER_EDGE,i.path="",i.initEdgeData(t),i.setAttributes(),i}return e.prototype.initEdgeData=function(t){this.offset=ci(t,"properties.offset",100),n.prototype.initEdgeData.call(this,t)},e.prototype.getEdgeStyle=function(){var t=this.graphModel.theme.bezier,r=n.prototype.getEdgeStyle.call(this),i=this.properties.style,o=i===void 0?{}:i;return Ui(Ui(Ui({},r),Ee(t)),Ee(o))},e.prototype.getTextPosition=function(){if(this.pointsList&&this.pointsList.length>0){var t=0,r=0;return this.pointsList.forEach(function(i){var o=i.x,a=i.y;t+=o,r+=a}),{x:t/this.pointsList.length,y:r/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 t=n.prototype.getData.call(this),r=this.pointsList.map(function(i){var o=i.x,a=i.y;return{x:o,y:a}});return Ui(Ui({},t),{pointsList:r})},e.prototype.getControls=function(){var t=this.startPoint,r=this.endPoint,i=Fm({start:t,end:r,sourceNode:this.sourceNode,targetNode:this.targetNode,offset:this.offset});return i},e.prototype.getPath=function(t){var r=Jf(t,4),i=r[0],o=r[1],a=r[2],s=r[3];return"M ".concat(i.x," ").concat(i.y,`
|
|
81
|
+
C `).concat(o.x," ").concat(o.y,`,
|
|
82
|
+
`).concat(a.x," ").concat(a.y,`,
|
|
83
|
+
`).concat(s.x," ").concat(s.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(),r=t.sNext,i=t.ePre;this.updatePath(r,i)},e.prototype.updatePath=function(t,r){t=Ee(t),r=Ee(r);var i={x:this.startPoint.x,y:this.startPoint.y},o={x:this.endPoint.x,y:this.endPoint.y};if(!t||!r){var a=this.getControls();t=a.sNext,r=a.ePre}this.pointsList=[i,t,r,o],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,r){this.startPoint.x+=t,this.startPoint.y+=r;var i=Jf(this.pointsList,3),o=i[1],a=i[2];o.x+=t,o.y+=r,this.updatePath(o,a)},e.prototype.moveEndPoint=function(t,r){this.endPoint.x+=t,this.endPoint.y+=r;var i=Jf(this.pointsList,3),o=i[1],a=i[2];a.x+=t,a.y+=r,this.updatePath(o,a)},e.prototype.updateAdjustAnchor=function(t,r){var i;r==="sNext"?this.pointsList[1]=t:r==="ePre"&&(this.pointsList[2]=t),this.path=this.getPath(this.pointsList),!((i=this.text)===null||i===void 0)&&i.value&&this.setText(Je({},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 r=t.startPoint,i=t.endPoint,o=t.sourceNode,a=t.targetNode,s=Fm({start:r,end:i,sourceNode:o,targetNode:a,offset:this.offset}),l=s.sNext,u=s.ePre;this.pointsList=[r,l,u,i],this.initPoints()},er([z],e.prototype,"offset",void 0),er([z],e.prototype,"path",void 0),er([H],e.prototype,"initPoints",null),er([H],e.prototype,"updatePoints",null),er([H],e.prototype,"updateStartPoint",null),er([H],e.prototype,"updateEndPoint",null),er([H],e.prototype,"moveStartPoint",null),er([H],e.prototype,"moveEndPoint",null),er([H],e.prototype,"updateAdjustAnchor",null),er([H],e.prototype,"getAdjustStart",null),er([H],e.prototype,"getAdjustEnd",null),er([H],e.prototype,"updateAfterAdjustStartAndEnd",null),e})(Yl),K3=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),za=function(){return za=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},za.apply(this,arguments)},s_=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},q3=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))},l_=(function(n){K3(e,n);function e(){var t=n.apply(this,q3([],s_(arguments),!1))||this;return t.modelType=We.LINE_EDGE,t}return e.prototype.getEdgeStyle=function(){var t=this.graphModel.theme.line,r=n.prototype.getEdgeStyle.call(this),i=this.properties.style,o=i===void 0?{}:i;return za(za(za({},r),Ee(t)),Ee(o))},e.prototype.initEdgeData=function(t){n.prototype.initEdgeData.call(this,t),this.points=this.getPath([this.startPoint,this.endPoint])},e.prototype.getPath=function(t){var r=s_(t,2),i=r[0],o=r[1];return"".concat(i.x,",").concat(i.y," ").concat(o.x,",").concat(o.y)},e.prototype.getTextPosition=function(){return{x:(this.startPoint.x+this.endPoint.x)/2,y:(this.startPoint.y+this.endPoint.y)/2}},e})(Yl),Z3=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Wa=function(){return Wa=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Wa.apply(this,arguments)},Qt=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},u_=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},Q3=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))},Xa=(function(n){Z3(e,n);function e(){var t=n.apply(this,Q3([],u_(arguments),!1))||this;return t.modelType=We.POLYLINE_EDGE,t.draggingPointList=[],t}return e.prototype.initEdgeData=function(t){var r=ci(t,"properties.offset");if(this.offset=typeof r=="number"?r:this.getDefaultOffset(),t.pointsList){var i=this.orthogonalizePath(t.pointsList);t.pointsList=i,this.pointsList=i}n.prototype.initEdgeData.call(this,t)},e.prototype.setAttributes=function(){var t=this.properties.offset;t&&t!==this.offset&&(this.offset=t,this.updatePoints())},e.prototype.orthogonalizePath=function(t){if(!Array.isArray(t)||t.length<2)return t;var r=function(T,C){var A=T[T.length-1];(!A||A.x!==C.x||A.y!==C.y)&&T.push({x:C.x,y:C.y})},i=function(T,C){return T.x===C.x||T.y===C.y},o=function(T,C){return Math.abs(T.x-C.x)+Math.abs(T.y-C.y)},a=[];r(a,t[0]);for(var s,l=0;l<t.length-1;l++){var u=a[a.length-1],d=t[l+1];if(!(!u||!d)){if(i(u,d)){r(a,d),s=u.x===d.x?ct.VERTICAL:ct.HORIZONTAL;continue}var f={x:d.x,y:u.y},c={x:u.x,y:d.y},h=s===ct.VERTICAL?c:s===ct.HORIZONTAL||o(u,f)<=o(u,c)?f:c;(h.x!==u.x||h.y!==u.y)&&r(a,h),r(a,d);var p=a[a.length-2],v=a[a.length-1];s=p&&v?p.x===v.x?ct.VERTICAL:ct.HORIZONTAL:s}}for(var g=[],l=0;l<a.length;l++){var y=a[l-1],m=a[l],d=a[l+1];y&&m&&d&&(y.x===m.x&&m.x===d.x||y.y===m.y&&m.y===d.y)||r(g,m)}g.length>=2&&(g[0]={x:t[0].x,y:t[0].y},g[g.length-1]={x:t[t.length-1].x,y:t[t.length-1].y});var O=g.length<2||g.every(function(T,C,A){return C===0?!0:i(A[C-1],A[C])});return O?g:[{x:t[0].x,y:t[0].y},{x:t[t.length-1].x,y:t[t.length-1].y}]},e.prototype.getDefaultOffset=function(){var t=this.getArrowStyle(),r=typeof t.offset=="number"?t.offset:0;return r+5},e.prototype.getEdgeStyle=function(){var t=this.graphModel.theme.polyline,r=n.prototype.getEdgeStyle.call(this),i=this.properties.style,o=i===void 0?{}:i;return Wa(Wa(Wa({},r),Ee(t)),Ee(o))},e.prototype.getTextPosition=function(){var t,r=(t=this.text)===null||t===void 0?void 0:t.value;if(this.dbClickPosition&&!r){var i=this.dbClickPosition,o=i.x,a=i.y;return{x:o,y:a}}var s=bi(this.points),l=u_(GL(s),2),u=l[0],d=l[1];return{x:(u.x+d.x)/2,y:(u.y+d.y)/2}},e.prototype.getAfterAnchor=function(t,r,i){var o,a;return i.forEach(function(s){var l;t===ct.HORIZONTAL?l=Math.abs(r.y-s.y):t===ct.VERTICAL&&(l=Math.abs(r.x-s.x)),(!a||a>l)&&(a=l,o=s)}),o},e.prototype.getCrossPoint=function(t,r,i){var o;return t===ct.HORIZONTAL?o={x:i.x,y:r.y}:t===ct.VERTICAL&&(o={x:r.x,y:i.y}),o},e.prototype.removeCrossPoints=function(t,r,i){var o=i.map(function(y){return y});if(t===1){var a=o[t],s=o[r],l=o[t-1],u=Lm(l,a,this.sourceNode);if(u){var d=Im(a,s,this.sourceNode);if(d){var f=km(a,s,this.sourceNode);f&&(o[t]=f,o.splice(t-1,1),t--,r--)}}else{var c=this.sourceNode.anchors;c.forEach(function(y){if(y.x===l.x&&y.x===a.x||y.y===l.y&&y.y===a.y){var m=mr(y.x,y.y,a.x,a.y),O=mr(l.x,l.y,a.x,a.y);m<O&&(o[t-1]=y)}})}}if(r===i.length-2){var h=o[t],p=o[r],v=o[r+1],g=Lm(p,v,this.targetNode);if(g){var d=Im(h,p,this.targetNode);if(d){var f=km(h,p,this.targetNode);f&&(o[r]=f,o.splice(r+1,1))}}else{var c=this.targetNode.anchors;c.forEach(function(m){if(m.x===v.x&&m.x===p.x||m.y===v.y&&m.y===p.y){var O=mr(m.x,m.y,p.x,p.y),T=mr(v.x,v.y,p.x,p.y);O<T&&(o[r+1]=m)}})}}return o},e.prototype.getDraggingPoints=function(t,r,i,o,a){var s=a.map(function(d){return d}),l=this.getAfterAnchor(t,i,o),u=this.getCrossPoint(t,i,l);return r==="start"?(s.unshift(u),s.unshift(l)):(s.push(u),s.push(l)),s},e.prototype.updateCrossPoints=function(t){var r=t.map(function(m){return m}),i=t[0],o=t[1],a=t[r.length-2],s=t[r.length-1],l=this,u=l.sourceNode,d=l.targetNode,f=u.modelType,c=d.modelType,h=Il(i,o),p=r[0];switch(f){case We.RECT_NODE:if(u.radius!==0){var v=Vm(i,u);v||(p=Ym(i,h,u))}break;case We.CIRCLE_NODE:p=Gf(i,h,u);break;case We.ELLIPSE_NODE:p=Km(i,h,u);break;case We.DIAMOND_NODE:p=zl(i,h,u);break;case We.POLYGON_NODE:p=zl(i,h,u);break}p&&(r[0]=p);var g=Il(a,s),y=r[r.length-1];switch(c){case We.RECT_NODE:if(d.radius!==0){var v=Vm(s,d);v||(y=Ym(s,g,d))}break;case We.CIRCLE_NODE:y=Gf(s,g,d);break;case We.ELLIPSE_NODE:y=Km(s,g,d);break;case We.DIAMOND_NODE:y=zl(s,g,d);break;case We.POLYGON_NODE:y=zl(s,g,d);break}return y&&(r[r.length-1]=y),r},e.prototype.updatePath=function(t){this.pointsList=this.orthogonalizePath(t),this.points=this.getPath(this.pointsList)},e.prototype.getData=function(){var t=n.prototype.getData.call(this),r=this.pointsList.map(function(i){var o=i.x,a=i.y;return{x:o,y:a}});return Object.assign({},t,{pointsList:r})},e.prototype.getPath=function(t){return t.map(function(r){return"".concat(r.x,",").concat(r.y)}).join(" ")},e.prototype.initPoints=function(){this.pointsList.length>0?this.points=this.getPath(this.pointsList):this.updatePoints()},e.prototype.updatePoints=function(){var t=Rm({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=this.orthogonalizePath(t),this.points=this.pointsList.map(function(r){return"".concat(r.x,",").concat(r.y)}).join(" ")},e.prototype.updateStartPoint=function(t){this.startPoint=Object.assign({},t),this.updatePoints()},e.prototype.moveStartPoint=function(t,r){this.startPoint.x+=t,this.startPoint.y+=r,this.updatePoints()},e.prototype.updateEndPoint=function(t){this.endPoint=Object.assign({},t),this.updatePoints()},e.prototype.moveEndPoint=function(t,r){this.endPoint.x+=t,this.endPoint.y+=r,this.updatePoints()},e.prototype.updatePointsList=function(t,r){this.pointsList.forEach(function(a){a.x+=t,a.y+=r});var i=this.pointsList[0];this.startPoint=Object.assign({},i);var o=this.pointsList[this.pointsList.length-1];this.endPoint=Object.assign({},o),this.initPoints()},e.prototype.dragAppendStart=function(){this.draggingPointList=this.pointsList.map(function(t){return t})},e.prototype.dragAppendSimple=function(t,r){var i;this.isDragging=!0;var o=t.start,a=t.end,s=t.startIndex,l=t.endIndex,u=t.direction,d=this.pointsList,f=d;return u===ct.HORIZONTAL?(d[s]={x:o.x,y:o.y+r.y},d[l]={x:a.x,y:a.y+r.y},f=this.pointsList.map(function(c){return c})):u===ct.VERTICAL&&(d[s]={x:o.x+r.x,y:o.y},d[l]={x:a.x+r.x,y:a.y},f=this.pointsList.map(function(c){return c})),this.updatePointsAfterDrag(f),this.draggingPointList=f,!((i=this.text)===null||i===void 0)&&i.value&&this.setText(Je({},this.text,this.textPosition)),{start:Je({},d[s]),end:Je({},d[l]),startIndex:s,endIndex:l,direction:u}},e.prototype.dragAppend=function(t,r){var i;this.isDragging=!0;var o=t.start,a=t.end,s=t.startIndex,l=t.endIndex,u=t.direction,d=this.pointsList;if(u===ct.HORIZONTAL){d[s]={x:o.x,y:o.y+r.y},d[l]={x:a.x,y:a.y+r.y};var f=this.pointsList.map(function(g){return g});if(s!==0&&l!==this.pointsList.length-1&&(f=this.removeCrossPoints(s,l,f)),s===0){var c={x:o.x,y:o.y+r.y},h=Jr(c,this.sourceNode);if(!h){var p=this.sourceNode.anchors;f=this.getDraggingPoints(u,"start",c,p,f)}}if(l===this.pointsList.length-1){var v={x:a.x,y:a.y+r.y},h=Jr(v,this.targetNode);if(!h){var p=this.targetNode.anchors;f=this.getDraggingPoints(u,"end",v,p,f)}}this.updatePointsAfterDrag(f),this.draggingPointList=f}else if(u===ct.VERTICAL){d[s]={x:o.x+r.x,y:o.y},d[l]={x:a.x+r.x,y:a.y};var f=this.pointsList.map(function(y){return y});if(s!==0&&l!==this.pointsList.length-1&&(f=this.removeCrossPoints(s,l,f)),s===0){var c={x:o.x+r.x,y:o.y},h=Jr(c,this.sourceNode);if(!h){var p=this.sourceNode.anchors;f=this.getDraggingPoints(u,"start",c,p,f)}}if(l===this.pointsList.length-1){var v={x:a.x+r.x,y:a.y},h=Jr(v,this.targetNode);if(!h){var p=this.targetNode.anchors;f=this.getDraggingPoints(u,"end",v,p,f)}}this.updatePointsAfterDrag(f),this.draggingPointList=f}return!((i=this.text)===null||i===void 0)&&i.value&&this.setText(Je({},this.text,this.textPosition)),{start:Je({},d[s]),end:Je({},d[l]),startIndex:s,endIndex:l,direction:u}},e.prototype.dragAppendEnd=function(){if(this.draggingPointList){var t=Dm(bi(this.points));this.pointsList=t.map(function(o){return o}),this.draggingPointList=[];var r=t[0];this.startPoint=Je({},r);var i=t[t.length-1];this.endPoint=Je({},i)}this.isDragging=!1},e.prototype.updatePointsAfterDrag=function(t){var r=this.updateCrossPoints(t);this.points=r.map(function(i){return"".concat(i.x,",").concat(i.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 r=t.startPoint,i=t.endPoint,o=t.sourceNode,a=t.targetNode;this.pointsList=this.orthogonalizePath(Rm({x:r.x,y:r.y},{x:i.x,y:i.y},o,a,this.offset||0)),this.initPoints()},Qt([z],e.prototype,"offset",void 0),Qt([z],e.prototype,"dbClickPosition",void 0),Qt([H],e.prototype,"initPoints",null),Qt([H],e.prototype,"updatePoints",null),Qt([H],e.prototype,"updateStartPoint",null),Qt([H],e.prototype,"moveStartPoint",null),Qt([H],e.prototype,"updateEndPoint",null),Qt([H],e.prototype,"moveEndPoint",null),Qt([H],e.prototype,"updatePointsList",null),Qt([H],e.prototype,"dragAppendStart",null),Qt([H],e.prototype,"dragAppendSimple",null),Qt([H],e.prototype,"dragAppend",null),Qt([H],e.prototype,"dragAppendEnd",null),Qt([H],e.prototype,"updatePointsAfterDrag",null),Qt([H],e.prototype,"getAdjustStart",null),Qt([H],e.prototype,"getAdjustEnd",null),Qt([H],e.prototype,"updateAfterAdjustStartAndEnd",null),e})(Yl),It=function(){return It=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},It.apply(this,arguments)},Ne=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},d_=function(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},J3=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},Ei=(function(){function n(e,t){var r;this.BaseType=Nt.NODE,this.id="",this.type="",this.x=0,this.y=0,this.textMode=Zn.TEXT,this.text={value:"",x:0,y:0,draggable:!1,editable:!0},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.rotatable=!0,this.resizable=!0,this.zIndex=1,this.state=it.DEFAULT,this.autoToFront=!0,this.style={},this._rotate=0,this.modelType=We.NODE,this.additionStateData={},this.targetRules=[],this.sourceRules=[],this.moveRules=[],this.resizeRules=[],this.hasSetTargetRules=!1,this.hasSetSourceRules=!1,this.graphModel=t,this.properties=(r=e.properties)!==null&&r!==void 0?r:{},this.initNodeData(e),this.setAttributes()}return Object.defineProperty(n.prototype,"width",{get:function(){return this._width},set:function(e){this._width=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this._height},set:function(e){this._height=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rotate",{get:function(){return this._rotate},set:function(e){this._rotate=e;var t=this,r=t.x,i=r===void 0?0:r,o=t.y,a=o===void 0?0:o;this.transform=new Fl(-i,-a).rotate(e).translate(i,a).toString()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"incoming",{get:function(){return{nodes:this.graphModel.getNodeIncomingNode(this.id),edges:this.graphModel.getNodeIncomingEdge(this.id)}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"outgoing",{get:function(){return{nodes:this.graphModel.getNodeOutgoingNode(this.id),edges:this.graphModel.getNodeOutgoingEdge(this.id)}},enumerable:!1,configurable:!0}),n.prototype.initNodeData=function(e){var t=this;if(e.properties||(e.properties={}),!e.id){var r=this.graphModel.idGenerator,i=r&&r(e.type),o=this.createId();e.id=o||i||xi()}this.formatText(e),Je(this,o3(e));var a=this.graphModel,s=a.overlapMode,l=a.eventCenter;this.updateZIndexByOverlap(s,e.zIndex||Ha()),l.on("overlap:change",function(u){var d=u.overlapMode;t.updateZIndexByOverlap(d,t.zIndex||Ha())})},n.prototype.setAttributes=function(){},n.prototype.createId=function(){return null},n.prototype.setTextMode=function(e){this.textMode=e},n.prototype.formatText=function(e){var t,r,i,o=this.graphModel.editConfigModel,a=o.nodeTextDraggable,s=o.nodeTextEdit,l=e.x,u=e.y,d=e.text,f={value:"",x:l,y:u,draggable:a,editable:s};d&&(typeof d=="string"?f.value=d:(f=It(It({},f),{x:(t=d.x)!==null&&t!==void 0?t:l,y:(r=d.y)!==null&&r!==void 0?r:u,value:(i=d.value)!==null&&i!==void 0?i:""}),zi(d.draggable)||(f.draggable=d.draggable),zi(d.editable)||(f.editable=d.editable))),e.text=f},n.prototype.resize=function(e){var t=e.width,r=e.height,i=e.deltaX,o=e.deltaY,a=this.isAllowResizeNode(i,o,t,r);return a?(this.move(i/2,o/2),this.width=t,this.height=r,this.setProperties({width:t,height:r}),this.getData()):this.getData()},n.prototype.proportionalResize=function(){},n.prototype.getData=function(){var e=this.text,t=e.x,r=e.y,i=e.value,o=this.properties;ai(o)&&(o=lr(o)),Kt(o.width)&&(o.width=this.width),Kt(o.height)&&(o.height=this.height);var a={id:this.id,type:this.type,x:this.x,y:this.y,properties:o};return this.rotate&&(a.rotate=this.rotate),[Xt.INCREASE,Xt.STATIC].includes(this.graphModel.overlapMode)&&(a.zIndex=this.zIndex),i&&(a.text={x:t,y:r,value:i}),a},n.prototype.getHistoryData=function(){return this.getData()},n.prototype.getProperties=function(){return lr(this.properties)},n.prototype.getOuterGAttributes=function(){return{className:""}},n.prototype.getNodeStyle=function(){return It(It({},this.graphModel.theme.baseNode),this.style)},n.prototype.getTextStyle=function(){var e=this.graphModel.theme.nodeText,t=this.properties.textStyle,r=t===void 0?{}:t;return It(It({},Ee(e)),Ee(r))},n.prototype.getRotateControlStyle=function(){var e=this.graphModel.theme.rotateControl;return Ee(e)},n.prototype.getResizeControlStyle=function(){var e=this.graphModel.theme.resizeControl;return Ee(e)},n.prototype.getResizeOutlineStyle=function(){var e=this.graphModel.theme.resizeOutline,t=It({},e);if(this.isHovered){var r=e.hover||{};t=It(It({},t),r)}return Ee(t)},n.prototype.getAnchorStyle=function(e){var t=this.graphModel.theme.anchor;return Ee(t)},n.prototype.getAnchorLineStyle=function(e){var t=this.graphModel.theme.anchorLine;return Ee(t)},n.prototype.getOutlineStyle=function(){var e=this.graphModel.theme.outline;return Ee(e)},n.prototype.isAllowConnectedAsSource=function(e,t,r,i){var o=this.hasSetSourceRules?this.sourceRules:this.getConnectedSourceRules();this.hasSetSourceRules=!0;for(var a=!0,s="",l=0;l<o.length;l++){var u=o[l];if(!u.validate.call(this,this,e,t,r,i)){a=!1,s=u.message;break}}return{isAllPass:a,msg:s}},n.prototype.getConnectedSourceRules=function(){return this.sourceRules},n.prototype.isAllowConnectedAsTarget=function(e,t,r,i){var o=this.hasSetTargetRules?this.targetRules:this.getConnectedTargetRules();this.hasSetTargetRules=!0;for(var a=!0,s="",l=0;l<o.length;l++){var u=o[l];if(!u.validate.call(this,e,this,t,r,i)){a=!1,s=u.message;break}}return{isAllPass:a,msg:s}},n.prototype.isAllowMoveNode=function(e,t){var r,i,o=!0,a=!0,s=this.moveRules.concat(this.graphModel.nodeMoveRules);try{for(var l=d_(s),u=l.next();!u.done;u=l.next()){var d=u.value,f=d(this,e,t);if(!f)return!1;if(typeof f=="object"){var c=f;if(!c.x&&!c.y)return!1;o=o&&c.x,a=a&&c.y}}}catch(h){r={error:h}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return{x:o,y:a}},n.prototype.getConnectedTargetRules=function(){return this.targetRules},n.prototype.getAnchorsByOffset=function(){var e=this,t=e.anchorsOffset,r=e.id,i=e.x,o=e.y;return t&&t.length>0?t.map(function(a,s){return a.length?(a=a,{id:"".concat(r,"_").concat(s),x:i+a[0],y:o+a[1]}):(a=a,It(It({},a),{x:i+a.x,y:o+a.y,id:a.id||"".concat(r,"_").concat(s)}))}):this.getDefaultAnchor()},n.prototype.getDefaultAnchor=function(){return[]},n.prototype.getTargetAnchor=function(e){var t,r=this.graphModel.customTargetAnchor;return(t=r==null?void 0:r(this,e))!==null&&t!==void 0?t:n3(e,this)},n.prototype.getBounds=function(){return{minX:this.x-this.width/2,minY:this.y-this.height/2,maxX:this.x+this.width/2,maxY:this.y+this.height/2}},Object.defineProperty(n.prototype,"anchors",{get:function(){var e=this.getAnchorsByOffset(),t=this,r=t.x,i=t.y,o=t.rotate;return e.forEach(function(a){var s=a.x,l=a.y,u=J3(new Ia([s,l,1]).translate(-r,-i).rotate(o).translate(r,i)[0],2),d=u[0],f=u[1];a.x=d,a.y=f}),e},enumerable:!1,configurable:!0}),n.prototype.getAnchorInfo=function(e){if(!Kt(e))for(var t=0;t<this.anchors.length;t++){var r=this.anchors[t];if(r.id===e)return r}},n.prototype.addNodeMoveRules=function(e){this.moveRules.includes(e)||this.moveRules.push(e)},n.prototype.isAllowMoveByXORY=function(e,t,r){var i,o;if(r)i=!0,o=!0;else{var a=this.isAllowMoveNode(e,t);typeof a=="boolean"?(i=a,o=a):(i=a.x,o=a.y)}return{isAllowMoveX:i,isAllowMoveY:o}},n.prototype.move=function(e,t,r){r===void 0&&(r=!1);var i=this.isAllowMoveByXORY(e,t,r),o=i.isAllowMoveX,a=i.isAllowMoveY;return o&&(this.x=this.x+e,this.text&&this.moveText(e,0)),a&&(this.y=this.y+t,this.text&&this.moveText(0,t)),(o||a)&&(this.rotate=this._rotate),o||a},n.prototype.getMoveDistance=function(e,t,r){r===void 0&&(r=!1);var i=this.isAllowMoveByXORY(e,t,r),o=i.isAllowMoveX,a=i.isAllowMoveY,s=0,l=0;return o&&e&&(this.x=this.x+e,this.text&&this.moveText(e,0),s=e),a&&t&&(this.y=this.y+t,this.text&&this.moveText(0,t),l=t),this.transform=new Fl(-this.x,-this.y).rotate(this.rotate).translate(this.x,this.y).toString(),[s,l]},n.prototype.moveTo=function(e,t,r){r===void 0&&(r=!1);var i=e-this.x,o=t-this.y;return!r&&!this.isAllowMoveNode(i,o)?!1:(this.text&&this.moveText(i,o),this.x=e,this.y=t,!0)},n.prototype.moveText=function(e,t){var r=this.text,i=r.x,o=r.y,a=r.value,s=r.draggable,l=r.editable;this.text={value:a,editable:l,draggable:s,x:i+e,y:o+t}},n.prototype.updateText=function(e){this.text=It(It({},lr(this.text)),{value:e})},n.prototype.addNodeResizeRules=function(e){this.resizeRules.includes(e)||this.resizeRules.push(e)},n.prototype.isAllowResizeNode=function(e,t,r,i){var o,a,s=this.resizeRules.concat(this.graphModel.nodeResizeRules);try{for(var l=d_(s),u=l.next();!u.done;u=l.next()){var d=u.value,f=d(this,e,t,r,i);if(!f)return!1}}catch(c){o={error:c}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.error}}return!0},n.prototype.setSelected=function(e){e===void 0&&(e=!0),this.isSelected=e},n.prototype.setHovered=function(e){e===void 0&&(e=!0),this.isHovered=e,this.setIsShowAnchor(e)},n.prototype.setIsShowAnchor=function(e){e===void 0&&(e=!0),this.isShowAnchor=e},n.prototype.setRotatable=function(e){e===void 0&&(e=!0),this.rotatable=e},n.prototype.setResizable=function(e){e===void 0&&(e=!0),this.resizable=e},n.prototype.setHitable=function(e){e===void 0&&(e=!0),this.isHitable=e},n.prototype.setHittable=function(e){e===void 0&&(e=!0),this.isHittable=e},n.prototype.setElementState=function(e,t){this.state=e,this.additionStateData=t},n.prototype.updateProperties=function(e,t){var r=lr(this.properties);this.properties=e,this.setAttributes(),this.graphModel.eventCenter.emit(ve.NODE_PROPERTIES_CHANGE,{id:this.id,keys:t,preProperties:r,properties:e})},n.prototype.setProperty=function(e,t){var r=lr(this.properties),i=Ee(r);om(i,e,an(t)),this.updateProperties(i,[e])},n.prototype.setProperties=function(e){var t=lr(this.properties),r=It(It({},t),an(e)),i=[];jy(e,function(o,a){(yl(t,a)&&t[a]!==o||!yl(t,a))&&i.push(a)}),this.updateProperties(r,i)},n.prototype.deleteProperty=function(e){delete this.properties[e],this.setAttributes()},n.prototype.setStyle=function(e,t){var r;this.style=It(It({},this.style),(r={},r[e]=an(t),r))},n.prototype.setStyles=function(e){this.style=It(It({},this.style),an(e))},n.prototype.updateStyles=function(e){this.style=It({},an(e))},n.prototype.setZIndex=function(e){e===void 0&&(e=1),this.zIndex=e},n.prototype.updateAttributes=function(e){Je(this,e)},n.prototype.updateZIndexByOverlap=function(e,t){switch(e){case Xt.DEFAULT:this.zIndex=1;break;case Xt.EDGE_TOP:this.zIndex=0;break;case Xt.INCREASE:this.zIndex=t;break}},n.BaseType=Nt.NODE,Ne([z],n.prototype,"type",void 0),Ne([z],n.prototype,"x",void 0),Ne([z],n.prototype,"y",void 0),Ne([z],n.prototype,"textMode",void 0),Ne([z],n.prototype,"text",void 0),Ne([z],n.prototype,"properties",void 0),Ne([z],n.prototype,"_width",void 0),Ne([z],n.prototype,"_height",void 0),Ne([z],n.prototype,"anchorsOffset",void 0),Ne([z],n.prototype,"isSelected",void 0),Ne([z],n.prototype,"isHovered",void 0),Ne([z],n.prototype,"isShowAnchor",void 0),Ne([z],n.prototype,"isDragging",void 0),Ne([z],n.prototype,"isHitable",void 0),Ne([z],n.prototype,"isHittable",void 0),Ne([z],n.prototype,"draggable",void 0),Ne([z],n.prototype,"visible",void 0),Ne([z],n.prototype,"rotatable",void 0),Ne([z],n.prototype,"resizable",void 0),Ne([z],n.prototype,"zIndex",void 0),Ne([z],n.prototype,"state",void 0),Ne([z],n.prototype,"autoToFront",void 0),Ne([z],n.prototype,"style",void 0),Ne([z],n.prototype,"transform",void 0),Ne([z],n.prototype,"_rotate",void 0),Ne([gt],n.prototype,"incoming",null),Ne([gt],n.prototype,"outgoing",null),Ne([H],n.prototype,"setTextMode",null),Ne([H],n.prototype,"addNodeMoveRules",null),Ne([H],n.prototype,"move",null),Ne([H],n.prototype,"getMoveDistance",null),Ne([H],n.prototype,"moveTo",null),Ne([H],n.prototype,"moveText",null),Ne([H],n.prototype,"updateText",null),Ne([H],n.prototype,"addNodeResizeRules",null),Ne([H],n.prototype,"setSelected",null),Ne([H],n.prototype,"setHovered",null),Ne([H],n.prototype,"setIsShowAnchor",null),Ne([H],n.prototype,"setRotatable",null),Ne([H],n.prototype,"setResizable",null),Ne([H],n.prototype,"setHitable",null),Ne([H],n.prototype,"setHittable",null),Ne([H],n.prototype,"setElementState",null),Ne([H],n.prototype,"setProperty",null),Ne([H],n.prototype,"setProperties",null),Ne([H],n.prototype,"deleteProperty",null),Ne([H],n.prototype,"setStyle",null),Ne([H],n.prototype,"setStyles",null),Ne([H],n.prototype,"updateStyles",null),Ne([H],n.prototype,"setZIndex",null),Ne([H],n.prototype,"updateAttributes",null),Ne([H],n.prototype,"updateZIndexByOverlap",null),n})(),eI=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Ga=function(){return Ga=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Ga.apply(this,arguments)},ec=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},Vl=(function(n){eI(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.modelType=We.CIRCLE_NODE,i.r=50,i.initNodeData(t),i.setAttributes(),i}return Object.defineProperty(e.prototype,"width",{get:function(){return this.r*2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.r*2},enumerable:!1,configurable:!0}),e.prototype.setAttributes=function(){n.prototype.setAttributes.call(this);var t=this.properties.r;t&&(this.r=t)},e.prototype.getNodeStyle=function(){var t=n.prototype.getNodeStyle.call(this),r=this.graphModel.theme.circle,i=this.properties.style,o=i===void 0?{}:i;return Ga(Ga(Ga({},t),Ee(r)),Ee(o))},e.prototype.getDefaultAnchor=function(){var t=this,r=t.x,i=t.y,o=t.r;return[{x:r,y:i-o,id:"".concat(this.id,"_0")},{x:r+o,y:i,id:"".concat(this.id,"_1")},{x:r,y:i+o,id:"".concat(this.id,"_2")},{x:r-o,y:i,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(t){var r=t.width,i=t.deltaX,o=t.deltaY;return this.move(i/2,o/2),this.r=r,this.setProperties({r}),this.getData()},ec([z],e.prototype,"r",void 0),ec([gt],e.prototype,"width",null),ec([gt],e.prototype,"height",null),e})(Ei),tI=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Ua=function(){return Ua=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Ua.apply(this,arguments)},jo=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},Kl=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},tc=(function(n){tI(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.modelType=We.DIAMOND_NODE,i.rx=30,i.ry=50,i.initNodeData(t),i.setAttributes(),i}return e.prototype.setAttributes=function(){n.prototype.setAttributes.call(this);var t=this.properties,r=t.rx,i=t.ry;r&&(this.rx=r),i&&(this.ry=i)},e.prototype.getNodeStyle=function(){var t=n.prototype.getNodeStyle.call(this),r=this.graphModel.theme.diamond,i=this.properties.style,o=i===void 0?{}:i;return Ua(Ua(Ua({},t),Ee(r)),Ee(o))},Object.defineProperty(e.prototype,"points",{get:function(){var t=this,r=t.x,i=t.y,o=t.rx,a=t.ry;return[[r,i-a],[r+o,i],[r,i+a],[r-o,i]]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pointsPosition",{get:function(){return jn(this.points,function(t){var r=Kl(t,2),i=r[0],o=r[1];return{x:i,y:o}})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var t=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;return nt(this.points,function(i){var o=Kl(i,1),a=o[0];a<t&&(t=a),a>r&&(r=a)}),r-t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var t=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;return nt(this.points,function(i){var o=Kl(i,2),a=o[1];a<t&&(t=a),a>r&&(r=a)}),r-t},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var t=this;return jn(this.points,function(r,i){var o=Kl(r,2),a=o[0],s=o[1];return{x:a,y:s,id:"".concat(t.id,"_").concat(i)}})},e.prototype.resize=function(t){var r=t.width,i=t.height,o=t.deltaX,a=t.deltaY;return this.move(o/2,a/2),this.rx=r,this.ry=i,this.setProperties({rx:r,ry:i}),this.getData()},jo([z],e.prototype,"rx",void 0),jo([z],e.prototype,"ry",void 0),jo([gt],e.prototype,"points",null),jo([gt],e.prototype,"pointsPosition",null),jo([gt],e.prototype,"width",null),jo([gt],e.prototype,"height",null),e})(Ei),nI=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Ya=function(){return Ya=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Ya.apply(this,arguments)},ql=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},nc=(function(n){nI(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.modelType=We.ELLIPSE_NODE,i.rx=30,i.ry=45,i.initNodeData(t),i.setAttributes(),i}return e.prototype.setAttributes=function(){n.prototype.setAttributes.call(this);var t=this.properties,r=t.rx,i=t.ry;r&&(this.rx=r),i&&(this.ry=i)},e.prototype.getNodeStyle=function(){var t=n.prototype.getNodeStyle.call(this),r=this.graphModel.theme.ellipse,i=this.properties.style,o=i===void 0?{}:i;return Ya(Ya(Ya({},t),Ee(r)),Ee(o))},Object.defineProperty(e.prototype,"width",{get:function(){return this.rx*2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.ry*2},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var t=this,r=t.x,i=t.y,o=t.rx,a=t.ry;return[{x:r,y:i-a,id:"".concat(this.id,"_0")},{x:r+o,y:i,id:"".concat(this.id,"_1")},{x:r,y:i+a,id:"".concat(this.id,"_2")},{x:r-o,y:i,id:"".concat(this.id,"_3")}]},e.prototype.resize=function(t){var r=t.width,i=t.height,o=t.deltaX,a=t.deltaY;return this.move(o/2,a/2),this.rx=r,this.ry=i,this.setProperties({rx:r,ry:i}),this.getData()},ql([z],e.prototype,"rx",void 0),ql([z],e.prototype,"ry",void 0),ql([gt],e.prototype,"width",null),ql([gt],e.prototype,"height",null),e})(Ei),rI=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Bo=function(){return Bo=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Bo.apply(this,arguments)},Zl=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},Ql=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},Jl=(function(n){rI(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.modelType=We.POLYGON_NODE,i.points=[[50,0],[100,50],[50,100],[0,50]],i.initNodeData(t),i.setAttributes(),i}return e.prototype.setAttributes=function(){n.prototype.setAttributes.call(this);var t=this.properties,r=t.points,i=t.width,o=t.height,a=r||this.points;this.points=ZL(a,i,o)},e.prototype.getNodeStyle=function(){var t=n.prototype.getNodeStyle.call(this),r=this.graphModel,i=r.theme.polygon,o=r.customStyles.polygon,a=this.properties.style,s=a===void 0?{}:a;return Bo(Bo(Bo(Bo({},t),Ee(i)),Ee(o)),Ee(s))},Object.defineProperty(e.prototype,"pointsPosition",{get:function(){var t=this,r=t.x,i=t.y,o=t.width,a=t.height;return this.points.map(function(s){return{x:s[0]+r-o/2,y:s[1]+i-a/2}})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var t=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;return this.points.forEach(function(i){var o=Ql(i,1),a=o[0];a<t&&(t=a),a>r&&(r=a)}),r-t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var t=Number.MAX_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;return this.points.forEach(function(i){var o=Ql(i,2),a=o[1];a<t&&(t=a),a>r&&(r=a)}),r-t},enumerable:!1,configurable:!0}),e.prototype.getDefaultAnchor=function(){var t=this,r=this,i=r.x,o=r.y,a=r.width,s=r.height,l=r.points;return l.map(function(u,d){var f=Ql(u,2),c=f[0],h=f[1];return{x:i+c-a/2,y:o+h-s/2,id:"".concat(t.id,"_").concat(d)}})},e.prototype.resize=function(t){var r=this,i=t.width,o=t.height,a=t.deltaX,s=t.deltaY;this.move(a/2,s/2);var l=jn(this.points,function(u){var d=Ql(u,2),f=d[0],c=d[1];return[f*i/r.width,c*o/r.height]});return this.points=l,this.properties.points=l,this.getData()},Zl([z],e.prototype,"points",void 0),Zl([gt],e.prototype,"pointsPosition",null),Zl([gt],e.prototype,"width",null),Zl([gt],e.prototype,"height",null),e})(Ei),iI=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Va=function(){return Va=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Va.apply(this,arguments)},oI=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},Fo=(function(n){iI(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.modelType=We.RECT_NODE,i.radius=0,i.initNodeData(t),i.setAttributes(),i}return e.prototype.setAttributes=function(){n.prototype.setAttributes.call(this);var t=this.properties,r=t.width,i=t.height,o=t.radius,a=this.getNodeStyle().radius;Kt(r)||(this.width=r),Kt(i)||(this.height=i),Kt(o)||(this.radius=o),Kt(a)||(this.radius=a)},e.prototype.getDefaultAnchor=function(){var t=this,r=t.x,i=t.y,o=t.width,a=t.height;return[{x:r,y:i-a/2,id:"".concat(this.id,"_0")},{x:r+o/2,y:i,id:"".concat(this.id,"_1")},{x:r,y:i+a/2,id:"".concat(this.id,"_2")},{x:r-o/2,y:i,id:"".concat(this.id,"_3")}]},e.prototype.getNodeStyle=function(){var t=n.prototype.getNodeStyle.call(this),r=this.graphModel.theme.rect,i=this.properties.style,o=i===void 0?{}:i;return Va(Va(Va({},t),Ee(r)),Ee(o))},oI([z],e.prototype,"radius",void 0),e})(Ei),aI=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Ka=function(){return Ka=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Ka.apply(this,arguments)},f_=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},sI=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},lI=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))},c_=(function(n){aI(e,n);function e(){var t=n.apply(this,lI([],sI(arguments),!1))||this;return t.modelType=We.TEXT_NODE,t}return e.prototype.getTextStyle=function(){var t=n.prototype.getTextStyle.call(this),r=this.graphModel.theme.text,i=this.properties.textStyle;return Ka(Ka(Ka({},t),Ee(r)),Ee(i))},Object.defineProperty(e.prototype,"width",{get:function(){var t=String(this.text.value).split(/[\r\n]/g),r=this.getTextStyle().fontSize,i=Qm({rows:t,fontSize:r,rowsLength:t.length}).width;return i},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var t=String(this.text.value).split(/[\r\n]/g),r=this.getTextStyle().fontSize,i=Qm({rows:t,fontSize:r,rowsLength:t.length}).height;return i},enumerable:!1,configurable:!0}),f_([gt],e.prototype,"width",null),f_([gt],e.prototype,"height",null),e})(Ei),uI=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),$o=function(){return $o=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},$o.apply(this,arguments)},rc=(function(n){uI(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.modelType=We.HTML_NODE,i.setAttributes(),i}return e.prototype.setAttributes=function(){n.prototype.setAttributes.call(this);var t=this.properties,r=t.width,i=t.height;r&&(this.width=r),i&&(this.height=i)},e.prototype.getDefaultAnchor=function(){var t=this,r=t.x,i=t.y,o=t.width,a=t.height;return[{x:r,y:i-a/2,id:"".concat(this.id,"_0")},{x:r+o/2,y:i,id:"".concat(this.id,"_1")},{x:r,y:i+a/2,id:"".concat(this.id,"_2")},{x:r-o/2,y:i,id:"".concat(this.id,"_3")}]},e.prototype.getNodeStyle=function(){var t=n.prototype.getNodeStyle.call(this),r=this.graphModel.theme,i=r.baseNode,o=r.html,a=this.properties.style,s=a===void 0?{}:a,l=$o($o($o($o({},t),Ee(i)),Ee(o)),Ee(s));return l},e})(Ei),st=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},dI={stopZoomGraph:!1,stopScrollGraph:!1,stopMoveGraph:!1,adjustEdge:!1,adjustEdgeStartAndEnd:!1,adjustNodePosition:!1,hideAnchors:!0,allowRotate:!1,allowResize:!1,nodeSelectedOutline:!0,textEdit:!1,nodeTextEdit:!1,edgeTextEdit:!1,textDraggable:!1,nodeTextDraggable:!1,edgeTextDraggable:!1},eu=["isSilentMode","stopZoomGraph","stopScrollGraph","stopMoveGraph","snapGrid","adjustEdge","adjustEdgeMiddle","adjustEdgeStartAndEnd","adjustEdgeStart","adjustEdgeEnd","adjustNodePosition","hideAnchors","allowRotate","allowResize","autoExpand","hoverOutline","nodeSelectedOutline","edgeSelectedOutline","textEdit","nodeTextEdit","edgeTextEdit","textDraggable","nodeTextDraggable","edgeTextDraggable","multipleSelectKey","textMode","nodeTextMode","edgeTextMode","nodeTextMultiple","edgeTextMultiple","nodeTextVertical","edgeTextVertical","isPinching"],fI=(function(){function n(e){this.isSilentMode=!1,this.stopZoomGraph=!1,this.stopMoveGraph=!1,this.stopScrollGraph=!1,this.snapGrid=!1,this.isPinching=!1,this.textMode=Zn.TEXT,this.textEdit=!0,this.textDraggable=!1,this.nodeTextEdit=!0,this.nodeTextDraggable=!1,this.nodeTextMultiple=!1,this.nodeTextVertical=!1,this.nodeTextMode=Zn.TEXT,this.edgeTextMode=Zn.TEXT,this.edgeTextEdit=!0,this.edgeTextDraggable=!1,this.edgeTextMultiple=!1,this.edgeTextVertical=!1,this.hideAnchors=!1,this.allowRotate=!1,this.allowResize=!1,this.hoverOutline=!0,this.nodeSelectedOutline=!0,this.adjustNodePosition=!0,this.autoExpand=!1,this.adjustEdge=!0,this.adjustEdgeMiddle=!1,this.adjustEdgeStartAndEnd=!1,this.adjustEdgeStart=!1,this.adjustEdgeEnd=!1,this.edgeSelectedOutline=!0,this.multipleSelectKey="",Je(this,this.computeConfig(e))}return n.prototype.updateEditConfig=function(e){var t=this.computeConfig(e);Je(this,t)},n.prototype.computeConfig=function(e){var t=e.isSilentMode,r=e.textDraggable,i=e.textMode,o=e.textEdit,a=e.adjustEdgeStartAndEnd,s={};if(t===!1&&Je(s,this.stagedConfig),t===!0&&t!==this.isSilentMode){var l=Wi(dI,eu);this.stagedConfig=Wi(this,eu),Je(s,l)}zi(o)||Je(s,{nodeTextEdit:o,edgeTextEdit:o}),zi(r)||Je(s,{nodeTextDraggable:r,edgeTextDraggable:r}),i&&Je(s,{nodeTextMode:i,edgeTextMode:i}),_l(a)&&Je(s,{adjustEdgeStart:a,adjustEdgeEnd:a});var u=Wi(e,eu);return Je(s,u)},n.prototype.updateTextMode=function(e){this.textMode=e,this.edgeTextMode=e,this.nodeTextMode=e},n.prototype.getConfig=function(){return Wi(this,eu)},st([z],n.prototype,"isSilentMode",void 0),st([z],n.prototype,"stopZoomGraph",void 0),st([z],n.prototype,"stopMoveGraph",void 0),st([z],n.prototype,"stopScrollGraph",void 0),st([z],n.prototype,"snapGrid",void 0),st([z],n.prototype,"isPinching",void 0),st([z],n.prototype,"textMode",void 0),st([z],n.prototype,"textEdit",void 0),st([z],n.prototype,"textDraggable",void 0),st([z],n.prototype,"nodeTextEdit",void 0),st([z],n.prototype,"nodeTextDraggable",void 0),st([z],n.prototype,"nodeTextMultiple",void 0),st([z],n.prototype,"nodeTextVertical",void 0),st([z],n.prototype,"nodeTextMode",void 0),st([z],n.prototype,"edgeTextMode",void 0),st([z],n.prototype,"edgeTextEdit",void 0),st([z],n.prototype,"edgeTextDraggable",void 0),st([z],n.prototype,"edgeTextMultiple",void 0),st([z],n.prototype,"edgeTextVertical",void 0),st([z],n.prototype,"hideAnchors",void 0),st([z],n.prototype,"allowRotate",void 0),st([z],n.prototype,"allowResize",void 0),st([z],n.prototype,"hoverOutline",void 0),st([z],n.prototype,"nodeSelectedOutline",void 0),st([z],n.prototype,"adjustNodePosition",void 0),st([z],n.prototype,"autoExpand",void 0),st([z],n.prototype,"adjustEdge",void 0),st([z],n.prototype,"adjustEdgeMiddle",void 0),st([z],n.prototype,"adjustEdgeStartAndEnd",void 0),st([z],n.prototype,"adjustEdgeStart",void 0),st([z],n.prototype,"adjustEdgeEnd",void 0),st([z],n.prototype,"edgeSelectedOutline",void 0),st([H],n.prototype,"updateEditConfig",null),st([H],n.prototype,"updateTextMode",null),n})(),cI="*",hI=(function(){function n(){this._events={}}return n.prototype.on=function(e,t,r){var i=this;e==null||e.split(",").forEach(function(o){o=o.trim(),i._events[o]||(i._events[o]=[]),i._events[o].push({callback:t,once:!!r})})},n.prototype.once=function(e,t){var r=this;e==null||e.split(",").forEach(function(i){i=i.trim(),r.on(i,t,!0)})},n.prototype.emit=function(e,t){var r=this;e==null||e.split(",").forEach(function(i){var o=r._events[i]||[],a=r._events[cI]||[],s=function(l){for(var u=l.length,d=0;d<u;d++)if(l[d]){var f=l[d],c=f.callback,h=f.once;h&&(l.splice(d,1),l.length===0&&delete r._events[i],u--,d--),c.apply(r,[t])}};s(o),s(a)})},n.prototype.off=function(e,t){var r=this;e||(this._events={}),e.split(",").forEach(function(i){if(!t)delete r._events[i];else{for(var o=r._events[i]||[],a=o.length,s=0;s<a;s++)o[s].callback===t&&(o.splice(s,1),a--,s--);o.length===0&&delete r._events[i]}})},n.prototype.getEvents=function(){return this._events},n.prototype.destroy=function(){this._events={}},n})(),pI=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),vI=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},gI=(function(n){pI(e,n);function e(t){var r=n.call(this)||this;r.stepScrollX=0,r.stepScrollY=0,r.pointers=new Map,r.onDragging=function(s){var l=s.deltaX,u=s.deltaY;r.longPressTimer&&(clearTimeout(r.longPressTimer),r.longPressTimer=void 0),r.setState({isDragging:!0});var d=r.props.graphModel,f=d.transformModel,c=d.editConfigModel;c.stopMoveGraph!==!0&&f.translate(l,u)},r.onDragEnd=function(){r.setState({isDragging:!1})},r.zoomHandler=function(s){var l=r.props,u=l.graphModel,d=u.editConfigModel,f=u.transformModel,c=u.gridSize,h=l.graphModel,p=s.deltaX,v=s.deltaY,g=d.stopScrollGraph,y=d.stopZoomGraph;if(!g&&!s.ctrlKey&&!s.metaKey){if(s.preventDefault(),r.stepScrollX+=p,r.stepScrollY+=v,Math.abs(r.stepScrollX)>=c){var m=r.stepScrollX%c,O=r.stepScrollX-m;f.translate(-O*f.SCALE_X,0),r.stepScrollX=m}if(Math.abs(r.stepScrollY)>=c){var T=r.stepScrollY%c,C=r.stepScrollY-T;f.translate(0,-C*f.SCALE_Y),r.stepScrollY=T}return}if(!y){s.preventDefault();var A=h.getPointByClient({x:s.clientX,y:s.clientY}),E=A.canvasOverlayPosition,N=E.x,B=E.y;f.zoom(s.deltaY<0,[N,B])}},r.clickHandler=function(s){var l=s.target;if(l.getAttribute("name")==="canvas-overlay"){var u=r.props.graphModel,d=u.selectElements;if(d.size>0&&u.clearSelectElements(),r.state.isDragging)return;u.eventCenter.emit(ve.BLANK_CLICK,{e:s})}},r.handleContextMenu=function(s){var l=s.target;if(l.getAttribute("name")==="canvas-overlay"){s.preventDefault();var u=r.props.graphModel,d=u.getPointByClient({x:s.clientX,y:s.clientY});u.eventCenter.emit(ve.BLANK_CONTEXTMENU,{e:s,position:d})}},r.pointerDownHandler=function(s){var l=r.props.graphModel,u=l.eventCenter,d=l.editConfigModel,f=l.transformModel.SCALE_X,c=l.gridSize;if(r.pointers.set(s.pointerId,{x:s.clientX,y:s.clientY}),r.longPressTimer&&clearTimeout(r.longPressTimer),s.pointerType==="touch"&&(r.longPressTimer=window.setTimeout(function(){r.handleContextMenu(s)},500)),r.pointers.size===2){var h=r.props.graphModel,p=h.transformModel,v=h.editConfigModel,g=Array.from(r.pointers.values()),y=g[0].x-g[1].x,m=g[0].y-g[1].y,O=(g[0].x+g[1].x)/2,T=(g[0].y+g[1].y)/2;r.pinchStartDistance=Math.hypot(y,m),r.pinchStartScale=p.SCALE_X,r.stepDrag.cancelDrag(),r.pinchLastCenterX=O,r.pinchLastCenterY=T,v.updateEditConfig({isPinching:!0});return}var C=d.adjustEdge,A=d.adjustNodePosition,E=d.stopMoveGraph,N=s.target,B=!C&&!A;(N.getAttribute("name")==="canvas-overlay"||B)&&(E!==!0?(r.stepDrag.setStep(c*f),r.stepDrag.handleMouseDown(s)):u.emit(ve.BLANK_MOUSEDOWN,{e:s}))},r.pointerMoveHandler=function(s){var l;if(r.pointers.set(s.pointerId,{x:s.clientX,y:s.clientY}),r.pinchStartDistance&&r.pointers.size>=2){var u=r.props,d=u.graphModel,f=u.graphModel,c=f.editConfigModel,h=f.transformModel;if(c.stopZoomGraph)return;r.longPressTimer&&clearTimeout(r.longPressTimer);var p=Array.from(r.pointers.values()),v=p[0].x-p[1].x,g=p[0].y-p[1].y,y=Math.hypot(v,g),m=((l=r.pinchStartScale)!==null&&l!==void 0?l:h.SCALE_X)*(y/r.pinchStartDistance),O=(p[0].x+p[1].x)/2,T=(p[0].y+p[1].y)/2,C=d.getPointByClient({x:O,y:T}),A=C.canvasOverlayPosition,E=A.x,N=A.y;if(h.zoom(m,[E,N]),!c.stopMoveGraph||c.isPinching){var B=r.pinchLastCenterX===void 0?0:O-r.pinchLastCenterX,Z=r.pinchLastCenterY===void 0?0:T-r.pinchLastCenterY;h.translate(B,Z),r.pinchLastCenterX=O,r.pinchLastCenterY=T}s.preventDefault()}},r.pointerUpHandler=function(s){if(r.pointers.delete(s.pointerId),r.longPressTimer&&(clearTimeout(r.longPressTimer),r.longPressTimer=void 0),r.pointers.size<2){r.pinchStartDistance=void 0,r.pinchStartScale=void 0,r.pinchLastCenterX=void 0,r.pinchLastCenterY=void 0;var l=r.props.graphModel.editConfigModel;l.updateEditConfig({isPinching:!1}),r.clickHandler(s)}};var i=t.graphModel,o=i.gridSize,a=i.eventCenter;return r.stepDrag=new Qn({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:o,eventType:"BLANK",isStopPropagation:!1,eventCenter:a,model:void 0}),r.state={isDragging:!1},r}return e.prototype.render=function(){var t=this.props.graphModel.transformModel,r=t.getTransformStyle().transform,i=this.props.children,o=this.state.isDragging;return $("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",name:"canvas-overlay",onWheel:this.zoomHandler,onPointerDown:this.pointerDownHandler,onPointerMove:this.pointerMoveHandler,onPointerUp:this.pointerUpHandler,onPointerCancel:this.pointerUpHandler,onContextMenu:this.handleContextMenu,style:{touchAction:"none",WebkitUserSelect:"none"},className:o?"lf-canvas-overlay lf-dragging":"lf-canvas-overlay lf-drag-able",children:$("g",{transform:r,children:i})})},e=vI([pn],e),e})(Ye),h_=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),qa=function(){return qa=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},qa.apply(this,arguments)},yI=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},mI=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},p_=(function(n){h_(e,n);function e(){var t=n.call(this)||this;return t.onDragging=function(r){var i=r.event,o=t.props,a=o.graphModel,s=o.bezierModel,l=o.type,u=a.getPointByClient({x:i.clientX,y:i.clientY}).canvasOverlayPosition,d=u.x,f=u.y;s.updateAdjustAnchor({x:d,y:f},l),a.eventCenter.emit(ve.EDGE_ADJUST,{data:s.getData()})},t.onDragEnd=function(){var r=t.props.bezierModel;r.isDragging=!1},t.dragHandler=new Qn({onDragging:t.onDragging,onDragEnd:t.onDragEnd}),t}return e.prototype.render=function(){var t=this,r=this.props.position,i=r.x,o=r.y,a=this.props.bezierModel,s=a.getEdgeStyle().adjustAnchor;return $(ko,qa({className:"lf-bezier-adjust-anchor",x:i,y:o},s,{onPointerDown:function(l){t.dragHandler.handleMouseDown(l)}}))},e})(Ye),_I=(function(n){h_(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getBezierAdjust=function(t,r){var i=t.path,o=t.id,a=Bf(i),s=mI(a,4),l=s[0],u=s[1],d=s[2],f=s[3],c=t.getEdgeStyle().adjustLine,h=[];return h.push($(Io,qa({x1:l.x,y1:l.y,x2:u.x,y2:u.y},c))),h.push($(p_,{position:u,bezierModel:t,graphModel:r,type:"sNext"},"".concat(o,"_ePre"))),h.push($(Io,qa({x1:f.x,y1:f.y,x2:d.x,y2:d.y},c))),h.push($(p_,{position:d,bezierModel:t,graphModel:r,type:"ePre"},"".concat(o,"_sNext"))),h},e.prototype.selectedBezierEdge=function(){for(var t=this.props.graphModel,r=t.edges,i=[],o=0;o<r.length;o++){var a=r[o];a.isSelected&&a.modelType===We.BEZIER_EDGE&&a.draggable&&i.push(this.getBezierAdjust(a,t))}return i},e.prototype.render=function(){return $("g",{className:"lf-bezier-adjust",children:this.selectedBezierEdge()})},e=yI([pn],e),e})(Ye),bI=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),xI=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},EI=(function(n){bI(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.render=function(){var t=this.props.background;return $("div",{className:"lf-background",children:$("div",{style:Mt(t)?t:{},className:"lf-background-area"})})},e=xI([pn],e),e})(Ye),ic=function(){return ic=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},ic.apply(this,arguments)},wI=function(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Za={opacity:1,boldIndices:[5],dashArrayConfig:{pattern:[2,1]},customBoldWidth:2};function SI(n){var e,t,r,i,o=Math.max(0,Math.min(1,(r=n.opacity)!==null&&r!==void 0?r:Za.opacity)),a=new Set,s=Array.isArray(n.boldIndices)?n.boldIndices:Za.boldIndices;try{for(var l=wI(s),u=l.next();!u.done;u=l.next()){var d=u.value;typeof d=="number"&&Number.isFinite(d)&&d>0&&a.add(Math.floor(d))}}catch(v){e={error:v}}finally{try{u&&!u.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}var f=Array.from(a),c=Array.isArray((i=n.dashArrayConfig)===null||i===void 0?void 0:i.pattern)?n.dashArrayConfig.pattern:Za.dashArrayConfig.pattern,h={pattern:c},p=n.customBoldWidth;return{opacity:o,boldIndices:f.length?f:Za.boldIndices,dashArrayConfig:h,customBoldWidth:p}}function v_(n){return n===!1?{mode:"disabled",config:{opacity:1,boldIndices:[],dashArrayConfig:{pattern:[]}}}:n===!0||n==null?{mode:"default",config:ic({},Za)}:{mode:"custom",config:SI(n)}}var OI=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),AI=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},CI=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},TI=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))},Ho=(function(n){OI(e,n);function e(t){var r=n.call(this,t)||this;return r.id=xi(),r.gridOptions=r.props.graphModel.grid,r}return e.prototype.renderDot=function(){var t=this.gridOptions,r=t.config,i=t.size,o=i===void 0?1:i,a=t.visible,s=r??{},l=s.color,u=s.thickness,d=u===void 0?2:u,f=Math.min(Math.max(2,d),o/4),c=a?1:0;return $("g",{fill:l,opacity:c,children:[$("circle",{cx:0,cy:0,r:f/2}),$("circle",{cx:0,cy:o,r:f/2}),$("circle",{cx:o,cy:0,r:f/2}),$("circle",{cx:o,cy:o,r:f/2})]})},e.prototype.getDashArrayForSize=function(t){var r,i=(r=t==null?void 0:t.pattern)===null||r===void 0?void 0:r.filter(function(o){return typeof o=="number"&&o>0});return(i==null?void 0:i.join(","))||"2,1"},e.prototype.getPeriod=function(t){var r=Array.isArray(t==null?void 0:t.boldIndices)?t.boldIndices.filter(function(i){return typeof i=="number"&&i>0}):[];return r.length?Math.max.apply(Math,TI([],CI(r),!1)):0},e.prototype.getBoldStrokeWidth=function(t,r,i,o){if(typeof(t==null?void 0:t.customBoldWidth)=="number")return t.customBoldWidth;var a=Math.max(1,i??1),s=Math.max(1,o??this.getPeriod(t));return Math.min(a,r*s/2)/2},e.prototype.renderMeshEdgeLines=function(t,r,i,o,a){var s=[{d:"M 0 0 H ".concat(t)},{d:"M 0 ".concat(t," H ").concat(t)},{d:"M 0 0 V ".concat(t)},{d:"M ".concat(t," 0 V ").concat(t)}];return $("g",{opacity:o,fill:"transparent",children:s.map(function(l){return $("path",{d:l.d,stroke:r,strokeWidth:i/2,strokeDasharray:a,strokeLinecap:"butt",fill:"transparent"})})})},e.prototype.renderMesh=function(){var t,r,i=this.gridOptions,o=i.config,a=i.size,s=a===void 0?1:a,l=i.visible,u=i.majorBold,d=v_(u).config,f=d.opacity,c=(t=o==null?void 0:o.color)!==null&&t!==void 0?t:"#D7DEEB",h=(r=o==null?void 0:o.thickness)!==null&&r!==void 0?r:1,p=Math.min(Math.max(1,h),s/2),v=l?f:0,g=u===!1?void 0:this.getDashArrayForSize(d.dashArrayConfig);return this.renderMeshEdgeLines(s,c,p,v,g)},e.prototype.render=function(){var t=this,r,i,o,a=this.props.graphModel,s=a.transformModel,l=a.grid;this.gridOptions=l;var u=this.gridOptions,d=u.type,f=u.config,c=f===void 0?{}:f,h=u.size,p=h===void 0?1:h,v=u.majorBold,g=v!==!1&&!Kt(v),y=v_(v).config,m=s.SCALE_X,O=s.SKEW_Y,T=s.SKEW_X,C=s.SCALE_Y,A=s.TRANSLATE_X,E=s.TRANSLATE_Y,N=[m,O,T,C,A,E].join(","),B="matrix(".concat(N,")"),Z=Math.min(Math.max(2,(r=c.thickness)!==null&&r!==void 0?r:1),p/4),ue=g?y.opacity:1;return $("div",{className:"lf-grid",children:$("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",children:[$("defs",{children:[$("pattern",{id:this.id,patternUnits:"userSpaceOnUse",patternTransform:B,x:"0",y:"0",width:p,height:p,children:[d==="dot"&&this.renderDot(),d==="mesh"&&this.renderMesh()]}),d==="dot"&&y.boldIndices.length?$("pattern",{id:"".concat(this.id,"-dot-major"),patternUnits:"userSpaceOnUse",patternTransform:B,x:"0",y:"0",width:p*this.getPeriod(y),height:p*this.getPeriod(y),children:$("g",{fill:(o=(i=this.gridOptions.config)===null||i===void 0?void 0:i.color)!==null&&o!==void 0?o:"#D7DEEB",opacity:this.gridOptions.visible?ue:0,children:[$("circle",{cx:0,cy:0,r:Z*1.5/2}),$("circle",{cx:p*this.getPeriod(y),cy:0,r:Z*1.5/2}),$("circle",{cx:0,cy:p*this.getPeriod(y),r:Z*1.5/2}),$("circle",{cx:p*this.getPeriod(y),cy:p*this.getPeriod(y),r:Z*1.5/2})]})}):null,d==="mesh"&&y.boldIndices.length?$("pattern",{id:"".concat(this.id,"-major"),patternUnits:"userSpaceOnUse",patternTransform:B,x:"0",y:"0",width:p*this.getPeriod(y),height:p*this.getPeriod(y),children:y.boldIndices.map(function(me){var S,D,L,Y,se,ce;return $("g",{children:[$("path",{d:"M ".concat(p*me," 0 V ").concat(p*t.getPeriod(y)),stroke:(D=(S=t.gridOptions.config)===null||S===void 0?void 0:S.color)!==null&&D!==void 0?D:"#D7DEEB",strokeWidth:t.getBoldStrokeWidth(y,p,((L=t.gridOptions.config)!==null&&L!==void 0?L:{}).thickness,t.getPeriod(y)),opacity:t.gridOptions.visible?ue:0,fill:"transparent"}),$("path",{d:"M 0 ".concat(p*me," H ").concat(p*t.getPeriod(y)),stroke:(se=(Y=t.gridOptions.config)===null||Y===void 0?void 0:Y.color)!==null&&se!==void 0?se:"#D7DEEB",strokeWidth:t.getBoldStrokeWidth(y,p,((ce=t.gridOptions.config)!==null&&ce!==void 0?ce:{}).thickness,t.getPeriod(y)),opacity:t.gridOptions.visible?ue:0,fill:"transparent"})]})})}):null]}),$("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,")")}),d==="dot"&&g&&y.boldIndices.length?$("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,"-dot-major)")}):null,d==="mesh"&&g&&y.boldIndices.length?$("rect",{width:"100%",height:"100%",fill:"url(#".concat(this.id,"-major)")}):null]})})},e=AI([pn],e),e})(Ye);(function(n){function e(t){var r=Ee(If);return typeof t=="number"?Je(r,{size:t}):typeof t=="boolean"?Je(r,{visible:t}):Je(r,t)}n.getGridOptions=e})(Ho||(Ho={}));var MI=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),NI=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},PI=(function(n){MI(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.render=function(){var t=this.props.graphModel.transformModel,r=t.getTransformStyle().transform,i=this.props.children;return $("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",width:"100%",height:"100%",className:"modification-overlay",children:$("g",{transform:r,children:i})})},e=NI([pn],e),e})(Ye),DI=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),zo=function(){return zo=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},zo.apply(this,arguments)},RI=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},LI=(function(n){DI(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.renderRectOutline=function(t,r,i,o){var a=r||{},s=a.widthOffset,l=s===void 0?o.widthOffset:s,u=a.heightOffset,d=u===void 0?o.heightOffset:u,f=Dl(t,l,d),c=f.x,h=f.y,p=f.width,v=f.height;return $(Lr,zo({className:i,x:c,y:h,width:p,height:v},r))},e.prototype.getNodesOutline=function(){var t=this.props.graphModel,r=t.nodes,i=t.editConfigModel,o=i.hoverOutline,a=i.nodeSelectedOutline,s=[];return r.forEach(function(l){if(l.isHovered||l.isSelected){var u=l.isHovered,d=l.isSelected,f=l.x,c=l.y,h=l.width,p=l.height;if(a&&d||o&&u){var v=l.getOutlineStyle()||{},g={};if(Object.keys(v).forEach(function(m){m!=="hover"&&(g[m]=v[m])}),u){var y=v.hover;g=zo(zo({},g),y)}s.push($(Lr,zo({transform:l.transform,className:"lf-outline-node",x:f,y:c,width:h+4,height:p+4},g)))}}}),s},e.prototype.getEdgeOutline=function(){for(var t=this.props.graphModel,r=t.edges,i=t.editConfigModel,o=i.edgeSelectedOutline,a=i.hoverOutline,s=[],l=0;l<r.length;l++){var u=r[l];(o&&u.isSelected||a&&u.isHovered)&&(u.modelType===We.LINE_EDGE?s.push(this.getLineOutline(u)):u.modelType===We.POLYLINE_EDGE?s.push(this.getPolylineOutline(u)):u.modelType===We.BEZIER_EDGE&&s.push(this.getBezierOutline(u)))}return s},e.prototype.getLineOutline=function(t){var r=t.startPoint,i=t.endPoint,o=t.getOutlineStyle();return this.renderRectOutline([r,i],o,"lf-outline-edge",{widthOffset:10,heightOffset:10})},e.prototype.getPolylineOutline=function(t){var r=t.points,i=bi(r),o=t.getOutlineStyle();return this.renderRectOutline(i,o,"lf-outline",{widthOffset:8,heightOffset:16})},e.prototype.getBezierOutline=function(t){var r=t.path,i=Bf(r),o=t.getOutlineStyle();return this.renderRectOutline(i,o,"lf-outline",{widthOffset:8,heightOffset:16})},e.prototype.render=function(){return $("g",{className:"lf-outline",children:[this.getNodesOutline(),this.getEdgeOutline()]})},e=RI([pn],e),e})(Ye),II=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),wi=function(){return wi=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},wi.apply(this,arguments)},kI=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},jI=(function(n){II(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.render=function(){var t=this.props.snaplineModel,r=t??{},i=r.position,o=r.isShowHorizontal,a=r.isShowVertical,s=t==null?void 0:t.getStyle(),l=i??{},u=l.x,d=u===void 0?0:u,f=l.y,c=f===void 0?0:f,h=wi(wi({x1:-1e5,y1:c,x2:1e5,y2:c},s),{stroke:o?s==null?void 0:s.stroke:"none"}),p=wi(wi({x1:d,y1:-1e5,x2:d,y2:1e5},s),{stroke:a?s==null?void 0:s.stroke:"none"});return $("g",{className:"lf-snapline",children:[$(Io,wi({},h)),$(Io,wi({},p))]})},e=kI([pn],e),e})(Ye),BI=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),FI=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},$I=(function(n){BI(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.componentDidMount=function(){this.triggerToolRender()},e.prototype.componentDidUpdate=function(){this.triggerToolRender()},e.prototype.getTools=function(){var t=this.props,r=t.tool,i=t.graphModel,o=i.textEditElement,a=r.getTools(),s=a.map(function(l){return ae(l,{textEditElement:o,graphModel:i,lf:r.instance})});return r.components=s,s},e.prototype.triggerToolRender=function(){var t=this.props,r=t.tool,i=t.graphModel,o=document.querySelector("#ToolOverlay_".concat(i.flowId)),a=r.getInstance();a.components.forEach(function(s){return s(a,o)}),a.components=[]},e.prototype.render=function(){var t=this.props.graphModel;return $("div",{className:"lf-tool-overlay",id:"ToolOverlay_".concat(t.flowId),children:this.getTools()})},e=FI([pn],e),e})(Ye),_r=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},Wo=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},HI={false:[-1/0,-1/0,1/0,1/0],true:[-1/0,-1/0,1/0,1/0],vertical:[-1/0,0,1/0,0],horizontal:[0,-1/0,0,1/0]},zI=(function(){function n(e,t){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=e;var r=t.stopMoveGraph,i=r===void 0?!1:r;this.updateTranslateLimits(i)}return n.prototype.setZoomMiniSize=function(e){this.MINI_SCALE_SIZE=e},n.prototype.setZoomMaxSize=function(e){this.MAX_SCALE_SIZE=e},n.prototype.HtmlPointToCanvasPoint=function(e){var t=Wo(e,2),r=t[0],i=t[1];return[(r-this.TRANSLATE_X)/this.SCALE_X,(i-this.TRANSLATE_Y)/this.SCALE_Y]},n.prototype.CanvasPointToHtmlPoint=function(e){var t=Wo(e,2),r=t[0],i=t[1];return[r*this.SCALE_X+this.TRANSLATE_X,i*this.SCALE_Y+this.TRANSLATE_Y]},n.prototype.moveCanvasPointByHtml=function(e,t,r){var i=Wo(e,2),o=i[0],a=i[1];return[o+t/this.SCALE_X,a+r/this.SCALE_Y]},n.prototype.fixDeltaXY=function(e,t){return[e/this.SCALE_X,t/this.SCALE_Y]},n.prototype.getTransformStyle=function(){var e=[this.SCALE_X,this.SKEW_Y,this.SKEW_X,this.SCALE_Y,this.TRANSLATE_X,this.TRANSLATE_Y].join(",");return{transform:"matrix(".concat(e,")")}},n.prototype.zoom=function(e,t){e===void 0&&(e=!1);var r=this.SCALE_X,i=this.SCALE_Y;return typeof e=="number"?(r=e,i=e):e?(r+=this.ZOOM_SIZE,i+=this.ZOOM_SIZE):(r-=this.ZOOM_SIZE,i-=this.ZOOM_SIZE),r<this.MINI_SCALE_SIZE||r>this.MAX_SCALE_SIZE?"".concat(this.SCALE_X*100,"%"):(t&&(this.TRANSLATE_X-=(r-this.SCALE_X)*t[0],this.TRANSLATE_Y-=(i-this.SCALE_Y)*t[1]),this.SCALE_X=r,this.SCALE_Y=i,this.emitGraphTransform("zoom"),"".concat(this.SCALE_X*100,"%"))},n.prototype.emitGraphTransform=function(e){this.eventCenter.emit(ve.GRAPH_TRANSFORM,{type:e,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}})},n.prototype.resetZoom=function(){this.SCALE_X=1,this.SCALE_Y=1,this.emitGraphTransform("resetZoom")},n.prototype.translate=function(e,t){this.TRANSLATE_X+e<=this.translateLimitMaxX&&this.TRANSLATE_X+e>=this.translateLimitMinX&&(this.TRANSLATE_X+=e),this.TRANSLATE_Y+t<=this.translateLimitMaxY&&this.TRANSLATE_Y+t>=this.translateLimitMinY&&(this.TRANSLATE_Y+=t),this.emitGraphTransform("translate")},n.prototype.focusOn=function(e,t,r,i){var o=Wo(this.CanvasPointToHtmlPoint([e,t]),2),a=o[0],s=o[1],l=Wo([r/2-a,i/2-s],2),u=l[0],d=l[1];this.TRANSLATE_X+=u,this.TRANSLATE_Y+=d,this.emitGraphTransform("focusOn")},n.prototype.updateTranslateLimits=function(e){var t;t=Wo(Array.isArray(e)&&e.length===4?e:HI[e.toString()],4),this.translateLimitMinX=t[0],this.translateLimitMinY=t[1],this.translateLimitMaxX=t[2],this.translateLimitMaxY=t[3]},_r([z],n.prototype,"SCALE_X",void 0),_r([z],n.prototype,"SKEW_Y",void 0),_r([z],n.prototype,"SKEW_X",void 0),_r([z],n.prototype,"SCALE_Y",void 0),_r([z],n.prototype,"TRANSLATE_X",void 0),_r([z],n.prototype,"TRANSLATE_Y",void 0),_r([z],n.prototype,"ZOOM_SIZE",void 0),_r([H],n.prototype,"zoom",null),_r([H],n.prototype,"resetZoom",null),_r([H],n.prototype,"translate",null),_r([H],n.prototype,"focusOn",null),n})(),WI=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),oc=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},XI=(function(n){WI(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.parentTransform=r.parentTransform,i}return e.prototype.setParentTransform=function(t){this.parentTransform=t},e.prototype.getCumulativeScale=function(){var t=this.SCALE_X,r=this.SCALE_Y;if(this.parentTransform)if(this.parentTransform instanceof e){var i=this.parentTransform.getCumulativeScale();t*=i.scaleX,r*=i.scaleY}else t*=this.parentTransform.SCALE_X,r*=this.parentTransform.SCALE_Y;return{scaleX:t,scaleY:r}},e.prototype.getCumulativeTranslate=function(){var t=this.TRANSLATE_X,r=this.TRANSLATE_Y;if(this.parentTransform&&this.parentTransform instanceof e){var i=this.parentTransform.getCumulativeScale(),o=i.scaleX,a=i.scaleY;t=o*t,r=a*r}return{translateX:t,translateY:r}},e.prototype.HtmlPointToCanvasPoint=function(t){var r=oc(t,2),i=r[0],o=r[1],a=this.getCumulativeScale(),s=a.scaleX,l=a.scaleY,u=this.getCumulativeTranslate(),d=u.translateX,f=u.translateY;return[(i-d)/s,(o-f)/l]},e.prototype.CanvasPointToHtmlPoint=function(t){var r=oc(t,2),i=r[0],o=r[1],a=this.getCumulativeScale(),s=a.scaleX,l=a.scaleY,u=this.getCumulativeTranslate(),d=u.translateX,f=u.translateY;return[i*s+d,o*l+f]},e.prototype.moveCanvasPointByHtml=function(t,r,i){var o=oc(t,2),a=o[0],s=o[1],l=this.getCumulativeScale(),u=l.scaleX,d=l.scaleY;return[a+r/u,s+i/d]},e.prototype.fixDeltaXY=function(t,r){var i=this.getCumulativeScale(),o=i.scaleX,a=i.scaleY;return[t/o,r/a]},e})(zI),sn=function(){return sn=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},sn.apply(this,arguments)},ge=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},GI=function(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ht=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},Fn=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))},UI=(function(){function n(e){var t=this,r,i;this.themeMode="default",this.modelMap=new Map,this.nodeModelMap=new Map,this.edgeModelMap=new Map,this.elementsModelMap=new Map,this.nodeMoveRules=[],this.nodeResizeRules=[],this.nodes=[],this.edges=[],this.overlapMode=Xt.DEFAULT,this.gridSize=1,this.partial=!1,this.waitCleanEffects=[];var o=e.container,a=e.partial,s=e.background,l=s===void 0?{}:s,u=e.grid,d=e.idGenerator,f=e.edgeGenerator,c=e.animation,h=e.customTrajectory,p=e.customTargetAnchor;this.themeMode=e.themeMode||"default";var v=Gi[this.themeMode]||Gi.default,g=Xi[this.themeMode]||Xi.default;this.rootEl=o,this.partial=!!a,this.background=l,typeof u=="object"&&e.snapGrid&&(this.gridSize=u.size||1),this.customStyles=e.style||{},this.theme=o_(e.style,e.themeMode),this.grid=Ho.getGridOptions(Je({},v,u)),this.theme.grid=Ee(this.grid),l&&(this.background=Ee(Je({},g,l)),this.theme.background=Ee(Je({},g,l))),this.edgeType=e.edgeType||"polyline",this.animation=gL(c),this.overlapMode=e.overlapMode||Xt.DEFAULT,this.isMiniMap=e.isMiniMap||!1,this.width=(r=e.width)!==null&&r!==void 0?r:this.rootEl.getBoundingClientRect().width,this.isContainerWidth=Kt(e.width),this.height=(i=e.height)!==null&&i!==void 0?i:this.rootEl.getBoundingClientRect().height,this.isContainerHeight=Kt(e.height);var y=new ResizeObserver(cl((function(m){var O,T;try{for(var C=GI(m),A=C.next();!A.done;A=C.next()){var E=A.value;if(E.target===t.rootEl){var N=document.body.contains(t.rootEl);if(!N)return;t.resize(),t.eventCenter.emit("graph:resize",{target:t.rootEl,contentRect:E.contentRect})}}}catch(B){O={error:B}}finally{try{A&&!A.done&&(T=C.return)&&T.call(C)}finally{if(O)throw O.error}}}),16));y.observe(this.rootEl),this.waitCleanEffects.push(function(){y.disconnect()}),this.eventCenter=new hI,this.editConfigModel=new fI(e),this.transformModel=new XI(this.eventCenter,e),this.flowId=xi(),this.idGenerator=d,this.edgeGenerator=KL(this,f),this.customTrajectory=h,this.customTargetAnchor=p}return Object.defineProperty(n.prototype,"nodesMap",{get:function(){return this.nodes.reduce(function(e,t,r){return e[t.id]={index:r,model:t},e},{})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"edgesMap",{get:function(){return this.edges.reduce(function(e,t,r){return e[t.id]={index:r,model:t},e},{})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"modelsMap",{get:function(){return Fn(Fn([],Ht(this.nodes),!1),Ht(this.edges),!1).reduce(function(e,t){return e[t.id]=t,e},{})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"sortElements",{get:function(){for(var e=function(l){return Fn([],Ht(l),!1).sort(function(u,d){return u.zIndex-d.zIndex})},t=e(Fn(Fn([],Ht(this.nodes),!1),Ht(this.edges),!1)),r=[],i=[-Ml,-Ml],o=[this.width+Ml,this.height+Ml],a=0;a<t.length;a++){var s=t[a];s.visible&&(!this.partial||s.isSelected||this.isElementInArea(s,i,o,!1,!1))&&r.push(s)}return r},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"textEditElement",{get:function(){var e=this.nodes.find(function(r){return r.state===it.TEXT_EDIT}),t=this.edges.find(function(r){return r.state===it.TEXT_EDIT});return e||t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selectElements",{get:function(){var e=new Map;return this.nodes.forEach(function(t){t.isSelected&&e.set(t.id,t)}),this.edges.forEach(function(t){t.isSelected&&e.set(t.id,t)}),e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"selectNodes",{get:function(){var e=[];return this.nodes.forEach(function(t){t.isSelected&&e.push(t)}),e},enumerable:!1,configurable:!0}),n.prototype.getAreaElement=function(e,t,r,i,o){var a=this;r===void 0&&(r=!0),i===void 0&&(i=!0),o===void 0&&(o=!1);var s=[];return nt(Fn(Fn([],Ht(this.nodes),!1),Ht(this.edges),!1),function(l){var u=a.isElementInArea(l,e,t,r,i);(!o||l.visible)&&u&&s.push(l)}),s},n.prototype.getModel=function(e){return this.modelMap.get(e)},n.prototype.getNodeModelById=function(e){var t;return this.fakeNode&&e===this.fakeNode.id?this.fakeNode:(t=this.nodesMap[e])===null||t===void 0?void 0:t.model},n.prototype.getPointByClient=function(e){var t=e.x,r=e.y,i=this.rootEl.getBoundingClientRect(),o={x:t-i.left,y:r-i.top},a=Ht(this.transformModel.HtmlPointToCanvasPoint([o.x,o.y]),2),s=a[0],l=a[1],u={x:s,y:l};return{domOverlayPosition:o,canvasOverlayPosition:u}},n.prototype.isElementInArea=function(e,t,r,i,o){var a;if(i===void 0&&(i=!0),o===void 0&&(o=!0),e.BaseType===Nt.NODE){e=e;for(var s=Bn(e),l=s.minX,u=s.minY,d=s.maxX,f=s.maxY,c=[{x:l,y:u},{x:d,y:u},{x:d,y:f},{x:l,y:f}],h=o,p=0;p<c.length;p++){var v=c[p],g=v.x,y=v.y;if(a=Ht(this.transformModel.CanvasPointToHtmlPoint([g,y]),2),g=a[0],y=a[1],$f([g,y],t,r)!==o){h=!o;break}}return h}if(e.BaseType===Nt.EDGE){e=e;var m=e.startPoint,O=e.endPoint,T=this.transformModel.CanvasPointToHtmlPoint([m.x,m.y]),C=this.transformModel.CanvasPointToHtmlPoint([O.x,O.y]),A=$f(T,t,r),E=$f(C,t,r);return i?A&&E:A||E}return!1},n.prototype.graphDataToModel=function(e){var t=this;if(!e){this.clearData();return}if(this.elementsModelMap.clear(),this.nodeModelMap.clear(),this.edgeModelMap.clear(),e.nodes?this.nodes=jn(e.nodes,function(i){var o=t.getModelAfterSnapToGrid(i);return t.elementsModelMap.set(o.id,o),t.nodeModelMap.set(o.id,o),o}):this.nodes=[],e.edges){var r=this.edgeType;this.edges=jn(e.edges,function(i){var o,a=t.getModel((o=i.type)!==null&&o!==void 0?o:r);if(!a)throw new Error("找不到".concat(i.type,"对应的边。"));var s=new a(i,t);return t.edgeModelMap.set(s.id,s),t.elementsModelMap.set(s.id,s),s})}else this.edges=[]},n.prototype.modelToGraphData=function(){var e=[];this.edges.forEach(function(r){var i=r.getData();i&&!r.virtual&&e.push(i)});var t=[];return this.nodes.forEach(function(r){var i=r.getData();i&&!r.virtual&&t.push(i)}),{nodes:t,edges:e}},n.prototype.modelToHistoryData=function(){for(var e=!1,t=[],r=0;r<this.nodes.length;r++){var i=this.nodes[r];if(i.isDragging){e=!0;break}else t.push(i.getHistoryData())}if(e)return!1;for(var o=!1,a=[],s=0;s<this.edges.length;s++){var l=this.edges[s];if(l.isDragging){o=!0;break}l.virtual||a.push(l.getHistoryData())}return o?!1:{nodes:t,edges:a}},n.prototype.getEdgeModelById=function(e){var t;return(t=this.edgesMap[e])===null||t===void 0?void 0:t.model},n.prototype.getElement=function(e){return this.modelsMap[e]},n.prototype.getNodeEdges=function(e){for(var t=[],r=0;r<this.edges.length;r++){var i=this.edges[r],o=i.sourceNodeId===e,a=i.targetNodeId===e;(o||a)&&t.push(i)}return t},n.prototype.getSelectElements=function(e){e===void 0&&(e=!0);var t=this.selectElements,r={nodes:[],edges:[]};return t.forEach(function(i){if(i.BaseType===Nt.NODE&&r.nodes.push(i.getData()),i.BaseType===Nt.EDGE){var o=i.getData(),a=t.get(o.sourceNodeId)&&t.get(o.targetNodeId);(e||a)&&r.edges.push(o)}}),r},n.prototype.updateAttributes=function(e,t){var r=this.getElement(e);r==null||r.updateAttributes(t)},n.prototype.changeNodeId=function(e,t){return t||(t=xi()),this.nodesMap[t]?(console.warn("当前流程图已存在节点".concat(t,", 修改失败")),""):this.nodesMap[e]?(this.edges.forEach(function(r){r.sourceNodeId===e&&(r.sourceNodeId=t),r.targetNodeId===e&&(r.targetNodeId=t)}),this.nodesMap[e].model.id=t,this.nodesMap[t]=this.nodesMap[e],t):(console.warn("当前流程图找不到节点".concat(e,", 修改失败")),"")},n.prototype.changeEdgeId=function(e,t){return t||(t=xi()),this.edgesMap[t]?(console.warn("当前流程图已存在边: ".concat(t,", 修改失败")),""):this.edgesMap[e]?(this.edges.forEach(function(r){r.id===e&&r.changeEdgeId(t)}),t):(console.warn("当前流程图找不到边: ".concat(t,", 修改失败")),"")},n.prototype.getTextModel=function(e){var t=this.editConfigModel,r=t.textMode,i=t.nodeTextMode,o=t.edgeTextMode;if(e.BaseType===Nt.NODE)return e.textMode||i||r||Zn.TEXT;if(e.BaseType===Nt.EDGE)return e.textMode||o||r||Zn.TEXT},n.prototype.setOverlapMode=function(e){this.overlapMode=e,this.eventCenter.emit("overlap:change",{overlapMode:e})},n.prototype.setTextMode=function(e,t){this.editConfigModel.updateEditConfig({textMode:e})},n.prototype.setFakeNode=function(e){this.fakeNode=e},n.prototype.removeFakeNode=function(){this.fakeNode=null},n.prototype.setModel=function(e,t){return this.modelMap.set(e,t)},n.prototype.toFront=function(e){var t,r,i,o=((t=this.nodesMap[e])===null||t===void 0?void 0:t.model)||((r=this.edgesMap[e])===null||r===void 0?void 0:r.model);if(o){if(this.overlapMode===Xt.STATIC)return;if(this.overlapMode===Xt.INCREASE){this.setElementZIndex(e,"top");return}(i=this.topElement)===null||i===void 0||i.setZIndex(),o.setZIndex(TL),this.topElement=o}},n.prototype.setElementZIndex=function(e,t){var r,i,o=((r=this.nodesMap[e])===null||r===void 0?void 0:r.model)||((i=this.edgesMap[e])===null||i===void 0?void 0:i.model);if(o){var a=void 0;typeof t=="number"?a=t:(t==="top"&&(a=Ha()),t==="bottom"&&(a=Y3())),o.setZIndex(a)}},n.prototype.deleteNode=function(e){var t=this.nodesMap[e].model,r=t.getData();this.deleteEdgeBySource(e),this.deleteEdgeByTarget(e),this.nodes.splice(this.nodesMap[e].index,1),this.eventCenter.emit(ve.NODE_DELETE,{data:r,model:t})},n.prototype.addNode=function(e,t,r){t===void 0&&(t=ve.NODE_ADD);var i=an(e),o=i.id;o&&this.nodesMap[o]&&delete i.id;var a=this.getModelAfterSnapToGrid(i);this.nodes.push(a);var s=a.getData(),l={data:s};return r&&(l.e=r),this.eventCenter.emit(t,l),a},n.prototype.getModelAfterSnapToGrid=function(e){var t=this.getModel(e.type),r=this.editConfigModel.snapGrid;if(!t)throw new Error("找不到".concat(e.type,"对应的节点,请确认是否已注册此类型节点。"));var i=e.x,o=e.y;i&&o&&(e.x=Ro(i,this.gridSize,r),e.y=Ro(o,this.gridSize,r),typeof e.text=="object"&&e.text!==null&&(e.text.x+=e.x-i,e.text.y+=e.y-o));var a=new t(e,this);return this.nodeModelMap.set(a.id,a),this.elementsModelMap.set(a.id,a),a},n.prototype.cloneNode=function(e){var t=this.getNodeModelById(e),r=t==null?void 0:t.getData();if(r){r.x+=30,r.y+=30,r.id="",typeof r.text=="object"&&r.text!==null&&(r.text.x+=30,r.text.y+=30);var i=this.addNode(r);return i.setSelected(!0),t==null||t.setSelected(!1),i.getData()}},n.prototype.moveNode=function(e,t,r,i){var o;i===void 0&&(i=!1);var a=this.nodesMap[e];if(!a){console.warn("不存在id为".concat(e,"的节点"));return}var s=a.model;o=Ht(s.getMoveDistance(t,r,i),2),t=o[0],r=o[1],this.moveEdge(e,t,r)},n.prototype.moveNode2Coordinate=function(e,t,r,i){i===void 0&&(i=!1);var o=this.nodesMap[e];if(!o){console.warn("不存在id为".concat(e,"的节点"));return}var a=o.model,s=a.x,l=a.y,u=t-s,d=r-l;this.moveNode(e,u,d,i)},n.prototype.editText=function(e){this.setElementStateById(e,it.TEXT_EDIT)},n.prototype.addEdge=function(e){var t=an(e),r=t.type;r||(r=this.edgeType),t.id&&this.edgesMap[t.id]&&(delete t.id,delete t.sourceAnchorId,delete t.targetAnchorId);var i=this.getModel(r);if(!i)throw new Error("找不到".concat(r,"对应的边,请确认是否已注册此类型边。"));var o=new i(sn(sn({},t),{type:r}),this);this.edgeModelMap.set(o.id,o),this.elementsModelMap.set(o.id,o);var a=o.getData();return this.edges.push(o),this.eventCenter.emit(ve.EDGE_ADD,{data:a}),o},n.prototype.moveEdge=function(e,t,r){for(var i=0;i<this.edges.length;i++){var o=this.edges[i],a=o.textPosition,s=a.x,l=a.y,u=this.edges[i].sourceNodeId===e,d=this.edges[i].targetNodeId===e;u&&o.moveStartPoint(t,r),d&&o.moveEndPoint(t,r),(u||d)&&this.handleEdgeTextMove(o,s,l)}},n.prototype.handleEdgeTextMove=function(e,t,r){var i;if(e.customTextPosition){e.resetTextPosition();return}if(e.modelType===We.POLYLINE_EDGE&&(!((i=e.text)===null||i===void 0)&&i.value)){var o=e.text,a=Hm(o,e.points);e.moveText(a.x-o.x,a.y-o.y)}var s=e.textPosition,l=s.x,u=s.y;e.moveText(l-t,u-r)},n.prototype.deleteEdgeBySourceAndTarget=function(e,t){for(var r=0;r<this.edges.length;r++)if(this.edges[r].sourceNodeId===e&&this.edges[r].targetNodeId===t){var i=this.edges[r].getData();this.edges.splice(r,1),r--,this.eventCenter.emit(ve.EDGE_DELETE,{data:i})}},n.prototype.deleteEdgeById=function(e){var t=this.edgesMap[e];if(t){var r=this.edgesMap[e].index,i=this.edgesMap[e].model.getData();this.edges.splice(r,1),this.eventCenter.emit(ve.EDGE_DELETE,{data:i})}},n.prototype.deleteEdgeBySource=function(e){for(var t=0;t<this.edges.length;t++)if(this.edges[t].sourceNodeId===e){var r=this.edges[t].getData();this.edges.splice(t,1),t--,this.eventCenter.emit(ve.EDGE_DELETE,{data:r})}},n.prototype.deleteEdgeByTarget=function(e){for(var t=0;t<this.edges.length;t++)if(this.edges[t].targetNodeId===e){var r=this.edges[t].getData();this.edges.splice(t,1),t--,this.eventCenter.emit(ve.EDGE_DELETE,{data:r})}},n.prototype.setElementStateById=function(e,t,r){this.nodes.forEach(function(i){i.id===e?i.setElementState(t,r):i.setElementState(it.DEFAULT)}),this.edges.forEach(function(i){i.id===e?i.setElementState(t,r):i.setElementState(it.DEFAULT)})},n.prototype.updateText=function(e,t){var r=yi(Fn(Fn([],Ht(this.nodes),!1),Ht(this.edges),!1),function(i){return i.id===e});r==null||r.updateText(t)},n.prototype.selectNodeById=function(e,t){var r;t===void 0&&(t=!1),t||this.clearSelectElements();var i=(r=this.nodesMap[e])===null||r===void 0?void 0:r.model;i==null||i.setSelected(!0)},n.prototype.selectEdgeById=function(e,t){var r;t===void 0&&(t=!1),t||this.clearSelectElements();var i=(r=this.edgesMap[e])===null||r===void 0?void 0:r.model;i==null||i.setSelected(!0)},n.prototype.selectElementById=function(e,t){t===void 0&&(t=!1),t||this.clearSelectElements();var r=this.getElement(e);r==null||r.setSelected(!0)},n.prototype.deselectElementById=function(e){var t=this.getElement(e);t&&t.setSelected(!1)},n.prototype.clearSelectElements=function(){var e;this.selectElements.forEach(function(t){t==null||t.setSelected(!1),t==null||t.setHovered(!1)}),this.selectElements.clear(),[Xt.DEFAULT,Xt.EDGE_TOP].includes(this.overlapMode)&&((e=this.topElement)===null||e===void 0||e.setZIndex())},n.prototype.moveNodes=function(e,t,r,i){var o,a,s,l=this;i===void 0&&(i=!1);for(var u=e.reduce(function(O,T){var C,A=(C=l.nodesMap[T])===null||C===void 0?void 0:C.model;return A&&(O[T]=A.getMoveDistance(t,r,i)),O},{}),d=0;d<this.edges.length;d++){var f=this.edges[d],c=f.textPosition,h=c.x,p=c.y,v=u[f.sourceNodeId],g=u[f.targetNodeId],y=void 0,m=void 0;v&&g&&f.modelType===We.POLYLINE_EDGE?(o=Ht(v,2),y=o[0],m=o[1],f.updatePointsList(y,m)):(v&&(a=Ht(v,2),y=a[0],m=a[1],f.moveStartPoint(y,m)),g&&(s=Ht(g,2),y=s[0],m=s[1],f.moveEndPoint(y,m))),(v||g)&&this.handleEdgeTextMove(f,h,p)}},n.prototype.addNodeMoveRules=function(e){this.nodeMoveRules.includes(e)||this.nodeMoveRules.push(e)},n.prototype.addNodeResizeRules=function(e){this.nodeResizeRules.includes(e)||this.nodeResizeRules.push(e)},n.prototype.setDefaultEdgeType=function(e){this.edgeType=e},n.prototype.changeNodeType=function(e,t){var r=this.getNodeModelById(e);if(!r){console.warn("找不到id为".concat(e,"的节点"));return}var i=r.getData();i.type=t;var o=this.getModel(t);if(!o)throw new Error("找不到".concat(t,"对应的节点,请确认是否已注册此类型节点。"));var a=new o(i,this);this.nodes.splice(this.nodesMap[e].index,1,a);var s=this.getNodeEdges(e);s.forEach(function(l){if(l.sourceNodeId===e){var u=qm(a,l.startPoint,a.width,a.height);l.updateStartPoint(u)}if(l.targetNodeId===e){var u=qm(a,l.endPoint,a.width,a.height);l.updateEndPoint(u)}})},n.prototype.changeEdgeType=function(e,t){var r=this.getEdgeModelById(e);if(!r){console.warn("找不到id为".concat(e,"的边"));return}if(r.type!==t){var i=r.getData();i.type=t;var o=this.getModel(t);if(!o)throw new Error("找不到".concat(t,"对应的节点,请确认是否已注册此类型节点。"));delete i.pointsList;var a=new o(i,this);this.edges.splice(this.edgesMap[e].index,1,a)}},n.prototype.getNodeIncomingEdge=function(e){var t=[];return this.edges.forEach(function(r){r.targetNodeId===e&&t.push(r)}),t},n.prototype.getNodeOutgoingEdge=function(e){var t=[];return this.edges.forEach(function(r){r.sourceNodeId===e&&t.push(r)}),t},n.prototype.getAnchorIncomingEdge=function(e){var t=[];return this.edges.forEach(function(r){r.targetAnchorId===e&&t.push(r)}),t},n.prototype.getAnchorOutgoingEdge=function(e){var t=[];return this.edges.forEach(function(r){r.sourceAnchorId===e&&t.push(r)}),t},n.prototype.getNodeIncomingNode=function(e){var t=this,r=[];return this.edges.forEach(function(i){var o;i.targetNodeId===e&&r.push((o=t.nodesMap[i.sourceNodeId])===null||o===void 0?void 0:o.model)}),r},n.prototype.getNodeOutgoingNode=function(e){var t=this,r=[];return this.edges.forEach(function(i){i.sourceNodeId===e&&r.push(t.nodesMap[i.targetNodeId].model)}),r},n.prototype.setTheme=function(e,t){var r;if(t&&(this.themeMode=t,Xi[t]&&this.updateBackgroundOptions(sn(sn({},typeof this.background=="object"?this.background:{}),Xi[t])),Gi[t]&&this.updateGridOptions(Ho.getGridOptions(sn(sn({},this.grid),Gi[t])))),e.background&&this.updateBackgroundOptions(e.background),e.grid){var i=Ho.getGridOptions((r=e.grid)!==null&&r!==void 0?r:!1);this.updateGridOptions(i)}this.theme=X3(sn(sn({},this.customStyles),e),t),this.customStyles=sn(sn({},this.customStyles),e)},n.prototype.getTheme=function(){var e=this,t=e.background,r=e.grid,i=sn(sn({},Ee(this.theme)),{background:t,grid:r});return i},n.prototype.updateGridOptions=function(e){Qr(this.grid,e)},n.prototype.updateGridSize=function(e){this.gridSize=e},n.prototype.updateBackgroundOptions=function(e){_l(e)||_l(this.background)?this.background=e:this.background=sn(sn({},this.background),e)},n.prototype.resize=function(e,t){if(this.rootEl){var r=document.body.contains(this.rootEl);if(r){var i=this.rootEl.offsetParent!==null;if(i)try{this.width=e??this.rootEl.getBoundingClientRect().width,this.isContainerWidth=Kt(e),this.height=t??this.rootEl.getBoundingClientRect().height,this.isContainerHeight=Kt(t),i&&(!this.width||!this.height)&&console.warn("渲染画布的时候无法获取画布宽高,请确认在container已挂载到DOM。@see https://github.com/didi/LogicFlow/issues/675")}catch(o){console.warn("获取画布宽高时发生错误:",o)}}}},n.prototype.clearData=function(){this.nodes=[],this.edges=[],this.edgeModelMap.clear(),this.nodeModelMap.clear(),this.elementsModelMap.clear()},n.prototype.getVirtualRectSize=function(){var e=this.nodes,t=[],r=[];e.forEach(function(c){var h=c.x,p=c.y,v=c.width,g=c.height,y=c.getNodeStyle().strokeWidth,m=y===void 0?0:y,O=h+v/2+m,T=h-v/2-m,C=p+g/2+m,A=p-g/2-m;t=t.concat([O,T].filter(function(E){return!Number.isNaN(E)})),r=r.concat([C,A].filter(function(E){return!Number.isNaN(E)}))});var i=Math.min.apply(Math,Fn([],Ht(t),!1)),o=Math.max.apply(Math,Fn([],Ht(t),!1)),a=Math.min.apply(Math,Fn([],Ht(r),!1)),s=Math.max.apply(Math,Fn([],Ht(r),!1)),l=o-i||0,u=s-a||0,d=i+l/2,f=a+u/2;return{width:l,height:u,x:d,y:f}},n.prototype.translateCenter=function(){var e=this,t=e.nodes,r=e.width,i=e.height,o=e.rootEl,a=e.transformModel;if(t.length){var s=r||o.clientWidth,l=i||o.clientHeight,u=this.getVirtualRectSize(),d=u.x,f=u.y;a.focusOn(d,f,s,l)}},n.prototype.fitView=function(e,t){e===void 0&&(e=20),t===void 0&&(t=20);var r=this,i=r.nodes,o=r.width,a=r.height,s=r.rootEl,l=r.transformModel;if(i.length){var u=o||s.clientWidth,d=a||s.clientHeight,f=this.getVirtualRectSize(),c=f.width,h=f.height,p=f.x,v=f.y,g=(c+t)/u,y=(h+e)/d,m=1/Math.max(g,y),O=[u/2,d/2];l.zoom(m,O),l.focusOn(p,v,u,d)}},n.prototype.openEdgeAnimation=function(e){var t=this.getEdgeModelById(e);t==null||t.openEdgeAnimation()},n.prototype.closeEdgeAnimation=function(e){var t=this.getEdgeModelById(e);t==null||t.closeEdgeAnimation()},n.prototype.getPartial=function(){return this.partial},n.prototype.setPartial=function(e){this.partial=e},n.prototype.destroy=function(){try{this.waitCleanEffects.forEach(function(e){e()})}catch(e){console.warn("error on destroy GraphModel",e)}this.waitCleanEffects.length=0,this.eventCenter.destroy()},ge([z],n.prototype,"width",void 0),ge([z],n.prototype,"height",void 0),ge([z],n.prototype,"theme",void 0),ge([z],n.prototype,"themeMode",void 0),ge([z],n.prototype,"grid",void 0),ge([z],n.prototype,"edgeType",void 0),ge([z],n.prototype,"nodes",void 0),ge([z],n.prototype,"edges",void 0),ge([z],n.prototype,"fakeNode",void 0),ge([z],n.prototype,"overlapMode",void 0),ge([z],n.prototype,"background",void 0),ge([z],n.prototype,"gridSize",void 0),ge([z],n.prototype,"transformModel",void 0),ge([z],n.prototype,"editConfigModel",void 0),ge([z],n.prototype,"partial",void 0),ge([gt],n.prototype,"nodesMap",null),ge([gt],n.prototype,"edgesMap",null),ge([gt],n.prototype,"modelsMap",null),ge([gt],n.prototype,"sortElements",null),ge([gt],n.prototype,"textEditElement",null),ge([gt],n.prototype,"selectElements",null),ge([gt],n.prototype,"selectNodes",null),ge([H],n.prototype,"setOverlapMode",null),ge([H],n.prototype,"setTextMode",null),ge([H],n.prototype,"setFakeNode",null),ge([H],n.prototype,"removeFakeNode",null),ge([H],n.prototype,"setModel",null),ge([H],n.prototype,"toFront",null),ge([H],n.prototype,"setElementZIndex",null),ge([H],n.prototype,"deleteNode",null),ge([H],n.prototype,"addNode",null),ge([H],n.prototype,"cloneNode",null),ge([H],n.prototype,"moveNode",null),ge([H],n.prototype,"moveNode2Coordinate",null),ge([H],n.prototype,"editText",null),ge([H],n.prototype,"addEdge",null),ge([H],n.prototype,"moveEdge",null),ge([H],n.prototype,"deleteEdgeBySourceAndTarget",null),ge([H],n.prototype,"deleteEdgeById",null),ge([H],n.prototype,"deleteEdgeBySource",null),ge([H],n.prototype,"deleteEdgeByTarget",null),ge([H],n.prototype,"setElementStateById",null),ge([H],n.prototype,"updateText",null),ge([H],n.prototype,"selectNodeById",null),ge([H],n.prototype,"selectEdgeById",null),ge([H],n.prototype,"selectElementById",null),ge([H],n.prototype,"deselectElementById",null),ge([H],n.prototype,"clearSelectElements",null),ge([H],n.prototype,"moveNodes",null),ge([H],n.prototype,"setDefaultEdgeType",null),ge([H],n.prototype,"changeNodeType",null),ge([H],n.prototype,"changeEdgeType",null),ge([H],n.prototype,"getNodeIncomingEdge",null),ge([H],n.prototype,"getNodeOutgoingEdge",null),ge([H],n.prototype,"getAnchorIncomingEdge",null),ge([H],n.prototype,"getAnchorOutgoingEdge",null),ge([H],n.prototype,"getNodeIncomingNode",null),ge([H],n.prototype,"getNodeOutgoingNode",null),ge([H],n.prototype,"setTheme",null),ge([H],n.prototype,"getTheme",null),ge([H],n.prototype,"resize",null),ge([H],n.prototype,"clearData",null),ge([H],n.prototype,"translateCenter",null),ge([H],n.prototype,"fitView",null),ge([H],n.prototype,"openEdgeAnimation",null),ge([H],n.prototype,"closeEdgeAnimation",null),ge([H],n.prototype,"setPartial",null),n})(),Yi=function(){return Yi=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Yi.apply(this,arguments)},Qa=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},YI=(function(){function n(e,t){t===void 0&&(t=1),this.isShowHorizontal=!1,this.isShowVertical=!1,this.position={x:0,y:0},this.graphModel=e,this.epsilon=t}return n.prototype.getStyle=function(){return Yi({},this.graphModel.theme.snapline)},n.prototype.getCenterSnapLine=function(e,t){for(var r=e.x,i=e.y,o=!1,a=!1,s=0;s<t.length;s++){var l=t[s];if(l.id!==e.id&&(br(r,l.x,this.epsilon)&&(o=!0),br(i,l.y,this.epsilon)&&(a=!0),o&&a))break}return{isShowVertical:o,isShowHorizontal:a,position:{x:r,y:i}}},n.prototype.getHorizontalSnapline=function(e,t){var r=!1,i=0,o=e.id,a;if(o){var s=this.graphModel.fakeNode;if(s&&s.id===o)a=Bn(s);else{var l=this.graphModel.getNodeModelById(o);l&&(a=Bn(l))}}for(var u=0;u<t.length;u++){var d=t[u];if(d.id!==e.id){var f=Bn(d);if(br(f.minY,a==null?void 0:a.minY,this.epsilon)||br(f.maxY,a==null?void 0:a.minY,this.epsilon)){r=!0,i=a.minY;break}if(br(f.minY,a==null?void 0:a.maxY,this.epsilon)||br(f.maxY,a==null?void 0:a.maxY,this.epsilon)){r=!0,i=a.maxY;break}}}return{isShowHorizontal:r,isShowVertical:this.isShowVertical,position:Yi(Yi({},this.position),{y:i})}},n.prototype.getVerticalSnapline=function(e,t){var r=!1,i=0,o=e.id,a;if(o){var s=this.graphModel.fakeNode;if(s&&s.id===o)a=Bn(s);else{var l=this.graphModel.getNodeModelById(o);l&&(a=Bn(l))}}for(var u=0;u<t.length;u++){var d=t[u];if(d.id!==e.id){var f=Bn(d);if(br(f.minX,a==null?void 0:a.minX,this.epsilon)){r=!0,i=a.minX;break}if(br(f.minX,a==null?void 0:a.minX,this.epsilon)||br(f.maxX,a==null?void 0:a.minX,this.epsilon)){r=!0,i=a.minX;break}if(br(f.minX,a==null?void 0:a.maxX,this.epsilon)||br(f.maxX,a==null?void 0:a.maxX,this.epsilon)){r=!0,i=a.maxX;break}}}return{isShowHorizontal:this.isShowHorizontal,isShowVertical:r,position:Yi(Yi({},this.position),{x:i})}},n.prototype.getSnapLinePosition=function(e,t){var r=this.getCenterSnapLine(e,t),i=r.isShowHorizontal,o=r.isShowVertical;if(!i){var a=this.getHorizontalSnapline(e,t);a.isShowHorizontal&&(r.isShowHorizontal=a.isShowHorizontal,r.position.y=a.position.y)}if(!o){var s=this.getVerticalSnapline(e,t);s.isShowVertical&&(r.isShowVertical=s.isShowVertical,r.position.x=s.position.x)}return r},n.prototype.setSnaplineInfo=function(e){var t=e.isShowHorizontal,r=e.isShowVertical,i=e.position;this.position=i,this.isShowHorizontal=t,this.isShowVertical=r},n.prototype.clearSnapline=function(){this.position={x:0,y:0},this.isShowHorizontal=!1,this.isShowVertical=!1},n.prototype.setNodeSnapLine=function(e){var t=this.graphModel.nodes,r=this.getSnapLinePosition(e,t);this.setSnaplineInfo(r)},Qa([z],n.prototype,"isShowHorizontal",void 0),Qa([z],n.prototype,"isShowVertical",void 0),Qa([z],n.prototype,"position",void 0),Qa([H],n.prototype,"clearSnapline",null),Qa([H],n.prototype,"setNodeSnapLine",null),n})();function br(n,e,t){return Math.abs(n-e)<=t}var VI=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),KI=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},qI=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},ZI=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))},QI=(function(n){VI(e,n);function e(){var t=n.apply(this,ZI([],qI(arguments),!1))||this;return t.handleResize=function(){var r=t.props,i=r.graphModel,o=r.options,a=i.width,s=i.height,l=i.isContainerWidth,u=i.isContainerHeight,d=a,f=s,c=!1;l&&(d=void 0,c=!0),u&&(f=void 0,c=!0),c&&i.resize(d,f),o.width=a,o.height=s},t.throttleResize=cm(t.handleResize,200),t}return e.prototype.componentDidMount=function(){window.addEventListener("resize",this.throttleResize)},e.prototype.componentDidUpdate=function(){var t=this.props.graphModel.modelToGraphData();this.props.graphModel.eventCenter.emit(ve.GRAPH_UPDATED,{data:t})},e.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.throttleResize)},e.prototype.getComponent=function(t,r,i){i===void 0&&(i="canvas-overlay");var o=this.props.getView,a=o(t.type);return a?$(a,{model:t,graphModel:r,overlay:i},t.id):null},e.prototype.render=function(){var t=this,r=this.props,i=r.graphModel,o=r.tool,a=r.options,s=r.dnd,l=r.snaplineModel,u={};a.width&&(u.width="".concat(i.width,"px")),a.height&&(u.height="".concat(i.height,"px"));var d=i.fakeNode,f=i.editConfigModel,c=i.background,h=f.adjustEdge;return $("div",{className:"lf-graph","flow-id":i.flowId,style:u,children:[$(gI,{graphModel:i,dnd:s,children:[$("g",{className:"lf-base",children:jn(i.sortElements,function(p){return t.getComponent(p,i)})}),d?this.getComponent(d,i):""]}),$(PI,{graphModel:i,children:[$(LI,{graphModel:i}),h?$(_I,{graphModel:i}):"",a.snapline!==!1?$(jI,{snaplineModel:l}):""]}),$($I,{graphModel:i,tool:o}),c&&$(EI,{background:c}),$(Ho,{graphModel:i})]})},e=KI([pn],e),e})(Ye),JI=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Ir=function(){return Ir=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Ir.apply(this,arguments)},ek=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},tk=(function(n){JI(e,n);function e(){var t=n.call(this)||this;return t.onDragStart=function(r){var i=r.event,o=t.props,a=o.anchorData,s=o.nodeModel,l=o.graphModel;l.selectNodeById(s.id),s.autoToFront&&l.toFront(s.id),l.eventCenter.emit(ve.ANCHOR_DRAGSTART,{data:a,e:i,nodeModel:s}),t.setState({startX:a.x,startY:a.y,endX:a.x,endY:a.y})},t.onDragging=function(r){var i=r.event,o=t.props,a=o.graphModel,s=o.nodeModel,l=o.anchorData,u=a.transformModel,d=a.eventCenter,f=a.width,c=a.height,h=a.editConfigModel,p=h.autoExpand,v=h.stopMoveGraph;if(i){var g=i.clientX,y=i.clientY,m=a.getPointByClient({x:g,y}),O=m.domOverlayPosition,T=O.x,C=O.y,A=m.canvasOverlayPosition,E=A.x,N=A.y;t.t&&Gl(t.t);var B=[],Z=10;T<10?B=[Z,0]:T+10>f?B=[-Z,0]:C<10?B=[0,Z]:C+10>c&&(B=[0,-Z]),t.setState({endX:E,endY:N,dragging:!0}),t.moveAnchorEnd(E,N,i),B.length>0&&!v&&p&&(t.t=e_(function(){var ue=ek(B,2),me=ue[0],S=ue[1];u.translate(me,S);var D=t.state,L=D.endX,Y=D.endY;t.setState({endX:L-me,endY:Y-S}),t.moveAnchorEnd(L-me,Y-S,i)})),d.emit(ve.ANCHOR_DRAG,{data:l,e:i,nodeModel:s})}},t.onDragEnd=function(r){var i=r.event;t.t&&Gl(t.t);var o=t.checkEnd(i);t.setState({startX:0,startY:0,endX:0,endY:0,dragging:!1}),t.sourceRuleResults.clear(),t.targetRuleResults.clear();var a=t.props,s=a.graphModel,l=a.nodeModel,u=a.anchorData;t.preTargetNode&&(t.preTargetNode.setHovered(!1),t.preTargetNode=void 0),s.eventCenter.emit(ve.ANCHOR_DRAGEND,{data:u,e:i,nodeModel:l,edgeModel:o??void 0})},t.checkEnd=function(r){var i,o=t.props,a=o.graphModel,s=o.nodeModel,l=o.anchorData,u=l.x,d=l.y,f=l.id,c=t.state,h=c.endX,p=c.endY,v=c.dragging,g=Hl({x:h,y:p},a);if(t.preTargetNode&&t.preTargetNode.state!==it.DEFAULT&&t.preTargetNode.setElementState(it.DEFAULT),!!v&&g&&g.node){var y=g.node,m=g.anchor.id,O="".concat(s.id,"_").concat(y.id,"_").concat(m,"_").concat(f),T=t.sourceRuleResults.get(O)||{},C=T.isAllPass,A=T.msg,E=t.targetRuleResults.get(O)||{},N=E.isAllPass,B=E.msg;if(C&&N){y.setElementState(it.DEFAULT);var Z=a.getNodeModelById(g.node.id),ue=(i=a.edgeGenerator)===null||i===void 0?void 0:i.call(a,s.getData(),Z==null?void 0:Z.getData()),me=a.addEdge(Ir(Ir({},ue),{sourceNodeId:s.id,sourceAnchorId:f,startPoint:{x:u,y:d},targetNodeId:g.node.id,targetAnchorId:g.anchor.id,endPoint:{x:g.anchor.x,y:g.anchor.y}})),S=t.props.anchorData;return a.eventCenter.emit(ve.ANCHOR_DROP,{data:S,e:r,nodeModel:s,edgeModel:me}),me}var D=y.getData();return a.eventCenter.emit(ve.CONNECTION_NOT_ALLOWED,{data:D,msg:B||A||"不允许添加连线"}),null}},t.sourceRuleResults=new Map,t.targetRuleResults=new Map,t.state={startX:0,startY:0,endX:0,endY:0,dragging:!1},t.dragHandler=new Qn({onDragStart:t.onDragStart,onDragging:t.onDragging,onDragEnd:t.onDragEnd}),t}return e.prototype.getAnchorShape=function(){var t=this.props,r=t.anchorData,i=t.style,o=t.node,a=o.getAnchorShape(r);if(a)return a;var s=r.x,l=r.y,u=Ir(Ir({},i),i==null?void 0:i.hover);return $("g",{children:[$(ko,Ir({className:"lf-node-anchor-hover"},u,{x:s,y:l})),$(ko,Ir({className:"lf-node-anchor"},i,{x:s,y:l}))]})},Object.defineProperty(e.prototype,"customTrajectory",{get:function(){var t=this.props.graphModel.customTrajectory;return t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"relateEdges",{get:function(){var t=this.props,r=t.graphModel,i=r.getAnchorIncomingEdge,o=r.getAnchorOutgoingEdge,a=t.anchorData.id;return{incomingEdgeList:i(a),outgoingEdgeList:o(a)}},enumerable:!1,configurable:!0}),e.prototype.moveAnchorEnd=function(t,r,i){var o=this.props,a=o.graphModel,s=o.nodeModel,l=o.anchorData,u=Hl({x:t,y:r},a);if(u){var d=u.node,f=u.anchor.id;if(this.preTargetNode&&this.preTargetNode!==u.node&&this.preTargetNode.setElementState(it.DEFAULT),l.id===f)return;if(this.preTargetNode=d,this.validateAndSetState(d,f,u.anchor,s,l),!d.isHovered){var c=d.getData();i&&a.eventCenter.emit(ve.NODE_MOUSEENTER,{data:c,e:i}),d.setHovered(!0)}}else if(this.preTargetNode&&this.preTargetNode.state!==it.DEFAULT){this.preTargetNode.setElementState(it.DEFAULT);var h=this.preTargetNode.getData();i&&a.eventCenter.emit(ve.NODE_MOUSELEAVE,{data:h,e:i}),this.preTargetNode.setHovered(!1),this.preTargetNode=void 0}},e.prototype.validateAndSetState=function(t,r,i,o,a){var s,l,u="".concat(o.id,"_").concat(t.id,"_").concat(r,"_").concat(a.id);if(!this.targetRuleResults.has(u)){var d=o.isAllowConnectedAsSource(t,a,i),f=t.isAllowConnectedAsTarget(o,a,i);this.sourceRuleResults.set(u,Wl(d)),this.targetRuleResults.set(u,Wl(f))}var c=((s=this.sourceRuleResults.get(u))!==null&&s!==void 0?s:{}).isAllPass,h=((l=this.targetRuleResults.get(u))!==null&&l!==void 0?l:{}).isAllPass;c&&h?t.setElementState(it.ALLOW_CONNECT):t.setElementState(it.NOT_ALLOW_CONNECT)},e.prototype.isShowLine=function(){var t=this.state,r=t.startX,i=t.startY,o=t.endX,a=t.endY,s=mr(r,i,o,a);return s>10},e.prototype.render=function(){var t=this,r=this.state,i=r.startX,o=r.startY,a=r.endX,s=r.endY,l=this.props,u=l.anchorData,d=l.edgeStyle,f=l.nodeModel,c=l.graphModel,h=u.edgeAddable;return $("g",{className:"lf-anchor",children:[$("g",{onClick:function(p){p.stopPropagation(),c.eventCenter.emit(ve.ANCHOR_CLICK,{data:u,e:p,nodeModel:f})},onPointerDown:function(p){c.eventCenter.emit(ve.ANCHOR_MOUSEDOWN,{data:u,e:p,nodeModel:f}),h!==!1&&t.dragHandler.handleMouseDown(p)},children:this.getAnchorShape()}),this.isShowLine()&&(this.customTrajectory?this.customTrajectory(Ir({sourcePoint:{x:i,y:o},targetPoint:{x:a,y:s}},d)):$(Io,Ir({x1:i,y1:o,x2:a,y2:s},d,{"pointer-events":"none"})))]})},e})(Ye),nk=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),ac=function(){return ac=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},ac.apply(this,arguments)},rk=(function(n){nk(e,n);function e(t){var r=n.call(this,t)||this;return r.style={},r.onDragging=function(i){var o,a=i.event,s=r.props,l=s.graphModel,u=s.nodeModel,d=s.eventCenter,f=l.selectNodes,c=u.x,h=u.y,p=a.clientX,v=a.clientY,g=l.getPointByClient({x:p,y:v}).canvasOverlayPosition,y=g.x,m=g.y,O=new qt(y-c,m-h),T=((o=r.normal)===null||o===void 0?void 0:o.angle(O))-r.defaultAngle,C=new Fl(-c,-h).rotate(T).translate(c,h).toString();u.transform=C,u.rotate=T;var A=jn(f,function(N){return N.id});A.indexOf(u.id)===-1&&(A=[u.id]);var E=rm(A,function(N,B){var Z=l.getNodeModelById(B);return N[B]=Z==null?void 0:Z.getMoveDistance(0,0,!1),N},{});A.forEach(function(N){var B=l.getNodeEdges(N);B.forEach(function(Z){if(E[Z.sourceNodeId]){var ue=l.getNodeModelById(Z.sourceNodeId),me=ue.anchors.find(function(S){return S.id===Z.sourceAnchorId});Z.updateStartPoint(me)}if(E[Z.targetNodeId]){var ue=l.getNodeModelById(Z.targetNodeId),me=ue.anchors.find(function(L){return L.id===Z.targetAnchorId});Z.updateEndPoint(me)}})}),d.emit(ve.NODE_ROTATE,{e:a,model:u,data:u.getData()})},r.style=t.style,r.stepperDrag=new Qn({onDragging:r.onDragging}),r}return e.prototype.render=function(){var t=this,r=this.props.nodeModel,i=r.x,o=r.y,a=r.width,s=r.height,l=i+a/2+20,u=o-s/2-20;return this.normal=new qt(1,0),this.defaultAngle=this.normal.angle(new qt(l-i,u-o)),r.defaultAngle=this.defaultAngle,$("g",{className:"lf-rotate-control",children:$("g",{onPointerDown:function(d){t.stepperDrag.handleMouseDown(d)},children:$(ko,ac({},this.style,{cx:l,cy:u}))})})},e})(Ye),sc={exports:{}};/*!
|
|
84
|
+
Copyright (c) 2018 Jed Watson.
|
|
85
|
+
Licensed under the MIT License (MIT), see
|
|
86
|
+
http://jedwatson.github.io/classnames
|
|
87
|
+
*/var g_;function ik(){return g_||(g_=1,(function(n){(function(){var e={}.hasOwnProperty;function t(){for(var o="",a=0;a<arguments.length;a++){var s=arguments[a];s&&(o=i(o,r(s)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return t.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var a="";for(var s in o)e.call(o,s)&&o[s]&&(a=i(a,s));return a}function i(o,a){return a?o?o+" "+a:o+a:o}n.exports?(t.default=t,n.exports=t):window.classNames=t})()})(sc)),sc.exports}var ok=ik();const lc=ps(ok);var ak=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),uc=function(){return uc=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},uc.apply(this,arguments)},sk=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},y_=(function(n){ak(e,n);function e(t){var r=n.call(this)||this;r.mouseDownHandler=function(o){var a=r.props,s=a.draggable,l=a.model,u=a.graphModel,d=u.editConfigModel.nodeTextDraggable;(s??d)&&(o.stopPropagation(),r.stepperDrag.model=l,r.stepperDrag.handleMouseDown(o))},r.onDragging=function(o){var a=o.deltaX,s=o.deltaY,l=r.props,u=l.model,d=l.graphModel.transformModel;if(a||s){var f=sk(d.fixDeltaXY(a,s),2),c=f[0],h=f[1];u.moveText(c,h)}},r.dbClickHandler=function(){var o=r.props,a=o.editable,s=o.graphModel.eventCenter,l=o.model;a&&l.setElementState(it.TEXT_EDIT),s.emit(ve.TEXT_DBCLICK,{data:l.text,model:l})};var i=t.draggable;return r.stepperDrag=new Qn({onDragging:r.onDragging,step:1,eventType:"TEXT",isStopPropagation:i}),r}return e.prototype.getShape=function(){var t=this.props,r=t.model,i=t.graphModel,o=i.editConfigModel,a=r.text,s=a.value,l=a.x,u=a.y,d=a.editable,f=a.draggable,c={x:l,y:u,className:"",value:s},h=r.getTextStyle(),p=o.nodeTextDraggable||f;return $(t_,uc({},c,h,{className:lc({"lf-element-text":d,"lf-text-draggable":!d&&p,"lf-text-disabled":!d&&!p}),model:r}))},e.prototype.render=function(){var t=this.props.model.text;if(t)return $("g",{onPointerDown:this.mouseDownHandler,onDblClick:this.dbClickHandler,children:this.getShape()})},e})(Ye),lk=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),xr=function(){return xr=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},xr.apply(this,arguments)},tu=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},uk=(function(n){lk(e,n);function e(t){var r=n.call(this,t)||this;return r.setHoverOn=function(){r.setState({isHovered:!0})},r.setHoverOff=function(){r.setState({isHovered:!1})},r.state={isHovered:!1},r}return e.prototype.getBackground=function(){var t=this.state.isHovered,r=this.props.model,i=r.text,o=r.getTextStyle(),a=o.background||{};if(t&&o.hover&&o.hover.background&&(a=xr(xr({},a),o.hover.background)),i!=null&&i.value&&(a==null?void 0:a.fill)!=="transparent"){var s=o.fontSize,l=o.textWidth,u=o.lineHeight,d=o.overflowMode,f=a.wrapPadding,c=i==null?void 0:i.value.split(/[\r\n]/g),h=c.length,p=i.x,v=i.y,g={};if(d==="autoWrap"&&l){var y=Zm({rows:c,style:{fontSize:"".concat(s,"px"),width:"".concat(l,"px"),lineHeight:u,padding:f},rowsLength:h,className:"lf-get-text-height"});g=xr(xr({},a),{x:p,y:v,width:l,height:y})}else{var m=qL({rows:c,rowsLength:h,fontSize:s}),O=m.width,T=m.height;if(d==="ellipsis"&&(O=l,T=s+2),typeof a.wrapPadding=="string"){var C=a.wrapPadding.split(",").filter(function(Ue){return Ue.trim()}).map(function(Ue){return parseFloat(Ue.trim())});if(C.length>0&&C.length<=4){if(C.length===1){var A=tu(C,1),E=A[0];C=[E,E,E,E]}else if(C.length===2){var N=tu(C,2),B=N[0],Z=N[1];C=[B,Z,B,Z]}else if(C.length===3){var ue=tu(C,3),me=ue[0],Z=ue[1],S=ue[2];C=[me,Z,S,Z]}var D=tu(C,4),L=D[0],Y=D[1],se=D[2],ce=D[3];O+=Y+ce,T+=L+se,p=p+(Y-ce)/2,v=v+(se-L)/2}}g=xr(xr({},a),{x:p-1,y:v-1,width:O,height:T})}return $(Lr,xr({},g))}return null},e.prototype.getShape=function(){var t=this.props.model,r=t.text,i=r.x,o=r.y,a=r.value;if(!a)return null;var s=t.getTextStyle(),l=xr({x:i,y:o,value:a,model:t,className:"lf-element-text"},s);return $("g",{className:"lf-line-text",onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,children:[this.getBackground(),$(t_,xr({},l))]})},e})(y_),dk=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),nu=function(){return nu=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},nu.apply(this,arguments)},fk=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},ru=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},Si=(function(n){dk(e,n);function e(t){var r=n.call(this)||this;r.onDragStart=function(l){var u=l.event,d=r.props,f=d.model,c=d.graphModel;if(u){var h=c.getPointByClient({x:u.clientX,y:u.clientY}).canvasOverlayPosition,p=h.x,v=h.y;r.moveOffset={dx:f.x-p,dy:f.y-v}}},r.onDragging=function(l){var u,d,f,c,h=l.event,p=r.props,v=p.model,g=p.graphModel,y=g.editConfigModel,m=y.stopMoveGraph,O=y.autoExpand,T=y.snapGrid,C=g.transformModel,A=g.selectNodes,E=g.width,N=g.height,B=g.gridSize,Z=h,ue=Z.clientX,me=Z.clientY,S=r.mouseDownPosition,D=S.x,L=S.y;(ue-D>B||me-L>B)&&(v.isDragging=!0);var Y=g.getPointByClient({x:ue,y:me}).canvasOverlayPosition,se=Y.x,ce=Y.y,Ue=ru(C.CanvasPointToHtmlPoint([se,ce]),2),He=Ue[0],F=Ue[1];if(se=se+((d=(u=r.moveOffset)===null||u===void 0?void 0:u.dx)!==null&&d!==void 0?d:0),ce=ce+((c=(f=r.moveOffset)===null||f===void 0?void 0:f.dy)!==null&&c!==void 0?c:0),se=Ro(se,B,T),ce=Ro(ce,B,T),!E||!N){g.moveNode2Coordinate(v.id,se,ce);return}var ne=He<0||F<0||He>E||F>N;if(!(O&&!m&&ne)){var _e=ru(C.CanvasPointToHtmlPoint([se-v.width/2,ce-v.height/2]),2),fe=_e[0],Fe=_e[1],R=ru(C.CanvasPointToHtmlPoint([se+v.width/2,ce+v.height/2]),2),W=R[0],G=R[1],te=Math.max(B,20),oe=[];fe<0?oe=[te,0]:W>g.width?oe=[-te,0]:Fe<0?oe=[0,te]:G>g.height&&(oe=[0,-te]),r.t&&Gl(r.t);var Se=A.map(function(Ce){return Ce.id});Se.indexOf(v.id)===-1&&(Se=[v.id]),oe.length>0&&!m&&O?r.t=e_(function(){var Ce=ru(oe,2),ot=Ce[0],pt=Ce[1];C.translate(ot??0,pt??0);var kt=-(ot??0)/C.SCALE_X,lt=-(pt??0)/C.SCALE_X;g.moveNodes(Se,kt,lt)}):g.moveNodes(Se,se-v.x,ce-v.y)}},r.onDragEnd=function(){r.t&&Gl(r.t);var l=r.props.model;l.isDragging=!1},r.onMouseOut=function(l){yL()&&r.setHoverOff(l)},r.handleMouseUp=function(){var l=r.props.model;r.mouseUpDrag=l.isDragging,r.longPressTimer&&(clearTimeout(r.longPressTimer),r.longPressTimer=void 0)},r.handleClick=function(l){var u=r.mouseUpDrag===!1,d=new Date().getTime();if(r.startTime){var f=d-r.startTime,c=r.props,h=c.model,p=c.graphModel;if(!(!u&&f>300)){u||(r.onDragEnd(),r.handleMouseUp());var v=h.getData(),g=p.getPointByClient({x:l.clientX,y:l.clientY}),y={data:v,e:l,position:g,isSelected:!1,isMultiple:!1},m=l.button===2,O=l.detail===2;if(!m){var T=p.editConfigModel,C=Xm(l,T);if(y.isMultiple=C,h.isSelected&&!O&&C?(y.isSelected=!1,h.setSelected(!1)):(p.selectNodeById(h.id,C),y.isSelected=!0,T.isSilentMode||r.toFront()),O)T.nodeTextEdit&&h.text.editable&&T.textMode===Zn.TEXT&&(h.setSelected(!1),p.setElementStateById(h.id,it.TEXT_EDIT)),p.eventCenter.emit(ve.NODE_DBCLICK,y);else{p.eventCenter.emit(ve.ELEMENT_CLICK,y),p.eventCenter.emit(ve.NODE_CLICK,y);var A=l.currentTarget,E=!Kt(window)&&hr(window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):function(N){return setTimeout(N,0)};E(function(){A.focus()})}}}}},r.handleContextMenu=function(l){l.preventDefault();var u=r.props,d=u.model,f=u.graphModel,c=f.editConfigModel,h=d.getData(),p=f.getPointByClient({x:l.clientX,y:l.clientY});f.setElementStateById(d.id,it.SHOW_MENU,p.domOverlayPosition),d.isSelected||f.selectNodeById(d.id),f.eventCenter.emit(ve.NODE_CONTEXTMENU,{data:h,e:l,position:p}),c.isSilentMode||r.toFront()},r.handleMouseDown=function(l){var u=r.props,d=u.model,f=u.graphModel;r.mouseDownPosition={x:l.clientX,y:l.clientY},r.startTime=new Date().getTime();var c=f.editConfigModel;c.adjustNodePosition&&d.draggable&&r.stepDrag&&r.stepDrag.handleMouseDown(l),r.longPressTimer&&clearTimeout(r.longPressTimer),l.pointerType==="touch"&&(r.longPressTimer=window.setTimeout(function(){r.props.model.isDragging||r.handleContextMenu(l)},500))},r.handleFocus=function(){var l=r.props,u=l.model,d=l.graphModel;d.eventCenter.emit(ve.NODE_FOCUS,{data:u.getData()})},r.handleBlur=function(){if(r.props){var l=r.props,u=l.model,d=l.graphModel;d.eventCenter.emit(ve.NODE_BLUR,{data:u.getData()})}},r.setHoverOn=function(l){var u=r.props,d=u.model,f=u.graphModel;if(!d.isHovered){var c=d.getData();d.setHovered(!0),f.eventCenter.emit(ve.NODE_MOUSEENTER,{data:c,e:l})}},r.setHoverOff=function(l){var u=r.props,d=u.model,f=u.graphModel,c=d.getData();d.isHovered&&(d.setHovered(!1),f.eventCenter.emit(ve.NODE_MOUSELEAVE,{data:c,e:l}))};var i=t.graphModel,o=i.gridSize,a=i.eventCenter,s=t.model;return r.stepDrag=new Qn({onDragStart:r.onDragStart,onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:o,eventType:"NODE",isStopPropagation:!1,eventCenter:a,model:s}),r.modelDisposer=qh(function(){return r.props},function(l){l&&l.model&&r.stepDrag.setModel(l.model)}),r}return e.prototype.componentWillUnmount=function(){this.modelDisposer&&this.modelDisposer(),this.render.$mobx&&this.render.$mobx.dispose()},e.prototype.componentDidMount=function(){},e.prototype.componentDidUpdate=function(){},e.prototype.getAnchorShape=function(t){return null},e.prototype.getAnchors=function(){var t=this,r=this.props,i=r.model,o=r.graphModel,a=i.isSelected,s=i.isHitable,l=i.isDragging,u=i.isShowAnchor;return s&&(a||u)&&!l?jn(i.anchors,function(d,f){var c=i.getAnchorLineStyle(d),h=i.getAnchorStyle(d);return $(tk,{anchorData:d,node:t,style:h,edgeStyle:c,anchorIndex:f,nodeModel:i,graphModel:o,setHoverOff:t.setHoverOff})}):[]},e.prototype.getRotateControl=function(){var t=this.props,r=t.model,i=t.graphModel,o=i.editConfigModel,a=o.isSilentMode,s=o.allowRotate,l=r.isSelected,u=r.isHitable,d=r.rotatable,f=r.isHovered,c=s&&d,h=r.getRotateControlStyle();if(!a&&u&&(l||f)&&c)return $(rk,{graphModel:i,nodeModel:r,eventCenter:i.eventCenter,style:h})},e.prototype.getResizeControl=function(){var t=this.props,r=t.model,i=t.graphModel,o=i.editConfigModel,a=o.isSilentMode,s=o.allowResize,l=r.isSelected,u=r.isHitable,d=r.resizable,f=r.isHovered,c=s&&d,h=r.getResizeControlStyle();return!a&&u&&(l||f)&&c?$(S3,{style:h,model:r,graphModel:i}):null},e.prototype.getText=function(){var t,r=this.props,i=r.model,o=r.graphModel,a=o.editConfigModel;if(a.nodeTextMode!==Zn.TEXT||i.state===it.TEXT_EDIT)return null;if(i.text){var s=!1;return a.nodeTextDraggable&&i.text.draggable&&(s=!0),$(y_,{editable:a.nodeTextEdit&&((t=i.text.editable)!==null&&t!==void 0?t:!0),model:i,graphModel:o,draggable:s})}return null},e.prototype.getStateClassName=function(){var t=this.props.model,r=t.state,i=t.isDragging,o=t.isSelected,a="lf-node";switch(r){case it.ALLOW_CONNECT:a+=" lf-node-allow";break;case it.NOT_ALLOW_CONNECT:a+=" lf-node-not-allow";break;default:a+=" lf-node-default";break}return i&&(a+=" lf-dragging"),o&&(a+=" lf-node-selected"),a},e.prototype.toFront=function(){var t=this.props,r=t.model,i=t.graphModel;r.autoToFront&&i.toFront(r.id)},e.prototype.render=function(){var t=this.props,r=t.model,i=t.graphModel,o=i.editConfigModel,a=o.hideAnchors,s=o.adjustNodePosition,l=o.allowRotate,u=o.allowResize,d=i.gridSize,f=i.transformModel.SCALE_X,c=r.isHitable,h=r.draggable,p=r.transform,v=r.getOuterGAttributes(),g=v.className,y=g===void 0?"":g,m=fk(v,["className"]),O=$("g",{className:"lf-node-content",children:[$("g",{transform:p,children:[this.getShape(),this.getText(),u&&this.getResizeControl(),l&&this.getRotateControl()]}),!a&&this.getAnchors()]}),T;return c?(s&&h&&this.stepDrag.setStep(d*f),T=$("g",nu({className:"".concat(this.getStateClassName()," ").concat(y),onPointerDown:this.handleMouseDown,onPointerUp:this.handleMouseUp,onClick:this.handleClick,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,onMouseOut:this.onMouseOut,onContextMenu:this.handleContextMenu,onFocus:this.handleFocus,onBlur:this.handleBlur},m,{children:O}))):T=$("g",nu({className:"".concat(this.getStateClassName()," ").concat(y)},m,{children:O})),T},e.isObserved=!1,e})(Ye),ck=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),dc=function(){return dc=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},dc.apply(this,arguments)},$n=(function(n){ck(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getShape=function(){var t=this.props.model,r=t.getNodeStyle();return $(Lr,dc({},r,{x:t.x,y:t.y,width:t.width,height:t.height,radius:t.radius}))},e})(Si),hk=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),fc=function(){return fc=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},fc.apply(this,arguments)},Xo=(function(n){hk(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getShape=function(){var t=this.props.model,r=t.x,i=t.y,o=t.r,a=t.getNodeStyle();return $(ko,fc({},a,{x:r,y:i,r:o}))},e})(Si),pk=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),iu=function(){return iu=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},iu.apply(this,arguments)},Go=(function(n){pk(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getShape=function(){var t=this.props.model,r=t,i=r.x,o=r.y,a=r.width,s=r.height,l=r.points,u=t.getNodeStyle(),d={transform:"matrix(1 0 0 1 ".concat(i-a/2," ").concat(o-s/2,")")};return $("g",iu({},d,{children:$(Zf,iu({},u,{points:l,x:i,y:o}))}))},e})(Si),vk=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),cc=function(){return cc=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},cc.apply(this,arguments)},hc=(function(n){vk(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getShape=function(){var t=this.props.model,r=t.getNodeStyle();return $("g",{children:$(Zf,cc({},r,{points:t.points,x:t.x,y:t.y}))})},e})(Si),gk=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),pc=function(){return pc=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},pc.apply(this,arguments)},vc=(function(n){gk(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getShape=function(){var t=this.props.model,r=t.getNodeStyle();return $(y3,pc({},r,{x:t.x,y:t.y,rx:t.rx,ry:t.ry}))},e})(Si),yk=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Ja=function(){return Ja=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Ja.apply(this,arguments)},m_=(function(n){yk(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getBackground=function(){var t=this.props.model,r=t.getTextStyle(),i=t.width,o=t.height,a=t.x,s=t.y,l=Ja(Ja({},r.background),{x:a,y:s,width:i,height:o});return $(Lr,Ja({},l))},e.prototype.getResizeControl=function(){return null},e.prototype.getShape=function(){return $("g",{children:this.getBackground()})},e})(Si),mk=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),es=function(){return es=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},es.apply(this,arguments)},_k=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},bk=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))},gc=(function(n){mk(e,n);function e(){var t=n.apply(this,bk([],_k(arguments),!1))||this;return t.ref=xs(),t}return 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?!1:(this.preProperties=this.currentProperties,!0)},e.prototype.componentDidMount=function(){this.shouldUpdate()&&this.rootEl&&this.setHtml(this.rootEl)},e.prototype.componentDidUpdate=function(){this.shouldUpdate()&&this.rootEl&&this.confirmUpdate(this.rootEl)},e.prototype.componentWillUnmount=function(){n.prototype.componentWillUnmount.call(this),this.rootEl.innerHTML=""},e.prototype.getShape=function(){var t=this.props.model,r=t.x,i=t.y,o=t.height,a=t.width,s=t.getNodeStyle();return this.currentProperties=JSON.stringify(t.properties),$("g",{children:[s.shadow&&$("defs",{children:$("filter",{id:"shadow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:$("feDropShadow",es({},s.shadow))})}),$("rect",es({x:r-a/2,y:i-o/2,width:a,height:o,rx:s.radius,ry:s.radius},s,{filter:"url(#shadow)"})),$("foreignObject",es({},s,{x:r-a/2,y:i-o/2,width:a,height:o,ref:this.ref}))]})},e})(Si),xk=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Er=function(){return Er=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Er.apply(this,arguments)},Ek=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},wk=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},kr;(function(n){n.SOURCE="SOURCE",n.TARGET="TARGET"})(kr||(kr={}));var __=(function(n){xk(e,n);function e(t){var r=n.call(this)||this;r.handleMouseDown=function(l){r.stepDrag&&r.stepDrag.handleMouseDown(l)},r.onDragStart=function(){var l=r.props,u=l.x,d=l.y,f=l.edgeModel,c=f.startPoint,h=f.endPoint,p=f.pointsList;r.oldEdge={startPoint:c,endPoint:h,pointsList:p},r.setState({endX:u,endY:d,dragging:!0})},r.onDragging=function(l){var u=l.deltaX,d=l.deltaY,f=r.state,c=f.endX,h=f.endY,p=r.props,v=p.graphModel,g=p.type,y=v.transformModel,m=v.editConfigModel,O=wk(y.moveCanvasPointByHtml([c,h],u,d),2),T=O[0],C=O[1];r.setState({endX:T,endY:C,dragging:!0});var A=r.props.edgeModel,E=Hl({x:c,y:h},v);if(E&&E.node&&r.isAllowAdjust(E).pass){var N=A.startPoint,B=A.endPoint,Z=A.sourceNode,ue=A.targetNode,me=g===kr.SOURCE?{startPoint:{x:E.anchor.x,y:E.anchor.y},endPoint:{x:B.x,y:B.y},sourceNode:E.node,targetNode:ue}:{startPoint:{x:N.x,y:N.y},endPoint:{x:E.anchor.x,y:E.anchor.y},sourceNode:Z,targetNode:E.node};A.updateAfterAdjustStartAndEnd(me)}else g===kr.SOURCE?A.updateStartPoint({x:T,y:C}):A.updateEndPoint({x:T,y:C});A.text.value&&m.adjustEdge&&A.setText(Object.assign({},A.text,A.textPosition))},r.onDragEnd=function(l){var u,d,f,c=l.event;try{r.setState({dragging:!1});var h=r.props,p=h.graphModel,v=h.edgeModel,g=h.type,y=r.state,m=y.endX,O=y.endY,T=y.dragging,C=Hl({x:m,y:O},p);if(!T)return;var A=!1,E=void 0;if(C&&C.node){var N=r.isAllowAdjust(C),B=N.pass,Z=N.msg,ue=N.newTargetNode;if(B){var me=v.getData(),S=me.text,D=me.sourceAnchorId,L=D===void 0?"":D,Y=me.targetAnchorId,se=Y===void 0?"":Y,ce=Ek(me,["text","sourceAnchorId","targetAnchorId"]);if(E=Er(Er({sourceAnchorId:L,targetAnchorId:se},ce),{text:(S==null?void 0:S.value)||""}),g===kr.SOURCE){var Ue=p.getNodeModelById(C.node.id),He=p.getNodeModelById(v.targetNodeId),F=(u=p.edgeGenerator)===null||u===void 0?void 0:u.call(p,Ue==null?void 0:Ue.getData(),He==null?void 0:He.getData(),E);E=Er(Er({},F),{sourceNodeId:C.node.id,sourceAnchorId:C.anchor.id,startPoint:{x:C.anchor.x,y:C.anchor.y},targetNodeId:v.targetNodeId,endPoint:Er({},v.endPoint)}),v.sourceNodeId===C.node.id&&v.sourceAnchorId===C.anchor.id&&(A=!0)}else if(g===kr.TARGET){var Ue=p.getNodeModelById(v.sourceNodeId),He=p.getNodeModelById(C.node.id),F=(d=p.edgeGenerator)===null||d===void 0?void 0:d.call(p,Ue==null?void 0:Ue.getData(),He==null?void 0:He.getData(),E);E=Er(Er({},F),{sourceNodeId:v.sourceNodeId,startPoint:Er({},v.startPoint),targetNodeId:C.node.id,targetAnchorId:C.anchor.id,endPoint:{x:C.anchor.x,y:C.anchor.y}}),v.targetNodeId===C.node.id&&v.targetAnchorId===C.anchor.id&&(A=!0)}}else{A=!0;var ne=ue.getData();p.eventCenter.emit(ve.CONNECTION_NOT_ALLOWED,{data:ne,msg:Z})}}else A=!0;if(A)r.recoveryEdge();else{var _e=v.getData();p.deleteEdgeById(v.id);var fe=p.addEdge(Er({},E));p.eventCenter.emit(ve.EDGE_EXCHANGE_NODE,{data:{newEdge:fe.getData(),oldEdge:_e}})}(f=r.preTargetNode)===null||f===void 0||f.setElementState(it.DEFAULT)}finally{var p=r.props.graphModel;p.eventCenter.emit(ve.ADJUST_POINT_DRAGEND,{e:c,data:r.stepDragData})}},r.recoveryEdge=function(){var l=r.props.edgeModel,u=r.oldEdge,d=u.startPoint,f=u.endPoint,c=u.pointsList;l.updateStartPoint(d),l.updateEndPoint(f),l.modelType!==We.LINE_EDGE&&(l.pointsList=c??[],l.initPoints())},r.getAdjustPointStyle=function(){var l=r.props.graphModel.theme,u=l.edgeAdjust;return u},r.state={dragging:!1,endX:0,endY:0},r.targetRuleResults=new Map,r.sourceRuleResults=new Map;var i=t.type,o=t.edgeModel,a=t.graphModel,s=a.eventCenter;return r.stepDragData={type:i,edgeData:o.getData()},r.stepDrag=new Qn({onDragStart:r.onDragStart,onDragging:r.onDragging,onDragEnd:r.onDragEnd,eventType:"ADJUST_POINT",isStopPropagation:!1,eventCenter:s,data:r.stepDragData}),r}return e.prototype.isAllowAdjust=function(t){var r=this.props,i=r.edgeModel,o=i.id,a=i.sourceNode,s=i.targetNode,l=i.sourceAnchorId,u=i.targetAnchorId,d=r.type,f,c,h,p;if(d===kr.SOURCE?(f=t.node,c=s,h=t.anchor,p=s.getAnchorInfo(u)):(f=a,c=t.node,p=t.anchor,h=a.getAnchorInfo(l)),this.preTargetNode&&this.preTargetNode!==t.node&&this.preTargetNode.setElementState(it.DEFAULT),this.preTargetNode=t.node,p.id===h.id)return{pass:!1,msg:"",newTargetNode:c};var v="".concat(f.id,"_").concat(c.id,"_").concat(h.id,"_").concat(p.id);if(!this.targetRuleResults.has(v)){var g=f.isAllowConnectedAsSource(c,h,p,o),y=c.isAllowConnectedAsTarget(f,h,p,o);this.sourceRuleResults.set(v,Wl(g)),this.targetRuleResults.set(v,Wl(y))}var m=this.sourceRuleResults.get(v),O=m.isAllPass,T=m.msg,C=this.targetRuleResults.get(v),A=C.isAllPass,E=C.msg,N=O&&A?it.ALLOW_CONNECT:it.NOT_ALLOW_CONNECT;return d===kr.SOURCE?f.setElementState(N):c.setElementState(N),{pass:O&&A,msg:E||T,newTargetNode:c}},e.prototype.render=function(){var t=this.props,r=t.x,i=t.y,o=t.getAdjustPointShape,a=t.edgeModel,s=this.state.dragging;return $("g",{pointerEvents:s?"none":"",onPointerDown:this.handleMouseDown,children:s?"":o(r,i,a)})},e})(Ye),Sk=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),yc=function(){return yc=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},yc.apply(this,arguments)};(function(n){Sk(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getArrowAttributes=function(){var t=this.props,r=t.arrowInfo,i=t.style,o=r.start,a=r.end,s={start:o,end:a,offset:i.offset,verticalLength:i.verticalLength,type:"end"},l=Ra(s),u=l.leftX,d=l.leftY,f=l.rightX,c=l.rightY;return yc({d:"M".concat(u," ").concat(d," L").concat(a.x," ").concat(a.y," L").concat(f," ").concat(c," z")},i)},e.prototype.getShape=function(){var t=this.getArrowAttributes(),r=t.d,i=t.strokeWidth,o=t.stroke,a=t.fill;return $(Ba,{d:r,fill:a,strokeWidth:i,stroke:o})},e.prototype.render=function(){return $("g",{className:"lf-arrow",children:this.getShape()})},e})(Ye);var Ok=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),ts=function(){return ts=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},ts.apply(this,arguments)},Ak=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},ou=(function(n){Ok(e,n);function e(){var t=n.call(this)||this;return t.textRef=xs(),t.handleHover=function(r,i){var o=t.props,a=o.model,s=o.graphModel.eventCenter;a.setHovered(r);var l=r?ve.EDGE_MOUSEENTER:ve.EDGE_MOUSELEAVE,u=a.getData();s.emit(l,{data:u,e:i})},t.setHoverOn=function(r){var i=t.props.model.isHovered;i||(t.textRef&&t.textRef.current&&t.textRef.current.setHoverOn(),t.handleHover(!0,r))},t.setHoverOff=function(r){var i=t.props.model.isHovered;i&&(t.textRef&&t.textRef.current&&t.textRef.current.setHoverOff(),t.handleHover(!1,r))},t.handleContextMenu=function(r){r.preventDefault(),t.contextMenuTime=new Date().getTime(),t.clickTimer&&clearTimeout(t.clickTimer);var i=t.props,o=i.model,a=i.graphModel,s=a.editConfigModel,l=a.getPointByClient({x:r.clientX,y:r.clientY});a.setElementStateById(o.id,it.SHOW_MENU,l.domOverlayPosition),s.isSilentMode||t.toFront(),o.isSelected||a.selectEdgeById(o.id);var u=o==null?void 0:o.getData();a.eventCenter.emit(ve.EDGE_CONTEXTMENU,{data:u,e:r,position:l})},t.handleMouseDown=function(r){r.stopPropagation(),t.startTime=new Date().getTime(),t.longPressTimer&&clearTimeout(t.longPressTimer),r.pointerType==="touch"&&(t.longPressTimer=window.setTimeout(function(){t.props.model.isDragging||t.handleContextMenu(r)},500))},t.handleMouseUp=function(){var r=t.props.model;t.mouseUpDrag=r.isDragging,t.longPressTimer&&(clearTimeout(t.longPressTimer),t.longPressTimer=void 0)},t.handleClick=function(r){if(t.startTime&&!t.mouseUpDrag){var i=r.button===2;if(!i){var o=r.detail===2,a=t.props,s=a.model,l=a.graphModel,u=s==null?void 0:s.getData(),d=l.getPointByClient({x:r.clientX,y:r.clientY});if(o){var f=l.editConfigModel,c=l.textEditElement,h=s.id,p=s.text,v=s.modelType;if(c&&c.id===h&&l.setElementStateById(h,it.DEFAULT),f.edgeTextEdit&&p.editable&&(s.setSelected(!1),l.setElementStateById(h,it.TEXT_EDIT)),v===We.POLYLINE_EDGE){var g=s,y=l.getPointByClient({x:r.x,y:r.y}).canvasOverlayPosition,m=y.x,O=y.y;g.dbClickPosition=Hm({x:m,y:O},g.points)}l.eventCenter.emit(ve.EDGE_DBCLICK,{data:u,e:r,position:d})}else{l.eventCenter.emit(ve.ELEMENT_CLICK,{data:u,e:r,position:d}),l.eventCenter.emit(ve.EDGE_CLICK,{data:u,e:r,position:d});var T=r.currentTarget,C=!Kt(window)&&hr(window.requestAnimationFrame)?window.requestAnimationFrame.bind(window):function(E){return setTimeout(E,0)};C(function(){T.focus()})}var A=l.editConfigModel;l.selectEdgeById(s.id,Xm(r,A)),A.isSilentMode||t.toFront()}}},t.handleFocus=function(){var r=t.props,i=r.model,o=r.graphModel;o.eventCenter.emit(ve.EDGE_FOCUS,{data:i.getData()})},t.handleBlur=function(){var r=t.props,i=r.model,o=r.graphModel;o.eventCenter.emit(ve.EDGE_BLUR,{data:i.getData()})},t}return e.prototype.getShape=function(){return $("g",{children:this.getEdge()})},e.prototype.getTextStyle=function(){},e.prototype.getText=function(){var t,r=this.props,i=r.model,o=r.graphModel,a=o.editConfigModel;if(a.edgeTextMode!==Zn.TEXT||i.state===it.TEXT_EDIT)return null;if(i.text){var s=!1;return a.edgeTextDraggable&&i.text.draggable&&(s=!0),$(uk,{ref:this.textRef,editable:a.edgeTextEdit&&((t=i.text.editable)!==null&&t!==void 0?t:!0),model:i,graphModel:o,draggable:s})}return null},e.prototype.getArrowInfo=function(){var t=this.props.model,r=t.startPoint,i=t.endPoint,o=t.isSelected,a=this.state.hover;return{start:r,end:i,hover:a,isSelected:o}},e.prototype.getLastTwoPoints=function(){var t=this.props.model,r=t.startPoint,i=t.endPoint;return[r,i]},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,r=t.id,i=t.getArrowStyle(),o=i.refY,a=o===void 0?0:o,s=i.refX,l=s===void 0?2:s,u=Ak(this.getLastTwoPoints(),2),d=u[0],f=u[1],c="auto";if(d&&f){var h=f.x-d.x,p=f.y-d.y;if(h!==0||p!==0){var v=$3(F3({x:h,y:p}));Number.isFinite(v)&&!Number.isNaN(v)&&(c=v)}}return $("g",{children:$("defs",{children:[$("marker",{id:"marker-start-".concat(r),refX:-l,refY:a,overflow:"visible",orient:"auto",markerUnits:"userSpaceOnUse",children:this.getStartArrow()}),$("marker",{id:"marker-end-".concat(r),refX:l,refY:a,overflow:"visible",orient:c,markerUnits:"userSpaceOnUse",children:this.getEndArrow()})]})})},e.prototype.getArrowPath=function(t,r){var i=r.stroke,o=r.fill,a=o===void 0?i:o,s=r.strokeWidth,l=r.offset,u=l===void 0?10:l,d=r.verticalLength,f=r.strokeLinecap,c=r.strokeLinejoin,h=r.transform,p="";switch(t){case"solid":p="M".concat(-u/4,",0 L").concat(3*u/4,",").concat(d," L").concat(3*u/4,",-").concat(d," Z");break;case"hollow":p="M".concat(-u/4,",0 L").concat(3*u/4,",").concat(d," L").concat(-u/4,",0 L").concat(3*u/4,",-").concat(d," L").concat(-u/4,",0 Z");break;case"diamond":p="M".concat(-u/2,",0 L0,").concat(d," L").concat(u/2,",0 L0,-").concat(d," L").concat(-u/2,",0 Z");break;case"circle":p="M".concat(-u/2,",0 A").concat(u/4,",").concat(u/4," 0 1,0 ").concat(u/2,",0 A").concat(u/4,",").concat(u/4," 0 1,0 ").concat(-u/2,",0 Z");break;default:p="";break}return $("path",{d:p,stroke:i,fill:a,strokeWidth:s,strokeLinecap:f,strokeLinejoin:c,transform:h})},e.prototype.getStartArrow=function(){var t=this.props.model,r=t.getArrowStyle(),i=r.stroke,o=r.strokeWidth,a=r.offset,s=r.verticalLength,l=r.startArrowType,u=l===void 0?"none":l,d=r.strokeLinecap,f=r.strokeLinejoin;return this.getArrowPath(u,{stroke:i,strokeWidth:o,offset:a,verticalLength:s,strokeLinecap:d,strokeLinejoin:f})},e.prototype.getEndArrow=function(){var t=this.props.model,r=t.getArrowStyle(),i=r.stroke,o=r.strokeWidth,a=r.offset,s=r.verticalLength,l=r.endArrowType,u=l===void 0?"solid":l,d=r.strokeLinecap,f=r.strokeLinejoin;return this.getArrowPath(u,{stroke:i,strokeWidth:o,offset:a,verticalLength:s,strokeLinecap:d,strokeLinejoin:f,transform:"rotate(180)"})},e.prototype.getAdjustPointShape=function(t,r,i){var o=i.getAdjustPointStyle();return $(ko,ts({className:"lf-edge-adjust-point"},o,{x:t,y:r}))},e.prototype.getAdjustPoints=function(){var t=this.props,r=t.model,i=t.graphModel,o=i.editConfigModel,a=o.adjustEdgeStartAndEnd,s=o.adjustEdgeStart,l=o.adjustEdgeEnd,u=r.getAdjustStart(),d=r.getAdjustEnd();return $("g",{children:[a&&s&&$(__,ts({type:kr.SOURCE},u,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:r,graphModel:i})),a&&l&&$(__,ts({type:kr.TARGET},d,{getAdjustPointShape:this.getAdjustPointShape,edgeModel:r,graphModel:i}))]})},e.prototype.getAnimation=function(){console.error("getAnimation is deprecated in 1.2.0, please use model.getEdgeAnimationStyle")},e.prototype.getAppendWidth=function(){return $("g",{})},e.prototype.getAppend=function(){return $("g",{className:"lf-edge-append",children:this.getAppendWidth()})},e.prototype.getEdge=function(){return null},e.prototype.toFront=function(){var t=this.props,r=t.graphModel,i=t.model;r.toFront(i.id)},e.prototype.render=function(){var t=this.props.model,r=t.isSelected,i=t.isHitable,o=t.isShowAdjustPoint;return $("g",{children:[$("g",{className:["lf-edge",!i&&"pointer-none",r&&"lf-edge-selected"].filter(Boolean).join(" "),style:{touchAction:"none",WebkitTouchCallout:"none"},onClick:this.handleClick,onContextMenu:this.handleContextMenu,onPointerDown:this.handleMouseDown,onPointerUp:this.handleMouseUp,onPointerCancel:this.handleMouseUp,onMouseOver:this.setHoverOn,onMouseEnter:this.setHoverOn,onMouseLeave:this.setHoverOff,onFocus:this.handleFocus,onBlur:this.handleBlur,children:[this.getShape(),this.getAppend(),this.getText(),this.getArrow()]}),o&&r?this.getAdjustPoints():""]})},e.isObserved=!1,e})(Ye),Ck=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),mc=function(){return mc=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},mc.apply(this,arguments)},Tk=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},b_=(function(n){Ck(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getEdge=function(){var t=this.props.model,r=t.getEdgeStyle(),i=t,o=i.path,a=i.isAnimation,s=i.arrowConfig,l=t.getEdgeAnimationStyle(),u=l.strokeDasharray,d=l.stroke,f=l.strokeDashoffset,c=l.animationName,h=l.animationDuration,p=l.animationIterationCount,v=l.animationTimingFunction,g=l.animationDirection;return $(Ba,mc({d:o},r,s,a?{strokeDasharray:u,stroke:d,style:{strokeDashoffset:f,animationName:c,animationDuration:h,animationIterationCount:p,animationTimingFunction:v,animationDirection:g}}:{}))},e.prototype.getAppendWidth=function(){var t=this.props.model.path;return $(Ba,{d:t,strokeWidth:10,stroke:"transparent",fill:"none"})},e.prototype.getArrowInfo=function(){var t=this.props.model,r=this.state.hover,i=t.isSelected,o=t.getArrowStyle().offset,a=t.pointsList.map(function(f){return{x:f.x,y:f.y}}),s=Tk($m(a,o),2),l=s[0],u=s[1],d={start:l,end:u,hover:r,isSelected:i};return d},e.prototype.getLastTwoPoints=function(){var t=this.props.model,r=t.getArrowStyle().offset,i=t.pointsList.map(function(o){return{x:o.x,y:o.y}});return $m(i,r)},e})(ou),Mk=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),_c=function(){return _c=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},_c.apply(this,arguments)},x_=(function(n){Mk(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getEdge=function(){var t=this.props.model,r=t.startPoint,i=t.endPoint,o=t.isAnimation,a=t.arrowConfig,s=t.getEdgeStyle(),l=t.getEdgeAnimationStyle(),u=l.strokeDasharray,d=l.stroke,f=l.strokeDashoffset,c=l.animationName,h=l.animationDuration,p=l.animationIterationCount,v=l.animationTimingFunction,g=l.animationDirection;return $(Io,_c({},s,{x1:r.x,y1:r.y,x2:i.x,y2:i.y},a,o?{strokeDasharray:u,stroke:d,style:{strokeDashoffset:f,animationName:c,animationDuration:h,animationIterationCount:p,animationTimingFunction:v,animationDirection:g}}:{}))},e.prototype.getAppendWidth=function(){var t=this.props.model,r=t.startPoint,i=t.endPoint,o={start:r,end:i},a=YL(o),s=a.d,l=a.strokeWidth,u=a.fill,d=a.strokeDasharray,f=a.stroke;return $(Ba,{d:s,fill:u,strokeWidth:l,stroke:f,strokeDasharray:d})},e})(ou),Nk=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Vi=function(){return Vi=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Vi.apply(this,arguments)},Pk=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},ns=(function(n){Nk(e,n);function e(){var t=n.call(this)||this;return t.onDragStart=function(){var r=t.props.model;r.dragAppendStart(),t.isShowAdjustPointTemp=r.isShowAdjustPoint,r.isShowAdjustPoint=!1},t.onDragging=function(r){var i=r.deltaX,o=r.deltaY,a=t.props,s=a.model,l=a.graphModel;t.isDragging=!0;var u=l.transformModel,d=l.editConfigModel,f=Pk(u.fixDeltaXY(i,o),2),c=f[0],h=f[1],p=s,v=d.adjustEdgeMiddle;v?t.appendInfo=p.dragAppendSimple(t.appendInfo,{x:c,y:h}):t.appendInfo=p.dragAppend(t.appendInfo,{x:c,y:h})},t.onDragEnd=function(){var r,i=t.props,o=i.model,a=i.graphModel.eventCenter,s=o;s.dragAppendEnd(),t.isDragging=!1,s.isShowAdjustPoint=(r=t.isShowAdjustPointTemp)!==null&&r!==void 0?r:!1,t.appendInfo=void 0,a.emit(ve.EDGE_ADJUST,{data:s.getData()})},t.beforeDragStart=function(r,i){i.draggable&&t.drag.handleMouseDown(r),t.appendInfo=i},t.drag=new Qn({onDragStart:t.onDragStart,onDragging:t.onDragging,onDragEnd:t.onDragEnd,isStopPropagation:!1}),t}return e.prototype.getEdge=function(){var t,r,i=this.props.model,o=i.points,a=i.isAnimation,s=i.arrowConfig,l=i.properties,u=i.getEdgeStyle(),d=i.getEdgeAnimationStyle(),f=d.strokeDasharray,c=d.stroke,h=d.strokeDashoffset,p=d.animationName,v=d.animationDuration,g=d.animationIterationCount,y=d.animationTimingFunction,m=d.animationDirection,O=(r=(t=l==null?void 0:l.radius)!==null&&t!==void 0?t:u==null?void 0:u.radius)!==null&&r!==void 0?r:0,T=(function(){if(!O||O<=0)return o;var C=bi(o),A=Wm(C,O,!1);return A.map(function(E){return"".concat(E.x,",").concat(E.y)}).join(" ")})();return $(b3,Vi({points:T},u,s,a?{strokeDasharray:f,stroke:c,style:{strokeDashoffset:h,animationName:p,animationDuration:v,animationIterationCount:g,animationTimingFunction:y,animationDirection:m}}:{}))},e.prototype.getArrowInfo=function(){var t=this.props.model,r=t.points,i=t.isSelected,o=this.state.hover,a=bi(r),s=a[0],l=a[0];return a.length>=2&&(s=a[a.length-2],l=a[a.length-1]),{start:s,end:l,hover:o,isSelected:i}},e.prototype.getLastTwoPoints=function(){var t=this.props.model,r=t.points,i=bi(r),o=i[0],a=i[0];return i.length>=2&&(o=i[i.length-2],a=i[i.length-1]),[o,a]},e.prototype.getAppendAttributes=function(t){var r=t.start,i=t.end,o;if(r.x===i.x&&r.y===i.y)o="";else{var a={start:r,end:i,offset:10,verticalLength:5},s=Ra(Vi(Vi({},a),{type:"start"})),l=Ra(Vi(Vi({},a),{type:"end"}));o="M".concat(s.leftX," ").concat(s.leftY,`
|
|
88
|
+
L`).concat(s.rightX," ").concat(s.rightY,`
|
|
89
|
+
L`).concat(l.rightX," ").concat(l.rightY,`
|
|
90
|
+
L`).concat(l.leftX," ").concat(l.leftY," z")}return{d:o,fill:"transparent",stroke:"transparent",strokeWidth:1,strokeDasharray:"4, 4"}},e.prototype.getAppendShape=function(t){var r=this.getAppendAttributes(t),i=r.d,o=r.strokeWidth,a=r.fill,s=r.strokeDasharray,l=r.stroke;return $(Ba,{d:i,fill:a,strokeWidth:o,stroke:l,strokeDasharray:s})},e.prototype.getAppendWidth=function(){for(var t=this,r=this.props,i=r.model,o=r.graphModel,a=i.pointsList,s=i.draggable,l=[],u=a.length,d=function(h){var p="lf-polyline-append",v={start:{x:a[h].x,y:a[h].y},end:{x:a[h+1].x,y:a[h+1].y},startIndex:h,endIndex:h+1,direction:ct.HORIZONTAL,draggable:!0},g=$("g",{className:p,children:f.getAppendShape(v)}),y=o.editConfigModel,m=y.adjustEdge,O=y.adjustEdgeMiddle;if(m&&s){var T=v.startIndex,C=v.endIndex,A=O&&(T===0||C===u-1);v.draggable=!A,v.start.x===v.end.x?(v.draggable&&(p+="-ew-resize"),v.direction=ct.VERTICAL):v.start.y===v.end.y&&(v.draggable&&(p+="-ns-resize"),v.direction=ct.HORIZONTAL),g=$("g",{className:f.isDragging?"lf-dragging":"lf-drag-able",onPointerDown:function(E){return t.beforeDragStart(E,v)},children:$("g",{className:p,children:f.getAppendShape(v)})})}l.push(g)},f=this,c=0;c<u-1;c++)d(c);return $("g",{children:l})},e})(ou),Uo=function(){return Uo=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Uo.apply(this,arguments)},Dk=(function(){function n(e){var t=this;this.nodeConfig=null,this.fakeNode=null,this.stopDrag=function(){t.nodeConfig=null,t.docPointerMove&&window.document.removeEventListener("pointermove",t.docPointerMove),t.docPointerUp&&window.document.removeEventListener("pointerup",t.docPointerUp)},this.dragEnter=function(i){!t.nodeConfig||t.fakeNode||(t.fakeNode=t.lf.createFakeNode(Uo(Uo({},t.nodeConfig),t.clientToLocalPoint({x:i.clientX,y:i.clientY}))))},this.onDragOver=function(i){if(t.lf.graphModel.eventCenter.emit(ve.BLANK_CANVAS_MOUSEMOVE,{e:i}),i.preventDefault(),t.fakeNode){var o=t.clientToLocalPoint({x:i.clientX,y:i.clientY}),a=o.x,s=o.y;t.fakeNode.moveTo(a,s);var l=t.fakeNode.getData();t.lf.setNodeSnapLine(l),t.lf.graphModel.eventCenter.emit(ve.NODE_DND_DRAG,{data:l,e:i})}return!1},this.onDragLeave=function(){t.fakeNode&&(t.lf.removeNodeSnapLine(),t.lf.graphModel.removeFakeNode(),t.fakeNode=null)},this.onDrop=function(i){!t.lf.graphModel||!i||!t.nodeConfig||(t.lf.addNode(Uo(Uo({},t.nodeConfig),t.clientToLocalPoint({x:i.clientX,y:i.clientY})),ve.NODE_DND_ADD,i),i.preventDefault(),i.stopPropagation(),t.nodeConfig=null,t.lf.removeNodeSnapLine(),t.lf.graphModel.removeFakeNode(),t.fakeNode=null)};var r=e.lf;this.lf=r}return n.prototype.clientToLocalPoint=function(e){var t=e.x,r=e.y,i=ci(this.lf.options,["grid","size"]),o=this.lf.graphModel.getPointByClient({x:t,y:r}),a=o.canvasOverlayPosition,s=a.x,l=a.y,u=this.lf.graphModel.editConfigModel.snapGrid;return{x:Ro(s,i,u),y:Ro(l,i,u)}},n.prototype.isInsideCanvas=function(e){var t=this.lf.graphModel.rootEl.querySelector('[name="canvas-overlay"]'),r=window.document.elementFromPoint(e.clientX,e.clientY);return r===t||r!==null&&!!t&&t.contains(r)},n.prototype.startDrag=function(e){var t=this,r=this.lf.graphModel.editConfigModel;r!=null&&r.isSilentMode||(this.nodeConfig=e,this.docPointerMove=function(i){if(t.nodeConfig){if(!t.isInsideCanvas(i)){t.onDragLeave();return}if(!t.fakeNode){t.dragEnter(i);return}t.onDragOver(i)}},this.docPointerUp=function(i){t.nodeConfig&&(t.isInsideCanvas(i)?t.onDrop(i):t.onDragLeave(),i.preventDefault(),i.stopPropagation(),t.stopDrag())},window.document.addEventListener("pointermove",this.docPointerMove),window.document.addEventListener("pointerup",this.docPointerUp))},n})();function Rk(n,e){n.on("node:mousemove",function(t){var r=t.data;e.setNodeSnapLine(r)}),n.on("node:mouseup",function(){e.clearSnapline()})}var Lk=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),ei=function(){return ei=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},ei.apply(this,arguments)},Ik=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},kk=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},jk=(function(n){Lk(e,n);function e(t){var r=n.call(this,t)||this;return r.ref=xs(),r.__prevText={type:"",text:"",id:""},r.keyupHandler=function(i){var o=r.props.graphModel.textEditElement;i.key==="Enter"&&i.altKey&&(o==null||o.setElementState(it.DEFAULT))},r.inputHandler=function(i){var o=i.target.innerText,a=r.props.graphModel.textEditElement;a&&(r.__prevText={type:a.type,text:o.replace(/(\r\n)+$|(\n)+$/,""),id:a.id})},r.keydownHandler=function(i){i.stopPropagation()},r.state={style:{left:0,top:0}},r}return e.getDerivedStateFromProps=function(t){var r,i=t.textEditElement,o=t.graphModel,a=o.transformModel,s=o.theme,l=s.inputText,u;if(i){if(!(!((r=i.text)===null||r===void 0)&&r.value)&&i.BaseType===Nt.EDGE){var d=i.text,f=i.textPosition,c=f.x,h=f.y;d.x=c,d.y=h,i.setText(d)}var p={resize:"auto",whiteSpace:"normal",wordBreak:"break-all"};if(i.BaseType===Nt.EDGE){var v=s.edgeText,g=v.overflowMode,y=v.lineHeight,m=v.wrapPadding,O=v.textWidth;O&&g==="autoWrap"&&(u=ei(ei({},p),{width:O,minWidth:O,lineHeight:y,padding:m}))}else if(i.BaseType===Nt.NODE){var T=s.nodeText,g=T.overflowMode,y=T.lineHeight,m=T.wrapPadding,O=T.textWidth,C=i.width,A=i.modelType,E=i.textWidth,N=E||O||C;(A!==We.TEXT_NODE&&g==="autoWrap"||A===We.TEXT_NODE&&O)&&(u=ei(ei({},p),{width:N,minWidth:N,lineHeight:y,padding:m}))}var B=i.text,Z=B.x,ue=B.y,me=kk(a.CanvasPointToHtmlPoint([Z,ue]),2),S=me[0],D=me[1];return{style:ei(ei({left:S,top:D},u),l)}}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 r=this.__prevText,i=r.text,o=r.id;t.updateText(o,i),t.eventCenter.emit(ve.TEXT_UPDATE,{data:ei({},this.__prevText)}),this.__prevText.id="",this.__prevText.text="",this.__prevText.type=""}},e.prototype.placeCaretAtEnd=function(t){if(window.getSelection!==void 0&&document.createRange!==void 0){var r=document.createRange();r.selectNodeContents(t),r.collapse(!1);var i=window.getSelection();i==null||i.removeAllRanges(),i==null||i.addRange(r)}},e.prototype.render=function(){var t,r=this.props.graphModel.textEditElement,i=this.state.style;return r?$("div",{contentEditable:!0,className:"lf-text-input",style:i,ref:this.ref,onKeyUp:this.keyupHandler,onKeyDown:this.keydownHandler,onKeyPress:this.keydownHandler,onInput:this.inputHandler,children:(t=r.text)===null||t===void 0?void 0:t.value},r.id):null},e.toolName="text-edit-tool",e=Ik([pn],e),e})(Ye),Bk=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Fk=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},bc=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},$k=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))},Hk=(function(n){Bk(e,n);function e(t){var r=n.call(this,t)||this;r.handleMouseDown=function(s){var l=r.props,u=l.graphModel.gridSize,d=l.lf,f=d.getTransform().SCALE_X;r.stepDrag.setStep(u*f),r.stepDrag.handleMouseDown(s)},r.handleWheelEvent=function(s){var l,u;s.preventDefault();var d=s.deltaX,f=s.deltaY,c=s.clientX,h=s.clientY,p=s.ctrlKey,v=new WheelEvent("wheel",{deltaX:d,deltaY:f,clientX:c,clientY:h,ctrlKey:p});(u=(l=r.props.lf.container)===null||l===void 0?void 0:l.querySelector('.lf-canvas-overlay[name="canvas-overlay"]'))===null||u===void 0||u.dispatchEvent(v)},r.onDragging=function(s){var l=s.deltaX,u=s.deltaY,d=r.props,f=d.graphModel,c=d.lf,h=c.getTransform(),p=h.SCALE_X,v=h.SCALE_Y,g=f.getSelectElements(!0);f.moveNodes(g.nodes.map(function(y){return y.id}),l/p,u/v)},r.handleContextMenu=function(s){s.preventDefault();var l=r.props,u=l.graphModel,d=l.graphModel,f=d.eventCenter,c=d.selectElements,h=u.getPointByClient({x:s.clientX,y:s.clientY}),p={nodes:[],edges:[]},v=$k([],bc(c.values()),!1);v.forEach(function(g){g.BaseType===Nt.NODE&&p.nodes.push(g.getData()),g.BaseType===Nt.EDGE&&p.edges.push(g.getData())}),f.emit(ve.SELECTION_CONTEXTMENU,{data:p,e:s,position:h})};var i=t.graphModel,o=i.gridSize,a=i.eventCenter;return r.stepDrag=new Qn({onDragging:r.onDragging,step:o,eventType:"SELECTION",eventCenter:a}),r}return e.prototype.render=function(){var t,r,i=this.props.graphModel,o=i.selectElements,a=i.transformModel,s=i.theme,l=this.props.lf.getTransform(),u=l.SCALE_X,d=l.SCALE_Y,f=s.multiSelect||{},c=f.xPadding,h=c===void 0?8:c,p=f.yPadding,v=p===void 0?8:p;if(!(o.size<=1)){var g=Number.MAX_SAFE_INTEGER,y=Number.MAX_SAFE_INTEGER,m=Number.MIN_SAFE_INTEGER,O=Number.MIN_SAFE_INTEGER;o.forEach(function(C){var A;C.BaseType===Nt.NODE&&(A=NL(C)),C.BaseType===Nt.EDGE&&(A=LL(C)),A!==void 0&&(g=Math.min(g,A.x),y=Math.min(y,A.y),m=Math.max(m,A.x1),O=Math.max(O,A.y1))}),t=bc(a.CanvasPointToHtmlPoint([g,y]),2),g=t[0],y=t[1],r=bc(a.CanvasPointToHtmlPoint([m,O]),2),m=r[0],O=r[1];var T={left:"".concat(g-20*u/2-h/2,"px"),top:"".concat(y-20*d/2-v/2,"px"),width:"".concat(m-g+20*u+h,"px"),height:"".concat(O-y+20*d+v,"px"),"border-width":"".concat(2*u,"px")};return $("div",{className:"lf-multiple-select",style:T,onPointerDown:this.handleMouseDown,onContextMenu:this.handleContextMenu,onWheel:this.handleWheelEvent})}},e.toolName="multiple-select-tool",e=Fk([pn],e),e})(Ye),xc=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},zk=[jk,Hk],Wk=(function(){function n(e){var t=this;this.toolMap=new Map,this.disabledToolMap=new Map,this.instance=e,nt(zk,function(o){t.isDisabled(o.toolName)||t.registerTool(o.toolName,o)});var r=e.graphModel,i=r.eventCenter;i.on("".concat(ve.GRAPH_TRANSFORM,",").concat(ve.NODE_CLICK,",").concat(ve.BLANK_CLICK," "),function(){var o,a=r.textEditElement,s=r.editConfigModel,l=s.edgeTextEdit,u=s.nodeTextEdit;(l||u)&&a&&((o=r.textEditElement)===null||o===void 0||o.setElementState(it.DEFAULT))})}return n.prototype.isDisabled=function(e){var t;return((t=this.instance.options.disabledTools)===null||t===void 0?void 0:t.indexOf(e))!==-1},n.prototype.registerTool=function(e,t){this.toolMap.set(e,t)},n.prototype.disableTool=function(e){var t=this.toolMap.get(e);if(t)return this.disabledToolMap.set(e,t),this.toolMap.delete(e),!0;throw new Error("禁用失败,不存在名为 ".concat(t," 的工具"))},n.prototype.enableTool=function(e){var t=this.disabledToolMap.get(e);if(t)return this.toolMap.set(e,t),this.disabledToolMap.delete(e),!0;throw new Error("不存在名为 ".concat(t," 的工具"))},n.prototype.getTools=function(){return Array.from(this.toolMap.values())},n.prototype.getInstance=function(){return this.instance},n.prototype.destroy=function(){this.toolMap.clear(),this.disabledToolMap.clear()},xc([z],n.prototype,"toolMap",void 0),xc([H],n.prototype,"disableTool",null),xc([H],n.prototype,"enableTool",null),n})();function Xk(n){throw new Error("[mobx-utils] "+n)}function au(n,e){e===void 0&&(e="Illegal state"),n||Xk(e)}var E_=function(n){return n&&n!==Object.prototype&&Object.getOwnPropertyNames(n).concat(E_(Object.getPrototypeOf(n))||[])},Gk=function(n){var e=E_(n),t=e.filter(function(r,i){return e.indexOf(r)===i});return t},Uk=function(n){return Gk(n).filter(function(e){return e!=="constructor"&&!~e.indexOf("__")})},w_="pending",su="fulfilled",Ec="rejected";function Yk(n){switch(this.state){case w_:return n.pending&&n.pending(this.value);case Ec:return n.rejected&&n.rejected(this.value);case su:return n.fulfilled?n.fulfilled(this.value):this.value}}function S_(n,e){if(au(arguments.length<=2,"fromPromise expects up to two arguments"),au(typeof n=="function"||typeof n=="object"&&n&&typeof n.then=="function","Please pass a promise or function to fromPromise"),n.isPromiseBasedObservable===!0)return n;typeof n=="function"&&(n=new Promise(n));var t=n;n.then(H("observableFromPromise-resolve",function(i){t.value=i,t.state=su}),H("observableFromPromise-reject",function(i){t.value=i,t.state=Ec})),t.isPromiseBasedObservable=!0,t.case=Yk;var r=e&&e.state===su?e.value:void 0;return fd(t,{value:r,state:w_},{},{deep:!1}),t}(function(n){n.reject=H("fromPromise.reject",function(t){var r=n(Promise.reject(t));return r.state=Ec,r.value=t,r});function e(t){t===void 0&&(t=void 0);var r=n(Promise.resolve(t));return r.state=su,r.value=t,r}n.resolve=H("fromPromise.resolve",e)})(S_||(S_={}));var lu=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};(function(){function n(e,t){var r=this;ox(function(){r.current=t,r.subscription=e.subscribe(r)})}return n.prototype.dispose=function(){this.subscription&&this.subscription.unsubscribe()},n.prototype.next=function(e){this.current=e},n.prototype.complete=function(){this.dispose()},n.prototype.error=function(e){this.current=e,this.dispose()},lu([z.ref],n.prototype,"current",void 0),lu([H.bound],n.prototype,"next",null),lu([H.bound],n.prototype,"complete",null),lu([H.bound],n.prototype,"error",null),n})();var uu=function(){return uu=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},uu.apply(this,arguments)},rs=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},Vk=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];(function(){function n(e){var t=this;this.model=e,this.localValues=z.map({}),this.localComputedValues=z.map({}),this.isPropertyDirty=function(r){return t.localValues.has(r)},au(cr(e),"createViewModel expects an observable object"),Uk(e).forEach(function(r){if(!(r===Re||r==="__mobxDidRunLazyInitializers")){if(au(Vk.indexOf(r)===-1,"The propertyname "+r+" is reserved and cannot be used with viewModels"),ip(e,r)){var i=zs(e,r).derivation;t.localComputedValues.set(r,gt(i.bind(t)))}var o=Object.getOwnPropertyDescriptor(e,r),a=o?{enumerable:o.enumerable}:{};Object.defineProperty(t,r,uu(uu({},a),{configurable:!0,get:function(){return ip(e,r)?t.localComputedValues.get(r).get():t.isPropertyDirty(r)?t.localValues.get(r):t.model[r]},set:H(function(s){s!==t.model[r]?t.localValues.set(r,s):t.localValues.delete(r)})}))}})}return Object.defineProperty(n.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"changedValues",{get:function(){return this.localValues.toJS()},enumerable:!1,configurable:!0}),n.prototype.submit=function(){var e=this;vo(this.localValues).forEach(function(t){var r=e.localValues.get(t),i=e.model[t];Cr(i)?i.replace(r):dn(i)?(i.clear(),i.merge(r)):rp(r)||(e.model[t]=r)}),this.localValues.clear()},n.prototype.reset=function(){this.localValues.clear()},n.prototype.resetProperty=function(e){this.localValues.delete(e)},rs([gt],n.prototype,"isDirty",null),rs([gt],n.prototype,"changedValues",null),rs([H.bound],n.prototype,"submit",null),rs([H.bound],n.prototype,"reset",null),rs([H.bound],n.prototype,"resetProperty",null),n})();function wc(n){if(!n)return"ROOT";for(var e=[];n.parent;)e.push(n.path),n=n.parent;return e.reverse().join("/")}function Sc(n){return cr(n)||Cr(n)||dn(n)}function Kk(n,e){var t=new WeakMap;function r(s){var l=t.get(s.object);i(s,l),e(s,wc(l),n)}function i(s,l){switch(s.type){case"add":o(s.newValue,l,s.name);break;case"update":a(s.oldValue),o(s.newValue,l,s.name||""+s.index);break;case"remove":case"delete":a(s.oldValue);break;case"splice":s.removed.map(a),s.added.forEach(function(f,c){return o(f,l,""+(s.index+c))});for(var u=s.index+s.addedCount;u<s.object.length;u++)if(Sc(s.object[u])){var d=t.get(s.object[u]);d&&(d.path=""+u)}break}}function o(s,l,u){if(Sc(s)){var d=t.get(s);if(d){if(d.parent!==l||d.path!==u)throw new Error("The same observable object cannot appear twice in the same tree,"+(" trying to assign it to '"+wc(l)+"/"+u+"',")+(" but it already exists at '"+wc(d.parent)+"/"+d.path+"'"))}else{var f={parent:l,path:u,dispose:op(s,r)};t.set(s,f),vx(s).forEach(function(c){var h=c[0],p=c[1];return o(p,f,h)})}}}function a(s){if(Sc(s)){var l=t.get(s);if(!l)return;t.delete(s),l.dispose(),px(s).forEach(a)}}return o(n,void 0,""),function(){a(n)}}var qk=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},n(e,t)};return function(e,t){n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})();(function(n){qk(e,n);function e(t,r,i){var o=i===void 0?{}:i,a=o.name,s=a===void 0?"ogm"+(Math.random()*1e3|0):a,l=o.keyToName,u=l===void 0?function(c){return""+c}:l,d=n.call(this)||this;d._keyToName=u,d._groupBy=r,d._ogmInfoKey=Symbol("ogmInfo"+s),d._base=t;for(var f=0;f<t.length;f++)d._addItem(t[f]);return d._disposeBaseObserver=op(d._base,function(c){if(c.type==="splice")ur(function(){for(var h=0,p=c.removed;h<p.length;h++){var v=p[h];d._removeItem(v)}for(var g=0,y=c.added;g<y.length;g++){var m=y[g];d._addItem(m)}});else if(c.type==="update")ur(function(){d._removeItem(c.oldValue),d._addItem(c.newValue)});else throw new Error("illegal state")}),d}return e.prototype.clear=function(){throw new Error("not supported")},e.prototype.delete=function(t){throw new Error("not supported")},e.prototype.set=function(t,r){throw new Error("not supported")},e.prototype.dispose=function(){this._disposeBaseObserver();for(var t=0;t<this._base.length;t++){var r=this._base[t],i=r[this._ogmInfoKey];i.reaction(),delete r[this._ogmInfoKey]}},e.prototype._getGroupArr=function(t){var r=n.prototype.get.call(this,t);return r===void 0&&(r=z([],{name:"GroupArray["+this._keyToName(t)+"]",deep:!1}),n.prototype.set.call(this,t,r)),r},e.prototype._removeFromGroupArr=function(t,r){var i=n.prototype.get.call(this,t);i.length===1?n.prototype.delete.call(this,t):(r===i.length-1||(i[r]=i[i.length-1],i[r][this._ogmInfoKey].groupArrIndex=r),i.length--)},e.prototype._addItem=function(t){var r=this,i=this._groupBy(t),o=this._getGroupArr(i),a={groupByValue:i,groupArrIndex:o.length,reaction:qh(function(){return r._groupBy(t)},function(s,l){var u=t[r._ogmInfoKey];r._removeFromGroupArr(u.groupByValue,u.groupArrIndex);var d=r._getGroupArr(s),f=d.length;d.push(t),u.groupByValue=s,u.groupArrIndex=f})};Object.defineProperty(t,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:a}),o.push(t)},e.prototype._removeItem=function(t){var r=t[this._ogmInfoKey];this._removeFromGroupArr(r.groupByValue,r.groupArrIndex),r.reaction(),delete t[this._ogmInfoKey]},e})(hd),Promise.resolve(),typeof queueMicrotask<"u"||typeof process<"u"&&process.nextTick;var Oc=function(){return Oc=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Oc.apply(this,arguments)},Zk=(function(){function n(e){this.undos=[],this.redos=[],this.callbacks=[],this.stopWatch=null,this.curData=null,this.maxSize=50,this.waitTime=100,this.eventCenter=e}return n.prototype.add=function(e){pf(kn(this.undos),e)||(this.undos.push(e),pf(this.curData,e)||(this.redos=[]),this.eventCenter.emit(ve.HISTORY_CHANGE,{data:{undos:this.undos,redos:this.redos,undoAble:this.undoAble(),redoAble:this.redoAble()}}),this.undos.length>this.maxSize&&this.undos.shift())},n.prototype.undoAble=function(){return this.undos.length>1},n.prototype.undo=function(){if(this.undoAble()){var e=this.undos.pop();this.redos.push(e);var t=this.undos.pop();return this.curData=Ee(t),t}},n.prototype.redoAble=function(){return this.redos.length>0},n.prototype.redo=function(){if(this.redoAble()){var e=this.redos.pop();return this.curData=Ee(e),e}},n.prototype.watch=function(e){var t=this;this.stopWatch&&this.stopWatch(),this.undos.push(e.modelToGraphData()),this.stopWatch=Kk(e,cl(function(){var r=e.modelToHistoryData();r&&t.add(Oc({},r))},this.waitTime))},n.prototype.destroy=function(){this.undos=[],this.redos=[],this.curData=null,this.stopWatch&&this.stopWatch()},n})(),Ac={exports:{}},O_;function Qk(){return O_||(O_=1,(function(n){(function(e,t,r){if(!e)return;for(var 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"},o={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},s={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l,u=1;u<20;++u)i[111+u]="f"+u;for(u=0;u<=9;++u)i[u+96]=u.toString();function d(E,N,B){if(E.addEventListener){E.addEventListener(N,B,!1);return}E.attachEvent("on"+N,B)}function f(E){if(E.type=="keypress"){var N=String.fromCharCode(E.which);return E.shiftKey||(N=N.toLowerCase()),N}return i[E.which]?i[E.which]:o[E.which]?o[E.which]:String.fromCharCode(E.which).toLowerCase()}function c(E,N){return E.sort().join(",")===N.sort().join(",")}function h(E){var N=[];return E.shiftKey&&N.push("shift"),E.altKey&&N.push("alt"),E.ctrlKey&&N.push("ctrl"),E.metaKey&&N.push("meta"),N}function p(E){if(E.preventDefault){E.preventDefault();return}E.returnValue=!1}function v(E){if(E.stopPropagation){E.stopPropagation();return}E.cancelBubble=!0}function g(E){return E=="shift"||E=="ctrl"||E=="alt"||E=="meta"}function y(){if(!l){l={};for(var E in i)E>95&&E<112||i.hasOwnProperty(E)&&(l[i[E]]=E)}return l}function m(E,N,B){return B||(B=y()[E]?"keydown":"keypress"),B=="keypress"&&N.length&&(B="keydown"),B}function O(E){return E==="+"?["+"]:(E=E.replace(/\+{2}/g,"+plus"),E.split("+"))}function T(E,N){var B,Z,ue,me=[];for(B=O(E),ue=0;ue<B.length;++ue)Z=B[ue],s[Z]&&(Z=s[Z]),N&&N!="keypress"&&a[Z]&&(Z=a[Z],me.push("shift")),g(Z)&&me.push(Z);return N=m(Z,me,N),{key:Z,modifiers:me,action:N}}function C(E,N){return E===null||E===t?!1:E===N?!0:C(E.parentNode,N)}function A(E){var N=this;if(E=E||t,!(N instanceof A))return new A(E);N.target=E,N._callbacks={},N._directMap={};var B={},Z,ue=!1,me=!1,S=!1;function D(F){F=F||{};var ne=!1,_e;for(_e in B){if(F[_e]){ne=!0;continue}B[_e]=0}ne||(S=!1)}function L(F,ne,_e,fe,Fe,R){var W,G,te=[],oe=_e.type;if(!N._callbacks[F])return[];for(oe=="keyup"&&g(F)&&(ne=[F]),W=0;W<N._callbacks[F].length;++W)if(G=N._callbacks[F][W],!(!fe&&G.seq&&B[G.seq]!=G.level)&&oe==G.action&&(oe=="keypress"&&!_e.metaKey&&!_e.ctrlKey||c(ne,G.modifiers))){var Se=!fe&&G.combo==Fe,Ce=fe&&G.seq==fe&&G.level==R;(Se||Ce)&&N._callbacks[F].splice(W,1),te.push(G)}return te}function Y(F,ne,_e,fe){N.stopCallback(ne,ne.target||ne.srcElement,_e,fe)||F(ne,_e)===!1&&(p(ne),v(ne))}N._handleKey=function(F,ne,_e){var fe=L(F,ne,_e),Fe,R={},W=0,G=!1;for(Fe=0;Fe<fe.length;++Fe)fe[Fe].seq&&(W=Math.max(W,fe[Fe].level));for(Fe=0;Fe<fe.length;++Fe){if(fe[Fe].seq){if(fe[Fe].level!=W)continue;G=!0,R[fe[Fe].seq]=1,Y(fe[Fe].callback,_e,fe[Fe].combo,fe[Fe].seq);continue}G||Y(fe[Fe].callback,_e,fe[Fe].combo)}var te=_e.type=="keypress"&&me;_e.type==S&&!g(F)&&!te&&D(R),me=G&&_e.type=="keydown"};function se(F){typeof F.which!="number"&&(F.which=F.keyCode);var ne=f(F);if(ne){if(F.type=="keyup"&&ue===ne){ue=!1;return}N.handleKey(ne,h(F),F)}}function ce(){clearTimeout(Z),Z=setTimeout(D,1e3)}function Ue(F,ne,_e,fe){B[F]=0;function Fe(oe){return function(){S=oe,++B[F],ce()}}function R(oe){Y(_e,oe,F),fe!=="keyup"&&(ue=f(oe)),setTimeout(D,10)}for(var W=0;W<ne.length;++W){var G=W+1===ne.length,te=G?R:Fe(fe||T(ne[W+1]).action);He(ne[W],te,fe,F,W)}}function He(F,ne,_e,fe,Fe){N._directMap[F+":"+_e]=ne,F=F.replace(/\s+/g," ");var R=F.split(" "),W;if(R.length>1){Ue(F,R,ne,_e);return}W=T(F,_e),N._callbacks[W.key]=N._callbacks[W.key]||[],L(W.key,W.modifiers,{type:W.action},fe,F,Fe),N._callbacks[W.key][fe?"unshift":"push"]({callback:ne,modifiers:W.modifiers,action:W.action,seq:fe,level:Fe,combo:F})}N._bindMultiple=function(F,ne,_e){for(var fe=0;fe<F.length;++fe)He(F[fe],ne,_e)},d(E,"keypress",se),d(E,"keydown",se),d(E,"keyup",se)}A.prototype.bind=function(E,N,B){var Z=this;return E=E instanceof Array?E:[E],Z._bindMultiple.call(Z,E,N,B),Z},A.prototype.unbind=function(E,N){var B=this;return B.bind.call(B,E,function(){},N)},A.prototype.trigger=function(E,N){var B=this;return B._directMap[E+":"+N]&&B._directMap[E+":"+N]({},E),B},A.prototype.reset=function(){var E=this;return E._callbacks={},E._directMap={},E},A.prototype.stopCallback=function(E,N){var B=this;if((" "+N.className+" ").indexOf(" mousetrap ")>-1||C(N,B.target))return!1;if("composedPath"in E&&typeof E.composedPath=="function"){var Z=E.composedPath()[0];Z!==E.target&&(N=Z)}return N.tagName=="INPUT"||N.tagName=="SELECT"||N.tagName=="TEXTAREA"||N.isContentEditable},A.prototype.handleKey=function(){var E=this;return E._handleKey.apply(E,arguments)},A.addKeycodes=function(E){for(var N in E)E.hasOwnProperty(N)&&(i[N]=E[N]);l=null},A.init=function(){var E=A(t);for(var N in E)N.charAt(0)!=="_"&&(A[N]=(function(B){return function(){return E[B].apply(E,arguments)}})(N))},A.init(),e.Mousetrap=A,n.exports&&(n.exports=A)})(typeof window<"u"?window:null,typeof window<"u"?document:null)})(Ac)),Ac.exports}var Jk=Qk();const e4=ps(Jk);var A_=function(){return A_=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},A_.apply(this,arguments)},jr=null;function C_(n,e){var t,r;return n.x+=e,n.y+=e,Ma(n.text)||(n.text.x+=e,n.text.y+=e),Ma((t=n.properties)===null||t===void 0?void 0:t._label)||(r=n.properties)===null||r===void 0||r._label.forEach(function(i){i.x+=e,i.y+=e}),n}function T_(n,e){return n.startPoint&&(n.startPoint.x+=e,n.startPoint.y+=e),n.endPoint&&(n.endPoint.x+=e,n.endPoint.y+=e),n.pointsList&&n.pointsList.length>0&&n.pointsList.forEach(function(t){t.x+=e,t.y+=e}),Ma(n.text)||(n.text.x+=e,n.text.y+=e),n}var Yo=40,du=40;function t4(n,e){var t=n.keyboard,r=t.options.keyboard;t.on(["cmd + c","ctrl + c"],function(){if(du=Yo,!(r!=null&&r.enabled)||e.textEditElement)return!0;var i=n.options.guards,o=e.getSelectElements(!1),a=i&&i.beforeClone?i.beforeClone(o):!0;return!a||o.nodes.length===0&&o.edges.length===0?(jr=null,!0):(jr=o,jr.nodes.forEach(function(s){return C_(s,Yo)}),jr.edges.forEach(function(s){return T_(s,Yo)}),!1)}),t.on(["cmd + v","ctrl + v"],function(){if(!(r!=null&&r.enabled)||e.textEditElement)return!0;if(jr&&(jr.nodes||jr.edges)){n.clearSelectElements();var i=n.addElements(jr,du);if(!i)return!0;i.nodes.forEach(function(o){return n.selectElementById(o.id,!0)}),i.edges.forEach(function(o){return n.selectElementById(o.id,!0)}),jr.nodes.forEach(function(o){return C_(o,Yo)}),jr.edges.forEach(function(o){return T_(o,Yo)}),du=du+Yo}return!1}),t.on(["cmd + z","ctrl + z"],function(){return!(r!=null&&r.enabled)||e.textEditElement?!0:(n.undo(),!1)}),t.on(["cmd + y","ctrl + y"],function(){return!(r!=null&&r.enabled)||e.textEditElement?!0:(n.redo(),!1)}),t.on(["backspace"],function(){if(!(r!=null&&r.enabled)||e.textEditElement)return!0;var i=e.getSelectElements(!0);return n.clearSelectElements(),i.edges.forEach(function(o){return o.id&&n.deleteEdge(o.id)}),i.nodes.forEach(function(o){return o.id&&n.deleteNode(o.id)}),!1})}var n4=(function(){function n(e){e.keyboard||(e.keyboard={enabled:!1}),this.options=e;var t=e.lf;this.target=t.container,this.mousetrap=new e4(this.target),e.keyboard.enabled&&!t.options.isSilentMode&&this.enable(!0)}return n.prototype.initShortcuts=function(){var e=this,t,r=((t=this.options.keyboard)!==null&&t!==void 0?t:{}).shortcuts;if(r)if(je(r))r.forEach(function(s){var l=s.keys,u=s.callback,d=s.action;return e.on(l,u,d)});else{var i=r.keys,o=r.callback,a=r.action;this.on(i,o,a)}},n.prototype.on=function(e,t,r){this.mousetrap.bind(this.getKeys(e),t,r)},Object.defineProperty(n.prototype,"disabled",{get:function(){var e,t;return((t=(e=this.options)===null||e===void 0?void 0:e.keyboard)===null||t===void 0?void 0:t.enabled)!==!0},enumerable:!1,configurable:!0}),n.prototype.off=function(e,t){this.mousetrap.unbind(this.getKeys(e),t)},n.prototype.enable=function(e){(this.disabled||e)&&(this.options.keyboard&&(this.options.keyboard.enabled=!0),this.target instanceof HTMLElement&&(this.target.setAttribute("tabindex","-1"),this.target.style.outline="none"))},n.prototype.disable=function(){this.disabled||(this.options.keyboard&&(this.options.keyboard.enabled=!1),this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))},n.prototype.destroy=function(){this.mousetrap.reset()},n.prototype.getKeys=function(e){var t=this;return(Array.isArray(e)?e:[e]).map(function(r){return t.formatKey(r)})},n.prototype.formatKey=function(e){return e.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command")},n})(),Oi=function(){return Oi=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Oi.apply(this,arguments)},fu=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},Cc=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))},Tc=Symbol("plugin registered by Logicflow.use"),Mc=(function(){function n(e){var t=this,r;this.viewMap=new Map,this.components=[],this.extension={},this.setView=function(u,d){return t.viewMap.set(u,d)},this.getView=function(u){return t.viewMap.get(u)};var i=Pa.get(e),o=i.container,a=i.width,s=i.height;this.options=i,this.container=this.initContainer(o,a,s),this.graphModel=new UI(Oi(Oi({},i),{container:this.container})),this.plugins=(r=i.plugins)!==null&&r!==void 0?r:[];var l=this.graphModel.eventCenter;this.tool=new Wk(this),this.dnd=new Dk({lf:this}),this.history=new Zk(l),this.keyboard=new n4({lf:this,keyboard:i.keyboard}),i.snapline!==!1&&(this.snaplineModel=new YI(this.graphModel,i.snaplineEpsilon),Rk(l,this.snaplineModel)),i.isSilentMode||(t4(this,this.graphModel),this.keyboard.initShortcuts()),this.defaultRegister(),this.installPlugins(i.disabledPlugins)}return n.prototype.initContainer=function(e,t,r){var i=document.createElement("div");return i.style.position="relative",i.style.width=t?"".concat(t,"px"):"100%",i.style.height=r?"".concat(r,"px"):"100%",e.innerHTML="",e.appendChild(i),i},Object.defineProperty(n.prototype,Symbol.toStringTag,{get:function(){return n.toStringTag},enumerable:!1,configurable:!0}),n.prototype.register=function(e,t,r){if(r===void 0&&(r=!0),typeof e!="string"){this.registerElement(e);return}var i={BaseEdge:ou,BaseEdgeModel:Yl,BaseNode:Si,BaseNodeModel:Ei,RectNode:$n,RectNodeModel:Fo,CircleNode:Xo,CircleNodeModel:Vl,PolygonNode:Go,PolygonNodeModel:Jl,TextNode:m_,TextNodeModel:c_,LineEdge:x_,LineEdgeModel:l_,DiamondNode:hc,DiamondNodeModel:tc,PolylineEdge:ns,PolylineEdgeModel:Xa,BezierEdge:b_,BezierEdgeModel:a_,EllipseNode:vc,EllipseNodeModel:nc,HtmlNode:gc,HtmlNodeModel:rc,h:ae,type:e};if(this.viewMap.forEach(function(u){var d=u.extendKey;d&&(i[d]=u)}),this.graphModel.modelMap.forEach(function(u){var d=u.extendKey;d&&(i[d]=u)}),t){var o=t(i),a=o.view,s=o.model,l=a;r&&!l.isObserved&&(l.isObserved=!0,l=pn(l)),this.setView(e,l),this.graphModel.setModel(e,s)}},n.prototype.registerElement=function(e){var t=e.view;e.isObserverView!==!1&&!t.isObserved&&(t.isObserved=!0,t=pn(t)),this.setView(e.type,t),this.graphModel.setModel(e.type,e.model)},n.prototype.batchRegister=function(e){var t=this;e===void 0&&(e=[]),nt(e,function(r){t.registerElement(r)})},n.prototype.defaultRegister=function(){var e=[{type:"rect",view:$n,model:Fo},{type:"circle",view:Xo,model:Vl},{type:"polygon",view:Go,model:Jl},{type:"text",view:m_,model:c_},{type:"ellipse",view:vc,model:nc},{type:"diamond",view:hc,model:tc},{type:"html",view:gc,model:rc},{type:"line",view:x_,model:l_},{type:"polyline",view:ns,model:Xa},{type:"bezier",view:b_,model:a_}];this.batchRegister(e)},n.prototype.addNode=function(e,t,r){return t===void 0&&(t=ve.NODE_ADD),this.graphModel.addNode(e,t,r)},n.prototype.deleteNode=function(e){var t=this.graphModel.getNodeModelById(e);if(!t)return!1;var r=t.getData(),i=this.options.guards,o=i!=null&&i.beforeDelete?i.beforeDelete(r):!0;return o&&this.graphModel.deleteNode(e),o},n.prototype.cloneNode=function(e){var t=this.graphModel.getNodeModelById(e),r=t==null?void 0:t.getData();if(r){var i=this.options.guards,o=i!=null&&i.beforeClone?i.beforeClone(r):!0;if(o)return this.graphModel.cloneNode(e)}},n.prototype.changeNodeId=function(e,t){return this.graphModel.changeNodeId(e,t)},n.prototype.changeNodeType=function(e,t){this.graphModel.changeNodeType(e,t)},n.prototype.getNodeModelById=function(e){return this.graphModel.getNodeModelById(e)},n.prototype.getNodeDataById=function(e){var t=this.getNodeModelById(e);return t==null?void 0:t.getData()},n.prototype.getNodeIncomingEdge=function(e){return this.graphModel.getNodeIncomingEdge(e)},n.prototype.getNodeOutgoingEdge=function(e){return this.graphModel.getNodeOutgoingEdge(e)},n.prototype.getNodeIncomingNode=function(e){return this.graphModel.getNodeIncomingNode(e)},n.prototype.getNodeOutgoingNode=function(e){return this.graphModel.getNodeOutgoingNode(e)},n.prototype.createFakeNode=function(e){var t=this.graphModel.modelMap.get(e.type);if(!t)return console.warn("不存在为".concat(e.type,"类型的节点")),null;var r=new t(Oi(Oi({},e),{virtual:!0}),this.graphModel);return this.graphModel.setFakeNode(r),r},n.prototype.removeFakeNode=function(){this.graphModel.removeFakeNode()},n.prototype.setNodeSnapLine=function(e){var t;(t=this.snaplineModel)===null||t===void 0||t.setNodeSnapLine(e)},n.prototype.removeNodeSnapLine=function(){var e;(e=this.snaplineModel)===null||e===void 0||e.clearSnapline()},n.prototype.setDefaultEdgeType=function(e){this.graphModel.setDefaultEdgeType(e)},n.prototype.addEdge=function(e){return this.graphModel.addEdge(e)},n.prototype.getEdgeDataById=function(e){var t=this.getEdgeModelById(e);return t==null?void 0:t.getData()},n.prototype.getEdgeModelById=function(e){return this.graphModel.getEdgeModelById(e)},n.prototype.getEdgeModels=function(e){var t=e.sourceNodeId,r=e.targetNodeId,i=[],o=this.graphModel.edges;return t&&r?nt(o,function(a){a.sourceNodeId===t&&a.targetNodeId===r&&i.push(a)}):t?nt(o,function(a){a.sourceNodeId===t&&i.push(a)}):r&&nt(o,function(a){a.targetNodeId===r&&i.push(a)}),i},n.prototype.changeEdgeId=function(e,t){return this.graphModel.changeEdgeId(e,t)},n.prototype.changeEdgeType=function(e,t){this.graphModel.changeEdgeType(e,t)},n.prototype.deleteEdge=function(e){var t=this.graphModel.getEdgeModelById(e);if(!t)return!1;var r=t.getData(),i=this.options.guards,o=i!=null&&i.beforeDelete?i.beforeDelete(r):!0;return o&&this.graphModel.deleteEdgeById(e),o},n.prototype.deleteEdgeByNodeId=function(e){var t=e.sourceNodeId,r=e.targetNodeId;t&&r?this.graphModel.deleteEdgeBySourceAndTarget(t,r):t?this.graphModel.deleteEdgeBySource(t):r&&this.graphModel.deleteEdgeByTarget(r)},n.prototype.getNodeEdges=function(e){return this.graphModel.getNodeEdges(e)},n.prototype.addElements=function(e,t){var r=this,i=e.nodes,o=e.edges;t===void 0&&(t=40),console.log("distance",t);var a={},s={nodes:[],edges:[]};return nt(i,function(l){var u=l.id,d=r.addNode(l);u&&(a[u]=d.id),s.nodes.push(d)}),nt(o,function(l){var u=l.sourceNodeId,d=l.targetNodeId;a[u]&&(u=a[u]),a[d]&&(d=a[d]);var f=r.graphModel.addEdge(Oi(Oi({},l),{sourceNodeId:u,targetNodeId:d}));s.edges.push(f)}),s},n.prototype.selectElementById=function(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),this.graphModel.selectElementById(e,t),!t&&r&&this.graphModel.toFront(e)},n.prototype.deselectElementById=function(e){this.graphModel.deselectElementById(e)},n.prototype.getSelectElements=function(e){return e===void 0&&(e=!0),this.graphModel.getSelectElements(e)},n.prototype.clearSelectElements=function(){this.graphModel.clearSelectElements()},n.prototype.getModelById=function(e){return this.graphModel.getElement(e)},n.prototype.getDataById=function(e){var t;return(t=this.graphModel.getElement(e))===null||t===void 0?void 0:t.getData()},n.prototype.deleteElement=function(e){var t,r,i,o=this.getModelById(e);if(!o)return!1;var a=(t={},t[Nt.NODE]=this.deleteNode,t[Nt.EDGE]=this.deleteEdge,t);return(i=(r=a[o.BaseType])===null||r===void 0?void 0:r.call(this,e))!==null&&i!==void 0?i:!1},n.prototype.setElementZIndex=function(e,t){return this.graphModel.setElementZIndex(e,t)},n.prototype.getAreaElement=function(e,t,r,i,o){return r===void 0&&(r=!0),i===void 0&&(i=!0),o===void 0&&(o=!1),this.graphModel.getAreaElement(e,t,r,i,o).map(function(a){return a.getData()})},n.prototype.setProperties=function(e,t){var r;(r=this.graphModel.getElement(e))===null||r===void 0||r.setProperties(an(t))},n.prototype.getProperties=function(e){var t;return(t=this.graphModel.getElement(e))===null||t===void 0?void 0:t.getProperties()},n.prototype.deleteProperty=function(e,t){var r;(r=this.graphModel.getElement(e))===null||r===void 0||r.deleteProperty(t)},n.prototype.updateAttributes=function(e,t){this.graphModel.updateAttributes(e,t)},n.prototype.editText=function(e){this.graphModel.editText(e)},n.prototype.updateText=function(e,t){this.graphModel.updateText(e,t)},n.prototype.updateEditConfig=function(e){var t=this.graphModel,r=t.editConfigModel,i=t.transformModel,o=r.snapGrid;if(r.updateEditConfig(e),(e==null?void 0:e.stopMoveGraph)!==void 0&&i.updateTranslateLimits(e.stopMoveGraph),e!=null&&e.isSilentMode?this.keyboard.disable():this.keyboard.enable(!0),!Kt(e==null?void 0:e.snapGrid)&&e.snapGrid!==o){var a=this.graphModel.grid.size,s=a===void 0?1:a;this.graphModel.updateGridSize(e.snapGrid?s:1)}this.emit(ve.EDIT_CONFIG_CHANGED,{data:r.getConfig()})},n.prototype.getEditConfig=function(){return this.graphModel.editConfigModel.getConfig()},n.prototype.setTheme=function(e,t){this.graphModel.setTheme(e,t)},n.prototype.getTheme=function(){return this.graphModel.getTheme()},n.prototype.focusByElement=function(e){var t=void 0,r=this.getNodeModelById(e);if(r){var i=r.getData(),o=i.x,a=i.y;t={x:o,y:a}}var s=this.getEdgeModelById(e);if(s){var l=s.textPosition,o=l.x,a=l.y;t={x:o,y:a}}t&&this.focusByCoordinate(t)},n.prototype.focusByCoordinate=function(e){var t=this.graphModel,r=t.transformModel,i=t.width,o=t.height,a=e.x,s=e.y;r.focusOn(a,s,i,o)},n.prototype.focusOn=function(e){if(typeof e=="string")this.focusByElement(e);else if("x"in e&&"y"in e)this.focusByCoordinate(e);else{var t=e.id,r=e.coordinate;t&&this.focusByElement(t),r&&this.focusByCoordinate(r)}},n.prototype.resize=function(e,t){this.graphModel.resize(e,t),this.options.width=this.graphModel.width,this.options.height=this.graphModel.height},n.prototype.toFront=function(e){this.graphModel.toFront(e)},n.prototype.getPointByClient=function(e,t){if(typeof e=="object")return this.graphModel.getPointByClient(e);if(typeof t=="number")return this.graphModel.getPointByClient({x:e,y:t})},n.prototype.getGraphData=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=this.getGraphRawData();return this.adapterOut?this.adapterOut.apply(this,Cc([r],fu(e),!1)):r},n.prototype.getGraphRawData=function(){return this.graphModel.modelToGraphData()},n.prototype.clearData=function(){this.graphModel.clearData(),this.render({})},n.prototype.setOverlapMode=function(e){this.graphModel.setOverlapMode(e)},n.prototype.renderRawData=function(e){this.graphModel.graphDataToModel(an(e)),this.options.history!==!1&&this.history.watch(this.graphModel),Yp($(QI,{getView:this.getView,tool:this.tool,options:this.options,dnd:this.dnd,snaplineModel:this.snaplineModel,graphModel:this.graphModel}),this.container),this.emit(ve.GRAPH_RENDERED,{data:this.graphModel.modelToGraphData(),graphModel:this.graphModel})},n.prototype.render=function(e){var t=Ee(e);this.adapterIn&&(t=this.adapterIn(t)),this.renderRawData(t)},n.prototype.undo=function(){if(this.history.undoAble()){var e=an(this.history.undo());this.clearSelectElements(),this.graphModel.graphDataToModel(e)}},n.prototype.redo=function(){if(this.history.redoAble()){var e=an(this.history.redo());this.clearSelectElements(),this.graphModel.graphDataToModel(e)}},n.prototype.zoom=function(e,t){var r=this.graphModel.transformModel;return r.zoom(e,t)},n.prototype.resetZoom=function(){var e=this.graphModel.transformModel;e.resetZoom()},n.prototype.setZoomMiniSize=function(e){var t=this.graphModel.transformModel;t.setZoomMiniSize(e)},n.prototype.setZoomMaxSize=function(e){var t=this.graphModel.transformModel;t.setZoomMaxSize(e)},n.prototype.getTransform=function(){var e=this.graphModel.transformModel,t=e.SCALE_X,r=e.SCALE_Y,i=e.TRANSLATE_X,o=e.TRANSLATE_Y;return{SCALE_X:t,SCALE_Y:r,TRANSLATE_X:i,TRANSLATE_Y:o}},n.prototype.translate=function(e,t){var r=this.graphModel.transformModel;r.translate(e,t)},n.prototype.resetTranslate=function(){var e=this.graphModel.transformModel,t=e.TRANSLATE_X,r=e.TRANSLATE_Y;this.translate(-t,-r)},n.prototype.translateCenter=function(){this.graphModel.translateCenter()},n.prototype.fitView=function(e,t){t===void 0&&(t=e),this.graphModel.fitView(e,t)},n.prototype.openEdgeAnimation=function(e){this.graphModel.openEdgeAnimation(e)},n.prototype.closeEdgeAnimation=function(e){this.graphModel.closeEdgeAnimation(e)},n.prototype.on=function(e,t){this.graphModel.eventCenter.on(e,t)},n.prototype.off=function(e,t){this.graphModel.eventCenter.off(e,t)},n.prototype.once=function(e,t){this.graphModel.eventCenter.once(e,t)},n.prototype.emit=function(e,t){this.graphModel.eventCenter.emit(e,t)},n.use=function(e,t){var r,i=e.pluginName;if(!i)throw new Error("请给插件指定 pluginName!");this.extensions.set(i,(r={},r[Tc]=Tc,r.extension=e,r.props=t,r))},n.addThemeMode=function(e,t){H3(e,t)},n.removeThemeMode=function(e){z3(e)},n.clearThemeMode=function(){W3()},n.prototype.installPlugins=function(e){var t=this;e===void 0&&(e=[]);var r=Array.from(n.extensions,function(o){var a=fu(o,2),s=a[1];return s}),i=Cc(Cc([],fu(this.plugins),!1),fu(r),!1);nt(i,function(o){var a,s;Tc in o?(a=o.extension,s=o.props):a=o;var l=a==null?void 0:a.pluginName;Cy(e,l)===-1&&t.installPlugin(a,s)})},n.prototype.installPlugin=function(e,t){var r,i;if("pluginName"in e&&"install"in e){var o=e.pluginName,a=e.install,s=e.render;o&&(a&&a.call(e,this,n),s&&this.components.push(s.bind(e)),this.extension[o]=e);return}var l=e,u=l.pluginName,d=new l({lf:this,LogicFlow:n,props:t,options:(i=(r=this.options.pluginsOptions)===null||r===void 0?void 0:r[u])!==null&&i!==void 0?i:{}});d.render&&this.components.push(d.render.bind(d)),this.extension[u]=d},n.prototype.destroy=function(){var e;this.clearData(),Yp(null,this.container),this.keyboard.destroy(),this.graphModel.destroy(),this.tool.destroy(),this.history.destroy();for(var t in this.extension){var r=this.extension[t];"destroy"in r&&((e=r.destroy)===null||e===void 0||e.call(r))}},n.extensions=new Map,n})();(function(n){n.toStringTag="LF.".concat(n.name)})(Mc||(Mc={}));const Ai=Mc;function pn(n){return yd(n)}const nh=class nh extends $n{getNodeStyle(){const e=super.getNodeStyle();return e.fill="#52c41a",e.stroke="#52c41a",e.strokeWidth=2,e}getTextStyle(){const e=super.getTextStyle();return e.color="#fff",e.fontSize=14,e}getShape(){const{x:e,y:t,width:r,height:i}=this.getAttributes(),o=i/2;return ae("rect",{x:e-r/2,y:t-i/2,width:r,height:i,rx:o,ry:o})}};nh.extendKey="start";let Nc=nh;const rh=class rh extends $n{getNodeStyle(){const e=super.getNodeStyle();return e.fill="#fff",e.stroke="#1677ff",e.strokeWidth=2,e}getTextStyle(){const e=super.getTextStyle();return e.color="#262626",e.fontSize=14,e}};rh.extendKey="approval";let Pc=rh;const ih=class ih extends Go{getNodeStyle(){const e=super.getNodeStyle();return e.fill="#fff7e6",e.stroke="#fa8c16",e.strokeWidth=2,e}getTextStyle(){const e=super.getTextStyle();return e.color="#262626",e.fontSize=13,e}getAttributes(){const e=super.getAttributes(),t=Math.max(80,e.width||80),r=Math.max(80,e.height||80),i=[[e.x,e.y-r/2],[e.x+t/2,e.y],[e.x,e.y+r/2],[e.x-t/2,e.y]];return{...e,points:i,width:t,height:r}}};ih.extendKey="condition";let Dc=ih;const oh=class oh extends $n{getNodeStyle(){const e=super.getNodeStyle();return e.fill="#f6ffed",e.stroke="#52c41a",e.strokeWidth=2,e.strokeDasharray="5,5",e}getTextStyle(){const e=super.getTextStyle();return e.color="#262626",e.fontSize=14,e}};oh.extendKey="copy";let Rc=oh;const ah=class ah extends Xo{getNodeStyle(){const e=super.getNodeStyle();return e.fill="#ff4d4f",e.stroke="#ff4d4f",e.strokeWidth=2,e}getTextStyle(){const e=super.getTextStyle();return e.color="#fff",e.fontSize=14,e}};ah.extendKey="end";let Lc=ah;function r4(n){n.register({type:"start",view:Nc,model:$n.model}),n.register({type:"approval",view:Pc,model:$n.model}),n.register({type:"condition",view:Dc,model:Go.model}),n.register({type:"copy",view:Rc,model:$n.model}),n.register({type:"end",view:Lc,model:Xo.model})}var M_={width:40,height:40},N_={width:40,height:40},P_={width:40,height:40},D_={width:100,height:80},R_={width:100,height:80},i4=(function(){function n(){globalThis._ids=this,this._ids=new Set}return n.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,function(e){var t=Math.random()*16|0,r=e==="x"?t:t&3|8;return r.toString(16)})},n.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},n})(),o4=(globalThis==null?void 0:globalThis._ids)||new i4;function Vo(){return o4.next()}var L_=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})();(function(n){L_(e,n);function e(t,r){return t.id||(t.id="Event_".concat(Vo())),t.text||(t.text=""),t.text&&typeof t.text=="string"&&(t.text={value:t.text,x:t.x,y:t.y+40}),n.call(this,t,r)||this}return e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedTargetRules=function(){var t=n.prototype.getConnectedTargetRules.call(this),r={message:"起始节点不能作为边的终点",validate:function(){return!1}};return t.push(r),t},e.extendKey="StartEventModel",e})(Vl),(function(n){L_(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.extendKey="StartEventNode",e})(Xo);var I_=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),cu=function(){return cu=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},cu.apply(this,arguments)};(function(n){I_(e,n);function e(t,r){return t.id||(t.id="Event_".concat(Vo())),t.text||(t.text=""),t.text&&typeof t.text=="string"&&(t.text={value:t.text,x:t.x,y:t.y+40}),n.call(this,t,r)||this}return e.prototype.setAttributes=function(){this.r=18},e.prototype.getConnectedSourceRules=function(){var t=n.prototype.getConnectedSourceRules.call(this),r={message:"结束节点不能作为边的起点",validate:function(){return!1}};return t.push(r),t},e.extendKey="EndEventModel",e})(Vl),(function(n){I_(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getAnchorStyle=function(){return{visibility:"hidden"}},e.prototype.getShape=function(){var t=this.props.model,r=t.getNodeStyle(),i=t,o=i.x,a=i.y,s=i.r,l=n.prototype.getShape.call(this);return ae("g",{},l,ae("circle",cu(cu({},r),{cx:o,cy:a,r:s-5})))},e.extendKey="EndEventView",e})(Xo);var k_=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})();(function(n){k_(e,n);function e(t,r){return t.id||(t.id="Flow_".concat(Vo())),n.call(this,t,r)||this}return e.extendKey="SequenceFlowModel",e})(Xa),(function(n){k_(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.extendKey="SequenceFlowEdge",e})(ns);var j_=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),is=function(){return is=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},is.apply(this,arguments)};(function(n){j_(e,n);function e(t,r){var i=this;return t.id||(t.id="Gateway_".concat(Vo())),t.text||(t.text=""),t.text&&typeof t.text=="string"&&(t.text={value:t.text,x:t.x,y:t.y+40}),i=n.call(this,t,r)||this,i.points=[[25,0],[50,25],[25,50],[0,25]],i}return e.extendKey="ExclusiveGatewayModel",e})(Jl),(function(n){j_(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getShape=function(){var t=this.props.model,r=t,i=r.x,o=r.y,a=r.width,s=r.height,l=r.points,u=t.getNodeStyle();return ae("g",{transform:"matrix(1 0 0 1 ".concat(i-a/2," ").concat(o-s/2,")")},ae("polygon",is(is({},u),{x:i,y:o,points:l})),ae("path",is({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"},u)))},e.extendKey="ExclusiveGatewayNode",e})(Go);var B_=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Ic=function(){return Ic=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Ic.apply(this,arguments)};(function(n){B_(e,n);function e(t,r){return t.id||(t.id="Activity_".concat(Vo())),n.call(this,t,r)||this}return e.extendKey="ServiceTaskModel",e})(Fo),(function(n){B_(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var t=this.props.model,r=t.x,i=t.y,o=t.width,a=t.height,s=t.getNodeStyle();return ae("svg",{x:r-o/2+5,y:i-a/2+5,width:30,height:30,viewBox:"0 0 1274 1024"},ae("path",{fill:s.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,r=t.x,i=t.y,o=t.width,a=t.height,s=t.radius,l=t.getNodeStyle();return ae("g",{},[ae("rect",Ic({x:r-o/2,y:i-a/2,rx:s,ry:s,width:o,height:a},l)),this.getLabelShape()])},e.extendKey="ServiceTaskNode",e})($n);var F_=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),hu=function(){return hu=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},hu.apply(this,arguments)};(function(n){F_(e,n);function e(t,r){return t.id||(t.id="Activity_".concat(Vo())),n.call(this,t,r)||this}return e.extendKey="UserTaskModel",e})(Fo),(function(n){F_(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var t=this.props.model,r=t.x,i=t.y,o=t.width,a=t.height,s=t.getNodeStyle();return ae("svg",{x:r-o/2+5,y:i-a/2+5,width:25,height:25,viewBox:"0 0 1274 1024"},ae("path",{fill:s.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,r=t.x,i=t.y,o=t.width,a=t.height,s=t.radius,l=t.getNodeStyle();return ae("g",{},[ae("rect",hu(hu({},l),{x:r-o/2,y:i-a/2,rx:s,ry:s,width:o,height:a})),this.getLabelShape()])},e.extendKey="UserTaskNode",e})($n);var a4=(function(){function n(){globalThis._ids=this,this._ids=new Set}return n.prototype.generateId=function(){return"xxxxxxx".replace(/[x]/g,function(e){var t=Math.random()*16|0,r=e==="x"?t:t&3|8;return r.toString(16)})},n.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},n})(),s4=(globalThis==null?void 0:globalThis._ids)||new a4;function $_(){return s4.next()}function H_(n){return Object.prototype.toString.call(n)}function l4(n){return" ".repeat(n)}function pu(n){var e=n;return H_(n)==="[object Object]"?(e={},Object.keys(n).forEach(function(t){var r=t;t.charAt(0)==="-"&&(r=t.substring(1)),e[r]=pu(n[t])})):Array.isArray(n)&&(e=[],n.forEach(function(t,r){e[r]=pu(t)})),e}function vu(n){return n==null?"":n.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function u4(n){var e=n;try{typeof e!="string"&&(e=JSON.parse(n))}catch{e=JSON.stringify(pu(n)).replace(/"/g,"'")}return vu(String(e))}var Ki=`
|
|
91
|
+
`;function gu(n,e,t){var r=l4(t);if(n!==0&&n!==!1&&!n)return Ki+r+"<".concat(e," />");var i="";if(e==="#text")return Ki+r+vu(String(n));if(e==="#cdata-section")return Ki+r+"<![CDATA["+n+"]]>";if(e==="#comment")return Ki+r+"<!--"+n+"-->";if("".concat(e).charAt(0)==="-")return" "+e.substring(1)+'="'+u4(n)+'"';if(Array.isArray(n))n.forEach(function(l){i+=gu(l,e,t+1)});else if(H_(n)==="[object Object]"){var o=Object.keys(n),a="",s="";i+=(t===0?"":Ki+r)+"<"+e,o.forEach(function(l){l.charAt(0)==="-"?a+=gu(n[l],l,t+1):s+=gu(n[l],l,t+1)}),i+=a+(s!==""?">".concat(s).concat(Ki+r,"</").concat(e,">"):" />")}else i+=Ki+r+"<".concat(e,">").concat(vu(String(n)),"</").concat(e,">");return i}function d4(n){var e="";for(var t in n)e+=gu(n[t],t,0);return e}var vn=function(){};vn.ObjTree=function(){return this},vn.ObjTree.VERSION="0.23",vn.ObjTree.prototype.xmlDecl=`<?xml version="1.0" encoding="UTF-8" ?>
|
|
92
|
+
`,vn.ObjTree.prototype.attr_prefix="-",vn.ObjTree.prototype.parseXML=function(n){var e;if(window.DOMParser){var t=new DOMParser,r=t.parseFromString(n,"application/xml");if(!r)return;e=r.documentElement}else window.ActiveXObject&&(t=new ActiveXObject("Microsoft.XMLDOM"),t.async=!1,t.loadXML(n),e=t.documentElement);if(e)return this.parseDOM(e)},vn.ObjTree.prototype.parseHTTP=function(n,e,t){var r={};for(var i in e)r[i]=e[i];if(r.method||(typeof r.postBody>"u"&&typeof r.postbody>"u"&&typeof r.parameters>"u"?r.method="get":r.method="post"),t){r.asynchronous=!0;var o=this,a=t,s=r.onComplete;r.onComplete=function(d){var f;d&&d.responseXML&&d.responseXML.documentElement&&(f=o.parseDOM(d.responseXML.documentElement)),a(f,d),s&&s(d)}}else r.asynchronous=!1;var l;if(typeof HTTP<"u"&&HTTP.Request){r.uri=n;var u=new HTTP.Request(r);u&&(l=u.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var u=new Ajax.Request(n,r);u&&(l=u.transport)}if(t)return l;if(l&&l.responseXML&&l.responseXML.documentElement)return this.parseDOM(l.responseXML.documentElement)},vn.ObjTree.prototype.parseDOM=function(n){if(n){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 t=this.parseElement(n);if(this.__force_array[n.nodeName]&&(t=[t]),n.nodeType!=11){var r={};r[n.nodeName]=t,t=r}return t}},vn.ObjTree.prototype.parseElement=function(n){if(n.nodeType!=7){if(n.nodeType==3||n.nodeType==4||n.nodeType==8){var e=n.nodeValue.match(/[^\x00-\x20]/);return e==null?void 0:n.nodeValue}var t=null,r={};if(n.attributes&&n.attributes.length){t={};for(var i=0;i<n.attributes.length;i++){var o=n.attributes[i].nodeName;if(typeof o=="string"){var a=n.attributes[i].nodeValue;try{a=JSON.parse(n.attributes[i].nodeValue.replace(/'/g,'"'))}catch{a=n.attributes[i].nodeValue}a&&(o=this.attr_prefix+o,typeof r[o]>"u"&&(r[o]=0),r[o]++,this.addNode(t,o,r[o],a))}}}if(n.childNodes&&n.childNodes.length){var s=!0;t&&(s=!1);for(var i=0;i<n.childNodes.length&&s;i++){var l=n.childNodes[i].nodeType;l==3||l==4||l==8||(s=!1)}if(s){t||(t="");for(var i=0;i<n.childNodes.length;i++)t+=n.childNodes[i].nodeValue}else{t||(t={});for(var i=0;i<n.childNodes.length;i++){var o=n.childNodes[i].nodeName;if(typeof o=="string"){var a=this.parseElement(n.childNodes[i]);a&&(typeof r[o]>"u"&&(r[o]=0),r[o]++,this.addNode(t,o,r[o],a))}}}}else t===null&&(t={});return t}},vn.ObjTree.prototype.addNode=function(n,e,t,r){this.__force_array[e]?(t==1&&(n[e]=[]),n[e][n[e].length]=r):t==1?n[e]=r:t==2?n[e]=[n[e],r]:n[e][n[e].length]=r},vn.ObjTree.prototype.writeXML=function(n){var e=this.hash_to_xml(null,n);return this.xmlDecl+e},vn.ObjTree.prototype.hash_to_xml=function(n,e){var t=[],r=[];for(var i in e)if(e.hasOwnProperty(i)){var o=e[i];i.charAt(0)!=this.attr_prefix?typeof o>"u"||o==null?t[t.length]="<"+i+" />":typeof o=="object"&&o.constructor==Array?t[t.length]=this.array_to_xml(i,o):typeof o=="object"?t[t.length]=this.hash_to_xml(i,o):t[t.length]=this.scalar_to_xml(i,o):r[r.length]=" "+i.substring(1)+'="'+this.xml_escape(o)+'"'}var a=r.join(""),s=t.join("");return typeof n>"u"||n==null||(t.length>0?s.match(/\n/)?s="<"+n+a+`>
|
|
93
|
+
`+s+"</"+n+`>
|
|
94
|
+
`:s="<"+n+a+">"+s+"</"+n+`>
|
|
95
|
+
`:s="<"+n+a+` />
|
|
96
|
+
`),s},vn.ObjTree.prototype.array_to_xml=function(n,e){for(var t=[],r=0;r<e.length;r++){var i=e[r];typeof i>"u"||i==null?t[t.length]="<"+n+" />":typeof i=="object"&&i.constructor==Array?t[t.length]=this.array_to_xml(n,i):typeof i=="object"?t[t.length]=this.hash_to_xml(n,i):t[t.length]=this.scalar_to_xml(n,i)}return t.join("")},vn.ObjTree.prototype.scalar_to_xml=function(n,e){return n=="#text"?this.xml_escape(e):"<"+n+">"+this.xml_escape(e)+"</"+n+`>
|
|
97
|
+
`},vn.ObjTree.prototype.xml_escape=vu;var f4=function(n){return new vn.ObjTree().parseXML(n)},c4=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),kc=function(){return kc=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},kc.apply(this,arguments)},yu=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},Br;(function(n){n.START="bpmn:startEvent",n.END="bpmn:endEvent",n.GATEWAY="bpmn:exclusiveGateway",n.USER="bpmn:userTask",n.SYSTEM="bpmn:serviceTask",n.FLOW="bpmn:sequenceFlow"})(Br||(Br={}));var z_=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef"],W_=["properties","startPoint","endPoint","pointsList"],X_=function(n){return String(n||"").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'")};function G_(n){var e=n?W_.concat(n):W_;return function(t){function r(i){var o={};return typeof i=="string"?i:Array.isArray(i)?i.map(function(a){return r(a)}):(Object.entries(i).forEach(function(a){var s=yu(a,2),l=s[0],u=s[1];typeof u!="object"?l.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(l)?o[l]=u:o["-".concat(l)]=u:e.includes(l)?o["-".concat(l)]=r(u):o[l]=r(u)}),o)}return r(t)}}function mu(n){var e={};return Object.entries(n).forEach(function(t){var r=yu(t,2),i=r[0],o=r[1];i.indexOf("-")===0?e[i.substring(1)]=pu(o):typeof o=="string"?e[i]=o:Object.prototype.toString.call(o)==="[object Object]"?e[i]=mu(o):Array.isArray(o)?e[i]=o.map(function(a){return mu(a)}):e[i]=o}),e}function h4(n,e,t){var r=new Map;e.nodes.forEach(function(o){var a,s={"-id":o.id};if(!((a=o.text)===null||a===void 0)&&a.value&&(s["-name"]=o.text.value),o.properties){var l=G_(t)(o.properties);Object.assign(s,l)}r.set(o.id,s),n[o.type]?Array.isArray(n[o.type])?n[o.type].push(s):n[o.type]=[n[o.type],s]:n[o.type]=s});var i=e.edges.map(function(o){var a,s,l=r.get(o.targetNodeId);l["bpmn:incoming"]?Array.isArray(l["bpmn:incoming"])?l["bpmn:incoming"].push(o.id):l["bpmn:incoming"]=[l["bpmn:incoming"],o.id]:l["bpmn:incoming"]=o.id;var u={"-id":o.id,"-sourceRef":o.sourceNodeId,"-targetRef":o.targetNodeId};if(!((a=o.text)===null||a===void 0)&&a.value&&(u["-name"]=(s=o.text)===null||s===void 0?void 0:s.value),o.properties){var d=G_(t)(o.properties);Object.assign(u,d)}return u});e.edges.forEach(function(o){var a=r.get(o.sourceNodeId);a["bpmn:outgoing"]?Array.isArray(a["bpmn:outgoing"])?a["bpmn:outgoing"].push(o.id):a["bpmn:outgoing"]=[a["bpmn:outgoing"],o.id]:a["bpmn:outgoing"]=o.id}),n[Br.FLOW]=i}function p4(n,e){n["bpmndi:BPMNEdge"]=e.edges.map(function(t){var r,i=t.id,o=t.pointsList.map(function(s){var l=s.x,u=s.y;return{"-x":l,"-y":u}}),a={"-id":"".concat(i,"_di"),"-bpmnElement":i,"di:waypoint":o};return!((r=t.text)===null||r===void 0)&&r.value&&(a["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-t.text.value.length*10/2,"-y":t.text.y-7,"-width":t.text.value.length*10,"-height":14}}),a}),n["bpmndi:BPMNShape"]=e.nodes.map(function(t){var r,i=t.id,o=100,a=80,s=t.x,l=t.y,u=Ci.shapeConfigMap.get(t.type);u&&(o=u.width,a=u.height),s-=o/2,l-=a/2;var d={"-id":"".concat(i,"_di"),"-bpmnElement":i,"dc:Bounds":{"-x":s,"-y":l,"-width":o,"-height":a}};return!((r=t.text)===null||r===void 0)&&r.value&&(d["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-t.text.value.length*10/2,"-y":t.text.y-7,"-width":t.text.value.length*10,"-height":14}}),d})}function v4(n){var e=[],t=[],r=n["bpmn:definitions"];if(r){var i=r["bpmn:process"],o=r["bpmndi:BPMNDiagram"],a=o==null?void 0:o["bpmndi:BPMNPlane"];if(!i||!a)return{nodes:e,edges:t};Object.keys(i).forEach(function(s){if(s.indexOf("bpmn:")===0){var l=i[s];if(s===Br.FLOW){var u=a["bpmndi:BPMNEdge"],d=(Array.isArray(u),u);t=y4(l,d)}else{var f=a["bpmndi:BPMNShape"],c=(Array.isArray(f),f);e=e.concat(g4(l,c,s))}}})}return{nodes:e,edges:t}}function g4(n,e,t){var r=[];if(Array.isArray(n))n.forEach(function(a){var s;Array.isArray(e)?s=e.find(function(u){return u["-bpmnElement"]===a["-id"]}):s=e;var l=U_(s,t,a);r.push(l)});else{var i=void 0;Array.isArray(e)?i=e.find(function(a){return a["-bpmnElement"]===n["-id"]}):i=e;var o=U_(i,t,n);r.push(o)}return r}function U_(n,e,t){var r=Number(n["dc:Bounds"]["-x"]),i=Number(n["dc:Bounds"]["-y"]),o=X_(t["-name"]),a=Ci.shapeConfigMap.get(e);a&&(r+=a.width/2,i+=a.height/2);var s;Object.entries(t).forEach(function(f){var c=yu(f,2),h=c[0],p=c[1];z_.indexOf(h)===-1&&(s||(s={}),s[h]=p)}),s&&(s=mu(s));var l;if(o&&(l={x:r,y:i,value:o},n["bpmndi:BPMNLabel"]&&n["bpmndi:BPMNLabel"]["dc:Bounds"])){var u=n["bpmndi:BPMNLabel"]["dc:Bounds"];l.x=Number(u["-x"])+Number(u["-width"])/2,l.y=Number(u["-y"])+Number(u["-height"])/2}var d={id:n["-bpmnElement"],type:e,x:r,y:i,properties:s};return l&&(d.text=l),d}function y4(n,e){var t=[];if(Array.isArray(n))n.forEach(function(i){var o;Array.isArray(e)?o=e.find(function(a){return a["-bpmnElement"]===i["-id"]}):o=e,t.push(Y_(o,i))});else{var r=void 0;Array.isArray(e)?r=e.find(function(i){return i["-bpmnElement"]===n["-id"]}):r=e,t.push(Y_(r,n))}return t}function Y_(n,e){var t,r=e["-name"]?X_("".concat(e["-name"])):"";if(r){var i=void 0;n["bpmndi:BPMNLabel"]&&n["bpmndi:BPMNLabel"]["dc:Bounds"]&&(i=n["bpmndi:BPMNLabel"]["dc:Bounds"]);var o=0;if(r.split(`
|
|
98
|
+
`).forEach(function(h){o<h.length&&(o=h.length)}),i)t={value:r,x:Number(i["-x"])+o*10/2,y:Number(i["-y"])+7};else{var a=n["di:waypoint"]||[],s=a[0],l=a[a.length-1]||s,u=(Number((s==null?void 0:s["-x"])||0)+Number((l==null?void 0:l["-x"])||0))/2,d=(Number((s==null?void 0:s["-y"])||0)+Number((l==null?void 0:l["-y"])||0))/2;t={value:r,x:u,y:d}}}var f;Object.entries(e).forEach(function(h){var p=yu(h,2),v=p[0],g=p[1];z_.indexOf(v)===-1&&(f||(f={}),f[v]=g)}),f&&(f=mu(f));var c={id:e["-id"],type:Br.FLOW,pointsList:n["di:waypoint"].map(function(h){return{x:Number(h["-x"]),y:Number(h["-y"])}}),sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:f};return t&&(c.text=t),c}var Ci=(function(){function n(e){var t=e.lf,r=this;this.adapterOut=function(i,o){var a=kc({},r.processAttributes);h4(a,i,o);var s={"-id":"BPMNPlane_1","-bpmnElement":a["-id"]};p4(s,i);var l=r.definitionAttributes;l["bpmn:process"]=a,l["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":s};var u={"bpmn:definitions":l};return u},this.adapterIn=function(i){if(i)return v4(i)},t.adapterIn=function(i){return r.adapterIn(i)},t.adapterOut=function(i,o){return r.adapterOut(i,o)},this.processAttributes={"-isExecutable":"true","-id":"Process_".concat($_())},this.definitionAttributes={"-id":"Definitions_".concat($_()),"-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 n.prototype.setCustomShape=function(e,t){n.shapeConfigMap.set(e,t)},n.pluginName="bpmn-adapter",n.shapeConfigMap=new Map,n})();Ci.shapeConfigMap.set(Br.START,{width:M_.width,height:M_.height}),Ci.shapeConfigMap.set(Br.END,{width:N_.width,height:N_.height}),Ci.shapeConfigMap.set(Br.GATEWAY,{width:P_.width,height:P_.height}),Ci.shapeConfigMap.set(Br.SYSTEM,{width:D_.width,height:D_.height}),Ci.shapeConfigMap.set(Br.USER,{width:R_.width,height:R_.height}),(function(n){c4(e,n);function e(t){var r=n.call(this,t)||this;r.adapterXmlIn=function(o){var a=typeof o=="string"?r.sanitizeNameAttributes(o):o,s=f4(a);return r.adapterIn(s)},r.adapterXmlOut=function(o,a){var s=r.adapterOut(o,a);return d4(s)};var i=t.lf;return i.adapterIn=r.adapterXmlIn,i.adapterOut=r.adapterXmlOut,r}return e.prototype.sanitizeNameAttributes=function(t){return t.replace(/name="([^"]*)"/g,function(r,i){var o=i.replace(/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">");return'name="'.concat(o,'"')})},e.pluginName="bpmnXmlAdapter",e})(Ci);var m4=(function(){function n(){globalThis._ids=this,this._ids=new Set}return n.prototype.generateId=function(){var e="xxxxxxx".replace(/[x]/g,function(t){var r=Math.random()*16|0,i=t==="x"?r:r&3|8;return i.toString(16)});return e},n.prototype.next=function(){for(var e=this.generateId();this._ids.has(e);)e=this.generateId();return this._ids.add(e),e},n})(),_4=(globalThis==null?void 0:globalThis._ids)||new m4;function b4(){return _4.next()}var V_=function(){return V_=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},V_.apply(this,arguments)},K_=function(){return K_=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},K_.apply(this,arguments)},q_=function(){return q_=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},q_.apply(this,arguments)},Z_=function(){return Z_=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Z_.apply(this,arguments)},Q_=function(){return Q_=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Q_.apply(this,arguments)};ae("circle",{cx:18,cy:18,r:11,style:"stroke-linecap: round;stroke-linejoin: round;stroke: rgb(34, 36, 42);stroke-width: 2px;fill: white"}),ae("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;"}),ae("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;"}),ae("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;"}),ae("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;"}),ae("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;"}),ae("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;"}),ae("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;"}),ae("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;"}),ae("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;"}),ae("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;"}),ae("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;"}),ae("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;"}),ae("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;"}),ae("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);"}),ae("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;"});var J_=function(){return J_=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},J_.apply(this,arguments)},e0=function(){return e0=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},e0.apply(this,arguments)},x4=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),qi=function(){return qi=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},qi.apply(this,arguments)},E4=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},w4=Qn,S4=(function(n){x4(e,n);function e(t){var r=n.call(this)||this;return r.updatePosition=function(i){var o=i.deltaX,a=i.deltaY,s=r.nodeModel,l=s.x,u=s.y;r.nodeModel.x=l+o/2,r.nodeModel.y=u+a/2,r.nodeModel.moveText(o/2,a/2)},r.getResize=function(i){var o=i.index,a=i.deltaX,s=i.deltaY,l=i.width,u=i.height,d=i.PCTResizeInfo,f=i.pct,c=f===void 0?1:f,h=i.freezeWidth,p=h===void 0?!1:h,v=i.freezeHeight,g=v===void 0?!1:v,y={width:l,height:u,deltaX:a,deltaY:s};if(d){var m=4,O=0,T=0;switch(o){case 0:T=(a*-1-s)/m;break;case 1:T=(a-s)/m;break;case 2:T=(a+s)/m;break;case 3:T=(a*-1+s)/m;break}T!==0&&(O=Math.round(T/d.ResizeBasis.basisHeight*1e5)/1e3),d.ResizePCT.widthPCT=Math.max(Math.min(d.ResizePCT.widthPCT+O,d.ScaleLimit.maxScaleLimit),d.ScaleLimit.minScaleLimit),d.ResizePCT.heightPCT=Math.max(Math.min(d.ResizePCT.heightPCT+O,d.ScaleLimit.maxScaleLimit),d.ScaleLimit.minScaleLimit);var C=Math.round(d.ResizePCT.widthPCT*d.ResizeBasis.basisWidth/100),A=Math.round(d.ResizePCT.heightPCT*d.ResizeBasis.basisHeight/100);switch(o){case 0:a=l-C,s=u-A;break;case 1:a=C-l,s=u-A;break;case 2:a=C-l,s=A-u;break;case 3:a=l-C,s=A-u;break}return y.width=C,y.height=A,y.deltaX=a/c,y.deltaY=s/c,y}switch(o){case 0:y.width=p?l:l-a*c,y.height=g?u:u-s*c;break;case 1:y.width=p?l:l+a*c,y.height=g?u:u-s*c;break;case 2:y.width=p?l:l+a*c,y.height=g?u:u+s*c;break;case 3:y.width=p?l:l-a*c,y.height=g?u:u+s*c;break}return y},r.updateEdgePointByAnchors=function(){var i=r.nodeModel,o=i.id,a=i.anchors,s=r.getNodeEdges(o);s.sourceEdges.forEach(function(l){var u=a.find(function(d){return d.id===l.sourceAnchorId});u&&l.updateStartPoint({x:u.x,y:u.y})}),s.targetEdges.forEach(function(l){var u=a.find(function(d){return d.id===l.targetAnchorId});u&&l.updateEndPoint({x:u.x,y:u.y})})},r.updateRect=function(i){var o=i.deltaX,a=i.deltaY,s=r.nodeModel,l=s.x,u=s.y,d=s.width,f=s.height,c=s.radius,h=s.PCTResizeInfo,p=r.nodeModel,v=p.minWidth,g=p.minHeight,y=p.maxWidth,m=p.maxHeight,O=r.index,T=v===y,C=g===m,A=r.getResize({index:O,deltaX:o,deltaY:a,width:d,height:f,PCTResizeInfo:h,pct:1,freezeWidth:T,freezeHeight:C});if(A.width<v||A.width>y||A.height<g||A.height>m){r.dragHandler.cancelDrag();return}r.updatePosition({deltaX:T?0:A.deltaX,deltaY:C?0:A.deltaY}),r.nodeModel.width=A.width,r.nodeModel.height=A.height,r.nodeModel.setProperties({nodeSize:{width:A.width,height:A.height}});var E={x:l,y:u,width:d,height:f,radius:c},N={x:r.nodeModel.x,y:r.nodeModel.y,width:r.nodeModel.width,height:r.nodeModel.height,radius:c};r.updateEdgePointByAnchors(),r.eventEmit({deltaX:o,deltaY:a,beforeNode:E,afterNode:N})},r.updateEllipse=function(i){var o=i.deltaX,a=i.deltaY,s=r.nodeModel,l=s.rx,u=s.ry,d=s.x,f=s.y,c=s.PCTResizeInfo,h=r.index,p=r.nodeModel,v=p.minWidth,g=p.minHeight,y=p.maxWidth,m=p.maxHeight,O=v===y,T=g===m,C=l,A=u,E=r.getResize({index:h,deltaX:o,deltaY:a,width:C,height:A,PCTResizeInfo:c,pct:1/2,freezeWidth:O,freezeHeight:T});if(E.width<v/2||E.width>y/2||E.height<g/2||E.height>m/2){r.dragHandler.cancelDrag();return}r.updatePosition({deltaX:O?0:E.deltaX,deltaY:T?0:E.deltaY}),r.nodeModel.rx=E.width,r.nodeModel.ry=E.height,r.nodeModel.setProperties({nodeSize:{rx:E.width,ry:E.height}});var N={x:d,y:f},B={rx:E.width,ry:E.height,x:r.nodeModel.x,y:r.nodeModel.y};r.updateEdgePointByAnchors(),r.eventEmit({deltaX:o,deltaY:a,beforeNode:qi(qi({},N),{rx:l,ry:u}),afterNode:B})},r.updateDiamond=function(i){var o=i.deltaX,a=i.deltaY,s=r.nodeModel,l=s.rx,u=s.ry,d=s.x,f=s.y,c=s.PCTResizeInfo,h=r.index,p=r.nodeModel,v=p.minWidth,g=p.minHeight,y=p.maxWidth,m=p.maxHeight,O=v===y,T=g===m,C=l,A=u,E=r.getResize({index:h,deltaX:o,deltaY:a,width:C,height:A,PCTResizeInfo:c,pct:1/2,freezeWidth:O,freezeHeight:T});if(E.width<v/2||E.width>y/2||E.height<g/2||E.height>m/2){r.dragHandler.cancelDrag();return}r.updatePosition({deltaX:O?0:E.deltaX,deltaY:T?0:E.deltaY}),r.nodeModel.rx=E.width,r.nodeModel.ry=E.height,r.nodeModel.setProperties({nodeSize:{rx:E.width,ry:E.height}});var N={x:d,y:f,rx:l,ry:u},B={rx:E.width,ry:E.height,x:r.nodeModel.x,y:r.nodeModel.y};r.updateEdgePointByAnchors(),r.eventEmit({deltaX:o,deltaY:a,beforeNode:N,afterNode:B})},r.eventEmit=function(i){var o=i.deltaX,a=i.deltaY,s=i.beforeNode,l=i.afterNode,u=r.nodeModel,d=u.id,f=u.modelType,c=u.type,h=qi({id:d,modelType:f,type:c},s),p=qi({id:d,modelType:f,type:c},l);r.graphModel.eventCenter.emit("node:resize",{preData:h,data:p,deltaX:o,deltaY:a,index:r.index,model:r.nodeModel})},r.onDragging=function(i){var o,a=i.deltaX,s=i.deltaY,l=r.graphModel.transformModel,u=r.nodeModel.modelType;o=E4(l.fixDeltaXY(a,s),2),a=o[0],s=o[1],u===We.RECT_NODE||u===We.HTML_NODE?r.updateRect({deltaX:a,deltaY:s}):u===We.ELLIPSE_NODE?r.updateEllipse({deltaX:a,deltaY:s}):u===We.DIAMOND_NODE&&r.updateDiamond({deltaX:a,deltaY:s})},r.onDragEnd=function(){var i=r.graphModel.gridSize,o=i===void 0?1:i,a=o*Math.round(r.nodeModel.x/o),s=o*Math.round(r.nodeModel.y/o);r.nodeModel.moveTo(a,s),r.updateEdgePointByAnchors()},r.index=t.index,r.nodeModel=t.model,r.graphModel=t.graphModel,r.dragHandler=new w4({onDragging:r.onDragging,onDragEnd:r.onDragEnd,step:1}),r}return e.prototype.getNodeEdges=function(t){for(var r=this.graphModel,i=r.edges,o=[],a=[],s=0;s<i.length;s++){var l=i[s];l.sourceNodeId===t?o.push(l):i[s].targetNodeId===t&&a.push(l)}return{sourceEdges:o,targetEdges:a}},e.prototype.render=function(){var t=this.props,r=t.x,i=t.y,o=t.index,a=t.model,s=a.getControlPointStyle();return $("g",{className:"lf-resize-control-".concat(o),children:$(Lr,qi({className:"lf-node-control",x:r,y:i},s,{onMouseDown:this.dragHandler.handleMouseDown}))})},e})(Ye),O4=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),_u=function(){return _u=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},_u.apply(this,arguments)},bu=(function(n){O4(e,n);function e(){var t=n.call(this)||this;return t.state={},t}return e.prototype.getResizeControl=function(){var t=this.props,r=t.model,i=t.graphModel,o=r.x,a=r.y,s=r.width,l=r.height,u={minX:o-s/2,minY:a-l/2,maxX:o+s/2,maxY:a+l/2},d=u.minX,f=u.minY,c=u.maxX,h=u.maxY,p=[{x:d,y:f},{x:c,y:f},{x:c,y:h},{x:d,y:h}];return p.map(function(v,g){return $(S4,_u({index:g},v,{model:r,graphModel:i}))})},e.prototype.getGroupSolid=function(){var t=this.props.model,r=t.x,i=t.y,o=t.width,a=t.height,s=t.getResizeOutlineStyle();return $(Lr,_u({},s,{x:r,y:i,width:o,height:a}))},e.prototype.render=function(){return $("g",{className:"lf-resize-control",children:[this.getGroupSolid(),this.getResizeControl()]})},e})(Ye),t0=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})();(function(n){t0(e,n);function e(t,r){var i=n.call(this,t,r)||this,o=t.properties.nodeSize;return o&&(i.rx=o.rx,i.ry=o.ry),i}return e.prototype.initNodeData=function(t){n.prototype.initNodeData.call(this,t),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var t=n.prototype.getOutlineStyle.call(this),r=this.graphModel.editConfigModel.isSilentMode;return r||(t.stroke="none",t.hover&&(t.hover.stroke="none")),t},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(t===void 0&&(t=!0),t){var r={widthPCT:100,heightPCT:100},i={basisWidth:this.rx,basisHeight:this.ry},o={maxScaleLimit:Math.min(this.maxWidth/(this.rx*2)*100,this.maxHeight/(this.ry*2)*100),minScaleLimit:Math.max(this.minWidth/(this.rx*2)*100,this.minHeight/(this.ry*2)*100)};this.PCTResizeInfo={ResizePCT:r,ResizeBasis:i,ScaleLimit:o}}else delete this.PCTResizeInfo},e})(nc),(function(n){t0(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var t=this.props,r=t.model,i=t.graphModel;return $(bu,{model:r,graphModel:i})},e.prototype.getResizeShape=function(){return n.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,r=t.model,i=t.graphModel.editConfigModel.isSilentMode;return $("g",{children:[this.getResizeShape(),r.isSelected&&!i?this.getControlGroup():""]})},e})(vc);var n0=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),jc=function(){return jc=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},jc.apply(this,arguments)};(function(n){n0(e,n);function e(t,r){var i=n.call(this,t,r)||this,o=t.properties.nodeSize;return o&&(i.rx=o.rx,i.ry=o.ry),i}return e.prototype.initNodeData=function(t){n.prototype.initNodeData.call(this,t),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3,this.gridSize=1},e.prototype.getOutlineStyle=function(){var t=n.prototype.getOutlineStyle.call(this),r=this.graphModel.editConfigModel.isSilentMode;return r||(t.stroke="none",t.hover&&(t.hover.stroke="none")),t},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(t===void 0&&(t=!0),t){var r={widthPCT:100,heightPCT:100},i={basisWidth:this.rx,basisHeight:this.ry},o={maxScaleLimit:Math.min(this.maxWidth/(this.rx*2)*100,this.maxHeight/(this.ry*2)*100),minScaleLimit:Math.max(this.minWidth/(this.rx*2)*100,this.minHeight/(this.ry*2)*100)};this.PCTResizeInfo={ResizePCT:r,ResizeBasis:i,ScaleLimit:o}}else delete this.PCTResizeInfo},e})(tc),(function(n){n0(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var t=this.props,r=t.model,i=t.graphModel;return $(bu,{model:r,graphModel:i})},e.prototype.getResizeShape=function(){var t=this.props.model,r=t.points,i=t.getNodeStyle();return $("g",{children:$(Zf,jc({},i,{points:r}))})},e.prototype.getShape=function(){var t=this.props,r=t.model.isSelected,i=t.graphModel.editConfigModel.isSilentMode;return $("g",{children:[this.getResizeShape(),r&&!i?this.getControlGroup():""]})},e})(hc);var r0=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})();(function(n){r0(e,n);function e(t,r){var i=n.call(this,t,r)||this,o=t.properties.nodeSize;return o&&(i.width=o.width,i.height=o.height),i}return e.prototype.initNodeData=function(t){n.prototype.initNodeData.call(this,t),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var t=n.prototype.getOutlineStyle.call(this),r=this.graphModel.editConfigModel.isSilentMode;return r||(t.stroke="none",t.hover&&(t.hover.stroke="none")),t},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(t===void 0&&(t=!0),t){var r={widthPCT:100,heightPCT:100},i={basisWidth:this.width,basisHeight:this.height},o={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:r,ResizeBasis:i,ScaleLimit:o}}else delete this.PCTResizeInfo},e})(rc),(function(n){r0(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var t=this.props,r=t.model,i=t.graphModel;return $(bu,{model:r,graphModel:i})},e.prototype.getResizeShape=function(){return n.prototype.getShape.call(this)},e.prototype.getShape=function(){var t=this.props,r=t.model.isSelected,i=t.graphModel.editConfigModel.isSilentMode;return $("g",{children:[this.getResizeShape(),r&&!i?this.getControlGroup():""]})},e})(gc);var i0=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),A4=(function(n){i0(e,n);function e(t,r){var i=n.call(this,t,r)||this,o=t.properties.nodeSize;return o&&(i.width=o.width,i.height=o.height),i}return e.prototype.initNodeData=function(t){n.prototype.initNodeData.call(this,t),this.minWidth=30,this.minHeight=30,this.maxWidth=2e3,this.maxHeight=2e3},e.prototype.getOutlineStyle=function(){var t=n.prototype.getOutlineStyle.call(this),r=this.graphModel.editConfigModel.isSilentMode;return r||(t.stroke="none",t.hover&&(t.hover.stroke="none")),t},e.prototype.getControlPointStyle=function(){return{width:7,height:7,fill:"#FFFFFF",stroke:"#000000"}},e.prototype.enableProportionResize=function(t){if(t===void 0&&(t=!0),t){var r={widthPCT:100,heightPCT:100},i={basisWidth:this.width,basisHeight:this.height},o={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:r,ResizeBasis:i,ScaleLimit:o}}else delete this.PCTResizeInfo},e})(Fo),C4=(function(n){i0(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var t=this.props,r=t.model,i=t.graphModel;return $(bu,{model:r,graphModel:i})},e.prototype.getResizeShape=function(){return n.prototype.getShape.call(this)},e.prototype.getShape=function(){return $("g",{children:this.getResizeShape()})},e})($n),o0=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),xu=function(){return xu=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},xu.apply(this,arguments)},Zi=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},Qi=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))},a0=500,s0=300,T4=-1e4;(function(n){o0(e,n);function e(){var t=n.apply(this,Qi([],Zi(arguments),!1))||this;return t.isGroup=!0,t.isFolded=!1,t.unfoldedWidth=a0,t.unfoldedHeight=s0,t.childrenLastFoldStatus={},t}return e.prototype.initNodeData=function(t){var r=this;n.prototype.initNodeData.call(this,t);var i=[];je(t.children)&&(i=t.children),this.children=new Set(i),this.width=a0,this.height=s0,this.foldedWidth=80,this.foldedHeight=60,this.zIndex=T4,this.radius=0,this.text.editable=!1,this.text.draggable=!1,this.isRestrict=!1,this.resizable=!1,this.autoToFront=!1,this.foldable=!1,this.properties.isFolded===void 0&&(this.properties.isFolded=!1),this.isFolded=!!this.properties.isFolded,setTimeout(function(){r.isFolded&&r.foldGroup(r.isFolded)})},e.prototype.foldGroup=function(t){var r=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 i=Qi(Qi([],Zi(this.incoming.edges),!1),Zi(this.outgoing.edges),!1);this.children.forEach(function(o){var a=r.graphModel.getElement(o);if(a){var s=a.isFolded;if(a.isGroup&&!a.isFolded&&a.foldGroup(t),a.isGroup&&!t){var l=r.childrenLastFoldStatus[o];l!==void 0&&l!==a.isFolded&&a.foldGroup(l)}r.childrenLastFoldStatus[o]=!!s,a.visible=!t;var u=a.incoming.edges,d=a.outgoing.edges;i=Qi(Qi(Qi([],Zi(i),!1),Zi(u),!1),Zi(d),!1)}}),this.foldEdge(t,i)}},e.prototype.getAnchorStyle=function(t){var r=n.prototype.getAnchorStyle.call(this,t);return r.stroke="transparent",r.fill="transparent",r.hover.fill="transparent",r.hover.stroke="transparent",r},e.prototype.foldEdge=function(t,r){var i=this;r.forEach(function(o,a){var s=o.id,l=o.sourceNodeId,u=o.targetNodeId,d=o.startPoint,f=o.endPoint,c=o.type,h=o.text,p=o.getProperties(),v={id:"".concat(s,"__").concat(a),sourceNodeId:l,targetNodeId:u,startPoint:d,endPoint:f,type:c,properties:p,text:h==null?void 0:h.value};o.virtual&&i.graphModel.deleteEdgeById(o.id);var g=i.graphModel.group.getNodeGroup(u);g||(g=i.graphModel.getNodeModelById(u));var y=i.graphModel.group.getNodeGroup(l);y||(y=i.graphModel.getNodeModelById(l)),t&&o.visible!==!1&&(i.children.has(l)||i.id===l?(v.startPoint=void 0,v.sourceNodeId=i.id):(v.endPoint=void 0,v.targetNodeId=i.id),(g.id!==i.id||y.id!==i.id)&&i.createVirtualEdge(v),o.visible=!1),!t&&o.visible===!1&&(g&&g.isGroup&&g.isFolded?(v.targetNodeId=g.id,v.endPoint=void 0,i.createVirtualEdge(v)):y&&y.isGroup&&y.isFolded?(v.sourceNodeId=y.id,v.startPoint=void 0,i.createVirtualEdge(v)):o.visible=!0)})},e.prototype.createVirtualEdge=function(t){t.pointsList=void 0;var r=this.graphModel.addEdge(t);r.virtual=!0,r.text.editable=!1,r.isFoldedEdge=!0},e.prototype.isInRange=function(t){var r=t.minX,i=t.minY,o=t.maxX,a=t.maxY;return r>=this.x-this.width/2&&o<=this.x+this.width/2&&i>=this.y-this.height/2&&a<=this.y+this.height/2},e.prototype.isAllowMoveTo=function(t){var r=t.minX,i=t.minY,o=t.maxX,a=t.maxY;return{x:r>=this.x-this.width/2&&o<=this.x+this.width/2,y:i>=this.y-this.height/2&&a<=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 t=this,r=n.prototype.getData.call(this);r.children=[],this.children.forEach(function(o){var a=t.graphModel.getNodeModelById(o);a&&!a.virtual&&r.children.push(o)});var i=r.properties;return i==null||delete i.groupAddable,i==null||delete i.isFolded,r},e.prototype.getHistoryData=function(){var t=n.prototype.getData.call(this);t.children=Qi([],Zi(this.children),!1),t.isGroup=!0;var r=t.properties;return r==null||delete r.groupAddable,r!=null&&r.isFolded&&(t.x=t.x+this.unfoldedWidth/2-this.foldedWidth/2,t.y=t.y+this.unfoldedHeight/2-this.foldedHeight/2),t},e.prototype.isAllowAppendIn=function(t){return console.info("_nodeData",t),!0},e.prototype.toBack=function(){this.zIndex--},e})(A4),(function(n){o0(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getControlGroup=function(){var t=this.props.model,r=t.resizable,i=t.properties;return r&&!i.isFolded?n.prototype.getControlGroup.call(this):null},e.prototype.getAddableShape=function(){var t=this.props.model,r=t.width,i=t.height,o=t.x,a=t.y,s=t.radius,l=t.properties,u=t.getAddableOutlineStyle;if(!l.groupAddable)return null;var d=this.props.model.getNodeStyle().strokeWidth,f=d===void 0?0:d,c=u(),h=r+f+8,p=i+f+8;return ae("rect",xu(xu({},c),{width:h,height:p,x:o-h/2,y:a-p/2,rx:s,ry:s}))},e.prototype.getFoldIcon=function(){var t=this.props.model,r=t.x-t.width/2+5,i=t.y-t.height/2+5;if(!t.foldable)return null;var o=ae("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:t.properties.isFolded?"M ".concat(r+3,",").concat(i+6," ").concat(r+11,",").concat(i+6," M").concat(r+7,",").concat(i+2," ").concat(r+7,",").concat(i+10):"M ".concat(r+3,",").concat(i+6," ").concat(r+11,",").concat(i+6," ")});return ae("g",{},[ae("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(){console.log("fold click"),t.foldGroup(!t.properties.isFolded)}}),o])},e.prototype.getResizeShape=function(){return ae("g",{},[this.getAddableShape(),n.prototype.getResizeShape.call(this),this.getFoldIcon()])},e})(C4);var l0=function(){return l0=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},l0.apply(this,arguments)},u0=function(){return u0=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},u0.apply(this,arguments)},d0=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),os=function(){return os=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},os.apply(this,arguments)};function M4(n){var e=(function(r){d0(i,r);function i(o,a){o.id||(o.id="Flow_".concat(b4()));var s=os(os(os({},{}),o.properties),{isDefaultFlow:!1});return o.properties=s,r.call(this,o,a)||this}return i.extendKey="SequenceFlowModel",i})(Xa),t=(function(r){d0(i,r);function i(){return r!==null&&r.apply(this,arguments)||this}return i.prototype.getStartArrow=function(){var o=this.props.model,a=o.properties.isDefaultFlow;return a?ae("path",{refX:15,stroke:"#000000",strokeWidth:2,d:"M 20 5 10 -5 z"}):ae("path",{d:""})},i.extendKey="SequenceFlowEdge",i})(ns);return{type:"bpmn:sequenceFlow",view:t,model:e}}M4();var f0={width:40,height:40},c0={width:40,height:40},h0={width:100,height:80},Eu={width:100,height:80},p0={width:100,height:80},v0={width:100,height:80},g0={width:100,height:80},y0={width:100,height:80},m0={width:100,height:80},_0={width:100,height:80};function b0(n){return Object.prototype.toString.call(n)}function x0(n){return" ".repeat(n)}function wu(n){return b0(n)==="[object Object]"?Object.keys(n).reduce(function(e,t){var r=t;return t.charAt(0)==="-"&&(r=t.substring(1)),e[r]=wu(n[t]),e},{}):Array.isArray(n)?n.map(function(e){return wu(e)}):n}function Su(n){return n==null?"":n.toString().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function N4(n){var e=n;try{typeof e!="string"&&(e=JSON.parse(n))}catch{e=JSON.stringify(wu(n)).replace(/"/g,"'")}return Su(String(e))}var E0=`
|
|
99
|
+
`;function Ou(n,e,t){var r=x0(t),i="",o=E0+r;if(e==="-json")return"";if(n!==0&&n!==!1&&!n)return"".concat(o,"<").concat(e," />");if(e==="#text")return o+Su(String(n));if(e==="#cdata-section")return"".concat(o,"<![CDATA[").concat(n,"]]>");if(e==="#comment")return"".concat(o,"<!--").concat(n,"-->");if("".concat(e).charAt(0)==="-")return" ".concat(e.substring(1),'="').concat(N4(n),'"');if(Array.isArray(n))i+=n.map(function(u){return Ou(u,e,t+1)}).join("");else if(b0(n)==="[object Object]"){var a=Object.keys(n),s="",l=n["-json"]?E0+x0(t+1)+n["-json"]:"";i+="".concat(t===0?"":o,"<").concat(e),a.forEach(function(u){u.charAt(0)==="-"?s+=Ou(n[u],u,t+1):l+=Ou(n[u],u,t+1)}),i+=s+(l!==""?">".concat(l).concat(o,"</").concat(e,">"):" />")}else i+="".concat(o,"<").concat(e,">").concat(Su(String(n)),"</").concat(e,">");return i}function P4(n){var e="";for(var t in n)e+=Ou(n[t],t,0);return e}var gn=function(){};gn.ObjTree=function(){return this},gn.ObjTree.VERSION="0.23",gn.ObjTree.prototype.xmlDecl=`<?xml version="1.0" encoding="UTF-8" ?>
|
|
100
|
+
`,gn.ObjTree.prototype.attr_prefix="-",gn.ObjTree.prototype.parseXML=function(n){var e;if(window.DOMParser){var t=new DOMParser,r=t.parseFromString(n,"application/xml");if(!r)return;e=r.documentElement}else window.ActiveXObject&&(t=new ActiveXObject("Microsoft.XMLDOM"),t.async=!1,t.loadXML(n),e=t.documentElement);if(e){var i=this.parseDOM(e);return i}},gn.ObjTree.prototype.parseHTTP=function(n,e,t){var r={};for(var i in e)r[i]=e[i];if(r.method||(typeof r.postBody>"u"&&typeof r.postbody>"u"&&typeof r.parameters>"u"?r.method="get":r.method="post"),t){r.asynchronous=!0;var o=this,a=t,s=r.onComplete;r.onComplete=function(d){var f;d&&d.responseXML&&d.responseXML.documentElement&&(f=o.parseDOM(d.responseXML.documentElement)),a(f,d),s&&s(d)}}else r.asynchronous=!1;var l;if(typeof HTTP<"u"&&HTTP.Request){r.uri=n;var u=new HTTP.Request(r);u&&(l=u.transport)}else if(typeof Ajax<"u"&&Ajax.Request){var u=new Ajax.Request(n,r);u&&(l=u.transport)}if(t)return l;if(l&&l.responseXML&&l.responseXML.documentElement)return this.parseDOM(l.responseXML.documentElement)},gn.ObjTree.prototype.parseDOM=function(n){if(n){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 t=this.parseElement(n);if(this.__force_array[n.nodeName]&&(t=[t]),n.nodeType!==11){var r={};r[n.nodeName]=t,t=r}return t}},gn.ObjTree.prototype.parseElement=function(n){if(n.nodeType!==7){if(n.nodeType===3||n.nodeType===4||n.nodeType===8){var e=n.nodeValue.match(/[^\x00-\x20]/);return e==null?void 0:n.nodeValue}var t=null,r={};if(n.attributes&&n.attributes.length){t={};for(var i=0;i<n.attributes.length;i++){var o=n.attributes[i].nodeName;if(typeof o=="string"){var a=n.attributes[i].nodeValue;try{a=JSON.parse(n.attributes[i].nodeValue.replace(/'/g,'"'))}catch{a=n.attributes[i].nodeValue}a!=null&&(o=this.attr_prefix+o,typeof r[o]>"u"&&(r[o]=0),r[o]++,this.addNode(t,o,r[o],a))}}}if(n.childNodes&&n.childNodes.length){var s=!0;t&&(s=!1);for(var i=0;i<n.childNodes.length&&s;i++){var l=n.childNodes[i].nodeType;l===3||l===4||l===8||(s=!1)}if(s){t||(t="");for(var i=0;i<n.childNodes.length;i++)t+=n.childNodes[i].nodeValue}else{t||(t={});for(var i=0;i<n.childNodes.length;i++){var o=n.childNodes[i].nodeName;if(typeof o=="string"){var a=this.parseElement(n.childNodes[i]);a&&(typeof r[o]>"u"&&(r[o]=0),r[o]++,this.addNode(t,o,r[o],a))}}}}else t===null&&(t={});return t}},gn.ObjTree.prototype.addNode=function(n,e,t,r){this.__force_array[e]?(t===1&&(n[e]=[]),n[e][n[e].length]=r):t===1?n[e]=r:t===2?n[e]=[n[e],r]:n[e][n[e].length]=r},gn.ObjTree.prototype.writeXML=function(n){var e=this.hash_to_xml(null,n);return this.xmlDecl+e},gn.ObjTree.prototype.hash_to_xml=function(n,e){var t=[],r=[];for(var i in e)if(yl(e,i)){var o=e[i];i.charAt(0)!==this.attr_prefix?typeof o>"u"||o==null?t[t.length]="<".concat(i," />"):typeof o=="object"&&o.constructor===Array?t[t.length]=this.array_to_xml(i,o):typeof o=="object"?t[t.length]=this.hash_to_xml(i,o):t[t.length]=this.scalar_to_xml(i,o):r[r.length]=" ".concat(i.substring(1),'="').concat(this.xml_escape(o),'"')}var a=r.join(""),s=t.join("");return typeof n>"u"||n==null||(t.length>0?s.match(/\n/)?s="<".concat(n).concat(a,`>
|
|
101
|
+
`).concat(s,"</").concat(n,`>
|
|
102
|
+
`):s="<".concat(n).concat(a,">").concat(s,"</").concat(n,`>
|
|
103
|
+
`):s="<".concat(n).concat(a,` />
|
|
104
|
+
`)),s},gn.ObjTree.prototype.array_to_xml=function(n,e){for(var t=[],r=0;r<e.length;r++){var i=e[r];typeof i>"u"||i==null?t[t.length]="<".concat(n," />"):typeof i=="object"&&i.constructor===Array?t[t.length]=this.array_to_xml(n,i):typeof i=="object"?t[t.length]=this.hash_to_xml(n,i):t[t.length]=this.scalar_to_xml(n,i)}return t.join("")},gn.ObjTree.prototype.scalar_to_xml=function(n,e){return n==="#text"?this.xml_escape(e):"<".concat(n,">").concat(this.xml_escape(e),"</").concat(n,`>
|
|
105
|
+
`)},gn.ObjTree.prototype.xml_escape=Su;var D4=function(n){return new gn.ObjTree().parseXML(n)},R4=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Bc=function(){return Bc=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Bc.apply(this,arguments)},w0=function(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t},Fc=function(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ln=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},wr=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))},yn;(function(n){n.START="bpmn:startEvent",n.END="bpmn:endEvent",n.INTERMEDIATE_CATCH="bpmn:intermediateCatchEvent",n.INTERMEDIATE_THROW="bpmn:intermediateThrowEvent",n.BOUNDARY="bpmn:boundaryEvent",n.PARALLEL_GATEWAY="bpmn:parallelGateway",n.INCLUSIVE_GATEWAY="bpmn:inclusiveGateway",n.EXCLUSIVE_GATEWAY="bpmn:exclusiveGateway",n.USER="bpmn:userTask",n.SYSTEM="bpmn:serviceTask",n.FLOW="bpmn:sequenceFlow",n.SUBPROCESS="bpmn:subProcess"})(yn||(yn={}));var S0=["-name","-id","bpmn:incoming","bpmn:outgoing","-sourceRef","-targetRef","-children"],L4=["properties","startPoint","endPoint","pointsList"],Au={in:[],out:["properties.panels","properties.nodeSize","properties.definitionId","properties.timerValue","properties.timerType","properties.definitionType","properties.parent","properties.isBoundaryEventTouchingTask"]},O0=function(n,e){var t=Object.keys(e||{});return t.forEach(function(r){if(n[r]){var i=e[r],o=i.in,a=i.out;o&&(n[r].in=o),a&&(n[r].out=a)}else n[r]=e[r]}),n},tr={"bpmn:startEvent":{out:function(n){var e,t,r=n.properties;return((t=(e=tr[r.definitionType])===null||e===void 0?void 0:e.out)===null||t===void 0?void 0:t.call(e,n))||{}}},"bpmn:intermediateCatchEvent":{out:function(n){var e,t,r=n.properties;return((t=(e=tr[r.definitionType])===null||e===void 0?void 0:e.out)===null||t===void 0?void 0:t.call(e,n))||{}}},"bpmn:intermediateThrowEvent":{out:function(n){var e,t,r=n.properties;return((t=(e=tr[r.definitionType])===null||e===void 0?void 0:e.out)===null||t===void 0?void 0:t.call(e,n))||{}}},"bpmn:boundaryEvent":{out:function(n){var e,t,r=n.properties;return((t=(e=tr[r.definitionType])===null||e===void 0?void 0:e.out)===null||t===void 0?void 0:t.call(e,n))||{}}},"bpmn:sequenceFlow":{out:function(n){var e=n.properties,t=e.expressionType,r=e.condition;return r?t==="cdata"?{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(n){var e=n.properties,t=e.timerType,r=e.timerValue,i=e.definitionId,o=function(){return"<bpmn:".concat(t,' xsi:type="bpmn:tFormalExpression">').concat(r,"</bpmn:").concat(t,">")};return{json:'<bpmn:timerEventDefinition id="'.concat(i,'"').concat(t&&r?">".concat(o(),"</bpmn:timerEventDefinition>"):"/>")}},in:function(n,e){var t,r,i,o,a=n,s=e["-id"],l="",u="";try{for(var d=Fc(Object.keys(e)),f=d.next();!f.done;f=d.next()){var c=f.value;c.includes("bpmn:")&&(i=ln(c.split(":"),2),l=i[1],u=(o=e[c])===null||o===void 0?void 0:o["#text"])}}catch(h){t={error:h}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(t)throw t.error}}return{"-definitionId":s,"-definitionType":a,"-timerType":l,"-timerValue":u}}},"bpmn:conditionExpression":{in:function(n,e){var t,r="",i="";return e["#cdata-section"]?(i="cdata",r=((t=/^\$\{(.*)\}$/g.exec(e["#cdata-section"]))===null||t===void 0?void 0:t[1])||""):e["#text"]&&(i="normal",r=e["#text"]),{"-condition":r,"-expressionType":i}}}};function I4(n){var e=n??{},t=e.retainedAttrsFields,r=e.excludeFields,i=e.transformer,o=new Set(wr(wr([],ln(L4),!1),ln(t||[]),!1)),a={in:new Set(wr(wr([],ln(Au.in),!1),ln((r==null?void 0:r.in)||[]),!1)),out:new Set(wr(wr([],ln(Au.out),!1),ln((r==null?void 0:r.out)||[]),!1))};return tr=O0(tr,i),function(s){var l=s.nodes,u=s.edges;function d(f,c){var h,p;if((f==null?void 0:f.flag)!==1){var v;if((v=tr[f.type])&&v.out){var g=v.out(f),y=Object.keys(g);y.length>0&&y.forEach(function(B){f[B]=g[B]})}f!=null&&f.children&&(f.children=f.children.map(function(B){var Z=l.find(function(ue){return ue.id===B})||u.find(function(ue){return ue.id===B});return Z||{}}));var m={};if(typeof f=="string")return f;if(Array.isArray(f))return f.map(function(B){return d(B,"")}).filter(function(B){return B!=null});try{for(var O=Fc(Object.entries(f)),T=O.next();!T.done;T=O.next()){var C=ln(T.value,2),A=C[0],E=C[1];if((E==null?void 0:E.flag)===1)return;var N=[c,A].filter(function(B){return B}).join(".");a.out.has(N)||(typeof E!="object"?A.indexOf("-")===0||["#text","#cdata-section","#comment"].includes(A)?m[A]=E:m["-".concat(A)]=E:o.has(N)?m["-".concat(A)]=d(E,N):m[A]=d(E,N))}}catch(B){h={error:B}}finally{try{T&&!T.done&&(p=O.return)&&p.call(O)}finally{if(h)throw h.error}}return m}}return d(s,"")}}function Cu(n){var e,t,r={};try{for(var i=Fc(Object.entries(n)),o=i.next();!o.done;o=i.next()){var a=ln(o.value,2),s=a[0],l=a[1];s.indexOf("-")===0?r[s.substring(1)]=wu(l):typeof l=="string"?r[s]=l:Object.prototype.toString.call(l)==="[object Object]"?r[s]=Cu(l):Array.isArray(l)?r[s]=l.map(function(u){return Cu(u)}):r[s]=l}}catch(u){e={error:u}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r}function k4(n,e,t){var r,i=new Map,o=I4(t)(e);o.nodes.forEach(function(s){var l=s["-id"],u=s["-type"],d=s.text,f=s.children,c=w0(s,["-id","-type","text","children"]),h={"-id":l};d!=null&&d["-value"]&&(h["-name"]=d["-value"]),c["-json"]&&(h["-json"]=c["-json"]),c["-properties"]&&Object.assign(h,c["-properties"]),f&&(h.children=f),n[u]||(n[u]=[]),n[u].push(h),i.set(l,h)});var a=o.edges.map(function(s){var l=s["-id"],u=s["-sourceNodeId"],d=s["-targetNodeId"],f=s.text,c=w0(s,["-id","-sourceNodeId","-targetNodeId","text"]),h=i.get(d);h["bpmn:incoming"]||(h["bpmn:incoming"]=[]),h["bpmn:incoming"].push(l);var p={"-id":l,"-sourceRef":u,"-targetRef":d};return f!=null&&f["-value"]&&(p["-name"]=f["-value"]),c["-json"]&&(p["-json"]=c["-json"]),c["-properties"]&&Object.assign(p,c["-properties"]),p});return e.edges.forEach(function(s){var l=s.sourceNodeId,u=s.id,d=i.get(l);d["bpmn:outgoing"]||(d["bpmn:outgoing"]=[]),d["bpmn:outgoing"].push(u)}),(r=n["bpmn:subProcess"])===null||r===void 0||r.forEach(function(s){var l={"bpmn:incoming":new Set,"bpmn:outgoing":new Set},u=[];s.children.forEach(function(v){var g,y=i.get(v["-id"]);["bpmn:incoming","bpmn:outgoing"].forEach(function(O){y[O]&&y[O].forEach(function(T){l[O].add(T)})});var m=(g=n[v["-type"]])===null||g===void 0?void 0:g.findIndex(function(O){return O["-id"]===v["-id"]});m>=0&&n[v["-type"]].splice(m,1),i.delete(v["-id"]),s[v["-type"]]||(s[v["-type"]]=[]),s[v["-type"]].push(y)});var d=l["bpmn:incoming"],f=l["bpmn:outgoing"];f.forEach(function(v){d.has(v)&&u.push(v)});for(var c=function(v){var g=a.findIndex(function(y){return y["-id"]===u[v]});g>=0?(s["bpmn:sequenceFlow"]||(s["bpmn:sequenceFlow"]=[]),s["bpmn:sequenceFlow"].push(a[g]),a.splice(g,1)):v++,h=v},h,p=0;p<u.length;)c(p),p=h;delete s.children}),n[yn.FLOW]=a,n}function j4(n,e){n["bpmndi:BPMNEdge"]=e.edges.map(function(t){var r,i=t.id,o=t.pointsList.map(function(s){var l=s.x,u=s.y;return{"-x":l,"-y":u}}),a={"-id":"".concat(i,"_di"),"-bpmnElement":i,"di:waypoint":o};return!((r=t.text)===null||r===void 0)&&r.value&&(a["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-t.text.value.length*10/2,"-y":t.text.y-7,"-width":t.text.value.length*10,"-height":14}}),a}),n["bpmndi:BPMNShape"]=e.nodes.map(function(t){var r,i=t.id,o=100,a=80,s=t.x,l=t.y,u=An.shapeConfigMap.get(t.type);u&&(o=u.width,a=u.height),s-=o/2,l-=a/2;var d={"-id":"".concat(i,"_di"),"-bpmnElement":i,"dc:Bounds":{"-x":s,"-y":l,"-width":o,"-height":a}};return!((r=t.text)===null||r===void 0)&&r.value&&(d["bpmndi:BPMNLabel"]={"dc:Bounds":{"-x":t.text.x-t.text.value.length*10/2,"-y":t.text.y-7,"-width":t.text.value.length*10,"-height":14}}),d})}var B4=["bpmn:incoming","bpmn:outgoing"];function F4(n,e){var t=[],r=[],i=new Map,o=e??{},a=o.transformer,s=o.excludeFields,l={in:new Set(wr(wr([],ln(Au.in),!1),ln((s==null?void 0:s.in)||[]),!1)),out:new Set(wr(wr([],ln(Au.out),!1),ln((s==null?void 0:s.out)||[]),!1))};tr=O0(tr,a);var u=n["bpmn:definitions"];if(u){var d=u["bpmn:process"];(function(c,h){h.forEach(function(p){try{Object.keys(c).forEach(function(v){try{p(v)}catch(g){console.error(g)}})}catch(v){console.error(v)}})})(d,[function(c){function h(v){v["-children"]||(v["-children"]=[]),Object.keys(v).forEach(function(g){var y;g.indexOf("bpmn:")===0&&!B4.includes(g)&&(d[g]||(d[g]=[]),!Array.isArray(d[g])&&(d[g]=[d[g]]),Array.isArray(v[g])?(y=d[g]).push.apply(y,wr([],ln(v[g]),!1)):d[g].push(v[g]),Array.isArray(v[g])?v[g].forEach(function(m){!g.includes("Flow")&&v["-children"].push(m["-id"])}):!g.includes("Flow")&&v["-children"].push(v[g]["-id"]),delete v[g])})}if(c==="bpmn:subProcess"){var p=d[c];Array.isArray(p)?p.forEach(function(v){c==="bpmn:subProcess"&&h(v)}):h(p)}},function(c){var h=function(v){Object.keys(v).forEach(function(g){var y,m;if(g.includes("bpmn:")){var O={};tr[g]&&tr[g].in?(O=(m=(y=tr[g]).in)===null||m===void 0?void 0:m.call(y,g,_.cloneDeep(v[g])),delete v[g]):p(v[g]);var T=void 0;(T=Reflect.ownKeys(O)).length>0&&T.forEach(function(C){Reflect.set(v,C,O[C])})}})};function p(v){i.set(v["-id"],v),Array.isArray(v)?v.forEach(function(g){p(g)}):typeof v=="object"&&h(v)}p(d[c])},function(c){if(c.indexOf("bpmn:")===0){var h=d[c];if(c==="bpmn:sequenceFlow"){var p=u["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNEdge"];r=H4(h,p)}else{var v=u["bpmndi:BPMNDiagram"]["bpmndi:BPMNPlane"]["bpmndi:BPMNShape"];if(c==="bpmn:boundaryEvent"){var g=d[c],y=function(m){var O=m["-attachedToRef"],T=i.get(O);T["-boundaryEvents"]||(T["-boundaryEvents"]=[]),T["-boundaryEvents"].push(m["-id"])};Array.isArray(g)?g.forEach(function(m){y(m)}):y(g)}t=t.concat($4(h,v,c))}}}])}var f=function(c,h,p){Object.keys(c).forEach(function(v){var g=p?"".concat(p,".").concat(v):v;h.has(g)?delete c[v]:typeof c[v]=="object"&&f(c[v],h,g)})};return t.forEach(function(c){var h,p;if(!((h=e==null?void 0:e.mapping)===null||h===void 0)&&h.in){var v=(p=e==null?void 0:e.mapping)===null||p===void 0?void 0:p.in,g=c.type;v[g]&&(c.type=v[g])}f(c,l.in,"")}),r.forEach(function(c){var h,p;if(!((h=e==null?void 0:e.mapping)===null||h===void 0)&&h.in){var v=(p=e==null?void 0:e.mapping)===null||p===void 0?void 0:p.in,g=c.type;v[g]&&(c.type=v[g])}f(c,l.in,"")}),{nodes:t,edges:r}}function $4(n,e,t){var r=[];if(Array.isArray(n))n.forEach(function(a){var s;Array.isArray(e)?s=e.find(function(u){return u["-bpmnElement"]===a["-id"]}):s=e;var l=A0(s,t,a);r.push(l)});else{var i=void 0;Array.isArray(e)?i=e.find(function(a){return a["-bpmnElement"]===n["-id"]}):i=e;var o=A0(i,t,n);r.push(o)}return r}function A0(n,e,t){var r=Number(n["dc:Bounds"]["-x"]),i=Number(n["dc:Bounds"]["-y"]),o=t["-children"],a=t["-name"],s=An.shapeConfigMap.get(e);s&&(r+=s.width/2,i+=s.height/2);var l={};Object.entries(t).forEach(function(c){var h=ln(c,2),p=h[0],v=h[1];S0.includes(p)||(l[p]=v)}),l=Cu(l);var u;if(a&&(u={x:r,y:i,value:a},n["bpmndi:BPMNLabel"]&&n["bpmndi:BPMNLabel"]["dc:Bounds"])){var d=n["bpmndi:BPMNLabel"]["dc:Bounds"];u.x=Number(d["-x"])+Number(d["-width"])/2,u.y=Number(d["-y"])+Number(d["-height"])/2}var f={id:n["-bpmnElement"],type:e,x:r,y:i,properties:l};return o&&(f.children=o),u&&(f.text=u),f}function H4(n,e){var t=[];if(Array.isArray(n))n.forEach(function(i){var o;Array.isArray(e)?o=e.find(function(a){return a["-bpmnElement"]===i["-id"]}):o=e,t.push(C0(o,i))});else{var r=void 0;Array.isArray(e)?r=e.find(function(i){return i["-bpmnElement"]===n["-id"]}):r=e,t.push(C0(r,n))}return t}function C0(n,e){var t,r=e["-name"]?"".concat(e["-name"]):"";if(r){var i=n["bpmndi:BPMNLabel"]["dc:Bounds"],o=0;r.split(`
|
|
106
|
+
`).forEach(function(u){o<u.length&&(o=u.length)}),t={value:r,x:Number(i["-x"])+o*10/2,y:Number(i["-y"])+7}}var a={};Object.entries(e).forEach(function(u){var d=ln(u,2),f=d[0],c=d[1];S0.includes(f)||(a[f]=c)}),a=Cu(a);var s=n["di:waypoint"].map(function(u){return{x:Number(u["-x"]),y:Number(u["-y"])}}),l={id:e["-id"],type:yn.FLOW,pointsList:s,sourceNodeId:e["-sourceRef"],targetNodeId:e["-targetRef"],properties:a};return t&&(l.text=t),l}var An=(function(){function n(e){var t=e.lf,r=this;this.adapterOut=function(i,o){var a,s,l=Bc({},r.processAttributes);k4(l,i,o);var u={"-id":"BPMNPlane_1","-bpmnElement":l["-id"]};j4(u,i);var d=r.definitionAttributes;d["bpmn:process"]=l,d["bpmndi:BPMNDiagram"]={"-id":"BPMNDiagram_1","bpmndi:BPMNPlane":u};var f={"bpmn:definitions":d};if(!((a=o==null?void 0:o.mapping)===null||a===void 0)&&a.out){var c=(s=o==null?void 0:o.mapping)===null||s===void 0?void 0:s.out,h=function(p){Array.isArray(p)&&p.forEach(function(v){return h(v)}),typeof p=="object"&&Object.keys(p).forEach(function(v){var g;(g=c[v])?(p[g]=_.cloneDeep(p[v]),delete p[v],h(p[g])):h(p[v])})};h(f)}return f},this.adapterIn=function(i,o){if(i)return F4(i,o)},t.adapterIn=this.adapterIn,t.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 n.prototype.setCustomShape=function(e,t){n.shapeConfigMap.set(e,t)},n.pluginName="bpmn-adapter",n.shapeConfigMap=new Map,n})();An.shapeConfigMap.set(yn.START,{width:f0.width,height:f0.height}),An.shapeConfigMap.set(yn.END,{width:c0.width,height:c0.height}),An.shapeConfigMap.set(yn.INTERMEDIATE_CATCH,{width:Eu.width,height:Eu.height}),An.shapeConfigMap.set(yn.INTERMEDIATE_THROW,{width:Eu.width,height:Eu.height}),An.shapeConfigMap.set(yn.BOUNDARY,{width:h0.width,height:h0.height}),An.shapeConfigMap.set(yn.PARALLEL_GATEWAY,{width:p0.width,height:p0.height}),An.shapeConfigMap.set(yn.INCLUSIVE_GATEWAY,{width:v0.width,height:v0.height}),An.shapeConfigMap.set(yn.EXCLUSIVE_GATEWAY,{width:g0.width,height:g0.height}),An.shapeConfigMap.set(yn.SYSTEM,{width:y0.width,height:y0.height}),An.shapeConfigMap.set(yn.USER,{width:m0.width,height:m0.height}),An.shapeConfigMap.set(yn.SUBPROCESS,{width:_0.width,height:_0.height}),(function(n){R4(e,n);function e(t){var r=n.call(this,t)||this;r.adapterXmlIn=function(a){var s=D4(a);return r.adapterIn(s,r.props)},r.adapterXmlOut=function(a){var s=r.adapterOut(a,r.props);return P4(s)};var i=t.lf,o=t.props;return i.adapterIn=r.adapterXmlIn,i.adapterOut=r.adapterXmlOut,r.props=o,r}return e.pluginName="BPMNAdapter",e})(An);var T0=function(){return T0=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},T0.apply(this,arguments)},z4=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Tu=function(){return Tu=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Tu.apply(this,arguments)},$c=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},Ko=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},as=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))},W4=400,X4=230,G4=80,U4=60,Y4=-1e4,M0=(function(n){z4(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.isGroup=!0,i.isRestrict=!1,i.autoResize=!1,i.collapsible=!0,i.staticTextPosition=!0,i.isCollapsed=!1,i.groupAddable=!1,i.transformWithContainer=!1,i.childrenLastCollapseStateDict=new Map,i.childrenLastCollapseStateDict=new Map,i.initNodeData(t),i.setAttributes(),i}return e.prototype.initNodeData=function(t){var r;n.prototype.initNodeData.call(this,t);var i=(r=t.properties)!==null&&r!==void 0?r:{},o=i.children,a=i.width,s=i.height,l=i.collapsedWidth,u=i.collapsedHeight,d=i.collapsible,f=i.isCollapsed,c=i.zIndex,h=i.isRestrict,p=i.autoResize,v=i.autoToFront,g=i.transformWithContainer;this.children=o?new Set(o):new Set,this.zIndex=c??Y4,this.isCollapsed=f??!1,this.setProperties({isCollapsed:f??!1});var y=a??W4,m=s??X4;this.width=y,this.height=m,this.expandWidth=y,this.expandHeight=m,this.collapsedWidth=l??G4,this.collapsedHeight=u??U4,this.isRestrict=h??!1,this.transformWithContainer=g??!1,this.autoResize=p??!1,this.collapsible=d??!0,this.autoToFront=v??!1,this.setTextPosition(),this.text.editable=!1,this.text.draggable=!1},e.prototype.setAttributes=function(){n.prototype.setAttributes.call(this)},e.prototype.getData=function(){var t=this,r=n.prototype.getData.call(this),i=[];return nt(Array.from(this.children),function(o){var a=t.graphModel.getNodeModelById(o);a&&!a.virtual&&i.push(o)}),r.children=i,r.properties&&(r.properties.children=i,r.properties.isCollapsed=this.isCollapsed),r},e.prototype.getNodesInGroup=function(t){var r=[];return t.isGroup&&nt(Array.from(t.children),function(i){r.push(i)}),r},e.prototype.getMoveDistance=function(t,r,i){i===void 0&&(i=!1);var o=Ko(n.prototype.getMoveDistance.call(this,t,r,i),2),a=o[0],s=o[1],l=this.getNodesInGroup(this);return this.graphModel.moveNodes(l,t,r,i),[a,s]},e.prototype.getHistoryData=function(){var t=n.prototype.getHistoryData.call(this);t.children=Array.from(this.children),t.isGroup=!0;var r=this,i=r.x,o=r.y,a=r.collapsedWidth,s=r.collapsedHeight,l=r.expandWidth,u=r.expandHeight,d=r.isCollapsed;return d&&(t.x=i+l/2-a/2,t.y=o+u/2-s/2,t.text&&(t.text.x=t.text.x+l/2-a/2,t.text.y=t.text.y+u/2-s/2)),t},e.prototype.toggleCollapse=function(t){var r=this,i=this.graphModel,o=!!t;this.isCollapsed=o,this.setProperties({isCollapsed:o}),i.eventCenter.emit("dynamicGroup:collapse",{collapse:o,nodeModel:this}),o?this.collapse():this.expand();var a=as(as([],Ko(this.incoming.edges),!1),Ko(this.outgoing.edges),!1),s=Array.from(this.children);nt(s,function(l){var u,d,f=r.graphModel.elementsModelMap.get(l);if(f){var c=f.isCollapsed;if(f.isGroup){var h=f;if(h.isCollapsed||h.toggleCollapse(t),!t){var p=(u=r.childrenLastCollapseStateDict)===null||u===void 0?void 0:u.get(l);p!==void 0&&p!==f.isCollapsed&&h.toggleCollapse(p)}}if((d=r.childrenLastCollapseStateDict)===null||d===void 0||d.set(l,!!c),f.visible=!t,f.BaseType===Nt.NODE){var v=f.incoming.edges,g=f.outgoing.edges;a=as(as(as([],Ko(a),!1),Ko(v),!1),Ko(g),!1)}}}),this.collapseEdge(o,a)},e.prototype.setTextPosition=function(){var t=this,r=t.x,i=t.y,o=t.staticTextPosition,a=t.text,s=t.isCollapsed,l=t.width,u=t.height,d=t.collapsedWidth,f=t.collapsedHeight;if(o){a.x=r,a.y=s?i:i-u/2+15;return}a.x=s?r-l/2+d/2:r+l/2-d/2,a.y=s?i-u/2+f/2:i+u/2-f/2},e.prototype.collapse=function(){var t=this,r=t.x,i=t.y,o=t.width,a=t.height,s=t.collapsedWidth,l=t.collapsedHeight;this.x=r-o/2+s/2,this.y=i-a/2+l/2,this.expandWidth=o,this.expandHeight=a,this.width=s,this.height=l,this.setTextPosition()},e.prototype.expand=function(){var t=this,r=t.x,i=t.y,o=t.expandWidth,a=t.expandHeight,s=t.collapsedWidth,l=t.collapsedHeight;this.width=o,this.height=a,this.x=r+this.width/2-s/2,this.y=i+this.height/2-l/2,this.setTextPosition()},e.prototype.createVirtualEdge=function(t){t.pointsList=void 0;var r=this.graphModel.addEdge(t);r.virtual=!0,r.text.editable=!1,r.isCollapsedEdge=!0},e.prototype.collapseEdge=function(t,r){var i=this,o=this.graphModel;nt(r,function(a,s){var l,u=a.getData(),d=u.targetNodeId,f=u.sourceNodeId,c=Tu(Tu({},u),{id:"".concat(u.id,"__").concat(s),text:(l=u.text)===null||l===void 0?void 0:l.value});a.virtual&&o.deleteEdgeById(a.id);var h=o.dynamicGroup.getGroupByNodeId(d);h||(h=o.getNodeModelById(d));var p=o.dynamicGroup.getGroupByNodeId(f);p||(p=o.getNodeModelById(f)),t&&a.visible&&(i.children.has(f)||i.id===f?(c.startPoint=void 0,c.sourceNodeId=i.id):(c.endPoint=void 0,c.targetNodeId=i.id),(h.id!==i.id||p.id!==i.id)&&i.createVirtualEdge(c),a.visible=!1),!t&&!a.visible&&(h&&h.isGroup&&h.isCollapsed?(c.targetNodeId=h.id,c.endPoint=void 0,i.createVirtualEdge(c)):p&&p.isGroup&&p.isCollapsed?(c.sourceNodeId=p.id,c.startPoint=void 0,i.createVirtualEdge(c)):a.visible=!0)})},e.prototype.isAllowAppendIn=function(t){return!0},e.prototype.setAllowAppendChild=function(t){this.groupAddable=t},e.prototype.addChild=function(t){this.children.add(t);var r=this.getData();this.graphModel.eventCenter.emit("group:add-node",{data:r,childId:t})},e.prototype.removeChild=function(t){this.children.delete(t);var r=this.getData();this.graphModel.eventCenter.emit("group:remove-node",{data:r})},e.prototype.toBack=function(){this.zIndex--},e.prototype.getAnchorStyle=function(){var t=n.prototype.getAnchorStyle.call(this);return t.stroke="transparent",t.fill="transparent",t.hover&&(t.hover.fill="transparent",t.hover.stroke="transparent"),t},e.prototype.getAddableOutlineStyle=function(){return{stroke:"#feb663",strokeWidth:2,strokeDasharray:"4 4",fill:"transparent"}},$c([z],e.prototype,"isCollapsed",void 0),$c([z],e.prototype,"groupAddable",void 0),$c([z],e.prototype,"transformWithContainer",void 0),e})(Fo),bt={defaultWidth:120,defaultHeight:120,titleSize:60,poolMinSize:20},Ze={defaultWidth:120,defaultHeight:120,titleSize:20,iconSize:20,iconSpacing:15},V4=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Fr=function(){return Fr=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Fr.apply(this,arguments)},K4=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o};(function(n){V4(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.titleSize=bt.titleSize,i.poolConfig=bt,i.isPool=!0,i._defaultLaneCreated=!1,i}return Object.defineProperty(e.prototype,"isHorizontal",{get:function(){var t;return((t=this.properties)===null||t===void 0?void 0:t.direction)==="horizontal"},enumerable:!1,configurable:!0}),e.prototype.initNodeData=function(t){var r,i;n.prototype.initNodeData.call(this,t),t.properties&&(this.width=((r=t.properties)===null||r===void 0?void 0:r.width)||bt.defaultWidth,this.height=((i=t.properties)===null||i===void 0?void 0:i.height)||bt.defaultHeight),this.autoResize=!1,this.isRestrict=!0,this.transformWithContainer=!0,this.resizable=!1,this.rotatable=!1,this.autoToFront=!1,this.text.editable=!0,this.updateTextPosition(),this.addEventListeners(),this.resizePool()},e.prototype.addEventListeners=function(){var t=this;this.graphModel.eventCenter.on("node:resize",function(r){var i=r.data,o=r.index;if(t.children.has(i.id)){var a=t.graphModel.getNodeModelById(i.id);if(!a||!a.type||a.type!=="lane")return;var s=t.getLanes(),l=void 0,u=void 0,d=0,f=0;if(t.isHorizontal){var c=s.reduce(function(O,T){return O+T.height},0);l=a.width+bt.titleSize,u=c}else{var h=s.reduce(function(O,T){return O+T.width},0);u=a.height+bt.titleSize,l=h}var p=typeof o=="number"?o:2,v=p===0||p===3,g=p===0||p===1,y=v?-1:1,m=g?-1:1;d=y*(l-t.width),f=m*(u-t.height),t.width=l,t.height=u,t.move(d/2,f/2)}t.resizeChildren(),t.updateTextPosition()})},e.prototype.getNodesInGroup=function(t){var r=this,i=[];return t.isGroup&&nt(Array.from(t.children),function(o){var a=r.graphModel.getNodeModelById(o);a&&!a.isDragging&&i.push(o)}),i},e.prototype.updateTextPosition=function(){this.isHorizontal?(this.text.x=this.x-this.width/2+bt.titleSize/2,this.text.y=this.y):(this.text.x=this.x,this.text.y=this.y-this.height/2+bt.titleSize/2)},e.prototype.resizePool=function(){var t=this.getLanes();if(t.length!==0){var r=0,i=0;this.isHorizontal?(nt(t,function(o){var a=o.width,s=o.height;r=Math.max(r,a),i+=s}),this.width=r+bt.titleSize,this.height=i):(nt(t,function(o){var a=o.width,s=o.height;r+=a,i=Math.max(i,s)}),this.width=r,this.height=i+bt.titleSize),this.updateTextPosition()}},e.prototype.resizeChildrenWithNewLane=function(t,r){var i=this,o,a=this.getLanes(),s=t&&r;if(!(!s||Ma(a))){var l=[],u=a.find(function(O){return O.id===r});if(l=a.filter(function(O){return O.id!==r}).slice().sort(function(O,T){return i.isHorizontal?O.y-T.y:O.x-T.x}),u){var d=(o=u.properties)===null||o===void 0?void 0:o.referenceLaneId,f=d?l.findIndex(function(O){return O.id===d}):0,c=["above","left"].includes(t)?Math.max(f,0):Math.min(f+1,l.length);l.splice(c,0,u)}if(this.isHorizontal){var h=this.width-bt.titleSize,p=l.reduce(function(O,T){return O+T.height},0),v=this.y-p/2;l.forEach(function(O,T){var C=v+O.height/2;O.text=Fr(Fr({},O.text),{x:O.x-h/2+Ze.titleSize/2,y:O.y}),i.moveLane(O,O.x,C),T<l.length-1&&(v+=O.height)}),this.height=p}else{var g=this.height-bt.titleSize,y=l.reduce(function(O,T){return O+T.width},0),m=this.x-y/2;l.forEach(function(O,T){var C=m+O.width/2;O.text=Fr(Fr({},O.text),{x:O.x,y:O.y-g/2+Ze.titleSize/2}),i.moveLane(O,C,O.y),T<l.length-1&&(m+=O.width)}),this.width=y}this.updateTextPosition()}},e.prototype.moveLane=function(t,r,i){var o=this,a=[];t.children&&t.children.size>0&&t.children.forEach(function(s){var l=o.graphModel.getNodeModelById(s);l&&!l.isDragging&&String(l.type)!=="lane"&&a.push({id:s,dx:l.x-t.x,dy:l.y-t.y})}),t.moveTo(r,i,!0),a.forEach(function(s){var l=s.id,u=s.dx,d=s.dy,f=o.graphModel.getNodeModelById(l);if(f){var c=f.x,h=f.y,p=t.x+u,v=t.y+d;f.moveTo(p,v);var g=f.incoming.edges,y=f.outgoing.edges;g.forEach(function(m){m.moveEndPoint(p-c,v-h)}),y.forEach(function(m){m.moveStartPoint(p-c,v-h)})}})},e.prototype.resizeChildren=function(){var t=this,r=this.getLanes();if(r.length!==0)if(this.isHorizontal){this.height=r.reduce(function(a,s){return a+s.height},0);var i=r.slice().sort(function(a,s){return a.y-s.y});r.forEach(function(a){a.width=t.width-bt.titleSize;var s=i.findIndex(function(u){return u.id===a.id}),l=i.reduce(function(u,d,f){return f<s&&d.id!==a.id?u+d.height:u},t.y-t.height/2);a.moveTo(t.x-t.width/2+bt.titleSize+a.width/2,l+a.height/2,!0)})}else{this.width=r.reduce(function(a,s){return a+s.width},0);var o=Ee(r).sort(function(a,s){return a.x-s.x});r.forEach(function(a){a.height=t.height-bt.titleSize;var s=o.findIndex(function(u){return u.id===a.id}),l=o.reduce(function(u,d,f){return f<s&&d.id!==a.id?u+d.width:u},t.x-t.width/2);a.moveTo(l+a.width/2,t.y-t.height/2+bt.titleSize+a.height/2,!0)})}},e.prototype.getLanes=function(){var t=this,r=[];return Array.from(this.children).forEach(function(i){var o=t.graphModel.getNodeModelById(i);o&&String(o.type)==="lane"&&r.push(o)}),r},e.prototype.addLane=function(t,r){var i,o,a,s,l=this.getLanes();if(l.length===0)return this.createDefaultLane(r);var u=this.x,d=this.y,f=l.find(function(m){return m.id===(r==null?void 0:r.id)}),c=f||l[0],h=(i=c==null?void 0:c.width)!==null&&i!==void 0?i:this.width,p=(o=c==null?void 0:c.height)!==null&&o!==void 0?o:this.height;this.isHorizontal&&["above","below"].includes(t)&&f&&(d=t==="above"?f.y-f.height/2-p/2:f.y+f.height/2+p/2,u=f.x),!this.isHorizontal&&["left","right"].includes(t)&&f&&(u=t==="left"?f.x-f.width/2-h/2:f.x+f.width/2+h/2,d=f.y);var v=Ee(r);v&&(delete v.id,delete v.children,(a=v.properties)===null||a===void 0||delete a.parent,(s=v.properties)===null||s===void 0||delete s.children);var g=Qr(v,{type:"lane",x:u,y:d,width:h,height:p,text:"新泳道",properties:{parent:this.id,position:t,referenceLaneId:f==null?void 0:f.id},zIndex:this.zIndex},this.properties.laneConfig),y=this.graphModel.addNode(g);return this.setZIndex(this.zIndex-1),this.addChild(y.id),this.resizeChildrenWithNewLane(t,y.id),y},e.prototype.setZIndex=function(t){this.zIndex=Math.min(t,-100)},e.prototype.addChildAbove=function(t){return this.addLane("above",t)},e.prototype.addChildBelow=function(t){return this.addLane("below",t)},e.prototype.addChildLeft=function(t){return this.addLane("left",t)},e.prototype.addChildRight=function(t){return this.addLane("right",t)},e.prototype.createDefaultLane=function(t){var r=null;if(this.isHorizontal){var i=this.width-bt.titleSize,o=this.height;r=this.graphModel.addNode(Qr({type:"lane",x:this.x-this.width/2+bt.titleSize+i/2,y:this.y,width:i,height:o,text:{x:this.x-this.width/2+bt.titleSize/2,y:this.y,value:"泳道1"},properties:{parent:this.id,isHorizontal:this.isHorizontal},zIndex:this.zIndex},t))}else{var i=this.width,o=this.height-bt.titleSize;r=this.graphModel.addNode(Qr({type:"lane",x:this.x,y:this.y-this.height/2+bt.titleSize+(this.height-bt.titleSize)/2,width:i,height:o,text:{x:this.x,y:this.y-this.height/2+bt.titleSize/2,value:"泳道1"},properties:{parent:this.id},zIndex:this.zIndex},t))}return this.setZIndex(this.zIndex-1),this.addChild(r.id),this.resizeChildren(),this.updateTextPosition(),r},e.prototype.deleteChild=function(t){var r=this.getLanes();if(!(r.length<=1)){var i=r.find(function(o){return o.id===t});i&&(this.removeChild(t),this.graphModel.deleteNode(t),this.resizePool(),this.resizeChildren())}},e.prototype.getNodeStyle=function(){var t=n.prototype.getNodeStyle.call(this);return t.strokeWidth=2,t},e.prototype.getTextStyle=function(){var t=n.prototype.getTextStyle.call(this);return t.overflowMode="ellipsis",t.strokeWidth=2,t.textWidth=this.isHorizontal?this.height:this.width,t.textHeight=this.isHorizontal?this.width:this.height,this.isHorizontal&&(t.transform="rotate(-90deg)",t.textAlign="center"),t},e.prototype.getData=function(){var t=n.prototype.getData.call(this);return Fr(Fr({},t),{properties:Fr(Fr({},t.properties),{width:this.width,height:this.height})})},K4([gt],e.prototype,"isHorizontal",null),e})(M0);function q4(n,e,t){var r=e.x,i=e.y,o=n.x,a=n.y,s=o-r,l=a-i,u=s*Math.cos(t)-l*Math.sin(t),d=s*Math.sin(t)+l*Math.cos(t),f=u+r,c=d+i;return{x:f,y:c}}var Z4=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Mu=function(){return Mu=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Mu.apply(this,arguments)},Q4=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},J4=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))},N0=(function(n){Z4(e,n);function e(){var t=n.apply(this,J4([],Q4(arguments),!1))||this;return t.childrenPositionMap=new Map,t.onNodeRotate=function(r){var i=r.model,o=t.props,a=o.model,s=o.graphModel,l=a.transformWithContainer,u=a.isRestrict,d=t.childrenPositionMap;if(!(!l||u)&&i.id===a.id){var f={x:a.x,y:a.y};nt(Array.from(a.children),function(c){var h=s.getNodeModelById(c);if(h){var p={x:h.x,y:h.y};d.has(h.id)?p=d.get(h.id):d.set(h.id,p);var v=i.rotate*(180/Math.PI);v<0&&(v+=360);var g=v*(Math.PI/180),y=q4(p,f,g);h.moveTo(y.x,y.y),h.rotate=i.rotate,console.log("childInfo",h)}})}},t.onNodeResize=function(r){var i=r.deltaX,o=r.deltaY,a=r.index,s=r.model,l=r.preData,u=t.props,d=u.model,f=u.graphModel,c=d.transformWithContainer,h=d.isRestrict;if(!(!c||h)&&s.id===d.id){var p=l.properties,v=p||{},g=v.width,y=v.height;nt(Array.from(d.children),function(m){var O=f.getNodeModelById(m);if(O){var T=O.width/g*i,C=O.height/y*o;r_({deltaX:T,deltaY:C,index:a,nodeModel:O,graphModel:f,cancelCallback:function(){}})}})}},t.onNodeMouseMove=function(){},t.graphRendered=function(){var r=t.props.model;r.isCollapsed&&r.toggleCollapse(!0)},t}return e.prototype.componentDidMount=function(){n.prototype.componentDidMount.call(this);var t=this.props.graphModel.eventCenter;t.on("node:rotate",this.onNodeRotate),t.on("node:resize",this.onNodeResize),t.on("node:mousemove",this.onNodeMouseMove),t.on("graph:rendered",this.graphRendered)},e.prototype.componentWillUnmount=function(){n.prototype.componentWillUnmount.call(this);var t=this.props.graphModel.eventCenter;t.off("node:rotate",this.onNodeRotate),t.off("node:resize",this.onNodeResize),t.off("node:mousemove",this.onNodeMouseMove),t.off("graph:rendered",this.graphRendered)},e.prototype.getNodesInGroup=function(t,r){var i=this,o=[];return t.isGroup&&nt(Array.from(t.children),function(a){o.push(a);var s=r.getNodeModelById(a);s!=null&&s.isGroup&&(o=o.concat(i.getNodesInGroup(s,r)))}),o},e.prototype.getResizeControl=function(){var t=this.props.model,r=t.resizable,i=t.isCollapsed,o=r&&!i;return o?n.prototype.getResizeControl.call(this):null},e.prototype.getAppendAreaShape=function(){var t=this.props.model,r=t.width,i=t.height,o=t.x,a=t.y,s=t.radius,l=t.groupAddable;if(!l)return null;var u=t.getNodeStyle().strokeWidth,d=u===void 0?0:u,f=t.getAddableOutlineStyle(),c=r+d+8,h=i+d+8;return ae("rect",Mu(Mu({},f),{width:c,height:h,x:o-c/2,y:a-h/2,rx:s,ry:s}))},e.prototype.getCollapseIcon=function(t,r){return"M ".concat(t+3,",").concat(r+6," ").concat(t+11,",").concat(r+6," M").concat(t+7,",").concat(r+2," ").concat(t+7,",").concat(r+10)},e.prototype.getExpandIcon=function(t,r){return"M ".concat(t+3,",").concat(r+6," ").concat(t+11,",").concat(r+6," ")},e.prototype.getOperateIcon=function(){var t=this.props.model,r=t.x,i=t.y,o=t.width,a=t.height,s=r-o/2+10,l=i-a/2+10;if(!t.collapsible)return null;var u=t!=null&&t.isCollapsed?this.getCollapseIcon(s,l):this.getExpandIcon(s,l),d=ae("path",{fill:"none",stroke:"#818281",strokeWidth:2,"pointer-events":"none",d:u});return ae("g",{},[ae("rect",{height:12,width:14,rx:2,ry:2,strokeWidth:1,fill:"#f4f5f6",stroke:"#cecece",cursor:"pointer",x:s,y:l,onClick:function(){t.toggleCollapse(!t.isCollapsed)}}),d])},e.prototype.getShape=function(){return ae("g",{},[this.getAppendAreaShape(),n.prototype.getShape.call(this),this.getOperateIcon()])},e})($n),e5=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),$r=function(){return $r=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},$r.apply(this,arguments)};(function(n){e5(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.componentDidMount=function(){var t,r,i,o=this.props,a=o.graphModel,s=o.model,l=a.nodes.findIndex(function(d){return d.id===s.id}),u=a.nodes.filter(function(d){return String(d.type)==="pool"}).length;s.setZIndex(-((u-l)*100)),!(!((r=(t=s.properties)===null||t===void 0?void 0:t.children)===null||r===void 0)&&r.length)&&!s._defaultLaneCreated&&!s.virtual&&(s.createDefaultLane((i=s.properties)===null||i===void 0?void 0:i.laneConfig),s._defaultLaneCreated=!0)},e.prototype.getShape=function(){var t=this.props.model,r=t.x,i=t.y,o=t.width,a=t.height,s=t.properties,l=s.textStyle,u=l===void 0?{}:l,d=s.style,f=d===void 0?{}:d,c=t.isHorizontal,h=t.getNodeStyle(),p={fill:"#ffffff",stroke:"#000000",strokeWidth:1},v=r-o/2,g=i-a/2,y=$r($r($r($r({},p),h),{x:v,y:g,width:c?bt.titleSize:o,height:c?a:bt.titleSize}),c&&u),m=$r($r($r($r({},p),h),{x:c?v+bt.titleSize:v,y:c?g:g+bt.titleSize,width:c?o-bt.titleSize:o,height:c?a:a-bt.titleSize}),c&&f);return ae("g",{},[ae("rect",y),ae("rect",m)])},e.prototype.getResizeControl=function(){var t=this.props.model,r=t.resizable,i=t.isCollapsed,o=r&&!i;return o?n.prototype.getResizeControl.call(this):null},e})(N0);var P0=function(){return P0=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},P0.apply(this,arguments)},t5=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Ti=function(){return Ti=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Ti.apply(this,arguments)},n5=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},r5=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))};(function(n){t5(e,n);function e(){var t=n.apply(this,r5([],n5(arguments),!1))||this;return t.isLane=!0,t.defaultZIndex=-1,t}return e.prototype.initNodeData=function(t){var r;n.prototype.initNodeData.call(this,t),this.width=t.width||Ze.defaultWidth,this.height=t.height||Ze.defaultHeight,this.draggable=!0,this.resizable=!0,this.rotatable=!1,this.defaultZIndex=t.zIndex||-1,this.setZIndex(this.defaultZIndex),this.autoToFront=!0,this.text.editable=!0,this.style.stroke="#000",this.style.strokeWidth=1,this.properties=Ti(Ti({},this.properties),{processRef:"",panels:["processRef"],direction:((r=t.properties)===null||r===void 0?void 0:r.direction)||"vertical"}),this.collapsedWidth=this.width,this.collapsedHeight=this.height,this.expandWidth=this.width,this.expandHeight=this.height},e.prototype.setAttributes=function(){n.prototype.setAttributes.call(this),this.updateTextPosition()},e.prototype.setZIndex=function(t){this.zIndex=Math.min(t,this.defaultZIndex)||this.defaultZIndex},e.prototype.toggleCollapse=function(){this.isCollapsed=!1,this.setProperties({isCollapsed:!1})},e.prototype.getPoolId=function(){var t=this;try{if(!this.graphModel)return console.warn("GraphModel is not available"),null;var r=this.graphModel.nodes.find(function(i){return i.children&&i.children.has(t.id)});return(r==null?void 0:r.id)||null}catch(i){return console.error("Error getting pool ID:",i),null}},e.prototype.getPoolModel=function(){try{var t=this.getPoolId();if(!t)return null;if(!this.graphModel)return console.warn("GraphModel is not available for getting pool model"),null;var r=this.graphModel.getNodeModelById(t);return r||null}catch(i){return console.error("Error getting pool model:",i),null}},e.prototype.changeAttribute=function(t){var r=t.width,i=t.height,o=t.x,a=t.y;r&&(this.width=r),i&&(this.height=i),o&&(this.x=o),a&&(this.y=a)},e.prototype.getData=function(){var t=n.prototype.getData.call(this);return Ti(Ti({},t),{properties:Ti(Ti({},t.properties),{width:this.width,height:this.height,processRef:this.properties.processRef,direction:this.properties.direction})})},e.prototype.isAllowAppendIn=function(t){return String(t.type)!=="lane"},e.prototype.getNodesInGroup=function(t){var r=this,i=[],o=t.properties.parent,a=t.isDragging;return a&&o&&i.push(o),nt(Array.from(t.children),function(s){var l=r.graphModel.getNodeModelById(s);l&&!l.isDragging&&String(l.type)!=="lane"&&i.push(s)}),i},e.prototype.getNodeStyle=function(){var t=n.prototype.getNodeStyle.call(this);return t.strokeWidth=2,t},e.prototype.getTextStyle=function(){var t=this.properties.isHorizontal,r=t===void 0?!1:t,i=n.prototype.getTextStyle.call(this);return i.overflowMode="ellipsis",i.strokeWidth=2,i.textWidth=r?this.height:this.width,i.textHeight=r?this.width:this.height,r&&(i.transform="rotate(-90deg)",i.textAlign="center"),i},e.prototype.getSubNodes=function(){var t=this,r=[];return Array.from(this.children).forEach(function(i){var o=t.graphModel.getNodeModelById(i);o&&r.push(o)}),r},e.prototype.updateTextPosition=function(){this.properties.isHorizontal?(this.text.x=this.x-this.width/2+Ze.titleSize/2,this.text.y=this.y):(this.text.x=this.x,this.text.y=this.y-this.height/2+Ze.titleSize/2)},e})(M0);var i5=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Dt=function(){return Dt=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Dt.apply(this,arguments)},o5=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},a5=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))};(function(n){i5(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getAppendAreaShape=function(){var t=this.props.model,r=t.width,i=t.height,o=t.x,a=t.y,s=t.radius,l=t.groupAddable;if(!l)return null;var u=t.getNodeStyle().strokeWidth,d=u===void 0?0:u,f=t.getAddableOutlineStyle(),c=r+d+8,h=i+d+8;return ae("rect",Dt(Dt({},f),{width:c,height:h,x:o-c/2,y:a-h/2,rx:s,ry:s}))},e.prototype.getShape=function(){var t=this.props.model,r=t.x,i=t.y,o=t.width,a=t.height,s=t.properties,l=s.textStyle,u=l===void 0?{}:l,d=s.isHorizontal,f=t.getNodeStyle(),c={fill:"#ffffff",stroke:"#000000",strokeWidth:1},h=r-o/2,p=i-a/2,v=Dt({x:r-o/2,y:i-a/2,width:o,height:a,stroke:"#000000",strokeWidth:2,fill:"transparent"},f),g=this.getOperateIcons(),y=Dt(Dt(Dt(Dt({},c),f),{x:d?h+Ze.titleSize:h,y:d?p:p+Ze.titleSize,width:d?o-Ze.titleSize:o,height:d?a:Ze.titleSize}),d?u:{});return ae("g",{},a5([this.getAppendAreaShape(),ae("rect",y),ae("rect",Dt({},v))],o5(g),!1))},e.prototype.getOperateIcons=function(){var t=this.props.model,r=t.isSelected;if(!r)return[];var i=t.getPoolModel();if(!i)return[];var o=i.isHorizontal,a=t.getData();return[this.addBeforeLaneIcon(o,function(){var s,l;return o?(s=i.addChildAbove)===null||s===void 0?void 0:s.call(i,a):(l=i.addChildRight)===null||l===void 0?void 0:l.call(i,a)}),this.addAfterLaneIcon(o,function(){var s,l;return o?(s=i.addChildBelow)===null||s===void 0?void 0:s.call(i,a):(l=i.addChildLeft)===null||l===void 0?void 0:l.call(i,a)}),this.deleteLaneIcon(function(){var s;return(s=i.deleteChild)===null||s===void 0?void 0:s.call(i,a.id)})]},e.prototype.addBeforeLaneIcon=function(t,r){var i=this.props.model,o=i.x,a=i.y,s=i.width,l=i.height,u=o+s/2+Ze.iconSpacing,d=a-l/2,f={width:Ze.iconSize/2,height:Ze.iconSize,strokeWidth:1,fill:"#fff",stroke:"#000",x:u,y:d},c=[ae("rect",Dt(Dt({},f),{x:u+Ze.iconSize/2,strokeDasharray:"2 2"})),ae("rect",f)];return t&&(c=[ae("rect",Dt(Dt({},f),{width:Ze.iconSize,height:Ze.iconSize/2,strokeDasharray:"2 2"})),ae("rect",Dt(Dt({},f),{width:Ze.iconSize,height:Ze.iconSize/2,y:d+Ze.iconSize/2}))]),ae("g",{cursor:"pointer",onClick:r},c)},e.prototype.addAfterLaneIcon=function(t,r){var i=this.props.model,o=i.x,a=i.y,s=i.width,l=i.height,u=o+s/2+Ze.iconSpacing,d=a-l/2+Ze.iconSize+Ze.iconSpacing,f={width:Ze.iconSize/2,height:Ze.iconSize,strokeWidth:1,fill:"#fff",stroke:"#000",x:u,y:d},c=[ae("rect",Dt(Dt({},f),{x:u+Ze.iconSize/2})),ae("rect",Dt(Dt({},f),{strokeDasharray:"2 2"}))];return t&&(c=[ae("rect",Dt(Dt({},f),{width:Ze.iconSize,height:Ze.iconSize/2})),ae("rect",Dt(Dt({},f),{width:Ze.iconSize,height:Ze.iconSize/2,y:d+Ze.iconSize/2,strokeDasharray:"2 2"}))]),ae("g",{cursor:"pointer",onClick:r},c)},e.prototype.deleteLaneIcon=function(t){var r=this.props.model,i=r.x,o=r.y,a=r.width,s=r.height,l=i+a/2+Ze.iconSpacing,u=o-s/2+(Ze.iconSize+Ze.iconSpacing)*3;return ae("g",{cursor:"pointer",onClick:t,width:Ze.iconSize,height:Ze.iconSize,transform:"translate(".concat(l,", ").concat(u,")")},[ae("rect",{width:Ze.iconSize,height:Ze.iconSize,fill:"transparent"}),ae("path",{transform:"translate(2, 1) scale(".concat(Ze.iconSize/18,")"),fill:"#000",d:"M1.6361705,0.07275847000000002L1.6362224,0.07267305000000002L5.1435161,2.2034403L6.3516493,1.28341734Q7.2009554,0.63665058,8.0902505,1.22722644L10.1215935,2.5762291Q11.006711,3.1640306,10.745867,4.1940317L10.4062386,5.5351257L13.625054,7.5778356L13.625001,7.5779204Q13.678322,7.6117587,13.721552,7.6577945Q13.764784,7.7038307,13.795207,7.7591715Q13.82563,7.8145118,13.841336,7.87568Q13.857041,7.9368477,13.857041,8Q13.85704,8.0492353,13.847435,8.0975251Q13.83783,8.145814900000001,13.818987,8.191302799999999Q13.800144,8.2367907,13.772791,8.2777286Q13.745438,8.318666499999999,13.710623,8.3534818Q13.675808,8.3882966,13.63487,8.4156504Q13.593931,8.4430046,13.548444,8.461846399999999Q13.502956,8.4806881,13.454666,8.4902935Q13.406377,8.4998994,13.357141,8.499899899999999Q13.211908,8.499899899999999,13.089283,8.4220805L13.08923,8.4221654L4.9074116,3.229857L1.1170242400000001,0.92732695L1.1170761599999999,0.92724147Q1.06204063,0.8938076500000001,1.0172748,0.84751782Q0.97250897,0.80122799,0.9409355500000001,0.74510445Q0.9093622,0.68898091,0.89304277,0.626688Q0.87672335,0.564395107,0.87672332,0.5Q0.8767232899999999,0.450764146,0.88632876,0.402474351Q0.8959341599999999,0.35418455,0.91477591,0.30869657Q0.93361765,0.26320857,0.9609716500000001,0.22227046Q0.9883256,0.18133234999999998,1.02314061,0.14651734Q1.05795562,0.11170232000000002,1.0988937,0.08434838Q1.13983184,0.056994409999999995,1.18531984,0.038152660000000005Q1.2308077800000001,0.019310890000000025,1.27909762,0.009705450000000004Q1.32738745,0.00010001999999997846,1.3766233300000001,0.00009998999999999425Q1.516567,0.00009998999999999425,1.6361705,0.07275847000000002ZM9.5175018,4.9711194L9.7764683,3.9485345Q9.8634167,3.6052005,9.5683784,3.4092672L7.537035,2.0602646Q7.240603,1.8634058,6.9575009,2.0789949L6.0496349,2.7703574L9.5175018,4.9711194ZM11.227273,14.5L11.227273,9.7307692L11.227173,9.7307692Q11.227173,9.6815329,11.217567,9.6332426Q11.207962,9.5849533,11.189119,9.539465Q11.170278,9.4939766,11.142924,9.4530392Q11.11557,9.4121017,11.080755,9.3772869Q11.04594,9.3424721,11.005002,9.3151178Q10.964064,9.2877636,10.918575,9.2689209Q10.873087,9.2500801,10.824797,9.2404747Q10.776508,9.2308693,10.727273,9.2308693Q10.678036,9.2308693,10.629745,9.2404747Q10.581455,9.2500801,10.535968,9.2689209Q10.4904804,9.2877636,10.449542,9.3151178Q10.4086046,9.3424721,10.3737898,9.377286Q10.338975,9.4121008,10.3116207,9.4530382Q10.2842674,9.4939766,10.2654257,9.539465Q10.2465839,9.5849533,10.2369785,9.6332426Q10.2273731,9.6815329,10.2273731,9.7307692L10.2272739,9.7307692L10.2272739,14.5Q10.2272739,15,9.727273,15L7.7207794,15L7.7207789,8.2500091L7.7206788,8.2500091Q7.7206783,8.2007728,7.7110729,8.152483Q7.7014675,8.104193200000001,7.6826253,8.0587053Q7.6637836,8.013217000000001,7.6364298,7.9722791Q7.6090755,7.9313412,7.5742612,7.8965263Q7.5394459,7.861711,7.4985075,7.8343568Q7.4575696,7.807003,7.4120817,7.7881613Q7.3665934,7.7693195,7.3183041,7.7597141Q7.2700143,7.7501092,7.2207789,7.7501092Q7.1715426,7.7501092,7.1232524,7.7597141Q7.0749626,7.7693195,7.0294747,7.7881613Q6.9839869,7.807003,6.943049,7.8343573Q6.9021111,7.861711,6.8672962,7.8965263Q6.8324809,7.9313412,6.8051271,7.9722791Q6.7777729,8.013217000000001,6.7589312,8.0587053Q6.7400894,8.1041937,6.7304845,8.1524839Q6.7208786,8.2007732,6.7208791,8.2500095L6.7207789,8.2500091L6.7207794,15L4.2142854,15L4.2142854,6.2692308L4.2141855,6.2692308Q4.2141852,6.2199945,4.204579799999999,6.1717048Q4.1949743999999995,6.123415,4.1761324,6.0779266Q4.1572905,6.0324383,4.1299367,5.9915004Q4.1025827,5.9505625,4.0677679,5.9157476Q4.0329528,5.8809328,3.9920146,5.8535786Q3.9510765,5.8262248,3.9055884,5.8073831Q3.8601003,5.7885418,3.811811,5.7789364Q3.7635212,5.769331,3.7142854,5.769331Q3.6650493,5.769331,3.6167595,5.7789364Q3.5684695,5.7885418,3.5229816,5.8073831Q3.4774938,5.8262248,3.4365554,5.8535786Q3.3956175,5.8809328,3.3608027,5.9157476Q3.3259873,5.9505625,3.2986333,5.9915004Q3.2712793,6.0324383,3.2524376,6.0779266Q3.2335958,6.123415,3.2239904,6.1717048Q3.214385,6.2199945,3.2143853,6.2692308L3.2142854,6.2692308L3.2142854,15L1.5000002,15Q1.0000001200000002,15,1.0000001200000002,14.5L1,5.4150848Q1,5.0384622,1.3766233300000001,5.0384622L1.3766233300000001,5.0383615Q1.42585915,5.0383615,1.47414887,5.0287557Q1.5224386,5.0191503,1.5679266,5.0003085Q1.6134146,4.9814663,1.6543528,4.954113Q1.695291,4.9267588,1.730106,4.8919439Q1.7649209,4.8571291,1.792275,4.8161907Q1.8196288,4.7752523,1.8384706,4.7297645Q1.8573124,4.6842766,1.8669178,4.6359868Q1.8765233,4.587697,1.8765234,4.5384617Q1.8765233,4.4892254000000005,1.8669178,4.4409355999999995Q1.8573124,4.3926458,1.8384707,4.3471577Q1.819629,4.3016696,1.792275,4.2607315Q1.7649209,4.2197936,1.730106,4.1849787Q1.695291,4.1501637,1.6543529,4.1228096Q1.6134148,4.0954556,1.5679268,4.0766139Q1.5224388,4.0577724,1.4741489300000001,4.048166999999999Q1.42585915,4.0385615999999995,1.3766233300000001,4.0385615999999995L1.3766233300000001,4.0384617Q0.8064074800000001,4.0384617,0.403203636,4.4416654Q0,4.8448691,0,5.4150848L9.000000000813912e-8,14.5Q2.9999999984209325e-8,15.121321,0.439339694,15.56066Q0.8786805,16.000002000000002,1.5000002,16.000002000000002L9.727273,16.000002000000002Q10.3485928,16.000002000000002,10.787933,15.56066Q11.227273,15.121321,11.227273,14.5Z"})])},e})(N0);var D0=function(){return D0=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},D0.apply(this,arguments)},R0;(function(n){n.HORIZONTAL="horizontal",n.VERTICAL="vertical"})(R0||(R0={}));var s5=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),ss=function(){return ss=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},ss.apply(this,arguments)},l5=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},u5=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},d5=(function(n){s5(e,n);function e(t){var r=n.call(this,t)||this;r.textRef=xs(),r.setHoverOn=function(){var l=r.props.element;l.isDragging||r.state.isHovered||(r.setState({isHovered:!0}),l.setHovered(!0))},r.setHoverOff=function(){var l=r.props.element;r.state.isHovered&&(r.setState({isHovered:!1}),l.setHovered(!1))},r.handleMouseDown=function(l){var u,d=r.props,f=d.label,c=d.graphModel,h=c.editConfigModel.nodeTextDraggable;((u=f.draggable)!==null&&u!==void 0?u:h)&&!r.state.isDragging&&!r.state.isEditing&&r.stepDrag.handleMouseDown(l)},r.handleMouseUp=function(l){r.state.isDragging&&r.stepDrag.handleMouseUp(l)},r.handleDragging=function(l){var u=l.deltaX,d=l.deltaY;r.state.isDragging||r.setState({isDragging:!0});var f=r.props,c=f.label,h=f.graphModel,p=h.transformModel,v=u5(p.fixDeltaXY(u,d),2),g=v[0],y=v[1];r.setElementModelLabelInfo({x:c.x+g,y:c.y+y}),h.eventCenter.emit("label:drag",{data:c.getData(),model:c})},r.handleDragEnd=function(){r.setState({isDragging:!1})},r.handleClick=function(l){var u=r.props,d=u.label,f=u.element,c=u.graphModel;f.setSelected(!r.state.isSelected),r.setState({isSelected:!r.state.isSelected}),r.setElementModelLabelInfo({isSelected:!0}),c.eventCenter.emit("label:click",{data:d.getData(),e:l,model:f})},r.handleDbClick=function(l){var u=r.props,d=u.label,f=u.element,c=u.graphModel;if(c.eventCenter.emit("label:dblclick",{data:d.getData(),e:l,model:f}),!d.editable){f.setSelected(!0);return}if(f.setSelected(),f.setElementState(it.TEXT_EDIT),r.setState({isEditing:!0}),r.textRef.current){r.textRef.current.contentEditable="true",r.textRef.current.focus();var h=document.createRange(),p=window.getSelection();h.selectNodeContents(r.textRef.current),h.collapse(!1),p==null||p.removeAllRanges(),p==null||p.addRange(h)}},r.handleBlur=function(l){var u=r.props,d=u.label,f=u.element,c=u.graphModel.eventCenter;c.emit("label:blur",{e:l,model:f,data:d.getData(),element:r.textRef.current}),r.setState({isDragging:!1,isHovered:!1,isSelected:!1})},r.handleInput=function(l){var u=r.props,d=u.label,f=u.graphModel;f.eventCenter.emit("label:input",{e:l,data:d.getData()})},r.reCalcLabelSize=function(){};var i=t.label,o=t.graphModel,a=o.gridSize,s=o.eventCenter;return r.stepDrag=new Qn({onDragging:r.handleDragging,onDragEnd:r.handleDragEnd,step:a,eventType:"LABEL",model:i,eventCenter:s}),r.state={isEditing:!1,isHovered:!1,isDragging:!1,isSelected:!1},r}return e.prototype.setElementModelLabelInfo=function(t){var r=this.props,i=r.label,o=r.element,a=r.graphModel,s=o.properties._label,l=s,u=uf(l,function(c){return c.id===i.id}),d=l[u];l[u]=ss(ss({},d),t);var f=a.getElement(o.id);f==null||f.setProperty("_label",l)},e.prototype.componentDidMount=function(){var t=this,r=this.props,i=r.label,o=r.element,a=r.graphModel;a.eventCenter.on("blank:click,node:click,edge:click,label:click",function(s){var l,u,d,f,c=s.data;if(((c==null?void 0:c.type)!=="label"||c.type==="label"&&c.id!==i.id||t.state.isSelected)&&t.setState({isSelected:!1}),((c==null?void 0:c.type)!=="label"||c.type=="label"&&c.id!==i.id)&&t.state.isEditing){t.setState({isEditing:!1});var h=(u=(l=t.textRef.current)===null||l===void 0?void 0:l.innerText)!==null&&u!==void 0?u:"",p=(f=(d=t.textRef.current)===null||d===void 0?void 0:d.innerHTML)!==null&&f!==void 0?f:"";t.setElementModelLabelInfo({value:h,content:p,isSelected:!1}),o.setElementState(it.DEFAULT)}((c==null?void 0:c.type)!=="label"||c.type=="label"&&c.id!==i.id)&&t.textRef.current&&(t.textRef.current.contentEditable="false")})},e.prototype.componentDidUpdate=function(){},e.prototype.componentWillUnmount=function(){var t=this.props.graphModel;t.eventCenter.off("blank:click,node:click,edge:click")},e.prototype.render=function(){var t,r=this.props,i=r.label,o=r.element,a=r.graphModel,s=this.state,l=s.isDragging,u=s.isHovered,d=s.isSelected,f=s.isEditing,c=a.transformModel,h=c.getTransformStyle().transform,p=i.id,v=i.x,g=i.y,y=i.zIndex,m=i.vertical,O=i.style,T=i.rotate,C=i.content,A=i.labelWidth,E=i.textOverflowMode,N=A??(o.BaseType==="node"?o.width-20:80),B={left:"".concat(v-N/2,"px"),top:"".concat(g-10,"px"),width:"".concat(N,"px"),height:"20px",zIndex:y??1,transform:T?"".concat(h," rotate(").concat(T,"deg)"):"".concat(h," rotate(").concat(m?-.25:0,"turn)")};return $("div",{id:"element-container-".concat(p),className:lc("lf-label-editor-container"),style:B,onPointerDown:this.handleMouseDown,onPointerUp:this.handleMouseUp,onClick:this.handleClick,onDblClick:this.handleDbClick,onBlur:this.handleBlur,onMouseEnter:this.setHoverOn,onMouseOver:this.setHoverOn,onMouseLeave:this.setHoverOff,children:$("div",{ref:this.textRef,id:"editor-container-".concat(p),className:lc("lf-label-editor",(t={"lf-label-editor-dragging":l,"lf-label-editor-editing":f,"lf-label-editor-hover":!f&&(u||d)},t["lf-label-editor-".concat(E)]=!f,t)),onInput:this.handleInput,style:ss({maxWidth:"".concat(N,"px"),boxSizing:"border-box",display:"inline-block",background:f||o.BaseType==="edge"?"#fff":"transparent"},O),dangerouslySetInnerHTML:{__html:C}})})},e=l5([pn],e),e})(Ye),nr=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},f5=xi,c5=(function(){function n(e,t,r){var i;this.type="label",this.content="",this.value="",this.style={},this.vertical=!1,this.editable=!0,this.draggable=!0,this.textOverflowMode="default",this.element=t,this.graphModel=r,this.id=(i=e.id)!==null&&i!==void 0?i:f5(),this.initLabelData(e)}return n.prototype.initLabelData=function(e){Je(this,e)},n.prototype.getData=function(){return{id:this.id,x:this.x,y:this.y,type:"label",content:this.content,value:this.value,rotate:this.rotate,style:lr(this.style),draggable:this.draggable,editable:this.editable,labelWidth:this.labelWidth,textOverflowMode:this.textOverflowMode,vertical:this.vertical}},nr([z],n.prototype,"x",void 0),nr([z],n.prototype,"y",void 0),nr([z],n.prototype,"content",void 0),nr([z],n.prototype,"value",void 0),nr([z],n.prototype,"rotate",void 0),nr([z],n.prototype,"style",void 0),nr([z],n.prototype,"zIndex",void 0),nr([z],n.prototype,"vertical",void 0),nr([z],n.prototype,"editable",void 0),nr([z],n.prototype,"draggable",void 0),nr([z],n.prototype,"labelWidth",void 0),nr([z],n.prototype,"textOverflowMode",void 0),n})(),Nu={exports:{}},Hc=Nu.exports,L0;function h5(){return L0||(L0=1,(function(n){/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */"classList"in document.createElement("_")||(function(e){if("Element"in e){var t="classList",r="prototype",i=e.Element[r],o=Object,a=String[r].trim||function(){return this.replace(/^\s+|\s+$/g,"")},s=Array[r].indexOf||function(p){for(var v=0,g=this.length;v<g;v++)if(v in this&&this[v]===p)return v;return-1},l=function(p,v){this.name=p,this.code=DOMException[p],this.message=v},u=function(p,v){if(v==="")throw new l("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(v))throw new l("INVALID_CHARACTER_ERR","String contains an invalid character");return s.call(p,v)},d=function(p){for(var v=a.call(p.getAttribute("class")||""),g=v?v.split(/\s+/):[],y=0,m=g.length;y<m;y++)this.push(g[y]);this._updateClassName=function(){p.setAttribute("class",this.toString())}},f=d[r]=[],c=function(){return new d(this)};if(l[r]=Error[r],f.item=function(p){return this[p]||null},f.contains=function(p){return p+="",u(this,p)!==-1},f.add=function(){var p=arguments,v=0,g=p.length,y,m=!1;do y=p[v]+"",u(this,y)===-1&&(this.push(y),m=!0);while(++v<g);m&&this._updateClassName()},f.remove=function(){var p=arguments,v=0,g=p.length,y,m=!1,O;do for(y=p[v]+"",O=u(this,y);O!==-1;)this.splice(O,1),m=!0,O=u(this,y);while(++v<g);m&&this._updateClassName()},f.toggle=function(p,v){p+="";var g=this.contains(p),y=g?v!==!0&&"remove":v!==!1&&"add";return y&&this[y](p),v===!0||v===!1?v:!g},f.toString=function(){return this.join(" ")},o.defineProperty){var h={get:c,enumerable:!0,configurable:!0};try{o.defineProperty(i,t,h)}catch(p){p.number===-2146823252&&(h.enumerable=!1,o.defineProperty(i,t,h))}}else o[r].__defineGetter__&&i.__defineGetter__(t,c)}})(self);/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */(function(e){if(e.URL=e.URL||e.webkitURL,e.Blob&&e.URL)try{new Blob;return}catch{}var t=e.BlobBuilder||e.WebKitBlobBuilder||e.MozBlobBuilder||(function(i){var o=function(E){return Object.prototype.toString.call(E).match(/^\[object\s(.*)\]$/)[1]},a=function(){this.data=[]},s=function(N,B,Z){this.data=N,this.size=N.length,this.type=B,this.encoding=Z},l=a.prototype,u=s.prototype,d=i.FileReaderSync,f=function(E){this.code=this[this.name=E]},c="NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR".split(" "),h=c.length,p=i.URL||i.webkitURL||i,v=p.createObjectURL,g=p.revokeObjectURL,y=p,m=i.btoa,O=i.atob,T=i.ArrayBuffer,C=i.Uint8Array,A=/^[\w-]+:\/*\[?[\w\.:-]+\]?(?::[0-9]+)?/;for(s.fake=u.fake=!0;h--;)f.prototype[c[h]]=h+1;return p.createObjectURL||(y=i.URL=function(E){var N=document.createElementNS("http://www.w3.org/1999/xhtml","a"),B;return N.href=E,"origin"in N||(N.protocol.toLowerCase()==="data:"?N.origin=null:(B=E.match(A),N.origin=B&&B[1])),N}),y.createObjectURL=function(E){var N=E.type,B;if(N===null&&(N="application/octet-stream"),E instanceof s)return B="data:"+N,E.encoding==="base64"?B+";base64,"+E.data:E.encoding==="URI"?B+","+decodeURIComponent(E.data):m?B+";base64,"+m(E.data):B+","+encodeURIComponent(E.data);if(v)return v.call(p,E)},y.revokeObjectURL=function(E){E.substring(0,5)!=="data:"&&g&&g.call(p,E)},l.append=function(E){var N=this.data;if(C&&(E instanceof T||E instanceof C)){for(var B="",Z=new C(E),ue=0,me=Z.length;ue<me;ue++)B+=String.fromCharCode(Z[ue]);N.push(B)}else if(o(E)==="Blob"||o(E)==="File")if(d){var S=new d;N.push(S.readAsBinaryString(E))}else throw new f("NOT_READABLE_ERR");else E instanceof s?E.encoding==="base64"&&O?N.push(O(E.data)):E.encoding==="URI"?N.push(decodeURIComponent(E.data)):E.encoding==="raw"&&N.push(E.data):(typeof E!="string"&&(E+=""),N.push(unescape(encodeURIComponent(E))))},l.getBlob=function(E){return arguments.length||(E=null),new s(this.data.join(""),E,"raw")},l.toString=function(){return"[object BlobBuilder]"},u.slice=function(E,N,B){var Z=arguments.length;return Z<3&&(B=null),new s(this.data.slice(E,Z>1?N:this.data.length),B,this.encoding)},u.toString=function(){return"[object Blob]"},u.close=function(){this.size=0,delete this.data},a})(e);e.Blob=function(i,o){var a=o&&o.type||"",s=new t;if(i)for(var l=0,u=i.length;l<u;l++)Uint8Array&&i[l]instanceof Uint8Array?s.append(i[l].buffer):s.append(i[l]);var d=s.getBlob(a);return!d.slice&&d.webkitSlice&&(d.slice=d.webkitSlice),d};var r=Object.getPrototypeOf||function(i){return i.__proto__};e.Blob.prototype=r(new e.Blob)})(typeof self<"u"&&self||typeof window<"u"&&window||Hc.content||Hc),(function(e,t){var r=typeof process<"u"&&process&&process.versions&&process.versions.electron;r?e.MediumEditor=t:n.exports=t})(Hc,(function(){function e(t,r){return this.init(t,r)}return e.extensions={},(function(t){function r(l,u){var d,f=Array.prototype.slice.call(arguments,2);u=u||{};for(var c=0;c<f.length;c++){var h=f[c];if(h)for(d in h)h.hasOwnProperty(d)&&typeof h[d]<"u"&&(l||u.hasOwnProperty(d)===!1)&&(u[d]=h[d])}return u}var i=!1;try{var o=document.createElement("div"),a=document.createTextNode(" ");o.appendChild(a),i=o.contains(a)}catch{}var s={isIE:navigator.appName==="Microsoft Internet Explorer"||navigator.appName==="Netscape"&&new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent)!==null,isEdge:/Edge\/\d+/.exec(navigator.userAgent)!==null,isFF:navigator.userAgent.toLowerCase().indexOf("firefox")>-1,isMac:t.navigator.platform.toUpperCase().indexOf("MAC")>=0,keyCode:{BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DELETE:46,K:75,M:77,V:86},isMetaCtrlKey:function(l){return!!(s.isMac&&l.metaKey||!s.isMac&&l.ctrlKey)},isKey:function(l,u){var d=s.getKeyCode(l);return Array.isArray(u)===!1?d===u:u.indexOf(d)!==-1},getKeyCode:function(l){var u=l.which;return u===null&&(u=l.charCode!==null?l.charCode:l.keyCode),u},blockContainerElementNames:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","li","ol","address","article","aside","audio","canvas","dd","dl","dt","fieldset","figcaption","figure","footer","form","header","hgroup","main","nav","noscript","output","section","video","table","thead","tbody","tfoot","tr","th","td"],emptyElementNames:["br","col","colgroup","hr","img","input","source","wbr"],extend:function(){var u=[!0].concat(Array.prototype.slice.call(arguments));return r.apply(this,u)},defaults:function(){var u=[!1].concat(Array.prototype.slice.call(arguments));return r.apply(this,u)},createLink:function(l,u,d,f){var c=l.createElement("a");return s.moveTextRangeIntoElement(u[0],u[u.length-1],c),c.setAttribute("href",d),f&&(f==="_blank"&&c.setAttribute("rel","noopener noreferrer"),c.setAttribute("target",f)),c},findOrCreateMatchingTextNodes:function(l,u,d){for(var f=l.createTreeWalker(u,NodeFilter.SHOW_ALL,null,!1),c=[],h=0,p=!1,v=null,g=null;(v=f.nextNode())!==null;)if(!(v.nodeType>3))if(v.nodeType===3){if(!p&&d.start<h+v.nodeValue.length&&(p=!0,g=s.splitStartNodeIfNeeded(v,d.start,h)),p&&s.splitEndNodeIfNeeded(v,g,d.end,h),p&&h===d.end)break;if(p&&h>d.end+1)throw new Error("PerformLinking overshot the target!");p&&c.push(g||v),h+=v.nodeValue.length,g!==null&&(h+=g.nodeValue.length,f.nextNode()),g=null}else v.tagName.toLowerCase()==="img"&&(!p&&d.start<=h&&(p=!0),p&&c.push(v));return c},splitStartNodeIfNeeded:function(l,u,d){return u!==d?l.splitText(u-d):null},splitEndNodeIfNeeded:function(l,u,d,f){var c,h;c=f+l.nodeValue.length+(u?u.nodeValue.length:0)-1,h=d-f-(u?l.nodeValue.length:0),c>=d&&f!==c&&h!==0&&(u||l).splitText(h)},splitByBlockElements:function(l){if(l.nodeType!==3&&l.nodeType!==1)return[];var u=[],d=e.util.blockContainerElementNames.join(",");if(l.nodeType===3||l.querySelectorAll(d).length===0)return[l];for(var f=0;f<l.childNodes.length;f++){var c=l.childNodes[f];if(c.nodeType===3)u.push(c);else if(c.nodeType===1){var h=c.querySelectorAll(d);h.length===0?u.push(c):u=u.concat(e.util.splitByBlockElements(c))}}return u},findAdjacentTextNodeWithContent:function(u,d,f){var c=!1,h,p=f.createNodeIterator(u,NodeFilter.SHOW_TEXT,null,!1);for(h=p.nextNode();h;){if(h===d)c=!0;else if(c&&h.nodeType===3&&h.nodeValue&&h.nodeValue.trim().length>0)break;h=p.nextNode()}return h},findPreviousSibling:function(l){if(!l||s.isMediumEditorElement(l))return!1;for(var u=l.previousSibling;!u&&!s.isMediumEditorElement(l.parentNode);)l=l.parentNode,u=l.previousSibling;return u},isDescendant:function(u,d,f){if(!u||!d)return!1;if(u===d)return!!f;if(u.nodeType!==1)return!1;if(i||d.nodeType!==3)return u.contains(d);for(var c=d.parentNode;c!==null;){if(c===u)return!0;c=c.parentNode}return!1},isElement:function(u){return!!(u&&u.nodeType===1)},throttle:function(l,u){var d=50,f,c,h,p=null,v=0,g=function(){v=Date.now(),p=null,h=l.apply(f,c),p||(f=c=null)};return!u&&u!==0&&(u=d),function(){var y=Date.now(),m=u-(y-v);return f=this,c=arguments,m<=0||m>u?(p&&(clearTimeout(p),p=null),v=y,h=l.apply(f,c),p||(f=c=null)):p||(p=setTimeout(g,m)),h}},traverseUp:function(l,u){if(!l)return!1;do{if(l.nodeType===1){if(u(l))return l;if(s.isMediumEditorElement(l))return!1}l=l.parentNode}while(l);return!1},htmlEntities:function(l){return String(l).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},insertHTMLCommand:function(l,u){var d,f,c,h,p,v,g,y=!1,m=["insertHTML",!1,u];if(!e.util.isEdge&&l.queryCommandSupported("insertHTML"))try{return l.execCommand.apply(l,m)}catch{}if(d=l.getSelection(),d.rangeCount){if(f=d.getRangeAt(0),g=f.commonAncestorContainer,s.isMediumEditorElement(g)&&!g.firstChild)f.selectNode(g.appendChild(l.createTextNode("")));else if(g.nodeType===3&&f.startOffset===0&&f.endOffset===g.nodeValue.length||g.nodeType!==3&&g.innerHTML===f.toString()){for(;!s.isMediumEditorElement(g)&&g.parentNode&&g.parentNode.childNodes.length===1&&!s.isMediumEditorElement(g.parentNode);)g=g.parentNode;f.selectNode(g)}for(f.deleteContents(),c=l.createElement("div"),c.innerHTML=u,h=l.createDocumentFragment();c.firstChild;)p=c.firstChild,v=h.appendChild(p);f.insertNode(h),v&&(f=f.cloneRange(),f.setStartAfter(v),f.collapse(!0),e.selection.selectRange(l,f)),y=!0}return l.execCommand.callListeners&&l.execCommand.callListeners(m,y),y},execFormatBlock:function(l,u){var d=s.getTopBlockContainer(e.selection.getSelectionStart(l)),f;if(u==="blockquote"){if(d&&(f=Array.prototype.slice.call(d.childNodes),f.some(function(c){return s.isBlockContainer(c)})))return l.execCommand("outdent",!1,null);if(s.isIE)return l.execCommand("indent",!1,u)}if(d&&u===d.nodeName.toLowerCase()&&(u="p"),s.isIE&&(u="<"+u+">"),d&&d.nodeName.toLowerCase()==="blockquote"){if(s.isIE&&u==="<p>")return l.execCommand("outdent",!1,u);if((s.isFF||s.isEdge)&&u==="p")return f=Array.prototype.slice.call(d.childNodes),f.some(function(c){return!s.isBlockContainer(c)})&&l.execCommand("formatBlock",!1,u),l.execCommand("outdent",!1,u)}return l.execCommand("formatBlock",!1,u)},setTargetBlank:function(l,u){var d,f=u||!1;if(l.nodeName.toLowerCase()==="a")l.target="_blank",l.rel="noopener noreferrer";else for(l=l.getElementsByTagName("a"),d=0;d<l.length;d+=1)(f===!1||f===l[d].attributes.href.value)&&(l[d].target="_blank",l[d].rel="noopener noreferrer")},removeTargetBlank:function(l,u){var d;if(l.nodeName.toLowerCase()==="a")l.removeAttribute("target"),l.removeAttribute("rel");else for(l=l.getElementsByTagName("a"),d=0;d<l.length;d+=1)u===l[d].attributes.href.value&&(l[d].removeAttribute("target"),l[d].removeAttribute("rel"))},addClassToAnchors:function(l,u){var d=u.split(" "),f,c;if(l.nodeName.toLowerCase()==="a")for(c=0;c<d.length;c+=1)l.classList.add(d[c]);else{var h=l.getElementsByTagName("a");if(h.length===0){var p=s.getClosestTag(l,"a");l=p?[p]:[]}else l=h;for(f=0;f<l.length;f+=1)for(c=0;c<d.length;c+=1)l[f].classList.add(d[c])}},isListItem:function(l){if(!l)return!1;if(l.nodeName.toLowerCase()==="li")return!0;for(var u=l.parentNode,d=u.nodeName.toLowerCase();d==="li"||!s.isBlockContainer(u)&&d!=="div";){if(d==="li")return!0;if(u=u.parentNode,u)d=u.nodeName.toLowerCase();else return!1}return!1},cleanListDOM:function(l,u){if(u.nodeName.toLowerCase()==="li"){var d=u.parentElement;d.parentElement.nodeName.toLowerCase()==="p"&&(s.unwrap(d.parentElement,l),e.selection.moveCursor(l,u.firstChild,u.firstChild.textContent.length))}},splitOffDOMTree:function(l,u,d){for(var f=u,c=null,h=!d;f!==l;){var p=f.parentNode,v=p.cloneNode(!1),g=h?f:p.firstChild,y;for(c&&(h?v.appendChild(c):y=c),c=v;g;){var m=g.nextSibling;g===f?(g.hasChildNodes()?g=g.cloneNode(!1):g.parentNode.removeChild(g),g.textContent&&c.appendChild(g),g=h?m:null):(g.parentNode.removeChild(g),(g.hasChildNodes()||g.textContent)&&c.appendChild(g),g=m)}y&&c.appendChild(y),f=p}return c},moveTextRangeIntoElement:function(l,u,d){if(!l||!u)return!1;var f=s.findCommonRoot(l,u);if(!f)return!1;if(u===l){var c=l.parentNode,h=l.nextSibling;return c.removeChild(l),d.appendChild(l),h?c.insertBefore(d,h):c.appendChild(d),d.hasChildNodes()}for(var p=[],v,g,y,m=0;m<f.childNodes.length;m++)if(y=f.childNodes[m],!v)s.isDescendant(y,l,!0)&&(v=y);else if(s.isDescendant(y,u,!0)){g=y;break}else p.push(y);var O=g.nextSibling,T=f.ownerDocument.createDocumentFragment();return v===l?(v.parentNode.removeChild(v),T.appendChild(v)):T.appendChild(s.splitOffDOMTree(v,l)),p.forEach(function(C){C.parentNode.removeChild(C),T.appendChild(C)}),g===u?(g.parentNode.removeChild(g),T.appendChild(g)):T.appendChild(s.splitOffDOMTree(g,u,!0)),d.appendChild(T),g.parentNode===f?f.insertBefore(d,g):O?f.insertBefore(d,O):f.appendChild(d),d.hasChildNodes()},depthOfNode:function(l){for(var u=0,d=l;d.parentNode!==null;)d=d.parentNode,u++;return u},findCommonRoot:function(l,u){for(var d=s.depthOfNode(l),f=s.depthOfNode(u),c=l,h=u;d!==f;)d>f?(c=c.parentNode,d-=1):(h=h.parentNode,f-=1);for(;c!==h;)c=c.parentNode,h=h.parentNode;return c},isElementAtBeginningOfBlock:function(l){for(var u,d;!s.isBlockContainer(l)&&!s.isMediumEditorElement(l);){for(d=l;d=d.previousSibling;)if(u=d.nodeType===3?d.nodeValue:d.textContent,u.length>0)return!1;l=l.parentNode}return!0},isMediumEditorElement:function(l){return l&&l.getAttribute&&!!l.getAttribute("data-medium-editor-element")},getContainerEditorElement:function(l){return s.traverseUp(l,function(u){return s.isMediumEditorElement(u)})},isBlockContainer:function(l){return l&&l.nodeType!==3&&s.blockContainerElementNames.indexOf(l.nodeName.toLowerCase())!==-1},getClosestBlockContainer:function(l){return s.traverseUp(l,function(u){return s.isBlockContainer(u)||s.isMediumEditorElement(u)})},getTopBlockContainer:function(l){var u=s.isBlockContainer(l)?l:!1;return s.traverseUp(l,function(d){return s.isBlockContainer(d)&&(u=d),!u&&s.isMediumEditorElement(d)?(u=d,!0):!1}),u},getFirstSelectableLeafNode:function(l){for(;l&&l.firstChild;)l=l.firstChild;if(l=s.traverseUp(l,function(d){return s.emptyElementNames.indexOf(d.nodeName.toLowerCase())===-1}),l.nodeName.toLowerCase()==="table"){var u=l.querySelector("th, td");u&&(l=u)}return l},getFirstTextNode:function(l){return s.warn("getFirstTextNode is deprecated and will be removed in version 6.0.0"),s._getFirstTextNode(l)},_getFirstTextNode:function(l){if(l.nodeType===3)return l;for(var u=0;u<l.childNodes.length;u++){var d=s._getFirstTextNode(l.childNodes[u]);if(d!==null)return d}return null},ensureUrlHasProtocol:function(l){return l.indexOf("://")===-1?"http://"+l:l},warn:function(){t.console!==void 0&&typeof t.console.warn=="function"&&t.console.warn.apply(t.console,arguments)},deprecated:function(l,u,d){var f=l+" is deprecated, please use "+u+" instead.";d&&(f+=" Will be removed in "+d),s.warn(f)},deprecatedMethod:function(l,u,d,f){s.deprecated(l,u,f),typeof this[u]=="function"&&this[u].apply(this,d)},cleanupAttrs:function(l,u){u.forEach(function(d){l.removeAttribute(d)})},cleanupTags:function(l,u){u.indexOf(l.nodeName.toLowerCase())!==-1&&l.parentNode.removeChild(l)},unwrapTags:function(l,u){u.indexOf(l.nodeName.toLowerCase())!==-1&&e.util.unwrap(l,document)},getClosestTag:function(l,u){return s.traverseUp(l,function(d){return d.nodeName.toLowerCase()===u.toLowerCase()})},unwrap:function(l,u){for(var d=u.createDocumentFragment(),f=Array.prototype.slice.call(l.childNodes),c=0;c<f.length;c++)d.appendChild(f[c]);d.childNodes.length?l.parentNode.replaceChild(d,l):l.parentNode.removeChild(l)},guid:function(){function l(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return l()+l()+"-"+l()+"-"+l()+"-"+l()+"-"+l()+l()+l()}};e.util=s})(window),(function(){var t=function(r){e.util.extend(this,r)};t.extend=function(r){var i=this,o;r&&r.hasOwnProperty("constructor")?o=r.constructor:o=function(){return i.apply(this,arguments)},e.util.extend(o,i);var a=function(){this.constructor=o};return a.prototype=i.prototype,o.prototype=new a,r&&e.util.extend(o.prototype,r),o},t.prototype={init:function(){},base:void 0,name:void 0,checkState:void 0,destroy:void 0,queryCommandState:void 0,isActive:void 0,isAlreadyApplied:void 0,setActive:void 0,setInactive:void 0,getInteractionElements:void 0,window:void 0,document:void 0,getEditorElements:function(){return this.base.elements},getEditorId:function(){return this.base.id},getEditorOption:function(r){return this.base.options[r]}},["execAction","on","off","subscribe","trigger"].forEach(function(r){t.prototype[r]=function(){return this.base[r].apply(this.base,arguments)}}),e.Extension=t})(),(function(){function t(i){return e.util.isBlockContainer(i)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}var r={findMatchingSelectionParent:function(i,o){var a=o.getSelection(),s,l;return a.rangeCount===0?!1:(s=a.getRangeAt(0),l=s.commonAncestorContainer,e.util.traverseUp(l,i))},getSelectionElement:function(i){return this.findMatchingSelectionParent(function(o){return e.util.isMediumEditorElement(o)},i)},exportSelection:function(i,o){if(!i)return null;var a=null,s=o.getSelection();if(s.rangeCount>0){var l=s.getRangeAt(0),u=l.cloneRange(),d;u.selectNodeContents(i),u.setEnd(l.startContainer,l.startOffset),d=u.toString().length,a={start:d,end:d+l.toString().length},this.doesRangeStartWithImages(l,o)&&(a.startsWithImage=!0);var f=this.getTrailingImageCount(i,a,l.endContainer,l.endOffset);if(f&&(a.trailingImageCount=f),d!==0){var c=this.getIndexRelativeToAdjacentEmptyBlocks(o,i,l.startContainer,l.startOffset);c!==-1&&(a.emptyBlocksIndex=c)}}return a},importSelection:function(i,o,a,s){if(!(!i||!o)){var l=a.createRange();l.setStart(o,0),l.collapse(!0);var u=o,d=[],f=0,c=!1,h=!1,p=0,v=!1,g,y=!1,m=null;for((s||i.startsWithImage||typeof i.emptyBlocksIndex<"u")&&(y=!0);!v&&u;){if(u.nodeType>3){u=d.pop();continue}if(u.nodeType===3&&!h)g=f+u.length,!c&&i.start>=f&&i.start<=g&&(y||i.start<g?(l.setStart(u,i.start-f),c=!0):m=u),c&&i.end>=f&&i.end<=g&&(i.trailingImageCount?h=!0:(l.setEnd(u,i.end-f),v=!0)),f=g;else{if(i.trailingImageCount&&h&&(u.nodeName.toLowerCase()==="img"&&p++,p===i.trailingImageCount)){for(var O=0;u.parentNode.childNodes[O]!==u;)O++;l.setEnd(u.parentNode,O+1),v=!0}if(!v&&u.nodeType===1)for(var T=u.childNodes.length-1;T>=0;)d.push(u.childNodes[T]),T-=1}v||(u=d.pop())}!c&&m&&(l.setStart(m,m.length),l.setEnd(m,m.length)),typeof i.emptyBlocksIndex<"u"&&(l=this.importSelectionMoveCursorPastBlocks(a,o,i.emptyBlocksIndex,l)),s&&(l=this.importSelectionMoveCursorPastAnchor(i,l)),this.selectRange(a,l)}},importSelectionMoveCursorPastAnchor:function(i,o){var a=function(f){return f.nodeName.toLowerCase()==="a"};if(i.start===i.end&&o.startContainer.nodeType===3&&o.startOffset===o.startContainer.nodeValue.length&&e.util.traverseUp(o.startContainer,a)){for(var s=o.startContainer,l=o.startContainer.parentNode;l!==null&&l.nodeName.toLowerCase()!=="a";)l.childNodes[l.childNodes.length-1]!==s?l=null:(s=l,l=l.parentNode);if(l!==null&&l.nodeName.toLowerCase()==="a"){for(var u=null,d=0;u===null&&d<l.parentNode.childNodes.length;d++)l.parentNode.childNodes[d]===l&&(u=d);o.setStart(l.parentNode,u+1),o.collapse(!0)}}return o},importSelectionMoveCursorPastBlocks:function(i,o,a,s){var l=i.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,t,!1),u=s.startContainer,d,f,c=0;for(a=a||1,u.nodeType===3&&e.util.isBlockContainer(u.previousSibling)?d=u.previousSibling:d=e.util.getClosestBlockContainer(u);l.nextNode();)if(!f)d===l.currentNode&&(f=l.currentNode);else if(f=l.currentNode,c++,c===a||f.textContent.length>0)break;return f||(f=d),s.setStart(e.util.getFirstSelectableLeafNode(f),0),s},getIndexRelativeToAdjacentEmptyBlocks:function(i,o,a,s){if(a.textContent.length>0&&s>0)return-1;var l=a;if(l.nodeType!==3&&(l=a.childNodes[s]),l){if(!e.util.isElementAtBeginningOfBlock(l))return-1;var u=e.util.findPreviousSibling(l);if(u){if(u.nodeValue)return-1}else return-1}for(var d=e.util.getClosestBlockContainer(a),f=i.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,t,!1),c=0;f.nextNode();){var h=f.currentNode.textContent==="";if((h||c>0)&&(c+=1),f.currentNode===d)return c;h||(c=0)}return c},doesRangeStartWithImages:function(i,o){if(i.startOffset!==0||i.startContainer.nodeType!==1)return!1;if(i.startContainer.nodeName.toLowerCase()==="img")return!0;var a=i.startContainer.querySelector("img");if(!a)return!1;for(var s=o.createTreeWalker(i.startContainer,NodeFilter.SHOW_ALL,null,!1);s.nextNode();){var l=s.currentNode;if(l===a)break;if(l.nodeValue)return!1}return!0},getTrailingImageCount:function(i,o,a,s){if(s===0||a.nodeType!==1||a.nodeName.toLowerCase()!=="img"&&!a.querySelector("img"))return 0;for(var l=a.childNodes[s-1];l.hasChildNodes();)l=l.lastChild;for(var u=i,d=[],f=0,c=!1,h=!1,p=!1,v,g=0;!p&&u;){if(u.nodeType>3){u=d.pop();continue}if(u.nodeType===3&&!h)g=0,v=f+u.length,!c&&o.start>=f&&o.start<=v&&(c=!0),c&&o.end>=f&&o.end<=v&&(h=!0),f=v;else if(u.nodeName.toLowerCase()==="img"&&g++,u===l)p=!0;else if(u.nodeType===1)for(var y=u.childNodes.length-1;y>=0;)d.push(u.childNodes[y]),y-=1;p||(u=d.pop())}return g},selectionContainsContent:function(i){var o=i.getSelection();if(!o||o.isCollapsed||!o.rangeCount)return!1;if(o.toString().trim()!=="")return!0;var a=this.getSelectedParentElement(o.getRangeAt(0));return!!(a&&(a.nodeName.toLowerCase()==="img"||a.nodeType===1&&a.querySelector("img")))},selectionInContentEditableFalse:function(i){var o,a=this.findMatchingSelectionParent(function(s){var l=s&&s.getAttribute("contenteditable");return l==="true"&&(o=!0),s.nodeName!=="#text"&&l==="false"},i);return!o&&a},getSelectionHtml:function(o){var a,s="",l=o.getSelection(),u,d;if(l.rangeCount){for(d=o.createElement("div"),a=0,u=l.rangeCount;a<u;a+=1)d.appendChild(l.getRangeAt(a).cloneContents());s=d.innerHTML}return s},getCaretOffsets:function(o,a){var s,l;return a||(a=window.getSelection().getRangeAt(0)),s=a.cloneRange(),l=a.cloneRange(),s.selectNodeContents(o),s.setEnd(a.endContainer,a.endOffset),l.selectNodeContents(o),l.setStart(a.endContainer,a.endOffset),{left:s.toString().length,right:l.toString().length}},rangeSelectsSingleNode:function(i){var o=i.startContainer;return o===i.endContainer&&o.hasChildNodes()&&i.endOffset===i.startOffset+1},getSelectedParentElement:function(i){return i?this.rangeSelectsSingleNode(i)&&i.startContainer.childNodes[i.startOffset].nodeType!==3?i.startContainer.childNodes[i.startOffset]:i.startContainer.nodeType===3?i.startContainer.parentNode:i.startContainer:null},getSelectedElements:function(i){var o=i.getSelection(),a,s,l;if(!o.rangeCount||o.isCollapsed||!o.getRangeAt(0).commonAncestorContainer)return[];if(a=o.getRangeAt(0),a.commonAncestorContainer.nodeType===3){for(s=[],l=a.commonAncestorContainer;l.parentNode&&l.parentNode.childNodes.length===1;)s.push(l.parentNode),l=l.parentNode;return s}return[].filter.call(a.commonAncestorContainer.getElementsByTagName("*"),function(u){return typeof o.containsNode=="function"?o.containsNode(u,!0):!0})},selectNode:function(i,o){var a=o.createRange();a.selectNodeContents(i),this.selectRange(o,a)},select:function(i,o,a,s,l){var u=i.createRange();return u.setStart(o,a),s?u.setEnd(s,l):u.collapse(!0),this.selectRange(i,u),u},clearSelection:function(i,o){o?i.getSelection().collapseToStart():i.getSelection().collapseToEnd()},moveCursor:function(i,o,a){this.select(i,o,a)},getSelectionRange:function(i){var o=i.getSelection();return o.rangeCount===0?null:o.getRangeAt(0)},selectRange:function(i,o){var a=i.getSelection();a.removeAllRanges(),a.addRange(o)},getSelectionStart:function(i){var o=i.getSelection().anchorNode,a=o&&o.nodeType===3?o.parentNode:o;return a}};e.selection=r})(),(function(){function t(i,o){return i?i.some(function(a){if(typeof a.getInteractionElements!="function")return!1;var s=a.getInteractionElements();return s?(Array.isArray(s)||(s=[s]),s.some(function(l){return e.util.isDescendant(l,o,!0)})):!1}):!1}var r=function(i){this.base=i,this.options=this.base.options,this.events=[],this.disabledEvents={},this.customEvents={},this.listeners={}};r.prototype={InputEventOnContenteditableSupported:!e.util.isIE&&!e.util.isEdge,attachDOMEvent:function(i,o,a,s){var l=this.base.options.contentWindow,u=this.base.options.ownerDocument;i=e.util.isElement(i)||[l,u].indexOf(i)>-1?[i]:i,Array.prototype.forEach.call(i,(function(d){d.addEventListener(o,a,s),this.events.push([d,o,a,s])}).bind(this))},detachDOMEvent:function(i,o,a,s){var l,u,d=this.base.options.contentWindow,f=this.base.options.ownerDocument;i&&(i=e.util.isElement(i)||[d,f].indexOf(i)>-1?[i]:i,Array.prototype.forEach.call(i,(function(c){l=this.indexOfListener(c,o,a,s),l!==-1&&(u=this.events.splice(l,1)[0],u[0].removeEventListener(u[1],u[2],u[3]))}).bind(this)))},indexOfListener:function(i,o,a,s){var l,u,d;for(l=0,u=this.events.length;l<u;l=l+1)if(d=this.events[l],d[0]===i&&d[1]===o&&d[2]===a&&d[3]===s)return l;return-1},detachAllDOMEvents:function(){for(var i=this.events.pop();i;)i[0].removeEventListener(i[1],i[2],i[3]),i=this.events.pop()},detachAllEventsFromElement:function(i){for(var o=this.events.filter(function(u){return u&&u[0].getAttribute&&u[0].getAttribute("medium-editor-index")===i.getAttribute("medium-editor-index")}),a=0,s=o.length;a<s;a++){var l=o[a];this.detachDOMEvent(l[0],l[1],l[2],l[3])}},attachAllEventsToElement:function(i){this.listeners.editableInput&&(this.contentCache[i.getAttribute("medium-editor-index")]=i.innerHTML),this.eventsCache&&this.eventsCache.forEach(function(o){this.attachDOMEvent(i,o.name,o.handler.bind(this))},this)},enableCustomEvent:function(i){this.disabledEvents[i]!==void 0&&delete this.disabledEvents[i]},disableCustomEvent:function(i){this.disabledEvents[i]=!0},attachCustomEvent:function(i,o){this.setupListener(i),this.customEvents[i]||(this.customEvents[i]=[]),this.customEvents[i].push(o)},detachCustomEvent:function(i,o){var a=this.indexOfCustomListener(i,o);a!==-1&&this.customEvents[i].splice(a,1)},indexOfCustomListener:function(i,o){return!this.customEvents[i]||!this.customEvents[i].length?-1:this.customEvents[i].indexOf(o)},detachAllCustomEvents:function(){this.customEvents={}},triggerCustomEvent:function(i,o,a){this.customEvents[i]&&!this.disabledEvents[i]&&this.customEvents[i].forEach(function(s){s(o,a)})},destroy:function(){this.detachAllDOMEvents(),this.detachAllCustomEvents(),this.detachExecCommand(),this.base.elements&&this.base.elements.forEach(function(i){i.removeAttribute("data-medium-focused")})},attachToExecCommand:function(){this.execCommandListener||(this.execCommandListener=(function(i){this.handleDocumentExecCommand(i)}).bind(this),this.wrapExecCommand(),this.options.ownerDocument.execCommand.listeners.push(this.execCommandListener))},detachExecCommand:function(){var i=this.options.ownerDocument;if(!(!this.execCommandListener||!i.execCommand.listeners)){var o=i.execCommand.listeners.indexOf(this.execCommandListener);o!==-1&&i.execCommand.listeners.splice(o,1),i.execCommand.listeners.length||this.unwrapExecCommand()}},wrapExecCommand:function(){var i=this.options.ownerDocument;if(!i.execCommand.listeners){var o=function(s,l){i.execCommand.listeners&&i.execCommand.listeners.forEach(function(u){u({command:s[0],value:s[2],args:s,result:l})})},a=function(){var s=i.execCommand.orig.apply(this,arguments);if(!i.execCommand.listeners)return s;var l=Array.prototype.slice.call(arguments);return o(l,s),s};a.orig=i.execCommand,a.listeners=[],a.callListeners=o,i.execCommand=a}},unwrapExecCommand:function(){var i=this.options.ownerDocument;i.execCommand.orig&&(i.execCommand=i.execCommand.orig)},setupListener:function(i){if(!this.listeners[i]){switch(i){case"externalInteraction":this.attachDOMEvent(this.options.ownerDocument.body,"mousedown",this.handleBodyMousedown.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"click",this.handleBodyClick.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"focus",this.handleBodyFocus.bind(this),!0);break;case"blur":this.setupListener("externalInteraction");break;case"focus":this.setupListener("externalInteraction");break;case"editableInput":this.contentCache={},this.base.elements.forEach(function(o){this.contentCache[o.getAttribute("medium-editor-index")]=o.innerHTML},this),this.InputEventOnContenteditableSupported&&this.attachToEachElement("input",this.handleInput),this.InputEventOnContenteditableSupported||(this.setupListener("editableKeypress"),this.keypressUpdateInput=!0,this.attachDOMEvent(document,"selectionchange",this.handleDocumentSelectionChange.bind(this)),this.attachToExecCommand());break;case"editableClick":this.attachToEachElement("click",this.handleClick);break;case"editableBlur":this.attachToEachElement("blur",this.handleBlur);break;case"editableKeypress":this.attachToEachElement("keypress",this.handleKeypress);break;case"editableKeyup":this.attachToEachElement("keyup",this.handleKeyup);break;case"editableKeydown":this.attachToEachElement("keydown",this.handleKeydown);break;case"editableKeydownSpace":this.setupListener("editableKeydown");break;case"editableKeydownEnter":this.setupListener("editableKeydown");break;case"editableKeydownTab":this.setupListener("editableKeydown");break;case"editableKeydownDelete":this.setupListener("editableKeydown");break;case"editableMouseover":this.attachToEachElement("mouseover",this.handleMouseover);break;case"editableDrag":this.attachToEachElement("dragover",this.handleDragging),this.attachToEachElement("dragleave",this.handleDragging);break;case"editableDrop":this.attachToEachElement("drop",this.handleDrop);break;case"editablePaste":this.attachToEachElement("paste",this.handlePaste);break}this.listeners[i]=!0}},attachToEachElement:function(i,o){this.eventsCache||(this.eventsCache=[]),this.base.elements.forEach(function(a){this.attachDOMEvent(a,i,o.bind(this))},this),this.eventsCache.push({name:i,handler:o})},cleanupElement:function(i){var o=i.getAttribute("medium-editor-index");o&&(this.detachAllEventsFromElement(i),this.contentCache&&delete this.contentCache[o])},focusElement:function(i){i.focus(),this.updateFocus(i,{target:i,type:"focus"})},updateFocus:function(i,o){var a=this.base.getFocusedElement(),s;a&&o.type==="click"&&this.lastMousedownTarget&&(e.util.isDescendant(a,this.lastMousedownTarget,!0)||t(this.base.extensions,this.lastMousedownTarget))&&(s=a),s||this.base.elements.some(function(u){return!s&&e.util.isDescendant(u,i,!0)&&(s=u),!!s},this);var l=!e.util.isDescendant(a,i,!0)&&!t(this.base.extensions,i);s!==a&&(a&&l&&(a.removeAttribute("data-medium-focused"),this.triggerCustomEvent("blur",o,a)),s&&(s.setAttribute("data-medium-focused",!0),this.triggerCustomEvent("focus",o,s))),l&&this.triggerCustomEvent("externalInteraction",o)},updateInput:function(i,o){if(this.contentCache){var a=i.getAttribute("medium-editor-index"),s=i.innerHTML;s!==this.contentCache[a]&&this.triggerCustomEvent("editableInput",o,i),this.contentCache[a]=s}},handleDocumentSelectionChange:function(i){if(i.currentTarget&&i.currentTarget.activeElement){var o=i.currentTarget.activeElement,a;this.base.elements.some(function(s){return e.util.isDescendant(s,o,!0)?(a=s,!0):!1},this),a&&this.updateInput(a,{target:o,currentTarget:a})}},handleDocumentExecCommand:function(){var i=this.base.getFocusedElement();i&&this.updateInput(i,{target:i,currentTarget:i})},handleBodyClick:function(i){this.updateFocus(i.target,i)},handleBodyFocus:function(i){this.updateFocus(i.target,i)},handleBodyMousedown:function(i){this.lastMousedownTarget=i.target},handleInput:function(i){this.updateInput(i.currentTarget,i)},handleClick:function(i){this.triggerCustomEvent("editableClick",i,i.currentTarget)},handleBlur:function(i){this.triggerCustomEvent("editableBlur",i,i.currentTarget)},handleKeypress:function(i){if(this.triggerCustomEvent("editableKeypress",i,i.currentTarget),this.keypressUpdateInput){var o={target:i.target,currentTarget:i.currentTarget};setTimeout((function(){this.updateInput(o.currentTarget,o)}).bind(this),0)}},handleKeyup:function(i){this.triggerCustomEvent("editableKeyup",i,i.currentTarget)},handleMouseover:function(i){this.triggerCustomEvent("editableMouseover",i,i.currentTarget)},handleDragging:function(i){this.triggerCustomEvent("editableDrag",i,i.currentTarget)},handleDrop:function(i){this.triggerCustomEvent("editableDrop",i,i.currentTarget)},handlePaste:function(i){this.triggerCustomEvent("editablePaste",i,i.currentTarget)},handleKeydown:function(i){if(this.triggerCustomEvent("editableKeydown",i,i.currentTarget),e.util.isKey(i,e.util.keyCode.SPACE))return this.triggerCustomEvent("editableKeydownSpace",i,i.currentTarget);if(e.util.isKey(i,e.util.keyCode.ENTER)||i.ctrlKey&&e.util.isKey(i,e.util.keyCode.M))return this.triggerCustomEvent("editableKeydownEnter",i,i.currentTarget);if(e.util.isKey(i,e.util.keyCode.TAB))return this.triggerCustomEvent("editableKeydownTab",i,i.currentTarget);if(e.util.isKey(i,[e.util.keyCode.DELETE,e.util.keyCode.BACKSPACE]))return this.triggerCustomEvent("editableKeydownDelete",i,i.currentTarget)}},e.Events=r})(),(function(){var t=e.Extension.extend({action:void 0,aria:void 0,tagNames:void 0,style:void 0,useQueryState:void 0,contentDefault:void 0,contentFA:void 0,classList:void 0,attrs:void 0,constructor:function(r){t.isBuiltInButton(r)?e.Extension.call(this,this.defaults[r]):e.Extension.call(this,r)},init:function(){e.Extension.prototype.init.apply(this,arguments),this.button=this.createButton(),this.on(this.button,"click",this.handleClick.bind(this))},getButton:function(){return this.button},getAction:function(){return typeof this.action=="function"?this.action(this.base.options):this.action},getAria:function(){return typeof this.aria=="function"?this.aria(this.base.options):this.aria},getTagNames:function(){return typeof this.tagNames=="function"?this.tagNames(this.base.options):this.tagNames},createButton:function(){var r=this.document.createElement("button"),i=this.contentDefault,o=this.getAria(),a=this.getEditorOption("buttonLabels");return r.classList.add("medium-editor-action"),r.classList.add("medium-editor-action-"+this.name),this.classList&&this.classList.forEach(function(s){r.classList.add(s)}),r.setAttribute("data-action",this.getAction()),o&&(r.setAttribute("title",o),r.setAttribute("aria-label",o)),this.attrs&&Object.keys(this.attrs).forEach(function(s){r.setAttribute(s,this.attrs[s])},this),a==="fontawesome"&&this.contentFA&&(i=this.contentFA),r.innerHTML=i,r},handleClick:function(r){r.preventDefault(),r.stopPropagation();var i=this.getAction();i&&this.execAction(i)},isActive:function(){return this.button.classList.contains(this.getEditorOption("activeButtonClass"))},setInactive:function(){this.button.classList.remove(this.getEditorOption("activeButtonClass")),delete this.knownState},setActive:function(){this.button.classList.add(this.getEditorOption("activeButtonClass")),delete this.knownState},queryCommandState:function(){var r=null;return this.useQueryState&&(r=this.base.queryCommandState(this.getAction())),r},isAlreadyApplied:function(r){var i=!1,o=this.getTagNames(),a,s;return this.knownState===!1||this.knownState===!0?this.knownState:(o&&o.length>0&&(i=o.indexOf(r.nodeName.toLowerCase())!==-1),!i&&this.style&&(a=this.style.value.split("|"),s=this.window.getComputedStyle(r,null).getPropertyValue(this.style.prop),a.forEach(function(l){this.knownState||(i=s.indexOf(l)!==-1,(i||this.style.prop!=="text-decoration")&&(this.knownState=i))},this)),i)}});t.isBuiltInButton=function(r){return typeof r=="string"&&e.extensions.button.prototype.defaults.hasOwnProperty(r)},e.extensions.button=t})(),(function(){e.extensions.button.prototype.defaults={bold:{name:"bold",action:"bold",aria:"bold",tagNames:["b","strong"],style:{prop:"font-weight",value:"700|bold"},useQueryState:!0,contentDefault:"<b>B</b>",contentFA:'<i class="fa fa-bold"></i>'},italic:{name:"italic",action:"italic",aria:"italic",tagNames:["i","em"],style:{prop:"font-style",value:"italic"},useQueryState:!0,contentDefault:"<b><i>I</i></b>",contentFA:'<i class="fa fa-italic"></i>'},underline:{name:"underline",action:"underline",aria:"underline",tagNames:["u"],style:{prop:"text-decoration",value:"underline"},useQueryState:!0,contentDefault:"<b><u>U</u></b>",contentFA:'<i class="fa fa-underline"></i>'},strikethrough:{name:"strikethrough",action:"strikethrough",aria:"strike through",tagNames:["strike"],style:{prop:"text-decoration",value:"line-through"},useQueryState:!0,contentDefault:"<s>A</s>",contentFA:'<i class="fa fa-strikethrough"></i>'},superscript:{name:"superscript",action:"superscript",aria:"superscript",tagNames:["sup"],contentDefault:"<b>x<sup>1</sup></b>",contentFA:'<i class="fa fa-superscript"></i>'},subscript:{name:"subscript",action:"subscript",aria:"subscript",tagNames:["sub"],contentDefault:"<b>x<sub>1</sub></b>",contentFA:'<i class="fa fa-subscript"></i>'},image:{name:"image",action:"image",aria:"image",tagNames:["img"],contentDefault:"<b>image</b>",contentFA:'<i class="fa fa-picture-o"></i>'},html:{name:"html",action:"html",aria:"evaluate html",tagNames:["iframe","object"],contentDefault:"<b>html</b>",contentFA:'<i class="fa fa-code"></i>'},orderedlist:{name:"orderedlist",action:"insertorderedlist",aria:"ordered list",tagNames:["ol"],useQueryState:!0,contentDefault:"<b>1.</b>",contentFA:'<i class="fa fa-list-ol"></i>'},unorderedlist:{name:"unorderedlist",action:"insertunorderedlist",aria:"unordered list",tagNames:["ul"],useQueryState:!0,contentDefault:"<b>•</b>",contentFA:'<i class="fa fa-list-ul"></i>'},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"<b>→</b>",contentFA:'<i class="fa fa-indent"></i>'},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"<b>←</b>",contentFA:'<i class="fa fa-outdent"></i>'},justifyCenter:{name:"justifyCenter",action:"justifyCenter",aria:"center justify",tagNames:[],style:{prop:"text-align",value:"center"},contentDefault:"<b>C</b>",contentFA:'<i class="fa fa-align-center"></i>'},justifyFull:{name:"justifyFull",action:"justifyFull",aria:"full justify",tagNames:[],style:{prop:"text-align",value:"justify"},contentDefault:"<b>J</b>",contentFA:'<i class="fa fa-align-justify"></i>'},justifyLeft:{name:"justifyLeft",action:"justifyLeft",aria:"left justify",tagNames:[],style:{prop:"text-align",value:"left"},contentDefault:"<b>L</b>",contentFA:'<i class="fa fa-align-left"></i>'},justifyRight:{name:"justifyRight",action:"justifyRight",aria:"right justify",tagNames:[],style:{prop:"text-align",value:"right"},contentDefault:"<b>R</b>",contentFA:'<i class="fa fa-align-right"></i>'},removeFormat:{name:"removeFormat",aria:"remove formatting",action:"removeFormat",contentDefault:"<b>X</b>",contentFA:'<i class="fa fa-eraser"></i>'},quote:{name:"quote",action:"append-blockquote",aria:"blockquote",tagNames:["blockquote"],contentDefault:"<b>“</b>",contentFA:'<i class="fa fa-quote-right"></i>'},pre:{name:"pre",action:"append-pre",aria:"preformatted text",tagNames:["pre"],contentDefault:"<b>0101</b>",contentFA:'<i class="fa fa-code fa-lg"></i>'},h1:{name:"h1",action:"append-h1",aria:"header type one",tagNames:["h1"],contentDefault:"<b>H1</b>",contentFA:'<i class="fa fa-header"><sup>1</sup>'},h2:{name:"h2",action:"append-h2",aria:"header type two",tagNames:["h2"],contentDefault:"<b>H2</b>",contentFA:'<i class="fa fa-header"><sup>2</sup>'},h3:{name:"h3",action:"append-h3",aria:"header type three",tagNames:["h3"],contentDefault:"<b>H3</b>",contentFA:'<i class="fa fa-header"><sup>3</sup>'},h4:{name:"h4",action:"append-h4",aria:"header type four",tagNames:["h4"],contentDefault:"<b>H4</b>",contentFA:'<i class="fa fa-header"><sup>4</sup>'},h5:{name:"h5",action:"append-h5",aria:"header type five",tagNames:["h5"],contentDefault:"<b>H5</b>",contentFA:'<i class="fa fa-header"><sup>5</sup>'},h6:{name:"h6",action:"append-h6",aria:"header type six",tagNames:["h6"],contentDefault:"<b>H6</b>",contentFA:'<i class="fa fa-header"><sup>6</sup>'}}})(),(function(){var t=e.extensions.button.extend({init:function(){e.extensions.button.prototype.init.apply(this,arguments)},formSaveLabel:"✓",formCloseLabel:"×",activeClass:"medium-editor-toolbar-form-active",hasForm:!0,getForm:function(){},isDisplayed:function(){return this.hasForm?this.getForm().classList.contains(this.activeClass):!1},showForm:function(){this.hasForm&&this.getForm().classList.add(this.activeClass)},hideForm:function(){this.hasForm&&this.getForm().classList.remove(this.activeClass)},showToolbarDefaultActions:function(){var r=this.base.getExtensionByName("toolbar");r&&r.showToolbarDefaultActions()},hideToolbarDefaultActions:function(){var r=this.base.getExtensionByName("toolbar");r&&r.hideToolbarDefaultActions()},setToolbarPosition:function(){var r=this.base.getExtensionByName("toolbar");r&&r.setToolbarPosition()}});e.extensions.form=t})(),(function(){var t=e.extensions.form.extend({customClassOption:null,customClassOptionText:"Button",linkValidation:!1,placeholderText:"Paste or type a link",targetCheckbox:!1,targetCheckboxText:"Open in new window",name:"anchor",action:"createLink",aria:"link",tagNames:["a"],contentDefault:"<b>#</b>",contentFA:'<i class="fa fa-link"></i>',init:function(){e.extensions.form.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this))},handleClick:function(r){r.preventDefault(),r.stopPropagation();var i=e.selection.getSelectionRange(this.document);return i.startContainer.nodeName.toLowerCase()==="a"||i.endContainer.nodeName.toLowerCase()==="a"||e.util.getClosestTag(e.selection.getSelectedParentElement(i),"a")?this.execAction("unlink"):(this.isDisplayed()||this.showForm(),!1)},handleKeydown:function(r){e.util.isKey(r,e.util.keyCode.K)&&e.util.isMetaCtrlKey(r)&&!r.shiftKey&&this.handleClick(r)},getForm:function(){return this.form||(this.form=this.createForm()),this.form},getTemplate:function(){var r=['<input type="text" class="medium-editor-toolbar-input" placeholder="',this.placeholderText,'">'];return r.push('<a href="#" class="medium-editor-toolbar-save">',this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':this.formSaveLabel,"</a>"),r.push('<a href="#" class="medium-editor-toolbar-close">',this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-times"></i>':this.formCloseLabel,"</a>"),this.targetCheckbox&&r.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-target" id="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">','<label for="medium-editor-toolbar-anchor-target-field-'+this.getEditorId()+'">',this.targetCheckboxText,"</label>","</div>"),this.customClassOption&&r.push('<div class="medium-editor-toolbar-form-row">','<input type="checkbox" class="medium-editor-toolbar-anchor-button">',"<label>",this.customClassOptionText,"</label>","</div>"),r.join("")},isDisplayed:function(){return e.extensions.form.prototype.isDisplayed.apply(this)},hideForm:function(){e.extensions.form.prototype.hideForm.apply(this),this.getInput().value=""},showForm:function(r){var i=this.getInput(),o=this.getAnchorTargetCheckbox(),a=this.getAnchorButtonCheckbox();if(r=r||{value:""},typeof r=="string"&&(r={value:r}),this.base.saveSelection(),this.hideToolbarDefaultActions(),e.extensions.form.prototype.showForm.apply(this),this.setToolbarPosition(),i.value=r.value,i.focus(),o&&(o.checked=r.target==="_blank"),a){var s=r.buttonClass?r.buttonClass.split(" "):[];a.checked=s.indexOf(this.customClassOption)!==-1}},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},getFormOpts:function(){var r=this.getAnchorTargetCheckbox(),i=this.getAnchorButtonCheckbox(),o={value:this.getInput().value.trim()};return this.linkValidation&&(o.value=this.checkLinkFormat(o.value)),o.target="_self",r&&r.checked&&(o.target="_blank"),i&&i.checked&&(o.buttonClass=this.customClassOption),o},doFormSave:function(){var r=this.getFormOpts();this.completeFormSave(r)},completeFormSave:function(r){this.base.restoreSelection(),this.execAction(this.action,r),this.base.checkSelection()},ensureEncodedUri:function(r){return r===decodeURI(r)?encodeURI(r):r},ensureEncodedUriComponent:function(r){return r===decodeURIComponent(r)?encodeURIComponent(r):r},ensureEncodedParam:function(r){var i=r.split("="),o=i[0],a=i[1];return o+(a===void 0?"":"="+this.ensureEncodedUriComponent(a))},ensureEncodedQuery:function(r){return r.split("&").map(this.ensureEncodedParam.bind(this)).join("&")},checkLinkFormat:function(r){var i=/^([a-z]+:)?\/\/|^(mailto|tel|maps):|^\#/i,o=i.test(r),a="",s=/^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/,l=r.match(/^(.*?)(?:\?(.*?))?(?:#(.*))?$/),u=l[1],d=l[2],f=l[3];if(s.test(r))return"tel:"+r;if(!o){var c=u.split("/")[0];(c.match(/.+(\.|:).+/)||c==="localhost")&&(a="http://")}return a+this.ensureEncodedUri(u)+(d===void 0?"":"?"+this.ensureEncodedQuery(d))+(f===void 0?"":"#"+f)},doFormCancel:function(){this.base.restoreSelection(),this.base.checkSelection()},attachFormEvents:function(r){var i=r.querySelector(".medium-editor-toolbar-close"),o=r.querySelector(".medium-editor-toolbar-save"),a=r.querySelector(".medium-editor-toolbar-input");this.on(r,"click",this.handleFormClick.bind(this)),this.on(a,"keyup",this.handleTextboxKeyup.bind(this)),this.on(i,"click",this.handleCloseClick.bind(this)),this.on(o,"click",this.handleSaveClick.bind(this),!0)},createForm:function(){var r=this.document,i=r.createElement("div");return i.className="medium-editor-toolbar-form",i.id="medium-editor-toolbar-form-anchor-"+this.getEditorId(),i.innerHTML=this.getTemplate(),this.attachFormEvents(i),i},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},getAnchorTargetCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-target")},getAnchorButtonCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-button")},handleTextboxKeyup:function(r){if(r.keyCode===e.util.keyCode.ENTER){r.preventDefault(),this.doFormSave();return}r.keyCode===e.util.keyCode.ESCAPE&&(r.preventDefault(),this.doFormCancel())},handleFormClick:function(r){r.stopPropagation()},handleSaveClick:function(r){r.preventDefault(),this.doFormSave()},handleCloseClick:function(r){r.preventDefault(),this.doFormCancel()}});e.extensions.anchor=t})(),(function(){var t=e.Extension.extend({name:"anchor-preview",hideDelay:500,previewValueSelector:"a",showWhenToolbarIsVisible:!1,showOnEmptyLinks:!0,init:function(){this.anchorPreview=this.createPreview(),this.getEditorOption("elementsContainer").appendChild(this.anchorPreview),this.attachToEditables()},getInteractionElements:function(){return this.getPreviewElement()},getPreviewElement:function(){return this.anchorPreview},createPreview:function(){var r=this.document.createElement("div");return r.id="medium-editor-anchor-preview-"+this.getEditorId(),r.className="medium-editor-anchor-preview",r.innerHTML=this.getTemplate(),this.on(r,"click",this.handleClick.bind(this)),r},getTemplate:function(){return'<div class="medium-editor-toolbar-anchor-preview" id="medium-editor-toolbar-anchor-preview"> <a class="medium-editor-toolbar-anchor-preview-inner"></a></div>'},destroy:function(){this.anchorPreview&&(this.anchorPreview.parentNode&&this.anchorPreview.parentNode.removeChild(this.anchorPreview),delete this.anchorPreview)},hidePreview:function(){this.anchorPreview&&this.anchorPreview.classList.remove("medium-editor-anchor-preview-active"),this.activeAnchor=null},showPreview:function(r){return this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||r.getAttribute("data-disable-preview")?!0:(this.previewValueSelector&&(this.anchorPreview.querySelector(this.previewValueSelector).textContent=r.attributes.href.value,this.anchorPreview.querySelector(this.previewValueSelector).href=r.attributes.href.value),this.anchorPreview.classList.add("medium-toolbar-arrow-over"),this.anchorPreview.classList.remove("medium-toolbar-arrow-under"),this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||this.anchorPreview.classList.add("medium-editor-anchor-preview-active"),this.activeAnchor=r,this.positionPreview(),this.attachPreviewHandlers(),this)},positionPreview:function(r){r=r||this.activeAnchor;var i=this.window.innerWidth,o=this.anchorPreview.offsetHeight,a=r.getBoundingClientRect(),s=this.diffLeft,l=this.diffTop,u=this.getEditorOption("elementsContainer"),d=["absolute","fixed"].indexOf(window.getComputedStyle(u).getPropertyValue("position"))>-1,f={},c,h,p,v,g;c=this.anchorPreview.offsetWidth/2;var y=this.base.getExtensionByName("toolbar");y&&(s=y.diffLeft,l=y.diffTop),h=s-c,d?(v=u.getBoundingClientRect(),["top","left"].forEach(function(m){f[m]=a[m]-v[m]}),f.width=a.width,f.height=a.height,a=f,i=v.width,g=u.scrollTop):g=this.window.pageYOffset,p=a.left+a.width/2,g+=o+a.top+a.height-l-this.anchorPreview.offsetHeight,this.anchorPreview.style.top=Math.round(g)+"px",this.anchorPreview.style.right="initial",p<c?(this.anchorPreview.style.left=h+c+"px",this.anchorPreview.style.right="initial"):i-p<c?(this.anchorPreview.style.left="auto",this.anchorPreview.style.right=0):(this.anchorPreview.style.left=h+p+"px",this.anchorPreview.style.right="initial")},attachToEditables:function(){this.subscribe("editableMouseover",this.handleEditableMouseover.bind(this)),this.subscribe("positionedToolbar",this.handlePositionedToolbar.bind(this))},handlePositionedToolbar:function(){this.showWhenToolbarIsVisible||this.hidePreview()},handleClick:function(r){var i=this.base.getExtensionByName("anchor"),o=this.activeAnchor;i&&o&&(r.preventDefault(),this.base.selectElement(this.activeAnchor),this.base.delay((function(){if(o){var a={value:o.attributes.href.value,target:o.getAttribute("target"),buttonClass:o.getAttribute("class")};i.showForm(a),o=null}}).bind(this))),this.hidePreview()},handleAnchorMouseout:function(){this.anchorToPreview=null,this.off(this.activeAnchor,"mouseout",this.instanceHandleAnchorMouseout),this.instanceHandleAnchorMouseout=null},handleEditableMouseover:function(r){var i=e.util.getClosestTag(r.target,"a");if(i!==!1){if(!this.showOnEmptyLinks&&(!/href=["']\S+["']/.test(i.outerHTML)||/href=["']#\S+["']/.test(i.outerHTML)))return!0;var o=this.base.getExtensionByName("toolbar");if(!this.showWhenToolbarIsVisible&&o&&o.isDisplayed&&o.isDisplayed())return!0;this.activeAnchor&&this.activeAnchor!==i&&this.detachPreviewHandlers(),this.anchorToPreview=i,this.instanceHandleAnchorMouseout=this.handleAnchorMouseout.bind(this),this.on(this.anchorToPreview,"mouseout",this.instanceHandleAnchorMouseout),this.base.delay((function(){this.anchorToPreview&&this.showPreview(this.anchorToPreview)}).bind(this))}},handlePreviewMouseover:function(){this.lastOver=new Date().getTime(),this.hovering=!0},handlePreviewMouseout:function(r){(!r.relatedTarget||!/anchor-preview/.test(r.relatedTarget.className))&&(this.hovering=!1)},updatePreview:function(){if(this.hovering)return!0;var r=new Date().getTime()-this.lastOver;r>this.hideDelay&&this.detachPreviewHandlers()},detachPreviewHandlers:function(){clearInterval(this.intervalTimer),this.instanceHandlePreviewMouseover&&(this.off(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.activeAnchor&&(this.off(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout))),this.hidePreview(),this.hovering=this.instanceHandlePreviewMouseover=this.instanceHandlePreviewMouseout=null},attachPreviewHandlers:function(){this.lastOver=new Date().getTime(),this.hovering=!0,this.instanceHandlePreviewMouseover=this.handlePreviewMouseover.bind(this),this.instanceHandlePreviewMouseout=this.handlePreviewMouseout.bind(this),this.intervalTimer=setInterval(this.updatePreview.bind(this),200),this.on(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.on(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout)}});e.extensions.anchorPreview=t})(),(function(){var t,r,i,o,a;t=[" "," ",`
|
|
107
|
+
`,"\r"," "," "," "," "," ","\u2028","\u2029"],r="com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw",i="(((?:(https?://|ftps?://|nntp://)|www\\d{0,3}[.]|[a-z0-9.\\-]+[.]("+r+")\\/)\\S+(?:[^\\s`!\\[\\]{};:'\".,?«»“”‘’])))|(([a-z0-9\\-]+\\.)?[a-z0-9\\-]+\\.("+r+"))",o=new RegExp("^("+r+")$","i"),a=new RegExp(i,"gi");function s(u){return!e.util.getClosestTag(u,"a")}var l=e.Extension.extend({init:function(){e.Extension.prototype.init.apply(this,arguments),this.disableEventHandling=!1,this.subscribe("editableKeypress",this.onKeypress.bind(this)),this.subscribe("editableBlur",this.onBlur.bind(this)),this.document.execCommand("AutoUrlDetect",!1,!1)},isLastInstance:function(){for(var u=0,d=0;d<this.window._mediumEditors.length;d++){var f=this.window._mediumEditors[d];f!==null&&f.getExtensionByName("autoLink")!==void 0&&u++}return u===1},destroy:function(){this.document.queryCommandSupported("AutoUrlDetect")&&this.isLastInstance()&&this.document.execCommand("AutoUrlDetect",!1,!0)},onBlur:function(u,d){this.performLinking(d)},onKeypress:function(u){this.disableEventHandling||e.util.isKey(u,[e.util.keyCode.SPACE,e.util.keyCode.ENTER])&&(clearTimeout(this.performLinkingTimeout),this.performLinkingTimeout=setTimeout((function(){try{var d=this.base.exportSelection();this.performLinking(u.target)&&this.base.importSelection(d,!0)}catch(f){window.console&&window.console.error("Failed to perform linking",f),this.disableEventHandling=!0}}).bind(this),0))},performLinking:function(u){var d=e.util.splitByBlockElements(u),f=!1;d.length===0&&(d=[u]);for(var c=0;c<d.length;c++)f=this.removeObsoleteAutoLinkSpans(d[c])||f,f=this.performLinkingWithinElement(d[c])||f;return this.base.events.updateInput(u,{target:u,currentTarget:u}),f},removeObsoleteAutoLinkSpans:function(u){if(!u||u.nodeType===3)return!1;for(var d=u.querySelectorAll('span[data-auto-link="true"]'),f=!1,c=0;c<d.length;c++){var h=d[c].textContent;if(h.indexOf("://")===-1&&(h=e.util.ensureUrlHasProtocol(h)),d[c].getAttribute("data-href")!==h&&s(d[c])){f=!0;var p=h.replace(/\s+$/,"");if(d[c].getAttribute("data-href")===p){var v=h.length-p.length,g=e.util.splitOffDOMTree(d[c],this.splitTextBeforeEnd(d[c],v));d[c].parentNode.insertBefore(g,d[c].nextSibling)}else e.util.unwrap(d[c],this.document)}}return f},splitTextBeforeEnd:function(u,d){for(var f=this.document.createTreeWalker(u,NodeFilter.SHOW_TEXT,null,!1),c=!0;c;)c=f.lastChild()!==null;for(var h,p,v;d>0&&v!==null;)h=f.currentNode,p=h.nodeValue,p.length>d?(v=h.splitText(p.length-d),d=0):(v=f.previousNode(),d-=p.length);return v},performLinkingWithinElement:function(u){for(var d=this.findLinkableText(u),f=!1,c=0;c<d.length;c++){var h=e.util.findOrCreateMatchingTextNodes(this.document,u,d[c]);this.shouldNotLink(h)||this.createAutoLink(h,d[c].href)}return f},shouldNotLink:function(u){for(var d=!1,f=0;f<u.length&&d===!1;f++)d=!!e.util.traverseUp(u[f],function(c){return c.nodeName.toLowerCase()==="a"||c.getAttribute&&c.getAttribute("data-auto-link")==="true"});return d},findLinkableText:function(u){for(var d=u.textContent,f=null,c=[];(f=a.exec(d))!==null;){var h=!0,p=f.index+f[0].length;h=(f.index===0||t.indexOf(d[f.index-1])!==-1)&&(p===d.length||t.indexOf(d[p])!==-1),h=h&&(f[0].indexOf("/")!==-1||o.test(f[0].split(".").pop().split("?").shift())),h&&c.push({href:f[0],start:f.index,end:p})}return c},createAutoLink:function(u,d){d=e.util.ensureUrlHasProtocol(d);var f=e.util.createLink(this.document,u,d,this.getEditorOption("targetBlank")?"_blank":null),c=this.document.createElement("span");for(c.setAttribute("data-auto-link","true"),c.setAttribute("data-href",d),f.insertBefore(c,f.firstChild);f.childNodes.length>1;)c.appendChild(f.childNodes[1])}});e.extensions.autoLink=l})(),(function(){var t="medium-editor-dragover";function r(o){var a=e.util.getContainerEditorElement(o),s=Array.prototype.slice.call(a.parentElement.querySelectorAll("."+t));s.forEach(function(l){l.classList.remove(t)})}var i=e.Extension.extend({name:"fileDragging",allowedTypes:["image"],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(o){o.preventDefault(),o.dataTransfer.dropEffect="copy";var a=o.target.classList?o.target:o.target.parentElement;r(a),o.type==="dragover"&&a.classList.add(t)},handleDrop:function(o){o.preventDefault(),o.stopPropagation(),this.base.selectElement(o.target);var a=this.base.exportSelection();a.start=a.end,this.base.importSelection(a),o.dataTransfer.files&&Array.prototype.slice.call(o.dataTransfer.files).forEach(function(s){this.isAllowedFile(s)&&s.type.match("image")&&this.insertImageFile(s)},this),r(o.target)},isAllowedFile:function(o){return this.allowedTypes.some(function(a){return!!o.type.match(a)})},insertImageFile:function(o){if(typeof FileReader=="function"){var a=new FileReader;a.readAsDataURL(o),a.addEventListener("load",(function(s){var l=this.document.createElement("img");l.src=s.target.result,e.util.insertHTMLCommand(this.document,l.outerHTML)}).bind(this))}}});e.extensions.fileDragging=i})(),(function(){var t=e.Extension.extend({name:"keyboard-commands",commands:[{command:"bold",key:"B",meta:!0,shift:!1,alt:!1},{command:"italic",key:"I",meta:!0,shift:!1,alt:!1},{command:"underline",key:"U",meta:!0,shift:!1,alt:!1}],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.keys={},this.commands.forEach(function(r){var i=r.key.charCodeAt(0);this.keys[i]||(this.keys[i]=[]),this.keys[i].push(r)},this)},handleKeydown:function(r){var i=e.util.getKeyCode(r);if(this.keys[i]){var o=e.util.isMetaCtrlKey(r),a=!!r.shiftKey,s=!!r.altKey;this.keys[i].forEach(function(l){l.meta===o&&l.shift===a&&(l.alt===s||l.alt===void 0)&&(r.preventDefault(),r.stopPropagation(),typeof l.command=="function"?l.command.apply(this):l.command!==!1&&this.execAction(l.command))},this)}}});e.extensions.keyboardCommands=t})(),(function(){var t=e.extensions.form.extend({name:"fontname",action:"fontName",aria:"change font name",contentDefault:"±",contentFA:'<i class="fa fa-font"></i>',fonts:["","Arial","Verdana","Times New Roman"],init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(r){if(r.preventDefault(),r.stopPropagation(),!this.isDisplayed()){var i=this.document.queryCommandValue("fontName")+"";this.showForm(i)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return this.getForm().style.display==="block"},hideForm:function(){this.getForm().style.display="none",this.getSelect().value=""},showForm:function(r){var i=this.getSelect();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),i.value=r||"",i.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontName(),this.base.checkSelection()},createForm:function(){var r=this.document,i=r.createElement("div"),o=r.createElement("select"),a=r.createElement("a"),s=r.createElement("a"),l;i.className="medium-editor-toolbar-form",i.id="medium-editor-toolbar-form-fontname-"+this.getEditorId(),this.on(i,"click",this.handleFormClick.bind(this));for(var u=0;u<this.fonts.length;u++)l=r.createElement("option"),l.innerHTML=this.fonts[u],l.value=this.fonts[u],o.appendChild(l);return o.className="medium-editor-toolbar-select",i.appendChild(o),this.on(o,"change",this.handleFontChange.bind(this)),s.setAttribute("href","#"),s.className="medium-editor-toobar-save",s.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':"✓",i.appendChild(s),this.on(s,"click",this.handleSaveClick.bind(this),!0),a.setAttribute("href","#"),a.className="medium-editor-toobar-close",a.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-times"></i>':"×",i.appendChild(a),this.on(a,"click",this.handleCloseClick.bind(this)),i},getSelect:function(){return this.getForm().querySelector("select.medium-editor-toolbar-select")},clearFontName:function(){e.selection.getSelectedElements(this.document).forEach(function(r){r.nodeName.toLowerCase()==="font"&&r.hasAttribute("face")&&r.removeAttribute("face")})},handleFontChange:function(){var r=this.getSelect().value;r===""?this.clearFontName():this.execAction("fontName",{value:r})},handleFormClick:function(r){r.stopPropagation()},handleSaveClick:function(r){r.preventDefault(),this.doFormSave()},handleCloseClick:function(r){r.preventDefault(),this.doFormCancel()}});e.extensions.fontName=t})(),(function(){var t=e.extensions.form.extend({name:"fontsize",action:"fontSize",aria:"increase/decrease font size",contentDefault:"±",contentFA:'<i class="fa fa-text-height"></i>',init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(r){if(r.preventDefault(),r.stopPropagation(),!this.isDisplayed()){var i=this.document.queryCommandValue("fontSize")+"";this.showForm(i)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return this.getForm().style.display==="block"},hideForm:function(){this.getForm().style.display="none",this.getInput().value=""},showForm:function(r){var i=this.getInput();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),i.value=r||"",i.focus()},destroy:function(){if(!this.form)return!1;this.form.parentNode&&this.form.parentNode.removeChild(this.form),delete this.form},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontSize(),this.base.checkSelection()},createForm:function(){var r=this.document,i=r.createElement("div"),o=r.createElement("input"),a=r.createElement("a"),s=r.createElement("a");return i.className="medium-editor-toolbar-form",i.id="medium-editor-toolbar-form-fontsize-"+this.getEditorId(),this.on(i,"click",this.handleFormClick.bind(this)),o.setAttribute("type","range"),o.setAttribute("min","1"),o.setAttribute("max","7"),o.className="medium-editor-toolbar-input",i.appendChild(o),this.on(o,"change",this.handleSliderChange.bind(this)),s.setAttribute("href","#"),s.className="medium-editor-toobar-save",s.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-check"></i>':"✓",i.appendChild(s),this.on(s,"click",this.handleSaveClick.bind(this),!0),a.setAttribute("href","#"),a.className="medium-editor-toobar-close",a.innerHTML=this.getEditorOption("buttonLabels")==="fontawesome"?'<i class="fa fa-times"></i>':"×",i.appendChild(a),this.on(a,"click",this.handleCloseClick.bind(this)),i},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},clearFontSize:function(){e.selection.getSelectedElements(this.document).forEach(function(r){r.nodeName.toLowerCase()==="font"&&r.hasAttribute("size")&&r.removeAttribute("size")})},handleSliderChange:function(){var r=this.getInput().value;r==="4"?this.clearFontSize():this.execAction("fontSize",{value:r})},handleFormClick:function(r){r.stopPropagation()},handleSaveClick:function(r){r.preventDefault(),this.doFormSave()},handleCloseClick:function(r){r.preventDefault(),this.doFormCancel()}});e.extensions.fontSize=t})(),(function(){var t="%ME_PASTEBIN%",r=null,i=null,o=function(u){u.stopPropagation()};function a(){return[[new RegExp(/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g),""],[new RegExp(/<!--StartFragment-->|<!--EndFragment-->/g),""],[new RegExp(/<br>$/i),""],[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi),""],[new RegExp(/<\/b>(<br[^>]*>)?$/gi),""],[new RegExp(/<span class="Apple-converted-space">\s+<\/span>/g)," "],[new RegExp(/<br class="Apple-interchange-newline">/g),"<br>"],[new RegExp(/<span[^>]*(font-style:italic;font-weight:(bold|700)|font-weight:(bold|700);font-style:italic)[^>]*>/gi),'<span class="replace-with italic bold">'],[new RegExp(/<span[^>]*font-style:italic[^>]*>/gi),'<span class="replace-with italic">'],[new RegExp(/<span[^>]*font-weight:(bold|700)[^>]*>/gi),'<span class="replace-with bold">'],[new RegExp(/<(\/?)(i|b|a)>/gi),"<$1$2>"],[new RegExp(/<a(?:(?!href).)+href=(?:"|”|“|"|“|”)(((?!"|”|“|"|“|”).)*)(?:"|”|“|"|“|”)(?:(?!>).)*>/gi),'<a href="$1">'],[new RegExp(/<\/p>\n+/gi),"</p>"],[new RegExp(/\n+<p/gi),"<p"],[new RegExp(/<\/?o:[a-z]*>/gi),""],[new RegExp(/<!\[if !supportLists\]>(((?!<!).)*)<!\[endif]\>/gi),"$1"]]}function s(u,d,f){var c=u.clipboardData||d.clipboardData||f.dataTransfer,h={};if(!c)return h;if(c.getData){var p=c.getData("Text");p&&p.length>0&&(h["text/plain"]=p)}if(c.types)for(var v=0;v<c.types.length;v++){var g=c.types[v];h[g]=c.getData(g)}return h}var l=e.Extension.extend({forcePlainText:!0,cleanPastedHTML:!1,preCleanReplacements:[],cleanReplacements:[],cleanAttrs:["class","style","dir"],cleanTags:["meta"],unwrapTags:[],init:function(){e.Extension.prototype.init.apply(this,arguments),(this.forcePlainText||this.cleanPastedHTML)&&(this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.getEditorElements().forEach(function(u){this.on(u,"paste",this.handlePaste.bind(this))},this),this.subscribe("addElement",this.handleAddElement.bind(this)))},handleAddElement:function(u,d){this.on(d,"paste",this.handlePaste.bind(this))},destroy:function(){(this.forcePlainText||this.cleanPastedHTML)&&this.removePasteBin()},handlePaste:function(u,d){if(!u.defaultPrevented){var f=s(u,this.window,this.document),c=f["text/html"],h=f["text/plain"];this.window.clipboardData&&u.clipboardData===void 0&&!c&&(c=h),(c||h)&&(u.preventDefault(),this.doPaste(c,h,d))}},doPaste:function(u,d,f){var c,h="",p;if(this.cleanPastedHTML&&u)return this.cleanPaste(u);if(d){if(this.getEditorOption("disableReturn")||f&&f.getAttribute("data-disable-return"))h=e.util.htmlEntities(d);else if(c=d.split(/[\r\n]+/g),c.length>1)for(p=0;p<c.length;p+=1)c[p]!==""&&(h+="<p>"+e.util.htmlEntities(c[p])+"</p>");else h=e.util.htmlEntities(c[0]);e.util.insertHTMLCommand(this.document,h)}},handlePasteBinPaste:function(u){if(u.defaultPrevented){this.removePasteBin();return}var d=s(u,this.window,this.document),f=d["text/html"],c=d["text/plain"],h=i;if(!this.cleanPastedHTML||f){u.preventDefault(),this.removePasteBin(),this.doPaste(f,c,h),this.trigger("editablePaste",{currentTarget:h,target:h},h);return}setTimeout((function(){this.cleanPastedHTML&&(f=this.getPasteBinHtml()),this.removePasteBin(),this.doPaste(f,c,h),this.trigger("editablePaste",{currentTarget:h,target:h},h)}).bind(this),0)},handleKeydown:function(u,d){e.util.isKey(u,e.util.keyCode.V)&&e.util.isMetaCtrlKey(u)&&(u.stopImmediatePropagation(),this.removePasteBin(),this.createPasteBin(d))},createPasteBin:function(u){var d,f=e.selection.getSelectionRange(this.document),c=this.window.pageYOffset;i=u,f&&(d=f.getClientRects(),d.length?c+=d[0].top:f.startContainer.getBoundingClientRect!==void 0?c+=f.startContainer.getBoundingClientRect().top:c+=f.getBoundingClientRect().top),r=f;var h=this.document.createElement("div");h.id=this.pasteBinId="medium-editor-pastebin-"+ +Date.now(),h.setAttribute("style","border: 1px red solid; position: absolute; top: "+c+"px; width: 10px; height: 10px; overflow: hidden; opacity: 0"),h.setAttribute("contentEditable",!0),h.innerHTML=t,this.document.body.appendChild(h),this.on(h,"focus",o),this.on(h,"focusin",o),this.on(h,"focusout",o),h.focus(),e.selection.selectNode(h,this.document),this.boundHandlePaste||(this.boundHandlePaste=this.handlePasteBinPaste.bind(this)),this.on(h,"paste",this.boundHandlePaste)},removePasteBin:function(){r!==null&&(e.selection.selectRange(this.document,r),r=null),i!==null&&(i=null);var u=this.getPasteBin();u&&u&&(this.off(u,"focus",o),this.off(u,"focusin",o),this.off(u,"focusout",o),this.off(u,"paste",this.boundHandlePaste),u.parentElement.removeChild(u))},getPasteBin:function(){return this.document.getElementById(this.pasteBinId)},getPasteBinHtml:function(){var u=this.getPasteBin();if(!u||u.firstChild&&u.firstChild.id==="mcepastebin")return!1;var d=u.innerHTML;return!d||d===t?!1:d},cleanPaste:function(u){var d,f,c,h,p=/<p|<br|<div/.test(u),v=[].concat(this.preCleanReplacements||[],a(),this.cleanReplacements||[]);for(d=0;d<v.length;d+=1)u=u.replace(v[d][0],v[d][1]);if(!p)return this.pasteHTML(u);for(c=this.document.createElement("div"),c.innerHTML="<p>"+u.split("<br><br>").join("</p><p>")+"</p>",f=c.querySelectorAll("a,p,div,br"),d=0;d<f.length;d+=1)switch(h=f[d],h.innerHTML=h.innerHTML.replace(/\n/gi," "),h.nodeName.toLowerCase()){case"p":case"div":this.filterCommonBlocks(h);break;case"br":this.filterLineBreak(h);break}this.pasteHTML(c.innerHTML)},pasteHTML:function(u,d){d=e.util.defaults({},d,{cleanAttrs:this.cleanAttrs,cleanTags:this.cleanTags,unwrapTags:this.unwrapTags});var f,c,h,p,v=this.document.createDocumentFragment();for(v.appendChild(this.document.createElement("body")),p=v.querySelector("body"),p.innerHTML=u,this.cleanupSpans(p),f=p.querySelectorAll("*"),h=0;h<f.length;h+=1)c=f[h],c.nodeName.toLowerCase()==="a"&&this.getEditorOption("targetBlank")&&e.util.setTargetBlank(c),e.util.cleanupAttrs(c,d.cleanAttrs),e.util.cleanupTags(c,d.cleanTags),e.util.unwrapTags(c,d.unwrapTags);e.util.insertHTMLCommand(this.document,p.innerHTML.replace(/ /g," "))},isCommonBlock:function(u){return u&&(u.nodeName.toLowerCase()==="p"||u.nodeName.toLowerCase()==="div")},filterCommonBlocks:function(u){/^\s*$/.test(u.textContent)&&u.parentNode&&u.parentNode.removeChild(u)},filterLineBreak:function(u){this.isCommonBlock(u.previousElementSibling)?this.removeWithParent(u):this.isCommonBlock(u.parentNode)&&(u.parentNode.firstChild===u||u.parentNode.lastChild===u)?this.removeWithParent(u):u.parentNode&&u.parentNode.childElementCount===1&&u.parentNode.textContent===""&&this.removeWithParent(u)},removeWithParent:function(u){u&&u.parentNode&&(u.parentNode.parentNode&&u.parentNode.childElementCount===1?u.parentNode.parentNode.removeChild(u.parentNode):u.parentNode.removeChild(u))},cleanupSpans:function(u){var d,f,c,h=u.querySelectorAll(".replace-with"),p=function(v){return v&&v.nodeName!=="#text"&&v.getAttribute("contenteditable")==="false"};for(d=0;d<h.length;d+=1)f=h[d],c=this.document.createElement(f.classList.contains("bold")?"b":"i"),f.classList.contains("bold")&&f.classList.contains("italic")?c.innerHTML="<i>"+f.innerHTML+"</i>":c.innerHTML=f.innerHTML,f.parentNode.replaceChild(c,f);for(h=u.querySelectorAll("span"),d=0;d<h.length;d+=1){if(f=h[d],e.util.traverseUp(f,p))return!1;e.util.unwrap(f,this.document)}}});e.extensions.paste=l})(),(function(){var t=e.Extension.extend({name:"placeholder",text:"Type your text",hideOnClick:!0,init:function(){e.Extension.prototype.init.apply(this,arguments),this.initPlaceholders(),this.attachEventHandlers()},initPlaceholders:function(){this.getEditorElements().forEach(this.initElement,this)},handleAddElement:function(r,i){this.initElement(i)},initElement:function(r){r.getAttribute("data-placeholder")||r.setAttribute("data-placeholder",this.text),this.updatePlaceholder(r)},destroy:function(){this.getEditorElements().forEach(this.cleanupElement,this)},handleRemoveElement:function(r,i){this.cleanupElement(i)},cleanupElement:function(r){r.getAttribute("data-placeholder")===this.text&&r.removeAttribute("data-placeholder")},showPlaceholder:function(r){r&&(e.util.isFF&&r.childNodes.length===0?(r.classList.add("medium-editor-placeholder-relative"),r.classList.remove("medium-editor-placeholder")):(r.classList.add("medium-editor-placeholder"),r.classList.remove("medium-editor-placeholder-relative")))},hidePlaceholder:function(r){r&&(r.classList.remove("medium-editor-placeholder"),r.classList.remove("medium-editor-placeholder-relative"))},updatePlaceholder:function(r,i){if(r.querySelector("img, blockquote, ul, ol, table")||r.textContent.replace(/^\s+|\s+$/g,"")!=="")return this.hidePlaceholder(r);i||this.showPlaceholder(r)},attachEventHandlers:function(){this.hideOnClick&&this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableInput",this.handleInput.bind(this)),this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("addElement",this.handleAddElement.bind(this)),this.subscribe("removeElement",this.handleRemoveElement.bind(this))},handleInput:function(r,i){var o=this.hideOnClick&&i===this.base.getFocusedElement();this.updatePlaceholder(i,o)},handleFocus:function(r,i){this.hidePlaceholder(i)},handleBlur:function(r,i){this.updatePlaceholder(i)}});e.extensions.placeholder=t})(),(function(){var t=e.Extension.extend({name:"toolbar",align:"center",allowMultiParagraphSelection:!0,buttons:["bold","italic","underline","anchor","h2","h3","quote"],diffLeft:0,diffTop:-10,firstButtonClass:"medium-editor-button-first",lastButtonClass:"medium-editor-button-last",standardizeSelectionStart:!1,static:!1,sticky:!1,stickyTopOffset:0,updateOnEmptySelection:!1,relativeContainer:null,init:function(){e.Extension.prototype.init.apply(this,arguments),this.initThrottledMethods(),this.relativeContainer?this.relativeContainer.appendChild(this.getToolbarElement()):this.getEditorOption("elementsContainer").appendChild(this.getToolbarElement())},forEachExtension:function(r,i){return this.base.extensions.forEach(function(o){if(o!==this)return r.apply(i||this,arguments)},this)},createToolbar:function(){var r=this.document.createElement("div");return r.id="medium-editor-toolbar-"+this.getEditorId(),r.className="medium-editor-toolbar",this.static?r.className+=" static-toolbar":this.relativeContainer?r.className+=" medium-editor-relative-toolbar":r.className+=" medium-editor-stalker-toolbar",r.appendChild(this.createToolbarButtons()),this.forEachExtension(function(i){i.hasForm&&r.appendChild(i.getForm())}),this.attachEventHandlers(),r},createToolbarButtons:function(){var r=this.document.createElement("ul"),i,o,a,s,l,u;return r.id="medium-editor-toolbar-actions"+this.getEditorId(),r.className="medium-editor-toolbar-actions",r.style.display="block",this.buttons.forEach(function(d){typeof d=="string"?(l=d,u=null):(l=d.name,u=d),s=this.base.addBuiltInExtension(l,u),s&&typeof s.getButton=="function"&&(o=s.getButton(this.base),i=this.document.createElement("li"),e.util.isElement(o)?i.appendChild(o):i.innerHTML=o,r.appendChild(i))},this),a=r.querySelectorAll("button"),a.length>0&&(a[0].classList.add(this.firstButtonClass),a[a.length-1].classList.add(this.lastButtonClass)),r},destroy:function(){this.toolbar&&(this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),delete this.toolbar)},getInteractionElements:function(){return this.getToolbarElement()},getToolbarElement:function(){return this.toolbar||(this.toolbar=this.createToolbar()),this.toolbar},getToolbarActionsElement:function(){return this.getToolbarElement().querySelector(".medium-editor-toolbar-actions")},initThrottledMethods:function(){this.throttledPositionToolbar=e.util.throttle((function(){this.base.isActive&&this.positionToolbarIfShown()}).bind(this))},attachEventHandlers:function(){this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableClick",this.handleEditableClick.bind(this)),this.subscribe("editableKeyup",this.handleEditableKeyup.bind(this)),this.on(this.document.documentElement,"mouseup",this.handleDocumentMouseup.bind(this)),this.static&&this.sticky&&this.on(this.window,"scroll",this.handleWindowScroll.bind(this),!0),this.on(this.window,"resize",this.handleWindowResize.bind(this))},handleWindowScroll:function(){this.positionToolbarIfShown()},handleWindowResize:function(){this.throttledPositionToolbar()},handleDocumentMouseup:function(r){if(r&&r.target&&e.util.isDescendant(this.getToolbarElement(),r.target))return!1;this.checkState()},handleEditableClick:function(){setTimeout((function(){this.checkState()}).bind(this),0)},handleEditableKeyup:function(){this.checkState()},handleBlur:function(){clearTimeout(this.hideTimeout),clearTimeout(this.delayShowTimeout),this.hideTimeout=setTimeout((function(){this.hideToolbar()}).bind(this),1)},handleFocus:function(){this.checkState()},isDisplayed:function(){return this.getToolbarElement().classList.contains("medium-editor-toolbar-active")},showToolbar:function(){clearTimeout(this.hideTimeout),this.isDisplayed()||(this.getToolbarElement().classList.add("medium-editor-toolbar-active"),this.trigger("showToolbar",{},this.base.getFocusedElement()))},hideToolbar:function(){this.isDisplayed()&&(this.getToolbarElement().classList.remove("medium-editor-toolbar-active"),this.trigger("hideToolbar",{},this.base.getFocusedElement()))},isToolbarDefaultActionsDisplayed:function(){return this.getToolbarActionsElement().style.display==="block"},hideToolbarDefaultActions:function(){this.isToolbarDefaultActionsDisplayed()&&(this.getToolbarActionsElement().style.display="none")},showToolbarDefaultActions:function(){this.hideExtensionForms(),this.isToolbarDefaultActionsDisplayed()||(this.getToolbarActionsElement().style.display="block"),this.delayShowTimeout=this.base.delay((function(){this.showToolbar()}).bind(this))},hideExtensionForms:function(){this.forEachExtension(function(r){r.hasForm&&r.isDisplayed()&&r.hideForm()})},multipleBlockElementsSelected:function(){var r=/<[^\/>][^>]*><\/[^>]+>/gim,i=new RegExp("<("+e.util.blockContainerElementNames.join("|")+")[^>]*>","g"),o=e.selection.getSelectionHtml(this.document).replace(r,""),a=o.match(i);return!!a&&a.length>1},modifySelection:function(){var r=this.window.getSelection(),i=r.getRangeAt(0);if(this.standardizeSelectionStart&&i.startContainer.nodeValue&&i.startOffset===i.startContainer.nodeValue.length){var o=e.util.findAdjacentTextNodeWithContent(e.selection.getSelectionElement(this.window),i.startContainer,this.document);if(o){for(var a=0;o.nodeValue.substr(a,1).trim().length===0;)a=a+1;i=e.selection.select(this.document,o,a,i.endContainer,i.endOffset)}}},checkState:function(){if(!this.base.preventSelectionUpdates){if(!this.base.getFocusedElement()||e.selection.selectionInContentEditableFalse(this.window))return this.hideToolbar();var r=e.selection.getSelectionElement(this.window);if(!r||this.getEditorElements().indexOf(r)===-1||r.getAttribute("data-disable-toolbar"))return this.hideToolbar();if(this.updateOnEmptySelection&&this.static)return this.showAndUpdateToolbar();if(!e.selection.selectionContainsContent(this.document)||this.allowMultiParagraphSelection===!1&&this.multipleBlockElementsSelected())return this.hideToolbar();this.showAndUpdateToolbar()}},showAndUpdateToolbar:function(){this.modifySelection(),this.setToolbarButtonStates(),this.trigger("positionToolbar",{},this.base.getFocusedElement()),this.showToolbarDefaultActions(),this.setToolbarPosition()},setToolbarButtonStates:function(){this.forEachExtension(function(r){typeof r.isActive=="function"&&typeof r.setInactive=="function"&&r.setInactive()}),this.checkActiveButtons()},checkActiveButtons:function(){var r=[],i=null,o=e.selection.getSelectionRange(this.document),a,s=function(l){typeof l.checkState=="function"?l.checkState(a):typeof l.isActive=="function"&&typeof l.isAlreadyApplied=="function"&&typeof l.setActive=="function"&&!l.isActive()&&l.isAlreadyApplied(a)&&l.setActive()};if(o&&(this.forEachExtension(function(l){if(typeof l.queryCommandState=="function"&&(i=l.queryCommandState(),i!==null)){i&&typeof l.setActive=="function"&&l.setActive();return}r.push(l)}),a=e.selection.getSelectedParentElement(o),!!this.getEditorElements().some(function(l){return e.util.isDescendant(l,a,!0)})))for(;a&&(r.forEach(s),!e.util.isMediumEditorElement(a));)a=a.parentNode},positionToolbarIfShown:function(){this.isDisplayed()&&this.setToolbarPosition()},setToolbarPosition:function(){var r=this.base.getFocusedElement(),i=this.window.getSelection();if(!r)return this;(this.static||!i.isCollapsed)&&(this.showToolbar(),this.relativeContainer||(this.static?this.positionStaticToolbar(r):this.positionToolbar(i)),this.trigger("positionedToolbar",{},this.base.getFocusedElement()))},positionStaticToolbar:function(r){this.getToolbarElement().style.left="0";var i=this.document.documentElement&&this.document.documentElement.scrollTop||this.document.body.scrollTop,o=this.window.innerWidth,a=this.getToolbarElement(),s=r.getBoundingClientRect(),l=s.top+i,u=s.left+s.width/2,d=a.offsetHeight,f=a.offsetWidth,c=f/2,h;switch(this.sticky?i>l+r.offsetHeight-d-this.stickyTopOffset?(a.style.top=l+r.offsetHeight-d+"px",a.classList.remove("medium-editor-sticky-toolbar")):i>l-d-this.stickyTopOffset?(a.classList.add("medium-editor-sticky-toolbar"),a.style.top=this.stickyTopOffset+"px"):(a.classList.remove("medium-editor-sticky-toolbar"),a.style.top=l-d+"px"):a.style.top=l-d+"px",this.align){case"left":h=s.left;break;case"right":h=s.right-f;break;case"center":h=u-c;break}h<0?h=0:h+f>o&&(h=o-Math.ceil(f)-1),a.style.left=h+"px"},positionToolbar:function(r){this.getToolbarElement().style.left="0",this.getToolbarElement().style.right="initial";var i=r.getRangeAt(0),o=i.getBoundingClientRect();(!o||o.height===0&&o.width===0&&i.startContainer===i.endContainer)&&(i.startContainer.nodeType===1&&i.startContainer.querySelector("img")?o=i.startContainer.querySelector("img").getBoundingClientRect():o=i.startContainer.getBoundingClientRect());var a=this.window.innerWidth,s=this.getToolbarElement(),l=s.offsetHeight,u=s.offsetWidth,d=u/2,f=50,c=this.diffLeft-d,h=this.getEditorOption("elementsContainer"),p=["absolute","fixed"].indexOf(window.getComputedStyle(h).getPropertyValue("position"))>-1,v={},g={},y,m;p?(m=h.getBoundingClientRect(),["top","left"].forEach(function(O){g[O]=o[O]-m[O]}),g.width=o.width,g.height=o.height,o=g,a=m.width,v.top=h.scrollTop):v.top=this.window.pageYOffset,y=o.left+o.width/2,v.top+=o.top-l,o.top<f?(s.classList.add("medium-toolbar-arrow-over"),s.classList.remove("medium-toolbar-arrow-under"),v.top+=f+o.height-this.diffTop):(s.classList.add("medium-toolbar-arrow-under"),s.classList.remove("medium-toolbar-arrow-over"),v.top+=this.diffTop),y<d?(v.left=c+d,v.right="initial"):a-y<d?(v.left="auto",v.right=0):(v.left=c+y,v.right="initial"),["top","left","right"].forEach(function(O){s.style[O]=v[O]+(isNaN(v[O])?"":"px")})}});e.extensions.toolbar=t})(),(function(){var t=e.Extension.extend({init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(r){var i="medium-editor-dragover";r.preventDefault(),r.dataTransfer.dropEffect="copy",r.type==="dragover"?r.target.classList.add(i):r.type==="dragleave"&&r.target.classList.remove(i)},handleDrop:function(r){var i="medium-editor-dragover",o;r.preventDefault(),r.stopPropagation(),r.dataTransfer.files&&(o=Array.prototype.slice.call(r.dataTransfer.files,0),o.some((function(a){if(a.type.match("image")){var s,l;s=new FileReader,s.readAsDataURL(a),l="medium-img-"+ +new Date,e.util.insertHTMLCommand(this.document,'<img class="medium-editor-image-loading" id="'+l+'" />'),s.onload=(function(){var u=this.document.getElementById(l);u&&(u.removeAttribute("id"),u.removeAttribute("class"),u.src=s.result)}).bind(this)}}).bind(this))),r.target.classList.remove(i)}});e.extensions.imageDragging=t})(),(function(){function t(S){var D=e.selection.getSelectionStart(this.options.ownerDocument),L=D.textContent,Y=e.selection.getCaretOffsets(D);(L[Y.left-1]===void 0||L[Y.left-1].trim()===""||L[Y.left]!==void 0&&L[Y.left].trim()==="")&&S.preventDefault()}function r(S,D){if(this.options.disableReturn||D.getAttribute("data-disable-return"))S.preventDefault();else if(this.options.disableDoubleReturn||D.getAttribute("data-disable-double-return")){var L=e.selection.getSelectionStart(this.options.ownerDocument);(L&&L.textContent.trim()===""&&L.nodeName.toLowerCase()!=="li"||L.previousElementSibling&&L.previousElementSibling.nodeName.toLowerCase()!=="br"&&L.previousElementSibling.textContent.trim()==="")&&S.preventDefault()}}function i(S){var D=e.selection.getSelectionStart(this.options.ownerDocument),L=D&&D.nodeName.toLowerCase();L==="pre"&&(S.preventDefault(),e.util.insertHTMLCommand(this.options.ownerDocument," ")),e.util.isListItem(D)&&(S.preventDefault(),S.shiftKey?this.options.ownerDocument.execCommand("outdent",!1,null):this.options.ownerDocument.execCommand("indent",!1,null))}function o(S){var D,L=e.selection.getSelectionStart(this.options.ownerDocument),Y=L.nodeName.toLowerCase(),se=/^(\s+|<br\/?>)?$/i,ce=/h\d/i;e.util.isKey(S,[e.util.keyCode.BACKSPACE,e.util.keyCode.ENTER])&&L.previousElementSibling&&ce.test(Y)&&e.selection.getCaretOffsets(L).left===0?e.util.isKey(S,e.util.keyCode.BACKSPACE)&&se.test(L.previousElementSibling.innerHTML)?(L.previousElementSibling.parentNode.removeChild(L.previousElementSibling),S.preventDefault()):!this.options.disableDoubleReturn&&e.util.isKey(S,e.util.keyCode.ENTER)&&(D=this.options.ownerDocument.createElement("p"),D.innerHTML="<br>",L.previousElementSibling.parentNode.insertBefore(D,L),S.preventDefault()):e.util.isKey(S,e.util.keyCode.DELETE)&&L.nextElementSibling&&L.previousElementSibling&&!ce.test(Y)&&se.test(L.innerHTML)&&ce.test(L.nextElementSibling.nodeName.toLowerCase())?(e.selection.moveCursor(this.options.ownerDocument,L.nextElementSibling),L.previousElementSibling.parentNode.removeChild(L),S.preventDefault()):e.util.isKey(S,e.util.keyCode.BACKSPACE)&&Y==="li"&&se.test(L.innerHTML)&&!L.previousElementSibling&&!L.parentElement.previousElementSibling&&L.nextElementSibling&&L.nextElementSibling.nodeName.toLowerCase()==="li"?(D=this.options.ownerDocument.createElement("p"),D.innerHTML="<br>",L.parentElement.parentElement.insertBefore(D,L.parentElement),e.selection.moveCursor(this.options.ownerDocument,D),L.parentElement.removeChild(L),S.preventDefault()):e.util.isKey(S,e.util.keyCode.BACKSPACE)&&e.util.getClosestTag(L,"blockquote")!==!1&&e.selection.getCaretOffsets(L).left===0?(S.preventDefault(),e.util.execFormatBlock(this.options.ownerDocument,"p")):e.util.isKey(S,e.util.keyCode.ENTER)&&e.util.getClosestTag(L,"blockquote")!==!1&&e.selection.getCaretOffsets(L).right===0?(D=this.options.ownerDocument.createElement("p"),D.innerHTML="<br>",L.parentElement.insertBefore(D,L.nextSibling),e.selection.moveCursor(this.options.ownerDocument,D),S.preventDefault()):e.util.isKey(S,e.util.keyCode.BACKSPACE)&&e.util.isMediumEditorElement(L.parentElement)&&!L.previousElementSibling&&L.nextElementSibling&&se.test(L.innerHTML)&&(S.preventDefault(),e.selection.moveCursor(this.options.ownerDocument,L.nextSibling),L.parentElement.removeChild(L))}function a(S){var D=e.selection.getSelectionStart(this.options.ownerDocument),L;D&&(e.util.isMediumEditorElement(D)&&D.children.length===0&&!e.util.isBlockContainer(D)&&this.options.ownerDocument.execCommand("formatBlock",!1,"p"),e.util.isKey(S,e.util.keyCode.ENTER)&&!e.util.isListItem(D)&&!e.util.isBlockContainer(D)&&(L=D.nodeName.toLowerCase(),L==="a"?this.options.ownerDocument.execCommand("unlink",!1,null):!S.shiftKey&&!S.ctrlKey&&this.options.ownerDocument.execCommand("formatBlock",!1,"p")))}function s(S,D){var L=D.parentNode.querySelector('textarea[medium-editor-textarea-id="'+D.getAttribute("medium-editor-textarea-id")+'"]');L&&(L.value=D.innerHTML.trim())}function l(S){S._mediumEditors||(S._mediumEditors=[null]),this.id||(this.id=S._mediumEditors.length),S._mediumEditors[this.id]=this}function u(S){!S._mediumEditors||!S._mediumEditors[this.id]||(S._mediumEditors[this.id]=null)}function d(S,D,L){var Y=[];if(S||(S=[]),typeof S=="string"&&(S=D.querySelectorAll(S)),e.util.isElement(S)&&(S=[S]),L)for(var se=0;se<S.length;se++){var ce=S[se];e.util.isElement(ce)&&!ce.getAttribute("data-medium-editor-element")&&!ce.getAttribute("medium-editor-textarea-id")&&Y.push(ce)}else Y=Array.prototype.slice.apply(S);return Y}function f(S){var D=S.parentNode.querySelector('textarea[medium-editor-textarea-id="'+S.getAttribute("medium-editor-textarea-id")+'"]');D&&(D.classList.remove("medium-editor-hidden"),D.removeAttribute("medium-editor-textarea-id")),S.parentNode&&S.parentNode.removeChild(S)}function c(S,D){return Object.keys(D).forEach(function(L){S[L]===void 0&&(S[L]=D[L])}),S}function h(S,D,L){var Y={window:L.options.contentWindow,document:L.options.ownerDocument,base:L};return S=c(S,Y),typeof S.init=="function"&&S.init(),S.name||(S.name=D),S}function p(){return this.elements.every(function(S){return!!S.getAttribute("data-disable-toolbar")})?!1:this.options.toolbar!==!1}function v(){return p.call(this)?this.options.anchorPreview!==!1:!1}function g(){return this.options.placeholder!==!1}function y(){return this.options.autoLink!==!1}function m(){return this.options.imageDragging!==!1}function O(){return this.options.keyboardCommands!==!1}function T(){return!this.options.extensions.imageDragging}function C(S){for(var D=this.options.ownerDocument.createElement("div"),L=Date.now(),Y="medium-editor-"+L,se=S.attributes;this.options.ownerDocument.getElementById(Y);)L++,Y="medium-editor-"+L;D.className=S.className,D.id=Y,D.innerHTML=S.value,S.setAttribute("medium-editor-textarea-id",Y);for(var ce=0,Ue=se.length;ce<Ue;ce++)D.hasAttribute(se[ce].nodeName)||D.setAttribute(se[ce].nodeName,se[ce].value);return S.form&&this.on(S.form,"reset",(function(He){He.defaultPrevented||this.resetContent(this.options.ownerDocument.getElementById(Y))}).bind(this)),S.classList.add("medium-editor-hidden"),S.parentNode.insertBefore(D,S),D}function A(S,D){if(!S.getAttribute("data-medium-editor-element")){S.nodeName.toLowerCase()==="textarea"&&(S=C.call(this,S),this.instanceHandleEditableInput||(this.instanceHandleEditableInput=s.bind(this),this.subscribe("editableInput",this.instanceHandleEditableInput))),!this.options.disableEditing&&!S.getAttribute("data-disable-editing")&&(S.setAttribute("contentEditable",!0),S.setAttribute("spellcheck",this.options.spellcheck)),this.instanceHandleEditableKeydownEnter||(S.getAttribute("data-disable-return")||S.getAttribute("data-disable-double-return"))&&(this.instanceHandleEditableKeydownEnter=r.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter)),!this.options.disableReturn&&!S.getAttribute("data-disable-return")&&this.on(S,"keyup",a.bind(this));var L=e.util.guid();S.setAttribute("data-medium-editor-element",!0),S.classList.add("medium-editor-element"),S.setAttribute("role","textbox"),S.setAttribute("aria-multiline",!0),S.setAttribute("data-medium-editor-editor-index",D),S.setAttribute("medium-editor-index",L),me[L]=S.innerHTML,this.events.attachAllEventsToElement(S)}return S}function E(){this.subscribe("editableKeydownTab",i.bind(this)),this.subscribe("editableKeydownDelete",o.bind(this)),this.subscribe("editableKeydownEnter",o.bind(this)),this.options.disableExtraSpaces&&this.subscribe("editableKeydownSpace",t.bind(this)),this.instanceHandleEditableKeydownEnter||(this.options.disableReturn||this.options.disableDoubleReturn)&&(this.instanceHandleEditableKeydownEnter=r.bind(this),this.subscribe("editableKeydownEnter",this.instanceHandleEditableKeydownEnter))}function N(){if(this.extensions=[],Object.keys(this.options.extensions).forEach(function(se){se!=="toolbar"&&this.options.extensions[se]&&this.extensions.push(h(this.options.extensions[se],se,this))},this),T.call(this)){var S=this.options.fileDragging;S||(S={},m.call(this)||(S.allowedTypes=[])),this.addBuiltInExtension("fileDragging",S)}var D={paste:!0,"anchor-preview":v.call(this),autoLink:y.call(this),keyboardCommands:O.call(this),placeholder:g.call(this)};Object.keys(D).forEach(function(se){D[se]&&this.addBuiltInExtension(se)},this);var L=this.options.extensions.toolbar;if(!L&&p.call(this)){var Y=e.util.extend({},this.options.toolbar,{allowMultiParagraphSelection:this.options.allowMultiParagraphSelection});L=new e.extensions.toolbar(Y)}L&&this.extensions.push(h(L,"toolbar",this))}function B(S,D){var L=[["allowMultiParagraphSelection","toolbar.allowMultiParagraphSelection"]];return D&&L.forEach(function(Y){D.hasOwnProperty(Y[0])&&D[Y[0]]!==void 0&&e.util.deprecated(Y[0],Y[1],"v6.0.0")}),e.util.defaults({},D,S)}function Z(S,D){var L=/^append-(.+)$/gi,Y=/justify([A-Za-z]*)$/g,se,ce;if(se=L.exec(S),se)return e.util.execFormatBlock(this.options.ownerDocument,se[1]);if(S==="fontSize")return D.size&&e.util.deprecated(".size option for fontSize command",".value","6.0.0"),ce=D.value||D.size,this.options.ownerDocument.execCommand("fontSize",!1,ce);if(S==="fontName")return D.name&&e.util.deprecated(".name option for fontName command",".value","6.0.0"),ce=D.value||D.name,this.options.ownerDocument.execCommand("fontName",!1,ce);if(S==="createLink")return this.createLink(D);if(S==="image"){var Ue=this.options.contentWindow.getSelection().toString().trim();return this.options.ownerDocument.execCommand("insertImage",!1,Ue)}if(S==="html"){var He=this.options.contentWindow.getSelection().toString().trim();return e.util.insertHTMLCommand(this.options.ownerDocument,He)}if(Y.exec(S)){var F=this.options.ownerDocument.execCommand(S,!1,null),ne=e.selection.getSelectedParentElement(e.selection.getSelectionRange(this.options.ownerDocument));return ne&&ue.call(this,e.util.getTopBlockContainer(ne)),F}return ce=D&&D.value,this.options.ownerDocument.execCommand(S,!1,ce)}function ue(S){if(S){var D,L=Array.prototype.slice.call(S.childNodes).filter(function(Y){var se=Y.nodeName.toLowerCase()==="div";return se&&!D&&(D=Y.style.textAlign),se});L.length&&(this.saveSelection(),L.forEach(function(Y){if(Y.style.textAlign===D){var se=Y.lastChild;if(se){e.util.unwrap(Y,this.options.ownerDocument);var ce=this.options.ownerDocument.createElement("BR");se.parentNode.insertBefore(ce,se.nextSibling)}}},this),S.style.textAlign=D,this.restoreSelection())}}var me={};e.prototype={init:function(S,D){return this.options=B.call(this,this.defaults,D),this.origElements=S,this.options.elementsContainer||(this.options.elementsContainer=this.options.ownerDocument.body),this.setup()},setup:function(){this.isActive||(l.call(this,this.options.contentWindow),this.events=new e.Events(this),this.elements=[],this.addElements(this.origElements),this.elements.length!==0&&(this.isActive=!0,N.call(this),E.call(this)))},destroy:function(){this.isActive&&(this.isActive=!1,this.extensions.forEach(function(S){typeof S.destroy=="function"&&S.destroy()},this),this.events.destroy(),this.elements.forEach(function(S){this.options.spellcheck&&(S.innerHTML=S.innerHTML),S.removeAttribute("contentEditable"),S.removeAttribute("spellcheck"),S.removeAttribute("data-medium-editor-element"),S.classList.remove("medium-editor-element"),S.removeAttribute("role"),S.removeAttribute("aria-multiline"),S.removeAttribute("medium-editor-index"),S.removeAttribute("data-medium-editor-editor-index"),S.getAttribute("medium-editor-textarea-id")&&f(S)},this),this.elements=[],this.instanceHandleEditableKeydownEnter=null,this.instanceHandleEditableInput=null,u.call(this,this.options.contentWindow))},on:function(S,D,L,Y){return this.events.attachDOMEvent(S,D,L,Y),this},off:function(S,D,L,Y){return this.events.detachDOMEvent(S,D,L,Y),this},subscribe:function(S,D){return this.events.attachCustomEvent(S,D),this},unsubscribe:function(S,D){return this.events.detachCustomEvent(S,D),this},trigger:function(S,D,L){return this.events.triggerCustomEvent(S,D,L),this},delay:function(S){var D=this;return setTimeout(function(){D.isActive&&S()},this.options.delay)},serialize:function(){var S,D,L={},Y=this.elements.length;for(S=0;S<Y;S+=1)D=this.elements[S].id!==""?this.elements[S].id:"element-"+S,L[D]={value:this.elements[S].innerHTML.trim()};return L},getExtensionByName:function(S){var D;return this.extensions&&this.extensions.length&&this.extensions.some(function(L){return L.name===S?(D=L,!0):!1}),D},addBuiltInExtension:function(S,D){var L=this.getExtensionByName(S),Y;if(L)return L;switch(S){case"anchor":Y=e.util.extend({},this.options.anchor,D),L=new e.extensions.anchor(Y);break;case"anchor-preview":L=new e.extensions.anchorPreview(this.options.anchorPreview);break;case"autoLink":L=new e.extensions.autoLink;break;case"fileDragging":L=new e.extensions.fileDragging(D);break;case"fontname":L=new e.extensions.fontName(this.options.fontName);break;case"fontsize":L=new e.extensions.fontSize(D);break;case"keyboardCommands":L=new e.extensions.keyboardCommands(this.options.keyboardCommands);break;case"paste":L=new e.extensions.paste(this.options.paste);break;case"placeholder":L=new e.extensions.placeholder(this.options.placeholder);break;default:e.extensions.button.isBuiltInButton(S)&&(D?(Y=e.util.defaults({},D,e.extensions.button.prototype.defaults[S]),L=new e.extensions.button(Y)):L=new e.extensions.button(S))}return L&&this.extensions.push(h(L,S,this)),L},stopSelectionUpdates:function(){this.preventSelectionUpdates=!0},startSelectionUpdates:function(){this.preventSelectionUpdates=!1},checkSelection:function(){var S=this.getExtensionByName("toolbar");return S&&S.checkState(),this},queryCommandState:function(S){var D=/^full-(.+)$/gi,L,Y=null;L=D.exec(S),L&&(S=L[1]);try{Y=this.options.ownerDocument.queryCommandState(S)}catch{Y=null}return Y},execAction:function(S,D){var L=/^full-(.+)$/gi,Y,se;return Y=L.exec(S),Y?(this.saveSelection(),this.selectAllContents(),se=Z.call(this,Y[1],D),this.restoreSelection()):se=Z.call(this,S,D),(S==="insertunorderedlist"||S==="insertorderedlist")&&e.util.cleanListDOM(this.options.ownerDocument,this.getSelectedParentElement()),this.checkSelection(),se},getSelectedParentElement:function(S){return S===void 0&&(S=this.options.contentWindow.getSelection().getRangeAt(0)),e.selection.getSelectedParentElement(S)},selectAllContents:function(){var S=e.selection.getSelectionElement(this.options.contentWindow);if(S){for(;S.children.length===1;)S=S.children[0];this.selectElement(S)}},selectElement:function(S){e.selection.selectNode(S,this.options.ownerDocument);var D=e.selection.getSelectionElement(this.options.contentWindow);D&&this.events.focusElement(D)},getFocusedElement:function(){var S;return this.elements.some(function(D){return!S&&D.getAttribute("data-medium-focused")&&(S=D),!!S},this),S},exportSelection:function(){var S=e.selection.getSelectionElement(this.options.contentWindow),D=this.elements.indexOf(S),L=null;return D>=0&&(L=e.selection.exportSelection(S,this.options.ownerDocument)),L!==null&&D!==0&&(L.editableElementIndex=D),L},saveSelection:function(){this.selectionState=this.exportSelection()},importSelection:function(S,D){if(S){var L=this.elements[S.editableElementIndex||0];e.selection.importSelection(S,L,this.options.ownerDocument,D)}},restoreSelection:function(){this.importSelection(this.selectionState)},createLink:function(S){var D=e.selection.getSelectionElement(this.options.contentWindow),L={},Y;if(this.elements.indexOf(D)!==-1){try{if(this.events.disableCustomEvent("editableInput"),S.url&&e.util.deprecated(".url option for createLink",".value","6.0.0"),Y=S.url||S.value,Y&&Y.trim().length>0){var se=this.options.contentWindow.getSelection();if(se){var ce=se.getRangeAt(0),Ue=ce.commonAncestorContainer,He,F,ne,_e;if(ce.endContainer.nodeType===3&&ce.startContainer.nodeType!==3&&ce.startOffset===0&&ce.startContainer.firstChild===ce.endContainer&&(Ue=ce.endContainer),F=e.util.getClosestBlockContainer(ce.startContainer),ne=e.util.getClosestBlockContainer(ce.endContainer),Ue.nodeType!==3&&Ue.textContent.length!==0&&F===ne){var fe=F||D,Fe=this.options.ownerDocument.createDocumentFragment();this.execAction("unlink"),He=this.exportSelection(),Fe.appendChild(fe.cloneNode(!0)),D===fe?e.selection.select(this.options.ownerDocument,fe.firstChild,0,fe.lastChild,fe.lastChild.nodeType===3?fe.lastChild.nodeValue.length:fe.lastChild.childNodes.length):e.selection.select(this.options.ownerDocument,fe,0,fe,fe.childNodes.length);var R=this.exportSelection();_e=e.util.findOrCreateMatchingTextNodes(this.options.ownerDocument,Fe,{start:He.start-R.start,end:He.end-R.start,editableElementIndex:He.editableElementIndex}),_e.length===0&&(Fe=this.options.ownerDocument.createDocumentFragment(),Fe.appendChild(Ue.cloneNode(!0)),_e=[Fe.firstChild.firstChild,Fe.firstChild.lastChild]),e.util.createLink(this.options.ownerDocument,_e,Y.trim());var W=(Fe.firstChild.innerHTML.match(/^\s+/)||[""])[0].length;e.util.insertHTMLCommand(this.options.ownerDocument,Fe.firstChild.innerHTML.replace(/^\s+/,"")),He.start-=W,He.end-=W,this.importSelection(He)}else this.options.ownerDocument.execCommand("createLink",!1,Y);this.options.targetBlank||S.target==="_blank"?e.util.setTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),Y):e.util.removeTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),Y),S.buttonClass&&e.util.addClassToAnchors(e.selection.getSelectionStart(this.options.ownerDocument),S.buttonClass)}}if(this.options.targetBlank||S.target==="_blank"||S.buttonClass){L=this.options.ownerDocument.createEvent("HTMLEvents"),L.initEvent("input",!0,!0,this.options.contentWindow);for(var G=0,te=this.elements.length;G<te;G+=1)this.elements[G].dispatchEvent(L)}}finally{this.events.enableCustomEvent("editableInput")}this.events.triggerCustomEvent("editableInput",L,D)}},cleanPaste:function(S){this.getExtensionByName("paste").cleanPaste(S)},pasteHTML:function(S,D){this.getExtensionByName("paste").pasteHTML(S,D)},setContent:function(S,D){if(D=D||0,this.elements[D]){var L=this.elements[D];L.innerHTML=S,this.checkContentChanged(L)}},getContent:function(S){return S=S||0,this.elements[S]?this.elements[S].innerHTML.trim():null},checkContentChanged:function(S){S=S||e.selection.getSelectionElement(this.options.contentWindow),this.events.updateInput(S,{target:S,currentTarget:S})},resetContent:function(S){if(S){var D=this.elements.indexOf(S);D!==-1&&this.setContent(me[S.getAttribute("medium-editor-index")],D);return}this.elements.forEach(function(L,Y){this.setContent(me[L.getAttribute("medium-editor-index")],Y)},this)},addElements:function(S){var D=d(S,this.options.ownerDocument,!0);if(D.length===0)return!1;D.forEach(function(L){L=A.call(this,L,this.id),this.elements.push(L),this.trigger("addElement",{target:L,currentTarget:L},L)},this)},removeElements:function(S){var D=d(S,this.options.ownerDocument),L=D.map(function(Y){return Y.getAttribute("medium-editor-textarea-id")&&Y.parentNode?Y.parentNode.querySelector('div[medium-editor-textarea-id="'+Y.getAttribute("medium-editor-textarea-id")+'"]'):Y});this.elements=this.elements.filter(function(Y){return L.indexOf(Y)!==-1?(this.events.cleanupElement(Y),Y.getAttribute("medium-editor-textarea-id")&&f(Y),this.trigger("removeElement",{target:Y,currentTarget:Y},Y),!1):!0},this)}},e.getEditorFromElement=function(S){var D=S.getAttribute("data-medium-editor-editor-index"),L=S&&S.ownerDocument&&(S.ownerDocument.defaultView||S.ownerDocument.parentWindow);return L&&L._mediumEditors&&L._mediumEditors[D]?L._mediumEditors[D]:null}})(),(function(){e.prototype.defaults={activeButtonClass:"medium-editor-button-active",buttonLabels:!1,delay:0,disableReturn:!1,disableDoubleReturn:!1,disableExtraSpaces:!1,disableEditing:!1,autoLink:!1,elementsContainer:!1,contentWindow:window,ownerDocument:document,targetBlank:!1,extensions:{},spellcheck:!0}})(),e.parseVersionString=function(t){var r=t.split("-"),i=r[0].split("."),o=r.length>1?r[1]:"";return{major:parseInt(i[0],10),minor:parseInt(i[1],10),revision:parseInt(i[2],10),preRelease:o,toString:function(){return[i[0],i[1],i[2]].join(".")+(o?"-"+o:"")}}},e.version=e.parseVersionString.call(this,"5.23.3"),e})())})(Nu)),Nu.exports}var p5=h5();const Pu=ps(p5);/*!
|
|
108
|
+
* vanilla-picker v2.12.3
|
|
109
|
+
* https://vanilla-picker.js.org
|
|
110
|
+
*
|
|
111
|
+
* Copyright 2017-2024 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate)
|
|
112
|
+
* Released under the ISC license.
|
|
113
|
+
*/var zc=function(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")},Wc=(function(){function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}})(),Du=(function(){function n(e,t){var r=[],i=!0,o=!1,a=void 0;try{for(var s=e[Symbol.iterator](),l;!(i=(l=s.next()).done)&&(r.push(l.value),!(t&&r.length===t));i=!0);}catch(u){o=!0,a=u}finally{try{!i&&s.return&&s.return()}finally{if(o)throw a}}return r}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return n(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})();String.prototype.startsWith=String.prototype.startsWith||function(n){return this.indexOf(n)===0},String.prototype.padStart=String.prototype.padStart||function(n,e){for(var t=this;t.length<n;)t=e+t;return t};var v5={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function I0(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,t=e>0?n.toFixed(e).replace(/0+$/,"").replace(/\.$/,""):n.toString();return t||"0"}var g5=(function(){function n(e,t,r,i){zc(this,n);var o=this;function a(l){if(l.startsWith("hsl")){var u=l.match(/([\-\d\.e]+)/g).map(Number),d=Du(u,4),f=d[0],c=d[1],h=d[2],p=d[3];p===void 0&&(p=1),f/=360,c/=100,h/=100,o.hsla=[f,c,h,p]}else if(l.startsWith("rgb")){var v=l.match(/([\-\d\.e]+)/g).map(Number),g=Du(v,4),y=g[0],m=g[1],O=g[2],T=g[3];T===void 0&&(T=1),o.rgba=[y,m,O,T]}else l.startsWith("#")?o.rgba=n.hexToRgb(l):o.rgba=n.nameToRgb(l)||n.hexToRgb(l)}if(e!==void 0)if(Array.isArray(e))this.rgba=e;else if(r===void 0){var s=e&&""+e;s&&a(s.toLowerCase())}else this.rgba=[e,t,r,i===void 0?1:i]}return Wc(n,[{key:"printRGB",value:function(t){var r=t?this.rgba:this.rgba.slice(0,3),i=r.map(function(o,a){return I0(o,a===3?3:0)});return t?"rgba("+i+")":"rgb("+i+")"}},{key:"printHSL",value:function(t){var r=[360,100,100,1],i=["","%","%",""],o=t?this.hsla:this.hsla.slice(0,3),a=o.map(function(s,l){return I0(s*r[l],l===3?3:1)+i[l]});return t?"hsla("+a+")":"hsl("+a+")"}},{key:"printHex",value:function(t){var r=this.hex;return t?r:r.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=n.hslToRgb(this._hsla)},set:function(t){t.length===3&&(t[3]=1),this._rgba=t,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=n.rgbToHsl(this._rgba)},set:function(t){t.length===3&&(t[3]=1),this._hsla=t,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){var t=this.rgba,r=t.map(function(i,o){return o<3?i.toString(16):Math.round(i*255).toString(16)});return"#"+r.map(function(i){return i.padStart(2,"0")}).join("")},set:function(t){this.rgba=n.hexToRgb(t)}}],[{key:"hexToRgb",value:function(t){var r=(t.startsWith("#")?t.slice(1):t).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!r.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+t);var i=r.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map(function(o){return parseInt(o,16)});return i[3]=i[3]/255,i}},{key:"nameToRgb",value:function(t){var r=t.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),i=v5[r];return i===void 0?i:n.hexToRgb(i.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(t){var r=Du(t,4),i=r[0],o=r[1],a=r[2],s=r[3];i/=255,o/=255,a/=255;var l=Math.max(i,o,a),u=Math.min(i,o,a),d=void 0,f=void 0,c=(l+u)/2;if(l===u)d=f=0;else{var h=l-u;switch(f=c>.5?h/(2-l-u):h/(l+u),l){case i:d=(o-a)/h+(o<a?6:0);break;case o:d=(a-i)/h+2;break;case a:d=(i-o)/h+4;break}d/=6}return[d,f,c,s]}},{key:"hslToRgb",value:function(t){var r=Du(t,4),i=r[0],o=r[1],a=r[2],s=r[3],l=void 0,u=void 0,d=void 0;if(o===0)l=u=d=a;else{var f=function(g,y,m){return m<0&&(m+=1),m>1&&(m-=1),m<.16666666666666666?g+(y-g)*6*m:m<.5?y:m<.6666666666666666?g+(y-g)*(.6666666666666666-m)*6:g},c=a<.5?a*(1+o):a+o-a*o,h=2*a-c;l=f(h,c,i+1/3),u=f(h,c,i),d=f(h,c,i-1/3)}var p=[l*255,u*255,d*255].map(Math.round);return p[3]=s,p}}]),n})(),y5=(function(){function n(){zc(this,n),this._events=[]}return Wc(n,[{key:"add",value:function(t,r,i){t.addEventListener(r,i,!1),this._events.push({target:t,type:r,handler:i})}},{key:"remove",value:function(t,r,i){this._events=this._events.filter(function(o){var a=!0;return t&&t!==o.target&&(a=!1),r&&r!==o.type&&(a=!1),i&&i!==o.handler&&(a=!1),a&&n._doRemove(o.target,o.type,o.handler),!a})}},{key:"destroy",value:function(){this._events.forEach(function(t){return n._doRemove(t.target,t.type,t.handler)}),this._events=[]}}],[{key:"_doRemove",value:function(t,r,i){t.removeEventListener(r,i,!1)}}]),n})();function m5(n){var e=document.createElement("div");return e.innerHTML=n,e.firstElementChild}function Xc(n,e,t){var r=!1;function i(l,u,d){return Math.max(u,Math.min(l,d))}function o(l,u,d){if(d&&(r=!0),!!r){l.preventDefault();var f=e.getBoundingClientRect(),c=f.width,h=f.height,p=u.clientX,v=u.clientY,g=i(p-f.left,0,c),y=i(v-f.top,0,h);t(g/c,y/h)}}function a(l,u){var d=l.buttons===void 0?l.which:l.buttons;d===1?o(l,l,u):r=!1}function s(l,u){l.touches.length===1?o(l,l.touches[0],u):r=!1}n.add(e,"mousedown",function(l){a(l,!0)}),n.add(e,"touchstart",function(l){s(l,!0)}),n.add(window,"mousemove",a),n.add(e,"touchmove",s),n.add(window,"mouseup",function(l){r=!1}),n.add(e,"touchend",function(l){r=!1}),n.add(e,"touchcancel",function(l){r=!1})}var _5=`linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,
|
|
114
|
+
linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em`,b5=360,k0="keydown",Ru="mousedown",Gc="focusin";function Hr(n,e){return(e||document).querySelector(n)}function x5(n){n.preventDefault(),n.stopPropagation()}function Uc(n,e,t,r,i){n.add(e,k0,function(o){t.indexOf(o.key)>=0&&r(o)})}var j0=(function(){function n(e){zc(this,n),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new y5,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(e)}return Wc(n,[{key:"setOptions",value:function(t){var r=this;if(!t)return;var i=this.settings;function o(u,d,f){for(var c in u)d[c]=u[c]}if(t instanceof HTMLElement)i.parent=t;else{i.parent&&t.parent&&i.parent!==t.parent&&(this._events.remove(i.parent),this._popupInited=!1),o(t,i),t.onChange&&(this.onChange=t.onChange),t.onDone&&(this.onDone=t.onDone),t.onOpen&&(this.onOpen=t.onOpen),t.onClose&&(this.onClose=t.onClose);var a=t.color||t.colour;a&&this._setColor(a)}var s=i.parent;if(s&&i.popup&&!this._popupInited){var l=function(d){return r.openHandler(d)};this._events.add(s,"click",l),Uc(this._events,s,[" ","Spacebar","Enter"],l),this._popupInited=!0}else t.parent&&!i.popup&&this.show()}},{key:"openHandler",value:function(t){if(this.show()){t&&t.preventDefault(),this.settings.parent.style.pointerEvents="none";var r=t&&t.type===k0?this._domEdit:this.domElement;setTimeout(function(){return r.focus()},100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(t){var r=t&&t.type,i=!1;if(!t)i=!0;else if(r===Ru||r===Gc){var o=(this.__containedEvent||0)+100;t.timeStamp>o&&(i=!0)}else x5(t),i=!0;i&&this.hide()&&(this.settings.parent.style.pointerEvents="",r!==Ru&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(t,r){this.closeHandler(),this.setOptions(t),r&&this.openHandler()}},{key:"setColor",value:function(t,r){this._setColor(t,{silent:r})}},{key:"_setColor",value:function(t,r){if(typeof t=="string"&&(t=t.trim()),!!t){r=r||{};var i=void 0;try{i=new g5(t)}catch(a){if(r.failSilently)return;throw a}if(!this.settings.alpha){var o=i.hsla;o[3]=1,i.hsla=o}this.colour=this.color=i,this._setHSLA(null,null,null,null,r)}}},{key:"setColour",value:function(t,r){this.setColor(t,r)}},{key:"show",value:function(){var t=this.settings.parent;if(!t)return!1;if(this.domElement){var r=this._toggleDOM(!0);return this._setPosition(),r}var i=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',o=m5(i);return this.domElement=o,this._domH=Hr(".picker_hue",o),this._domSL=Hr(".picker_sl",o),this._domA=Hr(".picker_alpha",o),this._domEdit=Hr(".picker_editor input",o),this._domSample=Hr(".picker_sample",o),this._domOkay=Hr(".picker_done button",o),this._domCancel=Hr(".picker_cancel button",o),o.classList.add("layout_"+this.settings.layout),this.settings.alpha||o.classList.add("no_alpha"),this.settings.editor||o.classList.add("no_editor"),this.settings.cancelButton||o.classList.add("no_cancel"),this._ifPopup(function(){return o.classList.add("popup")}),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var t=this,r=this,i=this.domElement,o=this._events;function a(u,d,f){o.add(u,d,f)}a(i,"click",function(u){return u.preventDefault()}),Xc(o,this._domH,function(u,d){return r._setHSLA(u)}),Xc(o,this._domSL,function(u,d){return r._setHSLA(null,u,1-d)}),this.settings.alpha&&Xc(o,this._domA,function(u,d){return r._setHSLA(null,null,null,1-d)});var s=this._domEdit;a(s,"input",function(u){r._setColor(this.value,{fromEditor:!0,failSilently:!0})}),a(s,"focus",function(u){var d=this;d.selectionStart===d.selectionEnd&&d.select()}),this._ifPopup(function(){var u=function(c){return t.closeHandler(c)};a(window,Ru,u),a(window,Gc,u),Uc(o,i,["Esc","Escape"],u);var d=function(c){t.__containedEvent=c.timeStamp};a(i,Ru,d),a(i,Gc,d),a(t._domCancel,"click",u)});var l=function(d){t._ifPopup(function(){return t.closeHandler(d)}),t.onDone&&t.onDone(t.colour)};a(this._domOkay,"click",l),Uc(o,i,["Enter"],l)}},{key:"_setPosition",value:function(){var t=this.settings.parent,r=this.domElement;t!==r.parentNode&&t.appendChild(r),this._ifPopup(function(i){getComputedStyle(t).position==="static"&&(t.style.position="relative");var o=i===!0?"popup_right":"popup_"+i;["popup_top","popup_bottom","popup_left","popup_right"].forEach(function(a){a===o?r.classList.add(a):r.classList.remove(a)}),r.classList.add(o)})}},{key:"_setHSLA",value:function(t,r,i,o,a){a=a||{};var s=this.colour,l=s.hsla;[t,r,i,o].forEach(function(u,d){(u||u===0)&&(l[d]=u)}),s.hsla=l,this._updateUI(a),this.onChange&&!a.silent&&this.onChange(s)}},{key:"_updateUI",value:function(t){if(!this.domElement)return;t=t||{};var r=this.colour,i=r.hsla,o="hsl("+i[0]*b5+", 100%, 50%)",a=r.hslString,s=r.hslaString,l=this._domH,u=this._domSL,d=this._domA,f=Hr(".picker_selector",l),c=Hr(".picker_selector",u),h=Hr(".picker_selector",d);function p(A,E,N){E.style.left=N*100+"%"}function v(A,E,N){E.style.top=N*100+"%"}p(l,f,i[0]),this._domSL.style.backgroundColor=this._domH.style.color=o,p(u,c,i[1]),v(u,c,1-i[2]),u.style.color=a,v(d,h,1-i[3]);var g=a,y=g.replace("hsl","hsla").replace(")",", 0)"),m="linear-gradient("+[g,y]+")";if(this._domA.style.background=m+", "+_5,!t.fromEditor){var O=this.settings.editorFormat,T=this.settings.alpha,C=void 0;switch(O){case"rgb":C=r.printRGB(T);break;case"hsl":C=r.printHSL(T);break;default:C=r.printHex(T)}this._domEdit.value=C}this._domSample.style.color=s}},{key:"_ifPopup",value:function(t,r){this.settings.parent&&this.settings.popup?t&&t(this.settings.popup):r&&r()}},{key:"_toggleDOM",value:function(t){var r=this.domElement;if(!r)return!1;var i=t?"":"none",o=r.style.display!==i;return o&&(r.style.display=i),o}}]),n})();{var Yc=document.createElement("style");Yc.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(Yc),j0.StyleElement=Yc}var Vc={exports:{}},B0;function F0(){return B0||(B0=1,(function(n,e){(function(t,r){n.exports=t()})(function(){var t="object",r="function",i="undefined",o=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],a=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],s=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],l=["collapse","compareEndPoints","duplicate","moveToElementText","parentElement","select","setEndPoint","getBoundingClientRect"];function u(R,W){var G=typeof R[W];return G==r||!!(G==t&&R[W])||G=="unknown"}function d(R,W){return!!(typeof R[W]==t&&R[W])}function f(R,W){return typeof R[W]!=i}function c(R){return function(W,G){for(var te=G.length;te--;)if(!R(W,G[te]))return!1;return!0}}var h=c(u),p=c(d),v=c(f);function g(R){return R&&h(R,l)&&v(R,s)}function y(R){return d(R,"body")?R.body:R.getElementsByTagName("body")[0]}var m=[].forEach?function(R,W){R.forEach(W)}:function(R,W){for(var G=0,te=R.length;G<te;++G)W(R[G],G)},O={},T=typeof window!=i&&typeof document!=i,C={isHostMethod:u,isHostObject:d,isHostProperty:f,areHostMethods:h,areHostObjects:p,areHostProperties:v,isTextRange:g,getBody:y,forEach:m},A={version:"1.3.2",initialized:!1,isBrowser:T,supported:!0,util:C,features:{},modules:O,config:{alertOnFail:!1,alertOnWarn:!1,preferTextRange:!1,autoInitialize:typeof rangyAutoInitialize==i?!0:rangyAutoInitialize}};function E(R){typeof console!=i&&u(console,"log")&&console.log(R)}function N(R,W){T&&W?alert(R):E(R)}function B(R){A.initialized=!0,A.supported=!1,N("Rangy is not supported in this environment. Reason: "+R,A.config.alertOnFail)}A.fail=B;function Z(R){N("Rangy warning: "+R,A.config.alertOnWarn)}A.warn=Z;var ue;({}).hasOwnProperty?(C.extend=ue=function(R,W,G){var te,oe;for(var Se in W)Se==="__proto__"||Se==="constructor"||Se==="prototype"||W.hasOwnProperty(Se)&&(te=R[Se],oe=W[Se],G&&te!==null&&typeof te=="object"&&oe!==null&&typeof oe=="object"&&ue(te,oe,!0),R[Se]=oe);return W.hasOwnProperty("toString")&&(R.toString=W.toString),R},C.createOptions=function(R,W){var G={};return ue(G,W),R&&ue(G,R),G}):B("hasOwnProperty not supported"),T||B("Rangy can only run in a browser"),(function(){var R;if(T){var W=document.createElement("div");W.appendChild(document.createElement("span"));var G=[].slice;try{G.call(W.childNodes,0)[0].nodeType==1&&(R=function(te){return G.call(te,0)})}catch{}}R||(R=function(te){for(var oe=[],Se=0,Ce=te.length;Se<Ce;++Se)oe[Se]=te[Se];return oe}),C.toArray=R})();var me;T&&(u(document,"addEventListener")?me=function(R,W,G){R.addEventListener(W,G,!1)}:u(document,"attachEvent")?me=function(R,W,G){R.attachEvent("on"+W,G)}:B("Document does not have required addEventListener or attachEvent method"),C.addListener=me);var S=[];function D(R){return R.message||R.description||String(R)}function L(){if(!(!T||A.initialized)){var R,W=!1,G=!1;u(document,"createRange")&&(R=document.createRange(),h(R,a)&&v(R,o)&&(W=!0));var te=y(document);if(!te||te.nodeName.toLowerCase()!="body"){B("No body element found");return}if(te&&u(te,"createTextRange")&&(R=te.createTextRange(),g(R)&&(G=!0)),!W&&!G){B("Neither Range nor TextRange are available");return}A.initialized=!0,A.features={implementsDomRange:W,implementsTextRange:G};var oe,Se;for(var Ce in O)(oe=O[Ce])instanceof He&&oe.init(oe,A);for(var ot=0,pt=S.length;ot<pt;++ot)try{S[ot](A)}catch(kt){Se="Rangy init listener threw an exception. Continuing. Detail: "+D(kt),E(Se)}}}function Y(R,W,G){G&&(R+=" in module "+G.name),A.warn("DEPRECATED: "+R+" is deprecated. Please use "+W+" instead.")}function se(R,W,G,te){R[W]=function(){return Y(W,G,te),R[G].apply(R,C.toArray(arguments))}}C.deprecationNotice=Y,C.createAliasForDeprecatedMethod=se,A.init=L,A.addInitListener=function(R){A.initialized?R(A):S.push(R)};var ce=[];A.addShimListener=function(R){ce.push(R)};function Ue(R){R=R||window,L();for(var W=0,G=ce.length;W<G;++W)ce[W](R)}T&&(A.shim=A.createMissingNativeApi=Ue,se(A,"createMissingNativeApi","shim"));function He(R,W,G){this.name=R,this.dependencies=W,this.initialized=!1,this.supported=!1,this.initializer=G}He.prototype={init:function(){for(var R=this.dependencies||[],W=0,G=R.length,te,oe;W<G;++W){if(oe=R[W],te=O[oe],!te||!(te instanceof He))throw new Error("required module '"+oe+"' not found");if(te.init(),!te.supported)throw new Error("required module '"+oe+"' not supported")}this.initializer(this)},fail:function(R){throw this.initialized=!0,this.supported=!1,new Error(R)},warn:function(R){A.warn("Module "+this.name+": "+R)},deprecationNotice:function(R,W){A.warn("DEPRECATED: "+R+" in module "+this.name+" is deprecated. Please use "+W+" instead")},createError:function(R){return new Error("Error in Rangy "+this.name+" module: "+R)}};function F(R,W,G){var te=new He(R,W,function(oe){if(!oe.initialized){oe.initialized=!0;try{G(A,oe),oe.supported=!0}catch(Ce){var Se="Module '"+R+"' failed to load: "+D(Ce);E(Se),Ce.stack&&E(Ce.stack)}}});return O[R]=te,te}A.createModule=function(R){var W,G;arguments.length==2?(W=arguments[1],G=[]):(W=arguments[2],G=arguments[1]);var te=F(R,G,W);A.initialized&&A.supported&&te.init()},A.createCoreModule=function(R,W,G){F(R,W,G)};function ne(){}A.RangePrototype=ne,A.rangePrototype=new ne;function _e(){}A.selectionPrototype=new _e,A.createCoreModule("DomUtil",[],function(R,W){var G="undefined",te=R.util,oe=te.getBody;te.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||W.fail("document missing a Node creation method"),te.isHostMethod(document,"getElementsByTagName")||W.fail("document missing getElementsByTagName method");var Se=document.createElement("div");te.areHostMethods(Se,["insertBefore","appendChild","cloneNode"])||W.fail("Incomplete Element implementation"),te.isHostProperty(Se,"innerHTML")||W.fail("Element is missing innerHTML property");var Ce=document.createTextNode("test");te.areHostMethods(Ce,["splitText","deleteData","insertData","appendData","cloneNode"])||W.fail("Incomplete Text Node implementation");var ot=function(X,ie){for(var $e=X.length;$e--;)if(X[$e]===ie)return!0;return!1};function pt(X){var ie;return typeof X.namespaceURI==G||(ie=X.namespaceURI)===null||ie=="http://www.w3.org/1999/xhtml"}function kt(X){var ie=X.parentNode;return ie.nodeType==1?ie:null}function lt(X){for(var ie=0;X=X.previousSibling;)++ie;return ie}function Gt(X){switch(X.nodeType){case 7:case 10:return 0;case 3:case 8:return X.length;default:return X.childNodes.length}}function Jt(X,ie){var $e=[],Te;for(Te=X;Te;Te=Te.parentNode)$e.push(Te);for(Te=ie;Te;Te=Te.parentNode)if(ot($e,Te))return Te;return null}function w(X,ie,$e){for(var Te=$e?ie:ie.parentNode;Te;){if(Te===X)return!0;Te=Te.parentNode}return!1}function M(X,ie){return w(X,ie,!0)}function P(X,ie,$e){for(var Te,Ct=$e?X:X.parentNode;Ct;){if(Te=Ct.parentNode,Te===ie)return Ct;Ct=Te}return null}function U(X){var ie=X.nodeType;return ie==3||ie==4||ie==8}function I(X){if(!X)return!1;var ie=X.nodeType;return ie==3||ie==8}function Q(X,ie){var $e=ie.nextSibling,Te=ie.parentNode;return $e?Te.insertBefore(X,$e):Te.appendChild(X),X}function K(X,ie,$e){var Te=X.cloneNode(!1);if(Te.deleteData(0,ie),X.deleteData(ie,X.length-ie),Q(Te,X),$e)for(var Ct=0,vt;vt=$e[Ct++];)vt.node==X&&vt.offset>ie?(vt.node=Te,vt.offset-=ie):vt.node==X.parentNode&&vt.offset>lt(X)&&++vt.offset;return Te}function J(X){if(X.nodeType==9)return X;if(typeof X.ownerDocument!=G)return X.ownerDocument;if(typeof X.document!=G)return X.document;if(X.parentNode)return J(X.parentNode);throw W.createError("getDocument: no document found for node")}function Pe(X){var ie=J(X);if(typeof ie.defaultView!=G)return ie.defaultView;if(typeof ie.parentWindow!=G)return ie.parentWindow;throw W.createError("Cannot get a window object for node")}function xe(X){if(typeof X.contentDocument!=G)return X.contentDocument;if(typeof X.contentWindow!=G)return X.contentWindow.document;throw W.createError("getIframeDocument: No Document object found for iframe element")}function de(X){if(typeof X.contentWindow!=G)return X.contentWindow;if(typeof X.contentDocument!=G)return X.contentDocument.defaultView;throw W.createError("getIframeWindow: No Window object found for iframe element")}function rt(X){return X&&te.isHostMethod(X,"setTimeout")&&te.isHostObject(X,"document")}function Ke(X,ie,$e){var Te;if(X?te.isHostProperty(X,"nodeType")?Te=X.nodeType==1&&X.tagName.toLowerCase()=="iframe"?xe(X):J(X):rt(X)&&(Te=X.document):Te=document,!Te)throw ie.createError($e+"(): Parameter must be a Window object or DOM node");return Te}function Qe(X){for(var ie;ie=X.parentNode;)X=ie;return X}function en(X,ie,$e,Te){var Ct,vt,Sr,zn,_n;if(X==$e)return ie===Te?0:ie<Te?-1:1;if(Ct=P($e,X,!0))return ie<=lt(Ct)?-1:1;if(Ct=P(X,$e,!0))return lt(Ct)<Te?-1:1;if(vt=Jt(X,$e),!vt)throw new Error("comparePoints error: nodes have no common ancestor");if(Sr=X===vt?vt:P(X,vt,!0),zn=$e===vt?vt:P($e,vt,!0),Sr===zn)throw W.createError("comparePoints got to case 4 and childA and childB are the same!");for(_n=vt.firstChild;_n;){if(_n===Sr)return-1;if(_n===zn)return 1;_n=_n.nextSibling}}var he=!1;function Oe(X){var ie;try{return ie=X.parentNode,!1}catch{return!0}}(function(){var X=document.createElement("b");X.innerHTML="1";var ie=X.firstChild;X.innerHTML="<br />",he=Oe(ie),R.features.crashyTextNodes=he})();function ut(X){if(!X)return"[No node]";if(he&&Oe(X))return"[Broken node]";if(U(X))return'"'+X.data+'"';if(X.nodeType==1){var ie=X.id?' id="'+X.id+'"':"";return"<"+X.nodeName+ie+">[index:"+lt(X)+",length:"+X.childNodes.length+"]["+(X.innerHTML||"[innerHTML not supported]").slice(0,25)+"]"}return X.nodeName}function xt(X){for(var ie=J(X).createDocumentFragment(),$e;$e=X.firstChild;)ie.appendChild($e);return ie}var Ft;typeof window.getComputedStyle!=G?Ft=function(X,ie){return Pe(X).getComputedStyle(X,null)[ie]}:typeof document.documentElement.currentStyle!=G?Ft=function(X,ie){return X.currentStyle?X.currentStyle[ie]:""}:W.fail("No means of obtaining computed style properties found");function Hn(X,ie,$e){var Te=oe(X),Ct=X.createElement("div");Ct.contentEditable=""+!!$e,ie&&(Ct.innerHTML=ie);var vt=Te.firstChild;return vt?Te.insertBefore(Ct,vt):Te.appendChild(Ct),Ct}function mn(X){return X.parentNode.removeChild(X)}function tn(X){this.root=X,this._next=X}tn.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var X=this._current=this._next,ie,$e;if(this._current)if(ie=X.firstChild,ie)this._next=ie;else{for($e=null;X!==this.root&&!($e=X.nextSibling);)X=X.parentNode;this._next=$e}return this._current},detach:function(){this._current=this._next=this.root=null}};function nn(X){return new tn(X)}function un(X,ie){this.node=X,this.offset=ie}un.prototype={equals:function(X){return!!X&&this.node===X.node&&this.offset==X.offset},inspect:function(){return"[DomPosition("+ut(this.node)+":"+this.offset+")]"},toString:function(){return this.inspect()}};function Cn(X){this.code=this[X],this.codeName=X,this.message="DOMException: "+this.codeName}Cn.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11,INVALID_NODE_TYPE_ERR:24},Cn.prototype.toString=function(){return this.message},R.dom={arrayContains:ot,isHtmlNamespace:pt,parentElement:kt,getNodeIndex:lt,getNodeLength:Gt,getCommonAncestor:Jt,isAncestorOf:w,isOrIsAncestorOf:M,getClosestAncestorIn:P,isCharacterDataNode:U,isTextOrCommentNode:I,insertAfter:Q,splitDataNode:K,getDocument:J,getWindow:Pe,getIframeWindow:de,getIframeDocument:xe,getBody:oe,isWindow:rt,getContentDocument:Ke,getRootContainer:Qe,comparePoints:en,isBrokenNode:Oe,inspectNode:ut,getComputedStyleProperty:Ft,createTestElement:Hn,removeNode:mn,fragmentFromNodeChildren:xt,createIterator:nn,DomPosition:un},R.DOMException=Cn}),A.createCoreModule("DomRange",["DomUtil"],function(R,W){var G=R.dom,te=R.util,oe=G.DomPosition,Se=R.DOMException,Ce=G.isCharacterDataNode,ot=G.getNodeIndex,pt=G.isOrIsAncestorOf,kt=G.getDocument,lt=G.comparePoints,Gt=G.splitDataNode,Jt=G.getClosestAncestorIn,w=G.getNodeLength,M=G.arrayContains,P=G.getRootContainer,U=R.features.crashyTextNodes,I=G.removeNode;function Q(x,k){return x.nodeType!=3&&(pt(x,k.startContainer)||pt(x,k.endContainer))}function K(x){return x.document||kt(x.startContainer)}function J(x){return P(x.startContainer)}function Pe(x){return new oe(x.parentNode,ot(x))}function xe(x){return new oe(x.parentNode,ot(x)+1)}function de(x,k,V){var re=x.nodeType==11?x.firstChild:x;return Ce(k)?V==k.length?G.insertAfter(x,k):k.parentNode.insertBefore(x,V==0?k:Gt(k,V)):V>=k.childNodes.length?k.appendChild(x):k.insertBefore(x,k.childNodes[V]),re}function rt(x,k,V){if(_t(x),_t(k),K(k)!=K(x))throw new Se("WRONG_DOCUMENT_ERR");var re=lt(x.startContainer,x.startOffset,k.endContainer,k.endOffset),Ae=lt(x.endContainer,x.endOffset,k.startContainer,k.startOffset);return V?re<=0&&Ae>=0:re<0&&Ae>0}function Ke(x){for(var k,V,re=K(x.range).createDocumentFragment(),Ae;V=x.next();){if(k=x.isPartiallySelectedSubtree(),V=V.cloneNode(!k),k&&(Ae=x.getSubtreeIterator(),V.appendChild(Ke(Ae)),Ae.detach()),V.nodeType==10)throw new Se("HIERARCHY_REQUEST_ERR");re.appendChild(V)}return re}function Qe(x,k,V){var re,Ae;V=V||{stop:!1};for(var et,ee;et=x.next();)if(x.isPartiallySelectedSubtree()){if(k(et)===!1){V.stop=!0;return}else if(ee=x.getSubtreeIterator(),Qe(ee,k,V),ee.detach(),V.stop)return}else for(re=G.createIterator(et);Ae=re.next();)if(k(Ae)===!1){V.stop=!0;return}}function en(x){for(var k;x.next();)x.isPartiallySelectedSubtree()?(k=x.getSubtreeIterator(),en(k),k.detach()):x.remove()}function he(x){for(var k,V=K(x.range).createDocumentFragment(),re;k=x.next();){if(x.isPartiallySelectedSubtree()?(k=k.cloneNode(!1),re=x.getSubtreeIterator(),k.appendChild(he(re)),re.detach()):x.remove(),k.nodeType==10)throw new Se("HIERARCHY_REQUEST_ERR");V.appendChild(k)}return V}function Oe(x,k,V){var re=!!(k&&k.length),Ae,et=!!V;re&&(Ae=new RegExp("^("+k.join("|")+")$"));var ee=[];return Qe(new xt(x,!1),function(be){if(!(re&&!Ae.test(be.nodeType))&&!(et&&!V(be))){var De=x.startContainer;if(!(be==De&&Ce(De)&&x.startOffset==De.length)){var qe=x.endContainer;be==qe&&Ce(qe)&&x.endOffset==0||ee.push(be)}}}),ee}function ut(x){var k=typeof x.getName>"u"?"Range":x.getName();return"["+k+"("+G.inspectNode(x.startContainer)+":"+x.startOffset+", "+G.inspectNode(x.endContainer)+":"+x.endOffset+")]"}function xt(x,k){if(this.range=x,this.clonePartiallySelectedTextNodes=k,!x.collapsed){this.sc=x.startContainer,this.so=x.startOffset,this.ec=x.endContainer,this.eo=x.endOffset;var V=x.commonAncestorContainer;this.sc===this.ec&&Ce(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc===V&&!Ce(this.sc)?this.sc.childNodes[this.so]:Jt(this.sc,V,!0),this._last=this.ec===V&&!Ce(this.ec)?this.ec.childNodes[this.eo-1]:Jt(this.ec,V,!0))}}xt.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null,this._next=this._first},hasNext:function(){return!!this._next},next:function(){var x=this._current=this._next;return x&&(this._next=x!==this._last?x.nextSibling:null,Ce(x)&&this.clonePartiallySelectedTextNodes&&(x===this.ec&&(x=x.cloneNode(!0)).deleteData(this.eo,x.length-this.eo),this._current===this.sc&&(x=x.cloneNode(!0)).deleteData(0,this.so))),x},remove:function(){var x=this._current,k,V;Ce(x)&&(x===this.sc||x===this.ec)?(k=x===this.sc?this.so:0,V=x===this.ec?this.eo:x.length,k!=V&&x.deleteData(k,V-k)):x.parentNode&&I(x)},isPartiallySelectedSubtree:function(){var x=this._current;return Q(x,this.range)},getSubtreeIterator:function(){var x;if(this.isSingleCharacterDataNode)x=this.range.cloneRange(),x.collapse(!1);else{x=new $t(K(this.range));var k=this._current,V=k,re=0,Ae=k,et=w(k);pt(k,this.sc)&&(V=this.sc,re=this.so),pt(k,this.ec)&&(Ae=this.ec,et=this.eo),dt(x,V,re,Ae,et)}return new xt(x,this.clonePartiallySelectedTextNodes)},detach:function(){this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}};var Ft=[1,3,4,5,7,8,10],Hn=[2,9,11],mn=[5,6,10,12],tn=[1,3,4,5,7,8,10,11],nn=[1,3,4,5,7,8];function un(x){return function(k,V){for(var re,Ae=V?k:k.parentNode;Ae;){if(re=Ae.nodeType,M(x,re))return Ae;Ae=Ae.parentNode}return null}}var Cn=un([9,11]),X=un(mn),ie=un([6,10,12]),$e=un([1]);function Te(x,k){if(ie(x,k))throw new Se("INVALID_NODE_TYPE_ERR")}function Ct(x,k){if(!M(k,x.nodeType))throw new Se("INVALID_NODE_TYPE_ERR")}function vt(x,k){if(k<0||k>(Ce(x)?x.length:x.childNodes.length))throw new Se("INDEX_SIZE_ERR")}function Sr(x,k){if(Cn(x,!0)!==Cn(k,!0))throw new Se("WRONG_DOCUMENT_ERR")}function zn(x){if(X(x,!0))throw new Se("NO_MODIFICATION_ALLOWED_ERR")}function _n(x,k){if(!x)throw new Se(k)}function us(x,k){return k<=(Ce(x)?x.length:x.childNodes.length)}function Ji(x){return!!x.startContainer&&!!x.endContainer&&!(U&&(G.isBrokenNode(x.startContainer)||G.isBrokenNode(x.endContainer)))&&P(x.startContainer)==P(x.endContainer)&&us(x.startContainer,x.startOffset)&&us(x.endContainer,x.endOffset)}function _t(x){if(!Ji(x))throw new Error("Range error: Range is not valid. This usually happens after DOM mutation. Range: ("+x.inspect()+")")}var ds=document.createElement("style"),ni=!1;try{ds.innerHTML="<b>x</b>",ni=ds.firstChild.nodeType==3}catch{}R.features.htmlParsingConforms=ni;var fs=ni?function(x){var k=this.startContainer,V=kt(k);if(!k)throw new Se("INVALID_STATE_ERR");var re=null;return k.nodeType==1?re=k:Ce(k)&&(re=G.parentElement(k)),re===null||re.nodeName=="HTML"&&G.isHtmlNamespace(kt(re).documentElement)&&G.isHtmlNamespace(re)?re=V.createElement("body"):re=re.cloneNode(!1),re.innerHTML=x,G.fragmentFromNodeChildren(re)}:function(x){var k=K(this),V=k.createElement("body");return V.innerHTML=x,G.fragmentFromNodeChildren(V)};function Zo(x,k){_t(x);var V=x.startContainer,re=x.startOffset,Ae=x.endContainer,et=x.endOffset,ee=V===Ae;Ce(Ae)&&et>0&&et<Ae.length&&Gt(Ae,et,k),Ce(V)&&re>0&&re<V.length&&(V=Gt(V,re,k),ee?(et-=re,Ae=V):Ae==V.parentNode&&et>=ot(V)&&et++,re=0),x.setStartAndEnd(V,re,Ae,et)}function ze(x){_t(x);var k=x.commonAncestorContainer.parentNode.cloneNode(!1);return k.appendChild(x.cloneContents()),k.innerHTML}var Qo=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],Jo=0,eo=1,$u=2,Mi=3,to=0,cs=1,hs=2,ea=3;te.extend(R.rangePrototype,{compareBoundaryPoints:function(x,k){_t(this),Sr(this.startContainer,k.startContainer);var V,re,Ae,et,ee=x==Mi||x==Jo?"start":"end",be=x==eo||x==Jo?"start":"end";return V=this[ee+"Container"],re=this[ee+"Offset"],Ae=k[be+"Container"],et=k[be+"Offset"],lt(V,re,Ae,et)},insertNode:function(x){if(_t(this),Ct(x,tn),zn(this.startContainer),pt(x,this.startContainer))throw new Se("HIERARCHY_REQUEST_ERR");var k=de(x,this.startContainer,this.startOffset);this.setStartBefore(k)},cloneContents:function(){_t(this);var x,k;if(this.collapsed)return K(this).createDocumentFragment();if(this.startContainer===this.endContainer&&Ce(this.startContainer))return x=this.startContainer.cloneNode(!0),x.data=x.data.slice(this.startOffset,this.endOffset),k=K(this).createDocumentFragment(),k.appendChild(x),k;var V=new xt(this,!0);return x=Ke(V),V.detach(),x},canSurroundContents:function(){_t(this),zn(this.startContainer),zn(this.endContainer);var x=new xt(this,!0),k=x._first&&Q(x._first,this)||x._last&&Q(x._last,this);return x.detach(),!k},surroundContents:function(x){if(Ct(x,nn),!this.canSurroundContents())throw new Se("INVALID_STATE_ERR");var k=this.extractContents();if(x.hasChildNodes())for(;x.lastChild;)x.removeChild(x.lastChild);de(x,this.startContainer,this.startOffset),x.appendChild(k),this.selectNode(x)},cloneRange:function(){_t(this);for(var x=new $t(K(this)),k=Qo.length,V;k--;)V=Qo[k],x[V]=this[V];return x},toString:function(){_t(this);var x=this.startContainer;if(x===this.endContainer&&Ce(x))return x.nodeType==3||x.nodeType==4?x.data.slice(this.startOffset,this.endOffset):"";var k=[],V=new xt(this,!0);return Qe(V,function(re){(re.nodeType==3||re.nodeType==4)&&k.push(re.data)}),V.detach(),k.join("")},compareNode:function(x){_t(this);var k=x.parentNode,V=ot(x);if(!k)throw new Se("NOT_FOUND_ERR");var re=this.comparePoint(k,V),Ae=this.comparePoint(k,V+1);return re<0?Ae>0?hs:to:Ae>0?cs:ea},comparePoint:function(x,k){return _t(this),_n(x,"HIERARCHY_REQUEST_ERR"),Sr(x,this.startContainer),lt(x,k,this.startContainer,this.startOffset)<0?-1:lt(x,k,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:fs,toHtml:function(){return ze(this)},intersectsNode:function(x,k){if(_t(this),P(x)!=J(this))return!1;var V=x.parentNode,re=ot(x);if(!V)return!0;var Ae=lt(V,re,this.endContainer,this.endOffset),et=lt(V,re+1,this.startContainer,this.startOffset);return k?Ae<=0&&et>=0:Ae<0&&et>0},isPointInRange:function(x,k){return _t(this),_n(x,"HIERARCHY_REQUEST_ERR"),Sr(x,this.startContainer),lt(x,k,this.startContainer,this.startOffset)>=0&<(x,k,this.endContainer,this.endOffset)<=0},intersectsRange:function(x){return rt(this,x,!1)},intersectsOrTouchesRange:function(x){return rt(this,x,!0)},intersection:function(x){if(this.intersectsRange(x)){var k=lt(this.startContainer,this.startOffset,x.startContainer,x.startOffset),V=lt(this.endContainer,this.endOffset,x.endContainer,x.endOffset),re=this.cloneRange();return k==-1&&re.setStart(x.startContainer,x.startOffset),V==1&&re.setEnd(x.endContainer,x.endOffset),re}return null},union:function(x){if(this.intersectsOrTouchesRange(x)){var k=this.cloneRange();return lt(x.startContainer,x.startOffset,this.startContainer,this.startOffset)==-1&&k.setStart(x.startContainer,x.startOffset),lt(x.endContainer,x.endOffset,this.endContainer,this.endOffset)==1&&k.setEnd(x.endContainer,x.endOffset),k}else throw new Se("Ranges do not intersect")},containsNode:function(x,k){return k?this.intersectsNode(x,!1):this.compareNode(x)==ea},containsNodeContents:function(x){return this.comparePoint(x,0)>=0&&this.comparePoint(x,w(x))<=0},containsRange:function(x){var k=this.intersection(x);return k!==null&&x.equals(k)},containsNodeText:function(x){var k=this.cloneRange();k.selectNode(x);var V=k.getNodes([3]);if(V.length>0){k.setStart(V[0],0);var re=V.pop();return k.setEnd(re,re.length),this.containsRange(k)}else return this.containsNodeContents(x)},getNodes:function(x,k){return _t(this),Oe(this,x,k)},getDocument:function(){return K(this)},collapseBefore:function(x){this.setEndBefore(x),this.collapse(!1)},collapseAfter:function(x){this.setStartAfter(x),this.collapse(!0)},getBookmark:function(x){var k=K(this),V=R.createRange(k);x=x||G.getBody(k),V.selectNodeContents(x);var re=this.intersection(V),Ae=0,et=0;return re&&(V.setEnd(re.startContainer,re.startOffset),Ae=V.toString().length,et=Ae+re.toString().length),{start:Ae,end:et,containerNode:x}},moveToBookmark:function(x){var k=x.containerNode,V=0;this.setStart(k,0),this.collapse(!0);for(var re=[k],Ae,et=!1,ee=!1,be,De,qe;!ee&&(Ae=re.pop());)if(Ae.nodeType==3)be=V+Ae.length,!et&&x.start>=V&&x.start<=be&&(this.setStart(Ae,x.start-V),et=!0),et&&x.end>=V&&x.end<=be&&(this.setEnd(Ae,x.end-V),ee=!0),V=be;else for(qe=Ae.childNodes,De=qe.length;De--;)re.push(qe[De])},getName:function(){return"DomRange"},equals:function(x){return $t.rangesEqual(this,x)},isValid:function(){return Ji(this)},inspect:function(){return ut(this)},detach:function(){}});function b(x){x.START_TO_START=Jo,x.START_TO_END=eo,x.END_TO_END=$u,x.END_TO_START=Mi,x.NODE_BEFORE=to,x.NODE_AFTER=cs,x.NODE_BEFORE_AND_AFTER=hs,x.NODE_INSIDE=ea}function j(x){b(x),b(x.prototype)}function q(x,k){return function(){_t(this);var V=this.startContainer,re=this.startOffset,Ae=this.commonAncestorContainer,et=new xt(this,!0),ee,be;V!==Ae&&(ee=Jt(V,Ae,!0),be=xe(ee),V=be.node,re=be.offset),Qe(et,zn),et.reset();var De=x(et);return et.detach(),k(this,V,re,V,re),De}}function pe(x,k){function V(ee,be){return function(De){Ct(De,Ft),Ct(P(De),Hn);var qe=(ee?Pe:xe)(De);(be?re:Ae)(this,qe.node,qe.offset)}}function re(ee,be,De){var qe=ee.endContainer,bn=ee.endOffset;(be!==ee.startContainer||De!==ee.startOffset)&&((P(be)!=P(qe)||lt(be,De,qe,bn)==1)&&(qe=be,bn=De),k(ee,be,De,qe,bn))}function Ae(ee,be,De){var qe=ee.startContainer,bn=ee.startOffset;(be!==ee.endContainer||De!==ee.endOffset)&&((P(be)!=P(qe)||lt(be,De,qe,bn)==-1)&&(qe=be,bn=De),k(ee,qe,bn,be,De))}var et=function(){};et.prototype=R.rangePrototype,x.prototype=new et,te.extend(x.prototype,{setStart:function(ee,be){Te(ee,!0),vt(ee,be),re(this,ee,be)},setEnd:function(ee,be){Te(ee,!0),vt(ee,be),Ae(this,ee,be)},setStartAndEnd:function(){var ee=arguments,be=ee[0],De=ee[1],qe=be,bn=De;switch(ee.length){case 3:bn=ee[2];break;case 4:qe=ee[2],bn=ee[3];break}Te(be,!0),vt(be,De),Te(qe,!0),vt(qe,bn),k(this,be,De,qe,bn)},setBoundary:function(ee,be,De){this["set"+(De?"Start":"End")](ee,be)},setStartBefore:V(!0,!0),setStartAfter:V(!1,!0),setEndBefore:V(!0,!1),setEndAfter:V(!1,!1),collapse:function(ee){_t(this),ee?k(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):k(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(ee){Te(ee,!0),k(this,ee,0,ee,w(ee))},selectNode:function(ee){Te(ee,!1),Ct(ee,Ft);var be=Pe(ee),De=xe(ee);k(this,be.node,be.offset,De.node,De.offset)},extractContents:q(he,k),deleteContents:q(en,k),canSurroundContents:function(){_t(this),zn(this.startContainer),zn(this.endContainer);var ee=new xt(this,!0),be=ee._first&&Q(ee._first,this)||ee._last&&Q(ee._last,this);return ee.detach(),!be},splitBoundaries:function(){Zo(this)},splitBoundariesPreservingPositions:function(ee){Zo(this,ee)},normalizeBoundaries:function(){_t(this);var ee=this.startContainer,be=this.startOffset,De=this.endContainer,qe=this.endOffset,bn=function(Tn){var zr=Tn.nextSibling;zr&&zr.nodeType==Tn.nodeType&&(De=Tn,qe=Tn.length,Tn.appendData(zr.data),I(zr))},ab=function(Tn){var zr=Tn.previousSibling;if(zr&&zr.nodeType==Tn.nodeType){ee=Tn;var H5=Tn.length;if(be=zr.length,Tn.insertData(0,zr.data),I(zr),ee==De)qe+=be,De=ee;else if(De==Tn.parentNode){var sb=ot(Tn);qe==sb?(De=Tn,qe=H5):qe>sb&&qe--}}},sh=!0,rr;if(Ce(De))qe==De.length?bn(De):qe==0&&(rr=De.previousSibling,rr&&rr.nodeType==De.nodeType&&(qe=rr.length,ee==De&&(sh=!1),rr.appendData(De.data),I(De),De=rr));else{if(qe>0){var lh=De.childNodes[qe-1];lh&&Ce(lh)&&bn(lh)}sh=!this.collapsed}if(sh){if(Ce(ee))be==0?ab(ee):be==ee.length&&(rr=ee.nextSibling,rr&&rr.nodeType==ee.nodeType&&(De==rr&&(De=ee,qe+=ee.length),ee.appendData(rr.data),I(rr)));else if(be<ee.childNodes.length){var uh=ee.childNodes[be];uh&&Ce(uh)&&ab(uh)}}else ee=De,be=qe;k(this,ee,be,De,qe)},collapseToPoint:function(ee,be){Te(ee,!0),vt(ee,be),this.setStartAndEnd(ee,be)},parentElement:function(){_t(this);var ee=this.commonAncestorContainer;return ee?$e(this.commonAncestorContainer,!0):null}}),j(x)}function Le(x){x.collapsed=x.startContainer===x.endContainer&&x.startOffset===x.endOffset,x.commonAncestorContainer=x.collapsed?x.startContainer:G.getCommonAncestor(x.startContainer,x.endContainer)}function dt(x,k,V,re,Ae){x.startContainer=k,x.startOffset=V,x.endContainer=re,x.endOffset=Ae,x.document=G.getDocument(k),Le(x)}function $t(x){dt(this,x,0,x,0)}pe($t,dt),te.extend($t,{rangeProperties:Qo,RangeIterator:xt,copyComparisonConstants:j,createPrototypeRange:pe,inspect:ut,toHtml:ze,getRangeDocument:K,rangesEqual:function(x,k){return x.startContainer===k.startContainer&&x.startOffset===k.startOffset&&x.endContainer===k.endContainer&&x.endOffset===k.endOffset}}),R.DomRange=$t}),A.createCoreModule("WrappedRange",["DomRange"],function(R,W){var G,te,oe=R.dom,Se=R.util,Ce=oe.DomPosition,ot=R.DomRange,pt=oe.getBody,kt=oe.getContentDocument,lt=oe.isCharacterDataNode;if(R.features.implementsDomRange&&(function(){var I,Q=ot.rangeProperties;function K(he){for(var Oe=Q.length,ut;Oe--;)ut=Q[Oe],he[ut]=he.nativeRange[ut];he.collapsed=he.startContainer===he.endContainer&&he.startOffset===he.endOffset}function J(he,Oe,ut,xt,Ft){var Hn=he.startContainer!==Oe||he.startOffset!=ut,mn=he.endContainer!==xt||he.endOffset!=Ft,tn=!he.equals(he.nativeRange);(Hn||mn||tn)&&(he.setEnd(xt,Ft),he.setStart(Oe,ut))}var Pe;G=function(he){if(!he)throw W.createError("WrappedRange: Range must be specified");this.nativeRange=he,K(this)},ot.createPrototypeRange(G,J),I=G.prototype,I.selectNode=function(he){this.nativeRange.selectNode(he),K(this)},I.cloneContents=function(){return this.nativeRange.cloneContents()},I.surroundContents=function(he){this.nativeRange.surroundContents(he),K(this)},I.collapse=function(he){this.nativeRange.collapse(he),K(this)},I.cloneRange=function(){return new G(this.nativeRange.cloneRange())},I.refresh=function(){K(this)},I.toString=function(){return this.nativeRange.toString()};var xe=document.createTextNode("test");pt(document).appendChild(xe);var de=document.createRange();de.setStart(xe,0),de.setEnd(xe,0);try{de.setStart(xe,1),I.setStart=function(he,Oe){this.nativeRange.setStart(he,Oe),K(this)},I.setEnd=function(he,Oe){this.nativeRange.setEnd(he,Oe),K(this)},Pe=function(he){return function(Oe){this.nativeRange[he](Oe),K(this)}}}catch{I.setStart=function(Oe,ut){try{this.nativeRange.setStart(Oe,ut)}catch{this.nativeRange.setEnd(Oe,ut),this.nativeRange.setStart(Oe,ut)}K(this)},I.setEnd=function(Oe,ut){try{this.nativeRange.setEnd(Oe,ut)}catch{this.nativeRange.setStart(Oe,ut),this.nativeRange.setEnd(Oe,ut)}K(this)},Pe=function(Oe,ut){return function(xt){try{this.nativeRange[Oe](xt)}catch{this.nativeRange[ut](xt),this.nativeRange[Oe](xt)}K(this)}}}I.setStartBefore=Pe("setStartBefore","setEndBefore"),I.setStartAfter=Pe("setStartAfter","setEndAfter"),I.setEndBefore=Pe("setEndBefore","setStartBefore"),I.setEndAfter=Pe("setEndAfter","setStartAfter"),I.selectNodeContents=function(he){this.setStartAndEnd(he,0,oe.getNodeLength(he))},de.selectNodeContents(xe),de.setEnd(xe,3);var rt=document.createRange();rt.selectNodeContents(xe),rt.setEnd(xe,4),rt.setStart(xe,2),de.compareBoundaryPoints(de.START_TO_END,rt)==-1&&de.compareBoundaryPoints(de.END_TO_START,rt)==1?I.compareBoundaryPoints=function(he,Oe){return Oe=Oe.nativeRange||Oe,he==Oe.START_TO_END?he=Oe.END_TO_START:he==Oe.END_TO_START&&(he=Oe.START_TO_END),this.nativeRange.compareBoundaryPoints(he,Oe)}:I.compareBoundaryPoints=function(he,Oe){return this.nativeRange.compareBoundaryPoints(he,Oe.nativeRange||Oe)};var Ke=document.createElement("div");Ke.innerHTML="123";var Qe=Ke.firstChild,en=pt(document);en.appendChild(Ke),de.setStart(Qe,1),de.setEnd(Qe,2),de.deleteContents(),Qe.data=="13"&&(I.deleteContents=function(){this.nativeRange.deleteContents(),K(this)},I.extractContents=function(){var he=this.nativeRange.extractContents();return K(this),he}),en.removeChild(Ke),en=null,Se.isHostMethod(de,"createContextualFragment")&&(I.createContextualFragment=function(he){return this.nativeRange.createContextualFragment(he)}),pt(document).removeChild(xe),I.getName=function(){return"WrappedRange"},R.WrappedRange=G,R.createNativeRange=function(he){return he=kt(he,W,"createNativeRange"),he.createRange()}})(),R.features.implementsTextRange){var Gt=function(I){var Q=I.parentElement(),K=I.duplicate();K.collapse(!0);var J=K.parentElement();K=I.duplicate(),K.collapse(!1);var Pe=K.parentElement(),xe=J==Pe?J:oe.getCommonAncestor(J,Pe);return xe==Q?xe:oe.getCommonAncestor(Q,xe)},Jt=function(I){return I.compareEndPoints("StartToEnd",I)==0},w=function(I,Q,K,J,Pe){var xe=I.duplicate();xe.collapse(K);var de=xe.parentElement();if(oe.isOrIsAncestorOf(Q,de)||(de=Q),!de.canHaveHTML){var rt=new Ce(de.parentNode,oe.getNodeIndex(de));return{boundaryPosition:rt,nodeInfo:{nodeIndex:rt.offset,containerElement:rt.node}}}var Ke=oe.getDocument(de).createElement("span");Ke.parentNode&&oe.removeNode(Ke);for(var Qe,en=K?"StartToStart":"StartToEnd",he,Oe,ut,xt,Ft=Pe&&Pe.containerElement==de?Pe.nodeIndex:0,Hn=de.childNodes.length,mn=Hn,tn=mn;tn==Hn?de.appendChild(Ke):de.insertBefore(Ke,de.childNodes[tn]),xe.moveToElementText(Ke),Qe=xe.compareEndPoints(en,I),!(Qe==0||Ft==mn);){if(Qe==-1){if(mn==Ft+1)break;Ft=tn}else mn=mn==Ft+1?Ft:tn;tn=Math.floor((Ft+mn)/2),de.removeChild(Ke)}if(xt=Ke.nextSibling,Qe==-1&&xt&<(xt)){xe.setEndPoint(K?"EndToStart":"EndToEnd",I);var nn;if(/[\r\n]/.test(xt.data)){var un=xe.duplicate(),Cn=un.text.replace(/\r\n/g,"\r").length;for(nn=un.moveStart("character",Cn);(Qe=un.compareEndPoints("StartToEnd",un))==-1;)nn++,un.moveStart("character",1)}else nn=xe.text.length;ut=new Ce(xt,nn)}else he=(J||!K)&&Ke.previousSibling,Oe=(J||K)&&Ke.nextSibling,Oe&<(Oe)?ut=new Ce(Oe,0):he&<(he)?ut=new Ce(he,he.data.length):ut=new Ce(de,oe.getNodeIndex(Ke));return oe.removeNode(Ke),{boundaryPosition:ut,nodeInfo:{nodeIndex:tn,containerElement:de}}},M=function(I,Q){var K,J,Pe=I.offset,xe=oe.getDocument(I.node),de,rt,Ke=pt(xe).createTextRange(),Qe=lt(I.node);return Qe?(K=I.node,J=K.parentNode):(rt=I.node.childNodes,K=Pe<rt.length?rt[Pe]:null,J=I.node),de=xe.createElement("span"),de.innerHTML="&#feff;",K?J.insertBefore(de,K):J.appendChild(de),Ke.moveToElementText(de),Ke.collapse(!Q),J.removeChild(de),Qe&&Ke[Q?"moveStart":"moveEnd"]("character",Pe),Ke};te=function(I){this.textRange=I,this.refresh()},te.prototype=new ot(document),te.prototype.refresh=function(){var I,Q,K,J=Gt(this.textRange);Jt(this.textRange)?Q=I=w(this.textRange,J,!0,!0).boundaryPosition:(K=w(this.textRange,J,!0,!1),I=K.boundaryPosition,Q=w(this.textRange,J,!1,!1,K.nodeInfo).boundaryPosition),this.setStart(I.node,I.offset),this.setEnd(Q.node,Q.offset)},te.prototype.getName=function(){return"WrappedTextRange"},ot.copyComparisonConstants(te);var P=function(I){if(I.collapsed)return M(new Ce(I.startContainer,I.startOffset),!0);var Q=M(new Ce(I.startContainer,I.startOffset),!0),K=M(new Ce(I.endContainer,I.endOffset),!1),J=pt(ot.getRangeDocument(I)).createTextRange();return J.setEndPoint("StartToStart",Q),J.setEndPoint("EndToEnd",K),J};if(te.rangeToTextRange=P,te.prototype.toTextRange=function(){return P(this)},R.WrappedTextRange=te,!R.features.implementsDomRange||R.config.preferTextRange){var U=(function(I){return I("return this;")()})(Function);typeof U.Range>"u"&&(U.Range=te),R.createNativeRange=function(I){return I=kt(I,W,"createNativeRange"),pt(I).createTextRange()},R.WrappedRange=te}}R.createRange=function(I){return I=kt(I,W,"createRange"),new R.WrappedRange(R.createNativeRange(I))},R.createRangyRange=function(I){return I=kt(I,W,"createRangyRange"),new ot(I)},Se.createAliasForDeprecatedMethod(R,"createIframeRange","createRange"),Se.createAliasForDeprecatedMethod(R,"createIframeRangyRange","createRangyRange"),R.addShimListener(function(I){var Q=I.document;typeof Q.createRange>"u"&&(Q.createRange=function(){return R.createRange(Q)}),Q=I=null})}),A.createCoreModule("WrappedSelection",["DomRange","WrappedRange"],function(R,W){R.config.checkSelectionRanges=!0;var G="boolean",te="number",oe=R.dom,Se=R.util,Ce=Se.isHostMethod,ot=R.DomRange,pt=R.WrappedRange,kt=R.DOMException,lt=oe.DomPosition,Gt,Jt,w=R.features,M="Control",P=oe.getDocument,U=oe.getBody,I=ot.rangesEqual;function Q(b){return typeof b=="string"?/^backward(s)?$/i.test(b):!!b}function K(b,j){if(b){if(oe.isWindow(b))return b;if(b instanceof _t)return b.win;var q=oe.getContentDocument(b,W,j);return oe.getWindow(q)}else return window}function J(b){return K(b,"getWinSelection").getSelection()}function Pe(b){return K(b,"getDocSelection").document.selection}function xe(b){var j=!1;return b.anchorNode&&(j=oe.comparePoints(b.anchorNode,b.anchorOffset,b.focusNode,b.focusOffset)==1),j}var de=Ce(window,"getSelection"),rt=Se.isHostObject(document,"selection");w.implementsWinGetSelection=de,w.implementsDocSelection=rt;var Ke=rt&&(!de||R.config.preferTextRange);if(Ke)Gt=Pe,R.isSelectionValid=function(b){var j=K(b,"isSelectionValid").document,q=j.selection;return q.type!="None"||P(q.createRange().parentElement())==j};else if(de)Gt=J,R.isSelectionValid=function(){return!0};else return W.fail("Neither document.selection or window.getSelection() detected."),!1;R.getNativeSelection=Gt;var Qe=Gt();if(!Qe)return W.fail("Native selection was null (possibly issue 138?)"),!1;var en=R.createNativeRange(document),he=U(document),Oe=Se.areHostProperties(Qe,["anchorNode","focusNode","anchorOffset","focusOffset"]);w.selectionHasAnchorAndFocus=Oe;var ut=Ce(Qe,"extend");w.selectionHasExtend=ut;var xt=Ce(Qe,"setBaseAndExtent");w.selectionHasSetBaseAndExtent=xt;var Ft=typeof Qe.rangeCount==te;w.selectionHasRangeCount=Ft;var Hn=!1,mn=!0,tn=ut?function(b,j){var q=ot.getRangeDocument(j),pe=R.createRange(q);pe.collapseToPoint(j.endContainer,j.endOffset),b.addRange(Te(pe)),b.extend(j.startContainer,j.startOffset)}:null;Se.areHostMethods(Qe,["addRange","getRangeAt","removeAllRanges"])&&typeof Qe.rangeCount==te&&w.implementsDomRange&&(function(){var b=window.getSelection();if(b){for(var j=b.rangeCount,q=j>1,pe=[],Le=xe(b),dt=0;dt<j;++dt)pe[dt]=b.getRangeAt(dt);var $t=oe.createTestElement(document,"",!1),x=$t.appendChild(document.createTextNode(" ")),k=document.createRange();if(k.setStart(x,1),k.collapse(!0),b.removeAllRanges(),b.addRange(k),mn=b.rangeCount==1,b.removeAllRanges(),!q){var V=window.navigator.appVersion.match(/Chrome\/(.*?) /);if(V&&parseInt(V[1])>=36)Hn=!1;else{var re=k.cloneRange();k.setStart(x,0),re.setEnd(x,3),re.setStart(x,2),b.addRange(k),b.addRange(re),Hn=b.rangeCount==2}}for(oe.removeNode($t),b.removeAllRanges(),dt=0;dt<j;++dt)dt==0&&Le?tn?tn(b,pe[dt]):(R.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend"),b.addRange(pe[dt])):b.addRange(pe[dt])}})(),w.selectionSupportsMultipleRanges=Hn,w.collapsedNonEditableSelectionsSupported=mn;var nn=!1,un;he&&Ce(he,"createControlRange")&&(un=he.createControlRange(),Se.areHostProperties(un,["item","add"])&&(nn=!0)),w.implementsControlRange=nn,Oe?Jt=function(b){return b.anchorNode===b.focusNode&&b.anchorOffset===b.focusOffset}:Jt=function(b){return b.rangeCount?b.getRangeAt(b.rangeCount-1).collapsed:!1};function Cn(b,j,q){var pe=q?"end":"start",Le=q?"start":"end";b.anchorNode=j[pe+"Container"],b.anchorOffset=j[pe+"Offset"],b.focusNode=j[Le+"Container"],b.focusOffset=j[Le+"Offset"]}function X(b){var j=b.nativeSelection;b.anchorNode=j.anchorNode,b.anchorOffset=j.anchorOffset,b.focusNode=j.focusNode,b.focusOffset=j.focusOffset}function ie(b){b.anchorNode=b.focusNode=null,b.anchorOffset=b.focusOffset=0,b.rangeCount=0,b.isCollapsed=!0,b._ranges.length=0,$e(b)}function $e(b){b.type=b.rangeCount==0?"None":Jt(b)?"Caret":"Range"}function Te(b){var j;return b instanceof ot?(j=R.createNativeRange(b.getDocument()),j.setEnd(b.endContainer,b.endOffset),j.setStart(b.startContainer,b.startOffset)):b instanceof pt?j=b.nativeRange:w.implementsDomRange&&b instanceof oe.getWindow(b.startContainer).Range&&(j=b),j}function Ct(b){if(!b.length||b[0].nodeType!=1)return!1;for(var j=1,q=b.length;j<q;++j)if(!oe.isAncestorOf(b[0],b[j]))return!1;return!0}function vt(b){var j=b.getNodes();if(!Ct(j))throw W.createError("getSingleElementFromRange: range "+b.inspect()+" did not consist of a single element");return j[0]}function Sr(b){return!!b&&typeof b.text<"u"}function zn(b,j){var q=new pt(j);b._ranges=[q],Cn(b,q,!1),b.rangeCount=1,b.isCollapsed=q.collapsed,$e(b)}function _n(b){if(b._ranges.length=0,b.docSelection.type=="None")ie(b);else{var j=b.docSelection.createRange();if(Sr(j))zn(b,j);else{b.rangeCount=j.length;for(var q,pe=P(j.item(0)),Le=0;Le<b.rangeCount;++Le)q=R.createRange(pe),q.selectNode(j.item(Le)),b._ranges.push(q);b.isCollapsed=b.rangeCount==1&&b._ranges[0].collapsed,Cn(b,b._ranges[b.rangeCount-1],!1),$e(b)}}}function us(b,j){for(var q=b.docSelection.createRange(),pe=vt(j),Le=P(q.item(0)),dt=U(Le).createControlRange(),$t=0,x=q.length;$t<x;++$t)dt.add(q.item($t));try{dt.add(pe)}catch{throw W.createError("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}dt.select(),_n(b)}var Ji;Ce(Qe,"getRangeAt")?Ji=function(b,j){try{return b.getRangeAt(j)}catch{return null}}:Oe&&(Ji=function(b){var j=P(b.anchorNode),q=R.createRange(j);return q.setStartAndEnd(b.anchorNode,b.anchorOffset,b.focusNode,b.focusOffset),q.collapsed!==this.isCollapsed&&q.setStartAndEnd(b.focusNode,b.focusOffset,b.anchorNode,b.anchorOffset),q});function _t(b,j,q){this.nativeSelection=b,this.docSelection=j,this._ranges=[],this.win=q,this.refresh()}_t.prototype=R.selectionPrototype;function ds(b){b.win=b.anchorNode=b.focusNode=b._ranges=null,b.rangeCount=b.anchorOffset=b.focusOffset=0,b.detached=!0,$e(b)}var ni=[];function fs(b,j){for(var q=ni.length,pe,Le;q--;)if(pe=ni[q],Le=pe.selection,j=="deleteAll")ds(Le);else if(pe.win==b)return j=="delete"?(ni.splice(q,1),!0):Le;return j=="deleteAll"&&(ni.length=0),null}var Zo=function(b){if(b&&b instanceof _t)return b.refresh(),b;b=K(b,"getNativeSelection");var j=fs(b),q=Gt(b),pe=rt?Pe(b):null;return j?(j.nativeSelection=q,j.docSelection=pe,j.refresh()):(j=new _t(q,pe,b),ni.push({win:b,selection:j})),j};R.getSelection=Zo,Se.createAliasForDeprecatedMethod(R,"getIframeSelection","getSelection");var ze=_t.prototype;function Qo(b,j){for(var q=P(j[0].startContainer),pe=U(q).createControlRange(),Le=0,dt,$t=j.length;Le<$t;++Le){dt=vt(j[Le]);try{pe.add(dt)}catch{throw W.createError("setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)")}}pe.select(),_n(b)}if(!Ke&&Oe&&Se.areHostMethods(Qe,["removeAllRanges","addRange"])){ze.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),ie(this)};var Jo=function(b,j){tn(b.nativeSelection,j),b.refresh()};Ft?ze.addRange=function(b,j){if(nn&&rt&&this.docSelection.type==M)us(this,b);else if(Q(j)&&ut)Jo(this,b);else{var q;Hn?q=this.rangeCount:(this.removeAllRanges(),q=0);var pe=Te(b).cloneRange();try{this.nativeSelection.addRange(pe)}catch{}if(this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==q+1){if(R.config.checkSelectionRanges){var Le=Ji(this.nativeSelection,this.rangeCount-1);Le&&!I(Le,b)&&(b=new pt(Le))}this._ranges[this.rangeCount-1]=b,Cn(this,b,Mi(this.nativeSelection)),this.isCollapsed=Jt(this),$e(this)}else this.refresh()}}:ze.addRange=function(b,j){Q(j)&&ut?Jo(this,b):(this.nativeSelection.addRange(Te(b)),this.refresh())},ze.setRanges=function(b){if(nn&&rt&&b.length>1)Qo(this,b);else{this.removeAllRanges();for(var j=0,q=b.length;j<q;++j)this.addRange(b[j])}}}else if(Ce(Qe,"empty")&&Ce(en,"select")&&nn&&Ke)ze.removeAllRanges=function(){try{if(this.docSelection.empty(),this.docSelection.type!="None"){var b;if(this.anchorNode)b=P(this.anchorNode);else if(this.docSelection.type==M){var j=this.docSelection.createRange();j.length&&(b=P(j.item(0)))}if(b){var q=U(b).createTextRange();q.select(),this.docSelection.empty()}}}catch{}ie(this)},ze.addRange=function(b){this.docSelection.type==M?us(this,b):(R.WrappedTextRange.rangeToTextRange(b).select(),this._ranges[0]=b,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,Cn(this,b,!1),$e(this))},ze.setRanges=function(b){this.removeAllRanges();var j=b.length;j>1?Qo(this,b):j&&this.addRange(b[0])};else return W.fail("No means of selecting a Range or TextRange was found"),!1;ze.getRangeAt=function(b){if(b<0||b>=this.rangeCount)throw new kt("INDEX_SIZE_ERR");return this._ranges[b].cloneRange()};var eo;if(Ke)eo=function(b){var j;R.isSelectionValid(b.win)?j=b.docSelection.createRange():(j=U(b.win.document).createTextRange(),j.collapse(!0)),b.docSelection.type==M?_n(b):Sr(j)?zn(b,j):ie(b)};else if(Ce(Qe,"getRangeAt")&&typeof Qe.rangeCount==te)eo=function(b){if(nn&&rt&&b.docSelection.type==M)_n(b);else if(b._ranges.length=b.rangeCount=b.nativeSelection.rangeCount,b.rangeCount){for(var j=0,q=b.rangeCount;j<q;++j)b._ranges[j]=new R.WrappedRange(b.nativeSelection.getRangeAt(j));Cn(b,b._ranges[b.rangeCount-1],Mi(b.nativeSelection)),b.isCollapsed=Jt(b),$e(b)}else ie(b)};else if(Oe&&typeof Qe.isCollapsed==G&&typeof en.collapsed==G&&w.implementsDomRange)eo=function(b){var j,q=b.nativeSelection;q.anchorNode?(j=Ji(q,0),b._ranges=[j],b.rangeCount=1,X(b),b.isCollapsed=Jt(b),$e(b)):ie(b)};else return W.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;ze.refresh=function(b){var j=b?this._ranges.slice(0):null,q=this.anchorNode,pe=this.anchorOffset;if(eo(this),b){var Le=j.length;if(Le!=this._ranges.length||this.anchorNode!=q||this.anchorOffset!=pe)return!0;for(;Le--;)if(!I(j[Le],this._ranges[Le]))return!0;return!1}};var $u=function(b,j){var q=b.getAllRanges();b.removeAllRanges();for(var pe=0,Le=q.length;pe<Le;++pe)I(j,q[pe])||b.addRange(q[pe]);b.rangeCount||ie(b)};nn&&rt?ze.removeRange=function(b){if(this.docSelection.type==M){for(var j=this.docSelection.createRange(),q=vt(b),pe=P(j.item(0)),Le=U(pe).createControlRange(),dt,$t=!1,x=0,k=j.length;x<k;++x)dt=j.item(x),dt!==q||$t?Le.add(j.item(x)):$t=!0;Le.select(),_n(this)}else $u(this,b)}:ze.removeRange=function(b){$u(this,b)};var Mi;!Ke&&Oe&&w.implementsDomRange?(Mi=xe,ze.isBackward=function(){return Mi(this)}):Mi=ze.isBackward=function(){return!1},ze.isBackwards=ze.isBackward,ze.toString=function(){for(var b=[],j=0,q=this.rangeCount;j<q;++j)b[j]=""+this._ranges[j];return b.join("")};function to(b,j){if(b.win.document!=P(j))throw new kt("WRONG_DOCUMENT_ERR")}function cs(b,j){if(j<0||j>(oe.isCharacterDataNode(b)?b.length:b.childNodes.length))throw new kt("INDEX_SIZE_ERR")}ze.collapse=function(b,j){to(this,b);var q=R.createRange(b);q.collapseToPoint(b,j),this.setSingleRange(q),this.isCollapsed=!0},ze.collapseToStart=function(){if(this.rangeCount){var b=this._ranges[0];this.collapse(b.startContainer,b.startOffset)}else throw new kt("INVALID_STATE_ERR")},ze.collapseToEnd=function(){if(this.rangeCount){var b=this._ranges[this.rangeCount-1];this.collapse(b.endContainer,b.endOffset)}else throw new kt("INVALID_STATE_ERR")},ze.selectAllChildren=function(b){to(this,b);var j=R.createRange(b);j.selectNodeContents(b),this.setSingleRange(j)},xt?ze.setBaseAndExtent=function(b,j,q,pe){this.nativeSelection.setBaseAndExtent(b,j,q,pe),this.refresh()}:ut&&(ze.setBaseAndExtent=function(b,j,q,pe){cs(b,j),cs(q,pe),to(this,b),to(this,q);var Le=R.createRange(node),dt=oe.comparePoints(b,j,q,pe)==-1;dt?Le.setStartAndEnd(q,pe,b,j):Le.setStartAndEnd(b,j,q,pe),this.setSingleRange(Le,dt)}),ze.deleteFromDocument=function(){if(nn&&rt&&this.docSelection.type==M){for(var b=this.docSelection.createRange(),j;b.length;)j=b.item(0),b.remove(j),oe.removeNode(j);this.refresh()}else if(this.rangeCount){var q=this.getAllRanges();if(q.length){this.removeAllRanges();for(var pe=0,Le=q.length;pe<Le;++pe)q[pe].deleteContents();this.addRange(q[Le-1])}}},ze.eachRange=function(b,j){for(var q=0,pe=this._ranges.length;q<pe;++q)if(b(this.getRangeAt(q)))return j},ze.getAllRanges=function(){var b=[];return this.eachRange(function(j){b.push(j)}),b},ze.setSingleRange=function(b,j){this.removeAllRanges(),this.addRange(b,j)},ze.callMethodOnEachRange=function(b,j){var q=[];return this.eachRange(function(pe){q.push(pe[b].apply(pe,j||[]))}),q};function hs(b){return function(j,q){var pe;this.rangeCount?(pe=this.getRangeAt(0),pe["set"+(b?"Start":"End")](j,q)):(pe=R.createRange(this.win.document),pe.setStartAndEnd(j,q)),this.setSingleRange(pe,this.isBackward())}}ze.setStart=hs(!0),ze.setEnd=hs(!1),R.rangePrototype.select=function(b){Zo(this.getDocument()).setSingleRange(this,b)},ze.changeEachRange=function(b){var j=[],q=this.isBackward();this.eachRange(function(pe){b(pe),j.push(pe)}),this.removeAllRanges(),q&&j.length==1?this.addRange(j[0],"backward"):this.setRanges(j)},ze.containsNode=function(b,j){return this.eachRange(function(q){return q.containsNode(b,j)},!0)||!1},ze.getBookmark=function(b){return{backward:this.isBackward(),rangeBookmarks:this.callMethodOnEachRange("getBookmark",[b])}},ze.moveToBookmark=function(b){for(var j=[],q=0,pe,Le;pe=b.rangeBookmarks[q++];)Le=R.createRange(this.win),Le.moveToBookmark(pe),j.push(Le);b.backward?this.setSingleRange(j[0],"backward"):this.setRanges(j)},ze.saveRanges=function(){return{backward:this.isBackward(),ranges:this.callMethodOnEachRange("cloneRange")}},ze.restoreRanges=function(b){this.removeAllRanges();for(var j=0,q;q=b.ranges[j];++j)this.addRange(q,b.backward&&j==0)},ze.toHtml=function(){var b=[];return this.eachRange(function(j){b.push(ot.toHtml(j))}),b.join("")},w.implementsTextRange&&(ze.getNativeTextRange=function(){var b;if(b=this.docSelection){var j=b.createRange();if(Sr(j))return j;throw W.createError("getNativeTextRange: selection is a control selection")}else{if(this.rangeCount>0)return R.WrappedTextRange.rangeToTextRange(this.getRangeAt(0));throw W.createError("getNativeTextRange: selection contains no range")}});function ea(b){var j=[],q=new lt(b.anchorNode,b.anchorOffset),pe=new lt(b.focusNode,b.focusOffset),Le=typeof b.getName=="function"?b.getName():"Selection";if(typeof b.rangeCount<"u")for(var dt=0,$t=b.rangeCount;dt<$t;++dt)j[dt]=ot.inspect(b.getRangeAt(dt));return"["+Le+"(Ranges: "+j.join(", ")+")(anchor: "+q.inspect()+", focus: "+pe.inspect()+"]"}ze.getName=function(){return"WrappedSelection"},ze.inspect=function(){return ea(this)},ze.detach=function(){fs(this.win,"delete"),ds(this)},_t.detachAll=function(){fs(null,"deleteAll")},_t.inspect=ea,_t.isDirectionBackward=Q,R.Selection=_t,R.selectionPrototype=ze,R.addShimListener(function(b){typeof b.getSelection>"u"&&(b.getSelection=function(){return Zo(b)}),b=null})});var fe=!1,Fe=function(R){fe||(fe=!0,!A.initialized&&A.config.autoInitialize&&L())};return T&&(document.readyState=="complete"?Fe():(u(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",Fe,!1),me(window,"load",Fe))),A})})(Vc)),Vc.exports}var E5=F0();const $0=ps(E5);var Kc={exports:{}},H0;function w5(){return H0||(H0=1,(function(n,e){(function(t,r){n.exports=t(F0())})(function(t){return t.createModule("ClassApplier",["WrappedSelection"],function(r,i){var o=r.dom,a=o.DomPosition,s=o.arrayContains,l=r.util,u=l.forEach,d="span",f=l.isHostMethod(document,"createElementNS");function c(w,M){for(var P in w)if(w.hasOwnProperty(P)&&M(P,w[P])===!1)return!1;return!0}function h(w){return w.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function p(w,M){return!!w&&new RegExp("(?:^|\\s)"+M+"(?:\\s|$)").test(w)}function v(w,M){if(typeof w.classList=="object")return w.classList.contains(M);var P=typeof w.className=="string",U=P?w.className:w.getAttribute("class");return p(U,M)}function g(w,M){if(typeof w.classList=="object")w.classList.add(M);else{var P=typeof w.className=="string",U=P?w.className:w.getAttribute("class");U?p(U,M)||(U+=" "+M):U=M,P?w.className=U:w.setAttribute("class",U)}}var y=(function(){function w(M,P,U){return P&&U?" ":""}return function(M,P){if(typeof M.classList=="object")M.classList.remove(P);else{var U=typeof M.className=="string",I=U?M.className:M.getAttribute("class");I=I.replace(new RegExp("(^|\\s)"+P+"(\\s|$)"),w),U?M.className=I:M.setAttribute("class",I)}}})();function m(w){var M=typeof w.className=="string";return M?w.className:w.getAttribute("class")}function O(w){return w&&w.split(/\s+/).sort().join(" ")}function T(w){return O(m(w))}function C(w,M){return T(w)==T(M)}function A(w,M){for(var P=M.split(/\s+/),U=0,I=P.length;U<I;++U)if(!v(w,h(P[U])))return!1;return!0}function E(w){var M=w.parentNode;return M&&M.nodeType==1&&!/^(textarea|style|script|select|iframe)$/i.test(M.nodeName)}function N(w,M,P,U,I){var Q=w.node,K=w.offset,J=Q,Pe=K;Q==U&&K>I&&++Pe,Q==M&&(K==P||K==P+1)&&(J=U,Pe+=I-P),Q==M&&K>P+1&&--Pe,w.node=J,w.offset=Pe}function B(w,M,P){w.node==M&&w.offset>P&&--w.offset}function Z(w,M,P,U){P==-1&&(P=M.childNodes.length);var I=w.parentNode,Q=o.getNodeIndex(w);u(U,function(K){N(K,I,Q,M,P)}),M.childNodes.length==P?M.appendChild(w):M.insertBefore(w,M.childNodes[P])}function ue(w,M){var P=w.parentNode,U=o.getNodeIndex(w);u(M,function(I){B(I,P,U)}),o.removeNode(w)}function me(w,M,P,U,I){for(var Q,K=[];Q=w.firstChild;)Z(Q,M,P++,I),K.push(Q);return ue(w,I),K}function S(w,M){return me(w,w.parentNode,o.getNodeIndex(w),!0,M)}function D(w,M){var P=w.cloneRange();P.selectNodeContents(M);var U=P.intersection(w),I=U?U.toString():"";return I!=""}function L(w){for(var M=w.getNodes([3]),P=0,U;(U=M[P])&&!D(w,U);)++P;for(var I=M.length-1;(U=M[I])&&!D(w,U);)--I;return M.slice(P,I+1)}function Y(w,M){if(w.attributes.length!=M.attributes.length)return!1;for(var P=0,U=w.attributes.length,I,Q,K;P<U;++P)if(I=w.attributes[P],K=I.name,K!="class"&&(Q=M.attributes.getNamedItem(K),I===null!=(Q===null)||I.specified!=Q.specified||I.specified&&I.nodeValue!==Q.nodeValue))return!1;return!0}function se(w,M){for(var P=0,U=w.attributes.length,I;P<U;++P)if(I=w.attributes[P].name,!(M&&s(M,I))&&w.attributes[P].specified&&I!="class")return!0;return!1}var ce=o.getComputedStyleProperty,Ue=(function(){var w=document.createElement("div");return typeof w.isContentEditable=="boolean"?function(M){return M&&M.nodeType==1&&M.isContentEditable}:function(M){return!M||M.nodeType!=1||M.contentEditable=="false"?!1:M.contentEditable=="true"||Ue(M.parentNode)}})();function He(w){var M;return w&&w.nodeType==1&&((M=w.parentNode)&&M.nodeType==9&&M.designMode=="on"||Ue(w)&&!Ue(w.parentNode))}function F(w){return(Ue(w)||w.nodeType!=1&&Ue(w.parentNode))&&!He(w)}var ne=/^inline(-block|-table)?$/i;function _e(w){return w&&w.nodeType==1&&!ne.test(ce(w,"display"))}var fe=/[^\r\n\t\f \u200B]/;function Fe(w){if(w.data.length==0)return!0;if(fe.test(w.data))return!1;var M=ce(w.parentNode,"whiteSpace");switch(M){case"pre":case"pre-wrap":case"-moz-pre-wrap":return!1;case"pre-line":if(/[\r\n]/.test(w.data))return!1}return _e(w.previousSibling)||_e(w.nextSibling)}function R(w){var M=[],P,U;for(P=0;U=w[P++];)M.push(new a(U.startContainer,U.startOffset),new a(U.endContainer,U.endOffset));return M}function W(w,M){for(var P=0,U,I,Q,K=w.length;P<K;++P)U=w[P],I=M[P*2],Q=M[P*2+1],U.setStartAndEnd(I.node,I.offset,Q.node,Q.offset)}function G(w,M){return o.isCharacterDataNode(w)?M==0?!!w.previousSibling:M==w.length?!!w.nextSibling:!0:M>0&&M<w.childNodes.length}function te(w,M,P,U){var I,Q,K=P==0;if(o.isAncestorOf(M,w))return w;if(o.isCharacterDataNode(M)){var J=o.getNodeIndex(M);if(P==0)P=J;else if(P==M.length)P=J+1;else throw i.createError("splitNodeAt() should not be called with offset in the middle of a data node ("+P+" in "+M.data);M=M.parentNode}if(G(M,P)){I=M.cloneNode(!1),Q=M.parentNode,I.id&&I.removeAttribute("id");for(var Pe,xe=0;Pe=M.childNodes[P];)Z(Pe,I,xe++,U);return Z(I,Q,o.getNodeIndex(M)+1,U),M==w?I:te(w,Q,o.getNodeIndex(I),U)}else if(w!=M){I=M.parentNode;var de=o.getNodeIndex(M);return K||de++,te(w,I,de,U)}return w}function oe(w,M){return w.namespaceURI==M.namespaceURI&&w.tagName.toLowerCase()==M.tagName.toLowerCase()&&C(w,M)&&Y(w,M)&&ce(w,"display")=="inline"&&ce(M,"display")=="inline"}function Se(w){var M=w?"nextSibling":"previousSibling";return function(P,U){var I=P.parentNode,Q=P[M];if(Q){if(Q&&Q.nodeType==3)return Q}else if(U&&(Q=I[M],Q&&Q.nodeType==1&&oe(I,Q))){var K=Q[w?"firstChild":"lastChild"];if(K&&K.nodeType==3)return K}return null}}var Ce=Se(!1),ot=Se(!0);function pt(w){this.isElementMerge=w.nodeType==1,this.textNodes=[];var M=this.isElementMerge?w.lastChild:w;M&&(this.textNodes[0]=M)}pt.prototype={doMerge:function(w){var M=this.textNodes,P=M[0];if(M.length>1){var U=o.getNodeIndex(P),I=[],Q=0,K;u(M,function(J,Pe){K=J.parentNode,Pe>0&&(K.removeChild(J),K.hasChildNodes()||o.removeNode(K),w&&u(w,function(xe){xe.node==J&&(xe.node=P,xe.offset+=Q),xe.node==K&&xe.offset>U&&(--xe.offset,xe.offset==U+1&&Pe<M.length-1&&(xe.node=P,xe.offset=Q))})),I[Pe]=J.data,Q+=J.data.length}),P.data=I.join("")}return P.data},getLength:function(){for(var w=this.textNodes.length,M=0;w--;)M+=this.textNodes[w].length;return M},toString:function(){var w=[];return u(this.textNodes,function(M,P){w[P]="'"+M.data+"'"}),"[Merge("+w.join(",")+")]"}};var kt=["elementTagName","ignoreWhiteSpace","applyToEditableOnly","useExistingElements","removeEmptyElements","onElementCreate"],lt={};function Gt(w,M,P){var U,I,Q,K,J=this;J.cssClass=J.className=w;var Pe=null,xe={};if(typeof M=="object"&&M!==null){for(typeof M.elementTagName<"u"&&(M.elementTagName=M.elementTagName.toLowerCase()),P=M.tagNames,Pe=M.elementProperties,xe=M.elementAttributes,I=0;K=kt[I++];)M.hasOwnProperty(K)&&(J[K]=M[K]);U=M.normalize}else U=M;J.normalize=typeof U>"u"?!0:U,J.attrExceptions=[];var de=document.createElement(J.elementTagName);J.elementProperties=J.copyPropertiesToElement(Pe,de,!0),c(xe,function(Ke,Qe){J.attrExceptions.push(Ke),xe[Ke]=""+Qe}),J.elementAttributes=xe,J.elementSortedClassName=J.elementProperties.hasOwnProperty("className")?O(J.elementProperties.className+" "+w):w,J.applyToAnyTagName=!1;var rt=typeof P;if(rt=="string")P=="*"?J.applyToAnyTagName=!0:J.tagNames=h(P.toLowerCase()).split(/\s*,\s*/);else if(rt=="object"&&typeof P.length=="number")for(J.tagNames=[],I=0,Q=P.length;I<Q;++I)P[I]=="*"?J.applyToAnyTagName=!0:J.tagNames.push(P[I].toLowerCase());else J.tagNames=[J.elementTagName]}Gt.prototype={elementTagName:d,elementProperties:{},elementAttributes:{},ignoreWhiteSpace:!0,applyToEditableOnly:!1,useExistingElements:!0,removeEmptyElements:!0,onElementCreate:null,copyPropertiesToElement:function(w,M,P){var U,I,Q={},K,J,Pe,xe;for(var de in w)if(w.hasOwnProperty(de))if(J=w[de],Pe=M[de],de=="className")g(M,J),g(M,this.className),M[de]=O(M[de]),P&&(Q[de]=J);else if(de=="style"){I=Pe,P&&(Q[de]=K={});for(U in w[de])w[de].hasOwnProperty(U)&&(I[U]=J[U],P&&(K[U]=I[U]));this.attrExceptions.push(de)}else M[de]=J,P&&(Q[de]=M[de],xe=lt.hasOwnProperty(de)?lt[de]:de,this.attrExceptions.push(xe));return P?Q:""},copyAttributesToElement:function(w,M){for(var P in w)w.hasOwnProperty(P)&&!/^class(?:Name)?$/i.test(P)&&M.setAttribute(P,w[P])},appliesToElement:function(w){return s(this.tagNames,w.tagName.toLowerCase())},getEmptyElements:function(w){var M=this;return w.getNodes([1],function(P){return M.appliesToElement(P)&&!P.hasChildNodes()})},hasClass:function(w){return w.nodeType==1&&(this.applyToAnyTagName||this.appliesToElement(w))&&v(w,this.className)},getSelfOrAncestorWithClass:function(w){for(;w;){if(this.hasClass(w))return w;w=w.parentNode}return null},isModifiable:function(w){return!this.applyToEditableOnly||F(w)},isIgnorableWhiteSpaceNode:function(w){return this.ignoreWhiteSpace&&w&&w.nodeType==3&&Fe(w)},postApply:function(w,M,P,U){var I=w[0],Q=w[w.length-1],K=[],J,Pe=I,xe=Q,de=0,rt=Q.length,Ke;u(w,function(Oe){Ke=Ce(Oe,!U),Ke?(J||(J=new pt(Ke),K.push(J)),J.textNodes.push(Oe),Oe===I&&(Pe=J.textNodes[0],de=Pe.length),Oe===Q&&(xe=J.textNodes[0],rt=J.getLength())):J=null});var Qe=ot(Q,!U);if(Qe&&(J||(J=new pt(Q),K.push(J)),J.textNodes.push(Qe)),K.length){for(var en=0,he=K.length;en<he;++en)K[en].doMerge(P);M.setStartAndEnd(Pe,de,xe,rt)}},createContainer:function(w){var M=o.getDocument(w),P=f&&!o.isHtmlNamespace(w)&&w.namespaceURI?M.createElementNS(w.namespaceURI,this.elementTagName):M.createElement(this.elementTagName);return this.copyPropertiesToElement(this.elementProperties,P,!1),this.copyAttributesToElement(this.elementAttributes,P),g(P,this.className),this.onElementCreate&&this.onElementCreate(P,this),P},elementHasProperties:function(w,M){var P=this;return c(M,function(U,I){if(U=="className")return A(w,I);if(typeof I=="object"){if(!P.elementHasProperties(w[U],I))return!1}else if(w[U]!==I)return!1})},elementHasAttributes:function(w,M){return c(M,function(P,U){if(w.getAttribute(P)!==U)return!1})},applyToTextNode:function(w,M){if(E(w)){var P=w.parentNode;if(P.childNodes.length==1&&this.useExistingElements&&this.appliesToElement(P)&&this.elementHasProperties(P,this.elementProperties)&&this.elementHasAttributes(P,this.elementAttributes))g(P,this.className);else{var U=w.parentNode,I=this.createContainer(U);U.insertBefore(I,w),I.appendChild(w)}}},isRemovable:function(w){return w.tagName.toLowerCase()==this.elementTagName&&T(w)==this.elementSortedClassName&&this.elementHasProperties(w,this.elementProperties)&&!se(w,this.attrExceptions)&&this.elementHasAttributes(w,this.elementAttributes)&&this.isModifiable(w)},isEmptyContainer:function(w){var M=w.childNodes.length;return w.nodeType==1&&this.isRemovable(w)&&(M==0||M==1&&this.isEmptyContainer(w.firstChild))},removeEmptyContainers:function(w){var M=this,P=w.getNodes([1],function(Q){return M.isEmptyContainer(Q)}),U=[w],I=R(U);u(P,function(Q){ue(Q,I)}),W(U,I)},undoToTextNode:function(w,M,P,U){if(!M.containsNode(P)){var I=M.cloneRange();I.selectNode(P),I.isPointInRange(M.endContainer,M.endOffset)&&(te(P,M.endContainer,M.endOffset,U),M.setEndAfter(P)),I.isPointInRange(M.startContainer,M.startOffset)&&(P=te(P,M.startContainer,M.startOffset,U))}this.isRemovable(P)?S(P,U):y(P,this.className)},splitAncestorWithClass:function(w,M,P){var U=this.getSelfOrAncestorWithClass(w);U&&te(U,w,M,P)},undoToAncestor:function(w,M){this.isRemovable(w)?S(w,M):y(w,this.className)},applyToRange:function(w,M){var P=this;M=M||[];var U=R(M||[]);w.splitBoundariesPreservingPositions(U),P.removeEmptyElements&&P.removeEmptyContainers(w);var I=L(w);if(I.length){u(I,function(J){!P.isIgnorableWhiteSpaceNode(J)&&!P.getSelfOrAncestorWithClass(J)&&P.isModifiable(J)&&P.applyToTextNode(J,U)});var Q=I[I.length-1];w.setStartAndEnd(I[0],0,Q,Q.length),P.normalize&&P.postApply(I,w,U,!1),W(M,U)}var K=P.getEmptyElements(w);u(K,function(J){g(J,P.className)})},applyToRanges:function(w){for(var M=w.length;M--;)this.applyToRange(w[M],w);return w},applyToSelection:function(w){var M=r.getSelection(w);M.setRanges(this.applyToRanges(M.getAllRanges()))},undoToRange:function(w,M){var P=this;M=M||[];var U=R(M);w.splitBoundariesPreservingPositions(U),P.removeEmptyElements&&P.removeEmptyContainers(w,U);var I=L(w),Q,K,J=I[I.length-1];if(I.length){P.splitAncestorWithClass(w.endContainer,w.endOffset,U),P.splitAncestorWithClass(w.startContainer,w.startOffset,U);for(var Pe=0,xe=I.length;Pe<xe;++Pe)Q=I[Pe],K=P.getSelfOrAncestorWithClass(Q),K&&P.isModifiable(Q)&&P.undoToAncestor(K,U);w.setStartAndEnd(I[0],0,J,J.length),P.normalize&&P.postApply(I,w,U,!0),W(M,U)}var de=P.getEmptyElements(w);u(de,function(rt){y(rt,P.className)})},undoToRanges:function(w){for(var M=w.length;M--;)this.undoToRange(w[M],w);return w},undoToSelection:function(w){var M=r.getSelection(w),P=r.getSelection(w).getAllRanges();this.undoToRanges(P),M.setRanges(P)},isAppliedToRange:function(w){if(w.collapsed||w.toString()=="")return!!this.getSelfOrAncestorWithClass(w.commonAncestorContainer);var M=w.getNodes([3]);if(M.length){for(var P=0,U;U=M[P++];)if(!this.isIgnorableWhiteSpaceNode(U)&&D(w,U)&&this.isModifiable(U)&&!this.getSelfOrAncestorWithClass(U))return!1}return!0},isAppliedToRanges:function(w){var M=w.length;if(M==0)return!1;for(;M--;)if(!this.isAppliedToRange(w[M]))return!1;return!0},isAppliedToSelection:function(w){var M=r.getSelection(w);return this.isAppliedToRanges(M.getAllRanges())},toggleRange:function(w){this.isAppliedToRange(w)?this.undoToRange(w):this.applyToRange(w)},toggleSelection:function(w){this.isAppliedToSelection(w)?this.undoToSelection(w):this.applyToSelection(w)},getElementsWithClassIntersectingRange:function(w){var M=[],P=this;return w.getNodes([3],function(U){var I=P.getSelfOrAncestorWithClass(U);I&&!s(M,I)&&M.push(I)}),M},detach:function(){}};function Jt(w,M,P){return new Gt(w,M,P)}Gt.util={hasClass:v,addClass:g,removeClass:y,getClass:m,hasSameClasses:C,hasAllClasses:A,replaceWithOwnChildren:S,elementsHaveSameNonClassAttributes:Y,elementHasNonClassAttributes:se,splitNodeAt:te,isEditableElement:Ue,isEditingHost:He,isEditable:F},r.CssClassApplier=r.ClassApplier=Gt,r.createClassApplier=Jt,l.createAliasForDeprecatedMethod(r,"createCssClassApplier","createClassApplier",i)}),t})})(Kc)),Kc.exports}w5();var z0={toolbar:{allowMultiParagraphSelection:!0,buttons:["bold","colorpicker","italic","underline","strikethrough","quote","justifyLeft","justifyCenter","justifyRight","justifyFull","superscript","subscript","orderedlist","unorderedlist","pre","removeFormat","outdent","indent","h2","h3"],standardizeSelectionStart:!1,updateOnEmptySelection:!1},placeholder:{text:"请输入内容",hideOnClick:!0},disableEditing:!0};function W0(n){var e,t,r=((e=n==null?void 0:n.extensions)===null||e===void 0?void 0:e.button)||((t=n==null?void 0:n.extensions)===null||t===void 0?void 0:t.button),i=(n==null?void 0:n.Extension)||(n==null?void 0:n.Extension),o=r||i;return o?o.extend({name:"colorpicker",tagNames:["mark"],contentDefault:"<b>Color</b>",aria:"Color Picker",action:"colorPicker",init:function(){var a=this,s,l;try{$0.init()}catch{console.error("rangy.init failed")}try{(l=(s=r==null?void 0:r.prototype)===null||s===void 0?void 0:s.init)===null||l===void 0||l.call(this)}catch{console.error("ButtonBase.init failed")}this.colorPicker=new j0({parent:this.button||void 0,color:"#000",onDone:function(u){var d,f,c,h,p;try{a.coloredText&&(!((f=(d=a.coloredText).isAppliedToSelection)===null||f===void 0)&&f.call(d))&&a.coloredText.undoToSelection(),a.coloredText=$0.createClassApplier("colored",{elementTagName:"span",elementProperties:{style:{color:u.hex}},normalize:!0}),a.coloredText.toggleSelection(),(h=(c=a.base)===null||c===void 0?void 0:c.checkContentChanged)===null||h===void 0||h.call(c),(p=a.setInactive)===null||p===void 0||p.call(a)}catch{console.error("Picker.onDone failed")}}})},getButton:function(){return this.button},handleClick:function(){var a,s,l;(a=this.setActive)===null||a===void 0||a.call(this),(l=(s=this.colorPicker)===null||s===void 0?void 0:s.show)===null||l===void 0||l.call(s)},isAlreadyApplied:function(a){var s,l;return((l=(s=a==null?void 0:a.nodeName)===null||s===void 0?void 0:s.toLowerCase)===null||l===void 0?void 0:l.call(s))==="mark"},isActive:function(){var a,s;return(s=(a=this.button)===null||a===void 0?void 0:a.classList)===null||s===void 0?void 0:s.contains("medium-editor-button-active")},setInactive:function(){var a,s;(s=(a=this.button)===null||a===void 0?void 0:a.classList)===null||s===void 0||s.remove("medium-editor-button-active")},setActive:function(){var a,s;(s=(a=this.button)===null||a===void 0?void 0:a.classList)===null||s===void 0||s.add("medium-editor-button-active")}}):(console.warn("MediumEditor button/extension base not available; using noop extension"),(function(){function a(){}return a})())}var S5=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),O5=function(n,e,t,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,r);else for(var s=n.length-1;s>=0;s--)(a=n[s])&&(o=(i<3?a(o):i>3?a(e,t,o):a(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},X0=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},G0=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))};(function(n){S5(e,n);function e(t){var r=n.call(this,t)||this;r.labelMap=new Map;var i=t.lf,o=t.graphModel;return r.lf=i,r.graphModel=o,r.state={tick:0},r}return e.prototype.componentDidMount=function(){var t=this,r=this.props.graphModel;this.editor=new Pu(".lf-label-editor",Qr(z0,{autoLink:!0,extensions:{colorPicker:new(W0(Pu))}})),r.eventCenter.on("text:update,node:mousemove,node:resize,node:rotate,node:drag,label:drop,node:drop",function(){}),r.eventCenter.on("node:properties-change,node:properties-delete",function(){t.setState({tick:t.state.tick+1})})},e.prototype.componentDidUpdate=function(){var t;this.editor&&this.editor.elements.length>0?this.editor.addElements(".lf-label-editor"):((t=this.editor)===null||t===void 0||t.destroy(),this.editor=new Pu(".lf-label-editor",Qr(z0,{autoLink:!0,extensions:{colorPicker:new(W0(Pu))}})))},e.prototype.componentWillUnmount=function(){var t;(t=this.editor)===null||t===void 0||t.destroy()},e.prototype.getLabels=function(){var t=this,r=this.props,i=r.lf.extension,o=r.graphModel,a=G0(G0([],X0(o.nodes),!1),X0(o.edges),!1),s=i.label;if(s){var l=[];return nt(a,function(u){var d,f,c=u.getData(),h=(f=(d=c.properties)===null||d===void 0?void 0:d._label)!==null&&f!==void 0?f:[];nt(h,function(p){var v=t.labelMap,g=new c5(p,u,o);v.set(g.id,g),l.push($(d5,{label:g,element:u,graphModel:o},g.id))})}),l}return null},e.prototype.render=function(){return $("foreignObject",{id:"lf-label-overlay",class:"lf-label-overlay",children:this.getLabels()})},e.toolName="label-edit-tool",e=O5([pn],e),e})(Ye);var U0=function(){return U0=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},U0.apply(this,arguments)},Y0=function(){return Y0=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Y0.apply(this,arguments)},V0=function(){return V0=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},V0.apply(this,arguments)},K0=function(){return K0=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},K0.apply(this,arguments)},q0=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},Z0=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))},A5=(function(){function n(e){var t=e.lf,r=this;this.controlItems=[{key:"zoom-out",iconClass:"lf-control-zoomOut",title:"缩小流程图",text:"缩小",hideText:!1,onClick:function(){r.lf.zoom(!1)}},{key:"zoom-in",iconClass:"lf-control-zoomIn",title:"放大流程图",text:"放大",hideText:!1,onClick:function(){r.lf.zoom(!0)}},{key:"reset",iconClass:"lf-control-fit",title:"恢复流程原有尺寸",text:"适应",hideText:!1,onClick:function(){r.lf.resetZoom()}},{key:"undo",iconClass:"lf-control-undo",title:"回到上一步",text:"上一步",hideText:!1,onClick:function(){r.lf.undo()}},{key:"redo",iconClass:"lf-control-redo",title:"移到下一步",text:"下一步",hideText:!1,onClick:function(){r.lf.redo()}}],this.lf=t}return n.prototype.render=function(e,t){this.destroy();var r=this.getControlTool();this.toolEl=r,t.appendChild(r),this.domContainer=t},n.prototype.destroy=function(){this.domContainer&&this.toolEl&&this.domContainer.contains(this.toolEl)&&this.domContainer.removeChild(this.toolEl)},n.prototype.addItem=function(e){this.controlItems.push(e)},n.prototype.removeItem=function(e){var t=this.controlItems.findIndex(function(r){return r.key===e});return t==-1?null:this.controlItems.splice(t,1)[0]},n.prototype.getControlTool=function(){var e=this,t=this.lf.graphModel.themeMode,r="lf-control-item-".concat(t," lf-control-item"),i="lf-control-item disabled",o=document.createElement("div"),a=[];o.className="lf-control-".concat(t," lf-control");var s=Z0([],q0(this.controlItems),!1);return s.forEach(function(l){var u=document.createElement("div"),d=document.createElement("i");if(u.className=i,l.onClick&&(u.onclick=l.onClick.bind(null,e.lf)),l.onMouseEnter&&(u.onmouseenter=l.onMouseEnter.bind(null,e.lf)),l.onMouseLeave&&(u.onmouseleave=l.onMouseLeave.bind(null,e.lf)),d.className=l.iconClass,Kt(l.hideText)||l.hideText!==!0){var f=document.createElement("span");f.className="lf-control-text-".concat(t," lf-control-text"),f.title=l.title,f.innerText=l.text,u.append(d,f)}else u.append(d);switch(l.key){case"undo":e.lf.on("history:change",function(c){var h=c.data.undoAble;u.className=h?r:i});break;case"redo":e.lf.on("history:change",function(c){var h=c.data.redoAble;u.className=h?r:i});break;default:u.className=r;break}a.push(u)}),o.append.apply(o,Z0([],q0(a),!1)),o},n.pluginName="control",n})(),qc=function(){return qc=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},qc.apply(this,arguments)},Zc=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},Qc=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))},Lu="lf:defaultNodeMenu",Iu="lf:defaultEdgeMenu",Jc="lf:defaultGraphMenu",ku="lf:defaultSelectionMenu",eh={nodeMenu:Lu,edgeMenu:Iu,graphMenu:Jc,selectionMenu:ku},ti={nodeMenu:[],edgeMenu:[],graphMenu:[],selectionMenu:[]},C5=(function(){function n(e){var t=e.lf,r=this;this.__currentData=null,this.__isSilentMode=!1,this.lf=t,this.__menuDOM=document.createElement("ul"),this.__isSilentMode=t.graphModel.editConfigModel.isSilentMode,this.menuTypeMap=new Map,this.init(),this.lf.setMenuConfig=function(i){r.setMenuConfig(i)},this.lf.addMenuConfig=function(i){r.addMenuConfig(i)},this.lf.setMenuByType=function(i){r.setMenuByType(i)},this.lf.changeMenuItemDisableStatus=function(i,o,a){r.changeMenuItemDisableStatus(i,o,a)},this.lf.getMenuConfig=function(i){return r.getMenuConfig(i)},this.lf.resetMenuConfigByType=function(i){r.resetMenuConfigByType(i)}}return n.prototype.init=function(){var e=this,t,r,i;ti.nodeMenu=[{text:"删除",callback:function(o){e.lf.deleteNode(o.id)}},{text:"编辑文本",callback:function(o){e.lf.graphModel.editText(o.id)}},{text:"复制",callback:function(o){e.lf.cloneNode(o.id)}}],(t=this.menuTypeMap)===null||t===void 0||t.set(Lu,ti.nodeMenu),ti.edgeMenu=[{text:"删除",callback:function(o){e.lf.deleteEdge(o.id)}},{text:"编辑文本",callback:function(o){e.lf.graphModel.editText(o.id)}}],(r=this.menuTypeMap)===null||r===void 0||r.set(Iu,ti.edgeMenu),ti.graphMenu=[],ti.selectionMenu=[{text:"删除",callback:function(o){e.lf.clearSelectElements(),o.edges.forEach(function(a){return e.lf.deleteEdge(a.id)}),o.nodes.forEach(function(a){return e.lf.deleteNode(a.id)})}}],(i=this.menuTypeMap)===null||i===void 0||i.set(ku,ti.selectionMenu)},n.prototype.showMenu=function(e,t,r,i){if(!this.__isSilentMode&&!(!r||!r.length)){var o=this.__menuDOM;if(o){if(o.innerHTML="",o.append.apply(o,Qc([],Zc(this.__getMenuDom(r)),!1)),!o.children.length)return;if(o.style.display="block",!i){o.style.top="".concat(t,"px"),o.style.left="".concat(e,"px");return}var a=i.width,s=i.height,l=i.clientX,u=i.clientY,d=this.lf.graphModel,f=o.offsetWidth,c=!0,h=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,p=h-l,v=d.rootEl.getBoundingClientRect(),g=v.left+v.width;g<h&&(p=g-l),p<f&&(c=!1),c?o.style.left="".concat(e,"px"):o.style.left="".concat(e-a,"px");var y=o.offsetHeight,m=!0,O=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,T=O-u,C=v.top+v.height;C<O&&(T=C-u),T<y&&(m=!1),m?o.style.top="".concat(t,"px"):o.style.top="".concat(t-s,"px")}}},n.prototype.processMenuConfig=function(e,t){var r=this;if(e){var i=["nodeMenu","edgeMenu","graphMenu","selectionMenu"];i.forEach(function(o){var a,s,l,u,d=e[o],f=eh[o];if(d!==void 0){if(t==="set")(a=r.menuTypeMap)===null||a===void 0||a.set(f,d||[]);else if(t==="add"&&Array.isArray(d)){var c=(l=(s=r.menuTypeMap)===null||s===void 0?void 0:s.get(f))!==null&&l!==void 0?l:[];(u=r.menuTypeMap)===null||u===void 0||u.set(f,c.concat(d))}}})}},n.prototype.createImageElement=function(e,t){var r=document.createElement("img");return r.src=e,r.alt=t,r.style.width="16px",r.style.height="16px",r.style.objectFit="contain",r},n.prototype.isImageFile=function(e){var t=[".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"];return t.some(function(r){return e.toLowerCase().includes(r)})},n.prototype.processIcon=function(e,t,r){var i;if(typeof t=="string"){var o=t;if(o.startsWith("data:image/")){var a=this.createImageElement(o,r||"icon");e.appendChild(a);return}if(this.isImageFile(o)){var a=this.createImageElement(o,r||"icon");e.appendChild(a);return}if(o.includes("<")&&o.includes(">")){e.innerHTML=o;return}if(o.includes(" ")||o.startsWith(".")){var s=o.replace(/^\./,"").split(" ");(i=e.classList).add.apply(i,Qc([],Zc(s),!1));return}e.classList.add(o)}},n.prototype.__getMenuDom=function(e){var t=this,r=[];return e&&e.length>0&&e.forEach(function(i){var o=document.createElement("li");if(i.className?o.className="lf-menu-item ".concat(i.disabled?"lf-menu-item__disabled":""," ").concat(i.className):o.className="lf-menu-item ".concat(i.disabled?"lf-menu-item__disabled":""),i.icon){var a=document.createElement("span");a.className="lf-menu-item-icon",t.processIcon(a,i.icon,i.text),o.appendChild(a)}var s=document.createElement("span");s.className="lf-menu-item-text",i.text&&(s.innerText=i.text),o.appendChild(s),i.disabled&&o.setAttribute("disabled","true"),o.onclickCallback=i.callback,r.push(o)}),r},n.prototype.updateMenuItemDOMStatus=function(e,t){if(!(!this.__menuDOM||this.__menuDOM.style.display==="none")){var r=Array.from(this.__menuDOM.querySelectorAll(".lf-menu-item")),i=r.find(function(a){var s=a.querySelector(".lf-menu-item-text");return(s==null?void 0:s.textContent)===e});if(i){var o=i;t?(o.classList.add("lf-menu-item__disabled"),o.setAttribute("disabled","true")):(o.classList.remove("lf-menu-item__disabled"),o.removeAttribute("disabled"))}}},n.prototype.setupSilentModeListener=function(){var e=this;this.__editConfigChangeHandler=function(t){var r=t.data,i=r.isSilentMode;i!==e.__isSilentMode&&(e.__isSilentMode=i,e.updateMenuVisibility(!i))},this.lf.on("editConfig:changed",this.__editConfigChangeHandler)},n.prototype.updateMenuVisibility=function(e){this.__menuDOM&&(e?this.__currentData&&(this.__menuDOM.style.display="block"):(this.__menuDOM.style.display="none",this.__currentData=null))},n.prototype.refreshCurrentMenu=function(){var e,t,r,i,o,a,s,l,u,d,f;if(!(!this.__menuDOM||this.__menuDOM.style.display==="none"||!this.__currentData)){var c=this.__menuDOM.style,h=c.left,p=c.top,v=[];if(this.__currentData&&typeof this.__currentData=="object")if("sourceNodeId"in this.__currentData&&"targetNodeId"in this.__currentData){var g=this.lf.graphModel.getEdgeModelById(this.__currentData.id);if(g){var y=(t=this.menuTypeMap)===null||t===void 0?void 0:t.get(g.type);g.menu&&Array.isArray(g.menu)?v=g.menu:y?v=y:v=(i=(r=this.menuTypeMap)===null||r===void 0?void 0:r.get(Iu))!==null&&i!==void 0?i:[]}}else if("id"in this.__currentData&&"type"in this.__currentData){var g=this.lf.graphModel.getNodeModelById(this.__currentData.id);if(g){var y=(o=this.menuTypeMap)===null||o===void 0?void 0:o.get(g.type);g.menu&&Array.isArray(g.menu)?v=g.menu:y?v=y:v=(s=(a=this.menuTypeMap)===null||a===void 0?void 0:a.get(Lu))!==null&&s!==void 0?s:[]}}else"nodes"in this.__currentData&&"edges"in this.__currentData?v=(u=(l=this.menuTypeMap)===null||l===void 0?void 0:l.get(ku))!==null&&u!==void 0?u:[]:v=(f=(d=this.menuTypeMap)===null||d===void 0?void 0:d.get(Jc))!==null&&f!==void 0?f:[];v&&v.length>0?(this.__menuDOM.innerHTML="",(e=this.__menuDOM).append.apply(e,Qc([],Zc(this.__getMenuDom(v)),!1)),h&&(this.__menuDOM.style.left=h),p&&(this.__menuDOM.style.top=p)):(this.__menuDOM.style.display="none",this.__currentData=null)}},n.prototype.setMenuByType=function(e){var t,r=e.type,i=e.menu;!r||!i||((t=this.menuTypeMap)===null||t===void 0||t.set(r,i),this.refreshCurrentMenu())},n.prototype.getMenuConfig=function(e){var t,r;return(r=(t=this.menuTypeMap)===null||t===void 0?void 0:t.get(eh[e]))!==null&&r!==void 0?r:[]},n.prototype.resetMenuConfigByType=function(e){var t;this.setMenuConfig((t={},t[e]=ti[e],t))},n.prototype.resetAllMenuConfig=function(){this.setMenuConfig(ti)},n.prototype.setMenuConfig=function(e){this.processMenuConfig(e,"set"),this.refreshCurrentMenu()},n.prototype.addMenuConfig=function(e){this.processMenuConfig(e,"add"),this.refreshCurrentMenu()},n.prototype.changeMenuItem=function(e,t){if(e==="add")this.addMenuConfig(t);else if(e==="reset")this.setMenuConfig(t);else throw new Error("The first parameter of changeMenuConfig should be 'add' or 'reset'")},n.prototype.changeMenuItemDisableStatus=function(e,t,r){var i,o;if(!e||!t){console.warn("params is vaild");return}var a=(o=(i=this.menuTypeMap)===null||i===void 0?void 0:i.get(eh[e]))!==null&&o!==void 0?o:[];if(!a.length){console.warn("menuMap: ".concat(e," is not exist"));return}var s=a.find(function(l){return l.text===t});if(!s){console.warn("menuItem: ".concat(t," is not exist"));return}s.disabled=r,this.updateMenuItemDOMStatus(t,r)},n.prototype.render=function(e,t){var r=this;e.graphModel.editConfigModel.isSilentMode||(this.__container=t,this.__currentData=null,this.setupSilentModeListener(),this.__menuDOM&&(this.__menuDOM.className="lf-menu",t.appendChild(this.__menuDOM),this.__menuDOM.addEventListener("click",function(i){i.stopPropagation();for(var o=i.target;Array.from(o.classList).indexOf("lf-menu-item")===-1&&Array.from(o.classList).indexOf("lf-menu")===-1;)o=o==null?void 0:o.parentElement;Array.from(o.classList).indexOf("lf-menu-item__disabled")>-1||(Array.from(o.classList).indexOf("lf-menu-item")>-1?(o.onclickCallback(r.__currentData,o),r.__menuDOM&&(r.__menuDOM.style.display="none"),r.__currentData=null):console.warn("点击区域不在菜单项内,请检查代码!"))},!0)),this.lf.on("node:contextmenu",function(i){var o,a,s=i.data,l=i.position,u=i.e,d=l.domOverlayPosition,f=d.x,c=d.y,h=s.id,p=r.lf.graphModel.getNodeModelById(h);if(!(!p||r.__isSilentMode)){var v=[],g=(o=r.menuTypeMap)===null||o===void 0?void 0:o.get(p.type);p&&p.menu&&Array.isArray(p.menu)?v=p.menu:g?v=g:v=(a=r.menuTypeMap)===null||a===void 0?void 0:a.get(Lu),r.__currentData=s,r.showMenu(f,c,v,{width:p.width,height:p.height,clientX:u.clientX,clientY:u.clientY})}}),this.lf.on("edge:contextmenu",function(i){var o,a,s,l=i.data,u=i.position,d=i.e,f=u.domOverlayPosition,c=f.x,h=f.y,p=l.id,v=r.lf.graphModel.getEdgeModelById(p);if(!(!v||r.__isSilentMode)){var g=[],y=(o=r.menuTypeMap)===null||o===void 0?void 0:o.get(v.type);v&&v.menu&&Array.isArray(v.menu)?g=v.menu:y?g=y:g=(s=(a=r.menuTypeMap)===null||a===void 0?void 0:a.get(Iu))!==null&&s!==void 0?s:[],r.__currentData=l,r.showMenu(c,h,g,{width:v.width,height:v.height,clientX:d.clientX,clientY:d.clientY})}}),this.lf.on("blank:contextmenu",function(i){var o,a,s=i.position;if(!r.__isSilentMode){var l=(a=(o=r.menuTypeMap)===null||o===void 0?void 0:o.get(Jc))!==null&&a!==void 0?a:[],u=s.domOverlayPosition,d=u.x,f=u.y;r.__currentData=qc({},s.canvasOverlayPosition),r.showMenu(d,f,l)}}),this.lf.on("selection:contextmenu",function(i){var o,a=i.data,s=i.position;if(!r.__isSilentMode){var l=(o=r.menuTypeMap)===null||o===void 0?void 0:o.get(ku),u=s.domOverlayPosition,d=u.x,f=u.y;r.__currentData=a,r.showMenu(d,f,l)}}),this.lf.on("node:mousedown",function(){r.__menuDOM.style.display="none"}),this.lf.on("edge:click",function(){r.__menuDOM.style.display="none"}),this.lf.on("blank:click",function(){r.__menuDOM.style.display="none"}))},n.prototype.destroy=function(){var e;this.__editConfigChangeHandler&&this.lf.off("editConfig:changed",this.__editConfigChangeHandler),this.__menuDOM&&((e=this===null||this===void 0?void 0:this.__container)===null||e===void 0||e.removeChild(this.__menuDOM),this.__menuDOM=void 0)},n.pluginName="menu",n})(),T5=(function(){function n(e){var t=e.lf,r=this;this.lf=t,this.lf.setPatternItems=function(i){r.setPatternItems(i)}}return n.prototype.render=function(e,t){var r=this;if(this.destroy(),!this.shapeList||this.shapeList.length===0){this.domContainer=t;return}this.panelEl=document.createElement("div"),this.panelEl.className="lf-dndpanel",this.panelEl.addEventListener("touchmove",function(i){i.preventDefault()},{passive:!1}),this.shapeList.forEach(function(i){var o;(o=r.panelEl)===null||o===void 0||o.appendChild(r.createDndItem(i))}),t.appendChild(this.panelEl),this.domContainer=t},n.prototype.destroy=function(){this.domContainer&&this.panelEl&&this.domContainer.contains(this.panelEl)&&this.domContainer.removeChild(this.panelEl)},n.prototype.setPatternItems=function(e){this.shapeList=e,this.domContainer&&this.render(this.lf,this.domContainer)},n.prototype.createDndItem=function(e){var t=this,r=document.createElement("div");r.className=e.className?"lf-dnd-item ".concat(e.className):"lf-dnd-item";var i=document.createElement("div");if(i.className="lf-dnd-shape",e.icon&&(i.style.backgroundImage="url(".concat(e.icon,")")),r.appendChild(i),e.label){var o=document.createElement("div");o.innerText=e.label,o.className="lf-dnd-text",r.appendChild(o)}return e.disabled?(r.classList.add("disabled"),r.onpointerdown=function(){e.callback&&e.callback(t.lf,t.domContainer)},r):(r.onpointerdown=function(a){e.type&&t.lf.dnd.startDrag({type:e.type,properties:e.properties,text:e.text}),e.callback&&e.callback(t.lf,t.domContainer),a.preventDefault()},r.ondblclick=function(a){t.lf.graphModel.eventCenter.emit("dnd:panel-dbclick",{e:a,data:e})},r.onclick=function(a){t.lf.graphModel.eventCenter.emit("dnd:panel-click",{e:a,data:e})},r.oncontextmenu=function(a){t.lf.graphModel.eventCenter.emit("dnd:panel-contextmenu",{e:a,data:e})},r)},n.pluginName="dndPanel",n})(),M5=function(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},N5=(function(){function n(e){var t=e.lf,r=e.LogicFlow,i=e.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.onGraphResize=function(){o.updateViewPortBounds(),o.isShow&&o.updateViewPort()},this.render=function(s,l){o.container=l,o.lf.on("history:change",function(){o.isShow&&o.setView()}),o.lf.on("graph:transform",function(){o.isShow&&o.setView(!1)})},this.show=function(s,l){o.isShow||(o.initMiniMap(),o.lf.on("graph:resize",o.onGraphResize),o.createMiniMap(s,l),o.setView(!0)),o.isShow=!0},this.hide=function(){o.isShow&&(o.lf.off("graph:resize",o.onGraphResize),o.lfMap.destroy(),o.translateX=0,o.translateY=0,o.removeMiniMap(),o.lf.emit("miniMap:close",{})),o.isShow=!1},this.updatePosition=function(s){if(typeof s=="object")(s.left!==void 0||s.right!==void 0)&&(o.leftPosition=s.left,o.rightPosition=s.right),(s.top!==void 0||s.bottom!==void 0)&&(o.topPosition=s.top,o.bottomPosition=s.bottom);else switch(s){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;break}o.updateMiniMapPosition()},this.reset=function(){o.lf.resetTranslate(),o.lf.resetZoom()},this.setShowEdge=function(s){o.showEdge!==s&&(o.showEdge=s,o.setView())},this.startDrag=function(s){document.addEventListener("pointermove",o.drag),document.addEventListener("pointerup",o.drop);var l=s.x,u=s.y;o.startPosition={x:l,y:u}},this.drag=function(s){var l=s.x,u=s.y,d=(l-o.startPosition.x)/o.scale,f=(u-o.startPosition.y)/o.scale,c=o.viewPortLeft+d+o.viewPortWidth/o.scale/2,h=o.viewPortTop+f+o.viewPortHeight/o.scale/2;o.startPosition={x:l,y:u},o.lf.focusOn({coordinate:{x:c,y:h}})},this.drop=function(){document.removeEventListener("pointermove",o.drag),document.removeEventListener("pointerup",o.drop)},this.mapClick=function(s){var l=s.offsetX,u=s.offsetY,d=o.translateX+l/o.scale,f=o.translateY+u/o.scale;o.lf.focusOn({coordinate:{x:d,y:f}})},this.lf=t,this.LFCtor=r,i&&this.setOption(i),this.viewPortWidth=t.graphModel.width,this.viewPortHeight=t.graphModel.height;var a={left:0,right:this.viewPortWidth,top:0,bottom:this.viewPortHeight};this.bounds=a,this.elementAreaBounds=a,this.viewPortBounds=a}return n.prototype.setOption=function(e){var t=e.width,r=t===void 0?200:t,i=e.height,o=i===void 0?150:i,a=e.showEdge,s=a===void 0?!1:a,l=e.isShowHeader,u=l===void 0?!1:l,d=e.isShowCloseIcon,f=d===void 0?!1:d,c=e.leftPosition,h=e.topPosition,p=e.rightPosition,v=p===void 0?0:p,g=e.bottomPosition,y=g===void 0?0:g,m=e.headerTitle,O=m===void 0?"导航":m;this.width=r,this.height=o,this.showEdge=s,this.isShowHeader=u,this.isShowCloseIcon=f,this.leftPosition=c,this.rightPosition=c!==void 0?void 0:v,this.topPosition=h,this.bottomPosition=h!==void 0?void 0:y,this.headerTitle=O},n.prototype.initMiniMap=function(){var e=document.createElement("div");e.className="lf-mini-map-graph",e.style.width="".concat(this.width,"px"),e.style.height="".concat(this.height,"px"),this.lfMap=new this.LFCtor({container:e,grid:!1,isSilentMode:!0,stopZoomGraph:!0,stopScrollGraph:!0,stopMoveGraph:!1,history:!1,snapline:!1,disabledPlugins:this.disabledPlugins,isMiniMap:!0}),this.miniMapWrap=e,this.createViewPort(),e.addEventListener("click",this.mapClick)},n.prototype.createMiniMap=function(e,t){var r,i=document.createElement("div");this.miniMapContainer=i,i.appendChild(this.miniMapWrap),i.style.position="absolute",(e!==void 0||t!==void 0)&&(this.leftPosition=e||0,this.topPosition=t||0,this.rightPosition=void 0,this.bottomPosition=void 0),this.updateMiniMapPosition(),i.className="lf-mini-map",this.isShowCloseIcon||i.classList.add("lf-mini-map-no-close-icon"),this.isShowHeader||i.classList.add("lf-mini-map-no-header"),(r=this.container)===null||r===void 0||r.appendChild(i),this.miniMapWrap.appendChild(this.viewport);var o=document.createElement("div");o.className="lf-mini-map-header",o.innerText=this.headerTitle,i.appendChild(o);var a=document.createElement("span");a.className="lf-mini-map-close",a.addEventListener("click",this.hide),i.appendChild(a)},n.prototype.updateMiniMapPosition=function(){if(this.miniMapContainer){var e=this.miniMapContainer.style;this.rightPosition!==void 0?(e.right="".concat(this.rightPosition,"px"),e.left=""):(e.left="".concat(this.leftPosition,"px"),e.right=""),this.bottomPosition!==void 0?(e.bottom="".concat(this.bottomPosition,"px"),e.top=""):(e.top="".concat(this.topPosition,"px"),e.bottom="")}},n.prototype.removeMiniMap=function(){var e;this.miniMapContainer&&((e=this.container)===null||e===void 0||e.removeChild(this.miniMapContainer))},n.prototype.updateBounds=function(e){e&&this.updateElementAreaBounds(e),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)}},n.prototype.updateElementAreaBounds=function(e){var t={left:0,right:0,top:0,bottom:0},r=e.nodes;r&&r.length>0&&r.forEach(function(i){var o,a,s=i.x,l=i.y,u=(o=i.width)!==null&&o!==void 0?o:200,d=(a=i.height)!==null&&a!==void 0?a:200,f=s-u/2,c=s+u/2,h=l-d/2,p=l+d/2;t.left=Math.min(f,t.left),t.right=Math.max(c,t.right),t.top=Math.min(h,t.top),t.bottom=Math.max(p,t.bottom)}),this.elementAreaBounds=t},n.prototype.updateViewPortBounds=function(){var e=this.lf.getTransform(),t=e.TRANSLATE_X,r=e.TRANSLATE_Y,i=e.SCALE_X,o=e.SCALE_Y,a=this.lf.graphModel,s=a.width,l=a.height;this.viewPortBounds={left:-t/i,right:(-t+s)/i,top:-r/o,bottom:(-r+l)/o}},n.prototype.resetData=function(e){var t=e.nodes,r=e.edges;return t.forEach(function(i){i.text=void 0}),this.showEdge&&r.forEach(function(i){i.text=void 0}),{nodes:t,edges:this.showEdge?r:[]}},n.prototype.setView=function(e){var t,r;if(e===void 0&&(e=!0),e){var i=this.lf.getGraphRawData(),o=this.resetData(i),a=this.lf.viewMap,s=this.lf.graphModel.modelMap,l=this.lfMap.viewMap;try{for(var u=M5(a.keys()),d=u.next();!d.done;d=u.next()){var f=d.value;l.has(f)||this.lfMap.register({type:f,view:a.get(f),model:s.get(f)})}}catch(B){t={error:B}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}this.lfMap.render(o),this.updateBounds(o)}else this.updateBounds();var c=this.bounds,h=c.left,p=c.top,v=c.right,g=c.bottom,y=v-h,m=g-p,O=this.width/y,T=this.height/m,C=Math.min(O,T);this.scale=C;var A=h-(this.width/C-y)/2,E=p-(this.height/C-m)/2;if(this.lfMap.graphModel.transformModel.translate(-A+this.translateX,-E+this.translateY),this.translateX=A,this.translateY=E,this.miniMapWrap.firstChild){var N=this.miniMapWrap.firstChild.style;N.pointerEvents="none",N.transform="matrix(".concat(C,", 0, 0, ").concat(C,", 0, 0)"),N.transformOrigin="left top",N.height="".concat(this.height/C,"px"),N.width="".concat(this.width/C,"px"),this.updateViewPort()}},n.prototype.updateViewPort=function(){var e=this.viewport.style,t=this.lf.getTransform(),r=t.TRANSLATE_X,i=t.TRANSLATE_Y,o=t.SCALE_X,a=t.SCALE_Y,s=this.lf.graphModel,l=s.width,u=s.height;this.viewPortLeft=-r/o,this.viewPortTop=-i/a,this.viewPortWidth=l/o*this.scale,this.viewPortHeight=u/a*this.scale,e.width="".concat(this.viewPortWidth,"px"),e.height="".concat(this.viewPortHeight,"px"),e.left="".concat((this.viewPortLeft-this.translateX)*this.scale,"px"),e.top="".concat((this.viewPortTop-this.translateY)*this.scale,"px")},n.prototype.createViewPort=function(){var e=document.createElement("div");e.className="lf-minimap-viewport",e.style.touchAction="none",e.addEventListener("pointerdown",this.startDrag),e.addEventListener("click",function(t){t.stopPropagation()}),this.viewport=e},n.prototype.destroy=function(){this.lf.off("graph:resize",this.onGraphResize)},n.pluginName="miniMap",n})(),Q0=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},J0=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))},P5=(function(){function n(e){var t=e.lf,r=e.options,i=this,o;this.disabled=!0,this.isWholeNode=!0,this.isWholeEdge=!0,this.originStatusSaved=!1,this.exclusiveMode=!1,this.mouseDownInfo=null,this.originalStopMoveGraph=!1,this.handleBlankMouseDown=function(a){var s=a.e;i.handleMouseDown(s)},this.draw=function(a){if(i.lf.graphModel.editConfigModel.isPinching){i.lf.updateEditConfig({stopMoveGraph:i.originalStopMoveGraph}),i.originStatusSaved=!1,i.cleanupSelectionState();return}var s=i.lf.getPointByClient(a.clientX,a.clientY).domOverlayPosition,l=s.x,u=s.y;if(i.endPoint={x:l,y:u},i.startPoint){var d=i.startPoint,f=d.x,c=d.y,h=f,p=c,v=l-f,g=u-c;l<f&&(h=l,v=f-l),u<c&&(p=u,g=c-u),i.wrapper&&(i.wrapper.style.left="".concat(h,"px"),i.wrapper.style.top="".concat(p,"px"),i.wrapper.style.width="".concat(v,"px"),i.wrapper.style.height="".concat(g,"px"))}},this.drawOff=function(a){if(i.lf.updateEditConfig({stopMoveGraph:i.originalStopMoveGraph}),i.originStatusSaved=!1,i.mouseDownInfo){var s=i.mouseDownInfo,l=s.x,u=s.y,d=s.time,f=Math.abs(a.clientX-l)<5&&Math.abs(a.clientY-u)<5&&Date.now()-d<200;if(f){i.lf.clearSelectElements(),i.cleanupSelectionState();return}}var c=Ee(i.startPoint),h=Ee(i.endPoint);if(document.removeEventListener("pointermove",i.draw),i.exclusiveMode||document.removeEventListener("pointerup",i.drawOff),c&&h){var l=c.x,u=c.y,p=h.x,v=h.y,g=[Math.min(l,p),Math.min(u,v)],y=[Math.max(l,p),Math.max(u,v)];if(i.lf.emit("selection:selected-area",{topLeft:g,bottomRight:y}),Math.abs(p-l)<10&&Math.abs(v-u)<10){i.wrapper&&(i.wrapper.oncontextmenu=null,i.container&&i.wrapper.parentNode===i.container&&i.container.removeChild(i.wrapper),i.wrapper=void 0);return}var m=i.lf.graphModel.getAreaElement(g,y,i.isWholeEdge,i.isWholeNode,!0),O=i.lf.graphModel,T=O.dynamicGroup,C=O.group,A=[],E=i.lf.getSelectElements(),N=new Set(J0(J0([],Q0(E.nodes.map(function(ue){return ue.id})),!1),Q0(E.edges.map(function(ue){return ue.id})),!1));m.forEach(function(ue){if(C){var me=C.getNodeGroup(ue.id);if(m.includes(me))return}if(T){var me=T.getGroupByNodeId(ue.id);if(m.includes(me))return}if(i.exclusiveMode&&N.has(ue.id)){i.lf.deselectElementById(ue.id);return}i.lf.selectElementById(ue.id,!0),A.push(ue)}),i.startPoint=void 0,i.endPoint=void 0,A.length>0&&i.lf.emit("selection:drop",{e:a}),i.lf.emit("selection:selected",{elements:A,leftTopPoint:g,rightBottomPoint:y})}i.wrapper&&(i.wrapper.oncontextmenu=null,i.container&&i.wrapper.parentNode===i.container&&i.container.removeChild(i.wrapper),i.wrapper=void 0)},this.lf=t,this.exclusiveMode=(o=r==null?void 0:r.exclusiveMode)!==null&&o!==void 0?o:!1,t.openSelectionSelect=function(){i.openSelectionSelect()},t.closeSelectionSelect=function(){i.closeSelectionSelect()},t.setSelectionSelectMode=function(a){i.setExclusiveMode(a)},this.handleMouseDown=this.handleMouseDown.bind(this),this.draw=this.draw.bind(this),this.drawOff=this.drawOff.bind(this)}return n.prototype.render=function(e,t){this.container=t},n.prototype.cleanupSelectionState=function(){this.wrapper&&(this.wrapper.oncontextmenu=null,this.container&&this.wrapper.parentNode===this.container&&this.container.removeChild(this.wrapper),this.wrapper=void 0),this.startPoint=void 0,this.endPoint=void 0,this.mouseDownInfo=null,document.removeEventListener("pointermove",this.draw),document.removeEventListener("pointerup",this.drawOff)},n.prototype.setExclusiveMode=function(e){e===void 0&&(e=!1),this.exclusiveMode!==e&&(this.cleanupSelectionState(),this.exclusiveMode=e,this.container&&!this.disabled&&(this.removeEventListeners(),this.addEventListeners()))},n.prototype.addEventListeners=function(){this.container&&(this.exclusiveMode?(this.container.style.pointerEvents="auto",this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.handleMouseDown)):(this.container.style.pointerEvents="none",this.lf.on("blank:mousedown",this.handleBlankMouseDown)))},n.prototype.removeEventListeners=function(){this.container&&(this.container.style.pointerEvents="none",this.container.removeEventListener("pointerdown",this.handleMouseDown)),this.lf.off("blank:mousedown",this.handleBlankMouseDown)},n.prototype.handleMouseDown=function(e){var t;if(!(!this.container||this.disabled)&&!this.lf.graphModel.editConfigModel.isPinching){var r=e.button===2;if(!r){this.cleanupSelectionState(),this.mouseDownInfo={x:e.clientX,y:e.clientY,time:Date.now()},this.originStatusSaved||(this.originalStopMoveGraph=this.lf.getEditConfig().stopMoveGraph,this.originStatusSaved=!0),this.lf.updateEditConfig({stopMoveGraph:!0});var i=this.lf.getPointByClient(e.clientX,e.clientY).domOverlayPosition,o=i.x,a=i.y;this.startPoint={x:o,y:a},this.endPoint={x:o,y:a};var s=document.createElement("div");s.className="lf-selection-select",s.oncontextmenu=function(u){u.preventDefault()},s.style.top="".concat(this.startPoint.y,"px"),s.style.left="".concat(this.startPoint.x,"px"),(t=this.container)===null||t===void 0||t.appendChild(s),this.wrapper=s,document.addEventListener("pointermove",this.draw),document.addEventListener("pointerup",this.drawOff)}}},n.prototype.setSelectionSense=function(e,t){e===void 0&&(e=!0),t===void 0&&(t=!0),this.isWholeEdge=e,this.isWholeNode=t},n.prototype.openSelectionSelect=function(){this.disabled||this.closeSelectionSelect(),this.container&&(this.cleanupSelectionState(),this.addEventListeners(),this.open())},n.prototype.closeSelectionSelect=function(){if(this.container){if(this.wrapper&&this.startPoint&&this.endPoint){var e=Ee(this.endPoint),t=new PointerEvent("pointerup",{clientX:e.x,clientY:e.y});this.drawOff(t)}this.cleanupSelectionState(),this.removeEventListeners(),this.close()}},n.prototype.open=function(){this.disabled=!1},n.prototype.close=function(){this.disabled=!0},n.pluginName="selectionSelect",n})(),eb=function(){return eb=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},eb.apply(this,arguments)},tb=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),qo=function(){return qo=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},qo.apply(this,arguments)},ls=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},D5={tr:"tl",lb:"tl",tl:"tr",rb:"tr",br:"bl",lt:"bl",bl:"br",rt:"br"};function R5(n){for(var e=n,t=1;t<e.length-1;){var r=ls(e[t-1],2),i=r[0],o=r[1],a=ls(e[t],2),s=a[0],l=a[1],u=ls(e[t+1],2),d=u[0],f=u[1];i===s&&s===d||o===l&&l===f?e.splice(t,1):t++}return e}function L5(n,e,t,r){var i=[n[0],n[1]],o=[n[0],n[1]];switch(t){case"tl":return e==="tr"?(i[1]+=r,o[0]+=r):e==="lb"&&(i[0]+=r,o[1]+=r),[i,o];case"tr":return e==="tl"?(i[1]+=r,o[0]-=r):e==="rb"&&(i[0]-=r,o[1]+=r),[i,o];case"bl":return e==="br"?(i[1]-=r,o[0]+=r):e==="lt"&&(i[0]+=r,o[1]-=r),[i,o];case"br":return e==="bl"?(i[1]-=r,o[0]-=r):e==="rt"&&(i[0]-=r,o[1]-=r),[i,o];default:return[]}}function I5(n,e,t,r){var i,o=1,a=function(g,y){var m=y[0]-g[0],O=y[1]-g[1],T=Math.abs(m),C=Math.abs(O);return C<=o&&T>o?m<0?"l":"r":T<=o&&C>o?O<0?"t":"b":T<=o&&C<=o?"":T<C?m<0?"l":"r":O<0?"t":"b"},s=a(n,e),l=a(e,t),u=Math.min(Math.hypot(e[0]-n[0],e[1]-n[1])/2,Math.hypot(t[0]-e[0],t[1]-e[1])/2,r)||1/5*r,d="".concat(s).concat(l),f=D5[d]||"-",c="";if(f==="-")c+="L ".concat(e[0]," ").concat(e[1]);else{var h=ls(L5(e,d,f,u),2),p=h[0],v=h[1];p&&v&&(c+="L ".concat(p[0]," ").concat(p[1]," Q ").concat(e[0]," ").concat(e[1]," ").concat(v[0]," ").concat(v[1]),i=ls(v,2),e[0]=i[0],e[1]=i[1])}return c}function k5(n,e){var t=0,r="";if(n.length===2)r+="M".concat(n[t][0]," ").concat(n[t++][1]," L ").concat(n[t][0]," ").concat(n[t][1]);else{for(r+="M".concat(n[t][0]," ").concat(n[t++][1]);t+1<n.length;){var i=n[t-1],o=n[t],a=n[t+++1];r+=I5(i,o,a,e)}r+="L ".concat(n[t][0]," ").concat(n[t][1])}return r}(function(n){tb(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getEdge=function(){var t=this.props.model,r=t.points,i=t.isAnimation,o=t.arrowConfig,a=t.radius,s=a===void 0?5:a,l=t.getEdgeStyle(),u=t.getEdgeAnimationStyle(),d=R5(r.split(" ").map(function(h){return h.split(",").map(function(p){return+p})})),f=k5(d,s),c=qo(qo(qo({style:i?u:{}},l),o),{fill:"none"});return ae("path",qo({d:f},c))},e})(ns),(function(n){tb(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e})(Xa);var nb=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),ju=function(){return ju=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},ju.apply(this,arguments)},rb=function(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,o=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(a)throw a.error}}return o},ib=function(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return n.concat(o||Array.prototype.slice.call(e))},j5=(function(n){nb(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var t=this.props.model,r=t.id,i=t.x,o=t.y,a=t.width,s=t.height,l=t.properties,u=this.props.model.getNodeStyle();return ae("svg",{x:i-a/2,y:o-s/2,width:50,height:24,style:"z-index: 0; background: none; overflow: auto;"},[l.labelText?ae("text",{x:0,y:-5,fontSize:"16px",fill:u.stroke},l.labelText):"",l.disabledDelete?"":ae("text",{x:l.labelText?50:0,y:-5,fontSize:"24px",cursor:"pointer",fill:u.stroke,onclick:this.handleCustomDeleteIconClick.bind(this,r)},"x")])},e.prototype.getShape=function(){var t=this.props.model,r=t.x,i=t.y,o=t.width,a=t.height,s=t.id,l=this.props.model.getNodeStyle();return ae("g",{},[ae("rect",ju(ju({},l),{x:r-o/2,y:i-a/2,width:o,height:a,id:s})),this.getLabelShape()])},e.prototype.toFront=function(){},e.prototype.handleCustomDeleteIconClick=function(t){var r=this.props.graphModel;r.deleteNode(t)},e})(Go),B5=(function(n){nb(e,n);function e(){var t=n.apply(this,ib([],rb(arguments),!1))||this;return t.d=10,t.isResize=!1,t}return e.prototype.initNodeData=function(t){t.text={value:"",x:t.x,y:t.y,draggable:!1,editable:!1},n.prototype.initNodeData.call(this,t),this.zIndex=0,this.draggable=!0},e.prototype.setAttributes=function(){var t=this,r;this.points=[],((r=this.properties)===null||r===void 0?void 0:r.node_selection_ids).length>1&&setTimeout(function(){var i;t.updatePointsByNodes(((i=t.properties)===null||i===void 0?void 0:i.node_selection_ids)||[])})},e.prototype.getNodeStyle=function(){var t=n.prototype.getNodeStyle.call(this);return t.stroke=this.properties.strokeColor||"#008000",t.strokeDasharray="10 5",t},e.prototype.getDefaultAnchor=function(){return[]},e.prototype.updatePoints=function(t){this.points=t},e.prototype.updateCoordinate=function(t){var r=t.x,i=t.y;this.x=r,this.y=i},e.prototype.updatePointsByNodes=function(t){var r=this,i=[],o=1/0,a=1/0,s=-1/0,l=-1/0;t.forEach(function(u){var d=r.graphModel.getNodeModelById(u);if(d){var f=d.width,c=d.height,h=d.x,p=d.y;o=Math.min(o,h-f/2-r.d),a=Math.min(a,p-c/2-r.d),s=Math.max(s,h+f/2+r.d),l=Math.max(l,p+c/2+r.d)}}),i.push([o,a],[s,a],[s,l],[o,l]),![o,a,s,l].some(function(u){return Math.abs(u)===1/0})&&(this.updatePoints(i),this.updateCoordinate({x:(s+o)/2,y:(l+a)/2}))},e.prototype.resize=function(t){var r;this.isResize=!0;for(var i=t.width,o=t.height,a={x:i/this.width,y:o/this.height},s=(this.properties.node_selection_ids||[]).slice(),l=[],u=new Set;s.length;){var d=s.shift(),f=(r=this.graphModel.nodesMap[d])===null||r===void 0?void 0:r.model;if(f){if(!Bu(f)){l.push(f);continue}u.has(f.id)||(u.add(f.id),s.push.apply(s,ib([],rb(f.properties.node_selection_ids||[]),!1)))}}var c={x:this.x-this.width/2,y:this.y-this.height/2},h=n.prototype.resize.call(this,t),p={x:this.x-this.width/2,y:this.y-this.height/2};return l.forEach(function(v){v.width=v.width*a.x,v.height=v.height*a.y;var g=(v.x-c.x)*a.x+p.x-v.x,y=(v.y-c.y)*a.y+p.y-v.y;v.move(g,y,!0)}),this.isResize=!1,h},e})(Jl),th="node-selection";(function(){function n(e){var t=e.lf;this.selectNodes=[],this.d=10,this.lf=t,t.register({type:th,view:j5,model:B5})}return Object.defineProperty(n.prototype,"selectNodesIds",{get:function(){return this.selectNodes.map(function(e){return e.id})},enumerable:!1,configurable:!0}),n.prototype.addNodeSelection=function(){var e=this.lf.addNode({type:"node-selection",text:"",properties:{node_selection_ids:this.selectNodesIds},x:0,y:0});e.updatePointsByNodes(this.selectNodesIds)},n.prototype.updateNodeSelection=function(){var e,t=this.getNodeSelection();t&&(this.lf.setProperties(t.id,{node_selection_ids:this.selectNodesIds}),(e=this.lf.getNodeModelById(t.id))===null||e===void 0||e.updatePointsByNodes(this.selectNodesIds))},n.prototype.getNodeSelection=function(){var e=this,t=this.selectNodesIds,r=this.lf.getGraphRawData(),i=t.filter(function(o){return o!==e.currentClickNode.id});return r.nodes.find(function(o){if(o.type==="node-selection"){var a=ci(o,"properties.node_selection_ids",[]);return i.every(function(s){return a.includes(s)})}return!1})},n.prototype.onNodeChange=function(e,t){var r=e.graphModel.nodes.filter(function(i){if(!Bu(i))return!1;var o=i.properties.node_selection_ids||[];return o.includes(t.id)});Promise.resolve().then(function(){r.forEach(function(i){i.updatePointsByNodes(i.properties.node_selection_ids||[])})})},n.prototype.render=function(e){var t=this;this.lf=e,e.on("node:click",function(r){var i;if(!(!r.e.shiftKey||r.data.type===th)){t.currentClickNode=r.data;var o=!1;t.selectNodesIds.includes(r.data.id)&&((i=t.lf.getNodeModelById(r.data.id))===null||i===void 0||i.setSelected(!1),o=!0);var a=e.getSelectElements(!0).nodes;t.selectNodes=a,t.selectNodes.length===1?o?t.updateNodeSelection():t.addNodeSelection():t.selectNodes.length>1&&t.updateNodeSelection()}}),e.graphModel.addNodeMoveRules(function(r,i,o){if(t.onNodeChange(e,r),Bu(r)&&!r.isResize){var a=r.properties.node_selection_ids||[];return e.graphModel.moveNodes(a,i,o,!0),!0}return!0}),e.graphModel.addNodeResizeRules(function(r){return Bu(r)||t.onNodeChange(e,r),!0})},n.pluginName="node-selection",n})();var Bu=function(n){return!!(n&&n.type===th)},F5=(function(){var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},n(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}})(),Fu=function(){return Fu=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},Fu.apply(this,arguments)};(function(n){F5(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.getLabelShape=function(){var t=this.props.model,r=t.x,i=t.y,o=t.width,a=t.height,s=t.properties;return ae("text",{x:r-o/2+5,y:i-a/2+16,fontSize:12,fill:"blue"},s.moreText)},e.prototype.getShape=function(){var t=this.props.model,r=t.x,i=t.y,o=t.width,a=t.height,s=this.props.model.getNodeStyle();return ae("g",{},[ae("rect",Fu(Fu({},s),{fill:"#FFFFFF",x:r-o/2,y:i-a/2})),this.getLabelShape()])},e})($n);const $5=[{type:"start",label:"开始节点",icon:"https://cdn.jsdelivr.net/gh/LogicFlow/static@latest/docs/static/start.png"},{type:"approval",label:"审批节点",icon:"https://cdn.jsdelivr.net/gh/LogicFlow/static@latest/docs/static/approve.png"},{type:"condition",label:"条件分支",icon:"https://cdn.jsdelivr.net/gh/LogicFlow/static@latest/docs/static/condition.png"},{type:"copy",label:"抄送节点",icon:"https://cdn.jsdelivr.net/gh/LogicFlow/static@latest/docs/static/copy.png"},{type:"end",label:"结束节点",icon:"https://cdn.jsdelivr.net/gh/LogicFlow/static@latest/docs/static/end.png"}],ob=({processDefinitionId:n,initialData:e,readOnly:t=!1,onSave:r,onDeploy:i})=>{const o=Wn.useRef(null),a=Wn.useRef(null),s=Wn.useCallback(()=>{if(!o.current)return;Ai.use(A5),Ai.use(N5),Ai.use(C5),Ai.use(T5),Ai.use(P5);const u=new Ai({container:o.current,grid:{size:20,visible:!0,type:"dot",config:{color:"#e5e5e5"}},keyboard:{enabled:!0},snapline:!0,outline:!0,textEdit:!t,isSilentMode:t,style:{rect:{rx:4,ry:4}}});r4(u),u.extension.dndPanel.setPatternItems($5.map(d=>({type:d.type,label:d.label,icon:d.icon,className:Hu.dndItem}))),u.render(e||{nodes:[{id:"start-1",type:"start",x:100,y:300,text:"开始"}],edges:[]}),a.current=u},[e,t]);Wn.useEffect(()=>{if(typeof Ai<"u")s();else{const u=setInterval(()=>{typeof Ai<"u"&&(clearInterval(u),s())},300);return()=>clearInterval(u)}return()=>{var u;(u=a.current)==null||u.destroy(),a.current=null}},[s]);const l=Wn.useCallback(()=>{var u;return((u=a.current)==null?void 0:u.getGraphData())||null},[]);return Wn.useImperativeHandle(Wn.useRef().current,()=>({getGraphData:l}),[l]),ra.jsxs("div",{className:Hu.designerContainer,children:[ra.jsx("div",{ref:o,className:Hu.canvas,style:{height:"70vh"}}),ra.jsxs("div",{style:{marginTop:16,display:"flex",gap:12},children:[ra.jsx("button",{onClick:()=>r==null?void 0:r(l()),style:{padding:"8px 16px",backgroundColor:"#1677ff",color:"#fff",border:"none",borderRadius:4,cursor:"pointer"},children:"保存流程"}),ra.jsx("button",{onClick:()=>i==null?void 0:i(),style:{padding:"8px 16px",backgroundColor:"#52c41a",color:"#fff",border:"none",borderRadius:4,cursor:"pointer"},children:"部署流程"})]})]})};Bt.FlowDesigner=ob,Bt.default=ob,Object.defineProperties(Bt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|