*/(function(o){"use strict";r=[n("b8cc")],i=o,s="function"===typeof i?i.apply(e,r):i,void 0===s||(t.exports=s)})((function(t){"use strict";var e,n,i=!!t.fn.on,r=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],s="onwheel"in window.document||window.document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],o=Array.prototype.slice;if(t.event.fixHooks)for(var a=r.length;a;)t.event.fixHooks[r[--a]]=t.event.mouseHooks;var l=t.event.special.mousewheel={version:"3.2.2",setup:function(){if(this.addEventListener)for(var e=s.length;e;)this.addEventListener(s[--e],h,!1);else this.onmousewheel=h;t.data(this,"mousewheel-line-height",l.getLineHeight(this)),t.data(this,"mousewheel-page-height",l.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=s.length;e;)this.removeEventListener(s[--e],h,!1);else this.onmousewheel=null;t.removeData(this,"mousewheel-line-height"),t.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var n=t(e),i=n["offsetParent"in t.fn?"offsetParent":"parent"]();return i.length||(i=t("body")),parseInt(i.css("fontSize"),10)||parseInt(n.css("fontSize"),10)||16},getPageHeight:function(e){return t(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function h(i){var r=i||window.event,s=o.call(arguments,1),a=0,h=0,u=0,d=0;if(i=t.event.fix(r),i.type="mousewheel","detail"in r&&(u=-1*r.detail),"wheelDelta"in r&&(u=r.wheelDelta),"wheelDeltaY"in r&&(u=r.wheelDeltaY),"wheelDeltaX"in r&&(h=-1*r.wheelDeltaX),"axis"in r&&r.axis===r.HORIZONTAL_AXIS&&(h=-1*u,u=0),a=0===u?h:u,"deltaY"in r&&(u=-1*r.deltaY,a=u),"deltaX"in r&&(h=r.deltaX,0===u&&(a=-1*h)),0!==u||0!==h){if(1===r.deltaMode){var g=t.data(this,"mousewheel-line-height");a*=g,u*=g,h*=g}else if(2===r.deltaMode){var p=t.data(this,"mousewheel-page-height");a*=p,u*=p,h*=p}if(d=Math.max(Math.abs(u),Math.abs(h)),(!n||d<n)&&(n=d,c(r,d)&&(n/=40)),c(r,d)&&(a/=40,h/=40,u/=40),a=Math[a>=1?"floor":"ceil"](a/n),h=Math[h>=1?"floor":"ceil"](h/n),u=Math[u>=1?"floor":"ceil"](u/n),l.settings.normalizeOffset&&this.getBoundingClientRect){var f=this.getBoundingClientRect();i.offsetX=i.clientX-f.left,i.offsetY=i.clientY-f.top}return i.deltaX=h,i.deltaY=u,i.deltaFactor=n,i.deltaMode=0,s.unshift(i,a,h,u),e&&window.clearTimeout(e),e=window.setTimeout((function(){n=null}),200),(t.event.dispatch||t.event.handle).apply(this,s)}}function c(t,e){return l.settings.adjustOldDeltas&&"mousewheel"===t.type&&e%120===0}t.fn.extend({mousewheel:function(t){return t?this[i?"on":"bind"]("mousewheel",t):this.trigger("mousewheel")},unmousewheel:function(t){return this[i?"off":"unbind"]("mousewheel",t)}})}))},"29e9":function(t,e,n){"use strict";(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e["a"]=n}).call(this,n("a282"))},3522:function(t,e,n){"use strict";n.d(e,"h",(function(){return r})),n.d(e,"c",(function(){return a})),n.d(e,"b",(function(){return SC})),n.d(e,"j",(function(){return $w})),n.d(e,"f",(function(){return SO})),n.d(e,"e",(function(){return iA})),n.d(e,"g",(function(){return VO})),n.d(e,"d",(function(){return Kk})),n.d(e,"k",(function(){return A})),n.d(e,"a",(function(){return S})),n.d(e,"i",(function(){return E}));var i={};n.r(i),n.d(i,"isArray",(function(){return q})),n.d(i,"isArrayLike",(function(){return At})),n.d(i,"uniq",(function(){return Tn})),n.d(i,"union",(function(){return vi})),n.d(i,"sortedIndex",(function(){return Fi})),n.d(i,"sortedIndexBy",(function(){return Pa})),n.d(i,"sortBy",(function(){return Ka})),n.d(i,"groupBy",(function(){return cl})),n.d(i,"difference",(function(){return fl})),n.d(i,"max",(function(){return wl})),n.d(i,"diff",(function(){return xl}));var r={};n.r(r),n.d(r,"has",(function(){return kl})),n.d(r,"pick",(function(){return Ul})),n.d(r,"forIn",(function(){return ih})),n.d(r,"merge",(function(){return $h})),n.d(r,"extend",(function(){return _h})),n.d(r,"isEqual",(function(){return Uh})),n.d(r,"isEmpty",(function(){return Zh})),n.d(r,"isObject",(function(){return pt})),n.d(r,"isPlainObject",(function(){return Oh})),n.d(r,"clone",(function(){return Iu})),n.d(r,"cloneDeep",(function(){return _u})),n.d(r,"defaults",(function(){return Xu})),n.d(r,"defaultsDeep",(function(){return Qu})),n.d(r,"applyMixins",(function(){return td})),n.d(r,"inherit",(function(){return nd})),n.d(r,"createClass",(function(){return sd})),n.d(r,"ensure",(function(){return od})),n.d(r,"getValue",(function(){return ad})),n.d(r,"getNumber",(function(){return ld})),n.d(r,"getBoolean",(function(){return hd})),n.d(r,"isMaliciousProp",(function(){return cd})),n.d(r,"getByPath",(function(){return ud})),n.d(r,"setByPath",(function(){return dd})),n.d(r,"unsetByPath",(function(){return gd})),n.d(r,"flatten",(function(){return pd}));var s={};n.r(s),n.d(s,"isString",(function(){return bd})),n.d(s,"toString",(function(){return Qo})),n.d(s,"escape",(function(){return Sd})),n.d(s,"unescape",(function(){return jd})),n.d(s,"startsWith",(function(){return ng})),n.d(s,"endsWith",(function(){return rg})),n.d(s,"split",(function(){return Qg})),n.d(s,"repeat",(function(){return sp})),n.d(s,"pad",(function(){return Rp})),n.d(s,"padEnd",(function(){return Vp})),n.d(s,"padStart",(function(){return Gp})),n.d(s,"truncate",(function(){return Xp})),n.d(s,"template",(function(){return Tf})),n.d(s,"uniqueId",(function(){return Lf})),n.d(s,"eval",(function(){return Ff})),n.d(s,"lowerFirst",(function(){return ub})),n.d(s,"upperFirst",(function(){return Qm})),n.d(s,"camelCase",(function(){return sb})),n.d(s,"kebabCase",(function(){return gb})),n.d(s,"pascalCase",(function(){return pb})),n.d(s,"constantCase",(function(){return fb})),n.d(s,"dotCase",(function(){return mb})),n.d(s,"pathCase",(function(){return bb})),n.d(s,"sentenceCase",(function(){return yb})),n.d(s,"titleCase",(function(){return Cb})),n.d(s,"hashcode",(function(){return vb})),n.d(s,"uuid",(function(){return wb})),n.d(s,"sanitizeHTML",(function(){return xb})),n.d(s,"getSpellingSuggestion",(function(){return Mb}));var o={};n.r(o),n.d(o,"isNaN",(function(){return kb})),n.d(o,"isNumber",(function(){return Ob})),n.d(o,"isFinite",(function(){return Nb})),n.d(o,"isInteger",(function(){return Lb})),n.d(o,"isSafeInteger",(function(){return Bb})),n.d(o,"clamp",(function(){return Ib})),n.d(o,"inRange",(function(){return Ub})),n.d(o,"toFinite",(function(){return Kd})),n.d(o,"toNumber",(function(){return qd})),n.d(o,"toInteger",(function(){return tg})),n.d(o,"toSafeInteger",(function(){return qb})),n.d(o,"parseInt",(function(){return Kb})),n.d(o,"isNumeric",(function(){return W})),n.d(o,"mod",(function(){return Qb})),n.d(o,"random",(function(){return ty})),n.d(o,"isPercentage",(function(){return ey})),n.d(o,"normalizePercentage",(function(){return ny})),n.d(o,"parseCssNumeric",(function(){return iy})),n.d(o,"normalizeSides",(function(){return ry}));var a={};n.r(a),n.d(a,"isFunction",(function(){return vt})),n.d(a,"once",(function(){return hy})),n.d(a,"noop",(function(){return wn})),n.d(a,"debounce",(function(){return my})),n.d(a,"defer",(function(){return wy})),n.d(a,"apply",(function(){return xy})),n.d(a,"call",(function(){return My})),n.d(a,"cacher",(function(){return Ay})),n.d(a,"isAsyncLike",(function(){return Sy})),n.d(a,"isAsync",(function(){return Oy})),n.d(a,"toAsyncBoolean",(function(){return Py})),n.d(a,"toDeferredBoolean",(function(){return ky}));var l={};n.r(l),n.d(l,"annotate",(function(){return vC})),n.d(l,"findAnnotationsAtIndex",(function(){return wC})),n.d(l,"findAnnotationsBetweenIndexes",(function(){return xC})),n.d(l,"shiftAnnotations",(function(){return MC})),n.d(l,"sanitize",(function(){return EC}));var h={};n.r(h),n.d(h,"requestAnimationFrame",(function(){return DC})),n.d(h,"cancelAnimationFrame",(function(){return TC})),n.d(h,"CASE_SENSITIVE_ATTR",(function(){return cC})),n.d(h,"getAttribute",(function(){return uC})),n.d(h,"removeAttribute",(function(){return dC})),n.d(h,"setAttribute",(function(){return gC})),n.d(h,"setAttributes",(function(){return pC})),n.d(h,"attr",(function(){return fC})),n.d(h,"qualifyAttr",(function(){return mC})),n.d(h,"kebablizeAttrs",(function(){return bC})),n.d(h,"styleToObject",(function(){return yC})),n.d(h,"mergeAttrs",(function(){return CC})),n.d(h,"uniqueId",(function(){return Iy})),n.d(h,"ensureId",(function(){return Vy})),n.d(h,"isSVGGraphicsElement",(function(){return $y})),n.d(h,"ns",(function(){return Gy})),n.d(h,"svgVersion",(function(){return _y})),n.d(h,"createElement",(function(){return Hy})),n.d(h,"createElementNS",(function(){return Uy})),n.d(h,"createSvgElement",(function(){return Wy})),n.d(h,"createSvgDocument",(function(){return Xy})),n.d(h,"parseXML",(function(){return qy})),n.d(h,"tagName",(function(){return Yy})),n.d(h,"index",(function(){return Jy})),n.d(h,"find",(function(){return Zy})),n.d(h,"findOne",(function(){return Ky})),n.d(h,"findParentByClass",(function(){return Qy})),n.d(h,"contains",(function(){return tC})),n.d(h,"remove",(function(){return eC})),n.d(h,"empty",(function(){return nC})),n.d(h,"append",(function(){return iC})),n.d(h,"prepend",(function(){return rC})),n.d(h,"before",(function(){return sC})),n.d(h,"appendTo",(function(){return oC})),n.d(h,"isHTMLElement",(function(){return aC})),n.d(h,"clickable",(function(){return lC})),n.d(h,"isInputElement",(function(){return hC})),n.d(h,"getClass",(function(){return jy})),n.d(h,"hasClass",(function(){return Ly})),n.d(h,"addClass",(function(){return Fy})),n.d(h,"removeClass",(function(){return zy})),n.d(h,"toggleClass",(function(){return By})),n.d(h,"setPrefixedStyle",(function(){return IC})),n.d(h,"getComputedStyle",(function(){return VC})),n.d(h,"hasScrollbars",(function(){return $C})),n.d(h,"getVendorPrefixedName",(function(){return RC})),n.d(h,"clearSelection",(function(){return GC})),n.d(h,"text",(function(){return kv})),n.d(h,"breakText",(function(){return Tv})),n.d(h,"KAPPA",(function(){return Nv})),n.d(h,"sample",(function(){return Lv})),n.d(h,"lineToPathData",(function(){return Fv})),n.d(h,"polygonToPathData",(function(){return zv})),n.d(h,"polylineToPathData",(function(){return Bv})),n.d(h,"getPointsFromSvgElement",(function(){return Iv})),n.d(h,"circleToPathData",(function(){return Vv})),n.d(h,"ellipseToPathData",(function(){return $v})),n.d(h,"rectangleToPathData",(function(){return Gv})),n.d(h,"rectToPathData",(function(){return _v})),n.d(h,"toPath",(function(){return Hv})),n.d(h,"toPathData",(function(){return Uv})),n.d(h,"createSlicePathData",(function(){return Wv})),n.d(h,"bbox",(function(){return gw})),n.d(h,"getBBox",(function(){return pw})),n.d(h,"getBBoxByElementAttr",(function(){return fw})),n.d(h,"getMatrixByElementAttr",(function(){return mw})),n.d(h,"getTransformToElement",(function(){return bw})),n.d(h,"toLocalPoint",(function(){return yw})),n.d(h,"toGeometryShape",(function(){return Cw})),n.d(h,"getIntersection",(function(){return vw})),n.d(h,"animate",(function(){return ww})),n.d(h,"animateTransform",(function(){return xw})),n.d(h,"animateAlongPath",(function(){return Aw})),n.d(h,"getBoundingOffsetRect",(function(){return Sw})),n.d(h,"createSVGPoint",(function(){return Zv})),n.d(h,"createSVGMatrix",(function(){return Kv})),n.d(h,"createSVGTransform",(function(){return Qv})),n.d(h,"transformStringToMatrix",(function(){return tw})),n.d(h,"matrixToTransformString",(function(){return ew})),n.d(h,"parseTransformString",(function(){return nw})),n.d(h,"decomposeMatrix",(function(){return rw})),n.d(h,"matrixToScale",(function(){return sw})),n.d(h,"matrixToRotation",(function(){return ow})),n.d(h,"matrixToTranslation",(function(){return aw})),n.d(h,"transformPoint",(function(){return lw})),n.d(h,"transformLine",(function(){return hw})),n.d(h,"transformPolyline",(function(){return cw})),n.d(h,"transformRectangle",(function(){return uw})),n.d(h,"transform",(function(){return Ow})),n.d(h,"translate",(function(){return Pw})),n.d(h,"rotate",(function(){return kw})),n.d(h,"scale",(function(){return Dw})),n.d(h,"translateAndAutoOrient",(function(){return Tw})),n.d(h,"MouseWheelHandle",(function(){return Nw})),n.d(h,"isVector",(function(){return jw})),n.d(h,"createVector",(function(){return Lw})),n.d(h,"createVectors",(function(){return Fw}));var c={};n.r(c),n.d(c,"block",(function(){return $x})),n.d(c,"classic",(function(){return Gx})),n.d(c,"diamond",(function(){return Ux})),n.d(c,"path",(function(){return Xx})),n.d(c,"cross",(function(){return Yx})),n.d(c,"async",(function(){return Zx})),n.d(c,"circle",(function(){return Qx})),n.d(c,"circlePlus",(function(){return tM})),n.d(c,"ellipse",(function(){return nM}));var u={};n.r(u),n.d(u,"ref",(function(){return Hw})),n.d(u,"refX",(function(){return Uw})),n.d(u,"refY",(function(){return Ww})),n.d(u,"refDx",(function(){return Xw})),n.d(u,"refDy",(function(){return qw})),n.d(u,"refWidth",(function(){return Yw})),n.d(u,"refHeight",(function(){return Jw})),n.d(u,"refRx",(function(){return Zw})),n.d(u,"refRy",(function(){return Kw})),n.d(u,"refRInscribed",(function(){return Qw})),n.d(u,"refRCircumscribed",(function(){return tx})),n.d(u,"refCx",(function(){return ex})),n.d(u,"refCy",(function(){return nx})),n.d(u,"refDResetOffset",(function(){return ix})),n.d(u,"refDKeepOffset",(function(){return rx})),n.d(u,"refPointsResetOffset",(function(){return sx})),n.d(u,"refPointsKeepOffset",(function(){return ox})),n.d(u,"refR",(function(){return ax})),n.d(u,"refD",(function(){return lx})),n.d(u,"refPoints",(function(){return hx})),n.d(u,"refX2",(function(){return cx})),n.d(u,"refY2",(function(){return ux})),n.d(u,"refWidth2",(function(){return dx})),n.d(u,"refHeight2",(function(){return gx})),n.d(u,"fill",(function(){return Cx})),n.d(u,"stroke",(function(){return vx})),n.d(u,"text",(function(){return wx})),n.d(u,"textWrap",(function(){return xx})),n.d(u,"lineHeight",(function(){return Ex})),n.d(u,"textVerticalAnchor",(function(){return Ax})),n.d(u,"textPath",(function(){return Sx})),n.d(u,"annotations",(function(){return Ox})),n.d(u,"eol",(function(){return Px})),n.d(u,"displayEmpty",(function(){return kx})),n.d(u,"title",(function(){return Dx})),n.d(u,"xAlign",(function(){return Tx})),n.d(u,"yAlign",(function(){return Nx})),n.d(u,"resetOffset",(function(){return jx})),n.d(u,"style",(function(){return Fx})),n.d(u,"html",(function(){return zx})),n.d(u,"filter",(function(){return Bx})),n.d(u,"port",(function(){return Rx})),n.d(u,"sourceMarker",(function(){return oM})),n.d(u,"targetMarker",(function(){return aM})),n.d(u,"vertexMarker",(function(){return lM})),n.d(u,"connection",(function(){return dM})),n.d(u,"atConnectionLengthKeepGradient",(function(){return gM})),n.d(u,"atConnectionLengthIgnoreGradient",(function(){return pM})),n.d(u,"atConnectionRatioKeepGradient",(function(){return fM})),n.d(u,"atConnectionRatioIgnoreGradient",(function(){return mM})),n.d(u,"atConnectionLength",(function(){return bM})),n.d(u,"atConnectionRatio",(function(){return yM}));var d={};n.r(d),n.d(d,"dot",(function(){return wM})),n.d(d,"fixedDot",(function(){return xM})),n.d(d,"mesh",(function(){return MM})),n.d(d,"doubleMesh",(function(){return EM}));var g={};n.r(g),n.d(g,"outline",(function(){return PM})),n.d(g,"highlight",(function(){return kM})),n.d(g,"blur",(function(){return DM})),n.d(g,"dropShadow",(function(){return TM})),n.d(g,"grayScale",(function(){return NM})),n.d(g,"sepia",(function(){return jM})),n.d(g,"saturate",(function(){return LM})),n.d(g,"hueRotate",(function(){return FM})),n.d(g,"invert",(function(){return zM})),n.d(g,"brightness",(function(){return BM})),n.d(g,"contrast",(function(){return RM}));var p={};n.r(p),n.d(p,"flipX",(function(){return VM})),n.d(p,"flipY",(function(){return $M})),n.d(p,"flipXY",(function(){return GM})),n.d(p,"watermark",(function(){return _M}));var f={};n.r(f),n.d(f,"className",(function(){return qM})),n.d(f,"opacity",(function(){return JM})),n.d(f,"stroke",(function(){return KM}));var m={};n.r(m),n.d(m,"absolute",(function(){return iE})),n.d(m,"ellipse",(function(){return rE})),n.d(m,"ellipseSpread",(function(){return sE})),n.d(m,"line",(function(){return lE})),n.d(m,"left",(function(){return hE})),n.d(m,"right",(function(){return cE})),n.d(m,"top",(function(){return uE})),n.d(m,"bottom",(function(){return dE}));var b={};n.r(b),n.d(b,"manual",(function(){return bE})),n.d(b,"left",(function(){return yE})),n.d(b,"right",(function(){return CE})),n.d(b,"top",(function(){return vE})),n.d(b,"bottom",(function(){return wE})),n.d(b,"outside",(function(){return xE})),n.d(b,"outsideOriented",(function(){return ME})),n.d(b,"inside",(function(){return EE})),n.d(b,"insideOriented",(function(){return AE})),n.d(b,"radial",(function(){return kE})),n.d(b,"radialOriented",(function(){return DE}));var y={};n.r(y),n.d(y,"noop",(function(){return YE})),n.d(y,"pinRelative",(function(){return tA})),n.d(y,"pinAbsolute",(function(){return eA}));var C={};n.r(C),n.d(C,"center",(function(){return PA})),n.d(C,"top",(function(){return kA})),n.d(C,"bottom",(function(){return DA})),n.d(C,"left",(function(){return TA})),n.d(C,"right",(function(){return NA})),n.d(C,"topLeft",(function(){return jA})),n.d(C,"topRight",(function(){return LA})),n.d(C,"bottomLeft",(function(){return FA})),n.d(C,"bottomRight",(function(){return zA})),n.d(C,"orth",(function(){return $A})),n.d(C,"nodeCenter",(function(){return GA})),n.d(C,"midSide",(function(){return HA}));var v={};n.r(v),n.d(v,"ratio",(function(){return WA})),n.d(v,"length",(function(){return XA})),n.d(v,"orth",(function(){return ZA})),n.d(v,"closest",(function(){return YA}));var w={};n.r(w),n.d(w,"bbox",(function(){return nS})),n.d(w,"rect",(function(){return iS})),n.d(w,"boundary",(function(){return rS})),n.d(w,"anchor",(function(){return oS}));var x={};n.r(x),n.d(x,"normal",(function(){return lS})),n.d(x,"oneSide",(function(){return hS})),n.d(x,"orth",(function(){return mS})),n.d(x,"metro",(function(){return XS})),n.d(x,"manhattan",(function(){return US})),n.d(x,"er",(function(){return qS})),n.d(x,"loop",(function(){return JS}));var M={};n.r(M),n.d(M,"normal",(function(){return KS})),n.d(M,"loop",(function(){return QS})),n.d(M,"rounded",(function(){return tO})),n.d(M,"smooth",(function(){return eO})),n.d(M,"jumpover",(function(){return pO}));var E={};n.r(E),n.d(E,"Attr",(function(){return vM})),n.d(E,"Grid",(function(){return AM})),n.d(E,"Filter",(function(){return IM})),n.d(E,"Background",(function(){return HM})),n.d(E,"Highlighter",(function(){return tE})),n.d(E,"PortLayout",(function(){return pE})),n.d(E,"PortLabelLayout",(function(){return NE})),n.d(E,"NodeTool",(function(){return AA})),n.d(E,"EdgeTool",(function(){return SA})),n.d(E,"Marker",(function(){return iM})),n.d(E,"NodeAnchor",(function(){return UA})),n.d(E,"EdgeAnchor",(function(){return KA})),n.d(E,"ConnectionPoint",(function(){return aS})),n.d(E,"Router",(function(){return ZS})),n.d(E,"Connector",(function(){return fO})),n.d(E,"ConnectionStrategy",(function(){return nA})),n.d(E,"Registry",(function(){return Gw})),n.d(E,"create",(function(){return mO}));var A={};n.r(A),n.d(A,"Empty",(function(){return qO})),n.d(A,"Rect",(function(){return ZO})),n.d(A,"HeaderedRect",(function(){return KO})),n.d(A,"Circle",(function(){return QO})),n.d(A,"Cylinder",(function(){return eP})),n.d(A,"Ellipse",(function(){return nP})),n.d(A,"Polygon",(function(){return sP})),n.d(A,"Polyline",(function(){return oP})),n.d(A,"Path",(function(){return lP})),n.d(A,"TextBlock",(function(){return cP})),n.d(A,"Image",(function(){return uP})),n.d(A,"BorderedImage",(function(){return dP})),n.d(A,"EmbeddedImage",(function(){return gP})),n.d(A,"InscribedImage",(function(){return pP})),n.d(A,"Edge",(function(){return fP})),n.d(A,"ShadowEdge",(function(){return mP})),n.d(A,"DoubleEdge",(function(){return bP})),n.d(A,"HTML",(function(){return yP}));var S={};n.r(S),n.d(S,"AutoSave",(function(){return vP})),n.d(S,"Clipboard",(function(){return Qk})),n.d(S,"Halo",(function(){return nD})),n.d(S,"MiniMap",(function(){return IP})),n.d(S,"Scroller",(function(){return JP})),n.d(S,"Selection",(function(){return ek})),n.d(S,"Snapline",(function(){return GP})),n.d(S,"Transform",(function(){return nk})),n.d(S,"Knob",(function(){return FP})),n.d(S,"Dnd",(function(){return aD})),n.d(S,"Stencil",(function(){return hD}));var O=n("b8cc"),P=n.n(O);n("23f14");let k=!1,D=!1,T=!1,N=!1,j=!1,L=!1,F=!1,z=!1,B=!1,R=!1,I=!1,V=!1,$=!1,G=!1,_=!1,H=!1;if("object"===typeof navigator){const t=navigator.userAgent;k=t.indexOf("Macintosh")>=0,D=!!t.match(/(iPad|iPhone|iPod)/g),T=t.indexOf("Windows")>=0,N=t.indexOf("MSIE")>=0,j=!!t.match(/Trident\/7\./),L=!!t.match(/Edge\//),F=t.indexOf("Mozilla/")>=0&&t.indexOf("MSIE")<0&&t.indexOf("Edge/")<0,B=t.indexOf("Chrome/")>=0&&t.indexOf("Edge/")<0,R=t.indexOf("Opera/")>=0||t.indexOf("OPR/")>=0,I=t.indexOf("Firefox/")>=0,V=t.indexOf("AppleWebKit/")>=0&&t.indexOf("Chrome/")<0&&t.indexOf("Edge/")<0,"object"===typeof document&&(H=!document.createElementNS||""+document.createElementNS("http://www.w3.org/2000/svg","foreignObject")!=="[object SVGForeignObjectElement]"||t.indexOf("Opera/")>=0)}if("object"===typeof window&&(z=null!=window.chrome&&null!=window.chrome.app&&null!=window.chrome.app.runtime,G=null!=window.PointerEvent&&!k),"object"===typeof document){$="ontouchstart"in document.documentElement;try{const t=Object.defineProperty({},"passive",{get(){_=!0}}),e=document.createElement("div");e.addEventListener&&e.addEventListener("click",()=>{},t)}catch(cD){}}var U;if(function(t){t.IS_MAC=k,t.IS_IOS=D,t.IS_WINDOWS=T,t.IS_IE=N,t.IS_IE11=j,t.IS_EDGE=L,t.IS_NETSCAPE=F,t.IS_CHROME_APP=z,t.IS_CHROME=B,t.IS_OPERA=R,t.IS_FIREFOX=I,t.IS_SAFARI=V,t.SUPPORT_TOUCH=$,t.SUPPORT_POINTER=G,t.SUPPORT_PASSIVE=_,t.NO_FOREIGNOBJECT=H,t.SUPPORT_FOREIGNOBJECT=!t.NO_FOREIGNOBJECT}(U||(U={})),function(t){function e(){const t=window.module;return null!=t&&null!=t.hot&&null!=t.hot.status?t.hot.status():"unkonwn"}function n(){return"apply"===e()}t.getHMRStatus=e,t.isApplyingHMR=n;const i={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};function r(t){const e=document.createElement(i[t]||"div"),n="on"+t;let r=n in e;return r||(e.setAttribute(n,"return;"),r="function"===typeof e[n]),r}t.isEventSupported=r}(U||(U={})),U.SUPPORT_PASSIVE){P.a.event.special.touchstart={setup(t,e,n){if(!this.addEventListener)return!1;this.addEventListener("touchstart",n,{passive:!0})}};const t=P.a.event.special.mousewheel;if(t){const e=t.setup;t.setup=function(){const t=this.addEventListener;if(!t)return!1;this.addEventListener=(e,n)=>{t.call(this,e,n,{passive:!0})},e.call(this),this.addEventListener=t}}}window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),function(t){t.forEach(t=>{Object.prototype.hasOwnProperty.call(t,"append")||Object.defineProperty(t,"append",{configurable:!0,enumerable:!0,writable:!0,value(...t){const e=document.createDocumentFragment();t.forEach(t=>{const n=t instanceof Node;e.appendChild(n?t:document.createTextNode(String(t)))}),this.appendChild(e)}})})}([Element.prototype,Document.prototype,DocumentFragment.prototype]);const W=t=>!Array.isArray(t)&&t-parseFloat(t)+1>=0;var X=Array.isArray,q=X,Y=n("3848"),J=Y["a"].Symbol,Z=J,K=Object.prototype,Q=K.hasOwnProperty,tt=K.toString,et=Z?Z.toStringTag:void 0;function nt(t){var e=Q.call(t,et),n=t[et];try{t[et]=void 0;var i=!0}catch(s){}var r=tt.call(t);return i&&(e?t[et]=n:delete t[et]),r}var it=nt,rt=Object.prototype,st=rt.toString;function ot(t){return st.call(t)}var at=ot,lt="[object Null]",ht="[object Undefined]",ct=Z?Z.toStringTag:void 0;function ut(t){return null==t?void 0===t?ht:lt:ct&&ct in Object(t)?it(t):at(t)}var dt=ut;function gt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var pt=gt,ft="[object AsyncFunction]",mt="[object Function]",bt="[object GeneratorFunction]",yt="[object Proxy]";function Ct(t){if(!pt(t))return!1;var e=dt(t);return e==mt||e==bt||e==ft||e==yt}var vt=Ct,wt=9007199254740991;function xt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=wt}var Mt=xt;function Et(t){return null!=t&&Mt(t.length)&&!vt(t)}var At=Et,St=Y["a"]["__core-js_shared__"],Ot=St,Pt=function(){var t=/[^.]+$/.exec(Ot&&Ot.keys&&Ot.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function kt(t){return!!Pt&&Pt in t}var Dt=kt,Tt=Function.prototype,Nt=Tt.toString;function jt(t){if(null!=t){try{return Nt.call(t)}catch(e){}try{return t+""}catch(e){}}return""}var Lt=jt,Ft=/[\\^$.*+?()[\]{}|]/g,zt=/^\[object .+?Constructor\]$/,Bt=Function.prototype,Rt=Object.prototype,It=Bt.toString,Vt=Rt.hasOwnProperty,$t=RegExp("^"+It.call(Vt).replace(Ft,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Gt(t){if(!pt(t)||Dt(t))return!1;var e=vt(t)?$t:zt;return e.test(Lt(t))}var _t=Gt;function Ht(t,e){return null==t?void 0:t[e]}var Ut=Ht;function Wt(t,e){var n=Ut(t,e);return _t(n)?n:void 0}var Xt=Wt,qt=Xt(Object,"create"),Yt=qt;function Jt(){this.__data__=Yt?Yt(null):{},this.size=0}var Zt=Jt;function Kt(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Qt=Kt,te="__lodash_hash_undefined__",ee=Object.prototype,ne=ee.hasOwnProperty;function ie(t){var e=this.__data__;if(Yt){var n=e[t];return n===te?void 0:n}return ne.call(e,t)?e[t]:void 0}var re=ie,se=Object.prototype,oe=se.hasOwnProperty;function ae(t){var e=this.__data__;return Yt?void 0!==e[t]:oe.call(e,t)}var le=ae,he="__lodash_hash_undefined__";function ce(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Yt&&void 0===e?he:e,this}var ue=ce;function de(t){var e=-1,n=null==t?0:t.length;this.clear();while(++e<n){var i=t[e];this.set(i[0],i[1])}}de.prototype.clear=Zt,de.prototype["delete"]=Qt,de.prototype.get=re,de.prototype.has=le,de.prototype.set=ue;var ge=de;function pe(){this.__data__=[],this.size=0}var fe=pe;function me(t,e){return t===e||t!==t&&e!==e}var be=me;function ye(t,e){var n=t.length;while(n--)if(be(t[n][0],e))return n;return-1}var Ce=ye,ve=Array.prototype,we=ve.splice;function xe(t){var e=this.__data__,n=Ce(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():we.call(e,n,1),--this.size,!0}var Me=xe;function Ee(t){var e=this.__data__,n=Ce(e,t);return n<0?void 0:e[n][1]}var Ae=Ee;function Se(t){return Ce(this.__data__,t)>-1}var Oe=Se;function Pe(t,e){var n=this.__data__,i=Ce(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}var ke=Pe;function De(t){var e=-1,n=null==t?0:t.length;this.clear();while(++e<n){var i=t[e];this.set(i[0],i[1])}}De.prototype.clear=fe,De.prototype["delete"]=Me,De.prototype.get=Ae,De.prototype.has=Oe,De.prototype.set=ke;var Te=De,Ne=Xt(Y["a"],"Map"),je=Ne;function Le(){this.size=0,this.__data__={hash:new ge,map:new(je||Te),string:new ge}}var Fe=Le;function ze(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}var Be=ze;function Re(t,e){var n=t.__data__;return Be(e)?n["string"==typeof e?"string":"hash"]:n.map}var Ie=Re;function Ve(t){var e=Ie(this,t)["delete"](t);return this.size-=e?1:0,e}var $e=Ve;function Ge(t){return Ie(this,t).get(t)}var _e=Ge;function He(t){return Ie(this,t).has(t)}var Ue=He;function We(t,e){var n=Ie(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}var Xe=We;function qe(t){var e=-1,n=null==t?0:t.length;this.clear();while(++e<n){var i=t[e];this.set(i[0],i[1])}}qe.prototype.clear=Fe,qe.prototype["delete"]=$e,qe.prototype.get=_e,qe.prototype.has=Ue,qe.prototype.set=Xe;var Ye=qe,Je="__lodash_hash_undefined__";function Ze(t){return this.__data__.set(t,Je),this}var Ke=Ze;function Qe(t){return this.__data__.has(t)}var tn=Qe;function en(t){var e=-1,n=null==t?0:t.length;this.__data__=new Ye;while(++e<n)this.add(t[e])}en.prototype.add=en.prototype.push=Ke,en.prototype.has=tn;var nn=en;function rn(t,e,n,i){var r=t.length,s=n+(i?1:-1);while(i?s--:++s<r)if(e(t[s],s,t))return s;return-1}var sn=rn;function on(t){return t!==t}var an=on;function ln(t,e,n){var i=n-1,r=t.length;while(++i<r)if(t[i]===e)return i;return-1}var hn=ln;function cn(t,e,n){return e===e?hn(t,e,n):sn(t,an,n)}var un=cn;function dn(t,e){var n=null==t?0:t.length;return!!n&&un(t,e,0)>-1}var gn=dn;function pn(t,e,n){var i=-1,r=null==t?0:t.length;while(++i<r)if(n(e,t[i]))return!0;return!1}var fn=pn;function mn(t,e){return t.has(e)}var bn=mn,yn=Xt(Y["a"],"Set"),Cn=yn;function vn(){}var wn=vn;function xn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var Mn=xn,En=1/0,An=Cn&&1/Mn(new Cn([,-0]))[1]==En?function(t){return new Cn(t)}:wn,Sn=An,On=200;function Pn(t,e,n){var i=-1,r=gn,s=t.length,o=!0,a=[],l=a;if(n)o=!1,r=fn;else if(s>=On){var h=e?null:Sn(t);if(h)return Mn(h);o=!1,r=bn,l=new nn}else l=e?[]:a;t:while(++i<s){var c=t[i],u=e?e(c):c;if(c=n||0!==c?c:0,o&&u===u){var d=l.length;while(d--)if(l[d]===u)continue t;e&&l.push(u),a.push(c)}else r(l,u,n)||(l!==a&&l.push(u),a.push(c))}return a}var kn=Pn;function Dn(t){return t&&t.length?kn(t):[]}var Tn=Dn;function Nn(t,e){var n=-1,i=e.length,r=t.length;while(++n<i)t[r+n]=e[n];return t}var jn=Nn;function Ln(t){return null!=t&&"object"==typeof t}var Fn=Ln,zn="[object Arguments]";function Bn(t){return Fn(t)&&dt(t)==zn}var Rn=Bn,In=Object.prototype,Vn=In.hasOwnProperty,$n=In.propertyIsEnumerable,Gn=Rn(function(){return arguments}())?Rn:function(t){return Fn(t)&&Vn.call(t,"callee")&&!$n.call(t,"callee")},_n=Gn,Hn=Z?Z.isConcatSpreadable:void 0;function Un(t){return q(t)||_n(t)||!!(Hn&&t&&t[Hn])}var Wn=Un;function Xn(t,e,n,i,r){var s=-1,o=t.length;n||(n=Wn),r||(r=[]);while(++s<o){var a=t[s];e>0&&n(a)?e>1?Xn(a,e-1,n,i,r):jn(r,a):i||(r[r.length]=a)}return r}var qn=Xn;function Yn(t){return t}var Jn=Yn;function Zn(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var Kn=Zn,Qn=Math.max;function ti(t,e,n){return e=Qn(void 0===e?t.length-1:e,0),function(){var i=arguments,r=-1,s=Qn(i.length-e,0),o=Array(s);while(++r<s)o[r]=i[e+r];r=-1;var a=Array(e+1);while(++r<e)a[r]=i[r];return a[e]=n(o),Kn(t,this,a)}}var ei=ti;function ni(t){return function(){return t}}var ii=ni,ri=function(){try{var t=Xt(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),si=ri,oi=si?function(t,e){return si(t,"toString",{configurable:!0,enumerable:!1,value:ii(e),writable:!0})}:Jn,ai=oi,li=800,hi=16,ci=Date.now;function ui(t){var e=0,n=0;return function(){var i=ci(),r=hi-(i-n);if(n=i,r>0){if(++e>=li)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var di=ui,gi=di(ai),pi=gi;function fi(t,e){return pi(ei(t,e,Jn),t+"")}var mi=fi;function bi(t){return Fn(t)&&At(t)}var yi=bi,Ci=mi((function(t){return kn(qn(t,1,yi,!0))})),vi=Ci,wi="[object Symbol]";function xi(t){return"symbol"==typeof t||Fn(t)&&dt(t)==wi}var Mi=xi,Ei=4294967295,Ai=Ei-1,Si=Math.floor,Oi=Math.min;function Pi(t,e,n,i){var r=0,s=null==t?0:t.length;if(0===s)return 0;e=n(e);var o=e!==e,a=null===e,l=Mi(e),h=void 0===e;while(r<s){var c=Si((r+s)/2),u=n(t[c]),d=void 0!==u,g=null===u,p=u===u,f=Mi(u);if(o)var m=i||p;else m=h?p&&(i||d):a?p&&d&&(i||!g):l?p&&d&&!g&&(i||!f):!g&&!f&&(i?u<=e:u<e);m?r=c+1:s=c}return Oi(s,Ai)}var ki=Pi,Di=4294967295,Ti=Di>>>1;function Ni(t,e,n){var i=0,r=null==t?i:t.length;if("number"==typeof e&&e===e&&r<=Ti){while(i<r){var s=i+r>>>1,o=t[s];null!==o&&!Mi(o)&&(n?o<=e:o<e)?i=s+1:r=s}return r}return ki(t,e,Jn,n)}var ji=Ni;function Li(t,e){return ji(t,e)}var Fi=Li;function zi(){this.__data__=new Te,this.size=0}var Bi=zi;function Ri(t){var e=this.__data__,n=e["delete"](t);return this.size=e.size,n}var Ii=Ri;function Vi(t){return this.__data__.get(t)}var $i=Vi;function Gi(t){return this.__data__.has(t)}var _i=Gi,Hi=200;function Ui(t,e){var n=this.__data__;if(n instanceof Te){var i=n.__data__;if(!je||i.length<Hi-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new Ye(i)}return n.set(t,e),this.size=n.size,this}var Wi=Ui;function Xi(t){var e=this.__data__=new Te(t);this.size=e.size}Xi.prototype.clear=Bi,Xi.prototype["delete"]=Ii,Xi.prototype.get=$i,Xi.prototype.has=_i,Xi.prototype.set=Wi;var qi=Xi;function Yi(t,e){var n=-1,i=null==t?0:t.length;while(++n<i)if(e(t[n],n,t))return!0;return!1}var Ji=Yi,Zi=1,Ki=2;function Qi(t,e,n,i,r,s){var o=n&Zi,a=t.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var h=s.get(t),c=s.get(e);if(h&&c)return h==e&&c==t;var u=-1,d=!0,g=n&Ki?new nn:void 0;s.set(t,e),s.set(e,t);while(++u<a){var p=t[u],f=e[u];if(i)var m=o?i(f,p,u,e,t,s):i(p,f,u,t,e,s);if(void 0!==m){if(m)continue;d=!1;break}if(g){if(!Ji(e,(function(t,e){if(!bn(g,e)&&(p===t||r(p,t,n,i,s)))return g.push(e)}))){d=!1;break}}else if(p!==f&&!r(p,f,n,i,s)){d=!1;break}}return s["delete"](t),s["delete"](e),d}var tr=Qi,er=Y["a"].Uint8Array,nr=er;function ir(t){var e=-1,n=Array(t.size);return t.forEach((function(t,i){n[++e]=[i,t]})),n}var rr=ir,sr=1,or=2,ar="[object Boolean]",lr="[object Date]",hr="[object Error]",cr="[object Map]",ur="[object Number]",dr="[object RegExp]",gr="[object Set]",pr="[object String]",fr="[object Symbol]",mr="[object ArrayBuffer]",br="[object DataView]",yr=Z?Z.prototype:void 0,Cr=yr?yr.valueOf:void 0;function vr(t,e,n,i,r,s,o){switch(n){case br:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case mr:return!(t.byteLength!=e.byteLength||!s(new nr(t),new nr(e)));case ar:case lr:case ur:return be(+t,+e);case hr:return t.name==e.name&&t.message==e.message;case dr:case pr:return t==e+"";case cr:var a=rr;case gr:var l=i&sr;if(a||(a=Mn),t.size!=e.size&&!l)return!1;var h=o.get(t);if(h)return h==e;i|=or,o.set(t,e);var c=tr(a(t),a(e),i,r,s,o);return o["delete"](t),c;case fr:if(Cr)return Cr.call(t)==Cr.call(e)}return!1}var wr=vr;function xr(t,e,n){var i=e(t);return q(t)?i:jn(i,n(t))}var Mr=xr;function Er(t,e){var n=-1,i=null==t?0:t.length,r=0,s=[];while(++n<i){var o=t[n];e(o,n,t)&&(s[r++]=o)}return s}var Ar=Er;function Sr(){return[]}var Or=Sr,Pr=Object.prototype,kr=Pr.propertyIsEnumerable,Dr=Object.getOwnPropertySymbols,Tr=Dr?function(t){return null==t?[]:(t=Object(t),Ar(Dr(t),(function(e){return kr.call(t,e)})))}:Or,Nr=Tr;function jr(t,e){var n=-1,i=Array(t);while(++n<t)i[n]=e(n);return i}var Lr=jr,Fr=n("f73c"),zr=9007199254740991,Br=/^(?:0|[1-9]\d*)$/;function Rr(t,e){var n=typeof t;return e=null==e?zr:e,!!e&&("number"==n||"symbol"!=n&&Br.test(t))&&t>-1&&t%1==0&&t<e}var Ir=Rr,Vr="[object Arguments]",$r="[object Array]",Gr="[object Boolean]",_r="[object Date]",Hr="[object Error]",Ur="[object Function]",Wr="[object Map]",Xr="[object Number]",qr="[object Object]",Yr="[object RegExp]",Jr="[object Set]",Zr="[object String]",Kr="[object WeakMap]",Qr="[object ArrayBuffer]",ts="[object DataView]",es="[object Float32Array]",ns="[object Float64Array]",is="[object Int8Array]",rs="[object Int16Array]",ss="[object Int32Array]",os="[object Uint8Array]",as="[object Uint8ClampedArray]",ls="[object Uint16Array]",hs="[object Uint32Array]",cs={};function us(t){return Fn(t)&&Mt(t.length)&&!!cs[dt(t)]}cs[es]=cs[ns]=cs[is]=cs[rs]=cs[ss]=cs[os]=cs[as]=cs[ls]=cs[hs]=!0,cs[Vr]=cs[$r]=cs[Qr]=cs[Gr]=cs[ts]=cs[_r]=cs[Hr]=cs[Ur]=cs[Wr]=cs[Xr]=cs[qr]=cs[Yr]=cs[Jr]=cs[Zr]=cs[Kr]=!1;var ds=us;function gs(t){return function(e){return t(e)}}var ps=gs,fs=n("b885"),ms=fs["a"]&&fs["a"].isTypedArray,bs=ms?ps(ms):ds,ys=bs,Cs=Object.prototype,vs=Cs.hasOwnProperty;function ws(t,e){var n=q(t),i=!n&&_n(t),r=!n&&!i&&Object(Fr["a"])(t),s=!n&&!i&&!r&&ys(t),o=n||i||r||s,a=o?Lr(t.length,String):[],l=a.length;for(var h in t)!e&&!vs.call(t,h)||o&&("length"==h||r&&("offset"==h||"parent"==h)||s&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||Ir(h,l))||a.push(h);return a}var xs=ws,Ms=Object.prototype;function Es(t){var e=t&&t.constructor,n="function"==typeof e&&e.prototype||Ms;return t===n}var As=Es;function Ss(t,e){return function(n){return t(e(n))}}var Os=Ss,Ps=Os(Object.keys,Object),ks=Ps,Ds=Object.prototype,Ts=Ds.hasOwnProperty;function Ns(t){if(!As(t))return ks(t);var e=[];for(var n in Object(t))Ts.call(t,n)&&"constructor"!=n&&e.push(n);return e}var js=Ns;function Ls(t){return At(t)?xs(t):js(t)}var Fs=Ls;function zs(t){return Mr(t,Fs,Nr)}var Bs=zs,Rs=1,Is=Object.prototype,Vs=Is.hasOwnProperty;function $s(t,e,n,i,r,s){var o=n&Rs,a=Bs(t),l=a.length,h=Bs(e),c=h.length;if(l!=c&&!o)return!1;var u=l;while(u--){var d=a[u];if(!(o?d in e:Vs.call(e,d)))return!1}var g=s.get(t),p=s.get(e);if(g&&p)return g==e&&p==t;var f=!0;s.set(t,e),s.set(e,t);var m=o;while(++u<l){d=a[u];var b=t[d],y=e[d];if(i)var C=o?i(y,b,d,e,t,s):i(b,y,d,t,e,s);if(!(void 0===C?b===y||r(b,y,n,i,s):C)){f=!1;break}m||(m="constructor"==d)}if(f&&!m){var v=t.constructor,w=e.constructor;v==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof v&&v instanceof v&&"function"==typeof w&&w instanceof w||(f=!1)}return s["delete"](t),s["delete"](e),f}var Gs=$s,_s=Xt(Y["a"],"DataView"),Hs=_s,Us=Xt(Y["a"],"Promise"),Ws=Us,Xs=Xt(Y["a"],"WeakMap"),qs=Xs,Ys="[object Map]",Js="[object Object]",Zs="[object Promise]",Ks="[object Set]",Qs="[object WeakMap]",to="[object DataView]",eo=Lt(Hs),no=Lt(je),io=Lt(Ws),ro=Lt(Cn),so=Lt(qs),oo=dt;(Hs&&oo(new Hs(new ArrayBuffer(1)))!=to||je&&oo(new je)!=Ys||Ws&&oo(Ws.resolve())!=Zs||Cn&&oo(new Cn)!=Ks||qs&&oo(new qs)!=Qs)&&(oo=function(t){var e=dt(t),n=e==Js?t.constructor:void 0,i=n?Lt(n):"";if(i)switch(i){case eo:return to;case no:return Ys;case io:return Zs;case ro:return Ks;case so:return Qs}return e});var ao=oo,lo=1,ho="[object Arguments]",co="[object Array]",uo="[object Object]",go=Object.prototype,po=go.hasOwnProperty;function fo(t,e,n,i,r,s){var o=q(t),a=q(e),l=o?co:ao(t),h=a?co:ao(e);l=l==ho?uo:l,h=h==ho?uo:h;var c=l==uo,u=h==uo,d=l==h;if(d&&Object(Fr["a"])(t)){if(!Object(Fr["a"])(e))return!1;o=!0,c=!1}if(d&&!c)return s||(s=new qi),o||ys(t)?tr(t,e,n,i,r,s):wr(t,e,l,n,i,r,s);if(!(n&lo)){var g=c&&po.call(t,"__wrapped__"),p=u&&po.call(e,"__wrapped__");if(g||p){var f=g?t.value():t,m=p?e.value():e;return s||(s=new qi),r(f,m,n,i,s)}}return!!d&&(s||(s=new qi),Gs(t,e,n,i,r,s))}var mo=fo;function bo(t,e,n,i,r){return t===e||(null==t||null==e||!Fn(t)&&!Fn(e)?t!==t&&e!==e:mo(t,e,n,i,bo,r))}var yo=bo,Co=1,vo=2;function wo(t,e,n,i){var r=n.length,s=r,o=!i;if(null==t)return!s;t=Object(t);while(r--){var a=n[r];if(o&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}while(++r<s){a=n[r];var l=a[0],h=t[l],c=a[1];if(o&&a[2]){if(void 0===h&&!(l in t))return!1}else{var u=new qi;if(i)var d=i(h,c,l,t,e,u);if(!(void 0===d?yo(c,h,Co|vo,i,u):d))return!1}}return!0}var xo=wo;function Mo(t){return t===t&&!pt(t)}var Eo=Mo;function Ao(t){var e=Fs(t),n=e.length;while(n--){var i=e[n],r=t[i];e[n]=[i,r,Eo(r)]}return e}var So=Ao;function Oo(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}var Po=Oo;function ko(t){var e=So(t);return 1==e.length&&e[0][2]?Po(e[0][0],e[0][1]):function(n){return n===t||xo(n,t,e)}}var Do=ko,To=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,No=/^\w*$/;function jo(t,e){if(q(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Mi(t))||(No.test(t)||!To.test(t)||null!=e&&t in Object(e))}var Lo=jo,Fo="Expected a function";function zo(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(Fo);var n=function(){var i=arguments,r=e?e.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var o=t.apply(this,i);return n.cache=s.set(r,o)||s,o};return n.cache=new(zo.Cache||Ye),n}zo.Cache=Ye;var Bo=zo,Ro=500;function Io(t){var e=Bo(t,(function(t){return n.size===Ro&&n.clear(),t})),n=e.cache;return e}var Vo=Io,$o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Go=/\\(\\)?/g,_o=Vo((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace($o,(function(t,n,i,r){e.push(i?r.replace(Go,"$1"):n||t)})),e})),Ho=_o;function Uo(t,e){var n=-1,i=null==t?0:t.length,r=Array(i);while(++n<i)r[n]=e(t[n],n,t);return r}var Wo=Uo,Xo=1/0,qo=Z?Z.prototype:void 0,Yo=qo?qo.toString:void 0;function Jo(t){if("string"==typeof t)return t;if(q(t))return Wo(t,Jo)+"";if(Mi(t))return Yo?Yo.call(t):"";var e=t+"";return"0"==e&&1/t==-Xo?"-0":e}var Zo=Jo;function Ko(t){return null==t?"":Zo(t)}var Qo=Ko;function ta(t,e){return q(t)?t:Lo(t,e)?[t]:Ho(Qo(t))}var ea=ta,na=1/0;function ia(t){if("string"==typeof t||Mi(t))return t;var e=t+"";return"0"==e&&1/t==-na?"-0":e}var ra=ia;function sa(t,e){e=ea(e,t);var n=0,i=e.length;while(null!=t&&n<i)t=t[ra(e[n++])];return n&&n==i?t:void 0}var oa=sa;function aa(t,e,n){var i=null==t?void 0:oa(t,e);return void 0===i?n:i}var la=aa;function ha(t,e){return null!=t&&e in Object(t)}var ca=ha;function ua(t,e,n){e=ea(e,t);var i=-1,r=e.length,s=!1;while(++i<r){var o=ra(e[i]);if(!(s=null!=t&&n(t,o)))break;t=t[o]}return s||++i!=r?s:(r=null==t?0:t.length,!!r&&Mt(r)&&Ir(o,r)&&(q(t)||_n(t)))}var da=ua;function ga(t,e){return null!=t&&da(t,e,ca)}var pa=ga,fa=1,ma=2;function ba(t,e){return Lo(t)&&Eo(e)?Po(ra(t),e):function(n){var i=la(n,t);return void 0===i&&i===e?pa(n,t):yo(e,i,fa|ma)}}var ya=ba;function Ca(t){return function(e){return null==e?void 0:e[t]}}var va=Ca;function wa(t){return function(e){return oa(e,t)}}var xa=wa;function Ma(t){return Lo(t)?va(ra(t)):xa(t)}var Ea=Ma;function Aa(t){return"function"==typeof t?t:null==t?Jn:"object"==typeof t?q(t)?ya(t[0],t[1]):Do(t):Ea(t)}var Sa=Aa;function Oa(t,e,n){return ki(t,e,Sa(n,2))}var Pa=Oa;function ka(t){return function(e,n,i){var r=-1,s=Object(e),o=i(e),a=o.length;while(a--){var l=o[t?a:++r];if(!1===n(s[l],l,s))break}return e}}var Da=ka,Ta=Da(),Na=Ta;function ja(t,e){return t&&Na(t,e,Fs)}var La=ja;function Fa(t,e){return function(n,i){if(null==n)return n;if(!At(n))return t(n,i);var r=n.length,s=e?r:-1,o=Object(n);while(e?s--:++s<r)if(!1===i(o[s],s,o))break;return n}}var za=Fa,Ba=za(La),Ra=Ba;function Ia(t,e){var n=-1,i=At(t)?Array(t.length):[];return Ra(t,(function(t,r,s){i[++n]=e(t,r,s)})),i}var Va=Ia;function $a(t,e){var n=t.length;t.sort(e);while(n--)t[n]=t[n].value;return t}var Ga=$a;function _a(t,e){if(t!==e){var n=void 0!==t,i=null===t,r=t===t,s=Mi(t),o=void 0!==e,a=null===e,l=e===e,h=Mi(e);if(!a&&!h&&!s&&t>e||s&&o&&l&&!a&&!h||i&&o&&l||!n&&l||!r)return 1;if(!i&&!s&&!h&&t<e||h&&n&&r&&!i&&!s||a&&n&&r||!o&&r||!l)return-1}return 0}var Ha=_a;function Ua(t,e,n){var i=-1,r=t.criteria,s=e.criteria,o=r.length,a=n.length;while(++i<o){var l=Ha(r[i],s[i]);if(l){if(i>=a)return l;var h=n[i];return l*("desc"==h?-1:1)}}return t.index-e.index}var Wa=Ua;function Xa(t,e,n){e=e.length?Wo(e,(function(t){return q(t)?function(e){return oa(e,1===t.length?t[0]:t)}:t})):[Jn];var i=-1;e=Wo(e,ps(Sa));var r=Va(t,(function(t,n,r){var s=Wo(e,(function(e){return e(t)}));return{criteria:s,index:++i,value:t}}));return Ga(r,(function(t,e){return Wa(t,e,n)}))}var qa=Xa;function Ya(t,e,n){if(!pt(n))return!1;var i=typeof e;return!!("number"==i?At(n)&&Ir(e,n.length):"string"==i&&e in n)&&be(n[e],t)}var Ja=Ya,Za=mi((function(t,e){if(null==t)return[];var n=e.length;return n>1&&Ja(t,e[0],e[1])?e=[]:n>2&&Ja(e[0],e[1],e[2])&&(e=[e[0]]),qa(t,qn(e,1),[])})),Ka=Za;function Qa(t,e,n){"__proto__"==e&&si?si(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var tl=Qa;function el(t,e,n,i){var r=-1,s=null==t?0:t.length;while(++r<s){var o=t[r];e(i,o,n(o),t)}return i}var nl=el;function il(t,e,n,i){return Ra(t,(function(t,r,s){e(i,t,n(t),s)})),i}var rl=il;function sl(t,e){return function(n,i){var r=q(n)?nl:rl,s=e?e():{};return r(n,t,Sa(i,2),s)}}var ol=sl,al=Object.prototype,ll=al.hasOwnProperty,hl=ol((function(t,e,n){ll.call(t,n)?t[n].push(e):tl(t,n,[e])})),cl=hl,ul=200;function dl(t,e,n,i){var r=-1,s=gn,o=!0,a=t.length,l=[],h=e.length;if(!a)return l;n&&(e=Wo(e,ps(n))),i?(s=fn,o=!1):e.length>=ul&&(s=bn,o=!1,e=new nn(e));t:while(++r<a){var c=t[r],u=null==n?c:n(c);if(c=i||0!==c?c:0,o&&u===u){var d=h;while(d--)if(e[d]===u)continue t;l.push(c)}else s(e,u,i)||l.push(c)}return l}var gl=dl,pl=mi((function(t,e){return yi(t)?gl(t,qn(e,1,yi,!0)):[]})),fl=pl;function ml(t,e,n){var i=-1,r=t.length;while(++i<r){var s=t[i],o=e(s);if(null!=o&&(void 0===a?o===o&&!Mi(o):n(o,a)))var a=o,l=s}return l}var bl=ml;function yl(t,e){return t>e}var Cl=yl;function vl(t){return t&&t.length?bl(t,Jn,Cl):void 0}var wl=vl;function xl(t,e,n){const i=Ml(t,n),r=Ml(e,n),s=r.free,o=i.keyIndex,a=r.keyIndex,l=[],h=[];let c,u,d=0,g=0;while(d<t.length){if(c=t[d],u=c[n],u)if(a.hasOwnProperty(u)){const t=a[u];h.push(e[t])}else h.push(null);else{g+=1;const t=s[g];h.push(t||null)}d+=1}const p=h.slice(0);d=0;while(d<p.length)null===p[d]?(b(d),C(d)):d+=1;let f=d=0;while(d<e.length){c=e[d],u=c[n];const t=p[f];if(t){const e=t[n];if(u===e)f+=1;else if(o.hasOwnProperty(u)){const t=p[f+1];if(t){const e=t[n];e===u?(b(d),C(f),f+=1):y(d,c)}}else y(d,c)}else y(d,c);d+=1}let m=p.length-f;while((f+=1)<p.length)m-=1,b(m+d);function b(t){const e={index:t,type:0,item:null};l.push(e)}function y(t,e){const n={index:t,item:e,type:1};l.push(n)}function C(t){p.splice(t,1)}return{moves:l}}function Ml(t,e){const n={},i=[];for(let r=0,s=t.length;r<s;r+=1){const s=t[r],o=s[e];o?n[o]=r:i.push(s)}return{keyIndex:n,free:i}}var El=Object.prototype,Al=El.hasOwnProperty;function Sl(t,e){return null!=t&&Al.call(t,e)}var Ol=Sl;function Pl(t,e){return null!=t&&da(t,e,Ol)}var kl=Pl,Dl=Object.prototype,Tl=Dl.hasOwnProperty;function Nl(t,e,n){var i=t[e];Tl.call(t,e)&&be(i,n)&&(void 0!==n||e in t)||tl(t,e,n)}var jl=Nl;function Ll(t,e,n,i){if(!pt(t))return t;e=ea(e,t);var r=-1,s=e.length,o=s-1,a=t;while(null!=a&&++r<s){var l=ra(e[r]),h=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return t;if(r!=o){var c=a[l];h=i?i(c,l,a):void 0,void 0===h&&(h=pt(c)?c:Ir(e[r+1])?[]:{})}jl(a,l,h),a=a[l]}return t}var Fl=Ll;function zl(t,e,n){var i=-1,r=e.length,s={};while(++i<r){var o=e[i],a=oa(t,o);n(a,o)&&Fl(s,ea(o,t),a)}return s}var Bl=zl;function Rl(t,e){return Bl(t,e,(function(e,n){return pa(t,n)}))}var Il=Rl;function Vl(t){var e=null==t?0:t.length;return e?qn(t,1):[]}var $l=Vl;function Gl(t){return pi(ei(t,void 0,$l),t+"")}var _l=Gl,Hl=_l((function(t,e){return null==t?{}:Il(t,e)})),Ul=Hl;function Wl(t){return"function"==typeof t?t:Jn}var Xl=Wl;function ql(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}var Yl=ql,Jl=Object.prototype,Zl=Jl.hasOwnProperty;function Kl(t){if(!pt(t))return Yl(t);var e=As(t),n=[];for(var i in t)("constructor"!=i||!e&&Zl.call(t,i))&&n.push(i);return n}var Ql=Kl;function th(t){return At(t)?xs(t,!0):Ql(t)}var eh=th;function nh(t,e){return null==t?t:Na(t,Xl(e),eh)}var ih=nh;function rh(t,e,n){(void 0!==n&&!be(t[e],n)||void 0===n&&!(e in t))&&tl(t,e,n)}var sh=rh,oh=n("000c");function ah(t){var e=new t.constructor(t.byteLength);return new nr(e).set(new nr(t)),e}var lh=ah;function hh(t,e){var n=e?lh(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var ch=hh;function uh(t,e){var n=-1,i=t.length;e||(e=Array(i));while(++n<i)e[n]=t[n];return e}var dh=uh,gh=Object.create,ph=function(){function t(){}return function(e){if(!pt(e))return{};if(gh)return gh(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),fh=ph,mh=Os(Object.getPrototypeOf,Object),bh=mh;function yh(t){return"function"!=typeof t.constructor||As(t)?{}:fh(bh(t))}var Ch=yh,vh="[object Object]",wh=Function.prototype,xh=Object.prototype,Mh=wh.toString,Eh=xh.hasOwnProperty,Ah=Mh.call(Object);function Sh(t){if(!Fn(t)||dt(t)!=vh)return!1;var e=bh(t);if(null===e)return!0;var n=Eh.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Mh.call(n)==Ah}var Oh=Sh;function Ph(t,e){if(("constructor"!==e||"function"!==typeof t[e])&&"__proto__"!=e)return t[e]}var kh=Ph;function Dh(t,e,n,i){var r=!n;n||(n={});var s=-1,o=e.length;while(++s<o){var a=e[s],l=i?i(n[a],t[a],a,n,t):void 0;void 0===l&&(l=t[a]),r?tl(n,a,l):jl(n,a,l)}return n}var Th=Dh;function Nh(t){return Th(t,eh(t))}var jh=Nh;function Lh(t,e,n,i,r,s,o){var a=kh(t,n),l=kh(e,n),h=o.get(l);if(h)sh(t,n,h);else{var c=s?s(a,l,n+"",t,e,o):void 0,u=void 0===c;if(u){var d=q(l),g=!d&&Object(Fr["a"])(l),p=!d&&!g&&ys(l);c=l,d||g||p?q(a)?c=a:yi(a)?c=dh(a):g?(u=!1,c=Object(oh["a"])(l,!0)):p?(u=!1,c=ch(l,!0)):c=[]:Oh(l)||_n(l)?(c=a,_n(a)?c=jh(a):pt(a)&&!vt(a)||(c=Ch(l))):u=!1}u&&(o.set(l,c),r(c,l,i,s,o),o["delete"](l)),sh(t,n,c)}}var Fh=Lh;function zh(t,e,n,i,r){t!==e&&Na(e,(function(s,o){if(r||(r=new qi),pt(s))Fh(t,e,o,n,zh,i,r);else{var a=i?i(kh(t,o),s,o+"",t,e,r):void 0;void 0===a&&(a=s),sh(t,o,a)}}),eh)}var Bh=zh;function Rh(t){return mi((function(e,n){var i=-1,r=n.length,s=r>1?n[r-1]:void 0,o=r>2?n[2]:void 0;s=t.length>3&&"function"==typeof s?(r--,s):void 0,o&&Ja(n[0],n[1],o)&&(s=r<3?void 0:s,r=1),e=Object(e);while(++i<r){var a=n[i];a&&t(e,a,i,s)}return e}))}var Ih=Rh,Vh=Ih((function(t,e,n){Bh(t,e,n)})),$h=Vh,Gh=Ih((function(t,e){Th(e,eh(e),t)})),_h=Gh;function Hh(t,e){return yo(t,e)}var Uh=Hh,Wh="[object Map]",Xh="[object Set]",qh=Object.prototype,Yh=qh.hasOwnProperty;function Jh(t){if(null==t)return!0;if(At(t)&&(q(t)||"string"==typeof t||"function"==typeof t.splice||Object(Fr["a"])(t)||ys(t)||_n(t)))return!t.length;var e=ao(t);if(e==Wh||e==Xh)return!t.size;if(As(t))return!js(t).length;for(var n in t)if(Yh.call(t,n))return!1;return!0}var Zh=Jh;function Kh(t,e){var n=-1,i=null==t?0:t.length;while(++n<i)if(!1===e(t[n],n,t))break;return t}var Qh=Kh;function tc(t,e){return t&&Th(e,Fs(e),t)}var ec=tc;function nc(t,e){return t&&Th(e,eh(e),t)}var ic=nc;function rc(t,e){return Th(t,Nr(t),e)}var sc=rc,oc=Object.getOwnPropertySymbols,ac=oc?function(t){var e=[];while(t)jn(e,Nr(t)),t=bh(t);return e}:Or,lc=ac;function hc(t,e){return Th(t,lc(t),e)}var cc=hc;function uc(t){return Mr(t,eh,lc)}var dc=uc,gc=Object.prototype,pc=gc.hasOwnProperty;function fc(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&pc.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var mc=fc;function bc(t,e){var n=e?lh(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var yc=bc,Cc=/\w*$/;function vc(t){var e=new t.constructor(t.source,Cc.exec(t));return e.lastIndex=t.lastIndex,e}var wc=vc,xc=Z?Z.prototype:void 0,Mc=xc?xc.valueOf:void 0;function Ec(t){return Mc?Object(Mc.call(t)):{}}var Ac=Ec,Sc="[object Boolean]",Oc="[object Date]",Pc="[object Map]",kc="[object Number]",Dc="[object RegExp]",Tc="[object Set]",Nc="[object String]",jc="[object Symbol]",Lc="[object ArrayBuffer]",Fc="[object DataView]",zc="[object Float32Array]",Bc="[object Float64Array]",Rc="[object Int8Array]",Ic="[object Int16Array]",Vc="[object Int32Array]",$c="[object Uint8Array]",Gc="[object Uint8ClampedArray]",_c="[object Uint16Array]",Hc="[object Uint32Array]";function Uc(t,e,n){var i=t.constructor;switch(e){case Lc:return lh(t);case Sc:case Oc:return new i(+t);case Fc:return yc(t,n);case zc:case Bc:case Rc:case Ic:case Vc:case $c:case Gc:case _c:case Hc:return ch(t,n);case Pc:return new i;case kc:case Nc:return new i(t);case Dc:return wc(t);case Tc:return new i;case jc:return Ac(t)}}var Wc=Uc,Xc="[object Map]";function qc(t){return Fn(t)&&ao(t)==Xc}var Yc=qc,Jc=fs["a"]&&fs["a"].isMap,Zc=Jc?ps(Jc):Yc,Kc=Zc,Qc="[object Set]";function tu(t){return Fn(t)&&ao(t)==Qc}var eu=tu,nu=fs["a"]&&fs["a"].isSet,iu=nu?ps(nu):eu,ru=iu,su=1,ou=2,au=4,lu="[object Arguments]",hu="[object Array]",cu="[object Boolean]",uu="[object Date]",du="[object Error]",gu="[object Function]",pu="[object GeneratorFunction]",fu="[object Map]",mu="[object Number]",bu="[object Object]",yu="[object RegExp]",Cu="[object Set]",vu="[object String]",wu="[object Symbol]",xu="[object WeakMap]",Mu="[object ArrayBuffer]",Eu="[object DataView]",Au="[object Float32Array]",Su="[object Float64Array]",Ou="[object Int8Array]",Pu="[object Int16Array]",ku="[object Int32Array]",Du="[object Uint8Array]",Tu="[object Uint8ClampedArray]",Nu="[object Uint16Array]",ju="[object Uint32Array]",Lu={};function Fu(t,e,n,i,r,s){var o,a=e&su,l=e&ou,h=e&au;if(n&&(o=r?n(t,i,r,s):n(t)),void 0!==o)return o;if(!pt(t))return t;var c=q(t);if(c){if(o=mc(t),!a)return dh(t,o)}else{var u=ao(t),d=u==gu||u==pu;if(Object(Fr["a"])(t))return Object(oh["a"])(t,a);if(u==bu||u==lu||d&&!r){if(o=l||d?{}:Ch(t),!a)return l?cc(t,ic(o,t)):sc(t,ec(o,t))}else{if(!Lu[u])return r?t:{};o=Wc(t,u,a)}}s||(s=new qi);var g=s.get(t);if(g)return g;s.set(t,o),ru(t)?t.forEach((function(i){o.add(Fu(i,e,n,i,t,s))})):Kc(t)&&t.forEach((function(i,r){o.set(r,Fu(i,e,n,r,t,s))}));var p=h?l?dc:Bs:l?eh:Fs,f=c?void 0:p(t);return Qh(f||t,(function(i,r){f&&(r=i,i=t[r]),jl(o,r,Fu(i,e,n,r,t,s))})),o}Lu[lu]=Lu[hu]=Lu[Mu]=Lu[Eu]=Lu[cu]=Lu[uu]=Lu[Au]=Lu[Su]=Lu[Ou]=Lu[Pu]=Lu[ku]=Lu[fu]=Lu[mu]=Lu[bu]=Lu[yu]=Lu[Cu]=Lu[vu]=Lu[wu]=Lu[Du]=Lu[Tu]=Lu[Nu]=Lu[ju]=!0,Lu[du]=Lu[gu]=Lu[xu]=!1;var zu=Fu,Bu=4;function Ru(t){return zu(t,Bu)}var Iu=Ru,Vu=1,$u=4;function Gu(t){return zu(t,Vu|$u)}var _u=Gu,Hu=Object.prototype,Uu=Hu.hasOwnProperty,Wu=mi((function(t,e){t=Object(t);var n=-1,i=e.length,r=i>2?e[2]:void 0;r&&Ja(e[0],e[1],r)&&(i=1);while(++n<i){var s=e[n],o=eh(s),a=-1,l=o.length;while(++a<l){var h=o[a],c=t[h];(void 0===c||be(c,Hu[h])&&!Uu.call(t,h))&&(t[h]=s[h])}}return t})),Xu=Wu;function qu(t,e,n,i,r,s){return pt(t)&&pt(e)&&(s.set(e,t),Bh(t,e,void 0,qu,s),s["delete"](e)),t}var Yu=qu,Ju=Ih((function(t,e,n,i){Bh(t,e,n,i)})),Zu=Ju,Ku=mi((function(t){return t.push(void 0,Yu),Kn(Zu,void 0,t)})),Qu=Ku;function td(t,...e){e.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(n=>{"constructor"!==n&&Object.defineProperty(t.prototype,n,Object.getOwnPropertyDescriptor(e.prototype,n))})})}const ed=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])};function nd(t,e){function n(){this.constructor=t}ed(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}class id{}const rd=/^\s*class\s+/.test(""+id)||/^\s*class\s*\{/.test(""+class{});function sd(t,e){let n;return rd?n=class extends e{}:(n=function(){return e.apply(this,arguments)},nd(n,e)),Object.defineProperty(n,"name",{value:t}),n}function od(t,e){return null!=t?t:e}function ad(t,e,n){const i=null!=t?t[e]:null;return void 0!==n?od(i,n):i}function ld(t,e,n){let i=null!=t?t[e]:null;return null==i?n:(i=+i,Number.isNaN(i)||!Number.isFinite(i)?n:i)}function hd(t,e,n){const i=null!=t?t[e]:null;return null==i?n:!!i}function cd(t){return"__proto__"===t}function ud(t,e,n="/"){let i;const r=Array.isArray(e)?e:e.split(n);if(r.length){i=t;while(r.length){const t=r.shift();if(Object(i)!==i||!t||!(t in i))return;i=i[t]}}return i}function dd(t,e,n,i="/"){const r=Array.isArray(e)?e:e.split(i),s=r.pop();if(s&&!cd(s)){let e=t;r.forEach(t=>{cd(t)||(null==e[t]&&(e[t]={}),e=e[t])}),e[s]=n}return t}function gd(t,e,n="/"){const i=Array.isArray(e)?e.slice():e.split(n),r=i.pop();if(r)if(i.length>0){const e=ud(t,i);e&&delete e[r]}else delete t[r];return t}function pd(t,e="/",n){const i={};Object.keys(t).forEach(r=>{const s=t[r];let o="object"===typeof s||Array.isArray(s);if(o&&n&&n(s)&&(o=!1),o){const t=pd(s,e,n);Object.keys(t).forEach(n=>{i[r+e+n]=t[n]})}else i[r]=s});for(const r in t)Object.prototype.hasOwnProperty.call(t,r);return i}var fd="[object String]";function md(t){return"string"==typeof t||!q(t)&&Fn(t)&&dt(t)==fd}var bd=md;function yd(t){return function(e){return null==t?void 0:t[e]}}var Cd=yd,vd={"&":"&","<":"<",">":">",'"':""","'":"'"},wd=Cd(vd),xd=wd,Md=/[&<>"']/g,Ed=RegExp(Md.source);function Ad(t){return t=Qo(t),t&&Ed.test(t)?t.replace(Md,xd):t}var Sd=Ad,Od={"&":"&","<":"<",">":">",""":'"',"'":"'"},Pd=Cd(Od),kd=Pd,Dd=/&(?:amp|lt|gt|quot|#39);/g,Td=RegExp(Dd.source);function Nd(t){return t=Qo(t),t&&Td.test(t)?t.replace(Dd,kd):t}var jd=Nd;function Ld(t,e,n){return t===t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}var Fd=Ld,zd=/\s/;function Bd(t){var e=t.length;while(e--&&zd.test(t.charAt(e)));return e}var Rd=Bd,Id=/^\s+/;function Vd(t){return t?t.slice(0,Rd(t)+1).replace(Id,""):t}var $d=Vd,Gd=NaN,_d=/^[-+]0x[0-9a-f]+$/i,Hd=/^0b[01]+$/i,Ud=/^0o[0-7]+$/i,Wd=parseInt;function Xd(t){if("number"==typeof t)return t;if(Mi(t))return Gd;if(pt(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=pt(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=$d(t);var n=Hd.test(t);return n||Ud.test(t)?Wd(t.slice(2),n?2:8):_d.test(t)?Gd:+t}var qd=Xd,Yd=1/0,Jd=17976931348623157e292;function Zd(t){if(!t)return 0===t?t:0;if(t=qd(t),t===Yd||t===-Yd){var e=t<0?-1:1;return e*Jd}return t===t?t:0}var Kd=Zd;function Qd(t){var e=Kd(t),n=e%1;return e===e?n?e-n:e:0}var tg=Qd;function eg(t,e,n){return t=Qo(t),n=null==n?0:Fd(tg(n),0,t.length),e=Zo(e),t.slice(n,n+e.length)==e}var ng=eg;function ig(t,e,n){t=Qo(t),e=Zo(e);var i=t.length;n=void 0===n?i:Fd(tg(n),0,i);var r=n;return n-=e.length,n>=0&&t.slice(n,r)==e}var rg=ig;function sg(t,e,n){var i=-1,r=t.length;e<0&&(e=-e>r?0:r+e),n=n>r?r:n,n<0&&(n+=r),r=e>n?0:n-e>>>0,e>>>=0;var s=Array(r);while(++i<r)s[i]=t[i+e];return s}var og=sg;function ag(t,e,n){var i=t.length;return n=void 0===n?i:n,!e&&n>=i?t:og(t,e,n)}var lg=ag,hg="\\ud800-\\udfff",cg="\\u0300-\\u036f",ug="\\ufe20-\\ufe2f",dg="\\u20d0-\\u20ff",gg=cg+ug+dg,pg="\\ufe0e\\ufe0f",fg="\\u200d",mg=RegExp("["+fg+hg+gg+pg+"]");function bg(t){return mg.test(t)}var yg=bg,Cg="[object RegExp]";function vg(t){return Fn(t)&&dt(t)==Cg}var wg=vg,xg=fs["a"]&&fs["a"].isRegExp,Mg=xg?ps(xg):wg,Eg=Mg;function Ag(t){return t.split("")}var Sg=Ag,Og="\\ud800-\\udfff",Pg="\\u0300-\\u036f",kg="\\ufe20-\\ufe2f",Dg="\\u20d0-\\u20ff",Tg=Pg+kg+Dg,Ng="\\ufe0e\\ufe0f",jg="["+Og+"]",Lg="["+Tg+"]",Fg="\\ud83c[\\udffb-\\udfff]",zg="(?:"+Lg+"|"+Fg+")",Bg="[^"+Og+"]",Rg="(?:\\ud83c[\\udde6-\\uddff]){2}",Ig="[\\ud800-\\udbff][\\udc00-\\udfff]",Vg="\\u200d",$g=zg+"?",Gg="["+Ng+"]?",_g="(?:"+Vg+"(?:"+[Bg,Rg,Ig].join("|")+")"+Gg+$g+")*",Hg=Gg+$g+_g,Ug="(?:"+[Bg+Lg+"?",Lg,Rg,Ig,jg].join("|")+")",Wg=RegExp(Fg+"(?="+Fg+")|"+Ug+Hg,"g");function Xg(t){return t.match(Wg)||[]}var qg=Xg;function Yg(t){return yg(t)?qg(t):Sg(t)}var Jg=Yg,Zg=4294967295;function Kg(t,e,n){return n&&"number"!=typeof n&&Ja(t,e,n)&&(e=n=void 0),n=void 0===n?Zg:n>>>0,n?(t=Qo(t),t&&("string"==typeof e||null!=e&&!Eg(e))&&(e=Zo(e),!e&&yg(t))?lg(Jg(t),0,n):t.split(e,n)):[]}var Qg=Kg,tp=9007199254740991,ep=Math.floor;function np(t,e){var n="";if(!t||e<1||e>tp)return n;do{e%2&&(n+=t),e=ep(e/2),e&&(t+=t)}while(e);return n}var ip=np;function rp(t,e,n){return e=(n?Ja(t,e,n):void 0===e)?1:tg(e),ip(Qo(t),e)}var sp=rp,op=va("length"),ap=op,lp="\\ud800-\\udfff",hp="\\u0300-\\u036f",cp="\\ufe20-\\ufe2f",up="\\u20d0-\\u20ff",dp=hp+cp+up,gp="\\ufe0e\\ufe0f",pp="["+lp+"]",fp="["+dp+"]",mp="\\ud83c[\\udffb-\\udfff]",bp="(?:"+fp+"|"+mp+")",yp="[^"+lp+"]",Cp="(?:\\ud83c[\\udde6-\\uddff]){2}",vp="[\\ud800-\\udbff][\\udc00-\\udfff]",wp="\\u200d",xp=bp+"?",Mp="["+gp+"]?",Ep="(?:"+wp+"(?:"+[yp,Cp,vp].join("|")+")"+Mp+xp+")*",Ap=Mp+xp+Ep,Sp="(?:"+[yp+fp+"?",fp,Cp,vp,pp].join("|")+")",Op=RegExp(mp+"(?="+mp+")|"+Sp+Ap,"g");function Pp(t){var e=Op.lastIndex=0;while(Op.test(t))++e;return e}var kp=Pp;function Dp(t){return yg(t)?kp(t):ap(t)}var Tp=Dp,Np=Math.ceil;function jp(t,e){e=void 0===e?" ":Zo(e);var n=e.length;if(n<2)return n?ip(e,t):e;var i=ip(e,Np(t/Tp(e)));return yg(e)?lg(Jg(i),0,t).join(""):i.slice(0,t)}var Lp=jp,Fp=Math.ceil,zp=Math.floor;function Bp(t,e,n){t=Qo(t),e=tg(e);var i=e?Tp(t):0;if(!e||i>=e)return t;var r=(e-i)/2;return Lp(zp(r),n)+t+Lp(Fp(r),n)}var Rp=Bp;function Ip(t,e,n){t=Qo(t),e=tg(e);var i=e?Tp(t):0;return e&&i<e?t+Lp(e-i,n):t}var Vp=Ip;function $p(t,e,n){t=Qo(t),e=tg(e);var i=e?Tp(t):0;return e&&i<e?Lp(e-i,n)+t:t}var Gp=$p,_p=30,Hp="...",Up=/\w*$/;function Wp(t,e){var n=_p,i=Hp;if(pt(e)){var r="separator"in e?e.separator:r;n="length"in e?tg(e.length):n,i="omission"in e?Zo(e.omission):i}t=Qo(t);var s=t.length;if(yg(t)){var o=Jg(t);s=o.length}if(n>=s)return t;var a=n-Tp(i);if(a<1)return i;var l=o?lg(o,0,a).join(""):t.slice(0,a);if(void 0===r)return l+i;if(o&&(a+=l.length-a),Eg(r)){if(t.slice(a).search(r)){var h,c=l;r.global||(r=RegExp(r.source,Qo(Up.exec(r))+"g")),r.lastIndex=0;while(h=r.exec(c))var u=h.index;l=l.slice(0,void 0===u?a:u)}}else if(t.indexOf(Zo(r),a)!=a){var d=l.lastIndexOf(r);d>-1&&(l=l.slice(0,d))}return l+i}var Xp=Wp,qp=Ih((function(t,e,n,i){Th(e,eh(e),t,i)})),Yp=qp,Jp="[object DOMException]",Zp="[object Error]";function Kp(t){if(!Fn(t))return!1;var e=dt(t);return e==Zp||e==Jp||"string"==typeof t.message&&"string"==typeof t.name&&!Oh(t)}var Qp=Kp,tf=mi((function(t,e){try{return Kn(t,void 0,e)}catch(n){return Qp(n)?n:new Error(n)}})),ef=tf;function nf(t,e){return Wo(e,(function(e){return t[e]}))}var rf=nf,sf=Object.prototype,of=sf.hasOwnProperty;function af(t,e,n,i){return void 0===t||be(t,sf[n])&&!of.call(i,n)?e:t}var lf=af,hf={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};function cf(t){return"\\"+hf[t]}var uf=cf,df=/<%=([\s\S]+?)%>/g,gf=df,pf=/<%-([\s\S]+?)%>/g,ff=pf,mf=/<%([\s\S]+?)%>/g,bf=mf,yf={escape:ff,evaluate:bf,interpolate:gf,variable:"",imports:{_:{escape:Sd}}},Cf=yf,vf="Invalid `variable` option passed into `_.template`",wf=/\b__p \+= '';/g,xf=/\b(__p \+=) '' \+/g,Mf=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ef=/[()=,{}\[\]\/\s]/,Af=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Sf=/($^)/,Of=/['\n\r\u2028\u2029\\]/g,Pf=Object.prototype,kf=Pf.hasOwnProperty;function Df(t,e,n){var i=Cf.imports._.templateSettings||Cf;n&&Ja(t,e,n)&&(e=void 0),t=Qo(t),e=Yp({},e,i,lf);var r,s,o=Yp({},e.imports,i.imports,lf),a=Fs(o),l=rf(o,a),h=0,c=e.interpolate||Sf,u="__p += '",d=RegExp((e.escape||Sf).source+"|"+c.source+"|"+(c===gf?Af:Sf).source+"|"+(e.evaluate||Sf).source+"|$","g"),g=kf.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(d,(function(e,n,i,o,a,l){return i||(i=o),u+=t.slice(h,l).replace(Of,uf),n&&(r=!0,u+="' +\n__e("+n+") +\n'"),a&&(s=!0,u+="';\n"+a+";\n__p += '"),i&&(u+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),h=l+e.length,e})),u+="';\n";var p=kf.call(e,"variable")&&e.variable;if(p){if(Ef.test(p))throw new Error(vf)}else u="with (obj) {\n"+u+"\n}\n";u=(s?u.replace(wf,""):u).replace(xf,"$1").replace(Mf,"$1;"),u="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(r?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+u+"return __p\n}";var f=ef((function(){return Function(a,g+"return "+u).apply(void 0,l)}));if(f.source=u,Qp(f))throw f;return f}var Tf=Df,Nf=0;function jf(t){var e=++Nf;return Qo(t)+e}var Lf=jf;function Ff(t){let e=null;try{e=window.eval(t)}catch(n){}return e}function zf(t,e,n,i){var r=-1,s=null==t?0:t.length;i&&s&&(n=t[++r]);while(++r<s)n=e(n,t[r],r,t);return n}var Bf=zf,Rf={"À":"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"},If=Cd(Rf),Vf=If,$f=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Gf="\\u0300-\\u036f",_f="\\ufe20-\\ufe2f",Hf="\\u20d0-\\u20ff",Uf=Gf+_f+Hf,Wf="["+Uf+"]",Xf=RegExp(Wf,"g");function qf(t){return t=Qo(t),t&&t.replace($f,Vf).replace(Xf,"")}var Yf=qf,Jf=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Zf(t){return t.match(Jf)||[]}var Kf=Zf,Qf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function tm(t){return Qf.test(t)}var em=tm,nm="\\ud800-\\udfff",im="\\u0300-\\u036f",rm="\\ufe20-\\ufe2f",sm="\\u20d0-\\u20ff",om=im+rm+sm,am="\\u2700-\\u27bf",lm="a-z\\xdf-\\xf6\\xf8-\\xff",hm="\\xac\\xb1\\xd7\\xf7",cm="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",um="\\u2000-\\u206f",dm=" \\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",gm="A-Z\\xc0-\\xd6\\xd8-\\xde",pm="\\ufe0e\\ufe0f",fm=hm+cm+um+dm,mm="['’]",bm="["+fm+"]",ym="["+om+"]",Cm="\\d+",vm="["+am+"]",wm="["+lm+"]",xm="[^"+nm+fm+Cm+am+lm+gm+"]",Mm="\\ud83c[\\udffb-\\udfff]",Em="(?:"+ym+"|"+Mm+")",Am="[^"+nm+"]",Sm="(?:\\ud83c[\\udde6-\\uddff]){2}",Om="[\\ud800-\\udbff][\\udc00-\\udfff]",Pm="["+gm+"]",km="\\u200d",Dm="(?:"+wm+"|"+xm+")",Tm="(?:"+Pm+"|"+xm+")",Nm="(?:"+mm+"(?:d|ll|m|re|s|t|ve))?",jm="(?:"+mm+"(?:D|LL|M|RE|S|T|VE))?",Lm=Em+"?",Fm="["+pm+"]?",zm="(?:"+km+"(?:"+[Am,Sm,Om].join("|")+")"+Fm+Lm+")*",Bm="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rm="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Im=Fm+Lm+zm,Vm="(?:"+[vm,Sm,Om].join("|")+")"+Im,$m=RegExp([Pm+"?"+wm+"+"+Nm+"(?="+[bm,Pm,"$"].join("|")+")",Tm+"+"+jm+"(?="+[bm,Pm+Dm,"$"].join("|")+")",Pm+"?"+Dm+"+"+Nm,Pm+"+"+jm,Rm,Bm,Cm,Vm].join("|"),"g");function Gm(t){return t.match($m)||[]}var _m=Gm;function Hm(t,e,n){return t=Qo(t),e=n?void 0:e,void 0===e?em(t)?_m(t):Kf(t):t.match(e)||[]}var Um=Hm,Wm="['’]",Xm=RegExp(Wm,"g");function qm(t){return function(e){return Bf(Um(Yf(e).replace(Xm,"")),t,"")}}var Ym=qm;function Jm(t){return function(e){e=Qo(e);var n=yg(e)?Jg(e):void 0,i=n?n[0]:e.charAt(0),r=n?lg(n,1).join(""):e.slice(1);return i[t]()+r}}var Zm=Jm,Km=Zm("toUpperCase"),Qm=Km,tb=Ym((function(t,e,n){return t+(n?" ":"")+Qm(e)})),eb=tb;function nb(t){return Qm(Qo(t).toLowerCase())}var ib=nb,rb=Ym((function(t,e,n){return e=e.toLowerCase(),t+(n?ib(e):e)})),sb=rb,ob=Ym((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),ab=ob,lb=Ym((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),hb=lb,cb=Zm("toLowerCase"),ub=cb;const db=t=>{const e=Object.create(null);return n=>{const i=e[n];return i||(e[n]=t(n))}},gb=db(t=>t.replace(/\B([A-Z])/g,"-$1").toLowerCase()),pb=db(t=>eb(sb(t)).replace(/ /g,"")),fb=db(t=>ab(t).replace(/ /g,"_")),mb=db(t=>hb(t).replace(/ /g,".")),bb=db(t=>hb(t).replace(/ /g,"/")),yb=db(t=>Qm(hb(t))),Cb=db(t=>eb(sb(t)));function vb(t){let e=2166136261,n=!1,i=t;for(let r=0,s=i.length;r<s;r+=1){let t=i.charCodeAt(r);t>127&&!n&&(i=unescape(encodeURIComponent(i)),t=i.charCodeAt(r),n=!0),e^=t,e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24)}return e>>>0}function wb(){let t="";const e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";for(let n=0,i=e.length;n<i;n+=1){const i=e[n],r=16*Math.random()|0,s="x"===i?r:"y"===i?3&r|8:i;t+=s.toString(16)}return t}function xb(t,e={}){const n=P.a.parseHTML(t,null,!1);return n.forEach(t=>{const e=t;if(e){const t=e.attributes;if(t)for(let n=0,i=t.length;n<i;n+=1){const i=t.item(n);if(i){const t=i.value.toLowerCase(),n=i.name.toLowerCase();(n.startsWith("on")||t.startsWith("javascript:")||t.startsWith("data:")||t.startsWith("vbscript:"))&&e.removeAttribute(n)}}}}),e.raw?n:P()("<div/>").append(n).html()}function Mb(t,e,n){const i=Math.min(2,Math.floor(.34*t.length));let r,s=Math.floor(.4*t.length)+1,o=!1;const a=t.toLowerCase();for(const l of e){const e=n(l);if(void 0!==e&&Math.abs(e.length-a.length)<=i){const n=e.toLowerCase();if(n===a){if(e===t)continue;return l}if(o)continue;if(e.length<3)continue;const i=Eb(a,n,s-1);if(void 0===i)continue;i<3?(o=!0,r=l):(s=i,r=l)}}return r}function Eb(t,e,n){let i=new Array(e.length+1),r=new Array(e.length+1);const s=n+1;for(let a=0;a<=e.length;a+=1)i[a]=a;for(let a=1;a<=t.length;a+=1){const o=t.charCodeAt(a-1),l=a>n?a-n:1,h=e.length>n+a?n+a:e.length;r[0]=a;let c=a;for(let t=1;t<l;t+=1)r[t]=s;for(let t=l;t<=h;t+=1){const n=o===e.charCodeAt(t-1)?i[t-1]:Math.min(i[t]+1,r[t-1]+1,i[t-1]+2);r[t]=n,c=Math.min(c,n)}for(let t=h+1;t<=e.length;t+=1)r[t]=s;if(c>n)return;const u=i;i=r,r=u}const o=i[e.length];return o>n?void 0:o}var Ab="[object Number]";function Sb(t){return"number"==typeof t||Fn(t)&&dt(t)==Ab}var Ob=Sb;function Pb(t){return Ob(t)&&t!=+t}var kb=Pb,Db=Y["a"].isFinite;function Tb(t){return"number"==typeof t&&Db(t)}var Nb=Tb;function jb(t){return"number"==typeof t&&t==tg(t)}var Lb=jb,Fb=9007199254740991;function zb(t){return Lb(t)&&t>=-Fb&&t<=Fb}var Bb=zb;function Rb(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=qd(n),n=n===n?n:0),void 0!==e&&(e=qd(e),e=e===e?e:0),Fd(qd(t),e,n)}var Ib=Rb,Vb=Math.max,$b=Math.min;function Gb(t,e,n){return t>=$b(e,n)&&t<Vb(e,n)}var _b=Gb;function Hb(t,e,n){return e=Kd(e),void 0===n?(n=e,e=0):n=Kd(n),t=qd(t),_b(t,e,n)}var Ub=Hb,Wb=9007199254740991;function Xb(t){return t?Fd(tg(t),-Wb,Wb):0===t?t:0}var qb=Xb,Yb=/^\s+/,Jb=Y["a"].parseInt;function Zb(t,e,n){return n||null==e?e=0:e&&(e=+e),Jb(Qo(t).replace(Yb,""),e||0)}var Kb=Zb;function Qb(t,e){return(t%e+e)%e}function ty(t,e){if(null==e)e=null==t?1:t,t=0;else if(e<t){const n=t;t=e,e=n}return Math.floor(Math.random()*(e-t+1)+t)}function ey(t){return"string"===typeof t&&"%"===t.slice(-1)}function ny(t,e){if(null==t)return 0;let n;if("string"===typeof t){if(n=parseFloat(t),ey(t)&&(n/=100,Number.isFinite(n)))return n*e}else n=t;return Number.isFinite(n)?n>0&&n<1?n*e:n:0}function iy(t,e){function n(e){const n=new RegExp(`(?:\\d+(?:\\.\\d+)*)(${e})$`).exec(t);return n?n[1]:null}const i=parseFloat(t);if(Number.isNaN(i))return null;let r;if(null==e)r="[A-Za-z]*";else if(Array.isArray(e)){if(0===e.length)return null;r=e.join("|")}else"string"===typeof e&&(r=e);const s=n(r);return null===s?null:{unit:s,value:i}}function ry(t){if("object"===typeof t){let e=0,n=0,i=0,r=0;return null!=t.vertical&&Number.isFinite(t.vertical)&&(n=r=t.vertical),null!=t.horizontal&&Number.isFinite(t.horizontal)&&(i=e=t.horizontal),null!=t.left&&Number.isFinite(t.left)&&(e=t.left),null!=t.top&&Number.isFinite(t.top)&&(n=t.top),null!=t.right&&Number.isFinite(t.right)&&(i=t.right),null!=t.bottom&&Number.isFinite(t.bottom)&&(r=t.bottom),{top:n,right:i,bottom:r,left:e}}let e=0;return null!=t&&Number.isFinite(t)&&(e=t),{top:e,right:e,bottom:e,left:e}}var sy="Expected a function";function oy(t,e){var n;if("function"!=typeof e)throw new TypeError(sy);return t=tg(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var ay=oy;function ly(t){return ay(2,t)}var hy=ly,cy=function(){return Y["a"].Date.now()},uy=cy,dy="Expected a function",gy=Math.max,py=Math.min;function fy(t,e,n){var i,r,s,o,a,l,h=0,c=!1,u=!1,d=!0;if("function"!=typeof t)throw new TypeError(dy);function g(e){var n=i,s=r;return i=r=void 0,h=e,o=t.apply(s,n),o}function p(t){return h=t,a=setTimeout(b,e),c?g(t):o}function f(t){var n=t-l,i=t-h,r=e-n;return u?py(r,s-i):r}function m(t){var n=t-l,i=t-h;return void 0===l||n>=e||n<0||u&&i>=s}function b(){var t=uy();if(m(t))return y(t);a=setTimeout(b,f(t))}function y(t){return a=void 0,d&&i?g(t):(i=r=void 0,o)}function C(){void 0!==a&&clearTimeout(a),h=0,i=l=r=a=void 0}function v(){return void 0===a?o:y(uy())}function w(){var t=uy(),n=m(t);if(i=arguments,r=this,l=t,n){if(void 0===a)return p(l);if(u)return clearTimeout(a),a=setTimeout(b,e),g(l)}return void 0===a&&(a=setTimeout(b,e)),o}return e=qd(e)||0,pt(n)&&(c=!!n.leading,u="maxWait"in n,s=u?gy(qd(n.maxWait)||0,e):s,d="trailing"in n?!!n.trailing:d),w.cancel=C,w.flush=v,w}var my=fy,by="Expected a function";function yy(t,e,n){if("function"!=typeof t)throw new TypeError(by);return setTimeout((function(){t.apply(void 0,n)}),e)}var Cy=yy,vy=mi((function(t,e){return Cy(t,1,e)})),wy=vy;function xy(t,e,n){if(n)switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2]);case 4:return t.call(e,n[0],n[1],n[2],n[3]);case 5:return t.call(e,n[0],n[1],n[2],n[3],n[4]);case 6:return t.call(e,n[0],n[1],n[2],n[3],n[4],n[5]);default:return t.apply(e,n)}return t.call(e)}function My(t,e,...n){return xy(t,e,n)}function Ey(t,e){for(let n=0,i=t.length;n<i;n+=1)if(t[n]===e)return t.push(t.splice(n,1)[0])}function Ay(t,e,n){const i=[],r={},s=(...s)=>{let o=!1;const a=s.join("␀");return a in r?(o=!0,Ey(i,a)):(i.length>=1e3&&delete r[i.shift()],i.push(a),r[a]=xy(t,e||null,s)),n?n(r[a],o):r[a]};return s}function Sy(t){return"object"===typeof t&&t.then&&"function"===typeof t.then}function Oy(t){return null!=t&&(t instanceof Promise||Sy(t))}function Py(...t){const e=[];t.forEach(t=>{Array.isArray(t)?e.push(...t):e.push(t)});const n=e.some(t=>Oy(t));if(n){const t=e.map(t=>Oy(t)?t:Promise.resolve(!1!==t));return Promise.all(t).then(t=>t.reduce((t,e)=>!1!==e&&t,!0))}return e.every(t=>!1!==t)}function ky(...t){const e=Py(t);return"boolean"===typeof e?Promise.resolve(e):e}const Dy=/[\t\r\n\f]/g,Ty=/\S+/g,Ny=t=>` ${t} `;function jy(t){return t&&t.getAttribute&&t.getAttribute("class")||""}function Ly(t,e){if(null==t||null==e)return!1;const n=Ny(jy(t)),i=Ny(e);return 1===t.nodeType&&n.replace(Dy," ").includes(i)}function Fy(t,e){if(null!=t&&null!=e){if("function"===typeof e)return Fy(t,e(jy(t)));if("string"===typeof e&&1===t.nodeType){const n=e.match(Ty)||[],i=Ny(jy(t)).replace(Dy," ");let r=n.reduce((t,e)=>t.indexOf(Ny(e))<0?`${t}${e} `:t,i);r=r.trim(),i!==r&&t.setAttribute("class",r)}}}function zy(t,e){if(null!=t){if("function"===typeof e)return zy(t,e(jy(t)));if((!e||"string"===typeof e)&&1===t.nodeType){const n=(e||"").match(Ty)||[],i=Ny(jy(t)).replace(Dy," ");let r=n.reduce((t,e)=>{const n=Ny(e);return t.indexOf(n)>-1?t.replace(n," "):t},i);r=e?r.trim():"",i!==r&&t.setAttribute("class",r)}}}function By(t,e,n){if(null!=t&&null!=e)if(null==n||"string"!==typeof e){if("function"===typeof e)return By(t,e(jy(t),n),n);if("string"===typeof e){const n=e.match(Ty)||[];n.forEach(e=>{Ly(t,e)?zy(t,e):Fy(t,e)})}}else n?Fy(t,e):zy(t,e)}let Ry=0;function Iy(){return Ry+=1,"v"+Ry}function Vy(t){return null!=t.id&&""!==t.id||(t.id=Iy()),t.id}function $y(t){return null!=t&&("function"===typeof t.getScreenCTM&&t instanceof SVGElement)}const Gy={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xml:"http://www.w3.org/XML/1998/namespace",xlink:"http://www.w3.org/1999/xlink",xhtml:"http://www.w3.org/1999/xhtml"},_y="1.1";function Hy(t,e=document){return e.createElement(t)}function Uy(t,e=Gy.xhtml,n=document){return n.createElementNS(e,t)}function Wy(t,e=document){return Uy(t,Gy.svg,e)}function Xy(t){if(t){const e=`<svg xmlns="${Gy.svg}" xmlns:xlink="${Gy.xlink}" version="${_y}">${t}</svg>`,{documentElement:n}=qy(e,{async:!1});return n}const e=document.createElementNS(Gy.svg,"svg");return e.setAttributeNS(Gy.xmlns,"xmlns:xlink",Gy.xlink),e.setAttribute("version",_y),e}function qy(t,e={}){let n;try{const i=new DOMParser;if(null!=e.async){const t=i;t.async=e.async}n=i.parseFromString(t,e.mimeType||"text/xml")}catch(i){n=void 0}if(!n||n.getElementsByTagName("parsererror").length)throw new Error("Invalid XML: "+t);return n}function Yy(t,e=!0){const n=t.nodeName;return e?n.toLowerCase():n.toUpperCase()}function Jy(t){let e=0,n=t.previousSibling;while(n)1===n.nodeType&&(e+=1),n=n.previousSibling;return e}function Zy(t,e){return t.querySelectorAll(e)}function Ky(t,e){return t.querySelector(e)}function Qy(t,e,n){const i=t.ownerSVGElement;let r=t.parentNode;while(r&&r!==n&&r!==i){if(Ly(r,e))return r;r=r.parentNode}return null}function tC(t,e){const n=e&&e.parentNode;return t===n||!!(n&&1===n.nodeType&&16&t.compareDocumentPosition(n))}function eC(t){t.parentNode&&t.parentNode.removeChild(t)}function nC(t){while(t.firstChild)t.removeChild(t.firstChild)}function iC(t,e){const n=Array.isArray(e)?e:[e];n.forEach(e=>{null!=e&&t.appendChild(e)})}function rC(t,e){const n=t.firstChild;return n?sC(n,e):iC(t,e)}function sC(t,e){const n=t.parentNode;if(n){const i=Array.isArray(e)?e:[e];i.forEach(e=>{null!=e&&n.insertBefore(e,t)})}}function oC(t,e){null!=e&&e.appendChild(t)}function aC(t){try{return t instanceof HTMLElement}catch(e){return"object"===typeof t&&1===t.nodeType&&"object"===typeof t.style&&"object"===typeof t.ownerDocument}}function lC(t){return!(!t||!aC(t))&&(!!["a","button"].includes(Yy(t))||("button"===t.getAttribute("role")||"button"===t.getAttribute("type")||lC(t.parentNode)))}function hC(t){const e=Yy(t);if("input"===e){const e=t.getAttribute("type");if(null==e||["text","password","number","email","search","tel","url"].includes(e))return!0}return!1}const cC=["viewBox","attributeName","attributeType","repeatCount"];function uC(t,e){return t.getAttribute(e)}function dC(t,e){const n=mC(e);n.ns?t.hasAttributeNS(n.ns,n.local)&&t.removeAttributeNS(n.ns,n.local):t.hasAttribute(e)&&t.removeAttribute(e)}function gC(t,e,n){if(null==n)return dC(t,e);const i=mC(e);i.ns&&"string"===typeof n?t.setAttributeNS(i.ns,e,n):"id"===e?t.id=""+n:t.setAttribute(e,""+n)}function pC(t,e){Object.keys(e).forEach(n=>{gC(t,n,e[n])})}function fC(t,e,n){if(null==e){const e=t.attributes,n={};for(let t=0;t<e.length;t+=1)n[e[t].name]=e[t].value;return n}if("string"===typeof e&&void 0===n)return t.getAttribute(e);"object"===typeof e?pC(t,e):gC(t,e,n)}function mC(t){if(-1!==t.indexOf(":")){const e=t.split(":");return{ns:Gy[e[0]],local:e[1]}}return{ns:null,local:t}}function bC(t){const e={};return Object.keys(t).forEach(n=>{const i=cC.includes(n)?n:gb(n);e[i]=t[n]}),e}function yC(t){const e={},n=t.split(";");return n.forEach(t=>{const n=t.trim();if(n){const t=n.split("=");t.length&&(e[t[0].trim()]=t[1]?t[1].trim():"")}}),e}function CC(t,e){return Object.keys(e).forEach(n=>{if("class"===n)t[n]=t[n]?`${t[n]} ${e[n]}`:e[n];else if("style"===n){const i="object"===typeof t[n],r="object"===typeof e[n];let s,o;i&&r?(s=t[n],o=e[n]):i?(s=t[n],o=yC(e[n])):r?(s=yC(t[n]),o=e[n]):(s=yC(t[n]),o=yC(e[n])),t[n]=CC(s,o)}else t[n]=e[n]}),t}function vC(t,e,n={}){const i=n.offset||0,s=[],o=[];let a,l,h=null;for(let c=0;c<t.length;c+=1){a=o[c]=t[c];for(let r=0,s=e.length;r<s;r+=1){const s=e[r],l=s.start+i,h=s.end+i;c>=l&&c<h&&("string"===typeof a?a=o[c]={t:t[c],attrs:s.attrs}:a.attrs=CC(CC({},a.attrs),s.attrs),n.includeAnnotationIndices&&(null==a.annotations&&(a.annotations=[]),a.annotations.push(r)))}l=o[c-1],l?r.isObject(a)&&r.isObject(l)?(h=h,JSON.stringify(a.attrs)===JSON.stringify(l.attrs)?h.t+=a.t:(s.push(h),h=a)):r.isObject(a)||r.isObject(l)?(h=h,s.push(h),h=a):h=(h||"")+a:h=a}return null!=h&&s.push(h),s}function wC(t,e){return t?t.filter(t=>t.start<e&&e<=t.end):[]}function xC(t,e,n){return t?t.filter(t=>e>=t.start&&e<t.end||n>t.start&&n<=t.end||t.start>=e&&t.end<n):[]}function MC(t,e,n){return t&&t.forEach(t=>{t.start<e&&t.end>=e?t.end+=n:t.start>=e&&(t.start+=n,t.end+=n)}),t}function EC(t){return t.replace(/ /g," ")}var AC,SC;let OC;(function(t){function e(t){return null===t||void 0===t||"boolean"===typeof t||"number"===typeof t||"string"===typeof t}function n(t){return Array.isArray(t)}function i(t){return!e(t)&&!n(t)}function r(t,i){if(t===i)return!0;if(e(t)||e(i))return!1;const r=n(t),s=n(i);return r===s&&(r&&s?o(t,i):a(t,i))}function s(t){return e(t)?t:n(t)?l(t):h(t)}function o(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0,i=t.length;n<i;n+=1)if(!r(t[n],e[n]))return!1;return!0}function a(t,e){if(t===e)return!0;for(const n in t)if(!(n in e))return!1;for(const n in e)if(!(n in t))return!1;for(const n in t)if(!r(t[n],e[n]))return!1;return!0}function l(t){const e=new Array(t.length);for(let n=0,i=t.length;n<i;n+=1)e[n]=s(t[n]);return e}function h(t){const e={};return Object.keys(t).forEach(n=>{e[n]=s(t[n])}),e}t.emptyObject=Object.freeze({}),t.emptyArray=Object.freeze([]),t.isPrimitive=e,t.isArray=n,t.isObject=i,t.deepEqual=r,t.deepCopy=s})(AC||(AC={})),function(t){function e(t){const e="data:";return t.substr(0,e.length)===e}function n(t,n){if(!t||e(t))return void setTimeout(()=>n(null,t));const i=()=>{n(new Error("Failed to load image: "+t))},r=window.FileReader?t=>{if(200===t.status){const e=new FileReader;e.onload=t=>{const e=t.target.result;n(null,e)},e.onerror=i,e.readAsDataURL(t.response)}else i()}:e=>{const r=t=>{const e=32768,n=[];for(let i=0;i<t.length;i+=e)n.push(String.fromCharCode.apply(null,t.subarray(i,i+e)));return n.join("")};if(200===e.status){let i=t.split(".").pop()||"png";"svg"===i&&(i="svg+xml");const s=`data:image/${i};base64,`,o=new Uint8Array(e.response),a=s+btoa(r(o));n(null,a)}else i()},s=new XMLHttpRequest;s.responseType=window.FileReader?"blob":"arraybuffer",s.open("GET",t,!0),s.addEventListener("error",i),s.addEventListener("load",()=>r(s)),s.send()}function i(t){let e=t.replace(/\s/g,"");e=decodeURIComponent(e);const n=e.indexOf(","),i=e.slice(0,n),r=i.split(":")[1].split(";")[0],s=e.slice(n+1);let o;o=i.indexOf("base64")>=0?atob(s):unescape(encodeURIComponent(s));const a=new Uint8Array(o.length);for(let l=0;l<o.length;l+=1)a[l]=o.charCodeAt(l);return new Blob([a],{type:r})}function r(t,e){const n=window.navigator.msSaveBlob;if(n)n(t,e);else{const n=window.URL.createObjectURL(t),i=document.createElement("a");i.href=n,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(n)}}function s(t,e){const n=i(t);r(n,e)}function o(t){const e=t.match(/<svg[^>]*viewBox\s*=\s*(["']?)(.+?)\1[^>]*>/i);return e&&e[2]?e[2].replace(/\s+/," ").split(" "):null}function a(t){const e=parseFloat(t);return Number.isNaN(e)?null:e}function l(t,e={}){let n=null;const i=e=>(null==n&&(n=o(t)),null!=n?a(n[e]):null),r=e=>{const n=t.match(e);return n&&n[2]?a(n[2]):null};let s=e.width;if(null==s&&(s=r(/<svg[^>]*width\s*=\s*(["']?)(.+?)\1[^>]*>/i)),null==s&&(s=i(2)),null==s)throw new Error("Can not parse width from svg string");let l=e.height;if(null==l&&(l=r(/<svg[^>]*height\s*=\s*(["']?)(.+?)\1[^>]*>/i)),null==l&&(l=i(3)),null==l)throw new Error("Can not parse height from svg string");const h=encodeURIComponent(t).replace(/'/g,"%27").replace(/"/g,"%22"),c="data:image/svg+xml",u=`${c},${h}`;return u}t.isDataUrl=e,t.imageToDataUri=n,t.dataUriToBlob=i,t.downloadBlob=r,t.downloadDataUri=s,t.svgToDataUrl=l}(SC||(SC={}));const PC={px(t){return t},mm(t){return OC*t},cm(t){return OC*t*10},in(t){return OC*t*25.4},pt(t){return OC*(25.4*t/72)},pc(t){return OC*(25.4*t/6)}};var kC;(function(t){function e(t,e,n){const i=P()("<div/>").css({display:"inline-block",position:"absolute",left:-15e3,top:-15e3,width:t+(n||""),height:e+(n||"")}).appendTo(document.body),r={width:i.width()||0,height:i.height()||0};return i.remove(),r}function n(t,n){null==OC&&(OC=e("1","1","mm").width);const i=n?PC[n]:null;return i?i(t):t}t.measure=e,t.toPx=n})(kC||(kC={}));const DC=function(){let t;const e=window;if(null!=e&&(t=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame,null!=t&&(t=t.bind(e))),null==t){let e=0;t=t=>{const n=(new Date).getTime(),i=Math.max(0,16-(n-e)),r=setTimeout(()=>{t(n+i)},i);return e=n+i,r}}return t}(),TC=function(){let t;const e=window;return null!=e&&(t=e.cancelAnimationFrame||e.webkitCancelAnimationFrame||e.webkitCancelRequestAnimationFrame||e.msCancelAnimationFrame||e.msCancelRequestAnimationFrame||e.oCancelAnimationFrame||e.oCancelRequestAnimationFrame||e.mozCancelAnimationFrame||e.mozCancelRequestAnimationFrame,t&&(t=t.bind(e))),null==t&&(t=clearTimeout),t}(),NC=/-(.)/g;function jC(t){return t.replace(NC,(t,e)=>e.toUpperCase())}const LC={},FC=["Webkit","ms","Moz","O"],zC=document?document.createElement("div").style:{};function BC(t){for(let e=0;e<FC.length;e+=1){const n=FC[e]+t;if(n in zC)return n}return null}function RC(t){const e=jC(t);if(null==LC[e]){const t=e.charAt(0).toUpperCase()+e.slice(1);LC[e]=e in zC?e:BC(t)}return LC[e]}function IC(t,e,n){const i=RC(e);null!=i&&(t[i]=n),t[e]=n}function VC(t,e){const n=t.ownerDocument&&t.ownerDocument.defaultView&&t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):window.getComputedStyle(t,null);return n&&e?n.getPropertyValue(e)||n[e]:n}function $C(t){const e=VC(t);return null!=e&&("scroll"===e.overflow||"auto"===e.overflow)}const GC=function(){const t=document;return t.selection?function(){t.selection.empty()}:window.getSelection?function(){const t=window.getSelection();t&&(t.empty?t.empty():t.removeAllRanges&&t.removeAllRanges())}:function(){}}();var _C;function HC(t,e=0){return Number.isInteger(t)?t:+t.toFixed(e)}function UC(t,e){let n,i;if(null==e?(i=null==t?1:t,n=0):(i=e,n=null==t?0:t),i<n){const t=n;n=i,i=t}return Math.floor(Math.random()*(i-n+1)+n)}function WC(t,e,n){return Number.isNaN(t)?NaN:Number.isNaN(e)||Number.isNaN(n)?0:e<n?t<e?e:t>n?n:t:t<n?n:t>e?e:t}function XC(t,e){return e*Math.round(t/e)}function qC(t,e){return null!=e&&null!=t&&e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height}function YC(t,e){const n=t.x-e.x,i=t.y-e.y;return n*n+i*i}(function(t){function e(t){return 180*t/Math.PI%360}function n(t){return t%360+(t<0?360:0)}t.toDeg=e,t.toRad=function(t,e=!1){const n=e?t:t%360;return n*Math.PI/180},t.normalize=n})(_C||(_C={}));class JC{valueOf(){return this.toJSON()}toString(){return JSON.stringify(this.toJSON())}}class ZC extends JC{constructor(t,e){super(),this.x=null==t?0:t,this.y=null==e?0:e}get[Symbol.toStringTag](){return ZC.toStringTag}round(t=0){return this.x=HC(this.x,t),this.y=HC(this.y,t),this}add(t,e){const n=ZC.create(t,e);return this.x+=n.x,this.y+=n.y,this}update(t,e){const n=ZC.create(t,e);return this.x=n.x,this.y=n.y,this}translate(t,e){const n=ZC.create(t,e);return this.x+=n.x,this.y+=n.y,this}rotate(t,e){const n=ZC.rotate(this,t,e);return this.x=n.x,this.y=n.y,this}scale(t,e,n=new ZC){const i=ZC.create(n);return this.x=i.x+t*(this.x-i.x),this.y=i.y+e*(this.y-i.y),this}closest(t){if(1===t.length)return ZC.create(t[0]);let e=null,n=1/0;return t.forEach(t=>{const i=this.squaredDistance(t);i<n&&(e=t,n=i)}),e?ZC.create(e):null}distance(t){return Math.sqrt(this.squaredDistance(t))}squaredDistance(t){const e=ZC.create(t),n=this.x-e.x,i=this.y-e.y;return n*n+i*i}manhattanDistance(t){const e=ZC.create(t);return Math.abs(e.x-this.x)+Math.abs(e.y-this.y)}magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)||.01}theta(t=new ZC){const e=ZC.create(t),n=-(e.y-this.y),i=e.x-this.x;let r=Math.atan2(n,i);return r<0&&(r=2*Math.PI+r),180*r/Math.PI}angleBetween(t,e){if(this.equals(t)||this.equals(e))return NaN;let n=this.theta(e)-this.theta(t);return n<0&&(n+=360),n}vectorAngle(t){const e=new ZC(0,0);return e.angleBetween(this,t)}toPolar(t){return this.update(ZC.toPolar(this,t)),this}changeInAngle(t,e,n=new ZC){return this.clone().translate(-t,-e).theta(n)-this.theta(n)}adhereToRect(t){return qC(t,this)||(this.x=Math.min(Math.max(this.x,t.x),t.x+t.width),this.y=Math.min(Math.max(this.y,t.y),t.y+t.height)),this}bearing(t){const e=ZC.create(t),n=_C.toRad(this.y),i=_C.toRad(e.y),r=this.x,s=e.x,o=_C.toRad(s-r),a=Math.sin(o)*Math.cos(i),l=Math.cos(n)*Math.sin(i)-Math.sin(n)*Math.cos(i)*Math.cos(o),h=_C.toDeg(Math.atan2(a,l)),c=["NE","E","SE","S","SW","W","NW","N"];let u=h-22.5;return u<0&&(u+=360),u=parseInt(u/45,10),c[u]}cross(t,e){if(null!=t&&null!=e){const n=ZC.create(t),i=ZC.create(e);return(i.x-this.x)*(n.y-this.y)-(i.y-this.y)*(n.x-this.x)}return NaN}dot(t){const e=ZC.create(t);return this.x*e.x+this.y*e.y}diff(t,e){if("number"===typeof t)return new ZC(this.x-t,this.y-e);const n=ZC.create(t);return new ZC(this.x-n.x,this.y-n.y)}lerp(t,e){const n=ZC.create(t);return new ZC((1-e)*this.x+e*n.x,(1-e)*this.y+e*n.y)}normalize(t=1){const e=t/this.magnitude();return this.scale(e,e)}move(t,e){const n=ZC.create(t),i=_C.toRad(n.theta(this));return this.translate(Math.cos(i)*e,-Math.sin(i)*e)}reflection(t){return ZC.create(t).move(this,this.distance(t))}snapToGrid(t,e){return this.x=XC(this.x,t),this.y=XC(this.y,null==e?t:e),this}equals(t){const e=ZC.create(t);return null!=e&&e.x===this.x&&e.y===this.y}clone(){return ZC.clone(this)}toJSON(){return ZC.toJSON(this)}serialize(){return`${this.x} ${this.y}`}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"number"===typeof i.x&&"number"===typeof i.y&&"function"===typeof i.toPolar}t.toStringTag="X6.Geometry."+t.name,t.isPoint=e})(ZC||(ZC={})),function(t){function e(t){return null!=t&&"object"===typeof t&&"number"===typeof t.x&&"number"===typeof t.y}function n(t){return null!=t&&Array.isArray(t)&&2===t.length&&"number"===typeof t[0]&&"number"===typeof t[1]}t.isPointLike=e,t.isPointData=n}(ZC||(ZC={})),function(t){function e(e,i){return null==e||"number"===typeof e?new t(e,i):n(e)}function n(e){return t.isPoint(e)?new t(e.x,e.y):Array.isArray(e)?new t(e[0],e[1]):new t(e.x,e.y)}function i(e){return t.isPoint(e)?{x:e.x,y:e.y}:Array.isArray(e)?{x:e[0],y:e[1]}:{x:e.x,y:e.y}}function r(e,i,r=new t){let s=Math.abs(e*Math.cos(i)),o=Math.abs(e*Math.sin(i));const a=n(r),l=_C.normalize(_C.toDeg(i));return l<90?o=-o:l<180?(s=-s,o=-o):l<270&&(s=-s),new t(a.x+s,a.y+o)}function s(e,i=new t){const r=n(e),s=n(i),o=r.x-s.x,a=r.y-s.y;return new t(Math.sqrt(o*o+a*a),_C.toRad(s.theta(r)))}function o(t,e){return t===e||null!=t&&null!=e&&(t.x===e.x&&t.y===e.y)}function a(t,e){if(null==t&&null!=e||null!=t&&null==e||null!=t&&null!=e&&t.length!==e.length)return!1;if(null!=t&&null!=e)for(let n=0,i=t.length;n<i;n+=1)if(!o(t[n],e[n]))return!1;return!0}function l(e,n,i,r){return new t(UC(e,n),UC(i,r))}function h(t,e,n){const i=_C.toRad(_C.normalize(-e)),r=Math.sin(i),s=Math.cos(i);return c(t,s,r,n)}function c(e,i,r,s=new t){const o=n(e),a=n(s),l=o.x-a.x,h=o.y-a.y,c=l*i-h*r,u=h*i+l*r;return new t(c+a.x,u+a.y)}t.create=e,t.clone=n,t.toJSON=i,t.fromPolar=r,t.toPolar=s,t.equals=o,t.equalPoints=a,t.random=l,t.rotate=h,t.rotateEx=c}(ZC||(ZC={}));class KC extends JC{constructor(t,e,n,i){super(),this.x=null==t?0:t,this.y=null==e?0:e,this.width=null==n?0:n,this.height=null==i?0:i}get[Symbol.toStringTag](){return KC.toStringTag}get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get origin(){return new ZC(this.x,this.y)}get topLeft(){return new ZC(this.x,this.y)}get topCenter(){return new ZC(this.x+this.width/2,this.y)}get topRight(){return new ZC(this.x+this.width,this.y)}get center(){return new ZC(this.x+this.width/2,this.y+this.height/2)}get bottomLeft(){return new ZC(this.x,this.y+this.height)}get bottomCenter(){return new ZC(this.x+this.width/2,this.y+this.height)}get bottomRight(){return new ZC(this.x+this.width,this.y+this.height)}get corner(){return new ZC(this.x+this.width,this.y+this.height)}get rightMiddle(){return new ZC(this.x+this.width,this.y+this.height/2)}get leftMiddle(){return new ZC(this.x,this.y+this.height/2)}get topLine(){return new QC(this.topLeft,this.topRight)}get rightLine(){return new QC(this.topRight,this.bottomRight)}get bottomLine(){return new QC(this.bottomLeft,this.bottomRight)}get leftLine(){return new QC(this.topLeft,this.bottomLeft)}getOrigin(){return this.origin}getTopLeft(){return this.topLeft}getTopCenter(){return this.topCenter}getTopRight(){return this.topRight}getCenter(){return this.center}getCenterX(){return this.x+this.width/2}getCenterY(){return this.y+this.height/2}getBottomLeft(){return this.bottomLeft}getBottomCenter(){return this.bottomCenter}getBottomRight(){return this.bottomRight}getCorner(){return this.corner}getRightMiddle(){return this.rightMiddle}getLeftMiddle(){return this.leftMiddle}getTopLine(){return this.topLine}getRightLine(){return this.rightLine}getBottomLine(){return this.bottomLine}getLeftLine(){return this.leftLine}bbox(t){if(!t)return this.clone();const e=_C.toRad(t),n=Math.abs(Math.sin(e)),i=Math.abs(Math.cos(e)),r=this.width*i+this.height*n,s=this.width*n+this.height*i;return new KC(this.x+(this.width-r)/2,this.y+(this.height-s)/2,r,s)}round(t=0){return this.x=HC(this.x,t),this.y=HC(this.y,t),this.width=HC(this.width,t),this.height=HC(this.height,t),this}add(t,e,n,i){const r=KC.create(t,e,n,i),s=Math.min(this.x,r.x),o=Math.min(this.y,r.y),a=Math.max(this.x+this.width,r.x+r.width),l=Math.max(this.y+this.height,r.y+r.height);return this.x=s,this.y=o,this.width=a-s,this.height=l-o,this}update(t,e,n,i){const r=KC.create(t,e,n,i);return this.x=r.x,this.y=r.y,this.width=r.width,this.height=r.height,this}inflate(t,e){const n=t,i=null!=e?e:t;return this.x-=n,this.y-=i,this.width+=2*n,this.height+=2*i,this}snapToGrid(t,e){const n=this.origin.snapToGrid(t,e),i=this.corner.snapToGrid(t,e);return this.x=n.x,this.y=n.y,this.width=i.x-n.x,this.height=i.y-n.y,this}translate(t,e){const n=ZC.create(t,e);return this.x+=n.x,this.y+=n.y,this}scale(t,e,n=new ZC){const i=this.origin.scale(t,e,n);return this.x=i.x,this.y=i.y,this.width*=t,this.height*=e,this}rotate(t,e=this.getCenter()){if(0!==t){const n=_C.toRad(t),i=Math.cos(n),r=Math.sin(n);let s=this.getOrigin(),o=this.getTopRight(),a=this.getBottomRight(),l=this.getBottomLeft();s=ZC.rotateEx(s,i,r,e),o=ZC.rotateEx(o,i,r,e),a=ZC.rotateEx(a,i,r,e),l=ZC.rotateEx(l,i,r,e);const h=new KC(s.x,s.y,0,0);h.add(o.x,o.y,0,0),h.add(a.x,a.y,0,0),h.add(l.x,l.y,0,0),this.update(h)}return this}rotate90(){const t=(this.width-this.height)/2;this.x+=t,this.y-=t;const e=this.width;return this.width=this.height,this.height=e,this}moveAndExpand(t){const e=KC.clone(t);return this.x+=e.x||0,this.y+=e.y||0,this.width+=e.width||0,this.height+=e.height||0,this}getMaxScaleToFit(t,e=this.center){const n=KC.clone(t),i=e.x,r=e.y;let s=1/0,o=1/0,a=1/0,l=1/0,h=1/0,c=1/0,u=1/0,d=1/0;const g=n.topLeft;g.x<i&&(s=(this.x-i)/(g.x-i)),g.y<r&&(h=(this.y-r)/(g.y-r));const p=n.bottomRight;p.x>i&&(o=(this.x+this.width-i)/(p.x-i)),p.y>r&&(c=(this.y+this.height-r)/(p.y-r));const f=n.topRight;f.x>i&&(a=(this.x+this.width-i)/(f.x-i)),f.y<r&&(u=(this.y-r)/(f.y-r));const m=n.bottomLeft;return m.x<i&&(l=(this.x-i)/(m.x-i)),m.y>r&&(d=(this.y+this.height-r)/(m.y-r)),{sx:Math.min(s,o,a,l),sy:Math.min(h,c,u,d)}}getMaxUniformScaleToFit(t,e=this.center){const n=this.getMaxScaleToFit(t,e);return Math.min(n.sx,n.sy)}containsPoint(t,e){return qC(this,ZC.create(t,e))}containsRect(t,e,n,i){const r=KC.create(t,e,n,i),s=this.x,o=this.y,a=this.width,l=this.height,h=r.x,c=r.y,u=r.width,d=r.height;return 0!==a&&0!==l&&0!==u&&0!==d&&(h>=s&&c>=o&&h+u<=s+a&&c+d<=o+l)}intersectsWithLine(t){const e=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],n=[],i=[];return e.forEach(e=>{const r=t.intersectsWithLine(e);null!==r&&i.indexOf(r.toString())<0&&(n.push(r),i.push(r.toString()))}),n.length>0?n:null}intersectsWithLineFromCenterToPoint(t,e){const n=ZC.clone(t),i=this.center;let r=null;null!=e&&0!==e&&n.rotate(e,i);const s=[this.topLine,this.rightLine,this.bottomLine,this.leftLine],o=new QC(i,n);for(let a=s.length-1;a>=0;a-=1){const t=s[a].intersectsWithLine(o);if(null!==t){r=t;break}}return r&&null!=e&&0!==e&&r.rotate(-e,i),r}intersectsWithRect(t,e,n,i){const r=KC.create(t,e,n,i);if(!this.isIntersectWithRect(r))return null;const s=this.origin,o=this.corner,a=r.origin,l=r.corner,h=Math.max(s.x,a.x),c=Math.max(s.y,a.y);return new KC(h,c,Math.min(o.x,l.x)-h,Math.min(o.y,l.y)-c)}isIntersectWithRect(t,e,n,i){const r=KC.create(t,e,n,i),s=this.origin,o=this.corner,a=r.origin,l=r.corner;return!(l.x<=s.x||l.y<=s.y||a.x>=o.x||a.y>=o.y)}normalize(){let t=this.x,e=this.y,n=this.width,i=this.height;return this.width<0&&(t=this.x+this.width,n=-this.width),this.height<0&&(e=this.y+this.height,i=-this.height),this.x=t,this.y=e,this.width=n,this.height=i,this}union(t){const e=KC.clone(t),n=this.origin,i=this.corner,r=e.origin,s=e.corner,o=Math.min(n.x,r.x),a=Math.min(n.y,r.y),l=Math.max(i.x,s.x),h=Math.max(i.y,s.y);return new KC(o,a,l-o,h-a)}getNearestSideToPoint(t){const e=ZC.clone(t),n=e.x-this.x,i=this.x+this.width-e.x,r=e.y-this.y,s=this.y+this.height-e.y;let o=n,a="left";return i<o&&(o=i,a="right"),r<o&&(o=r,a="top"),s<o&&(a="bottom"),a}getNearestPointToPoint(t){const e=ZC.clone(t);if(this.containsPoint(e)){const t=this.getNearestSideToPoint(e);switch(t){case"right":return new ZC(this.x+this.width,e.y);case"left":return new ZC(this.x,e.y);case"bottom":return new ZC(e.x,this.y+this.height);case"top":return new ZC(e.x,this.y);default:break}}return e.adhereToRect(this)}equals(t){return null!=t&&t.x===this.x&&t.y===this.y&&t.width===this.width&&t.height===this.height}clone(){return new KC(this.x,this.y,this.width,this.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height}}serialize(){return`${this.x} ${this.y} ${this.width} ${this.height}`}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"number"===typeof i.x&&"number"===typeof i.y&&"number"===typeof i.width&&"number"===typeof i.height&&"function"===typeof i.inflate&&"function"===typeof i.moveAndExpand}t.toStringTag="X6.Geometry."+t.name,t.isRectangle=e})(KC||(KC={})),function(t){function e(t){return null!=t&&"object"===typeof t&&"number"===typeof t.x&&"number"===typeof t.y&&"number"===typeof t.width&&"number"===typeof t.height}t.isRectangleLike=e}(KC||(KC={})),function(t){function e(e,i,r,s){return null==e||"number"===typeof e?new t(e,i,r,s):n(e)}function n(e){return t.isRectangle(e)?e.clone():Array.isArray(e)?new t(e[0],e[1],e[2],e[3]):new t(e.x,e.y,e.width,e.height)}function i(e){return new t(0,0,e.width,e.height)}function r(e,n){return new t(e.x,e.y,n.width,n.height)}function s(e){return new t(e.x-e.a,e.y-e.b,2*e.a,2*e.b)}t.create=e,t.clone=n,t.fromSize=i,t.fromPositionAndSize=r,t.fromEllipse=s}(KC||(KC={}));class QC extends JC{constructor(t,e,n,i){super(),"number"===typeof t&&"number"===typeof e?(this.start=new ZC(t,e),this.end=new ZC(n,i)):(this.start=ZC.create(t),this.end=ZC.create(e))}get[Symbol.toStringTag](){return QC.toStringTag}get center(){return new ZC((this.start.x+this.end.x)/2,(this.start.y+this.end.y)/2)}getCenter(){return this.center}round(t=0){return this.start.round(t),this.end.round(t),this}translate(t,e){return"number"===typeof t?(this.start.translate(t,e),this.end.translate(t,e)):(this.start.translate(t),this.end.translate(t)),this}rotate(t,e){return this.start.rotate(t,e),this.end.rotate(t,e),this}scale(t,e,n){return this.start.scale(t,e,n),this.end.scale(t,e,n),this}length(){return Math.sqrt(this.squaredLength())}squaredLength(){const t=this.start.x-this.end.x,e=this.start.y-this.end.y;return t*t+e*e}setLength(t){const e=this.length();if(!e)return this;const n=t/e;return this.scale(n,n,this.start)}parallel(t){const e=this.clone();if(!e.isDifferentiable())return e;const{start:n,end:i}=e,r=n.clone().rotate(270,i),s=i.clone().rotate(90,n);return n.move(s,t),i.move(r,t),e}vector(){return new ZC(this.end.x-this.start.x,this.end.y-this.start.y)}angle(){const t=new ZC(this.start.x+1,this.start.y);return this.start.angleBetween(this.end,t)}bbox(){const t=Math.min(this.start.x,this.end.x),e=Math.min(this.start.y,this.end.y),n=Math.max(this.start.x,this.end.x),i=Math.max(this.start.y,this.end.y);return new KC(t,e,n-t,i-e)}bearing(){return this.start.bearing(this.end)}closestPoint(t){return this.pointAt(this.closestPointNormalizedLength(t))}closestPointLength(t){return this.closestPointNormalizedLength(t)*this.length()}closestPointTangent(t){return this.tangentAt(this.closestPointNormalizedLength(t))}closestPointNormalizedLength(t){const e=this.vector().dot(new QC(this.start,t).vector()),n=Math.min(1,Math.max(0,e/this.squaredLength()));return Number.isNaN(n)?0:n}pointAt(t){const e=this.start,n=this.end;return t<=0?e.clone():t>=1?n.clone():e.lerp(n,t)}pointAtLength(t){const e=this.start,n=this.end;let i=!0;t<0&&(i=!1,t=-t);const r=this.length();if(t>=r)return i?n.clone():e.clone();const s=(i?t:r-t)/r;return this.pointAt(s)}divideAt(t){const e=this.pointAt(t);return[new QC(this.start,e),new QC(e,this.end)]}divideAtLength(t){const e=this.pointAtLength(t);return[new QC(this.start,e),new QC(e,this.end)]}containsPoint(t){const e=this.start,n=this.end;if(0!==e.cross(t,n))return!1;const i=this.length();return!(new QC(e,t).length()>i)&&!(new QC(t,n).length()>i)}intersect(t,e){const n=t.intersectsWithLine(this,e);return n?Array.isArray(n)?n:[n]:null}intersectsWithLine(t){const e=new ZC(this.end.x-this.start.x,this.end.y-this.start.y),n=new ZC(t.end.x-t.start.x,t.end.y-t.start.y),i=e.x*n.y-e.y*n.x,r=new ZC(t.start.x-this.start.x,t.start.y-this.start.y),s=r.x*n.y-r.y*n.x,o=r.x*e.y-r.y*e.x;if(0===i||s*i<0||o*i<0)return null;if(i>0){if(s>i||o>i)return null}else if(s<i||o<i)return null;return new ZC(this.start.x+s*e.x/i,this.start.y+s*e.y/i)}isDifferentiable(){return!this.start.equals(this.end)}pointOffset(t){const e=ZC.clone(t),n=this.start,i=this.end,r=(i.x-n.x)*(e.y-n.y)-(i.y-n.y)*(e.x-n.x);return r/this.length()}pointSquaredDistance(t,e){const n=ZC.create(t,e);return this.closestPoint(n).squaredDistance(n)}pointDistance(t,e){const n=ZC.create(t,e);return this.closestPoint(n).distance(n)}tangentAt(t){if(!this.isDifferentiable())return null;const e=this.start,n=this.end,i=this.pointAt(t),r=new QC(e,n);return r.translate(i.x-e.x,i.y-e.y),r}tangentAtLength(t){if(!this.isDifferentiable())return null;const e=this.start,n=this.end,i=this.pointAtLength(t),r=new QC(e,n);return r.translate(i.x-e.x,i.y-e.y),r}relativeCcw(t,e){const n=ZC.create(t,e);let i=n.x-this.start.x,r=n.y-this.start.y;const s=this.end.x-this.start.x,o=this.end.y-this.start.y;let a=i*o-r*s;return 0===a&&(a=i*s+r*o,a>0&&(i-=s,r-=o,a=i*s+r*o,a<0&&(a=0))),a<0?-1:a>0?1:0}equals(t){return null!=t&&this.start.x===t.start.x&&this.start.y===t.start.y&&this.end.x===t.end.x&&this.end.y===t.end.y}clone(){return new QC(this.start,this.end)}toJSON(){return{start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.end.serialize()].join(" ")}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;try{if((null==n||n===t.toStringTag)&&ZC.isPoint(i.start)&&ZC.isPoint(i.end)&&"function"===typeof i.vector&&"function"===typeof i.bearing&&"function"===typeof i.parallel&&"function"===typeof i.intersect)return!0}catch(r){return!1}return!1}t.toStringTag="X6.Geometry."+t.name,t.isLine=e})(QC||(QC={}));class tv extends JC{constructor(t,e,n,i){super(),this.x=null==t?0:t,this.y=null==e?0:e,this.a=null==n?0:n,this.b=null==i?0:i}get[Symbol.toStringTag](){return tv.toStringTag}get center(){return new ZC(this.x,this.y)}bbox(){return KC.fromEllipse(this)}getCenter(){return this.center}inflate(t,e){const n=t,i=null!=e?e:t;return this.a+=2*n,this.b+=2*i,this}normalizedDistance(t,e){const n=ZC.create(t,e),i=n.x-this.x,r=n.y-this.y,s=this.a,o=this.b;return i*i/(s*s)+r*r/(o*o)}containsPoint(t,e){return this.normalizedDistance(t,e)<=1}intersectsWithLine(t){const e=[],n=this.a,i=this.b,r=t.start,s=t.end,o=t.vector(),a=r.diff(new ZC(this.x,this.y)),l=new ZC(o.x/(n*n),o.y/(i*i)),h=new ZC(a.x/(n*n),a.y/(i*i)),c=o.dot(l),u=o.dot(h),d=a.dot(h)-1,g=u*u-c*d;if(g<0)return null;if(g>0){const t=Math.sqrt(g),n=(-u-t)/c,i=(-u+t)/c;if((n<0||n>1)&&(i<0||i>1))return null;n>=0&&n<=1&&e.push(r.lerp(s,n)),i>=0&&i<=1&&e.push(r.lerp(s,i))}else{const t=-u/c;if(!(t>=0&&t<=1))return null;e.push(r.lerp(s,t))}return e}intersectsWithLineFromCenterToPoint(t,e=0){const n=ZC.clone(t);e&&n.rotate(e,this.getCenter());const i=n.x-this.x,r=n.y-this.y;let s;if(0===i)return s=this.bbox().getNearestPointToPoint(n),e?s.rotate(-e,this.getCenter()):s;const o=r/i,a=o*o,l=this.a*this.a,h=this.b*this.b;let c=Math.sqrt(1/(1/l+a/h));c=i<0?-c:c;const u=o*c;return s=new ZC(this.x+c,this.y+u),e?s.rotate(-e,this.getCenter()):s}tangentTheta(t){const e=ZC.clone(t),n=e.x,i=e.y,r=this.a,s=this.b,o=this.bbox().center,a=o.x,l=o.y,h=30,c=n>o.x+r/2,u=n<o.x-r/2;let d,g;return c||u?(g=n>o.x?i-h:i+h,d=r*r/(n-a)-r*r*(i-l)*(g-l)/(s*s*(n-a))+a):(d=i>o.y?n+h:n-h,g=s*s/(i-l)-s*s*(n-a)*(d-a)/(r*r*(i-l))+l),new ZC(d,g).theta(e)}scale(t,e){return this.a*=t,this.b*=e,this}rotate(t,e){const n=KC.fromEllipse(this);n.rotate(t,e);const i=tv.fromRect(n);return this.a=i.a,this.b=i.b,this.x=i.x,this.y=i.y,this}translate(t,e){const n=ZC.create(t,e);return this.x+=n.x,this.y+=n.y,this}equals(t){return null!=t&&t.x===this.x&&t.y===this.y&&t.a===this.a&&t.b===this.b}clone(){return new tv(this.x,this.y,this.a,this.b)}toJSON(){return{x:this.x,y:this.y,a:this.a,b:this.b}}serialize(){return`${this.x} ${this.y} ${this.a} ${this.b}`}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"number"===typeof i.x&&"number"===typeof i.y&&"number"===typeof i.a&&"number"===typeof i.b&&"function"===typeof i.inflate&&"function"===typeof i.normalizedDistance}t.toStringTag="X6.Geometry."+t.name,t.isEllipse=e})(tv||(tv={})),function(t){function e(e,i,r,s){return null==e||"number"===typeof e?new t(e,i,r,s):n(e)}function n(e){return t.isEllipse(e)?e.clone():Array.isArray(e)?new t(e[0],e[1],e[2],e[3]):new t(e.x,e.y,e.a,e.b)}function i(e){const n=e.center;return new t(n.x,n.y,e.width/2,e.height/2)}t.create=e,t.parse=n,t.fromRect=i}(tv||(tv={}));class ev extends JC{constructor(t){if(super(),null!=t){if("string"===typeof t)return ev.parse(t);this.points=t.map(t=>ZC.create(t))}else this.points=[]}get[Symbol.toStringTag](){return ev.toStringTag}get start(){return 0===this.points.length?null:this.points[0]}get end(){return 0===this.points.length?null:this.points[this.points.length-1]}scale(t,e,n=new ZC){return this.points.forEach(i=>i.scale(t,e,n)),this}rotate(t,e){return this.points.forEach(n=>n.rotate(t,e)),this}translate(t,e){const n=ZC.create(t,e);return this.points.forEach(t=>t.translate(n.x,n.y)),this}bbox(){if(0===this.points.length)return new KC;let t=1/0,e=-1/0,n=1/0,i=-1/0;const r=this.points;for(let s=0,o=r.length;s<o;s+=1){const o=r[s],a=o.x,l=o.y;a<t&&(t=a),a>e&&(e=a),l<n&&(n=l),l>i&&(i=l)}return new KC(t,n,e-t,i-n)}closestPoint(t){const e=this.closestPointLength(t);return this.pointAtLength(e)}closestPointLength(t){const e=this.points,n=e.length;if(0===n||1===n)return 0;let i=0,r=0,s=1/0;for(let o=0,a=n-1;o<a;o+=1){const n=new QC(e[o],e[o+1]),a=n.length(),l=n.closestPointNormalizedLength(t),h=n.pointAt(l),c=h.squaredDistance(t);c<s&&(s=c,r=i+l*a),i+=a}return r}closestPointNormalizedLength(t){const e=this.closestPointLength(t);if(0===e)return 0;const n=this.length();return 0===n?0:e/n}closestPointTangent(t){const e=this.closestPointLength(t);return this.tangentAtLength(e)}containsPoint(t){if(0===this.points.length)return!1;const e=ZC.clone(t),n=e.x,i=e.y,r=this.points,s=r.length;let o=s-1,a=0;for(let l=0;l<s;l+=1){const s=r[o],h=r[l];if(e.equals(s))return!0;const c=new QC(s,h);if(c.containsPoint(t))return!0;if(i<=s.y&&i>h.y||i>s.y&&i<=h.y){const e=s.x-n>h.x-n?s.x-n:h.x-n;if(e>=0){const r=new ZC(n+e,i),s=new QC(t,r);c.intersectsWithLine(s)&&(a+=1)}}o=l}return a%2===1}intersectsWithLine(t){const e=[];for(let n=0,i=this.points.length-1;n<i;n+=1){const i=this.points[n],r=this.points[n+1],s=t.intersectsWithLine(new QC(i,r));s&&e.push(s)}return e.length>0?e:null}isDifferentiable(){for(let t=0,e=this.points.length-1;t<e;t+=1){const e=this.points[t],n=this.points[t+1],i=new QC(e,n);if(i.isDifferentiable())return!0}return!1}length(){let t=0;for(let e=0,n=this.points.length-1;e<n;e+=1){const n=this.points[e],i=this.points[e+1];t+=n.distance(i)}return t}pointAt(t){const e=this.points,n=e.length;if(0===n)return null;if(1===n)return e[0].clone();if(t<=0)return e[0].clone();if(t>=1)return e[n-1].clone();const i=this.length(),r=i*t;return this.pointAtLength(r)}pointAtLength(t){const e=this.points,n=e.length;if(0===n)return null;if(1===n)return e[0].clone();let i=!0;t<0&&(i=!1,t=-t);let r=0;for(let o=0,a=n-1;o<a;o+=1){const n=i?o:a-1-o,s=e[n],l=e[n+1],h=new QC(s,l),c=s.distance(l);if(t<=r+c)return h.pointAtLength((i?1:-1)*(t-r));r+=c}const s=i?e[n-1]:e[0];return s.clone()}tangentAt(t){const e=this.points,n=e.length;if(0===n||1===n)return null;t<0&&(t=0),t>1&&(t=1);const i=this.length(),r=i*t;return this.tangentAtLength(r)}tangentAtLength(t){const e=this.points,n=e.length;if(0===n||1===n)return null;let i,r=!0;t<0&&(r=!1,t=-t);let s=0;for(let o=0,a=n-1;o<a;o+=1){const n=r?o:a-1-o,l=e[n],h=e[n+1],c=new QC(l,h),u=l.distance(h);if(c.isDifferentiable()){if(t<=s+u)return c.tangentAtLength((r?1:-1)*(t-s));i=c}s+=u}if(i){const t=r?1:0;return i.tangentAt(t)}return null}simplify(t={}){const e=this.points;if(e.length<3)return this;const n=t.threshold||0;let i=0;while(e[i+2]){const t=i,r=i+1,s=i+2,o=e[t],a=e[r],l=e[s],h=new QC(o,l),c=h.closestPoint(a),u=c.distance(a);u<=n?e.splice(r,1):i+=1}return this}toHull(){const t=this.points,e=t.length;if(0===e)return new ev;let n=t[0];for(let u=1;u<e;u+=1)(t[u].y<n.y||t[u].y===n.y&&t[u].x>n.x)&&(n=t[u]);const i=[];for(let u=0;u<e;u+=1){let e=n.theta(t[u]);0===e&&(e=360),i.push([t[u],u,e])}if(i.sort((t,e)=>{let n=t[2]-e[2];return 0===n&&(n=e[1]-t[1]),n}),i.length>2){const t=i[i.length-1];i.unshift(t)}const r={},s=[],o=t=>`${t[0].toString()}@${t[1]}`;while(0!==i.length){const t=i.pop(),e=t[0];if(r[o(t)])continue;let n=!1;while(!n)if(s.length<2)s.push(t),n=!0;else{const a=s.pop(),l=a[0],h=s.pop(),c=h[0],u=c.cross(l,e);if(u<0)s.push(h),s.push(a),s.push(t),n=!0;else if(0===u){const t=1e-10,n=l.angleBetween(c,e);Math.abs(n-180)<t||l.equals(e)||c.equals(l)?(r[o(a)]=l,s.push(h)):Math.abs((n+1)%360-1)<t&&(s.push(h),i.push(a))}else r[o(a)]=l,s.push(h)}}let a;s.length>2&&s.pop();let l=-1;for(let u=0,d=s.length;u<d;u+=1){const t=s[u][1];(void 0===a||t<a)&&(a=t,l=u)}let h=[];if(l>0){const t=s.slice(l),e=s.slice(0,l);h=t.concat(e)}else h=s;const c=[];for(let u=0,d=h.length;u<d;u+=1)c.push(h[u][0]);return new ev(c)}equals(t){return null!=t&&(t.points.length===this.points.length&&t.points.every((t,e)=>t.equals(this.points[e])))}clone(){return new ev(this.points.map(t=>t.clone()))}toJSON(){return this.points.map(t=>t.toJSON())}serialize(){return this.points.map(t=>`${t.x}, ${t.y}`).join(" ")}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.toHull&&"function"===typeof i.simplify}t.toStringTag="X6.Geometry."+t.name,t.isPolyline=e})(ev||(ev={})),function(t){function e(e){const n=e.trim();if(""===n)return new t;const i=[],r=n.split(/\s*,\s*|\s+/);for(let t=0,s=r.length;t<s;t+=2)i.push({x:+r[t],y:+r[t+1]});return new t(i)}t.parse=e}(ev||(ev={}));class nv extends JC{constructor(t,e,n,i){super(),this.PRECISION=3,this.start=ZC.create(t),this.controlPoint1=ZC.create(e),this.controlPoint2=ZC.create(n),this.end=ZC.create(i)}get[Symbol.toStringTag](){return nv.toStringTag}bbox(){const t=this.start,e=this.controlPoint1,n=this.controlPoint2,i=this.end,r=t.x,s=t.y,o=e.x,a=e.y,l=n.x,h=n.y,c=i.x,u=i.y,d=[],g=[],p=[[],[]];let f,m,b,y,C,v,w,x,M,E,A;for(let N=0;N<2;N+=1)if(0===N?(m=6*r-12*o+6*l,f=-3*r+9*o-9*l+3*c,b=3*o-3*r):(m=6*s-12*a+6*h,f=-3*s+9*a-9*h+3*u,b=3*a-3*s),Math.abs(f)<1e-12){if(Math.abs(m)<1e-12)continue;y=-b/m,y>0&&y<1&&g.push(y)}else w=m*m-4*b*f,x=Math.sqrt(w),w<0||(C=(-m+x)/(2*f),C>0&&C<1&&g.push(C),v=(-m-x)/(2*f),v>0&&v<1&&g.push(v));let S=g.length;const O=S;while(S)S-=1,y=g[S],A=1-y,M=A*A*A*r+3*A*A*y*o+3*A*y*y*l+y*y*y*c,p[0][S]=M,E=A*A*A*s+3*A*A*y*a+3*A*y*y*h+y*y*y*u,p[1][S]=E,d[S]={X:M,Y:E};g[O]=0,g[O+1]=1,d[O]={X:r,Y:s},d[O+1]={X:c,Y:u},p[0][O]=r,p[1][O]=s,p[0][O+1]=c,p[1][O+1]=u,g.length=O+2,p[0].length=O+2,p[1].length=O+2,d.length=O+2;const P=Math.min.apply(null,p[0]),k=Math.min.apply(null,p[1]),D=Math.max.apply(null,p[0]),T=Math.max.apply(null,p[1]);return new KC(P,k,D-P,T-k)}closestPoint(t,e={}){return this.pointAtT(this.closestPointT(t,e))}closestPointLength(t,e={}){const n=this.getOptions(e);return this.lengthAtT(this.closestPointT(t,n),n)}closestPointNormalizedLength(t,e={}){const n=this.getOptions(e),i=this.closestPointLength(t,n);if(!i)return 0;const r=this.length(n);return 0===r?0:i/r}closestPointT(t,e={}){const n=this.getPrecision(e),i=this.getDivisions(e),r=Math.pow(10,-n);let s=null,o=0,a=0,l=0,h=0,c=0,u=null;const d=i.length;let g=d>0?1/d:0;i.forEach((e,n)=>{const i=e.start.distance(t),r=e.end.distance(t),d=i+r;(null==u||d<u)&&(s=e,o=n*g,a=(n+1)*g,l=i,h=r,u=d,c=e.endpointDistance())});while(1){const e=l?Math.abs(l-h)/l:0,n=null!=h?Math.abs(l-h)/h:0,i=e<r||n<r,u=!l||l<c*r,d=!h||h<c*r,p=u||d;if(i||p)return l<=h?o:a;const f=s.divide(.5);g/=2;const m=f[0].start.distance(t),b=f[0].end.distance(t),y=m+b,C=f[1].start.distance(t),v=f[1].end.distance(t),w=C+v;y<=w?(s=f[0],a-=g,l=m,h=b):(s=f[1],o+=g,l=C,h=v)}}closestPointTangent(t,e={}){return this.tangentAtT(this.closestPointT(t,e))}containsPoint(t,e={}){const n=this.toPolyline(e);return n.containsPoint(t)}divideAt(t,e={}){if(t<=0)return this.divideAtT(0);if(t>=1)return this.divideAtT(1);const n=this.tAt(t,e);return this.divideAtT(n)}divideAtLength(t,e={}){const n=this.tAtLength(t,e);return this.divideAtT(n)}divide(t){return this.divideAtT(t)}divideAtT(t){const e=this.start,n=this.controlPoint1,i=this.controlPoint2,r=this.end;if(t<=0)return[new nv(e,e,e,e),new nv(e,n,i,r)];if(t>=1)return[new nv(e,n,i,r),new nv(r,r,r,r)];const s=this.getSkeletonPoints(t),o=s.startControlPoint1,a=s.startControlPoint2,l=s.divider,h=s.dividerControlPoint1,c=s.dividerControlPoint2;return[new nv(e,o,a,l),new nv(l,h,c,r)]}endpointDistance(){return this.start.distance(this.end)}getSkeletonPoints(t){const e=this.start,n=this.controlPoint1,i=this.controlPoint2,r=this.end;if(t<=0)return{startControlPoint1:e.clone(),startControlPoint2:e.clone(),divider:e.clone(),dividerControlPoint1:n.clone(),dividerControlPoint2:i.clone()};if(t>=1)return{startControlPoint1:n.clone(),startControlPoint2:i.clone(),divider:r.clone(),dividerControlPoint1:r.clone(),dividerControlPoint2:r.clone()};const s=new QC(e,n).pointAt(t),o=new QC(n,i).pointAt(t),a=new QC(i,r).pointAt(t),l=new QC(s,o).pointAt(t),h=new QC(o,a).pointAt(t),c=new QC(l,h).pointAt(t);return{startControlPoint1:s,startControlPoint2:l,divider:c,dividerControlPoint1:h,dividerControlPoint2:a}}getSubdivisions(t={}){const e=this.getPrecision(t);let n=[new nv(this.start,this.controlPoint1,this.controlPoint2,this.end)];if(0===e)return n;let i=this.endpointDistance();const r=Math.pow(10,-e);let s=0;while(1){s+=1;const t=[];n.forEach(e=>{const n=e.divide(.5);t.push(n[0],n[1])});const e=t.reduce((t,e)=>t+e.endpointDistance(),0),o=0!==e?(e-i)/e:0;if(s>1&&o<r)return t;n=t,i=e}}length(t={}){const e=this.getDivisions(t);return e.reduce((t,e)=>t+e.endpointDistance(),0)}lengthAtT(t,e={}){if(t<=0)return 0;const n=void 0===e.precision?this.PRECISION:e.precision,i=this.divide(t)[0];return i.length({precision:n})}pointAt(t,e={}){if(t<=0)return this.start.clone();if(t>=1)return this.end.clone();const n=this.tAt(t,e);return this.pointAtT(n)}pointAtLength(t,e={}){const n=this.tAtLength(t,e);return this.pointAtT(n)}pointAtT(t){return t<=0?this.start.clone():t>=1?this.end.clone():this.getSkeletonPoints(t).divider}isDifferentiable(){const t=this.start,e=this.controlPoint1,n=this.controlPoint2,i=this.end;return!(t.equals(e)&&e.equals(n)&&n.equals(i))}tangentAt(t,e={}){if(!this.isDifferentiable())return null;t<0?t=0:t>1&&(t=1);const n=this.tAt(t,e);return this.tangentAtT(n)}tangentAtLength(t,e={}){if(!this.isDifferentiable())return null;const n=this.tAtLength(t,e);return this.tangentAtT(n)}tangentAtT(t){if(!this.isDifferentiable())return null;t<0&&(t=0),t>1&&(t=1);const e=this.getSkeletonPoints(t),n=e.startControlPoint2,i=e.dividerControlPoint1,r=e.divider,s=new QC(n,i);return s.translate(r.x-n.x,r.y-n.y),s}getPrecision(t={}){return null==t.precision?this.PRECISION:t.precision}getDivisions(t={}){if(null!=t.subdivisions)return t.subdivisions;const e=this.getPrecision(t);return this.getSubdivisions({precision:e})}getOptions(t={}){const e=this.getPrecision(t),n=this.getDivisions(t);return{precision:e,subdivisions:n}}tAt(t,e={}){if(t<=0)return 0;if(t>=1)return 1;const n=this.getOptions(e),i=this.length(n),r=i*t;return this.tAtLength(r,n)}tAtLength(t,e={}){let n=!0;t<0&&(n=!1,t=-t);const i=this.getPrecision(e),r=this.getDivisions(e),s={precision:i,subdivisions:r};let o,a,l=null,h=0,c=0,u=0;const d=r.length;let g=d>0?1/d:0;for(let m=0;m<d;m+=1){const e=n?m:d-1-m,i=r[m],s=i.endpointDistance();if(t<=u+s){l=i,o=e*g,a=(e+1)*g,h=n?t-u:s+u-t,c=n?s+u-t:t-u;break}u+=s}if(null==l)return n?1:0;const p=this.length(s),f=Math.pow(10,-i);while(1){let t,e,n;if(t=0!==p?h/p:0,t<f)return o;if(t=0!==p?c/p:0,t<f)return a;const i=l.divide(.5);g/=2;const r=i[0].endpointDistance(),s=i[1].endpointDistance();h<=r?(l=i[0],a-=g,e=h,n=r-e):(l=i[1],o+=g,e=h-r,n=s-e),h=e,c=n}}toPoints(t={}){const e=this.getDivisions(t),n=[e[0].start.clone()];return e.forEach(t=>n.push(t.end.clone())),n}toPolyline(t={}){return new ev(this.toPoints(t))}scale(t,e,n){return this.start.scale(t,e,n),this.controlPoint1.scale(t,e,n),this.controlPoint2.scale(t,e,n),this.end.scale(t,e,n),this}rotate(t,e){return this.start.rotate(t,e),this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this}translate(t,e){return"number"===typeof t?(this.start.translate(t,e),this.controlPoint1.translate(t,e),this.controlPoint2.translate(t,e),this.end.translate(t,e)):(this.start.translate(t),this.controlPoint1.translate(t),this.controlPoint2.translate(t),this.end.translate(t)),this}equals(t){return null!=t&&this.start.equals(t.start)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)&&this.end.equals(t.end)}clone(){return new nv(this.start,this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){return[this.start.serialize(),this.controlPoint1.serialize(),this.controlPoint2.serialize(),this.end.serialize()].join(" ")}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;try{if((null==n||n===t.toStringTag)&&ZC.isPoint(i.start)&&ZC.isPoint(i.controlPoint1)&&ZC.isPoint(i.controlPoint2)&&ZC.isPoint(i.end)&&"function"===typeof i.toPoints&&"function"===typeof i.toPolyline)return!0}catch(r){return!1}return!1}t.toStringTag="X6.Geometry."+t.name,t.isCurve=e})(nv||(nv={})),function(t){function e(t){const e=t.length,n=[],i=[];let r=2;n[0]=t[0]/r;for(let s=1;s<e;s+=1)i[s]=1/r,r=(s<e-1?4:3.5)-i[s],n[s]=(t[s]-n[s-1])/r;for(let s=1;s<e;s+=1)n[e-s-1]-=i[e-s]*n[e-s];return n}function n(t){const n=t.map(t=>ZC.clone(t)),i=[],r=[],s=n.length-1;if(1===s)return i[0]=new ZC((2*n[0].x+n[1].x)/3,(2*n[0].y+n[1].y)/3),r[0]=new ZC(2*i[0].x-n[0].x,2*i[0].y-n[0].y),[i,r];const o=[];for(let e=1;e<s-1;e+=1)o[e]=4*n[e].x+2*n[e+1].x;o[0]=n[0].x+2*n[1].x,o[s-1]=(8*n[s-1].x+n[s].x)/2;const a=e(o);for(let e=1;e<s-1;e+=1)o[e]=4*n[e].y+2*n[e+1].y;o[0]=n[0].y+2*n[1].y,o[s-1]=(8*n[s-1].y+n[s].y)/2;const l=e(o);for(let e=0;e<s;e+=1)i.push(new ZC(a[e],l[e])),e<s-1?r.push(new ZC(2*n[e+1].x-a[e+1],2*n[e+1].y-l[e+1])):r.push(new ZC((n[s].x+a[s-1])/2,(n[s].y+l[s-1])/2));return[i,r]}function i(e){if(null==e||Array.isArray(e)&&e.length<2)throw new Error("At least 2 points are required");const i=n(e),r=[];for(let n=0,s=i[0].length;n<s;n+=1){const s=new ZC(i[0][n].x,i[0][n].y),o=new ZC(i[1][n].x,i[1][n].y);r.push(new t(e[n],s,o,e[n+1]))}return r}t.throughPoints=i}(nv||(nv={}));class iv extends JC{constructor(){super(...arguments),this.isVisible=!0,this.isSegment=!0,this.isSubpathStart=!1}get end(){return this.endPoint}get start(){if(null==this.previousSegment)throw new Error("Missing previous segment. (This segment cannot be the first segment of a path, or segment has not yet been added to a path.)");return this.previousSegment.end}closestPointT(t,e){if(this.closestPointNormalizedLength)return this.closestPointNormalizedLength(t);throw new Error("Neither `closestPointT` nor `closestPointNormalizedLength` method is implemented.")}lengthAtT(t,e){if(t<=0)return 0;const n=this.length();return t>=1?n:n*t}divideAtT(t){if(this.divideAt)return this.divideAt(t);throw new Error("Neither `divideAtT` nor `divideAt` method is implemented.")}pointAtT(t){if(this.pointAt)return this.pointAt(t);throw new Error("Neither `pointAtT` nor `pointAt` method is implemented.")}tangentAtT(t){if(this.tangentAt)return this.tangentAt(t);throw new Error("Neither `tangentAtT` nor `tangentAt` method is implemented.")}}class rv extends iv{constructor(t,e){super(),QC.isLine(t)?this.endPoint=t.end.clone().round(2):this.endPoint=ZC.create(t,e).round(2)}get type(){return"L"}get line(){return new QC(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(t){return this.line.closestPoint(t)}closestPointLength(t){return this.line.closestPointLength(t)}closestPointNormalizedLength(t){return this.line.closestPointNormalizedLength(t)}closestPointTangent(t){return this.line.closestPointTangent(t)}length(){return this.line.length()}divideAt(t){const e=this.line.divideAt(t);return[new rv(e[0]),new rv(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[new rv(e[0]),new rv(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.line.pointAt(t)}pointAtLength(t){return this.line.pointAtLength(t)}tangentAt(t){return this.line.tangentAt(t)}tangentAtLength(t){return this.line.tangentAtLength(t)}isDifferentiable(){return null!=this.previousSegment&&!this.start.equals(this.end)}clone(){return new rv(this.end)}scale(t,e,n){return this.end.scale(t,e,n),this}rotate(t,e){return this.end.rotate(t,e),this}translate(t,e){return"number"===typeof t?this.end.translate(t,e):this.end.translate(t),this}equals(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){const t=this.end;return`${this.type} ${t.x} ${t.y}`}}(function(t){function e(...e){const n=e.length,i=e[0];if(QC.isLine(i))return new t(i);if(ZC.isPointLike(i))return 1===n?new t(i):e.map(e=>new t(e));if(2===n)return new t(+e[0],+e[1]);const r=[];for(let s=0;s<n;s+=2){const n=+e[s],i=+e[s+1];r.push(new t(n,i))}return r}t.create=e})(rv||(rv={}));class sv extends iv{get end(){if(!this.subpathStartSegment)throw new Error("Missing subpath start segment. (This segment needs a subpath start segment (e.g. MoveTo), or segment has not yet been added to a path.)");return this.subpathStartSegment.end}get type(){return"Z"}get line(){return new QC(this.start,this.end)}bbox(){return this.line.bbox()}closestPoint(t){return this.line.closestPoint(t)}closestPointLength(t){return this.line.closestPointLength(t)}closestPointNormalizedLength(t){return this.line.closestPointNormalizedLength(t)}closestPointTangent(t){return this.line.closestPointTangent(t)}length(){return this.line.length()}divideAt(t){const e=this.line.divideAt(t);return[e[1].isDifferentiable()?new rv(e[0]):this.clone(),new rv(e[1])]}divideAtLength(t){const e=this.line.divideAtLength(t);return[e[1].isDifferentiable()?new rv(e[0]):this.clone(),new rv(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.line.pointAt(t)}pointAtLength(t){return this.line.pointAtLength(t)}tangentAt(t){return this.line.tangentAt(t)}tangentAtLength(t){return this.line.tangentAtLength(t)}isDifferentiable(){return!(!this.previousSegment||!this.subpathStartSegment)&&!this.start.equals(this.end)}scale(){return this}rotate(){return this}translate(){return this}equals(t){return this.type===t.type&&this.start.equals(t.start)&&this.end.equals(t.end)}clone(){return new sv}toJSON(){return{type:this.type,start:this.start.toJSON(),end:this.end.toJSON()}}serialize(){return this.type}}(function(t){function e(){return new t}t.create=e})(sv||(sv={}));class ov extends iv{constructor(t,e){super(),this.isVisible=!1,this.isSubpathStart=!0,QC.isLine(t)||nv.isCurve(t)?this.endPoint=t.end.clone().round(2):this.endPoint=ZC.create(t,e).round(2)}get start(){throw new Error("Illegal access. Moveto segments should not need a start property.")}get type(){return"M"}bbox(){return null}closestPoint(){return this.end.clone()}closestPointLength(){return 0}closestPointNormalizedLength(){return 0}closestPointT(){return 1}closestPointTangent(){return null}length(){return 0}lengthAtT(){return 0}divideAt(){return[this.clone(),this.clone()]}divideAtLength(){return[this.clone(),this.clone()]}getSubdivisions(){return[]}pointAt(){return this.end.clone()}pointAtLength(){return this.end.clone()}pointAtT(){return this.end.clone()}tangentAt(){return null}tangentAtLength(){return null}tangentAtT(){return null}isDifferentiable(){return!1}scale(t,e,n){return this.end.scale(t,e,n),this}rotate(t,e){return this.end.rotate(t,e),this}translate(t,e){return"number"===typeof t?this.end.translate(t,e):this.end.translate(t),this}clone(){return new ov(this.end)}equals(t){return this.type===t.type&&this.end.equals(t.end)}toJSON(){return{type:this.type,end:this.end.toJSON()}}serialize(){const t=this.end;return`${this.type} ${t.x} ${t.y}`}}(function(t){function e(...e){const n=e.length,i=e[0];if(QC.isLine(i))return new t(i);if(nv.isCurve(i))return new t(i);if(ZC.isPointLike(i)){if(1===n)return new t(i);const r=[];for(let i=0;i<n;i+=1)0===i?r.push(new t(e[i])):r.push(new rv(e[i]));return r}if(2===n)return new t(+e[0],+e[1]);const r=[];for(let s=0;s<n;s+=2){const n=+e[s],i=+e[s+1];0===s?r.push(new t(n,i)):r.push(new rv(n,i))}return r}t.create=e})(ov||(ov={}));class av extends iv{constructor(t,e,n,i,r,s){super(),nv.isCurve(t)?(this.controlPoint1=t.controlPoint1.clone().round(2),this.controlPoint2=t.controlPoint2.clone().round(2),this.endPoint=t.end.clone().round(2)):"number"===typeof t?(this.controlPoint1=new ZC(t,e).round(2),this.controlPoint2=new ZC(n,i).round(2),this.endPoint=new ZC(r,s).round(2)):(this.controlPoint1=ZC.create(t).round(2),this.controlPoint2=ZC.create(e).round(2),this.endPoint=ZC.create(n).round(2))}get type(){return"C"}get curve(){return new nv(this.start,this.controlPoint1,this.controlPoint2,this.end)}bbox(){return this.curve.bbox()}closestPoint(t){return this.curve.closestPoint(t)}closestPointLength(t){return this.curve.closestPointLength(t)}closestPointNormalizedLength(t){return this.curve.closestPointNormalizedLength(t)}closestPointTangent(t){return this.curve.closestPointTangent(t)}length(){return this.curve.length()}divideAt(t,e={}){const n=this.curve.divideAt(t,e);return[new av(n[0]),new av(n[1])]}divideAtLength(t,e={}){const n=this.curve.divideAtLength(t,e);return[new av(n[0]),new av(n[1])]}divideAtT(t){const e=this.curve.divideAtT(t);return[new av(e[0]),new av(e[1])]}getSubdivisions(){return[]}pointAt(t){return this.curve.pointAt(t)}pointAtLength(t){return this.curve.pointAtLength(t)}tangentAt(t){return this.curve.tangentAt(t)}tangentAtLength(t){return this.curve.tangentAtLength(t)}isDifferentiable(){if(!this.previousSegment)return!1;const t=this.start,e=this.controlPoint1,n=this.controlPoint2,i=this.end;return!(t.equals(e)&&e.equals(n)&&n.equals(i))}scale(t,e,n){return this.controlPoint1.scale(t,e,n),this.controlPoint2.scale(t,e,n),this.end.scale(t,e,n),this}rotate(t,e){return this.controlPoint1.rotate(t,e),this.controlPoint2.rotate(t,e),this.end.rotate(t,e),this}translate(t,e){return"number"===typeof t?(this.controlPoint1.translate(t,e),this.controlPoint2.translate(t,e),this.end.translate(t,e)):(this.controlPoint1.translate(t),this.controlPoint2.translate(t),this.end.translate(t)),this}equals(t){return this.start.equals(t.start)&&this.end.equals(t.end)&&this.controlPoint1.equals(t.controlPoint1)&&this.controlPoint2.equals(t.controlPoint2)}clone(){return new av(this.controlPoint1,this.controlPoint2,this.end)}toJSON(){return{type:this.type,start:this.start.toJSON(),controlPoint1:this.controlPoint1.toJSON(),controlPoint2:this.controlPoint2.toJSON(),end:this.end.toJSON()}}serialize(){const t=this.controlPoint1,e=this.controlPoint2,n=this.end;return[this.type,t.x,t.y,e.x,e.y,n.x,n.y].join(" ")}}function lv(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function hv(t,e,n,i,r,s){const o=1/3,a=2/3;return[o*t+a*n,o*e+a*i,o*r+a*n,o*s+a*i,r,s]}function cv(t,e,n,i,r,s,o,a,l,h){const c=120*Math.PI/180,u=Math.PI/180*(+r||0);let d,g,p,f,m,b=[];if(h)g=h[0],p=h[1],f=h[2],m=h[3];else{d=lv(t,e,-u),t=d.x,e=d.y,d=lv(a,l,-u),a=d.x,l=d.y;const r=(t-a)/2,h=(e-l)/2;let c=r*r/(n*n)+h*h/(i*i);c>1&&(c=Math.sqrt(c),n*=c,i*=c);const b=n*n,y=i*i,C=(s===o?-1:1)*Math.sqrt(Math.abs((b*y-b*h*h-y*r*r)/(b*h*h+y*r*r)));f=C*n*h/i+(t+a)/2,m=C*-i*r/n+(e+l)/2,g=Math.asin((e-m)/i),p=Math.asin((l-m)/i),g=t<f?Math.PI-g:g,p=a<f?Math.PI-p:p,g<0&&(g=2*Math.PI+g),p<0&&(p=2*Math.PI+p),o&&g>p&&(g-=2*Math.PI),!o&&p>g&&(p-=2*Math.PI)}let y=p-g;if(Math.abs(y)>c){const t=p,e=a,s=l;p=g+c*(o&&p>g?1:-1),a=f+n*Math.cos(p),l=m+i*Math.sin(p),b=cv(a,l,n,i,r,0,o,e,s,[p,t,f,m])}y=p-g;const C=Math.cos(g),v=Math.sin(g),w=Math.cos(p),x=Math.sin(p),M=Math.tan(y/4),E=4/3*(n*M),A=4/3*(i*M),S=[t,e],O=[t+E*v,e-A*C],P=[a+E*x,l-A*w],k=[a,l];if(O[0]=2*S[0]-O[0],O[1]=2*S[1]-O[1],h)return[O,P,k].concat(b);{b=[O,P,k].concat(b).join().split(",");const t=[],e=b.length;for(let n=0;n<e;n+=1)t[n]=n%2?lv(+b[n-1],+b[n],u).y:lv(+b[n],+b[n+1],u).x;return t}}function uv(t){if(!t)return null;const e="\t\n\v\f\r \u2028\u2029",n=new RegExp(`([a-z])[${e},]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[${e}]*,?[${e}]*)+)`,"ig"),i=new RegExp(`(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[${e}]*,?[${e}]*`,"ig"),r={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},s=[];return t.replace(n,(t,e,n)=>{const o=[];let a=e.toLowerCase();n.replace(i,(t,e)=>(e&&o.push(+e),t)),"m"===a&&o.length>2&&(s.push([e,...o.splice(0,2)]),a="l",e="m"===e?"l":"L");const l=r[a];while(o.length>=l)if(s.push([e,...o.splice(0,l)]),!l)break;return t}),s}function dv(t){const e=uv(t);if(!e||!e.length)return[["M",0,0]];let n=0,i=0,r=0,s=0;const o=[];for(let a=0,l=e.length;a<l;a+=1){const t=[];o.push(t);const l=e[a],h=l[0];if(h!==h.toUpperCase())switch(t[0]=h.toUpperCase(),t[0]){case"A":t[1]=l[1],t[2]=l[2],t[3]=l[3],t[4]=l[4],t[5]=l[5],t[6]=+l[6]+n,t[7]=+l[7]+i;break;case"V":t[1]=+l[1]+i;break;case"H":t[1]=+l[1]+n;break;case"M":r=+l[1]+n,s=+l[2]+i;for(let e=1,r=l.length;e<r;e+=1)t[e]=+l[e]+(e%2?n:i);break;default:for(let e=1,r=l.length;e<r;e+=1)t[e]=+l[e]+(e%2?n:i);break}else for(let e=0,n=l.length;e<n;e+=1)t[e]=l[e];switch(t[0]){case"Z":n=+r,i=+s;break;case"H":n=t[1];break;case"V":i=t[1];break;case"M":r=t[t.length-2],s=t[t.length-1],n=t[t.length-2],i=t[t.length-1];break;default:n=t[t.length-2],i=t[t.length-1];break}}return o}function gv(t){const e=dv(t),n={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null};function i(t,e,n){let i,r;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(t[0]in{T:1,Q:1}||(e.qx=null,e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":return 0===parseFloat(t[1])||0===parseFloat(t[2])?["L",t[6],t[7]]:["C"].concat(cv.apply(0,[e.x,e.y].concat(t.slice(1))));case"S":return"C"===n||"S"===n?(i=2*e.x-e.bx,r=2*e.y-e.by):(i=e.x,r=e.y),["C",i,r].concat(t.slice(1));case"T":return"Q"===n||"T"===n?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),["C"].concat(hv(e.x,e.y,e.qx,e.qy,t[1],t[2]));case"Q":return e.qx=t[1],e.qy=t[2],["C"].concat(hv(e.x,e.y,t[1],t[2],t[3],t[4]));case"H":return["L"].concat(t[1],e.y);case"V":return["L"].concat(e.x,t[1]);case"L":break;case"Z":break;default:break}return t}function r(t,n){if(t[n].length>7){t[n].shift();const i=t[n];while(i.length)s[n]="A",n+=1,t.splice(n,0,["C"].concat(i.splice(0,6)));t.splice(n,1),a=e.length}}const s=[];let o="",a=e.length;for(let l=0;l<a;l+=1){let t="";e[l]&&(t=e[l][0]),"C"!==t&&(s[l]=t,l>0&&(o=s[l-1])),e[l]=i(e[l],n,o),"A"!==s[l]&&"C"===t&&(s[l]="C"),r(e,l);const a=e[l],h=a.length;n.x=a[h-2],n.y=a[h-1],n.bx=parseFloat(a[h-4])||n.x,n.by=parseFloat(a[h-3])||n.y}return e[0][0]&&"M"===e[0][0]||e.unshift(["M",0,0]),e}function pv(t){return gv(t).map(t=>t.map(t=>"string"===typeof t?t:HC(t,2))).join(",").split(",").join(" ")}(function(t){function e(...e){const n=e.length,i=e[0];if(nv.isCurve(i))return new t(i);if(ZC.isPointLike(i)){if(3===n)return new t(e[0],e[1],e[2]);const i=[];for(let r=0;r<n;r+=3)i.push(new t(e[r],e[r+1],e[r+2]));return i}if(6===n)return new t(e[0],e[1],e[2],e[3],e[4],e[5]);const r=[];for(let s=0;s<n;s+=6)r.push(new t(e[s],e[s+1],e[s+2],e[s+3],e[s+4],e[s+5]));return r}t.create=e})(av||(av={}));const fv=new RegExp("^[\\s\\dLMCZz,.]*$");function mv(t){return"string"===typeof t&&fv.test(t)}function bv(t,e){return(t%e+e)%e}function yv(t,e,n,i,r){const s=[],o=t[t.length-1],a=null!=e&&e>0,l=e||0;if(i&&a){t=t.slice();const e=t[0],n=new ZC(o.x+(e.x-o.x)/2,o.y+(e.y-o.y)/2);t.splice(0,0,n)}let h=t[0],c=1;n?s.push("M",h.x,h.y):s.push("L",h.x,h.y);while(c<(i?t.length:t.length-1)){let e=t[bv(c,t.length)],n=h.x-e.x,i=h.y-e.y;if(a&&(0!==n||0!==i)&&(null==r||r.indexOf(c-1)<0)){let r=Math.sqrt(n*n+i*i);const o=n*Math.min(l,r/2)/r,a=i*Math.min(l,r/2)/r,h=e.x+o,u=e.y+a;s.push("L",h,u);let d=t[bv(c+1,t.length)];while(c<t.length-2&&0===Math.round(d.x-e.x)&&0===Math.round(d.y-e.y))d=t[bv(c+2,t.length)],c+=1;n=d.x-e.x,i=d.y-e.y,r=Math.max(1,Math.sqrt(n*n+i*i));const g=n*Math.min(l,r/2)/r,p=i*Math.min(l,r/2)/r,f=e.x+g,m=e.y+p;s.push("Q",e.x,e.y,f,m),e=new ZC(f,m)}else s.push("L",e.x,e.y);h=e,c+=1}return i?s.push("Z"):s.push("L",o.x,o.y),s.map(t=>"string"===typeof t?t:+t.toFixed(3)).join(" ")}function Cv(t,e={}){const n=[];return t&&t.length&&t.forEach(t=>{Array.isArray(t)?n.push({x:t[0],y:t[1]}):n.push({x:t.x,y:t.y})}),yv(n,e.round,null==e.initialMove||e.initialMove,e.close,e.exclude)}function vv(t,e,n,i,r=0,s=0,o=0,a,l){if(0===n||0===i)return[];a-=t,l-=e,n=Math.abs(n),i=Math.abs(i);const h=-a/2,c=-l/2,u=Math.cos(r*Math.PI/180),d=Math.sin(r*Math.PI/180),g=u*h+d*c,p=-1*d*h+u*c,f=g*g,m=p*p,b=n*n,y=i*i,C=f/b+m/y;let v;if(C>1)n=Math.sqrt(C)*n,i=Math.sqrt(C)*i,v=0;else{let t=1;s===o&&(t=-1),v=t*Math.sqrt((b*y-b*m-y*f)/(b*m+y*f))}const w=v*n*p/i,x=-1*v*i*g/n,M=u*w-d*x+a/2,E=d*w+u*x+l/2;let A=Math.atan2((p-x)/i,(g-w)/n)-Math.atan2(0,1),S=A>=0?A:2*Math.PI+A;A=Math.atan2((-p-x)/i,(-g-w)/n)-Math.atan2((p-x)/i,(g-w)/n);let O=A>=0?A:2*Math.PI+A;0===o&&O>0?O-=2*Math.PI:0!==o&&O<0&&(O+=2*Math.PI);const P=2*O/Math.PI,k=Math.ceil(P<0?-1*P:P),D=O/k,T=8/3*Math.sin(D/4)*Math.sin(D/4)/Math.sin(D/2),N=u*n,j=u*i,L=d*n,F=d*i;let z=Math.cos(S),B=Math.sin(S),R=-T*(N*B+F*z),I=-T*(L*B-j*z),V=0,$=0;const G=[];for(let _=0;_<k;_+=1){S+=D,z=Math.cos(S),B=Math.sin(S),V=N*z-F*B+M,$=L*z+j*B+E;const n=-T*(N*B+F*z),i=-T*(L*B-j*z),r=6*_;G[r]=Number(R+t),G[r+1]=Number(I+e),G[r+2]=Number(V-n+t),G[r+3]=Number($-i+e),G[r+4]=Number(V+t),G[r+5]=Number($+e),R=V+n,I=$+i}return G.map(t=>+t.toFixed(2))}function wv(t,e,n,i,r=0,s=0,o=0,a,l){const h=[],c=vv(t,e,n,i,r,s,o,a,l);if(null!=c)for(let u=0,d=c.length;u<d;u+=6)h.push("C",c[u],c[u+1],c[u+2],c[u+3],c[u+4],c[u+5]);return h.join(" ")}class xv extends JC{constructor(t){if(super(),this.PRECISION=3,this.segments=[],Array.isArray(t))if(QC.isLine(t[0])||nv.isCurve(t[0])){let e=null;const n=t;n.forEach((t,n)=>{0===n&&this.appendSegment(xv.createSegment("M",t.start)),null==e||e.end.equals(t.start)||this.appendSegment(xv.createSegment("M",t.start)),QC.isLine(t)?this.appendSegment(xv.createSegment("L",t.end)):nv.isCurve(t)&&this.appendSegment(xv.createSegment("C",t.controlPoint1,t.controlPoint2,t.end)),e=t})}else{const e=t;e.forEach(t=>{t.isSegment&&this.appendSegment(t)})}else null!=t&&(QC.isLine(t)?(this.appendSegment(xv.createSegment("M",t.start)),this.appendSegment(xv.createSegment("L",t.end))):nv.isCurve(t)?(this.appendSegment(xv.createSegment("M",t.start)),this.appendSegment(xv.createSegment("C",t.controlPoint1,t.controlPoint2,t.end))):ev.isPolyline(t)?t.points&&t.points.length&&t.points.forEach((t,e)=>{const n=0===e?xv.createSegment("M",t):xv.createSegment("L",t);this.appendSegment(n)}):t.isSegment&&this.appendSegment(t))}get[Symbol.toStringTag](){return xv.toStringTag}get start(){const t=this.segments,e=t.length;if(0===e)return null;for(let n=0;n<e;n+=1){const e=t[n];if(e.isVisible)return e.start}return t[e-1].end}get end(){const t=this.segments,e=t.length;if(0===e)return null;for(let n=e-1;n>=0;n-=1){const e=t[n];if(e.isVisible)return e.end}return t[e-1].end}moveTo(...t){return this.appendSegment(ov.create.call(null,...t))}lineTo(...t){return this.appendSegment(rv.create.call(null,...t))}curveTo(...t){return this.appendSegment(av.create.call(null,...t))}arcTo(t,e,n,i,r,s,o){const a=this.end||new ZC,l="number"===typeof s?vv(a.x,a.y,t,e,n,i,r,s,o):vv(a.x,a.y,t,e,n,i,r,s.x,s.y);if(null!=l)for(let h=0,c=l.length;h<c;h+=6)this.curveTo(l[h],l[h+1],l[h+2],l[h+3],l[h+4],l[h+5]);return this}quadTo(t,e,n,i){const r=this.end||new ZC,s=["M",r.x,r.y];if("number"===typeof t)s.push("Q",t,e,n,i);else{const n=e;s.push("Q",t.x,t.y,n.x,n.y)}const o=xv.parse(s.join(" "));return this.appendSegment(o.segments.slice(1)),this}close(){return this.appendSegment(sv.create())}drawPoints(t,e={}){const n=Cv(t,e),i=xv.parse(n);i&&i.segments&&this.appendSegment(i.segments)}bbox(){const t=this.segments,e=t.length;if(0===e)return null;let n;for(let r=0;r<e;r+=1){const e=t[r];if(e.isVisible){const t=e.bbox();null!=t&&(n=n?n.union(t):t)}}if(null!=n)return n;const i=t[e-1];return new KC(i.end.x,i.end.y,0,0)}appendSegment(t){const e=this.segments.length;let n,i=0!==e?this.segments[e-1]:null;const r=null;if(Array.isArray(t))for(let s=0,o=t.length;s<o;s+=1){const e=t[s];n=this.prepareSegment(e,i,r),this.segments.push(n),i=n}else null!=t&&t.isSegment&&(n=this.prepareSegment(t,i,r),this.segments.push(n));return this}insertSegment(t,e){const n=this.segments.length;if(t<0&&(t=n+t+1),t>n||t<0)throw new Error("Index out of range.");let i,r=null,s=null;if(0!==n&&(t>=1?(r=this.segments[t-1],s=r.nextSegment):(r=null,s=this.segments[0])),Array.isArray(e))for(let o=0,a=e.length;o<a;o+=1){const n=e[o];i=this.prepareSegment(n,r,s),this.segments.splice(t+o,0,i),r=i}else i=this.prepareSegment(e,r,s),this.segments.splice(t,0,i);return this}removeSegment(t){const e=this.fixIndex(t),n=this.segments.splice(e,1)[0],i=n.previousSegment,r=n.nextSegment;return i&&(i.nextSegment=r),r&&(r.previousSegment=i),n.isSubpathStart&&r&&this.updateSubpathStartSegment(r),n}replaceSegment(t,e){const n=this.fixIndex(t);let i;const r=this.segments[n];let s=r.previousSegment;const o=r.nextSegment;let a=r.isSubpathStart;if(Array.isArray(e)){this.segments.splice(t,1);for(let n=0,r=e.length;n<r;n+=1){const r=e[n];i=this.prepareSegment(r,s,o),this.segments.splice(t+n,0,i),s=i,a&&i.isSubpathStart&&(a=!1)}}else i=this.prepareSegment(e,s,o),this.segments.splice(n,1,i),a&&i.isSubpathStart&&(a=!1);a&&o&&this.updateSubpathStartSegment(o)}getSegment(t){const e=this.fixIndex(t);return this.segments[e]}fixIndex(t){const e=this.segments.length;if(0===e)throw new Error("Path has no segments.");let n=t;while(n<0)n=e+n;if(n>=e||n<0)throw new Error("Index out of range.");return n}segmentAt(t,e={}){const n=this.segmentIndexAt(t,e);return n?this.getSegment(n):null}segmentAtLength(t,e={}){const n=this.segmentIndexAtLength(t,e);return n?this.getSegment(n):null}segmentIndexAt(t,e={}){if(0===this.segments.length)return null;const n=WC(t,0,1),i=this.getOptions(e),r=this.length(i),s=r*n;return this.segmentIndexAtLength(s,i)}segmentIndexAtLength(t,e={}){const n=this.segments.length;if(0===n)return null;let i=!0;t<0&&(i=!1,t=-t);const r=this.getPrecision(e),s=this.getSubdivisions(e);let o=0,a=null;for(let l=0;l<n;l+=1){const e=i?l:n-1-l,h=this.segments[e],c=s[e],u=h.length({precision:r,subdivisions:c});if(h.isVisible){if(t<=o+u)return e;a=e}o+=u}return a}getSegmentSubdivisions(t={}){const e=this.getPrecision(t),n=[];for(let i=0,r=this.segments.length;i<r;i+=1){const t=this.segments[i],r=t.getSubdivisions({precision:e});n.push(r)}return n}updateSubpathStartSegment(t){let e=t.previousSegment,n=t;while(n&&!n.isSubpathStart)n.subpathStartSegment=null!=e?e.subpathStartSegment:null,e=n,n=n.nextSegment}prepareSegment(t,e,n){t.previousSegment=e,t.nextSegment=n,null!=e&&(e.nextSegment=t),null!=n&&(n.previousSegment=t);let i=t;return t.isSubpathStart&&(t.subpathStartSegment=t,i=n),null!=i&&this.updateSubpathStartSegment(i),t}closestPoint(t,e={}){const n=this.closestPointT(t,e);return n?this.pointAtT(n):null}closestPointLength(t,e={}){const n=this.getOptions(e),i=this.closestPointT(t,n);return i?this.lengthAtT(i,n):0}closestPointNormalizedLength(t,e={}){const n=this.getOptions(e),i=this.closestPointLength(t,n);if(0===i)return 0;const r=this.length(n);return 0===r?0:i/r}closestPointT(t,e={}){if(0===this.segments.length)return null;const n=this.getPrecision(e),i=this.getSubdivisions(e);let r,s=1/0;for(let o=0,a=this.segments.length;o<a;o+=1){const e=this.segments[o],a=i[o];if(e.isVisible){const i=e.closestPointT(t,{precision:n,subdivisions:a}),l=e.pointAtT(i),h=YC(l,t);h<s&&(r={segmentIndex:o,value:i},s=h)}}return r||{segmentIndex:this.segments.length-1,value:1}}closestPointTangent(t,e={}){if(0===this.segments.length)return null;const n=this.getPrecision(e),i=this.getSubdivisions(e);let r,s=1/0;for(let o=0,a=this.segments.length;o<a;o+=1){const e=this.segments[o],a=i[o];if(e.isDifferentiable()){const i=e.closestPointT(t,{precision:n,subdivisions:a}),o=e.pointAtT(i),l=YC(o,t);l<s&&(r=e.tangentAtT(i),s=l)}}return r||null}containsPoint(t,e={}){const n=this.toPolylines(e);if(!n)return!1;let i=0;for(let r=0,s=n.length;r<s;r+=1){const e=n[r];e.containsPoint(t)&&(i+=1)}return i%2===1}pointAt(t,e={}){if(0===this.segments.length)return null;if(t<=0)return this.start.clone();if(t>=1)return this.end.clone();const n=this.getOptions(e),i=this.length(n),r=i*t;return this.pointAtLength(r,n)}pointAtLength(t,e={}){if(0===this.segments.length)return null;if(0===t)return this.start.clone();let n=!0;t<0&&(n=!1,t=-t);const i=this.getPrecision(e),r=this.getSubdivisions(e);let s,o=0;for(let l=0,h=this.segments.length;l<h;l+=1){const e=n?l:h-1-l,a=this.segments[e],c=r[e],u=a.length({precision:i,subdivisions:c});if(a.isVisible){if(t<=o+u)return a.pointAtLength((n?1:-1)*(t-o),{precision:i,subdivisions:c});s=a}o+=u}if(s)return n?s.end:s.start;const a=this.segments[this.segments.length-1];return a.end.clone()}pointAtT(t){const e=this.segments,n=e.length;if(0===n)return null;const i=t.segmentIndex;if(i<0)return e[0].pointAtT(0);if(i>=n)return e[n-1].pointAtT(1);const r=WC(t.value,0,1);return e[i].pointAtT(r)}divideAt(t,e={}){if(0===this.segments.length)return null;const n=WC(t,0,1),i=this.getOptions(e),r=this.length(i),s=r*n;return this.divideAtLength(s,i)}divideAtLength(t,e={}){if(0===this.segments.length)return null;let n=!0;t<0&&(n=!1,t=-t);const i=this.getPrecision(e),r=this.getSubdivisions(e);let s,o,a,l,h,c=0;for(let v=0,w=this.segments.length;v<w;v+=1){const e=n?v:w-1-v,h=this.getSegment(e),u=r[e],d={precision:i,subdivisions:u},g=h.length(d);if(h.isDifferentiable()&&(a=h,l=e,t<=c+g)){o=e,s=h.divideAtLength((n?1:-1)*(t-c),d);break}c+=g}if(!a)return null;s||(o=l,h=n?1:0,s=a.divideAtT(h));const u=this.clone(),d=o;u.replaceSegment(d,s);const g=d;let p=d+1,f=d+2;s[0].isDifferentiable()||(u.removeSegment(g),p-=1,f-=1);const m=u.getSegment(p).start;u.insertSegment(p,xv.createSegment("M",m)),f+=1,s[1].isDifferentiable()||(u.removeSegment(f-1),f-=1);const b=f-g-1;for(let v=f,w=u.segments.length;v<w;v+=1){const t=this.getSegment(v-b),e=u.getSegment(v);if("Z"===e.type&&!t.subpathStartSegment.end.equals(e.subpathStartSegment.end)){const e=xv.createSegment("L",t.end);u.replaceSegment(v,e)}}const y=new xv(u.segments.slice(0,p)),C=new xv(u.segments.slice(p));return[y,C]}intersectsWithLine(t,e={}){const n=this.toPolylines(e);if(null==n)return null;let i=null;for(let r=0,s=n.length;r<s;r+=1){const e=n[r],s=t.intersect(e);s&&(null==i&&(i=[]),Array.isArray(s)?i.push(...s):i.push(s))}return i}isDifferentiable(){for(let t=0,e=this.segments.length;t<e;t+=1){const e=this.segments[t];if(e.isDifferentiable())return!0}return!1}isValid(){const t=this.segments,e=0===t.length||"M"===t[0].type;return e}length(t={}){if(0===this.segments.length)return 0;const e=this.getSubdivisions(t);let n=0;for(let i=0,r=this.segments.length;i<r;i+=1){const t=this.segments[i],r=e[i];n+=t.length({subdivisions:r})}return n}lengthAtT(t,e={}){const n=this.segments.length;if(0===n)return 0;let i=t.segmentIndex;if(i<0)return 0;let r=WC(t.value,0,1);i>=n&&(i=n-1,r=1);const s=this.getPrecision(e),o=this.getSubdivisions(e);let a=0;for(let c=0;c<i;c+=1){const t=this.segments[c],e=o[c];a+=t.length({precision:s,subdivisions:e})}const l=this.segments[i],h=o[i];return a+=l.lengthAtT(r,{precision:s,subdivisions:h}),a}tangentAt(t,e={}){if(0===this.segments.length)return null;const n=WC(t,0,1),i=this.getOptions(e),r=this.length(i),s=r*n;return this.tangentAtLength(s,i)}tangentAtLength(t,e={}){if(0===this.segments.length)return null;let n=!0;t<0&&(n=!1,t=-t);const i=this.getPrecision(e),r=this.getSubdivisions(e);let s,o=0;for(let a=0,l=this.segments.length;a<l;a+=1){const e=n?a:l-1-a,h=this.segments[e],c=r[e],u=h.length({precision:i,subdivisions:c});if(h.isDifferentiable()){if(t<=o+u)return h.tangentAtLength((n?1:-1)*(t-o),{precision:i,subdivisions:c});s=h}o+=u}if(s){const t=n?1:0;return s.tangentAtT(t)}return null}tangentAtT(t){const e=this.segments.length;if(0===e)return null;const n=t.segmentIndex;if(n<0)return this.segments[0].tangentAtT(0);if(n>=e)return this.segments[e-1].tangentAtT(1);const i=WC(t.value,0,1);return this.segments[n].tangentAtT(i)}getPrecision(t={}){return null==t.precision?this.PRECISION:t.precision}getSubdivisions(t={}){if(null==t.segmentSubdivisions){const e=this.getPrecision(t);return this.getSegmentSubdivisions({precision:e})}return t.segmentSubdivisions}getOptions(t={}){const e=this.getPrecision(t),n=this.getSubdivisions(t);return{precision:e,segmentSubdivisions:n}}toPoints(t={}){const e=this.segments,n=e.length;if(0===n)return null;const i=this.getSubdivisions(t),r=[];let s=[];for(let o=0;o<n;o+=1){const t=e[o];if(t.isVisible){const e=i[o];e.length>0?e.forEach(t=>s.push(t.start)):s.push(t.start)}else s.length>0&&(s.push(e[o-1].end),r.push(s),s=[])}return s.length>0&&(s.push(this.end),r.push(s)),r}toPolylines(t={}){const e=this.toPoints(t);return e?e.map(t=>new ev(t)):null}scale(t,e,n){return this.segments.forEach(i=>i.scale(t,e,n)),this}rotate(t,e){return this.segments.forEach(n=>n.rotate(t,e)),this}translate(t,e){return"number"===typeof t?this.segments.forEach(n=>n.translate(t,e)):this.segments.forEach(e=>e.translate(t)),this}clone(){const t=new xv;return this.segments.forEach(e=>t.appendSegment(e.clone())),t}equals(t){if(null==t)return!1;const e=this.segments,n=t.segments,i=e.length;if(n.length!==i)return!1;for(let r=0;r<i;r+=1){const t=e[r],i=n[r];if(t.type!==i.type||!t.equals(i))return!1}return!0}toJSON(){return this.segments.map(t=>t.toJSON())}serialize(){if(!this.isValid())throw new Error("Invalid path segments.");return this.segments.map(t=>t.serialize()).join(" ")}toString(){return this.serialize()}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return!(null!=n&&n!==t.toStringTag||!Array.isArray(i.segments)||"function"!==typeof i.moveTo||"function"!==typeof i.lineTo||"function"!==typeof i.curveTo)}t.toStringTag="X6.Geometry."+t.name,t.isPath=e})(xv||(xv={})),function(t){function e(e){if(!e)return new t;const i=new t,r=/(?:[a-zA-Z] *)(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)? *,? *)|(?:-?\.\d+ *,? *))+|(?:[a-zA-Z] *)(?! |\d|-|\.)/g,s=t.normalize(e).match(r);if(null!=s)for(let t=0,o=s.length;t<o;t+=1){const e=s[t],r=/(?:[a-zA-Z])|(?:(?:-?\d+(?:\.\d+)?(?:e[-+]?\d+)?))|(?:(?:-?\.\d+))/g,o=e.match(r);if(null!=o){const t=o[0],e=o.slice(1).map(t=>+t),r=n.call(null,t,...e);i.appendSegment(r)}}return i}function n(t,...e){if("M"===t)return ov.create.call(null,...e);if("L"===t)return rv.create.call(null,...e);if("C"===t)return av.create.call(null,...e);if("z"===t||"Z"===t)return sv.create();throw new Error(`Invalid path segment type "${t}"`)}t.parse=e,t.createSegment=n}(xv||(xv={})),function(t){t.normalize=pv,t.isValid=mv,t.drawArc=wv,t.drawPoints=Cv,t.arcToCurves=vv}(xv||(xv={}));class Mv{constructor(t,e,n){if(!t)throw new TypeError("Invalid element to create vector");let i;if(Mv.isVector(t))i=t.node;else if("string"===typeof t)if("svg"===t.toLowerCase())i=Xy();else if("<"===t[0]){const e=Xy(t);i=document.importNode(e.firstChild,!0)}else i=document.createElementNS(Gy.svg,t);else i=t;this.node=i,e&&this.setAttributes(e),n&&this.append(n)}get[Symbol.toStringTag](){return Mv.toStringTag}get type(){return this.node.nodeName}get id(){return this.node.id}set id(t){this.node.id=t}transform(t,e){return null==t?Ow(this.node):(Ow(this.node,t,e),this)}translate(t,e=0,n={}){return null==t?Pw(this.node):(Pw(this.node,t,e,n),this)}rotate(t,e,n,i={}){return null==t?kw(this.node):(kw(this.node,t,e,n,i),this)}scale(t,e){return null==t?Dw(this.node):(Dw(this.node,t,e),this)}getTransformToElement(t){const e=Mv.toNode(t);return bw(this.node,e)}removeAttribute(t){return dC(this.node,t),this}getAttribute(t){return uC(this.node,t)}setAttribute(t,e){return gC(this.node,t,e),this}setAttributes(t){return pC(this.node,t),this}attr(t,e){return null==t?fC(this.node):"string"===typeof t&&void 0===e?fC(this.node,t):("object"===typeof t?fC(this.node,t):fC(this.node,t,e),this)}svg(){return this.node instanceof SVGSVGElement?this:Mv.create(this.node.ownerSVGElement)}defs(){const t=this.svg()||this,e=t.node.getElementsByTagName("defs")[0];return e?Mv.create(e):Mv.create("defs").appendTo(t)}text(t,e={}){return kv(this.node,t,e),this}tagName(){return Yy(this.node)}clone(){return Mv.create(this.node.cloneNode(!0))}remove(){return eC(this.node),this}empty(){return nC(this.node),this}append(t){return iC(this.node,Mv.toNodes(t)),this}appendTo(t){return oC(this.node,Mv.isVector(t)?t.node:t),this}prepend(t){return rC(this.node,Mv.toNodes(t)),this}before(t){return sC(this.node,Mv.toNodes(t)),this}replace(t){return this.node.parentNode&&this.node.parentNode.replaceChild(Mv.toNode(t),this.node),Mv.create(t)}first(){return this.node.firstChild?Mv.create(this.node.firstChild):null}last(){return this.node.lastChild?Mv.create(this.node.lastChild):null}get(t){const e=this.node.childNodes[t];return e?Mv.create(e):null}indexOf(t){const e=Array.prototype.slice.call(this.node.childNodes);return e.indexOf(Mv.toNode(t))}find(t){const e=[],n=Zy(this.node,t);if(n)for(let i=0,r=n.length;i<r;i+=1)e.push(Mv.create(n[i]));return e}findOne(t){const e=Ky(this.node,t);return e?Mv.create(e):null}findParentByClass(t,e){const n=Qy(this.node,t,e);return n?Mv.create(n):null}matches(t){const e=this.node,n=(this.node.matches,e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector||null);return n&&n.call(e,t)}contains(t){return tC(this.node,Mv.isVector(t)?t.node:t)}wrap(t){const e=Mv.create(t),n=this.node.parentNode;return null!=n&&n.insertBefore(e.node,this.node),e.append(this)}parent(t){let e=this;if(null==e.node.parentNode)return null;if(e=Mv.create(e.node.parentNode),null==t)return e;do{if("string"===typeof t?e.matches(t):e instanceof t)return e}while(e=Mv.create(e.node.parentNode));return e}children(){const t=this.node.childNodes,e=[];for(let n=0;n<t.length;n+=1){const i=t[n];1===i.nodeType&&e.push(Mv.create(t[n]))}return e}eachChild(t,e){const n=this.children();for(let i=0,r=n.length;i<r;i+=1)t.call(n[i],n[i],i,n),e&&n[i].eachChild(t,e);return this}index(){return Jy(this.node)}hasClass(t){return Ly(this.node,t)}addClass(t){return Fy(this.node,t),this}removeClass(t){return zy(this.node,t),this}toggleClass(t,e){return By(this.node,t,e),this}toLocalPoint(t,e){return yw(this.node,t,e)}toGeometryShape(){return Cw(this.node)}translateCenterToPoint(t){const e=this.getBBox({target:this.svg()}),n=e.getCenter();return this.translate(t.x-n.x,t.y-n.y),this}translateAndAutoOrient(t,e,n){return Tw(this.node,t,e,n),this}animate(t){return ww(this.node,t)}animateTransform(t){return xw(this.node,t)}animateAlongPath(t,e){return Aw(this.node,t,e)}normalizePath(){const t=this.tagName();return"path"===t&&this.attr("d",xv.normalize(this.attr("d"))),this}bbox(t,e){return gw(this.node,t,e)}getBBox(t={}){return pw(this.node,{recursive:t.recursive,target:t.target?Mv.toNode(t.target):null})}sample(t=1){return this.node instanceof SVGPathElement?Lv(this.node,t):[]}toPath(){return Mv.create(Hv(this.node))}toPathData(){return Uv(this.node)}}function Ev(t,e){const n=Mv.create(e),i=Mv.create("textPath"),r=t.d;if(r&&void 0===t["xlink:href"]){const t=Mv.create("path").attr("d",r).appendTo(n.defs());i.attr("xlink:href","#"+t.id)}return"object"===typeof t&&i.attr(t),i.node}function Av(t,e,n){const i=n.eol,r=n.baseSize,s=n.lineHeight;let o,a=0;const l={},h=e.length-1;for(let c=0;c<=h;c+=1){let s=e[c],l=null;if("object"===typeof s){const t=s.attrs,e=Mv.create("tspan",t);o=e.node;let u=s.t;i&&c===h&&(u+=i),o.textContent=u;const d=t.class;d&&e.addClass(d),n.includeAnnotationIndices&&e.attr("annotations",s.annotations.join(",")),l=parseFloat(t["font-size"]),void 0===l&&(l=r),l&&l>a&&(a=l)}else i&&c===h&&(s+=i),o=document.createTextNode(s||" "),r&&r>a&&(a=r);t.appendChild(o)}return a&&(l.maxFontSize=a),s?l.lineHeight=s:a&&(l.lineHeight=1.2*a),l}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&i.node instanceof SVGElement&&"function"===typeof i.animate&&"function"===typeof i.sample&&"function"===typeof i.normalizePath&&"function"===typeof i.toPath}function n(e,n,i){return new t(e,n,i)}function i(t){if("<"===t[0]){const e=Xy(t),i=[];for(let t=0,r=e.childNodes.length;t<r;t+=1){const r=e.childNodes[t];i.push(n(document.importNode(r,!0)))}return i}return[n(t)]}function r(t){return e(t)?t.node:t}function s(t){return Array.isArray(t)?t.map(t=>r(t)):[r(t)]}t.toStringTag="X6."+t.name,t.isVector=e,t.create=n,t.createVectors=i,t.toNode=r,t.toNodes=s})(Mv||(Mv={}));const Sv=/em$/;function Ov(t,e){const n=parseFloat(t);return Sv.test(t)?n*e:n}function Pv(t,e,n,i){if(!Array.isArray(e))return 0;const r=e.length;if(!r)return 0;let s=e[0];const o=Ov(s.maxFontSize,n)||n;let a=0;const l=Ov(i,n);for(let u=1;u<r;u+=1){s=e[u];const t=Ov(s.lineHeight,n)||l;a+=t}const h=Ov(s.maxFontSize,n)||n;let c;switch(t){case"middle":c=o/2-.15*h-a/2;break;case"bottom":c=-.25*h-a;break;default:case"top":c=.8*o;break}return c}function kv(t,e,n={}){e=l.sanitize(e);const i=n.eol;let r=n.textPath;const s=n.textVerticalAnchor,o="middle"===s||"bottom"===s||"top"===s;let a=n.x;void 0===a&&(a=t.getAttribute("x")||0);const h=n.includeAnnotationIndices;let c=n.annotations;c&&!Array.isArray(c)&&(c=[c]);const u=n.lineHeight,d="auto"===u,g=d?"1.5em":u||"1em";nC(t),fC(t,{"xml:space":"preserve",display:e||n.displayEmpty?null:"none"});const p=fC(t,"font-size");let f,m,b=parseFloat(p);b||(b=16,!o&&!c||p||fC(t,"font-size",""+b)),r?("string"===typeof r&&(r={d:r}),f=Ev(r,t)):f=document.createDocumentFragment();let y,C=0;const v=e.split("\n"),w=[],x=v.length-1;for(let E=0;E<=x;E+=1){m=g;let t="v-line";const e=Wy("tspan");let n,s=v[E];if(s)if(c){const t=l.annotate(s,c,{offset:-C,includeAnnotationIndices:h});n=Av(e,t,{eol:E!==x&&i,baseSize:b,lineHeight:d?null:g,includeAnnotationIndices:h});const r=n.lineHeight;r&&d&&0!==E&&(m=r),0===E&&(y=.8*n.maxFontSize)}else i&&E!==x&&(s+=i),e.textContent=s;else{e.textContent="-",t+=" v-empty-line";const i=e.style;i.fillOpacity=0,i.strokeOpacity=0,c&&(n={})}n&&w.push(n),E>0&&e.setAttribute("dy",m),(E>0||r)&&e.setAttribute("x",a),e.className.baseVal=t,f.appendChild(e),C+=s.length+1}if(o)if(c)m=Pv(s,w,b,g);else if("top"===s)m="0.8em";else{let t;switch(x>0?(t=parseFloat(g)||1,t*=x,Sv.test(g)||(t/=b)):t=0,s){case"middle":m=.3-t/2+"em";break;case"bottom":m=-t-.3+"em";break;default:break}}else 0===s?m="0em":s?m=s:(m=0,null==t.getAttribute("y")&&t.setAttribute("y",""+(y||"0.8em")));const M=f.firstChild;M.setAttribute("dy",m),t.appendChild(f)}function Dv(t,e,n,i){const r=[],s=[];if(null!=e){const n=t.split(e);if(r.push(...n),"string"===typeof e)for(let t=0,i=n.length-1;t<i;t+=1)s.push(e);else{const i=t.match(new RegExp(e,"g"));for(let t=0,e=n.length-1;t<e;t+=1)s.push(i?i[t]:"")}}else{let e="";for(let n=0,i=t.length;n<i;n+=1){const i=t[n];" "===i?(r.push(e),s.push(" "),e=""):i.match(/[^\x00-\xff]/)?(e.length&&(r.push(e),s.push("")),r.push(i),s.push(""),e=""):e+=i}e.length&&r.push(e)}for(let o=0;o<r.length;o+=1){const t=r[o];if(t.indexOf(n)>=0&&t.length>1){const e=t.split(n);for(let t=0,r=e.length-1;t<r;t+=1)e.splice(2*t+1,0,n);const i=e.filter(t=>""!==t);r.splice(o,1,...i);const a=i.map(()=>"");a.pop(),s.splice(o,0,...a)}}for(let o=0;o<r.length;o+=1){const t=r[o],e=t.search(i);e>0&&e<t.length-1&&(r.splice(o,1,t.substring(0,e+1),t.substring(e+1)),s.splice(o,0,""))}return{words:r,separators:s}}function Tv(t,e,n={},i={}){const r=e.width,s=e.height,a=i.svgDocument||Wy("svg"),l=Wy("text"),h=Wy("tspan"),c=document.createTextNode("");fC(l,n),l.appendChild(h),l.style.opacity="0",l.style.display="block",h.style.display="block",h.appendChild(c),a.appendChild(l);const u=null==a.parentNode;u&&document.body.appendChild(a);const d=i.eol||"\n",g=i.separator||" ",p=i.hyphen?new RegExp(i.hyphen):/[^\w\d]/,f=!1!==i.breakWord,m=[],b={};let y,C,v,w=[];const{words:x,separators:M}=Dv(t,i.separator,d,p);for(let E=0,A=0,S=x.length;E<S;E+=1){const t=x[E];if(t)if(t!==d){if(null!=w[A]?(v=M[E-1]||"",c.data=`${w[A]}${v}${t}`):c.data=t,h.getComputedTextLength()<=r)w[A]=c.data,b[A]=M[E],y&&(m[A]=!0,A+=1,y=0);else{if(f){if(!w[A]||y){const e=!!y,n=1===t.length;if(y=t.length-1,e||n){if(n){if(!w[A]){w=[];break}x.splice(E,2,t+x[E+1]),M.splice(E+1,1),m[A]=!0,A+=1,S-=1,E-=1;continue}x[E]=t.substring(0,y),x[E+1]=t.substring(y)+x[E+1]}else x.splice(E,1,t.substring(0,y),t.substring(y)),M.splice(E,0,""),S+=1,A&&!m[A-1]&&(A-=1);E-=1;continue}}else if(!w[A]){w[A]=t,m[A]=!0,A+=1;continue}A+=1,E-=1}if(null!=s){if(null==C){let t;t="auto"===n.lineHeight?{value:1.5,unit:"em"}:o.parseCssNumeric(n.lineHeight,["em"])||{value:1,unit:"em"},C=t.value,"em"===t.unit&&(U.IS_FIREFOX?C*=h.getBBox().height:C*=l.getBBox().height)}if(C*w.length>s){const t=Math.floor(s/C)-1,e=w[t],n=w[t+1];if(w.splice(t+1),null==e)break;let o=i.ellipsis;if(!o)break;"string"!==typeof o&&(o="…");let a=e;n&&f&&(a+=v+n);let l,u,d=a.length;do{if(u=a[d],l=a.substring(0,d),u?u.match(g)&&(l+=u):l+=b[t],l+=o,c.data=l,h.getComputedTextLength()<=r){w[t]=l;break}d-=1}while(d>=0);break}}}else m[A]=!0,A+=1,w[A]=""}return eC(u?a:l),w.join(d)}const Nv=.551784;function jv(t,e,n=NaN){const i=t.getAttribute(e);if(null==i)return n;const r=parseFloat(i);return Number.isNaN(r)?n:r}function Lv(t,e=1){const n=t.getTotalLength(),i=[];let r,s=0;while(s<n)r=t.getPointAtLength(s),i.push({distance:s,x:r.x,y:r.y}),s+=e;return i}function Fv(t){return["M",jv(t,"x1"),jv(t,"y1"),"L",jv(t,"x2"),jv(t,"y2")].join(" ")}function zv(t){const e=Iv(t);return 0===e.length?null:Rv(e)+" Z"}function Bv(t){const e=Iv(t);return 0===e.length?null:Rv(e)}function Rv(t){const e=t.map(t=>`${t.x} ${t.y}`);return"M "+e.join(" L")}function Iv(t){const e=[],n=t.points;if(n)for(let i=0,r=n.numberOfItems;i<r;i+=1)e.push(n.getItem(i));return e}function Vv(t){const e=jv(t,"cx",0),n=jv(t,"cy",0),i=jv(t,"r"),r=i*Nv;return["M",e,n-i,"C",e+r,n-i,e+i,n-r,e+i,n,"C",e+i,n+r,e+r,n+i,e,n+i,"C",e-r,n+i,e-i,n+r,e-i,n,"C",e-i,n-r,e-r,n-i,e,n-i,"Z"].join(" ")}function $v(t){const e=jv(t,"cx",0),n=jv(t,"cy",0),i=jv(t,"rx"),r=jv(t,"ry")||i,s=i*Nv,o=r*Nv,a=["M",e,n-r,"C",e+s,n-r,e+i,n-o,e+i,n,"C",e+i,n+o,e+s,n+r,e,n+r,"C",e-s,n+r,e-i,n+o,e-i,n,"C",e-i,n-o,e-s,n-r,e,n-r,"Z"].join(" ");return a}function Gv(t){return _v({x:jv(t,"x",0),y:jv(t,"y",0),width:jv(t,"width",0),height:jv(t,"height",0),rx:jv(t,"rx",0),ry:jv(t,"ry",0)})}function _v(t){let e;const n=t.x,i=t.y,r=t.width,s=t.height,o=Math.min(t.rx||t["top-rx"]||0,r/2),a=Math.min(t.rx||t["bottom-rx"]||0,r/2),l=Math.min(t.ry||t["top-ry"]||0,s/2),h=Math.min(t.ry||t["bottom-ry"]||0,s/2);return e=o||a||l||h?["M",n,i+l,"v",s-l-h,"a",a,h,0,0,0,a,h,"h",r-2*a,"a",a,h,0,0,0,a,-h,"v",-(s-h-l),"a",o,l,0,0,0,-o,-l,"h",-(r-2*o),"a",o,l,0,0,0,-o,l,"Z"]:["M",n,i,"H",n+r,"V",i+s,"H",n,"V",i,"Z"],e.join(" ")}function Hv(t){const e=Wy("path");fC(e,fC(t));const n=Uv(t);return n&&e.setAttribute("d",n),e}function Uv(t){const e=t.tagName.toLowerCase();switch(e){case"path":return t.getAttribute("d");case"line":return Fv(t);case"polygon":return zv(t);case"polyline":return Bv(t);case"ellipse":return $v(t);case"circle":return Vv(t);case"rect":return Gv(t);default:break}throw new Error(`"${e}" cannot be converted to svg path element.`)}function Wv(t,e,n,i){const r=2*Math.PI-1e-6,s=t,o=e;let a=n,l=i;if(l<a){const t=a;a=l,l=t}const h=l-a,c=h<Math.PI?"0":"1",u=Math.cos(a),d=Math.sin(a),g=Math.cos(l),p=Math.sin(l);return h>=r?s?`M0,${o}A${o},${o} 0 1,1 0,${-o}A${o},${o} 0 1,1 0,${o}M0,${s}A${s},${s} 0 1,0 0,${-s}A${s},${s} 0 1,0 0,${s}Z`:`M0,${o}A${o},${o} 0 1,1 0,${-o}A${o},${o} 0 1,1 0,${o}Z`:s?`M${o*u},${o*d}A${o},${o} 0 ${c},1 ${o*g},${o*p}L${s*g},${s*p}A${s},${s} 0 ${c},0 ${s*u},${s*d}Z`:`M${o*u},${o*d}A${o},${o} 0 ${c},1 ${o*g},${o*p}L0,0Z`}const Xv=Wy("svg"),qv=/(\w+)\(([^,)]+),?([^)]+)?\)/gi,Yv=/[ ,]+/,Jv=/^(\w+)\((.*)\)/;function Zv(t,e){const n=Xv.createSVGPoint();return n.x=t,n.y=e,n}function Kv(t){const e=Xv.createSVGMatrix();if(null!=t){const n=t,i=e;for(const t in n)i[t]=n[t]}return e}function Qv(t){return null!=t?(t instanceof DOMMatrix||(t=Kv(t)),Xv.createSVGTransformFromMatrix(t)):Xv.createSVGTransform()}function tw(t){let e=Kv();const n=null!=t&&t.match(qv);if(!n)return e;for(let i=0,r=n.length;i<r;i+=1){const t=n[i],r=t.match(Jv);if(r){let t,n,i,s,o,a=Kv();const l=r[2].split(Yv);switch(r[1].toLowerCase()){case"scale":t=parseFloat(l[0]),n=void 0===l[1]?t:parseFloat(l[1]),a=a.scaleNonUniform(t,n);break;case"translate":i=parseFloat(l[0]),s=parseFloat(l[1]),a=a.translate(i,s);break;case"rotate":o=parseFloat(l[0]),i=parseFloat(l[1])||0,s=parseFloat(l[2])||0,a=0!==i||0!==s?a.translate(i,s).rotate(o).translate(-i,-s):a.rotate(o);break;case"skewx":o=parseFloat(l[0]),a=a.skewX(o);break;case"skewy":o=parseFloat(l[0]),a=a.skewY(o);break;case"matrix":a.a=parseFloat(l[0]),a.b=parseFloat(l[1]),a.c=parseFloat(l[2]),a.d=parseFloat(l[3]),a.e=parseFloat(l[4]),a.f=parseFloat(l[5]);break;default:continue}e=e.multiply(a)}}return e}function ew(t){const e=t||{},n=null!=e.a?e.a:1,i=null!=e.b?e.b:0,r=null!=e.c?e.c:0,s=null!=e.d?e.d:1,o=null!=e.e?e.e:0,a=null!=e.f?e.f:0;return`matrix(${n},${i},${r},${s},${o},${a})`}function nw(t){let e,n,i;if(t){const r=Yv;if(t.trim().indexOf("matrix")>=0){const r=tw(t),s=rw(r);e=[s.translateX,s.translateY],n=[s.rotation],i=[s.scaleX,s.scaleY];const o=[];0===e[0]&&0===e[1]||o.push(`translate(${e.join(",")})`),1===i[0]&&1===i[1]||o.push(`scale(${i.join(",")})`),0!==n[0]&&o.push(`rotate(${n[0]})`),t=o.join(" ")}else{const s=t.match(/translate\((.*?)\)/);s&&(e=s[1].split(r));const o=t.match(/rotate\((.*?)\)/);o&&(n=o[1].split(r));const a=t.match(/scale\((.*?)\)/);a&&(i=a[1].split(r))}}const r=i&&i[0]?parseFloat(i[0]):1;return{raw:t||"",translation:{tx:e&&e[0]?parseInt(e[0],10):0,ty:e&&e[1]?parseInt(e[1],10):0},rotation:{angle:n&&n[0]?parseInt(n[0],10):0,cx:n&&n[1]?parseInt(n[1],10):void 0,cy:n&&n[2]?parseInt(n[2],10):void 0},scale:{sx:r,sy:i&&i[1]?parseFloat(i[1]):r}}}function iw(t,e){const n=e.x*t.a+e.y*t.c+0,i=e.x*t.b+e.y*t.d+0;return{x:n,y:i}}function rw(t){const e=iw(t,{x:0,y:1}),n=iw(t,{x:1,y:0}),i=180/Math.PI*Math.atan2(e.y,e.x)-90,r=180/Math.PI*Math.atan2(n.y,n.x);return{skewX:i,skewY:r,translateX:t.e,translateY:t.f,scaleX:Math.sqrt(t.a*t.a+t.b*t.b),scaleY:Math.sqrt(t.c*t.c+t.d*t.d),rotation:i}}function sw(t){let e,n,i,r;return t?(e=null==t.a?1:t.a,r=null==t.d?1:t.d,n=t.b,i=t.c):e=r=1,{sx:n?Math.sqrt(e*e+n*n):e,sy:i?Math.sqrt(i*i+r*r):r}}function ow(t){let e={x:0,y:1};return t&&(e=iw(t,e)),{angle:_C.normalize(_C.toDeg(Math.atan2(e.y,e.x))-90)}}function aw(t){return{tx:t&&t.e||0,ty:t&&t.f||0}}function lw(t,e){const n=Zv(t.x,t.y).matrixTransform(e);return new ZC(n.x,n.y)}function hw(t,e){return new QC(lw(t.start,e),lw(t.end,e))}function cw(t,e){let n=t instanceof ev?t.points:t;return Array.isArray(n)||(n=[]),new ev(n.map(t=>lw(t,e)))}function uw(t,e){const n=Xv.createSVGPoint();n.x=t.x,n.y=t.y;const i=n.matrixTransform(e);n.x=t.x+t.width,n.y=t.y;const r=n.matrixTransform(e);n.x=t.x+t.width,n.y=t.y+t.height;const s=n.matrixTransform(e);n.x=t.x,n.y=t.y+t.height;const o=n.matrixTransform(e),a=Math.min(i.x,r.x,s.x,o.x),l=Math.max(i.x,r.x,s.x,o.x),h=Math.min(i.y,r.y,s.y,o.y),c=Math.max(i.y,r.y,s.y,o.y);return new KC(a,h,l-a,c-h)}var dw=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};function gw(t,e,n){let i;const r=t.ownerSVGElement;if(!r)return new KC(0,0,0,0);try{i=t.getBBox()}catch(o){i={x:t.clientLeft,y:t.clientTop,width:t.clientWidth,height:t.clientHeight}}if(e)return KC.create(i);const s=bw(t,n||r);return uw(i,s)}function pw(t,e={}){let n;const i=t.ownerSVGElement;if(!i||!$y(t)){if(aC(t)){const{left:e,top:n,width:i,height:r}=Sw(t);return new KC(e,n,i,r)}return new KC(0,0,0,0)}let r=e.target;const s=e.recursive;if(!s){try{n=t.getBBox()}catch(o){n={x:t.clientLeft,y:t.clientTop,width:t.clientWidth,height:t.clientHeight}}if(!r)return KC.create(n);const e=bw(t,r);return uw(n,e)}{const e=t.childNodes,i=e.length;if(0===i)return pw(t,{target:r});r||(r=t);for(let t=0;t<i;t+=1){const i=e[t];let s;s=0===i.childNodes.length?pw(i,{target:r}):pw(i,{target:r,recursive:!0}),n=n?n.union(s):s}return n}}function fw(t){let e=t,n=e?e.tagName.toLowerCase():"";while("g"===n)e=e.firstElementChild,n=e?e.tagName.toLowerCase():"";const i=t=>{const n=e.getAttribute(t),i=n?parseFloat(n):0;return Number.isNaN(i)?0:i};let r,s;switch(n){case"rect":s=new KC(i("x"),i("y"),i("width"),i("height"));break;case"circle":r=i("r"),s=new KC(i("cx")-r,i("cy")-r,2*r,2*r);break;default:break}return s}function mw(t,e){let n=Kv();if($y(e)&&$y(t)){let i=t;const r=[];while(i&&i!==e){const t=i.getAttribute("transform")||null,e=tw(t);r.push(e),i=i.parentNode}r.reverse().forEach(t=>{n=n.multiply(t)})}return n}function bw(t,e){if($y(e)&&$y(t)){const n=e.getScreenCTM(),i=t.getScreenCTM();if(n&&i)return n.inverse().multiply(i)}return Kv()}function yw(t,e,n){const i=t instanceof SVGSVGElement?t:t.ownerSVGElement,r=i.createSVGPoint();r.x=e,r.y=n;try{const e=i.getScreenCTM(),n=r.matrixTransform(e.inverse()),s=bw(t,i).inverse();return n.matrixTransform(s)}catch(s){return r}}function Cw(t){const e=e=>{const n=t.getAttribute(e),i=n?parseFloat(n):0;return Number.isNaN(i)?0:i};switch(t instanceof SVGElement&&t.nodeName.toLowerCase()){case"rect":return new KC(e("x"),e("y"),e("width"),e("height"));case"circle":return new tv(e("cx"),e("cy"),e("r"),e("r"));case"ellipse":return new tv(e("cx"),e("cy"),e("rx"),e("ry"));case"polyline":{const e=Iv(t);return new ev(e)}case"polygon":{const e=Iv(t);return e.length>1&&e.push(e[0]),new ev(e)}case"path":{let e=t.getAttribute("d");return xv.isValid(e)||(e=xv.normalize(e)),xv.parse(e)}case"line":return new QC(e("x1"),e("y1"),e("x2"),e("y2"));default:break}return pw(t)}function vw(t,e,n){const i=t instanceof SVGSVGElement?t:t.ownerSVGElement;n=n||i;const r=pw(n),s=r.getCenter();if(!r.intersectsWithLineFromCenterToPoint(e))return null;let o=null;const a=t.tagName.toLowerCase();if("rect"===a){const r=new KC(parseFloat(t.getAttribute("x")||"0"),parseFloat(t.getAttribute("y")||"0"),parseFloat(t.getAttribute("width")||"0"),parseFloat(t.getAttribute("height")||"0")),a=bw(t,n),l=rw(a),h=i.createSVGTransform();h.setRotate(-l.rotation,s.x,s.y);const c=uw(r,h.matrix.multiply(a));o=KC.create(c).intersectsWithLineFromCenterToPoint(e,l.rotation)}else if("path"===a||"polygon"===a||"polyline"===a||"circle"===a||"ellipse"===a){const i="path"===a?t:Hv(t),r=Lv(i);let l=1/0,h=[];for(let o=0,a=r.length;o<a;o+=1){const i=r[o];let a=Zv(i.x,i.y);a=a.matrixTransform(bw(t,n));const c=ZC.create(a),u=c.distance(s),d=1.1*c.distance(e),g=u+d;g<l?(l=g,h=[{sample:i,refDistance:d}]):g<l+1&&h.push({sample:i,refDistance:d})}h.sort((t,e)=>t.refDistance-e.refDistance),h[0]&&(o=ZC.create(h[0].sample))}return o}function ww(t,e){return Mw(t,e,"animate")}function xw(t,e){return Mw(t,e,"animateTransform")}function Mw(t,e,n){const i=Wy(n);t.appendChild(i);try{return Ew(i,e)}catch(r){}return()=>{}}function Ew(t,e){const{start:n,complete:i,repeat:r}=e,s=dw(e,["start","complete","repeat"]);fC(t,s),n&&t.addEventListener("beginEvent",n),i&&t.addEventListener("endEvent",i),r&&t.addEventListener("repeatEvent",r);const o=t;return setTimeout(()=>{o.beginElement()}),()=>o.endElement()}function Aw(t,e,n){const i=Vy(n),r=Wy("animateMotion"),s=Wy("mpath");fC(s,{"xlink:href":"#"+i}),r.appendChild(s),t.appendChild(r);try{return Ew(r,e)}catch(o){if("fake"===document.documentElement.getAttribute("smiling")){const t=r;t.animators=[];const e=window,n=t.getAttribute("id");n&&(e.id2anim[n]=t);const i=e.getTargets(t);for(let r=0,s=i.length;r<s;r+=1){const n=i[r],s=new e.Animator(t,n,r);e.animators.push(s),t.animators[r]=s,s.register()}}}return()=>{}}function Sw(t){let e=0,n=0,i=0,r=0;if(t){let s=t;while(s)e+=s.offsetLeft,n+=s.offsetTop,s=s.offsetParent,s&&(e+=parseInt(VC(s,"borderLeft"),10),n+=parseInt(VC(s,"borderTop"),10));i=t.offsetWidth,r=t.offsetHeight}return{left:e,top:n,width:i,height:r}}function Ow(t,e,n={}){if(null==e)return tw(fC(t,"transform"));if(n.absolute)return void t.setAttribute("transform",ew(e));const i=t.transform,r=Qv(e);i.baseVal.appendItem(r)}function Pw(t,e,n=0,i={}){let r=fC(t,"transform");const s=nw(r);if(null==e)return s.translation;r=s.raw,r=r.replace(/translate\([^)]*\)/g,"").trim();const o=i.absolute?e:s.translation.tx+e,a=i.absolute?n:s.translation.ty+n,l=`translate(${o},${a})`;t.setAttribute("transform",`${l} ${r}`.trim())}function kw(t,e,n,i,r={}){let s=fC(t,"transform");const o=nw(s);if(null==e)return o.rotation;s=o.raw,s=s.replace(/rotate\([^)]*\)/g,"").trim(),e%=360;const a=r.absolute?e:o.rotation.angle+e,l=null!=n&&null!=i?`,${n},${i}`:"",h=`rotate(${a}${l})`;t.setAttribute("transform",`${s} ${h}`.trim())}function Dw(t,e,n){let i=fC(t,"transform");const r=nw(i);if(null==e)return r.scale;n=null==n?e:n,i=r.raw,i=i.replace(/scale\([^)]*\)/g,"").trim();const s=`scale(${e},${n})`;t.setAttribute("transform",`${i} ${s}`.trim())}function Tw(t,e,n,i){const r=ZC.create(e),s=ZC.create(n);if(!i){const e=t instanceof SVGSVGElement?t:t.ownerSVGElement;i=e}const o=Dw(t);t.setAttribute("transform","");const a=pw(t,{target:i}).scale(o.sx,o.sy),l=Qv();l.setTranslate(-a.x-a.width/2,-a.y-a.height/2);const h=Qv(),c=r.angleBetween(s,r.clone().translate(1,0));c&&h.setRotate(c,0,0);const u=Qv(),d=r.clone().move(s,a.width/2);u.setTranslate(2*r.x-d.x,2*r.y-d.y);const g=bw(t,i),p=Qv();p.setMatrix(u.matrix.multiply(h.matrix.multiply(l.matrix.multiply(g.scale(o.sx,o.sy))))),t.setAttribute("transform",ew(p.matrix))}class Nw{constructor(t,e,n){this.animationFrameId=0,this.deltaX=0,this.deltaY=0,this.eventName=U.isEventSupported("wheel")?"wheel":"mousewheel",this.target=t,this.onWheelCallback=e,this.onWheelGuard=n,this.onWheel=this.onWheel.bind(this),this.didWheel=this.didWheel.bind(this)}enable(){U.SUPPORT_PASSIVE?this.target.addEventListener(this.eventName,this.onWheel,{passive:!1}):P()(this.target).on("mousewheel",this.onWheel)}disable(){U.SUPPORT_PASSIVE?this.target.removeEventListener(this.eventName,this.onWheel):P()(this.target).off("mousewheel")}onWheel(t){if(null!=this.onWheelGuard&&!this.onWheelGuard(t))return;let e;this.deltaX+=t.deltaX,this.deltaY+=t.deltaY,t.preventDefault(),0===this.deltaX&&0===this.deltaY||(t.stopPropagation(),e=!0),!0===e&&0===this.animationFrameId&&(this.animationFrameId=requestAnimationFrame(()=>{this.didWheel(t)}))}didWheel(t){this.animationFrameId=0,this.onWheelCallback(t,this.deltaX,this.deltaY),this.deltaX=0,this.deltaY=0}}const jw=Mv.isVector,Lw=Mv.create,Fw=Mv.createVectors;function zw(t,e=60){let n=null;return(...i)=>{n&&clearTimeout(n),n=window.setTimeout(()=>{t.apply(this,i)},e)}}function Bw(t){let e=null,n=[];const i=()=>{if("static"===getComputedStyle(t).position){const e=t.style;e.position="relative"}const e=document.createElement("object");return e.onload=()=>{e.contentDocument.defaultView.addEventListener("resize",r),r()},e.style.display="block",e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.height="100%",e.style.width="100%",e.style.overflow="hidden",e.style.pointerEvents="none",e.style.zIndex="-1",e.style.opacity="0",e.setAttribute("tabindex","-1"),e.type="text/html",t.appendChild(e),e.data="about:blank",e},r=zw(()=>{n.forEach(e=>e(t))}),s=t=>{e||(e=i()),-1===n.indexOf(t)&&n.push(t)},o=()=>{e&&e.parentNode&&(e.contentDocument&&e.contentDocument.defaultView.removeEventListener("resize",r),e.parentNode.removeChild(e),e=null,n=[])},a=t=>{const i=n.indexOf(t);-1!==i&&n.splice(i,1),0===n.length&&e&&o()};return{element:t,bind:s,destroy:o,unbind:a}}function Rw(t){let e=null,n=[];const i=zw(()=>{n.forEach(e=>{e(t)})}),r=()=>{const e=new ResizeObserver(i);return e.observe(t),i(),e},s=t=>{e||(e=r()),-1===n.indexOf(t)&&n.push(t)},o=()=>{e&&(e.disconnect(),n=[],e=null)},a=t=>{const i=n.indexOf(t);-1!==i&&n.splice(i,1),0===n.length&&e&&o()};return{element:t,bind:s,destroy:o,unbind:a}}const Iw="undefined"!==typeof ResizeObserver?Rw:Bw;var Vw,$w;(function(t){const e=new WeakMap;function n(t){let n=e.get(t);return n||(n=Iw(t),e.set(t,n),n)}function i(t){t.destroy(),e.delete(t.element)}t.bind=(t,e)=>{const i=n(t);return i.bind(e),()=>i.unbind(e)},t.clear=t=>{const e=n(t);i(e)}})(Vw||(Vw={})),function(t){const e=[],n=1e3/60,i=[];let r=0;const s=()=>performance.now(),o=t=>t[0],a=t=>1===i.push(t)&&l(),l=(()=>{const t=()=>{var t,e;return null===(e=(t=i.splice(0,i.length))[0])||void 0===e?void 0:e.call(t)};if("undefined"!==typeof MessageChannel){const{port1:e,port2:n}=new MessageChannel;return e.onmessage=t,()=>n.postMessage(null)}return()=>setTimeout(t)})(),h=()=>{r=s()+n;let i=o(e);while(i&&!t.shouldYield()){const{callback:t,data:n}=i;i.callback=null;const r=t&&t(n);r?i.callback=r:e.shift(),i=o(e)}i&&a(h)};t.scheduleTask=(t,n)=>{const i={callback:t,data:n};e.push(i),a(h)},t.shouldYield=()=>{var t,e;return(null===(e=null===(t=navigator)||void 0===t?void 0:t.scheduling)||void 0===e?void 0:e.isInputPending())||s()>=r}}($w||($w={}));class Gw{constructor(t){this.options=Object.assign({},t),this.data=this.options.data||{},this.register=this.register.bind(this),this.unregister=this.unregister.bind(this)}get names(){return Object.keys(this.data)}register(t,e,n=!1){if("object"===typeof t)return void Object.keys(t).forEach(n=>{this.register(n,t[n],e)});!this.exist(t)||n||U.isApplyingHMR()||this.onDuplicated(t);const i=this.options.process,r=i?a.call(i,this,t,e):e;return this.data[t]=r,r}unregister(t){const e=t?this.data[t]:null;return delete this.data[t],e}get(t){return t?this.data[t]:null}exist(t){return!!t&&null!=this.data[t]}onDuplicated(t){try{throw this.options.onConflict&&a.call(this.options.onConflict,this,t),new Error(`${s.upperFirst(this.options.type)} with name '${t}' already registered.`)}catch(cD){throw cD}}onNotFound(t,e){throw new Error(this.getSpellingSuggestion(t,e))}getSpellingSuggestion(t,e){const n=this.getSpellingSuggestionForName(t),i=e?`${e} ${s.lowerFirst(this.options.type)}`:this.options.type;return`${s.upperFirst(i)} with name '${t}' does not exist.${n?` Did you mean '${n}'?`:""}`}getSpellingSuggestionForName(t){return s.getSpellingSuggestion(t,Object.keys(this.data),t=>t)}}(function(t){function e(e){return new t(e)}t.create=e})(Gw||(Gw={}));const _w={xlinkHref:"xlink:href",xlinkShow:"xlink:show",xlinkRole:"xlink:role",xlinkType:"xlink:type",xlinkArcrole:"xlink:arcrole",xlinkTitle:"xlink:title",xlinkActuate:"xlink:actuate",xmlSpace:"xml:space",xmlBase:"xml:base",xmlLang:"xml:lang",preserveAspectRatio:"preserveAspectRatio",requiredExtension:"requiredExtension",requiredFeatures:"requiredFeatures",systemLanguage:"systemLanguage",externalResourcesRequired:"externalResourceRequired"},Hw={},Uw={position:px("x","width","origin")},Ww={position:px("y","height","origin")},Xw={position:px("x","width","corner")},qw={position:px("y","height","corner")},Yw={set:fx("width","width")},Jw={set:fx("height","height")},Zw={set:fx("rx","width")},Kw={set:fx("ry","height")},Qw={set:(t=>{const e=fx(t,"width"),n=fx(t,"height");return function(t,i){const r=i.refBBox,s=r.height>r.width?e:n;return a.call(s,this,t,i)}})("r")},tx={set(t,{refBBox:e}){let n=parseFloat(t);const i=o.isPercentage(t);i&&(n/=100);const r=Math.sqrt(e.height*e.height+e.width*e.width);let s;return Number.isFinite(n)&&(s=i||n>=0&&n<=1?n*r:Math.max(n+r,0)),{r:s}}},ex={set:fx("cx","width")},nx={set:fx("cy","height")},ix={set:bx({resetOffset:!0})},rx={set:bx({resetOffset:!1})},sx={set:yx({resetOffset:!0})},ox={set:yx({resetOffset:!1})},ax=Qw,lx=ix,hx=sx,cx=Uw,ux=Ww,dx=Yw,gx=Jw;function px(t,e,n){return(i,{refBBox:r})=>{if(null==i)return null;let s=parseFloat(i);const a=o.isPercentage(i);let l;if(a&&(s/=100),Number.isFinite(s)){const i=r[n];l=a||s>0&&s<1?i[t]+r[e]*s:i[t]+s}const h=new ZC;return h[t]=l||0,h}}function fx(t,e){return function(n,{refBBox:i}){let r=parseFloat(n);const s=o.isPercentage(n);s&&(r/=100);const a={};if(Number.isFinite(r)){const n=s||r>=0&&r<=1?r*i[e]:Math.max(r+i[e],0);a[t]=n}return a}}function mx(t,e){const n="x6-shape",i=e&&e.resetOffset;return function(e,{view:r,elem:s,refBBox:o}){const a=r.$(s);let l=a.data(n);if(!l||l.value!==e){const i=t(e);l={value:e,shape:i,shapeBBox:i.bbox()},a.data(n,l)}const h=l.shape.clone(),c=l.shapeBBox.clone(),u=c.getOrigin(),d=o.getOrigin();c.x=d.x,c.y=d.y;const g=o.getMaxScaleToFit(c,d),p=0===c.width||0===o.width?1:g.sx,f=0===c.height||0===o.height?1:g.sy;return h.scale(p,f,u),i&&h.translate(-u.x,-u.y),h}}function bx(t){function e(t){return xv.parse(t)}const n=mx(e,t);return(t,e)=>{const i=n(t,e);return{d:i.serialize()}}}function yx(t){const e=mx(t=>new ev(t),t);return(t,n)=>{const i=e(t,n);return{points:i.serialize()}}}const Cx={qualify:r.isPlainObject,set(t,{view:e}){return`url(#${e.graph.defineGradient(t)})`}},vx={qualify:r.isPlainObject,set(t,{view:e}){const n=e.cell,i=Object.assign({},t);if(n.isEdge()&&"linearGradient"===i.type){const t=e,r=t.sourcePoint,s=t.targetPoint;i.id=`gradient-${i.type}-${n.id}`,i.attrs=Object.assign(Object.assign({},i.attrs),{x1:r.x,y1:r.y,x2:s.x,y2:s.y,gradientUnits:"userSpaceOnUse"}),e.graph.defs.remove(i.id)}return`url(#${e.graph.defineGradient(i)})`}},wx={qualify(t,{attrs:e}){return null==e.textWrap||!r.isPlainObject(e.textWrap)},set(t,{view:e,elem:n,attrs:i}){const r="x6-text",s=e.$(n),o=s.data(r),a=t=>{try{return JSON.parse(t)}catch(e){return t}},l={x:i.x,eol:i.eol,annotations:a(i.annotations),textPath:a(i["text-path"]||i.textPath),textVerticalAnchor:i["text-vertical-anchor"]||i.textVerticalAnchor,displayEmpty:"true"===(i["display-empty"]||i.displayEmpty),lineHeight:i["line-height"]||i.lineHeight},c=i["font-size"]||i.fontSize,u=JSON.stringify([t,l]);if(c&&n.setAttribute("font-size",c),null==o||o!==u){const i=l.textPath;if(null!=i&&"object"===typeof i){const t=i.selector;if("string"===typeof t){const n=e.find(t)[0];n instanceof SVGPathElement&&(h.ensureId(n),l.textPath=Object.assign({"xlink:href":"#"+n.id},i))}}h.text(n,""+t,l),s.data(r,u)}}},xx={qualify:r.isPlainObject,set(t,{view:e,elem:n,attrs:i,refBBox:r}){const s=t,l=s.width||0;o.isPercentage(l)?r.width*=parseFloat(l)/100:l<=0?r.width+=l:r.width=l;const c=s.height||0;let u;o.isPercentage(c)?r.height*=parseFloat(c)/100:c<=0?r.height+=c:r.height=c;let d=s.text;null==d&&(d=i.text),u=null!=d?h.breakText(""+d,r,{"font-weight":i["font-weight"]||i.fontWeight,"font-size":i["font-size"]||i.fontSize,"font-family":i["font-family"]||i.fontFamily,lineHeight:i.lineHeight},{svgDocument:e.graph.view.svg,ellipsis:s.ellipsis,hyphen:s.hyphen,breakWord:s.breakWord}):"",a.call(wx.set,this,u,{view:e,elem:n,attrs:i,refBBox:r,cell:e.cell})}},Mx=(t,{attrs:e})=>void 0!==e.text,Ex={qualify:Mx},Ax={qualify:Mx},Sx={qualify:Mx},Ox={qualify:Mx},Px={qualify:Mx},kx={qualify:Mx},Dx={qualify(t,{elem:e}){return e instanceof SVGElement},set(t,{view:e,elem:n}){const i="x6-title",r=""+t,s=e.$(n),o=s.data(i);if(null==o||o!==r){s.data(i,r);const t=n.firstChild;if(t&&"TITLE"===t.tagName.toUpperCase()){const e=t;e.textContent=r}else{const e=document.createElementNS(n.namespaceURI,"title");e.textContent=r,n.insertBefore(e,t)}}}},Tx={offset:Lx("x","width","right")},Nx={offset:Lx("y","height","bottom")},jx={offset(t,{refBBox:e}){return t?{x:-e.x,y:-e.y}:{x:0,y:0}}};function Lx(t,e,n){return(i,{refBBox:r})=>{const s=new ZC;let a;return a="middle"===i?r[e]/2:i===n?r[e]:"number"===typeof i&&Number.isFinite(i)?i>-1&&i<1?-r[e]*i:-i:o.isPercentage(i)?r[e]*parseFloat(i)/100:0,s[t]=-(r[t]+a),s}}const Fx={qualify:r.isPlainObject,set(t,{view:e,elem:n}){e.$(n).css(t)}},zx={set(t,{view:e,elem:n}){e.$(n).html(""+t)}},Bx={qualify:r.isPlainObject,set(t,{view:e}){return`url(#${e.graph.defineFilter(t)})`}},Rx={set(t){return null!=t&&"object"===typeof t&&t.id?t.id:t}};function Ix(t,e,n){let i,r;"object"===typeof e?(i=e.x,r=e.y):(i=e,r=n);const s=xv.parse(t),o=s.bbox();if(o){let t=-o.height/2-o.y,e=-o.width/2-o.x;"number"===typeof i&&(e-=i),"number"===typeof r&&(t-=r),s.translate(e,t)}return s.serialize()}var Vx=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const $x=t=>{var{size:e,width:n,height:i,offset:r,open:s}=t,o=Vx(t,["size","width","height","offset","open"]);return _x({size:e,width:n,height:i,offset:r},!0===s,!0,void 0,o)},Gx=t=>{var{size:e,width:n,height:i,offset:r,factor:s}=t,o=Vx(t,["size","width","height","offset","factor"]);return _x({size:e,width:n,height:i,offset:r},!1,!1,s,o)};function _x(t,e,n,i=3/4,r={}){const s=t.size||10,a=t.width||s,l=t.height||s,h=new xv,c={};if(e)h.moveTo(a,0).lineTo(0,l/2).lineTo(a,l),c.fill="none";else{if(h.moveTo(0,l/2),h.lineTo(a,0),!n){const t=o.clamp(i,0,1);h.lineTo(a*t,l/2)}h.lineTo(a,l),h.close()}return Object.assign(Object.assign(Object.assign({},c),r),{tagName:"path",d:Ix(h.serialize(),{x:null!=t.offset?t.offset:-a/2})})}var Hx=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const Ux=t=>{var{size:e,width:n,height:i,offset:r}=t,s=Hx(t,["size","width","height","offset"]);const o=e||10,a=n||o,l=i||o,h=new xv;return h.moveTo(0,l/2).lineTo(a/2,0).lineTo(a,l/2).lineTo(a/2,l).close(),Object.assign(Object.assign({},s),{tagName:"path",d:Ix(h.serialize(),null==r?-a/2:r)})};var Wx=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const Xx=t=>{var{d:e,offsetX:n,offsetY:i}=t,r=Wx(t,["d","offsetX","offsetY"]);return Object.assign(Object.assign({},r),{tagName:"path",d:Ix(e,n,i)})};var qx=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const Yx=t=>{var{size:e,width:n,height:i,offset:r}=t,s=qx(t,["size","width","height","offset"]);const o=e||10,a=n||o,l=i||o,h=new xv;return h.moveTo(0,0).lineTo(a,l).moveTo(0,l).lineTo(a,0),Object.assign(Object.assign({},s),{tagName:"path",fill:"none",d:Ix(h.serialize(),r||-a/2)})};var Jx=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const Zx=t=>{var{width:e,height:n,offset:i,open:r,flip:s}=t,o=Jx(t,["width","height","offset","open","flip"]);let a=n||6;const l=e||10,h=!0===r,c=!0===s,u=Object.assign(Object.assign({},o),{tagName:"path"});c&&(a=-a);const d=new xv;return d.moveTo(0,a).lineTo(l,0),h?u.fill="none":(d.lineTo(l,a),d.close()),u.d=Ix(d.serialize(),{x:i||-l/2,y:a/2}),u};var Kx=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const Qx=t=>{var{r:e}=t,n=Kx(t,["r"]);const i=e||5;return Object.assign(Object.assign({cx:i},n),{tagName:"circle",r:i})},tM=t=>{var{r:e}=t,n=Kx(t,["r"]);const i=e||5,r=new xv;return r.moveTo(i,0).lineTo(i,2*i),r.moveTo(0,i).lineTo(2*i,i),{children:[Object.assign(Object.assign({},Qx({r:i})),{fill:"none"}),Object.assign(Object.assign({},n),{tagName:"path",d:Ix(r.serialize(),-i)})]}};var eM=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const nM=t=>{var{rx:e,ry:n}=t,i=eM(t,["rx","ry"]);const r=e||5,s=n||5;return Object.assign(Object.assign({cx:r},i),{tagName:"ellipse",rx:r,ry:s})};var iM;(function(t){t.presets=c,t.registry=Gw.create({type:"marker"}),t.registry.register(t.presets,!0)})(iM||(iM={})),function(t){t.normalize=Ix}(iM||(iM={}));var rM=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};function sM(t){return"string"===typeof t||r.isPlainObject(t)}const oM={qualify:sM,set(t,{view:e,attrs:n}){return hM("marker-start",t,e,n)}},aM={qualify:sM,set(t,{view:e,attrs:n}){return hM("marker-end",t,e,n,{transform:"rotate(180)"})}},lM={qualify:sM,set(t,{view:e,attrs:n}){return hM("marker-mid",t,e,n)}};function hM(t,e,n,i,r={}){const s="string"===typeof e?{name:e}:e,{name:o,args:a}=s,l=rM(s,["name","args"]);let h=l;if(o&&"string"===typeof o){const t=iM.registry.get(o);if(!t)return iM.registry.onNotFound(o);h=t(Object.assign(Object.assign({},l),a))}const c=Object.assign(Object.assign(Object.assign({},cM(i,t)),r),h);return{[t]:`url(#${n.graph.defineMarker(c)})`}}function cM(t,e){const n={},i=t.stroke;"string"===typeof i&&(n.stroke=i,n.fill=i);let r=t.strokeOpacity;if(null==r&&(r=t["stroke-opacity"]),null==r&&(r=t.opacity),null!=r&&(n["stroke-opacity"]=r,n["fill-opacity"]=r),"marker-mid"!==e){const i=parseFloat(t.strokeWidth||t["stroke-width"]);if(Number.isFinite(i)&&i>1){const t=Math.ceil(i/2);n.refX="marker-start"===e?t:-t}}return n}const uM=(t,{view:e})=>e.cell.isEdge(),dM={qualify:uM,set(t,e){var n,i,r,s;const o=e.view,a=t.reverse||!1,l=t.stubs||0;let h;if(Number.isFinite(l)&&0!==l)if(a){let t,e;const a=o.getConnectionLength()||0;l<0?(t=(a+l)/2,e=-l):(t=l,e=a-2*l);const c=o.getConnection();h=null===(s=null===(r=null===(i=null===(n=null===c||void 0===c?void 0:c.divideAtLength(t))||void 0===n?void 0:n[1])||void 0===i?void 0:i.divideAtLength(e))||void 0===r?void 0:r[0])||void 0===s?void 0:s.serialize()}else{let t;if(l<0){const e=o.getConnectionLength()||0;t=(e+l)/2}else t=l;const e=o.getConnection();if(e){const n=e.divideAtLength(t),i=e.divideAtLength(-t);n&&i&&(h=`${n[0].serialize()} ${i[1].serialize()}`)}}return{d:h||o.getConnectionPathData()}}},gM={qualify:uM,set:CM("getTangentAtLength",{rotate:!0})},pM={qualify:uM,set:CM("getTangentAtLength",{rotate:!1})},fM={qualify:uM,set:CM("getTangentAtRatio",{rotate:!0})},mM={qualify:uM,set:CM("getTangentAtRatio",{rotate:!1})},bM=gM,yM=fM;function CM(t,e){const n={x:1,y:0};return(i,r)=>{let s,o;const a=r.view,l=a[t](Number(i));return l?(o=e.rotate?l.vector().vectorAngle(n):0,s=l.start):(s=a.path.start,o=0),0===o?{transform:`translate(${s.x},${s.y}')`}:{transform:`translate(${s.x},${s.y}') rotate(${o})`}}}var vM;(function(t){function e(t,e,n){if(null!=t){if("string"===typeof t)return!0;if("function"!==typeof t.qualify||a.call(t.qualify,this,e,n))return!0}return!1}t.isValidDefinition=e})(vM||(vM={})),function(t){t.presets=Object.assign(Object.assign({},_w),u),t.registry=Gw.create({type:"attribute definition"}),t.registry.register(t.presets,!0)}(vM||(vM={}));const wM={color:"#aaaaaa",thickness:1,markup:"rect",update(t,e){const n=e.thickness*e.sx,i=e.thickness*e.sy;h.attr(t,{width:n,height:i,rx:n,ry:i,fill:e.color})}},xM={color:"#aaaaaa",thickness:1,markup:"rect",update(t,e){const n=e.sx<=1?e.thickness*e.sx:e.thickness;h.attr(t,{width:n,height:n,rx:n,ry:n,fill:e.color})}},MM={color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(t,e){let n;const i=e.width,r=e.height,s=e.thickness;n=i-s>=0&&r-s>=0?["M",i,0,"H0 M0 0 V0",r].join(" "):"M 0 0 0 0",h.attr(t,{d:n,stroke:e.color,"stroke-width":e.thickness})}},EM=[{color:"rgba(224,224,224,1)",thickness:1,markup:"path",update(t,e){let n;const i=e.width,r=e.height,s=e.thickness;n=i-s>=0&&r-s>=0?["M",i,0,"H0 M0 0 V0",r].join(" "):"M 0 0 0 0",h.attr(t,{d:n,stroke:e.color,"stroke-width":e.thickness})}},{color:"rgba(224,224,224,0.2)",thickness:3,factor:4,markup:"path",update(t,e){let n;const i=e.factor||1,r=e.width*i,s=e.height*i,o=e.thickness;n=r-o>=0&&s-o>=0?["M",r,0,"H0 M0 0 V0",s].join(" "):"M 0 0 0 0",e.width=r,e.height=s,h.attr(t,{d:n,stroke:e.color,"stroke-width":e.thickness})}}];class AM{constructor(){this.patterns={},this.root=Mv.create(h.createSvgDocument(),{width:"100%",height:"100%"},[h.createSvgElement("defs")]).node}add(t,e){const n=this.root.childNodes[0];n&&n.appendChild(e),this.patterns[t]=e,Mv.create("rect",{width:"100%",height:"100%",fill:`url(#${t})`}).appendTo(this.root)}get(t){return this.patterns[t]}has(t){return null!=this.patterns[t]}}function SM(t,e){return null!=t?t:e}function OM(t,e){return null!=t&&Number.isFinite(t)?t:e}function PM(t={}){const e=SM(t.color,"blue"),n=OM(t.width,1),i=OM(t.margin,2),r=OM(t.opacity,1),s=i,o=i+n;return`\n <filter>\n <feFlood flood-color="${e}" flood-opacity="${r}" result="colored"/>\n <feMorphology in="SourceAlpha" result="morphedOuter" operator="dilate" radius="${o}" />\n <feMorphology in="SourceAlpha" result="morphedInner" operator="dilate" radius="${s}" />\n <feComposite result="morphedOuterColored" in="colored" in2="morphedOuter" operator="in"/>\n <feComposite operator="xor" in="morphedOuterColored" in2="morphedInner" result="outline"/>\n <feMerge>\n <feMergeNode in="outline"/>\n <feMergeNode in="SourceGraphic"/>\n </feMerge>\n </filter>\n `.trim()}function kM(t={}){const e=SM(t.color,"red"),n=OM(t.blur,0),i=OM(t.width,1),r=OM(t.opacity,1);return`\n <filter>\n <feFlood flood-color="${e}" flood-opacity="${r}" result="colored"/>\n <feMorphology result="morphed" in="SourceGraphic" operator="dilate" radius="${i}"/>\n <feComposite result="composed" in="colored" in2="morphed" operator="in"/>\n <feGaussianBlur result="blured" in="composed" stdDeviation="${n}"/>\n <feBlend in="SourceGraphic" in2="blured" mode="normal"/>\n </filter>\n `.trim()}function DM(t={}){const e=OM(t.x,2),n=null!=t.y&&Number.isFinite(t.y)?[e,t.y]:e;return`\n <filter>\n <feGaussianBlur stdDeviation="${n}"/>\n </filter>\n `.trim()}function TM(t={}){const e=OM(t.dx,0),n=OM(t.dy,0),i=SM(t.color,"black"),r=OM(t.blur,4),s=OM(t.opacity,1);return"SVGFEDropShadowElement"in window?`<filter>\n <feDropShadow stdDeviation="${r}" dx="${e}" dy="${n}" flood-color="${i}" flood-opacity="${s}" />\n </filter>`.trim():`<filter>\n <feGaussianBlur in="SourceAlpha" stdDeviation="${r}" />\n <feOffset dx="${e}" dy="${n}" result="offsetblur" />\n <feFlood flood-color="${i}" />\n <feComposite in2="offsetblur" operator="in" />\n <feComponentTransfer>\n <feFuncA type="linear" slope="${s}" />\n </feComponentTransfer>\n <feMerge>\n <feMergeNode/>\n <feMergeNode in="SourceGraphic"/>\n </feMerge>\n </filter>`.trim()}function NM(t={}){const e=OM(t.amount,1),n=.2126+.7874*(1-e),i=.7152-.7152*(1-e),r=.0722-.0722*(1-e),s=.2126-.2126*(1-e),o=.7152+.2848*(1-e),a=.0722-.0722*(1-e),l=.2126-.2126*(1-e),h=.0722+.9278*(1-e);return`\n <filter>\n <feColorMatrix type="matrix" values="${n} ${i} ${r} 0 0 ${s} ${o} ${a} 0 0 ${l} ${i} ${h} 0 0 0 0 0 1 0"/>\n </filter>\n `.trim()}function jM(t={}){const e=OM(t.amount,1),n=.393+.607*(1-e),i=.769-.769*(1-e),r=.189-.189*(1-e),s=.349-.349*(1-e),o=.686+.314*(1-e),a=.168-.168*(1-e),l=.272-.272*(1-e),h=.534-.534*(1-e),c=.131+.869*(1-e);return`\n <filter>\n <feColorMatrix type="matrix" values="${n} ${i} ${r} 0 0 ${s} ${o} ${a} 0 0 ${l} ${h} ${c} 0 0 0 0 0 1 0"/>\n </filter>\n `.trim()}function LM(t={}){const e=OM(t.amount,1);return`\n <filter>\n <feColorMatrix type="saturate" values="${1-e}"/>\n </filter>\n `.trim()}function FM(t={}){const e=OM(t.angle,0);return`\n <filter>\n <feColorMatrix type="hueRotate" values="${e}"/>\n </filter>\n `.trim()}function zM(t={}){const e=OM(t.amount,1),n=1-e;return`\n <filter>\n <feComponentTransfer>\n <feFuncR type="table" tableValues="${e} ${n}"/>\n <feFuncG type="table" tableValues="${e} ${n}"/>\n <feFuncB type="table" tableValues="${e} ${n}"/>\n </feComponentTransfer>\n </filter>\n `.trim()}function BM(t={}){const e=OM(t.amount,1);return`\n <filter>\n <feComponentTransfer>\n <feFuncR type="linear" slope="${e}"/>\n <feFuncG type="linear" slope="${e}"/>\n <feFuncB type="linear" slope="${e}"/>\n </feComponentTransfer>\n </filter>\n `.trim()}function RM(t={}){const e=OM(t.amount,1),n=.5-e/2;return`\n <filter>\n <feComponentTransfer>\n <feFuncR type="linear" slope="${e}" intercept="${n}"/>\n <feFuncG type="linear" slope="${e}" intercept="${n}"/>\n <feFuncB type="linear" slope="${e}" intercept="${n}"/>\n </feComponentTransfer>\n </filter>\n `.trim()}var IM;(function(t){t.presets=d,t.registry=Gw.create({type:"grid"}),t.registry.register(t.presets,!0)})(AM||(AM={})),function(t){t.presets=g,t.registry=Gw.create({type:"filter"}),t.registry.register(t.presets,!0)}(IM||(IM={}));const VM=function(t){const e=document.createElement("canvas"),n=t.width,i=t.height;e.width=2*n,e.height=i;const r=e.getContext("2d");return r.drawImage(t,0,0,n,i),r.translate(2*n,0),r.scale(-1,1),r.drawImage(t,0,0,n,i),e},$M=function(t){const e=document.createElement("canvas"),n=t.width,i=t.height;e.width=n,e.height=2*i;const r=e.getContext("2d");return r.drawImage(t,0,0,n,i),r.translate(0,2*i),r.scale(1,-1),r.drawImage(t,0,0,n,i),e},GM=function(t){const e=document.createElement("canvas"),n=t.width,i=t.height;e.width=2*n,e.height=2*i;const r=e.getContext("2d");return r.drawImage(t,0,0,n,i),r.setTransform(-1,0,0,-1,e.width,e.height),r.drawImage(t,0,0,n,i),r.setTransform(-1,0,0,1,e.width,0),r.drawImage(t,0,0,n,i),r.setTransform(1,0,0,-1,0,e.height),r.drawImage(t,0,0,n,i),e},_M=function(t,e){const n=t.width,i=t.height,r=document.createElement("canvas");r.width=3*n,r.height=3*i;const s=r.getContext("2d"),o=null!=e.angle?-e.angle:-20,a=_C.toRad(o),l=r.width/4,h=r.height/4;for(let c=0;c<4;c+=1)for(let e=0;e<4;e+=1)(c+e)%2>0&&(s.setTransform(1,0,0,1,(2*c-1)*l,(2*e-1)*h),s.rotate(a),s.drawImage(t,-n/2,-i/2,n,i));return r};var HM;(function(t){t.presets=Object.assign({},p),t.presets["flip-x"]=VM,t.presets["flip-y"]=$M,t.presets["flip-xy"]=GM,t.registry=Gw.create({type:"background pattern"}),t.registry.register(t.presets,!0)})(HM||(HM={}));const UM={prefixCls:"x6",autoInsertCSS:!0,useCSSSelector:!0,trackable:!1,trackInfo:{},track(t){UM.trackable=t}};var WM;(function(t){function e(t){return`${UM.prefixCls}-${t}`}t.snapToGrid=XC,t.normalizeMarker=Ix,t.prefix=e})(WM||(WM={})),function(t){function e(t,e,n,i=[]){const r="function"===typeof e.children?e.children(t):t[e.children||"children"];return n||(n=e.createNode(t),i.push(n)),Array.isArray(r)&&r.forEach(t=>{const r=e.createNode(t),s=e.createEdge(n,r);i.push(r,s),this.makeTree(t,e,r,i)}),i}t.makeTree=e}(WM||(WM={}));const XM=WM.prefix("highlighted"),qM={highlight(t,e,n){const i=n&&n.className||XM;h.addClass(e,i)},unhighlight(t,e,n){const i=n&&n.className||XM;h.removeClass(e,i)}},YM=WM.prefix("highlight-opacity"),JM={highlight(t,e){h.addClass(e,YM)},unhighlight(t,e){h.removeClass(e,YM)}},ZM={padding:3,rx:0,ry:0,attrs:{"stroke-width":3,stroke:"#FEB663"}},KM={highlight(t,e,n){const i=QM.getHighlighterId(e,n);if(QM.hasCache(i))return;n=r.defaultsDeep({},n,ZM);const s=Mv.create(e);let o,a;try{o=s.toPathData()}catch(d){a=s.bbox(!0),o=h.rectToPathData(Object.assign(Object.assign({},n),a))}const l=h.createSvgElement("path");if(h.attr(l,Object.assign({d:o,"pointer-events":"none","vector-effect":"non-scaling-stroke",fill:"none"},n.attrs?h.kebablizeAttrs(n.attrs):null)),t.isEdgeElement(e))h.attr(l,"d",t.getConnectionPathData());else{let e=s.getTransformToElement(t.container);const i=n.padding;if(i){null==a&&(a=s.bbox(!0));const t=a.x+a.width/2,n=a.y+a.height/2;a=h.transformRectangle(a,e);const r=Math.max(a.width,1),o=Math.max(a.height,1),l=(r+i)/r,c=(o+i)/o,u=h.createSVGMatrix({a:l,b:0,c:0,d:c,e:t-l*t,f:n-c*n});e=e.multiply(u)}h.transform(l,e)}h.addClass(l,WM.prefix("highlight-stroke"));const c=t.cell,u=()=>QM.removeHighlighter(i);c.on("removed",u),c.model&&c.model.on("reseted",u),t.container.appendChild(l),QM.setCache(i,l)},unhighlight(t,e,n){QM.removeHighlighter(QM.getHighlighterId(e,n))}};var QM,tE;function eE(t,e={}){return new ZC(o.normalizePercentage(e.x,t.width),o.normalizePercentage(e.y,t.height))}function nE(t,e,n){return Object.assign({angle:e,position:t.toJSON()},n)}(function(t){function e(t,e){return h.ensureId(t),t.id+JSON.stringify(e)}t.getHighlighterId=e;const n={};function i(t,e){n[t]=e}function r(t){return null!=n[t]}function s(t){const e=n[t];e&&(h.remove(e),delete n[t])}t.setCache=i,t.hasCache=r,t.removeHighlighter=s})(QM||(QM={})),function(t){function e(t,e){if("function"!==typeof e.highlight)throw new Error(`Highlighter '${t}' is missing required \`highlight()\` method`);if("function"!==typeof e.unhighlight)throw new Error(`Highlighter '${t}' is missing required \`unhighlight()\` method`)}t.check=e}(tE||(tE={})),function(t){t.presets=f,t.registry=Gw.create({type:"highlighter"}),t.registry.register(t.presets,!0)}(tE||(tE={}));const iE=(t,e)=>t.map(({x:t,y:n,angle:i})=>nE(eE(e,{x:t,y:n}),i||0)),rE=(t,e,n)=>{const i=n.start||0,r=n.step||20;return oE(t,e,i,(t,e)=>(t+.5-e/2)*r)},sE=(t,e,n)=>{const i=n.start||0,r=n.step||360/t.length;return oE(t,e,i,t=>t*r)};function oE(t,e,n,i){const r=e.getCenter(),s=e.getTopCenter(),o=e.width/e.height,a=tv.fromRect(e),l=t.length;return t.map((t,e)=>{const h=n+i(e,l),c=s.clone().rotate(-h,r).scale(o,1,r),u=t.compensateRotate?-a.tangentTheta(c):0;return(t.dx||t.dy)&&c.translate(t.dx||0,t.dy||0),t.dr&&c.move(r,t.dr),nE(c.round(),u,t)})}var aE=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const lE=(t,e,n)=>{const i=eE(e,n.start||e.getOrigin()),r=eE(e,n.end||e.getCorner());return gE(t,i,r,n)},hE=(t,e,n)=>gE(t,e.getTopLeft(),e.getBottomLeft(),n),cE=(t,e,n)=>gE(t,e.getTopRight(),e.getBottomRight(),n),uE=(t,e,n)=>gE(t,e.getTopLeft(),e.getTopRight(),n),dE=(t,e,n)=>gE(t,e.getBottomLeft(),e.getBottomRight(),n);function gE(t,e,n,i){const r=new QC(e,n),s=t.length;return t.map((t,e)=>{var{strict:n}=t,o=aE(t,["strict"]);const a=n||i.strict?(e+1)/(s+1):(e+.5)/s,l=r.pointAt(a);return(o.dx||o.dy)&&l.translate(o.dx||0,o.dy||0),nE(l.round(),0,o)})}var pE;(function(t){t.presets=m,t.registry=Gw.create({type:"port layout"}),t.registry.register(t.presets,!0)})(pE||(pE={}));const fE={position:{x:0,y:0},angle:0,attrs:{".":{y:"0","text-anchor":"start"}}};function mE(t,e){const{x:n,y:i,angle:s,attrs:o}=e||{};return r.defaultsDeep({},{angle:s,attrs:o,position:{x:n,y:i}},t,fE)}const bE=(t,e,n)=>mE({position:e.getTopLeft()},n),yE=(t,e,n)=>mE({position:{x:-15,y:0},attrs:{".":{y:".3em","text-anchor":"end"}}},n),CE=(t,e,n)=>mE({position:{x:15,y:0},attrs:{".":{y:".3em","text-anchor":"start"}}},n),vE=(t,e,n)=>mE({position:{x:0,y:-15},attrs:{".":{"text-anchor":"middle"}}},n),wE=(t,e,n)=>mE({position:{x:0,y:15},attrs:{".":{y:".6em","text-anchor":"middle"}}},n),xE=(t,e,n)=>SE(t,e,!1,n),ME=(t,e,n)=>SE(t,e,!0,n),EE=(t,e,n)=>OE(t,e,!1,n),AE=(t,e,n)=>OE(t,e,!0,n);function SE(t,e,n,i){const r=null!=i.offset?i.offset:15,s=e.getCenter().theta(t),o=PE(e);let a,l,h,c,u=0;return s<o[1]||s>o[2]?(a=".3em",l=r,h=0,c="start"):s<o[0]?(a="0",l=0,h=-r,n?(u=-90,c="start"):c="middle"):s<o[3]?(a=".3em",l=-r,h=0,c="end"):(a=".6em",l=0,h=r,n?(u=90,c="start"):c="middle"),mE({position:{x:Math.round(l),y:Math.round(h)},angle:u,attrs:{".":{y:a,"text-anchor":c}}},i)}function OE(t,e,n,i){const r=null!=i.offset?i.offset:15,s=e.getCenter().theta(t),o=PE(e);let a,l,h,c,u=0;return s<o[1]||s>o[2]?(a=".3em",l=-r,h=0,c="end"):s<o[0]?(a=".6em",l=0,h=r,n?(u=90,c="start"):c="middle"):s<o[3]?(a=".3em",l=r,h=0,c="start"):(a="0em",l=0,h=-r,n?(u=-90,c="start"):c="middle"),mE({position:{x:Math.round(l),y:Math.round(h)},angle:u,attrs:{".":{y:a,"text-anchor":c}}},i)}function PE(t){const e=t.getCenter(),n=e.theta(t.getTopLeft()),i=e.theta(t.getBottomLeft()),r=e.theta(t.getBottomRight()),s=e.theta(t.getTopRight());return[n,s,r,i]}const kE=(t,e,n)=>TE(t.diff(e.getCenter()),!1,n),DE=(t,e,n)=>TE(t.diff(e.getCenter()),!0,n);function TE(t,e,n){const i=null!=n.offset?n.offset:20,r=new ZC(0,0),s=-t.theta(r),o=t.clone().move(r,i).diff(t).round();let a,l=".3em",h=s;return(s+90)%180===0?(a=e?"end":"middle",e||-270!==s||(l="0em")):s>-270&&s<-90?(a="start",h=s-180):a="end",mE({position:o.round().toJSON(),angle:e?h:0,attrs:{".":{y:l,"text-anchor":a}}},n)}var NE,jE;(function(t){t.presets=b,t.registry=Gw.create({type:"port label layout"}),t.registry.register(t.presets,!0)})(NE||(NE={}));class LE{constructor(t,e,n,i){return null==t?this.set(255,255,255,1):"number"===typeof t?this.set(t,e,n,i):"string"===typeof t?LE.fromString(t)||this:Array.isArray(t)?this.set(t):void this.set(t.r,t.g,t.b,null==t.a?1:t.a)}blend(t,e,n){this.set(t.r+(e.r-t.r)*n,t.g+(e.g-t.g)*n,t.b+(e.b-t.b)*n,t.a+(e.a-t.a)*n)}lighten(t){const e=LE.lighten(this.toArray(),t);this.r=e[0],this.g=e[1],this.b=e[2],this.a=e[3]}darken(t){this.lighten(-t)}set(t,e,n,i){const r=Array.isArray(t)?t[0]:t,s=Array.isArray(t)?t[1]:e,a=Array.isArray(t)?t[2]:n,l=Array.isArray(t)?t[3]:i;return this.r=Math.round(o.clamp(r,0,255)),this.g=Math.round(o.clamp(s,0,255)),this.b=Math.round(o.clamp(a,0,255)),this.a=null==l?1:o.clamp(l,0,1),this}toHex(){const t=["r","g","b"].map(t=>{const e=this[t].toString(16);return e.length<2?"0"+e:e});return"#"+t.join("")}toRGBA(){return this.toArray()}toHSLA(){return LE.rgba2hsla(this.r,this.g,this.b,this.a)}toCSS(t){const e=`${this.r},${this.g},${this.b},`;return t?`rgb(${e})`:`rgba(${e},${this.a})`}toGrey(){return LE.makeGrey(Math.round((this.r+this.g+this.b)/3),this.a)}toArray(){return[this.r,this.g,this.b,this.a]}toString(){return this.toCSS()}}(function(t){function e(e){return new t(e)}function n(e){return new t([...f(e),1])}function i(e){const n=e.toLowerCase().match(/^rgba?\(([\s.,0-9]+)\)/);if(n){const e=n[1].split(/\s*,\s*/).map(t=>parseInt(t,10));return new t(e)}return null}function r(t,e,n){n<0&&++n,n>1&&--n;const i=6*n;return i<1?t+(e-t)*i:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function s(e){const n=e.toLowerCase().match(/^hsla?\(([\s.,0-9]+)\)/);if(n){const e=n[2].split(/\s*,\s*/),i=(parseFloat(e[0])%360+360)%360/360,r=parseFloat(e[1])/100,s=parseFloat(e[2])/100,o=null==e[3]?1:parseInt(e[3],10);return new t(c(i,r,s,o))}return null}function a(e){if(e.startsWith("#"))return n(e);if(e.startsWith("rgb"))return i(e);const r=t.named[e];return r?n(r):s(e)}function l(e,n){return t.fromArray([e,e,e,n])}function h(t,e,n,i){const r=Array.isArray(t)?t[0]:t,s=Array.isArray(t)?t[1]:e,o=Array.isArray(t)?t[2]:n,a=Array.isArray(t)?t[3]:i,l=Math.max(r,s,o),h=Math.min(r,s,o),c=(l+h)/2;let u=0,d=0;if(h!==l){const t=l-h;switch(d=c>.5?t/(2-l-h):t/(l+h),l){case r:u=(s-o)/t+(s<o?6:0);break;case s:u=(o-r)/t+2;break;case o:u=(r-s)/t+4;break;default:break}u/=6}return[u,d,c,null==a?1:a]}function c(t,e,n,i){const s=Array.isArray(t)?t[0]:t,o=Array.isArray(t)?t[1]:e,a=Array.isArray(t)?t[2]:n,l=Array.isArray(t)?t[3]:i,h=a<=.5?a*(o+1):a+o-a*o,c=2*a-h;return[256*r(c,h,s+1/3),256*r(c,h,s),256*r(c,h,s-1/3),null==l?1:l]}function u(e){return new t(Math.round(256*Math.random()),Math.round(256*Math.random()),Math.round(256*Math.random()),e?void 0:parseFloat(Math.random().toFixed(2)))}function d(){const t="0123456789ABCDEF";let e="#";for(let n=0;n<6;n+=1)e+=t[Math.floor(16*Math.random())];return e}function g(t){return u(t).toString()}function p(t,e){if("string"===typeof t){const n="#"===t[0],[i,r,s]=f(t);return e?.299*i+.587*r+.114*s>186?"#000000":"#ffffff":`${n?"#":""}${m(255-i,255-r,255-s)}`}const n=t[0],i=t[1],r=t[2],s=t[3];return e?.299*n+.587*i+.114*r>186?[0,0,0,s]:[255,255,255,s]:[255-n,255-i,255-r,s]}function f(t){const e=0===t.indexOf("#")?t:"#"+t;let n=Number("0x"+e.substr(1));if(4!==e.length&&7!==e.length||Number.isNaN(n))throw new Error("Invalid hex color.");const i=4===e.length?4:8,r=(1<<i)-1,s=["b","g","r"].map(()=>{const t=n&r;return n>>=i,4===i?17*t:t});return[s[2],s[1],s[0]]}function m(t,e,n){const i=t=>t.length<2?"0"+t:t;return`${i(t.toString(16))}${i(e.toString(16))}${i(n.toString(16))}`}function b(t,e){return C(t,e)}function y(t,e){return C(t,-e)}function C(t,e){if("string"===typeof t){const n="#"===t[0],i=parseInt(n?t.substr(1):t,16),r=o.clamp((i>>16)+e,0,255),s=o.clamp((i>>8&255)+e,0,255),a=o.clamp((255&i)+e,0,255);return`${n?"#":""}${(a|s<<8|r<<16).toString(16)}`}const n=m(t[0],t[1],t[2]),i=f(C(n,e));return[i[0],i[1],i[2],t[3]]}t.fromArray=e,t.fromHex=n,t.fromRGBA=i,t.fromHSLA=s,t.fromString=a,t.makeGrey=l,t.rgba2hsla=h,t.hsla2rgba=c,t.random=u,t.randomHex=d,t.randomRGBA=g,t.invert=p,t.lighten=b,t.darken=y})(LE||(LE={})),function(t){t.named={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",burntsienna:"#ea7e5d",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}}(LE||(LE={}));class FE{constructor(){this.listeners={}}on(t,e,n){if(null==e)return this;this.listeners[t]||(this.listeners[t]=[]);const i=this.listeners[t];return i.push(e,n),this}once(t,e,n){const i=(...r)=>(this.off(t,i),jE.call([e,n],r));return this.on(t,i,this)}off(t,e,n){if(!(t||e||n))return this.listeners={},this;const i=this.listeners,r=t?[t]:Object.keys(i);return r.forEach(t=>{const r=i[t];if(r)if(e||n)for(let i=r.length-2;i>=0;i-=2)e&&r[i]!==e||n&&r[i+1]!==n||r.splice(i,2);else delete i[t]}),this}trigger(t,...e){let n=!0;if("*"!==t){const i=this.listeners[t];null!=i&&(n=jE.call([...i],e))}const i=this.listeners["*"];return null!=i?a.toAsyncBoolean([n,jE.call([...i],[t,...e])]):n}emit(t,...e){return this.trigger(t,...e)}}(function(t){function e(t,e){const n=[];for(let i=0;i<t.length;i+=2){const r=t[i],s=t[i+1],o=Array.isArray(e)?e:[e],l=a.apply(r,s,o);n.push(l)}return a.toAsyncBoolean(n)}t.call=e})(jE||(jE={}));class zE{get disposed(){return!0===this._disposed}dispose(){this._disposed=!0}}(function(t){function e(){return(t,e,n)=>{const i=n.value,r=t.__proto__;n.value=function(){this.disposed||(i.call(this),r.dispose.call(this))}}}t.dispose=e})(zE||(zE={}));class BE{constructor(){this.isDisposed=!1,this.items=new Set}get disposed(){return this.isDisposed}dispose(){this.isDisposed||(this.isDisposed=!0,this.items.forEach(t=>{t.dispose()}),this.items.clear())}contains(t){return this.items.has(t)}add(t){this.items.add(t)}remove(t){this.items.delete(t)}clear(){this.items.clear()}}(function(t){function e(e){const n=new t;return e.forEach(t=>{n.add(t)}),n}t.from=e})(BE||(BE={}));class RE extends FE{}(function(t){t.dispose=zE.dispose})(RE||(RE={})),r.applyMixins(RE,zE);class IE extends RE{get disabled(){return!0===this._disabled}enable(){delete this._disabled}disable(){this._disabled=!0}}var VE,$E,GE,_E,HE,UE=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class WE extends zE{constructor(){super(),this.clear()}clear(){this.map=new WeakMap,this.arr=[]}has(t){return this.map.has(t)}get(t){return this.map.get(t)}set(t,e){this.map.set(t,e),this.arr.push(t)}delete(t){const e=this.arr.indexOf(t);e>=0&&this.arr.splice(e,1);const n=this.map.get(t);return this.map.delete(t),n}each(t){this.arr.forEach(e=>{const n=this.map.get(e);t(n,e)})}dispose(){this.clear()}}UE([zE.dispose()],WE.prototype,"dispose",null);class XE{constructor(t={}){this.comparator=t.comparator||XE.defaultComparator,this.index={},this.data=t.data||[],this.heapify()}isEmpty(){return 0===this.data.length}insert(t,e,n){const i={priority:t,value:e},r=this.data.length;return n&&(i.id=n,this.index[n]=r),this.data.push(i),this.bubbleUp(r),this}peek(){return this.data[0]?this.data[0].value:null}peekPriority(){return this.data[0]?this.data[0].priority:null}updatePriority(t,e){const n=this.index[t];if("undefined"===typeof n)throw new Error(`Node with id '${t}' was not found in the heap.`);const i=this.data,r=i[n].priority,s=this.comparator(e,r);s<0?(i[n].priority=e,this.bubbleUp(n)):s>0&&(i[n].priority=e,this.bubbleDown(n))}remove(){const t=this.data,e=t[0],n=t.pop();return e.id&&delete this.index[e.id],t.length>0&&(t[0]=n,n.id&&(this.index[n.id]=0),this.bubbleDown(0)),e?e.value:null}heapify(){for(let t=0;t<this.data.length;t+=1)this.bubbleUp(t)}bubbleUp(t){const e=this.data;let n,i,r=t;while(r>0){if(i=r-1>>>1,!(this.comparator(e[r].priority,e[i].priority)<0))break;{n=e[i],e[i]=e[r];let t=e[r].id;null!=t&&(this.index[t]=i),e[r]=n,t=e[r].id,null!=t&&(this.index[t]=r),r=i}}}bubbleDown(t){const e=this.data,n=e.length-1;let i=t;while(1){const t=1+(i<<1),r=t+1;let s=i;if(t<=n&&this.comparator(e[t].priority,e[s].priority)<0&&(s=t),r<=n&&this.comparator(e[r].priority,e[s].priority)<0&&(s=r),s===i)break;{const t=e[s];e[s]=e[i];let n=e[i].id;null!=n&&(this.index[n]=s),e[i]=t,n=e[i].id,null!=n&&(this.index[n]=i),i=s}}}}(function(t){t.defaultComparator=(t,e)=>t-e})(XE||(XE={})),function(t){function e(t,e,n=((t,e)=>1)){const i={},r={},s={},o=new XE;i[e]=0,Object.keys(t).forEach(t=>{t!==e&&(i[t]=1/0),o.insert(i[t],t,t)});while(!o.isEmpty()){const e=o.remove();s[e]=!0;const a=t[e]||[];for(let t=0;t<a.length;t+=1){const l=a[t];if(!s[l]){const t=i[e]+n(e,l);t<i[l]&&(i[l]=t,r[l]=e,o.updatePriority(l,t))}}}return r}t.run=e}(VE||(VE={})),function(t){t.linear=t=>t,t.quad=t=>t*t,t.cubic=t=>t*t*t,t.inout=t=>{if(t<=0)return 0;if(t>=1)return 1;const e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)},t.exponential=t=>Math.pow(2,10*(t-1)),t.bounce=t=>{for(let e=0,n=1;1;e+=n,n/=2)if(t>=(7-4*e)/11){const i=(11-6*e-11*t)/4;return-i*i+n*n}}}($E||($E={})),function(t){t.decorators={reverse(t){return e=>1-t(1-e)},reflect(t){return e=>.5*(e<.5?t(2*e):2-t(2-2*e))},clamp(t,e=0,n=1){return i=>{const r=t(i);return r<e?e:r>n?n:r}},back(t=1.70158){return e=>e*e*((t+1)*e-t)},elastic(t=1.5){return e=>Math.pow(2,10*(e-1))*Math.cos(20*Math.PI*t/3*e)}}}($E||($E={})),function(t){function e(t){return-1*Math.cos(t*(Math.PI/2))+1}function n(t){return Math.sin(t*(Math.PI/2))}function i(t){return-.5*(Math.cos(Math.PI*t)-1)}function r(t){return t*t}function s(t){return t*(2-t)}function o(t){return t<.5?2*t*t:(4-2*t)*t-1}function a(t){return t*t*t}function l(t){const e=t-1;return e*e*e+1}function h(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1}function c(t){return t*t*t*t}function u(t){const e=t-1;return 1-e*e*e*e}function d(t){const e=t-1;return t<.5?8*t*t*t*t:1-8*e*e*e*e}function g(t){return t*t*t*t*t}function p(t){const e=t-1;return 1+e*e*e*e*e}function f(t){const e=t-1;return t<.5?16*t*t*t*t*t:1+16*e*e*e*e*e}function m(t){return 0===t?0:Math.pow(2,10*(t-1))}function b(t){return 1===t?1:1-Math.pow(2,-10*t)}function y(t){if(0===t||1===t)return t;const e=2*t,n=e-1;return e<1?.5*Math.pow(2,10*n):.5*(2-Math.pow(2,-10*n))}function C(t){const e=t/1;return-1*(Math.sqrt(1-e*t)-1)}function v(t){const e=t-1;return Math.sqrt(1-e*e)}function w(t){const e=2*t,n=e-2;return e<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-n*n)+1)}function x(t,e=1.70158){return t*t*((e+1)*t-e)}function M(t,e=1.70158){const n=t/1-1;return n*n*((e+1)*n+e)+1}function E(t,e=1.70158){const n=2*t,i=n-2,r=1.525*e;return n<1?.5*n*n*((r+1)*n-r):.5*(i*i*((r+1)*i+r)+2)}function A(t,e=.7){if(0===t||1===t)return t;const n=t/1,i=n-1,r=1-e,s=r/(2*Math.PI)*Math.asin(1);return-Math.pow(2,10*i)*Math.sin((i-s)*(2*Math.PI)/r)}function S(t,e=.7){const n=1-e,i=2*t;if(0===t||1===t)return t;const r=n/(2*Math.PI)*Math.asin(1);return Math.pow(2,-10*i)*Math.sin((i-r)*(2*Math.PI)/n)+1}function O(t,e=.65){const n=1-e;if(0===t||1===t)return t;const i=2*t,r=i-1,s=n/(2*Math.PI)*Math.asin(1);return i<1?Math.pow(2,10*r)*Math.sin((r-s)*(2*Math.PI)/n)*-.5:Math.pow(2,-10*r)*Math.sin((r-s)*(2*Math.PI)/n)*.5+1}function P(t){const e=t/1;if(e<1/2.75)return 7.5625*e*e;if(e<2/2.75){const t=e-1.5/2.75;return 7.5625*t*t+.75}if(e<2.5/2.75){const t=e-2.25/2.75;return 7.5625*t*t+.9375}{const t=e-2.625/2.75;return 7.5625*t*t+.984375}}function k(t){return 1-P(1-t)}function D(t){return t<.5?.5*k(2*t):.5*P(2*t-1)+.5}t.easeInSine=e,t.easeOutSine=n,t.easeInOutSine=i,t.easeInQuad=r,t.easeOutQuad=s,t.easeInOutQuad=o,t.easeInCubic=a,t.easeOutCubic=l,t.easeInOutCubic=h,t.easeInQuart=c,t.easeOutQuart=u,t.easeInOutQuart=d,t.easeInQuint=g,t.easeOutQuint=p,t.easeInOutQuint=f,t.easeInExpo=m,t.easeOutExpo=b,t.easeInOutExpo=y,t.easeInCirc=C,t.easeOutCirc=v,t.easeInOutCirc=w,t.easeInBack=x,t.easeOutBack=M,t.easeInOutBack=E,t.easeInElastic=A,t.easeOutElastic=S,t.easeInOutElastic=O,t.easeOutBounce=P,t.easeInBounce=k,t.easeInOutBounce=D}($E||($E={})),function(t){t.number=(t,e)=>{const n=e-t;return e=>t+n*e},t.object=(t,e)=>{const n=Object.keys(t);return i=>{const r={};for(let s=n.length-1;-1!==s;s-=1){const o=n[s];r[o]=t[o]+(e[o]-t[o])*i}return r}},t.unit=(t,e)=>{const n=/(-?[0-9]*.[0-9]*)(px|em|cm|mm|in|pt|pc|%)/,i=n.exec(t),r=n.exec(e),s=r?r[1]:"",o=i?+i[1]:0,a=r?+r[1]:0,l=s.indexOf("."),h=l>0?s[1].length-l-1:0,c=a-o,u=i?i[2]:"";return t=>(o+c*t).toFixed(h)+u},t.color=(t,e)=>{const n=parseInt(t.slice(1),16),i=parseInt(e.slice(1),16),r=255&n,s=(255&i)-r,o=65280&n,a=(65280&i)-o,l=16711680&n,h=(16711680&i)-l;return t=>{const e=r+s*t&255,n=o+a*t&65280,i=l+h*t&16711680;return"#"+(1<<24|e|n|i).toString(16).slice(1)}}}(GE||(GE={})),function(t){const e=UM.prefixCls+".storage";function n(t,e,n){const i=e.id||s.uniqueId("doc-"),r=c(t);r.keys.push(i),l(u(t,i),e),l(d(t),r),o(n,null,Object.assign(Object.assign({},e),{id:i}))}function i(t,e,n){const i=c(t),r=[];if(null==e)i.keys.forEach(e=>{const i=h(u(t,e));i?r.push(i):o(n,new Error(`No document found for an ID '${e}' from index.`))}),o(n,null,r);else if(e.id){const i=h(u(t,e.id));o(n,null,i?[i]:[])}else o(n,null,[])}function r(t,e,n){const i=c(t);if(null==e)i.keys.forEach(e=>{localStorage.removeItem(u(t,e))}),localStorage.removeItem(d(t)),o(n,null);else if(e.id){const r=i.keys.indexOf(e.id);r>=0&&i.keys.splice(r,1),localStorage.removeItem(u(t,e.id)),l(d(t),i),o(n,null)}}function o(t,e,n){t&&a.defer(()=>{t(e,n)})}function l(t,e){localStorage.setItem(t,JSON.stringify(e))}function h(t){const e=localStorage.getItem(t);return e?JSON.parse(e):null}function c(t){const e=h(d(t));return e?(null==e.keys&&(e.keys=[]),e):{keys:[]}}function u(t,n){return`${e}.${t}.docs.${n}`}function d(t){return`${e}.${t}.index`}t.insert=n,t.find=i,t.remove=r}(_E||(_E={}));class qE extends RE{constructor(){super(),this.cid=HE.uniqueId(),qE.views[this.cid]=this}get priority(){return 2}confirmUpdate(t,e){return 0}$(t){return qE.$(t)}empty(t=this.container){return this.$(t).empty(),this}unmount(t=this.container){return this.$(t).remove(),this}remove(t=this.container){return t===this.container&&(this.removeEventListeners(document),this.onRemove(),delete qE.views[this.cid]),this.unmount(t),this}onRemove(){}setClass(t,e=this.container){e.classList.value=Array.isArray(t)?t.join(" "):t}addClass(t,e=this.container){return this.$(e).addClass(Array.isArray(t)?t.join(" "):t),this}removeClass(t,e=this.container){return this.$(e).removeClass(Array.isArray(t)?t.join(" "):t),this}setStyle(t,e=this.container){return this.$(e).css(t),this}setAttrs(t,e=this.container){return null!=t&&null!=e&&(e instanceof SVGElement?h.attr(e,t):this.$(e).attr(t)),this}findAttr(t,e=this.container){let n=e;while(n&&1===n.nodeType){const e=n.getAttribute(t);if(null!=e)return e;if(n===this.container)return null;n=n.parentNode}return null}find(t,e=this.container,n=this.selectors){return qE.find(t,e,n).elems}findOne(t,e=this.container,n=this.selectors){const i=this.find(t,e,n);return i.length>0?i[0]:null}findByAttr(t,e=this.container){let n=e;while(n&&n.getAttribute){const e=n.getAttribute(t);if((null!=e||n===this.container)&&"false"!==e)return n;n=n.parentNode}return null}getSelector(t,e){let n;if(t===this.container)return"string"===typeof e&&(n="> "+e),n;if(t){const i=h.index(t)+1;n=`${t.tagName.toLowerCase()}:nth-child(${i})`,e&&(n+=" > "+e),n=this.getSelector(t.parentNode,n)}return n}prefixClassName(t){return WM.prefix(t)}delegateEvents(t,e){if(null==t)return this;e||this.undelegateEvents();const n=/^(\S+)\s*(.*)$/;return Object.keys(t).forEach(e=>{const i=e.match(n);if(null==i)return;const r=this.getEventHandler(t[e]);"function"===typeof r&&this.delegateEvent(i[1],i[2],r)}),this}undelegateEvents(){return this.$(this.container).off(this.getEventNamespace()),this}delegateDocumentEvents(t,e){return this.addEventListeners(document,t,e),this}undelegateDocumentEvents(){return this.removeEventListeners(document),this}delegateEvent(t,e,n){return this.$(this.container).on(t+this.getEventNamespace(),e,n),this}undelegateEvent(t,e,n){const i=t+this.getEventNamespace();return null==e?this.$(this.container).off(i):"string"===typeof e?this.$(this.container).off(i,e,n):this.$(this.container).off(i,e),this}addEventListeners(t,e,n){if(null==e)return this;const i=this.getEventNamespace(),r=this.$(t);return Object.keys(e).forEach(t=>{const s=this.getEventHandler(e[t]);"function"===typeof s&&r.on(t+i,n,s)}),this}removeEventListeners(t){return null!=t&&this.$(t).off(this.getEventNamespace()),this}getEventNamespace(){return`.${UM.prefixCls}-event-${this.cid}`}getEventHandler(t){let e;if("string"===typeof t){const n=this[t];"function"===typeof n&&(e=(...t)=>n.call(this,...t))}else e=(...e)=>t.call(this,...e);return e}getEventTarget(t,e={}){const{target:n,type:i,clientX:r=0,clientY:s=0}=t;return e.fromPoint||"touchmove"===i||"touchend"===i?document.elementFromPoint(r,s):n}stopPropagation(t){return this.setEventData(t,{propagationStopped:!0}),this}isPropagationStopped(t){return!0===this.getEventData(t).propagationStopped}getEventData(t){return this.eventData(t)}setEventData(t,e){return this.eventData(t,e)}eventData(t,e){if(null==t)throw new TypeError("Event object required");let n=t.data;const i=`__${this.cid}__`;return null==e?null==n?{}:n[i]||{}:(null==n&&(n=t.data={}),null==n[i]?n[i]=Object.assign({},e):n[i]=Object.assign(Object.assign({},n[i]),e),n[i])}normalizeEvent(t){return qE.normalizeEvent(t)}}(function(t){function e(t){return P()(t)}function n(t,e){return e?h.createSvgElement(t||"g"):h.createElementNS(t||"div")}function i(t,n,i){if(!t||"."===t)return{elems:[n]};if(i){const e=i[t];if(e)return{elems:Array.isArray(e)?e:[e]}}return UM.useCSSSelector?{isCSSSelector:!0,elems:e(n).find(t).toArray()}:{elems:[]}}function r(t){let e=t;const n=t.originalEvent,i=n&&n.changedTouches&&n.changedTouches[0];if(i){for(const e in t)void 0===i[e]&&(i[e]=t[e]);e=i}const r=e.target;if(r){const t=r.correspondingUseElement;t&&(e.target=t)}return e}t.$=e,t.createElement=n,t.find=i,t.normalizeEvent=r})(qE||(qE={})),function(t){function e(e){return t.views[e]||null}t.views={},t.getView=e}(qE||(qE={})),function(t){let e=0;function n(){const t="v"+e;return e+=1,t}t.uniqueId=n}(HE||(HE={}));const YE=t=>t;function JE(t,e){return 0===e?"0%":Math.round(t/e*100)+"%"}function ZE(t){const e=(e,n,i,r)=>n.isEdgeElement(i)?QE(t,e,n,i,r):KE(t,e,n,i,r);return e}function KE(t,e,n,i,r){const s=n.cell,o=s.getAngle(),a=n.getUnrotatedBBoxOfElement(i),l=s.getBBox().getCenter(),h=ZC.create(r).rotate(o,l);let c=h.x-a.x,u=h.y-a.y;return t&&(c=JE(c,a.width),u=JE(u,a.height)),e.anchor={name:"topLeft",args:{dx:c,dy:u,rotate:!0}},e}function QE(t,e,n,i,r){const s=n.getConnection();if(!s)return e;const o=s.closestPointLength(r);if(t){const t=s.length();e.anchor={name:"ratio",args:{ratio:o/t}}}else e.anchor={name:"length",args:{length:o}};return e}const tA=ZE(!0),eA=ZE(!1);var nA,iA;(function(t){t.presets=y,t.registry=Gw.create({type:"connection strategy"}),t.registry.register(t.presets,!0)})(nA||(nA={}));class rA{constructor(t){this.view=t,this.clean()}clean(){this.elemCache&&this.elemCache.dispose(),this.elemCache=new WE,this.pathCache={}}get(t){const e=this.elemCache;return e.has(t)||this.elemCache.set(t,{}),this.elemCache.get(t)}getData(t){const e=this.get(t);return e.data||(e.data={}),e.data}getMatrix(t){const e=this.get(t);if(null==e.matrix){const n=this.view.rotatableNode||this.view.container;e.matrix=h.getTransformToElement(t,n)}return h.createSVGMatrix(e.matrix)}getShape(t){const e=this.get(t);return null==e.shape&&(e.shape=h.toGeometryShape(t)),e.shape.clone()}getBoundingRect(t){const e=this.get(t);return null==e.boundingRect&&(e.boundingRect=h.getBBox(t)),e.boundingRect.clone()}}(function(t){function e(t){return null!=t&&!n(t)}function n(t){return null!=t&&"string"===typeof t}function i(t){return null==t||n(t)?t:r.cloneDeep(t)}function o(t){return(""+t).trim().replace(/[\r|\n]/g," ").replace(/>\s+</g,"><")}function a(t){const e=document.createDocumentFragment(),n={},i={},r=o(t),a=s.sanitizeHTML(r,{raw:!0});return a.forEach(t=>{e.appendChild(t)}),{fragment:e,selectors:i,groups:n}}function l(t,e={ns:h.ns.svg}){const n=document.createDocumentFragment(),i={},r={},s=[{markup:Array.isArray(t)?t:[t],parent:n,ns:e.ns}];while(s.length>0){const t=s.pop();let e=t.ns||h.ns.svg;const n=t.markup,o=t.parent;n.forEach(t=>{const n=t.tagName;if(!n)throw new TypeError("Invalid tagName");t.ns&&(e=t.ns);const a=e===h.ns.svg,l=e?h.createElementNS(n,e):h.createElement(n),c=t.attrs;c&&(a?h.attr(l,h.kebablizeAttrs(c)):P()(l).attr(c));const u=t.style;u&&P()(l).css(u);const d=t.className;null!=d&&l.setAttribute("class",Array.isArray(d)?d.join(" "):d),t.textContent&&(l.textContent=t.textContent);const g=t.selector;if(null!=g){if(r[g])throw new TypeError("Selector must be unique");r[g]=l}if(t.groupSelector){let e=t.groupSelector;Array.isArray(e)||(e=[e]),e.forEach(t=>{i[t]||(i[t]=[]),i[t].push(l)})}o.appendChild(l);const p=t.children;Array.isArray(p)&&s.push({ns:e,markup:p,parent:l})})}return Object.keys(i).forEach(t=>{if(r[t])throw new Error("Ambiguous group selector");r[t]=i[t]}),{fragment:n,selectors:r,groups:i}}function c(t){return t instanceof SVGElement?h.createSvgElement("g"):h.createElement("div")}function u(t){if(n(t)){const e=Mv.createVectors(t),n=e.length;if(1===n)return{elem:e[0].node};if(n>1){const t=c(e[0].node);return e.forEach(e=>{t.appendChild(e.node)}),{elem:t}}return{}}const e=l(t),i=e.fragment;let r=null;return i.childNodes.length>1?(r=c(i.firstChild),r.appendChild(i)):r=i.firstChild,{elem:r,selectors:e.selectors}}function d(t){const e=Mv.createVectors(t),n=document.createDocumentFragment();for(let i=0,r=e.length;i<r;i+=1){const t=e[i].node;n.appendChild(t)}return{fragment:n,selectors:{}}}t.isJSONMarkup=e,t.isStringMarkup=n,t.clone=i,t.sanitize=o,t.parseStringMarkup=a,t.parseJSONMarkup=l,t.renderMarkup=u,t.parseLabelStringMarkup=d})(iA||(iA={})),function(t){function e(t,n,i){if(null!=t){let r;const s=t.tagName.toLowerCase();if(t===n)return r="string"===typeof i?`> ${s} > ${i}`:"> "+s,r;const o=t.parentNode;if(o&&o.childNodes.length>1){const e=h.index(t)+1;r=`${s}:nth-child(${e})`}else r=s;return i&&(r+=" > "+i),e(t.parentNode,n,r)}return i}function n(t,n,i){if("#text"===t.nodeName)return null;let r=null,s=null,o=null,a=!1;const l={tagName:t.tagName};if(t.attributes){o={};for(let e=0,n=t.attributes.length;e<n;e+=1){const n=t.attributes[e],i=n.nodeName,a=n.nodeValue;"selector"===i?r=a:"groupSelector"===i?s=a:"class"===i?l.attrs={class:a}:o[i]=a}}return null==r&&(a=!0,r=e(t,n)),t.namespaceURI&&(l.ns=t.namespaceURI),null==l.ns&&(["body","div","section","main","nav","footer","span","p","h1","h2","h3","h4","h5","h6","ul","ol","dl","center","strong","pre","form","select","textarea","fieldset","marquee","bgsound","iframe","frameset"].includes(t.tagName)?l.ns=h.ns.xhtml:i&&(l.ns=i)),r&&(l.selector=r),null!=s&&(l.groupSelector=s),{markup:l,attrs:o,isCSSSelector:a}}function i(e){const i=t.sanitize(e),r=h.parseXML(i,{mimeType:"image/svg+xml"}),s=Array.prototype.slice.call(r.childNodes),o={},a=new WeakMap,l=(t,e,i)=>{const r=n(t,e,i);if(null!=r){const{markup:n,attrs:i,isCSSSelector:s}=r;if(a.set(t,n),n.selector&&null!=i&&(Object.keys(i).length&&(o[n.selector]=i),s&&delete n.selector),t.childNodes&&t.childNodes.length>0)for(let r=0,o=t.childNodes.length;r<o;r+=1){const i=t.childNodes[r],s=l(i,e,n.ns);s&&(null==n.children&&(n.children=[]),n.children.push(s))}return n}{const e=a.get(t.parentNode);e&&t.textContent&&(e.textContent=t.textContent)}},c=s.map(t=>l(t,t)).filter(t=>null!=t);return{markup:c,attrs:o}}t.getSelector=e,t.xml2json=i}(iA||(iA={})),function(t){function e(){return"g"}function n(){return{tagName:"circle",selector:"circle",attrs:{r:10,fill:"#FFFFFF",stroke:"#000000"}}}function i(){return{tagName:"text",selector:"text",attrs:{fill:"#000000"}}}t.getPortContainerMarkup=e,t.getPortMarkup=n,t.getPortLabelMarkup=i}(iA||(iA={})),function(t){function e(){return t.sanitize('\n <path class="connection" stroke="black" d="M 0 0 0 0"/>\n <path class="source-marker" fill="black" stroke="black" d="M 0 0 0 0"/>\n <path class="target-marker" fill="black" stroke="black" d="M 0 0 0 0"/>\n <path class="connection-wrap" d="M 0 0 0 0"/>\n <g class="labels"/>\n <g class="vertices"/>\n <g class="arrowheads"/>\n <g class="tools"/>\n ')}function n(){return t.sanitize('\n <g class="edge-tool">\n <g class="tool-remove" event="edge:remove">\n <circle r="11" />\n <path transform="scale(.8) translate(-16, -16)" d="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z" />\n <title>Remove edge.</title>\n </g>\n <g class="tool-options" event="edge:options">\n <circle r="11" transform="translate(25)"/>\n <path fill="white" transform="scale(.55) translate(29, -16)" d="M31.229,17.736c0.064-0.571,0.104-1.148,0.104-1.736s-0.04-1.166-0.104-1.737l-4.377-1.557c-0.218-0.716-0.504-1.401-0.851-2.05l1.993-4.192c-0.725-0.91-1.549-1.734-2.458-2.459l-4.193,1.994c-0.647-0.347-1.334-0.632-2.049-0.849l-1.558-4.378C17.165,0.708,16.588,0.667,16,0.667s-1.166,0.041-1.737,0.105L12.707,5.15c-0.716,0.217-1.401,0.502-2.05,0.849L6.464,4.005C5.554,4.73,4.73,5.554,4.005,6.464l1.994,4.192c-0.347,0.648-0.632,1.334-0.849,2.05l-4.378,1.557C0.708,14.834,0.667,15.412,0.667,16s0.041,1.165,0.105,1.736l4.378,1.558c0.217,0.715,0.502,1.401,0.849,2.049l-1.994,4.193c0.725,0.909,1.549,1.733,2.459,2.458l4.192-1.993c0.648,0.347,1.334,0.633,2.05,0.851l1.557,4.377c0.571,0.064,1.148,0.104,1.737,0.104c0.588,0,1.165-0.04,1.736-0.104l1.558-4.377c0.715-0.218,1.399-0.504,2.049-0.851l4.193,1.993c0.909-0.725,1.733-1.549,2.458-2.458l-1.993-4.193c0.347-0.647,0.633-1.334,0.851-2.049L31.229,17.736zM16,20.871c-2.69,0-4.872-2.182-4.872-4.871c0-2.69,2.182-4.872,4.872-4.872c2.689,0,4.871,2.182,4.871,4.872C20.871,18.689,18.689,20.871,16,20.871z"/>\n <title>Edge options.</title>\n </g>\n </g>\n ')}function i(){return t.sanitize('\n <g class="vertex-group" transform="translate(<%= x %>, <%= y %>)">\n <circle class="vertex" data-index="<%= index %>" r="10" />\n <path class="vertex-remove-area" data-index="<%= index %>" d="M16,5.333c-7.732,0-14,4.701-14,10.5c0,1.982,0.741,3.833,2.016,5.414L2,25.667l5.613-1.441c2.339,1.317,5.237,2.107,8.387,2.107c7.732,0,14-4.701,14-10.5C30,10.034,23.732,5.333,16,5.333z" transform="translate(5, -33)"/>\n <path class="vertex-remove" data-index="<%= index %>" transform="scale(.8) translate(9.5, -37)" d="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z">\n <title>Remove vertex.</title>\n </path>\n </g>\n ')}function r(){return t.sanitize('\n <g class="arrowhead-group arrowhead-group-<%= end %>">\n <path class="arrowhead" data-terminal="<%= end %>" d="M 26 0 L 0 13 L 26 26 z" />\n </g>\n ')}t.getEdgeMarkup=e,t.getEdgeToolMarkup=n,t.getEdgeVertexMarkup=i,t.getEdgeArrowheadMarkup=r}(iA||(iA={})),function(t){function e(t=!1){return{tagName:"foreignObject",selector:"fo",children:[{ns:h.ns.xhtml,tagName:"body",selector:"foBody",attrs:{xmlns:h.ns.xhtml},style:{width:"100%",height:"100%",background:"transparent"},children:t?[]:[{tagName:"div",selector:"foContent",style:{width:"100%",height:"100%"}}]}]}}t.getForeignObjectMarkup=e}(iA||(iA={}));class sA{constructor(t){this.view=t}get cell(){return this.view.cell}getDefinition(t){return this.cell.getAttrDefinition(t)}processAttrs(t,e){let n,i,r,o,l;const c=[];return Object.keys(e).forEach(i=>{const r=e[i],o=this.getDefinition(i),l=a.call(vM.isValidDefinition,this.view,o,r,{elem:t,attrs:e,cell:this.cell,view:this.view});if(o&&l)"string"===typeof o?(null==n&&(n={}),n[o]=r):null!==r&&c.push({name:i,definition:o});else{null==n&&(n={});const t=h.CASE_SENSITIVE_ATTR.includes(i)?i:s.kebabCase(i);n[t]=r}}),c.forEach(({name:n,definition:s})=>{const a=e[n],c=s;"function"===typeof c.set&&(!h.isHTMLElement(t)&&sA.DELAY_ATTRS.includes(n)?(null==l&&(l={}),l[n]=a):(null==i&&(i={}),i[n]=a));const u=s;"function"===typeof u.offset&&(null==r&&(r={}),r[n]=a);const d=s;"function"===typeof d.position&&(null==o&&(o={}),o[n]=a)}),{raw:e,normal:n,set:i,offset:r,position:o,delay:l}}mergeProcessedAttrs(t,e){t.set=Object.assign(Object.assign({},t.set),e.set),t.position=Object.assign(Object.assign({},t.position),e.position),t.offset=Object.assign(Object.assign({},t.offset),e.offset);const n=t.normal&&t.normal.transform;null!=n&&e.normal&&(e.normal.transform=n),t.normal=e.normal}findAttrs(t,e,n,s){const o=[],a=new WE;return Object.keys(t).forEach(l=>{const h=t[l];if(!r.isPlainObject(h))return;const{isCSSSelector:c,elems:u}=qE.find(l,e,s);n[l]=u;for(let t=0,e=u.length;t<e;t+=1){const n=u[t],r=s&&s[l]===n,d=a.get(n);if(d){d.array||(o.push(n),d.array=!0,d.attrs=[d.attrs],d.priority=[d.priority]);const t=d.attrs,s=d.priority;if(r)t.unshift(h),s.unshift(-1);else{const n=i.sortedIndex(s,c?-1:e);t.splice(n,0,h),s.splice(n,0,e)}}else a.set(n,{elem:n,attrs:h,priority:r?-1:e,array:!1})}}),o.forEach(t=>{const e=a.get(t),n=e.attrs;e.attrs=n.reduceRight((t,e)=>r.merge(t,e),{})}),a}updateRelativeAttrs(t,e,n,i){const r=e.raw||{};let s=e.normal||{};const o=e.set,l=e.position,c=e.offset,u=e.delay,d=()=>({elem:t,cell:this.cell,view:this.view,attrs:r,refBBox:n.clone()});if(null!=o&&Object.keys(o).forEach(t=>{const e=o[t],n=this.getDefinition(t);if(null!=n){const i=a.call(n.set,this.view,e,d());"object"===typeof i?s=Object.assign(Object.assign({},s),i):null!=i&&(s[t]=i)}}),h.isHTMLElement(t))return void this.view.setAttrs(s,t);const g=s.transform,p=g?""+g:null,f=h.transformStringToMatrix(p),m=new ZC(f.e,f.f);g&&(delete s.transform,f.e=0,f.f=0);let b=1,y=1;if(l||c){const e=this.view.getScaleOfElement(t,i.scalableNode);b=e.sx,y=e.sy}let C=!1;null!=l&&Object.keys(l).forEach(t=>{const e=l[t],n=this.getDefinition(t);if(null!=n){const t=a.call(n.position,this.view,e,d());null!=t&&(C=!0,m.translate(ZC.create(t).scale(b,y)))}}),this.view.setAttrs(s,t);let v=!1;if(null!=c){const e=this.view.getBoundingRectOfElement(t);if(e.width>0&&e.height>0){const n=h.transformRectangle(e,f).scale(1/b,1/y);Object.keys(c).forEach(e=>{const i=c[e],s=this.getDefinition(e);if(null!=s){const e=a.call(s.offset,this.view,i,{elem:t,cell:this.cell,view:this.view,attrs:r,refBBox:n});null!=e&&(v=!0,m.translate(ZC.create(e).scale(b,y)))}})}}(null!=g||C||v)&&(m.round(1),f.e=m.x,f.f=m.y,t.setAttribute("transform",h.matrixToTransformString(f)));const w=()=>{null!=u&&Object.keys(u).forEach(e=>{const n=u[e],i=this.getDefinition(e);if(null!=i){const r=a.call(i.set,this.view,n,d());"object"===typeof r?this.view.setAttrs(r,t):null!=r&&this.view.setAttrs({[e]:r},t)}})};i.forceSync?w():$w.scheduleTask(w)}update(t,e,n){const i={},r=this.findAttrs(n.attrs||e,t,i,n.selectors),s=n.attrs?this.findAttrs(e,t,i,n.selectors):r,o=[];r.each(e=>{const r=e.elem,a=e.attrs,l=this.processAttrs(r,a);if(null==l.set&&null==l.position&&null==l.offset&&null==l.delay)this.view.setAttrs(l.normal,r);else{const e=s.get(r),h=e?e.attrs:null,c=h&&null==a.ref?h.ref:a.ref;let u;if(c){if(u=(i[c]||this.view.find(c,t,n.selectors))[0],!u)throw new Error(`"${c}" reference does not exist.`)}else u=null;const d={node:r,refNode:u,attributes:h,processedAttributes:l},g=o.findIndex(t=>t.refNode===r);g>-1?o.splice(g,0,d):o.push(d)}});const a=new WE;let l;o.forEach(e=>{const i=e.node,r=e.refNode;let s;const c=null!=r&&null!=n.rotatableNode&&h.contains(n.rotatableNode,r);if(r&&(s=a.get(r)),!s){const e=c?n.rotatableNode:t;s=r?h.getBBox(r,{target:e}):n.rootBBox,r&&a.set(r,s)}let u;n.attrs&&e.attributes?(u=this.processAttrs(i,e.attributes),this.mergeProcessedAttrs(u,e.processedAttributes)):u=e.processedAttributes;let d=s;c&&null!=n.rotatableNode&&!n.rotatableNode.contains(i)&&(l||(l=h.transformStringToMatrix(h.attr(n.rotatableNode,"transform"))),d=h.transformRectangle(s,l));const g=o.find(t=>t.refNode===i);g&&(n.forceSync=!0),this.updateRelativeAttrs(i,u,d,n)})}}(function(t){t.DELAY_ATTRS=["text","textWrap","sourceMarker","targetMarker"]})(sA||(sA={}));class oA{constructor(t,e,n=[]){this.view=t;const i={},r={};let s=0;Object.keys(e).forEach(t=>{let n=e[t];Array.isArray(n)||(n=[n]),n.forEach(e=>{let n=i[e];n||(s+=1,n=i[e]=1<<s),r[t]|=n})});let o=n;if(Array.isArray(o)||(o=[o]),o.forEach(t=>{i[t]||(s+=1,i[t]=1<<s)}),s>25)throw new Error("Maximum number of flags exceeded.");this.flags=i,this.attrs=r,this.bootstrap=n}get cell(){return this.view.cell}getFlag(t){const e=this.flags;return null==e?0:Array.isArray(t)?t.reduce((t,n)=>t|e[n],0):0|e[t]}hasAction(t,e){return t&this.getFlag(e)}removeAction(t,e){return t^t&this.getFlag(e)}getBootstrapFlag(){return this.getFlag(this.bootstrap)}getChangedFlag(){let t=0;return this.attrs?(Object.keys(this.attrs).forEach(e=>{this.cell.hasChanged(e)&&(t|=this.attrs[e])}),t):t}}var aA=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class lA extends qE{constructor(t,e={}){super(),this.cell=t,this.options=this.ensureOptions(e),this.graph=this.options.graph,this.attr=new sA(this),this.flag=new oA(this,this.options.actions,this.options.bootstrap),this.cache=new rA(this),this.setContainer(this.ensureContainer()),this.setup(),this.$(this.container).data("view",this),this.init()}static getDefaults(){return this.defaults}static config(t){this.defaults=this.getOptions(t)}static getOptions(t){const e=(t,e)=>null!=e?i.uniq([...Array.isArray(t)?t:[t],...Array.isArray(e)?e:[e]]):Array.isArray(t)?[...t]:[t],n=r.cloneDeep(this.getDefaults()),{bootstrap:s,actions:o,events:a,documentEvents:l}=t,h=aA(t,["bootstrap","actions","events","documentEvents"]);return s&&(n.bootstrap=e(n.bootstrap,s)),o&&Object.keys(o).forEach(t=>{const i=o[t],r=n.actions[t];i&&r?n.actions[t]=e(r,i):i&&(n.actions[t]=e(i))}),a&&(n.events=Object.assign(Object.assign({},n.events),a)),t.documentEvents&&(n.documentEvents=Object.assign(Object.assign({},n.documentEvents),l)),r.merge(n,h)}get[Symbol.toStringTag](){return lA.toStringTag}init(){}onRemove(){this.removeTools()}get priority(){return this.options.priority}get rootSelector(){return this.options.rootSelector}getConstructor(){return this.constructor}ensureOptions(t){return this.getConstructor().getOptions(t)}getContainerTagName(){return this.options.isSvgElement?"g":"div"}getContainerStyle(){}getContainerAttrs(){return{"data-cell-id":this.cell.id,"data-shape":this.cell.shape}}getContainerClassName(){return this.prefixClassName("cell")}ensureContainer(){return qE.createElement(this.getContainerTagName(),this.options.isSvgElement)}setContainer(t){if(this.container!==t){this.undelegateEvents(),this.container=t,null!=this.options.events&&this.delegateEvents(this.options.events);const e=this.getContainerAttrs();null!=e&&this.setAttrs(e,t);const n=this.getContainerStyle();null!=n&&this.setStyle(n,t);const i=this.getContainerClassName();null!=i&&this.addClass(i,t)}return this}isNodeView(){return!1}isEdgeView(){return!1}render(){return this}confirmUpdate(t,e={}){return 0}getBootstrapFlag(){return this.flag.getBootstrapFlag()}getFlag(t){return this.flag.getFlag(t)}hasAction(t,e){return this.flag.hasAction(t,e)}removeAction(t,e){return this.flag.removeAction(t,e)}handleAction(t,e,n,i){if(this.hasAction(t,e)){n();const r=[e];return i&&("string"===typeof i?r.push(i):r.push(...i)),this.removeAction(t,r)}return t}setup(){this.cell.on("changed",({options:t})=>this.onAttrsChange(t))}onAttrsChange(t){let e=this.flag.getChangedFlag();!t.updated&&e&&(t.dirty&&this.hasAction(e,"update")&&(e|=this.getFlag("render")),t.toolId&&(t.async=!1),null!=this.graph&&this.graph.renderer.requestViewUpdate(this,e,this.priority,t))}parseJSONMarkup(t,e){const n=iA.parseJSONMarkup(t),i=n.selectors,r=this.rootSelector;if(e&&r){if(i[r])throw new Error("Invalid root selector");i[r]=e}return n}can(t){let e=this.graph.options.interacting;if("function"===typeof e&&(e=a.call(e,this.graph,this)),"object"===typeof e){let n=e[t];return"function"===typeof n&&(n=a.call(n,this.graph,this)),!1!==n}return"boolean"===typeof e&&e}cleanCache(){return this.cache.clean(),this}getCache(t){return this.cache.get(t)}getDataOfElement(t){return this.cache.getData(t)}getMatrixOfElement(t){return this.cache.getMatrix(t)}getShapeOfElement(t){return this.cache.getShape(t)}getScaleOfElement(t,e){let n,i;if(e&&e.contains(t)){const t=h.scale(e);n=1/t.sx,i=1/t.sy}else n=1,i=1;return{sx:n,sy:i}}getBoundingRectOfElement(t){return this.cache.getBoundingRect(t)}getBBoxOfElement(t){const e=this.getBoundingRectOfElement(t),n=this.getMatrixOfElement(t),i=this.getRootRotatedMatrix(),r=this.getRootTranslatedMatrix();return h.transformRectangle(e,r.multiply(i).multiply(n))}getUnrotatedBBoxOfElement(t){const e=this.getBoundingRectOfElement(t),n=this.getMatrixOfElement(t),i=this.getRootTranslatedMatrix();return h.transformRectangle(e,i.multiply(n))}getBBox(t={}){let e;if(t.useCellGeometry){const t=this.cell,n=t.isNode()?t.getAngle():0;e=t.getBBox().bbox(n)}else e=this.getBBoxOfElement(this.container);return this.graph.localToGraph(e)}getRootTranslatedMatrix(){const t=this.cell,e=t.isNode()?t.getPosition():{x:0,y:0};return h.createSVGMatrix().translate(e.x,e.y)}getRootRotatedMatrix(){let t=h.createSVGMatrix();const e=this.cell,n=e.isNode()?e.getAngle():0;if(n){const i=e.getBBox(),r=i.width/2,s=i.height/2;t=t.translate(r,s).rotate(n).translate(-r,-s)}return t}findMagnet(t=this.container){return this.findByAttr("magnet",t)}updateAttrs(t,e,n={}){null==n.rootBBox&&(n.rootBBox=new KC),null==n.selectors&&(n.selectors=this.selectors),this.attr.update(t,e,n)}isEdgeElement(t){return this.cell.isEdge()&&(null==t||t===this.container)}prepareHighlight(t,e={}){const n=t&&this.$(t)[0]||this.container;return e.partial=n===this.container,n}highlight(t,e={}){const n=this.prepareHighlight(t,e);return this.notify("cell:highlight",{magnet:n,options:e,view:this,cell:this.cell}),this.isEdgeView()?this.notify("edge:highlight",{magnet:n,options:e,view:this,edge:this.cell,cell:this.cell}):this.isNodeView()&&this.notify("node:highlight",{magnet:n,options:e,view:this,node:this.cell,cell:this.cell}),this}unhighlight(t,e={}){const n=this.prepareHighlight(t,e);return this.notify("cell:unhighlight",{magnet:n,options:e,view:this,cell:this.cell}),this.isNodeView()?this.notify("node:unhighlight",{magnet:n,options:e,view:this,node:this.cell,cell:this.cell}):this.isEdgeView()&&this.notify("edge:unhighlight",{magnet:n,options:e,view:this,edge:this.cell,cell:this.cell}),this}notifyUnhighlight(t,e){}getEdgeTerminal(t,e,n,i,r){const s=this.cell,o=this.findAttr("port",t),a=t.getAttribute("data-selector"),l={cell:s.id};return null!=a&&(l.magnet=a),null!=o?(l.port=o,s.isNode()&&(s.hasPort(o)||null!=a||(l.selector=this.getSelector(t)))):null==a&&this.container!==t&&(l.selector=this.getSelector(t)),this.customizeEdgeTerminal(l,t,e,n,i,r)}customizeEdgeTerminal(t,e,n,i,r,s){const o=r.getStrategy()||this.graph.options.connecting.strategy;if(o){const l="string"===typeof o?o:o.name,h="string"===typeof o?{}:o.args||{},c=nA.registry;if(l){const o=c.get(l);if(null==o)return c.onNotFound(l);const u=a.call(o,this.graph,t,this,e,new ZC(n,i),r,s,h);if(u)return u}}return t}getMagnetFromEdgeTerminal(t){const e=this.cell,n=this.container,i=t.port;let r,s=t.magnet;return null!=i&&e.isNode()&&e.hasPort(i)?r=this.findPortElem(i,s)||n:(s||(s=t.selector),s||null==i||(s=`[port="${i}"]`),r=this.findOne(s,n,this.selectors)),r}animate(t,e){const n="string"===typeof t?this.findOne(t):t;if(null==n)throw new Error("Invalid animation element.");const i=n.parentNode,r=()=>{i||h.remove(n)},s=Mv.create(n);i||s.appendTo(this.graph.view.stage);const o=e.complete;return e.complete=t=>{r(),o&&o(t)},s.animate(e)}animateTransform(t,e){const n="string"===typeof t?this.findOne(t):t;if(null==n)throw new Error("Invalid animation element.");const i=n.parentNode,r=()=>{i||h.remove(n)},s=Mv.create(n);i||s.appendTo(this.graph.view.stage);const o=e.complete;return e.complete=t=>{r(),o&&o(t)},s.animateTransform(e)}hasTools(t){const e=this.tools;return null!=e&&(null==t||e.name===t)}addTools(t){if(!this.can("toolsAddable"))return this;if(this.removeTools(),t){const e=hA.isToolsView(t)?t:new hA(t);this.tools=e,this.graph.on("tools:hide",this.hideTools,this),this.graph.on("tools:show",this.showTools,this),this.graph.on("tools:remove",this.removeTools,this),e.config({view:this}),e.mount()}return this}updateTools(t={}){return this.tools&&this.tools.update(t),this}removeTools(){return this.tools&&(this.tools.remove(),this.graph.off("tools:hide",this.hideTools,this),this.graph.off("tools:show",this.showTools,this),this.graph.off("tools:remove",this.removeTools,this),this.tools=null),this}hideTools(){return this.tools&&this.tools.hide(),this}showTools(){return this.tools&&this.tools.show(),this}renderTools(){const t=this.cell.getTools();return this.addTools(t),this}notify(t,e){return this.trigger(t,e),this.graph.trigger(t,e),this}getEventArgs(t,e,n){const i=this,r=i.cell;return null==e||null==n?{e:t,view:i,cell:r}:{e:t,x:e,y:n,view:i,cell:r}}onClick(t,e,n){this.notify("cell:click",this.getEventArgs(t,e,n))}onDblClick(t,e,n){this.notify("cell:dblclick",this.getEventArgs(t,e,n))}onContextMenu(t,e,n){this.notify("cell:contextmenu",this.getEventArgs(t,e,n))}onMouseDown(t,e,n){this.cell.model&&(this.cachedModelForMouseEvent=this.cell.model,this.cachedModelForMouseEvent.startBatch("mouse")),this.notify("cell:mousedown",this.getEventArgs(t,e,n))}onMouseUp(t,e,n){this.notify("cell:mouseup",this.getEventArgs(t,e,n)),this.cachedModelForMouseEvent&&(this.cachedModelForMouseEvent.stopBatch("mouse",{cell:this.cell}),this.cachedModelForMouseEvent=null)}onMouseMove(t,e,n){this.notify("cell:mousemove",this.getEventArgs(t,e,n))}onMouseOver(t){this.notify("cell:mouseover",this.getEventArgs(t))}onMouseOut(t){this.notify("cell:mouseout",this.getEventArgs(t))}onMouseEnter(t){this.notify("cell:mouseenter",this.getEventArgs(t))}onMouseLeave(t){this.notify("cell:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,i){this.notify("cell:mousewheel",Object.assign({delta:i},this.getEventArgs(t,e,n)))}onCustomEvent(t,e,n,i){this.notify("cell:customevent",Object.assign({name:e},this.getEventArgs(t,n,i))),this.notify(e,Object.assign({},this.getEventArgs(t,n,i)))}onMagnetMouseDown(t,e,n,i){}onMagnetDblClick(t,e,n,i){}onMagnetContextMenu(t,e,n,i){}onLabelMouseDown(t,e,n){}checkMouseleave(t){const e=this.graph;e.renderer.isAsync()&&e.renderer.dumpView(this);const n=this.getEventTarget(t,{fromPoint:!0}),i=e.renderer.findViewByElem(n);i!==this&&(this.onMouseLeave(t),i&&i.onMouseEnter(t))}}lA.defaults={isSvgElement:!0,rootSelector:"root",priority:0,bootstrap:[],actions:{}},function(t){t.Flag=oA,t.Attr=sA}(lA||(lA={})),function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.isNodeView&&"function"===typeof i.isEdgeView&&"function"===typeof i.confirmUpdate}t.toStringTag="X6."+t.name,t.isCellView=e}(lA||(lA={})),function(t){function e(t){return function(e){e.config({priority:t})}}function n(t){return function(e){e.config({bootstrap:t})}}t.priority=e,t.bootstrap=n}(lA||(lA={})),function(t){t.registry=Gw.create({type:"view"})}(lA||(lA={}));class hA extends qE{constructor(t={}){super(),this.svgContainer=this.createContainer(!0,t),this.htmlContainer=this.createContainer(!1,t),this.config(t)}get name(){return this.options.name}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get[Symbol.toStringTag](){return hA.toStringTag}createContainer(t,e){const n=t?qE.createElement("g",!0):qE.createElement("div",!1);return h.addClass(n,this.prefixClassName("cell-tools")),e.className&&h.addClass(n,e.className),n}config(t){if(this.options=Object.assign(Object.assign({},this.options),t),!lA.isCellView(t.view)||t.view===this.cellView)return this;this.cellView=t.view,this.cell.isEdge()?(h.addClass(this.svgContainer,this.prefixClassName("edge-tools")),h.addClass(this.htmlContainer,this.prefixClassName("edge-tools"))):this.cell.isNode()&&(h.addClass(this.svgContainer,this.prefixClassName("node-tools")),h.addClass(this.htmlContainer,this.prefixClassName("node-tools"))),this.svgContainer.setAttribute("data-cell-id",this.cell.id),this.htmlContainer.setAttribute("data-cell-id",this.cell.id),this.name&&(this.svgContainer.setAttribute("data-tools-name",this.name),this.htmlContainer.setAttribute("data-tools-name",this.name));const e=this.options.items;if(!Array.isArray(e))return this;this.tools=[];const n=[];e.forEach(t=>{if(hA.ToolItem.isToolItem(t))"vertices"===t.name?n.unshift(t):n.push(t);else{const e="object"===typeof t?t.name:t;"vertices"===e?n.unshift(t):n.push(t)}});for(let i=0;i<n.length;i+=1){const t=n[i];let e;if(hA.ToolItem.isToolItem(t))e=t;else{const n="object"===typeof t?t.name:t,i="object"===typeof t&&t.args||{};if(n)if(this.cell.isNode()){const t=AA.registry.get(n);if(!t)return AA.registry.onNotFound(n);e=new t(i)}else if(this.cell.isEdge()){const t=SA.registry.get(n);if(!t)return SA.registry.onNotFound(n);e=new t(i)}}if(e){e.config(this.cellView,this),e.render();const t=!1!==e.options.isSVGElement?this.svgContainer:this.htmlContainer;t.appendChild(e.container),this.tools.push(e)}}return this}update(t={}){const e=this.tools;return e&&e.forEach(e=>{t.toolId!==e.cid&&e.isVisible()&&e.update()}),this}focus(t){const e=this.tools;return e&&e.forEach(e=>{t===e?e.show():e.hide()}),this}blur(t){const e=this.tools;return e&&e.forEach(e=>{e===t||e.isVisible()||(e.show(),e.update())}),this}hide(){return this.focus(null)}show(){return this.blur(null)}remove(){const t=this.tools;return t&&(t.forEach(t=>t.remove()),this.tools=null),h.remove(this.svgContainer),h.remove(this.htmlContainer),super.remove()}mount(){const t=this.tools,e=this.cellView;if(e&&t){const n=t.some(t=>!1!==t.options.isSVGElement),i=t.some(t=>!1===t.options.isSVGElement);if(n){const t=this.options.local?e.container:e.graph.view.decorator;t.appendChild(this.svgContainer)}i&&this.graph.container.appendChild(this.htmlContainer)}return this}}function cA(t,e,n,i){const r=a.call(nA.presets.pinRelative,this.graph,{},e,n,t,this.cell,i,{});return r.anchor}function uA(t,e){return e?t.cell.getBBox():t.cell.isEdge()?t.getConnection().bbox():t.getUnrotatedBBoxOfElement(t.container)}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&null!=i.graph&&null!=i.cell&&"function"===typeof i.config&&"function"===typeof i.update&&"function"===typeof i.focus&&"function"===typeof i.blur&&"function"===typeof i.show&&"function"===typeof i.hide}t.toStringTag="X6."+t.name,t.isToolsView=e})(hA||(hA={})),function(t){class e extends qE{constructor(t={}){super(),this.visible=!0,this.options=this.getOptions(t),this.container=qE.createElement(this.options.tagName||"g",!1!==this.options.isSVGElement),h.addClass(this.container,this.prefixClassName("cell-tool")),"string"===typeof this.options.className&&h.addClass(this.container,this.options.className),this.init()}static getDefaults(){return this.defaults}static config(t){this.defaults=this.getOptions(t)}static getOptions(t){return r.merge(r.cloneDeep(this.getDefaults()),t)}get graph(){return this.cellView.graph}get cell(){return this.cellView.cell}get name(){return this.options.name}get[Symbol.toStringTag](){return e.toStringTag}init(){}getOptions(t){const e=this.constructor;return e.getOptions(t)}delegateEvents(){return this.options.events&&super.delegateEvents(this.options.events),this}config(t,e){return this.cellView=t,this.parent=e,this.stamp(this.container),this.cell.isEdge()?h.addClass(this.container,this.prefixClassName("edge-tool")):this.cell.isNode()&&h.addClass(this.container,this.prefixClassName("node-tool")),this.name&&this.container.setAttribute("data-tool-name",this.name),this.delegateEvents(),this}render(){this.empty();const t=this.options.markup;if(t){const e=iA.isStringMarkup(t)?iA.parseStringMarkup(t):iA.parseJSONMarkup(t);this.container.appendChild(e.fragment),this.childNodes=e.selectors}return this.onRender(),this}onRender(){}update(){return this}stamp(t){t&&t.setAttribute("data-cell-id",this.cellView.cell.id)}show(){return this.container.style.display="",this.visible=!0,this}hide(){return this.container.style.display="none",this.visible=!1,this}isVisible(){return!!this.visible}focus(){const t=this.options.focusOpacity;return null!=t&&Number.isFinite(t)&&(this.container.style.opacity=""+t),this.parent.focus(this),this}blur(){return this.container.style.opacity="",this.parent.blur(this),this}guard(t){return null==this.graph||null==this.cellView||this.graph.view.guard(t,this.cellView)}}e.defaults={isSVGElement:!0,tagName:"g"},t.ToolItem=e,function(t){let e=0;function n(t){return t?s.pascalCase(t):(e+=1,"CustomTool"+e)}function i(t){const e=r.createClass(n(t.name),this);return e.config(t),e}t.define=i}(e=t.ToolItem||(t.ToolItem={})),function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&null!=i.graph&&null!=i.cell&&"function"===typeof i.config&&"function"===typeof i.update&&"function"===typeof i.focus&&"function"===typeof i.blur&&"function"===typeof i.show&&"function"===typeof i.hide&&"function"===typeof i.isVisible}t.toStringTag="X6."+t.name,t.isToolItem=e}(e=t.ToolItem||(t.ToolItem={}))}(hA||(hA={}));class dA extends hA.ToolItem{onRender(){h.addClass(this.container,this.prefixClassName("cell-tool-button")),this.update()}update(){return this.updatePosition(),this}updatePosition(){const t=this.cellView,e=t.cell.isEdge()?this.getEdgeMatrix():this.getNodeMatrix();h.transform(this.container,e,{absolute:!0})}getNodeMatrix(){const t=this.cellView,e=this.options;let{x:n=0,y:i=0}=e;const{offset:r,useCellGeometry:s,rotate:a}=e;let l=uA(t,s);const c=t.cell.getAngle();a||(l=l.bbox(c));let u=0,d=0;"number"===typeof r?(u=r,d=r):"object"===typeof r&&(u=r.x,d=r.y),n=o.normalizePercentage(n,l.width),i=o.normalizePercentage(i,l.height);let g=h.createSVGMatrix().translate(l.x+l.width/2,l.y+l.height/2);return a&&(g=g.rotate(c)),g=g.translate(n+u-l.width/2,i+d-l.height/2),g}getEdgeMatrix(){const t=this.cellView,e=this.options,{offset:n=0,distance:i=0,rotate:r}=e;let s,a,l;const c=o.normalizePercentage(i,1);s=c>=0&&c<=1?t.getTangentAtRatio(c):t.getTangentAtLength(c),s?(a=s.start,l=s.vector().vectorAngle(new ZC(1,0))||0):(a=t.getConnection().start,l=0);let u=h.createSVGMatrix().translate(a.x,a.y).rotate(l);return u="object"===typeof n?u.translate(n.x||0,n.y||0):u.translate(0,n),r||(u=u.rotate(-l)),u}onMouseDown(t){if(this.guard(t))return;t.stopPropagation(),t.preventDefault();const e=this.options.onClick;"function"===typeof e&&a.call(e,this.cellView,{e:t,view:this.cellView,cell:this.cellView.cell,btn:this})}}(function(t){t.config({name:"button",events:{mousedown:"onMouseDown",touchstart:"onMouseDown"}})})(dA||(dA={})),function(t){t.Remove=t.define({name:"button-remove",markup:[{tagName:"circle",selector:"button",attrs:{r:7,fill:"#FF1D00",cursor:"pointer"}},{tagName:"path",selector:"icon",attrs:{d:"M -3 -3 3 3 M -3 3 3 -3",fill:"none",stroke:"#FFFFFF","stroke-width":2,"pointer-events":"none"}}],distance:60,offset:0,onClick({view:t,btn:e}){e.parent.remove(),t.cell.remove({ui:!0,toolId:e.cid})}})}(dA||(dA={}));var gA=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class pA extends hA.ToolItem{onRender(){if(h.addClass(this.container,this.prefixClassName("cell-tool-boundary")),this.options.attrs){const t=this.options.attrs,{class:e}=t,n=gA(t,["class"]);h.attr(this.container,h.kebablizeAttrs(n)),e&&h.addClass(this.container,e)}this.update()}update(){const t=this.cellView,e=this.options,{useCellGeometry:n,rotate:i}=e,r=o.normalizeSides(e.padding);let s=uA(t,n).moveAndExpand({x:-r.left,y:-r.top,width:r.left+r.right,height:r.top+r.bottom});const a=t.cell;if(a.isNode()){const t=a.getAngle();if(t)if(i){const e=a.getBBox().getCenter();h.rotate(this.container,t,e.x,e.y,{absolute:!0})}else s=s.bbox(t)}return h.attr(this.container,s.toJSON()),this}}(function(t){t.config({name:"boundary",tagName:"rect",padding:10,attrs:{fill:"none",stroke:"#333","stroke-width":.5,"stroke-dasharray":"5, 5","pointer-events":"none"}})})(pA||(pA={}));class fA extends hA.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}onRender(){return this.addClass(this.prefixClassName("edge-tool-vertices")),this.options.addable&&this.updatePath(),this.resetHandles(),this.renderHandles(),this}update(){const t=this.vertices;return t.length===this.handles.length?this.updateHandles():(this.resetHandles(),this.renderHandles()),this.options.addable&&this.updatePath(),this}resetHandles(){const t=this.handles;this.handles=[],t&&t.forEach(t=>{this.stopHandleListening(t),t.remove()})}renderHandles(){const t=this.vertices;for(let e=0,n=t.length;e<n;e+=1){const n=t[e],i=this.options.createHandle,r=this.options.processHandle,s=i({index:e,graph:this.graph,guard:t=>this.guard(t),attrs:this.options.attrs||{}});r&&r(s),this.graph.hook.onToolItemCreated({name:"vertices",cell:this.cell,view:this.cellView,tool:s}),s.updatePosition(n.x,n.y),this.stamp(s.container),this.container.appendChild(s.container),this.handles.push(s),this.startHandleListening(s)}}updateHandles(){const t=this.vertices;for(let e=0,n=t.length;e<n;e+=1){const n=t[e],i=this.handles[e];i&&i.updatePosition(n.x,n.y)}}updatePath(){const t=this.childNodes.connection;t&&t.setAttribute("d",this.cellView.getConnectionPathData())}startHandleListening(t){const e=this.cellView;e.can("vertexMovable")&&(t.on("change",this.onHandleChange,this),t.on("changing",this.onHandleChanging,this),t.on("changed",this.onHandleChanged,this)),e.can("vertexDeletable")&&t.on("remove",this.onHandleRemove,this)}stopHandleListening(t){const e=this.cellView;e.can("vertexMovable")&&(t.off("change",this.onHandleChange,this),t.off("changing",this.onHandleChanging,this),t.off("changed",this.onHandleChanged,this)),e.can("vertexDeletable")&&t.off("remove",this.onHandleRemove,this)}getNeighborPoints(t){const e=this.cellView,n=this.vertices,i=t>0?n[t-1]:e.sourceAnchor,r=t<n.length-1?n[t+1]:e.targetAnchor;return{prev:ZC.create(i),next:ZC.create(r)}}getMouseEventArgs(t){const e=this.normalizeEvent(t),{x:n,y:i}=this.graph.snapToGrid(e.clientX,e.clientY);return{e:e,x:n,y:i}}onHandleChange({e:t}){this.focus();const e=this.cellView;if(e.cell.startBatch("move-vertex",{ui:!0,toolId:this.cid}),!this.options.stopPropagation){const{e:n,x:i,y:r}=this.getMouseEventArgs(t);e.notifyMouseDown(n,i,r)}}onHandleChanging({handle:t,e:e}){const n=this.cellView,i=t.options.index,{e:r,x:s,y:o}=this.getMouseEventArgs(e),a={x:s,y:o};this.snapVertex(a,i),n.cell.setVertexAt(i,a,{ui:!0,toolId:this.cid}),t.updatePosition(a.x,a.y),this.options.stopPropagation||n.notifyMouseMove(r,s,o)}onHandleChanged({e:t}){const e=this.options,n=this.cellView;if(e.addable&&this.updatePath(),!e.removeRedundancies)return;const i=n.removeRedundantLinearVertices({ui:!0,toolId:this.cid});i&&this.render(),this.blur(),n.cell.stopBatch("move-vertex",{ui:!0,toolId:this.cid}),this.eventData(t).vertexAdded&&n.cell.stopBatch("add-vertex",{ui:!0,toolId:this.cid});const{e:r,x:s,y:o}=this.getMouseEventArgs(t);this.options.stopPropagation||n.notifyMouseUp(r,s,o),n.checkMouseleave(r),e.onChanged&&e.onChanged({edge:n.cell,edgeView:n})}snapVertex(t,e){const n=this.options.snapRadius||0;if(n>0){const i=this.getNeighborPoints(e),r=i.prev,s=i.next;Math.abs(t.x-r.x)<n?t.x=r.x:Math.abs(t.x-s.x)<n&&(t.x=s.x),Math.abs(t.y-r.y)<n?t.y=i.prev.y:Math.abs(t.y-s.y)<n&&(t.y=s.y)}}onHandleRemove({handle:t,e:e}){if(this.options.removable){const n=t.options.index,i=this.cellView;i.cell.removeVertexAt(n,{ui:!0}),this.options.addable&&this.updatePath(),i.checkMouseleave(this.normalizeEvent(e))}}onPathMouseDown(t){const e=this.cellView;if(this.guard(t)||!this.options.addable||!e.can("vertexAddable"))return;t.stopPropagation(),t.preventDefault();const n=this.normalizeEvent(t),i=this.graph.snapToGrid(n.clientX,n.clientY).toJSON();e.cell.startBatch("add-vertex",{ui:!0,toolId:this.cid});const r=e.getVertexIndex(i.x,i.y);this.snapVertex(i,r),e.cell.insertVertex(i,r,{ui:!0,toolId:this.cid}),this.render();const s=this.handles[r];this.eventData(n,{vertexAdded:!0}),s.onMouseDown(n)}onRemove(){this.resetHandles()}}(function(t){class e extends qE{constructor(t){super(),this.options=t,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDoubleClick"})}get graph(){return this.options.graph}render(){this.container=qE.createElement("circle",!0);const e=this.options.attrs;if("function"===typeof e){const n=t.getDefaults();this.setAttrs(Object.assign(Object.assign({},n.attrs),e(this)))}else this.setAttrs(e);this.addClass(this.prefixClassName("edge-tool-vertex"))}updatePosition(t,e){this.setAttrs({cx:t,cy:e})}onMouseDown(t){this.options.guard(t)||(t.stopPropagation(),t.preventDefault(),this.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},t.data),this.emit("change",{e:t,handle:this}))}onMouseMove(t){this.emit("changing",{e:t,handle:this})}onMouseUp(t){this.emit("changed",{e:t,handle:this}),this.undelegateDocumentEvents(),this.graph.view.delegateEvents()}onDoubleClick(t){this.emit("remove",{e:t,handle:this})}}t.Handle=e})(fA||(fA={})),function(t){const e=WM.prefix("edge-tool-vertex-path");t.config({name:"vertices",snapRadius:20,addable:!0,removable:!0,removeRedundancies:!0,stopPropagation:!0,attrs:{r:6,fill:"#333",stroke:"#fff",cursor:"move","stroke-width":2},createHandle:e=>new t.Handle(e),markup:[{tagName:"path",selector:"connection",className:e,attrs:{fill:"none",stroke:"transparent","stroke-width":10,cursor:"pointer"}}],events:{["mousedown ."+e]:"onPathMouseDown",["touchstart ."+e]:"onPathMouseDown"}})}(fA||(fA={}));class mA extends hA.ToolItem{constructor(){super(...arguments),this.handles=[]}get vertices(){return this.cellView.cell.getVertices()}update(){return this.render(),this}onRender(){h.addClass(this.container,this.prefixClassName("edge-tool-segments")),this.resetHandles();const t=this.cellView,e=[...this.vertices];!0===this.options.addRoutePoint&&0===e.length&&e.push(...t.routePoints),e.unshift(t.sourcePoint),e.push(t.targetPoint);for(let n=0,i=e.length;n<i-1;n+=1){const t=e[n],i=e[n+1],r=this.renderHandle(t,i,n);this.stamp(r.container),this.handles.push(r)}return this}renderHandle(t,e,n){const i=this.options.createHandle({index:n,graph:this.graph,guard:t=>this.guard(t),attrs:this.options.attrs||{}});return this.options.processHandle&&this.options.processHandle(i),this.graph.hook.onToolItemCreated({name:"segments",cell:this.cell,view:this.cellView,tool:i}),this.updateHandle(i,t,e),this.container.appendChild(i.container),this.startHandleListening(i),i}startHandleListening(t){t.on("change",this.onHandleChange,this),t.on("changing",this.onHandleChanging,this),t.on("changed",this.onHandleChanged,this)}stopHandleListening(t){t.off("change",this.onHandleChange,this),t.off("changing",this.onHandleChanging,this),t.off("changed",this.onHandleChanged,this)}resetHandles(){const t=this.handles;this.handles=[],t&&t.forEach(t=>{this.stopHandleListening(t),t.remove()})}shiftHandleIndexes(t){const e=this.handles;for(let n=0,i=e.length;n<i;n+=1)e[n].options.index+=t}resetAnchor(t,e){const n=this.cellView.cell,i={ui:!0,toolId:this.cid};e?n.prop([t,"anchor"],e,i):n.removeProp([t,"anchor"],i)}snapHandle(t,e,n){const i=t.options.axis,r=t.options.index,s=this.cellView,o=s.cell,a=o.getVertices(),l=a[r-2]||n.sourceAnchor,h=a[r+1]||n.targetAnchor,c=this.options.snapRadius;return Math.abs(e[i]-l[i])<c?e[i]=l[i]:Math.abs(e[i]-h[i])<c&&(e[i]=h[i]),e}onHandleChanging({handle:t,e:e}){const n=this.graph,i=this.options,s=this.cellView,o=i.anchor,l=t.options.axis,h=t.options.index-1,c=this.getEventData(e),u=this.normalizeEvent(e),d=n.snapToGrid(u.clientX,u.clientY),g=this.snapHandle(t,d.clone(),c),p=r.cloneDeep(this.vertices);let f=p[h],m=p[h+1];const b=s.sourceView,y=s.sourceBBox;let C=!1,v=!1;if(f?0===h?y.containsPoint(f)?(p.shift(),this.shiftHandleIndexes(-1),C=!0):(f[l]=g[l],v=!0):f[l]=g[l]:(f=s.sourceAnchor.toJSON(),f[l]=g[l],y.containsPoint(f)?C=!0:(p.unshift(f),this.shiftHandleIndexes(1),v=!0)),"function"===typeof o&&b){if(C){const t=c.sourceAnchor.clone();t[l]=g[l];const e=a.call(o,s,t,b,s.sourceMagnet||b.container,"source",s,this);this.resetAnchor("source",e)}v&&this.resetAnchor("source",c.sourceAnchorDef)}const w=s.targetView,x=s.targetBBox;let M=!1,E=!1;if(m?h===p.length-2?x.containsPoint(m)?(p.pop(),M=!0):(m[l]=g[l],E=!0):m[l]=g[l]:(m=s.targetAnchor.toJSON(),m[l]=g[l],x.containsPoint(m)?M=!0:(p.push(m),E=!0)),"function"===typeof o&&w){if(M){const t=c.targetAnchor.clone();t[l]=g[l];const e=a.call(o,s,t,w,s.targetMagnet||w.container,"target",s,this);this.resetAnchor("target",e)}E&&this.resetAnchor("target",c.targetAnchorDef)}ZC.equalPoints(p,this.vertices)||this.cellView.cell.setVertices(p,{ui:!0,toolId:this.cid}),this.updateHandle(t,f,m,0),i.stopPropagation||s.notifyMouseMove(u,d.x,d.y)}onHandleChange({handle:t,e:e}){const n=this.options,i=this.handles,s=this.cellView,o=t.options.index;if(Array.isArray(i)){for(let t=0,e=i.length;t<e;t+=1)t!==o&&i[t].hide();if(this.focus(),this.setEventData(e,{sourceAnchor:s.sourceAnchor.clone(),targetAnchor:s.targetAnchor.clone(),sourceAnchorDef:r.cloneDeep(this.cell.prop(["source","anchor"])),targetAnchorDef:r.cloneDeep(this.cell.prop(["target","anchor"]))}),this.cell.startBatch("move-segment",{ui:!0,toolId:this.cid}),!n.stopPropagation){const t=this.normalizeEvent(e),n=this.graph.snapToGrid(t.clientX,t.clientY);s.notifyMouseDown(t,n.x,n.y)}}}onHandleChanged({e:t}){const e=this.options,n=this.cellView;e.removeRedundancies&&n.removeRedundantLinearVertices({ui:!0,toolId:this.cid});const i=this.normalizeEvent(t),r=this.graph.snapToGrid(i.clientX,i.clientY);this.render(),this.blur(),this.cell.stopBatch("move-segment",{ui:!0,toolId:this.cid}),e.stopPropagation||n.notifyMouseUp(i,r.x,r.y),n.checkMouseleave(i),e.onChanged&&e.onChanged({edge:n.cell,edgeView:n})}updateHandle(t,e,n,i=0){const r=this.options.precision||0,s=Math.abs(e.x-n.x)<r,o=Math.abs(e.y-n.y)<r;if(s||o){const r=new QC(e,n),o=r.length();if(o<this.options.threshold)t.hide();else{const e=r.getCenter(),n=s?"x":"y";e[n]+=i||0;const o=r.vector().vectorAngle(new ZC(1,0));t.updatePosition(e.x,e.y,o,this.cellView),t.show(),t.options.axis=n}}else t.hide()}onRemove(){this.resetHandles()}}(function(t){class e extends qE{constructor(t){super(),this.options=t,this.render(),this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"})}render(){this.container=qE.createElement("rect",!0);const e=this.options.attrs;if("function"===typeof e){const n=t.getDefaults();this.setAttrs(Object.assign(Object.assign({},n.attrs),e(this)))}else this.setAttrs(e);this.addClass(this.prefixClassName("edge-tool-segment"))}updatePosition(t,e,n,i){const r=i.getClosestPoint(new ZC(t,e))||new ZC(t,e);let s=h.createSVGMatrix().translate(r.x,r.y);if(r.equals({x:t,y:e}))s=s.rotate(n);else{const n=new QC(t,e,r.x,r.y);let i=n.vector().vectorAngle(new ZC(1,0));0!==i&&(i+=90),s=s.rotate(i)}this.setAttrs({transform:h.matrixToTransformString(s),cursor:n%180===0?"row-resize":"col-resize"})}onMouseDown(t){this.options.guard(t)||(this.trigger("change",{e:t,handle:this}),t.stopPropagation(),t.preventDefault(),this.options.graph.view.undelegateEvents(),this.delegateDocumentEvents({mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},t.data))}onMouseMove(t){this.emit("changing",{e:t,handle:this})}onMouseUp(t){this.emit("changed",{e:t,handle:this}),this.undelegateDocumentEvents(),this.options.graph.view.delegateEvents()}show(){this.container.style.display=""}hide(){this.container.style.display="none"}}t.Handle=e})(mA||(mA={})),function(t){t.config({name:"segments",precision:.5,threshold:40,snapRadius:10,stopPropagation:!0,removeRedundancies:!0,attrs:{width:20,height:8,x:-10,y:-4,rx:4,ry:4,fill:"#333",stroke:"#fff","stroke-width":2},createHandle:e=>new t.Handle(e),anchor:cA,addRoutePoint:!1})}(mA||(mA={}));class bA extends hA.ToolItem{get type(){return this.options.type}onRender(){h.addClass(this.container,this.prefixClassName(`edge-tool-${this.type}-anchor`)),this.toggleArea(!1),this.update()}update(){const t=this.type,e=this.cellView,n=e.getTerminalView(t);return n?(this.updateAnchor(),this.updateArea(),this.container.style.display=""):this.container.style.display="none",this}updateAnchor(){const t=this.childNodes;if(!t)return;const e=t.anchor;if(!e)return;const n=this.type,i=this.cellView,r=this.options,s=i.getTerminalAnchor(n),o=i.cell.prop([n,"anchor"]);e.setAttribute("transform",`translate(${s.x}, ${s.y})`);const a=o?r.customAnchorAttrs:r.defaultAnchorAttrs;a&&Object.keys(a).forEach(t=>{e.setAttribute(t,a[t])})}updateArea(){const t=this.childNodes;if(!t)return;const e=t.area;if(!e)return;const n=this.type,i=this.cellView,r=i.getTerminalView(n);if(r){const t=r.cell,s=i.getTerminalMagnet(n);let o,a,l,c=this.options.areaPadding||0;Number.isFinite(c)||(c=0),r.isEdgeElement(s)?(o=r.getBBox(),a=0,l=o.getCenter()):(o=r.getUnrotatedBBoxOfElement(s),a=t.getAngle(),l=o.getCenter(),a&&l.rotate(-a,t.getBBox().getCenter())),o.inflate(c),h.attr(e,{x:-o.width/2,y:-o.height/2,width:o.width,height:o.height,transform:`translate(${l.x}, ${l.y}) rotate(${a})`})}}toggleArea(t){if(this.childNodes){const e=this.childNodes.area;e&&(e.style.display=t?"":"none")}}onMouseDown(t){this.guard(t)||(t.stopPropagation(),t.preventDefault(),this.graph.view.undelegateEvents(),this.options.documentEvents&&this.delegateDocumentEvents(this.options.documentEvents),this.focus(),this.toggleArea(this.options.restrictArea),this.cell.startBatch("move-anchor",{ui:!0,toolId:this.cid}))}resetAnchor(t){const e=this.type,n=this.cell;t?n.prop([e,"anchor"],t,{rewrite:!0,ui:!0,toolId:this.cid}):n.removeProp([e,"anchor"],{ui:!0,toolId:this.cid})}onMouseMove(t){const e=this.type,n=this.cellView,i=n.getTerminalView(e);if(null==i)return;const r=this.normalizeEvent(t),s=i.cell,o=n.getTerminalMagnet(e);let l=this.graph.clientToLocal(r.clientX,r.clientY);const h=this.options.snap;if("function"===typeof h){const t=a.call(h,n,l,i,o,e,n,this);l=ZC.create(t)}if(this.options.restrictArea)if(i.isEdgeElement(o)){const t=i.getClosestPoint(l);t&&(l=t)}else{const t=i.getUnrotatedBBoxOfElement(o),e=s.getAngle(),n=s.getBBox().getCenter(),r=l.clone().rotate(e,n);t.containsPoint(r)||(l=t.getNearestPointToPoint(r).rotate(-e,n))}let c;const u=this.options.anchor;"function"===typeof u&&(c=a.call(u,n,l,i,o,e,n,this)),this.resetAnchor(c),this.update()}onMouseUp(t){this.graph.view.delegateEvents(),this.undelegateDocumentEvents(),this.blur(),this.toggleArea(!1);const e=this.cellView;this.options.removeRedundancies&&e.removeRedundantLinearVertices({ui:!0,toolId:this.cid}),this.cell.stopBatch("move-anchor",{ui:!0,toolId:this.cid})}onDblClick(){const t=this.options.resetAnchor;t&&this.resetAnchor(!0===t?void 0:t),this.update()}}(function(t){t.config({tagName:"g",markup:[{tagName:"circle",selector:"anchor",attrs:{cursor:"pointer"}},{tagName:"rect",selector:"area",attrs:{"pointer-events":"none",fill:"none",stroke:"#33334F","stroke-dasharray":"2,4",rx:5,ry:5}}],events:{mousedown:"onMouseDown",touchstart:"onMouseDown",dblclick:"onDblClick"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},customAnchorAttrs:{"stroke-width":4,stroke:"#33334F",fill:"#FFFFFF",r:5},defaultAnchorAttrs:{"stroke-width":2,stroke:"#FFFFFF",fill:"#33334F",r:6},areaPadding:6,snapRadius:10,resetAnchor:!0,restrictArea:!0,removeRedundancies:!0,anchor:cA,snap(t,e,n,i,r,s){const o=s.options.snapRadius||0,a="source"===i,l=a?0:-1,h=this.cell.getVertexAt(l)||this.getTerminalAnchor(a?"target":"source");return h&&(Math.abs(h.x-t.x)<o&&(t.x=h.x),Math.abs(h.y-t.y)<o&&(t.y=h.y)),t}})})(bA||(bA={}));const yA=bA.define({name:"source-anchor",type:"source"}),CA=bA.define({name:"target-anchor",type:"target"});var vA=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class wA extends hA.ToolItem{get type(){return this.options.type}get ratio(){return this.options.ratio}init(){if(this.options.attrs){const t=this.options.attrs,{class:e}=t,n=vA(t,["class"]);this.setAttrs(n,this.container),e&&h.addClass(this.container,e)}}onRender(){h.addClass(this.container,this.prefixClassName(`edge-tool-${this.type}-arrowhead`)),this.update()}update(){const t=this.ratio,e=this.cellView,n=e.getTangentAtRatio(t),i=n?n.start:e.getPointAtRatio(t),r=n&&n.vector().vectorAngle(new ZC(1,0))||0;if(!i)return this;const s=h.createSVGMatrix().translate(i.x,i.y).rotate(r);return h.transform(this.container,s,{absolute:!0}),this}onMouseDown(t){if(this.guard(t))return;t.stopPropagation(),t.preventDefault();const e=this.cellView;if(e.can("arrowheadMovable")){e.cell.startBatch("move-arrowhead",{ui:!0,toolId:this.cid});const n=this.graph.snapToGrid(t.clientX,t.clientY),i=e.prepareArrowheadDragging(this.type,{x:n.x,y:n.y,options:{toolId:this.cid}});this.cellView.setEventData(t,i),this.delegateDocumentEvents(this.options.documentEvents,t.data),e.graph.view.undelegateEvents(),this.container.style.pointerEvents="none"}this.focus()}onMouseMove(t){const e=this.normalizeEvent(t),n=this.graph.snapToGrid(e.clientX,e.clientY);this.cellView.onMouseMove(e,n.x,n.y),this.update()}onMouseUp(t){this.undelegateDocumentEvents();const e=this.normalizeEvent(t),n=this.cellView,i=this.graph.snapToGrid(e.clientX,e.clientY);n.onMouseUp(e,i.x,i.y),this.graph.view.delegateEvents(),this.blur(),this.container.style.pointerEvents="",n.cell.stopBatch("move-arrowhead",{ui:!0,toolId:this.cid})}}(function(t){t.config({tagName:"path",isSVGElement:!0,events:{mousedown:"onMouseDown",touchstart:"onMouseDown"},documentEvents:{mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}})})(wA||(wA={}));const xA=wA.define({name:"source-arrowhead",type:"source",ratio:0,attrs:{d:"M 10 -8 -10 0 10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}}),MA=wA.define({name:"target-arrowhead",type:"target",ratio:1,attrs:{d:"M -10 -8 10 0 -10 8 Z",fill:"#333",stroke:"#fff","stroke-width":2,cursor:"move"}});class EA extends hA.ToolItem{constructor(){super(...arguments),this.labelIndex=-1,this.distance=.5}render(){return this.createElement(),this.updateEditor(),this.autoFocus(),this.delegateDocumentEvents(this.options.documentEvents),this}createElement(){const{cell:t}=this,e=[this.prefixClassName((t.isEdge()?"edge":"node")+"-tool-editor"),this.prefixClassName("cell-tool-editor")];this.editor=hA.createElement("div",!1),this.addClass(e,this.editor),this.editor.contentEditable="true",this.container.appendChild(this.editor)}updateEditor(){const{graph:t,cell:e,editor:n}=this,i=n.style;let r=new ZC,s=20;if(e.isNode())r=e.getBBox().center,s=e.size().width-4;else if(e.isEdge()){const e=this.options.event,n=e.target,i=n.parentElement,o=i&&h.hasClass(i,this.prefixClassName("edge-label"));if(o){const t=i.getAttribute("data-index")||"0";this.labelIndex=parseInt(t,10);const e=i.getAttribute("transform"),{translation:o}=h.parseTransformString(e);r=new ZC(o.tx,o.ty),s=h.getBBox(n).width}else{if(!this.options.labelAddable)return this;r=t.clientToLocal(ZC.create(e.clientX,e.clientY));const n=this.cellView,i=n.path.closestPointLength(r);this.distance=i}}r=t.localToGraph(r),i.left=r.x+"px",i.top=r.y+"px",i.minWidth=s+"px";const o=t.scale();i.transform=`scale(${o.sx}, ${o.sy}) translate(-50%, -50%)`;const l=this.options.attrs;i.fontSize=l.fontSize+"px",i.fontFamily=l.fontFamily,i.color=l.color,i.backgroundColor=l.backgroundColor;const c=this.options.getText;let u;return"function"===typeof c&&(u=a.call(c,this.cellView,{cell:this.cell,index:this.labelIndex})),n.innerText=u||"",this}onDocumentMouseDown(t){if(t.target!==this.editor){const t=this.cell,e=this.editor.innerText.replace(/\n$/,"")||"",n=this.options.setText;"function"===typeof n&&a.call(n,this.cellView,{cell:this.cell,value:e,index:this.labelIndex,distance:this.distance}),t.removeTool(t.isEdge()?"edge-editor":"node-editor"),this.undelegateDocumentEvents()}}onDblClick(t){t.stopPropagation()}onMouseDown(t){t.stopPropagation()}autoFocus(){setTimeout(()=>{this.editor.focus(),this.selectText()})}selectText(){if(window.getSelection){const t=document.createRange(),e=window.getSelection();t.selectNodeContents(this.editor),e.removeAllRanges(),e.addRange(t)}}}(function(t){t.config({tagName:"div",isSVGElement:!1,events:{dblclick:"onDblClick",mousedown:"onMouseDown"},documentEvents:{mousedown:"onDocumentMouseDown"}})})(EA||(EA={})),function(t){t.NodeEditor=t.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},getText({cell:t}){return t.attr("text/text")},setText({cell:t,value:e}){t.attr("text/text",e)}}),t.EdgeEditor=t.define({attrs:{fontSize:14,fontFamily:"Arial, helvetica, sans-serif",color:"#000",backgroundColor:"#fff"},labelAddable:!0,getText({cell:t,index:e}){return-1===e?"":t.prop(`labels/${e}/attrs/label/text`)},setText({cell:t,value:e,index:n,distance:i}){const r=t;-1===n?r.appendLabel({position:{distance:i},attrs:{label:{text:e}}}):e?r.prop(`labels/${n}/attrs/label/text`,e):"number"===typeof n&&r.removeLabelAt(n)}})}(EA||(EA={}));var AA,SA,OA=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};(function(t){t.presets={boundary:pA,button:dA,"button-remove":dA.Remove,"node-editor":EA.NodeEditor},t.registry=Gw.create({type:"node tool",process(t,e){if("function"===typeof e)return e;let n=hA.ToolItem;const{inherit:i}=e,r=OA(e,["inherit"]);if(i){const t=this.get(i);null==t?this.onNotFound(i,"inherited"):n=t}return null==r.name&&(r.name=t),n.define.call(n,r)}}),t.registry.register(t.presets,!0)})(AA||(AA={})),function(t){t.presets={boundary:pA,vertices:fA,segments:mA,button:dA,"button-remove":dA.Remove,"source-anchor":yA,"target-anchor":CA,"source-arrowhead":xA,"target-arrowhead":MA,"edge-editor":EA.EdgeEditor},t.registry=Gw.create({type:"edge tool",process(t,e){if("function"===typeof e)return e;let n=hA.ToolItem;const{inherit:i}=e,r=OA(e,["inherit"]);if(i){const t=this.get(i);null==t?this.onNotFound(i,"inherited"):n=t}return null==r.name&&(r.name=t),n.define.call(n,r)}}),t.registry.register(t.presets,!0)}(SA||(SA={}));const PA=BA("center"),kA=BA("topCenter"),DA=BA("bottomCenter"),TA=BA("leftMiddle"),NA=BA("rightMiddle"),jA=BA("topLeft"),LA=BA("topRight"),FA=BA("bottomLeft"),zA=BA("bottomRight");function BA(t){return function(e,n,i,r={}){const s=r.rotate?e.getUnrotatedBBoxOfElement(n):e.getBBoxOfElement(n),a=s[t];a.x+=o.normalizePercentage(r.dx,s.width),a.y+=o.normalizePercentage(r.dy,s.height);const l=e.cell;return r.rotate?a.rotate(-l.getAngle(),l.getBBox().getCenter()):a}}function RA(t){return function(e,n,i,r){if(i instanceof Element){const s=this.graph.renderer.findViewByElem(i);let o;if(s)if(s.isEdgeElement(i)){const t=null!=r.fixedAt?r.fixedAt:"50%";o=IA(s,t)}else o=s.getBBoxOfElement(i).getCenter();else o=new ZC;return t.call(this,e,n,o,r)}return t.apply(this,arguments)}}function IA(t,e){const n=o.isPercentage(e),i="string"===typeof e?parseFloat(e):e;return n?t.getPointAtRatio(i/100):t.getPointAtLength(i)}const VA=function(t,e,n,i){const r=t.cell.getAngle(),s=t.getBBoxOfElement(e),o=s.getCenter(),a=s.getTopLeft(),l=s.getBottomRight();let h=i.padding;if(Number.isFinite(h)||(h=0),a.y+h<=n.y&&n.y<=l.y-h){const t=n.y-o.y;o.x+=0===r||180===r?0:1*t/Math.tan(_C.toRad(r)),o.y+=t}else if(a.x+h<=n.x&&n.x<=l.x-h){const t=n.x-o.x;o.y+=90===r||270===r?0:t*Math.tan(_C.toRad(r)),o.x+=t}return o},$A=RA(VA),GA=function(t,e,n,i,r){const s=t.cell.getConnectionPoint(this.cell,r);return(i.dx||i.dy)&&s.translate(i.dx||0,i.dy||0),s},_A=function(t,e,n,i){let r,s,o=0;const a=t.cell;i.rotate?(r=t.getUnrotatedBBoxOfElement(e),s=a.getBBox().getCenter(),o=a.getAngle()):r=t.getBBoxOfElement(e);const l=i.padding;null!=l&&Number.isFinite(l)&&r.inflate(l),i.rotate&&n.rotate(o,s);const h=r.getNearestSideToPoint(n);let c;switch(h){case"left":c=r.getLeftMiddle();break;case"right":c=r.getRightMiddle();break;case"top":c=r.getTopCenter();break;case"bottom":c=r.getBottomCenter();break;default:break}const u=i.direction;return"H"===u?"top"!==h&&"bottom"!==h||(c=n.x<=r.x+r.width?r.getLeftMiddle():r.getRightMiddle()):"V"===u&&(c=n.y<=r.y+r.height?r.getTopCenter():r.getBottomCenter()),i.rotate?c.rotate(-o,s):c},HA=RA(_A);var UA;(function(t){t.presets=C,t.registry=Gw.create({type:"node endpoint"}),t.registry.register(t.presets,!0)})(UA||(UA={}));const WA=function(t,e,n,i){let r=null!=i.ratio?i.ratio:.5;return r>1&&(r/=100),t.getPointAtRatio(r)},XA=function(t,e,n,i){const r=null!=i.length?i.length:20;return t.getPointAtLength(r)},qA=function(t,e,n,i){const r=t.getClosestPoint(n);return null!=r?r:new ZC},YA=RA(qA),JA=function(t,e,n,i){const r=1e6,s=t.getConnection(),o=t.getConnectionSubdivisions(),l=new QC(n.clone().translate(0,r),n.clone().translate(0,-r)),h=new QC(n.clone().translate(r,0),n.clone().translate(-r,0)),c=l.intersect(s,{segmentSubdivisions:o}),u=h.intersect(s,{segmentSubdivisions:o}),d=[];return c&&d.push(...c),u&&d.push(...u),d.length>0?n.closest(d):null!=i.fallbackAt?IA(t,i.fallbackAt):a.call(qA,this,t,e,n,i)},ZA=RA(JA);var KA;function QA(t,e,n){let i;if("object"===typeof n){if(Number.isFinite(n.y)){const i=new QC(e,t),{start:r,end:s}=i.parallel(n.y);e=r,t=s}i=n.x}else i=n;if(null==i||!Number.isFinite(i))return t;const r=t.distance(e);return 0===i&&r>0?t:t.move(e,-Math.min(i,r-1))}function tS(t){const e=t.getAttribute("stroke-width");return null===e?0:parseFloat(e)||0}function eS(t){if(null==t)return null;let e=t;do{let t=e.tagName;if("string"!==typeof t)return null;if(t=t.toUpperCase(),"G"===t)e=e.firstElementChild;else{if("TITLE"!==t)break;e=e.nextElementSibling}}while(e);return e}(function(t){t.presets=v,t.registry=Gw.create({type:"edge endpoint"}),t.registry.register(t.presets,!0)})(KA||(KA={}));const nS=function(t,e,n,i){const r=e.getBBoxOfElement(n);i.stroked&&r.inflate(tS(n)/2);const s=t.intersect(r),o=s&&s.length?t.start.closest(s):t.end;return QA(o,t.start,i.offset)},iS=function(t,e,n,i,r){const s=e.cell,o=s.isNode()?s.getAngle():0;if(0===o)return a.call(nS,this,t,e,n,i,r);const l=e.getUnrotatedBBoxOfElement(n);i.stroked&&l.inflate(tS(n)/2);const h=l.getCenter(),c=t.clone().rotate(o,h),u=c.setLength(1e6).intersect(l),d=u&&u.length?c.start.closest(u).rotate(-o,h):t.end;return QA(d,t.start,i.offset)},rS=function(t,e,n,i){let s,o;const a=t.end,l=i.selector;if(s="string"===typeof l?e.findOne(l):Array.isArray(l)?r.getByPath(n,l):eS(n),!h.isSVGGraphicsElement(s)){if(s===n||!h.isSVGGraphicsElement(n))return a;s=n}const c=e.getShapeOfElement(s),u=e.getMatrixOfElement(s),d=e.getRootTranslatedMatrix(),g=e.getRootRotatedMatrix(),p=d.multiply(g).multiply(u),f=p.inverse(),m=h.transformLine(t,f),b=m.start.clone(),y=e.getDataOfElement(s);if(!1===i.insideout){null==y.shapeBBox&&(y.shapeBBox=c.bbox());const t=y.shapeBBox;if(null!=t&&t.containsPoint(b))return a}let C;if(!0===i.extrapolate&&m.setLength(1e6),xv.isPath(c)){const t=i.precision||2;null==y.segmentSubdivisions&&(y.segmentSubdivisions=c.getSegmentSubdivisions({precision:t})),C={precision:t,segmentSubdivisions:y.segmentSubdivisions},o=m.intersect(c,C)}else o=m.intersect(c);o?Array.isArray(o)&&(o=b.closest(o)):!0===i.sticky&&(o=KC.isRectangle(c)?c.getNearestPointToPoint(b):tv.isEllipse(c)?c.intersectsWithLineFromCenterToPoint(b):c.closestPoint(b,C));const v=o?h.transformPoint(o,p):a;let w=i.offset||0;return!1!==i.stroked&&("object"===typeof w?(w=Object.assign({},w),null==w.x&&(w.x=0),w.x+=tS(s)/2):w+=tS(s)/2),QA(v,t.start,w)};function sS(t,e,n=0){const{start:i,end:r}=t;let s,o,a,l;switch(e){case"left":l="x",s=r,o=i,a=-1;break;case"right":l="x",s=i,o=r,a=1;break;case"top":l="y",s=r,o=i,a=-1;break;case"bottom":l="y",s=i,o=r,a=1;break;default:return}i[l]<r[l]?s[l]=o[l]:o[l]=s[l],Number.isFinite(n)&&(s[l]+=a*n,o[l]+=a*n)}const oS=function(t,e,n,i){const{alignOffset:r,align:s}=i;return s&&sS(t,s,r),QA(t.end,t.start,i.offset)};var aS;(function(t){t.presets=w,t.registry=Gw.create({type:"connection point"}),t.registry.register(t.presets,!0)})(aS||(aS={}));const lS=function(t){return[...t]},hS=function(t,e,n){const i=e.side||"bottom",r=o.normalizeSides(e.padding||40),s=n.sourceBBox,a=n.targetBBox,l=s.getCenter(),h=a.getCenter();let c,u,d;switch(i){case"top":d=-1,c="y",u="height";break;case"left":d=-1,c="x",u="width";break;case"right":d=1,c="x",u="width";break;case"bottom":default:d=1,c="y",u="height";break}return l[c]+=d*(s[u]/2+r[i]),h[c]+=d*(a[u]/2+r[i]),d*(l[c]-h[c])>0?h[c]=l[c]:l[c]=h[c],[l.toJSON(),...t,h.toJSON()]};function cS(t){return new KC(t.x,t.y,0,0)}function uS(t={}){const e=o.normalizeSides(t.padding||20);return{x:-e.left,y:-e.top,width:e.left+e.right,height:e.top+e.bottom}}function dS(t,e={}){return t.sourceBBox.clone().moveAndExpand(uS(e))}function gS(t,e={}){return t.targetBBox.clone().moveAndExpand(uS(e))}function pS(t,e={}){if(t.sourceAnchor)return t.sourceAnchor;const n=dS(t,e);return n.getCenter()}function fS(t,e={}){if(t.targetAnchor)return t.targetAnchor;const n=gS(t,e);return n.getCenter()}const mS=function(t,e,n){let i=dS(n,e),r=gS(n,e);const s=pS(n,e),o=fS(n,e);i=i.union(cS(s)),r=r.union(cS(o));const a=t.map(t=>ZC.create(t));a.unshift(s),a.push(o);let l=null;const h=[];for(let c=0,u=a.length-1;c<u;c+=1){let t=null;const n=a[c],s=a[c+1],o=null!=bS.getBearing(n,s);if(0===c)c+1===u?i.intersectsWithRect(r.clone().inflate(1))?t=bS.insideNode(n,s,i,r):o||(t=bS.nodeToNode(n,s,i,r)):i.containsPoint(s)?t=bS.insideNode(n,s,i,cS(s).moveAndExpand(uS(e))):o||(t=bS.nodeToVertex(n,s,i));else if(c+1===u){const i=o&&bS.getBearing(s,n)===l;r.containsPoint(n)||i?t=bS.insideNode(n,s,cS(n).moveAndExpand(uS(e)),r,l):o||(t=bS.vertexToNode(n,s,r,l))}else o||(t=bS.vertexToVertex(n,s,l));t?(h.push(...t.points),l=t.direction):l=bS.getBearing(n,s),c+1<u&&h.push(s)}return h};var bS;(function(t){const e={N:"S",S:"N",E:"W",W:"E"},n={N:-Math.PI/2*3,S:-Math.PI/2,E:0,W:Math.PI};function r(t,e,n){let i=new ZC(t.x,e.y);return n.containsPoint(i)&&(i=new ZC(e.x,t.y)),i}function s(t,e){return t["W"===e||"E"===e?"width":"height"]}function o(t,e){return t.x===e.x?t.y>e.y?"N":"S":t.y===e.y?t.x>e.x?"W":"E":null}function a(t,n,i){const r=new ZC(t.x,n.y),s=new ZC(n.x,t.y),a=o(t,r),l=o(t,s),h=i?e[i]:null,c=a===i||a!==h&&(l===h||l!==i)?r:s;return{points:[c],direction:o(c,n)}}function l(t,e,n){const i=r(t,e,n);return{points:[i],direction:o(i,e)}}function h(t,e,n,a){const l=[new ZC(t.x,e.y),new ZC(e.x,t.y)],h=l.filter(t=>!n.containsPoint(t)),c=h.filter(e=>o(e,t)!==a);let u;if(c.length>0)return u=c.filter(e=>o(t,e)===a).pop(),u=u||c[0],{points:[u],direction:o(u,e)};{u=i.difference(l,h)[0];const c=ZC.create(e).move(u,-s(n,a)/2),d=r(c,t,n);return{points:[d,c],direction:o(c,e)}}}function c(t,e,n,i){let r=l(e,t,i);const h=r.points[0];if(n.containsPoint(h)){r=l(t,e,n);const c=r.points[0];if(i.containsPoint(c)){const u=ZC.create(t).move(c,-s(n,o(t,c))/2),d=ZC.create(e).move(h,-s(i,o(e,h))/2),g=new QC(u,d).getCenter(),p=l(t,g,n),f=a(g,e,p.direction);r.points=[p.points[0],f.points[0]],r.direction=f.direction}}return r}function u(t,e,i,s,a){const l=i.union(s).inflate(1),h=l.getCenter(),c=h.distance(e)>h.distance(t),u=c?e:t,d=c?t:e;let g,p,f,m;a?(g=ZC.fromPolar(l.width+l.height,n[a],u),g=l.getNearestPointToPoint(g).move(g,-1)):g=l.getNearestPointToPoint(u).move(u,1),p=r(g,d,l),g.round().equals(p.round())?(p=ZC.fromPolar(l.width+l.height,_C.toRad(g.theta(u))+Math.PI/2,d),p=l.getNearestPointToPoint(p).move(d,1).round(),f=r(g,p,l),m=c?[p,f,g]:[g,f,p]):m=c?[p,g]:[g,p];const b=o(c?g:p,e);return{points:m,direction:b}}t.getBBoxSize=s,t.getBearing=o,t.vertexToVertex=a,t.nodeToVertex=l,t.vertexToNode=h,t.nodeToNode=c,t.insideNode=u})(bS||(bS={}));const yS={step:10,maxLoopCount:2e3,precision:1,maxDirectionChange:90,perpendicular:!0,excludeTerminals:[],excludeShapes:[],excludeNodes:[],excludeHiddenNodes:!1,startDirections:["top","right","bottom","left"],endDirections:["top","right","bottom","left"],directionMap:{top:{x:0,y:-1},right:{x:1,y:0},bottom:{x:0,y:1},left:{x:-1,y:0}},cost(){const t=CS(this.step,this);return t},directions(){const t=CS(this.step,this),e=CS(this.cost,this);return[{cost:e,offsetX:t,offsetY:0},{cost:e,offsetX:-t,offsetY:0},{cost:e,offsetX:0,offsetY:t},{cost:e,offsetX:0,offsetY:-t}]},penalties(){const t=CS(this.step,this);return{0:0,45:t/2,90:t/2}},paddingBox(){const t=CS(this.step,this);return{x:-t,y:-t,width:2*t,height:2*t}},fallbackRouter:mS,draggingRouter:null};function CS(t,e){return"function"===typeof t?t.call(e):t}function vS(t){const e=Object.keys(t).reduce((e,n)=>{const i=e;return i[n]="fallbackRouter"===n||"draggingRouter"===n||"fallbackRoute"===n?t[n]:CS(t[n],t),e},{});if(e.padding){const t=o.normalizeSides(e.padding);e.paddingBox={x:-t.left,y:-t.top,width:t.left+t.right,height:t.top+t.bottom}}return e.directions.forEach(t=>{const e=new ZC(0,0),n=new ZC(t.offsetX,t.offsetY);t.angle=_C.normalize(e.theta(n))}),e}const wS=1,xS=2;class MS{constructor(){this.items=[],this.hash={},this.values={}}add(t,e){this.hash[t]?this.items.splice(this.items.indexOf(t),1):this.hash[t]=wS,this.values[t]=e;const n=i.sortedIndexBy(this.items,t,t=>this.values[t]);this.items.splice(n,0,t)}pop(){const t=this.items.shift();return t&&(this.hash[t]=xS),t}isOpen(t){return this.hash[t]===wS}isClose(t){return this.hash[t]===xS}isEmpty(){return 0===this.items.length}}class ES{constructor(t){this.options=t,this.mapGridSize=100,this.map={}}build(t,e){const n=this.options,r=n.excludeTerminals.reduce((n,i)=>{const r=e[i];if(r){const e=t.getCell(r.cell);e&&n.push(e)}return n},[]);let s=[];const o=t.getCell(e.getSourceCellId());o&&(s=i.union(s,o.getAncestors().map(t=>t.id)));const a=t.getCell(e.getTargetCellId());a&&(s=i.union(s,a.getAncestors().map(t=>t.id)));const l=this.mapGridSize;return t.getNodes().reduce((t,e)=>{const i=e.shape,o=n.excludeShapes,a=!!i&&o.includes(i),h=r.some(t=>t.id===e.id),c=n.excludeNodes.some(t=>"string"===typeof t?e.id===t:t===e),u=s.includes(e.id),d=n.excludeHiddenNodes&&!e.isVisible(),g=a||h||c||u||d;if(!g){const i=e.getBBox().moveAndExpand(n.paddingBox),r=i.getOrigin().snapToGrid(l),s=i.getCorner().snapToGrid(l);for(let e=r.x;e<=s.x;e+=l)for(let n=r.y;n<=s.y;n+=l){const r=new ZC(e,n).toString();null==t[r]&&(t[r]=[]),t[r].push(i)}}return t},this.map),this}isAccessible(t){const e=t.clone().snapToGrid(this.mapGridSize).toString(),n=this.map[e];return!n||n.every(e=>!e.containsPoint(t))}}function AS(t,e){const n=t.sourceBBox.clone();return e&&e.paddingBox?n.moveAndExpand(e.paddingBox):n}function SS(t,e){const n=t.targetBBox.clone();return e&&e.paddingBox?n.moveAndExpand(e.paddingBox):n}function OS(t,e){if(t.sourceAnchor)return t.sourceAnchor;const n=AS(t,e);return n.getCenter()}function PS(t,e){if(t.targetAnchor)return t.targetAnchor;const n=SS(t,e);return n.getCenter()}function kS(t,e,n,i,r){const s=360/n,o=t.theta(DS(t,e,i,r)),a=_C.normalize(o+s/2);return s*Math.floor(a/s)}function DS(t,e,n,i){const r=i.step,s=e.x-t.x,o=e.y-t.y,a=s/n.x,l=o/n.y,h=a*r,c=l*r;return new ZC(t.x+h,t.y+c)}function TS(t,e){const n=Math.abs(t-e);return n>180?360-n:n}function NS(t,e){const n=e.step;return e.directions.forEach(e=>{e.gridOffsetX=e.offsetX/n*t.x,e.gridOffsetY=e.offsetY/n*t.y}),e.directions}function jS(t,e,n){return{source:e.clone(),x:LS(n.x-e.x,t),y:LS(n.y-e.y,t)}}function LS(t,e){if(!t)return e;const n=Math.abs(t),i=Math.round(n/e);if(!i)return n;const r=i*e,s=n-r,o=s/i;return e+o}function FS(t,e){const n=e.source,i=WM.snapToGrid(t.x-n.x,e.x)+n.x,r=WM.snapToGrid(t.y-n.y,e.y)+n.y;return new ZC(i,r)}function zS(t,e){return t.round(e)}function BS(t,e,n){return zS(FS(t.clone(),e),n)}function RS(t){return t.toString()}function IS(t){return new ZC(0===t.x?0:Math.abs(t.x)/t.x,0===t.y?0:Math.abs(t.y)/t.y)}function VS(t,e){let n=1/0;for(let i=0,r=e.length;i<r;i+=1){const r=t.manhattanDistance(e[i]);r<n&&(n=r)}return n}function $S(t,e,n,i,r){const s=r.precision,o=r.directionMap,a=t.diff(e.getCenter()),l=Object.keys(o).reduce((r,l)=>{if(n.includes(l)){const n=o[l],h=new ZC(t.x+n.x*(Math.abs(a.x)+e.width),t.y+n.y*(Math.abs(a.y)+e.height)),c=new QC(t,h),u=c.intersect(e)||[];let d,g=null;for(let e=0;e<u.length;e+=1){const n=u[e],i=t.squaredDistance(n);(null==d||i>d)&&(d=i,g=n)}if(g){let t=BS(g,i,s);e.containsPoint(t)&&(t=BS(t.translate(n.x*i.x,n.y*i.y),i,s)),r.push(t)}}return r},[]);return e.containsPoint(t)||l.push(BS(t,i,s)),l}function GS(t,e,n,i,r){const s=[];let o,a=IS(r.diff(n)),l=RS(n),h=t[l];while(h){o=e[l];const n=IS(o.diff(h));n.equals(a)||(s.unshift(o),a=n),l=RS(h),h=t[l]}const c=e[l],u=IS(c.diff(i));return u.equals(a)||s.unshift(c),s}function _S(t,e,n,i,r){const s=r.precision;let o,l;o=KC.isRectangle(e)?zS(OS(t,r).clone(),s):zS(e.clone(),s),l=KC.isRectangle(n)?zS(PS(t,r).clone(),s):zS(n.clone(),s);const h=jS(r.step,o,l),c=o,u=l;let d,g;if(d=KC.isRectangle(e)?$S(c,e,r.startDirections,h,r):[c],g=KC.isRectangle(n)?$S(l,n,r.endDirections,h,r):[u],d=d.filter(t=>i.isAccessible(t)),g=g.filter(t=>i.isAccessible(t)),d.length>0&&g.length>0){const t=new MS,e={},n={},o={};for(let i=0,r=d.length;i<r;i+=1){const n=d[i],r=RS(n);t.add(r,VS(n,g)),e[r]=n,o[r]=0}const a=r.previousDirectionAngle,l=void 0===a;let p,f;const m=NS(h,r),b=m.length,y=g.reduce((t,e)=>{const n=RS(e);return t.push(n),t},[]),C=ZC.equalPoints(d,g);let v=r.maxLoopCount;while(!t.isEmpty()&&v>0){const d=t.pop(),w=e[d],x=n[d],M=o[d],E=w.equals(c),A=null==x;let S;S=A?l?E?null:kS(c,w,b,h,r):a:kS(x,w,b,h,r);const O=A&&C;if(!O&&y.indexOf(d)>=0)return r.previousDirectionAngle=S,GS(n,e,w,c,u);for(let a=0;a<b;a+=1){p=m[a];const c=p.angle;if(f=TS(S,c),(!l||!E)&&f>r.maxDirectionChange)continue;const d=BS(w.clone().translate(p.gridOffsetX||0,p.gridOffsetY||0),h,s),C=RS(d);if(t.isClose(C)||!i.isAccessible(d))continue;if(y.indexOf(C)>=0){const t=d.equals(u);if(!t){const t=kS(d,u,b,h,r),e=TS(c,t);if(e>r.maxDirectionChange)continue}}const v=p.cost,x=E?0:r.penalties[f],A=M+v+x;(!t.isOpen(C)||A<o[C])&&(e[C]=d,n[C]=w,o[C]=A,t.add(C,A+VS(d,g)))}v-=1}}return r.fallbackRoute?a.call(r.fallbackRoute,this,c,u,r):null}const HS=function(t,e,n){const i=vS(e),r=AS(n,i),s=SS(n,i),o=OS(n,i),l=new ES(i).build(n.graph.model,n.cell),h=t.map(t=>ZC.create(t)),c=[];let u,d,g=o;for(let p=0,f=h.length;p<=f;p+=1){let e=null;if(u=d||r,d=h[p],null==d){d=s;const t=n.cell,l=null==t.getSourceCellId()||null==t.getTargetCellId();if(l&&"function"===typeof i.draggingRouter){const t=u===r?o:u,s=d.getOrigin();e=a.call(i.draggingRouter,n,t,s,i)}}if(null==e&&(e=_S(n,u,d,l,i)),null===e)return console.warn("Unable to execute manhattan algorithm, use orth instead"),a.call(i.fallbackRouter,this,t,i,n);const f=e[0];f&&f.equals(g)&&e.shift(),g=e[e.length-1]||g,c.push(...e)}return c},US=function(t,e,n){return a.call(HS,this,t,Object.assign(Object.assign({},yS),e),n)},WS={maxDirectionChange:45,directions(){const t=CS(this.step,this),e=CS(this.cost,this),n=Math.ceil(Math.sqrt(t*t<<1));return[{cost:e,offsetX:t,offsetY:0},{cost:n,offsetX:t,offsetY:t},{cost:e,offsetX:0,offsetY:t},{cost:n,offsetX:-t,offsetY:t},{cost:e,offsetX:-t,offsetY:0},{cost:n,offsetX:-t,offsetY:-t},{cost:e,offsetX:0,offsetY:-t},{cost:n,offsetX:t,offsetY:-t}]},fallbackRoute(t,e,n){const i=t.theta(e),r=[];let s={x:e.x,y:t.y},o={x:t.x,y:e.y};if(i%180>90){const t=s;s=o,o=t}const a=i%90<45?s:o,l=new QC(t,a),h=90*Math.ceil(i/90),c=ZC.fromPolar(l.squaredLength(),_C.toRad(h+135),a),u=new QC(e,c),d=l.intersectsWithLine(u),g=d||e,p=d?g:t,f=360/n.directions.length,m=p.theta(e),b=_C.normalize(m+f/2),y=f*Math.floor(b/f);return n.previousDirectionAngle=y,g&&r.push(g.round()),r.push(e),r}},XS=function(t,e,n){return a.call(US,this,t,Object.assign(Object.assign({},WS),e),n)},qS=function(t,e,n){const i=e.offset||32,r=null==e.min?16:e.min;let s=0,o=e.direction;const a=n.sourceBBox,l=n.targetBBox,h=a.getCenter(),c=l.getCenter();if("number"===typeof i&&(s=i),null==o){let t=l.left-a.right,e=l.top-a.bottom;t>=0&&e>=0?o=t>=e?"L":"T":t<=0&&e>=0?(t=a.left-l.right,o=t>=0&&t>=e?"R":"T"):t>=0&&e<=0?(e=a.top-l.bottom,o=e>=0?t>=e?"L":"B":"L"):(t=a.left-l.right,e=a.top-l.bottom,o=t>=0&&e>=0?t>=e?"R":"B":t<=0&&e>=0?"B":t>=0&&e<=0||Math.abs(t)>Math.abs(e)?"R":"B")}let u,d,g;"H"===o?o=c.x-h.x>=0?"L":"R":"V"===o&&(o=c.y-h.y>=0?"T":"B"),"center"===i&&("L"===o?s=(l.left-a.right)/2:"R"===o?s=(a.left-l.right)/2:"T"===o?s=(l.top-a.bottom)/2:"B"===o&&(s=(a.top-l.bottom)/2));const p="L"===o||"R"===o;if(p){if(c.y===h.y)return[...t];g="L"===o?1:-1,u="x",d="width"}else{if(c.x===h.x)return[...t];g="T"===o?1:-1,u="y",d="height"}const f=h.clone(),m=c.clone();if(f[u]+=g*(a[d]/2+s),m[u]-=g*(l[d]/2+s),p){const t=f.x,e=m.x,n=a.width/2+r,i=l.width/2+r;c.x>h.x?e<=t&&(f.x=Math.max(e,h.x+n),m.x=Math.min(t,c.x-i)):e>=t&&(f.x=Math.min(e,h.x-n),m.x=Math.max(t,c.x+i))}else{const t=f.y,e=m.y,n=a.height/2+r,i=l.height/2+r;c.y>h.y?e<=t&&(f.y=Math.max(e,h.y+n),m.y=Math.min(t,c.y-i)):e>=t&&(f.y=Math.min(e,h.y-n),m.y=Math.max(t,c.y+i))}return[f.toJSON(),...t,m.toJSON()]};function YS(t,e){if(null!=e&&!1!==e){const n="boolean"===typeof e?0:e;if(n>0){const e=ZC.create(t[1]).move(t[2],n),i=ZC.create(t[1]).move(t[0],n);return[e.toJSON(),...t,i.toJSON()]}{const e=t[1];return[Object.assign({},e),...t,Object.assign({},e)]}}return t}const JS=function(t,e,n){const i=e.width||50,r=e.height||80,s=r/2,o=e.angle||"auto",a=n.sourceAnchor,l=n.targetAnchor,h=n.sourceBBox,c=n.targetBBox;if(a.equals(l)){const t=t=>{const e=_C.toRad(t),n=Math.sin(e),r=Math.cos(e),o=new ZC(a.x+r*i,a.y+n*i),l=new ZC(o.x-r*s,o.y-n*s),h=l.clone().rotate(-90,o),c=l.clone().rotate(90,o);return[h.toJSON(),o.toJSON(),c.toJSON()]},n=t=>{const e=a.clone().move(t,-1),n=new QC(e,t);return!h.containsPoint(t)&&!h.intersectsWithLine(n)},r=[0,90,180,270,45,135,225,315];if("number"===typeof o)return YS(t(o),e.merge);const l=h.getCenter();if(l.equals(a))return YS(t(0),e.merge);const c=l.angleBetween(a,l.clone().translate(1,0));let u=t(c);if(n(u[1]))return YS(u,e.merge);for(let i=1,s=r.length;i<s;i+=1)if(u=t(c+r[i]),n(u[1]))return YS(u,e.merge);return YS(u,e.merge)}{const t=new QC(a,l);let r=t.parallel(-i),o=r.getCenter(),u=r.start.clone().move(r.end,s),d=r.end.clone().move(r.start,s);const g=t.parallel(-1),p=new QC(g.start,o),f=new QC(g.end,o);if((h.containsPoint(o)||c.containsPoint(o)||h.intersectsWithLine(p)||h.intersectsWithLine(f)||c.intersectsWithLine(p)||c.intersectsWithLine(f))&&(r=t.parallel(i),o=r.getCenter(),u=r.start.clone().move(r.end,s),d=r.end.clone().move(r.start,s)),e.merge){const t=new QC(a,l),e=new QC(o,t.center).setLength(Number.MAX_SAFE_INTEGER),i=h.intersectsWithLine(e),r=c.intersectsWithLine(e),s=i?Array.isArray(i)?i:[i]:[];r&&(Array.isArray(r)?s.push(...r):s.push(r));const u=t.center.closest(s);u?(n.sourceAnchor=u.clone(),n.targetAnchor=u.clone()):(n.sourceAnchor=t.center.clone(),n.targetAnchor=t.center.clone())}return YS([u.toJSON(),o.toJSON(),d.toJSON()],e.merge)}};var ZS;(function(t){t.presets=x,t.registry=Gw.create({type:"router"}),t.registry.register(t.presets,!0)})(ZS||(ZS={}));const KS=function(t,e,n,i={}){const r=[t,...n,e],s=new ev(r),o=new xv(s);return i.raw?o:o.serialize()},QS=function(t,e,n,i={}){const r=3===n.length?0:1,s=ZC.create(n[0+r]),o=ZC.create(n[2+r]),a=ZC.create(n[1+r]);if(!ZC.equals(t,e)){const n=new ZC((t.x+e.x)/2,(t.y+e.y)/2),i=n.angleBetween(ZC.create(t).rotate(90,n),a);i>1&&(s.rotate(180-i,n),o.rotate(180-i,n),a.rotate(180-i,n))}const l=`\n M ${t.x} ${t.y}\n Q ${s.x} ${s.y} ${a.x} ${a.y}\n Q ${o.x} ${o.y} ${e.x} ${e.y}\n `;return i.raw?xv.parse(l):l},tO=function(t,e,n,i={}){const r=new xv;r.appendSegment(xv.createSegment("M",t));const s=1/3,o=2/3,a=i.radius||10;let l,h;for(let c=0,u=n.length;c<u;c+=1){const i=ZC.create(n[c]),u=n[c-1]||t,d=n[c+1]||e;l=h||i.distance(u)/2,h=i.distance(d)/2;const g=-Math.min(a,l),p=-Math.min(a,h),f=i.clone().move(u,g).round(),m=i.clone().move(d,p).round(),b=new ZC(s*f.x+o*i.x,o*i.y+s*f.y),y=new ZC(s*m.x+o*i.x,o*i.y+s*m.y);r.appendSegment(xv.createSegment("L",f)),r.appendSegment(xv.createSegment("C",b,y,m))}return r.appendSegment(xv.createSegment("L",e)),i.raw?r:r.serialize()},eO=function(t,e,n,i={}){let r,s=i.direction;if(n&&0!==n.length){const i=[t,...n,e],s=nv.throughPoints(i);r=new xv(s)}else if(r=new xv,r.appendSegment(xv.createSegment("M",t)),s||(s=Math.abs(t.x-e.x)>=Math.abs(t.y-e.y)?"H":"V"),"H"===s){const n=(t.x+e.x)/2;r.appendSegment(xv.createSegment("C",n,t.y,n,e.y,e.x,e.y))}else{const n=(t.y+e.y)/2;r.appendSegment(xv.createSegment("C",t.x,n,e.x,n,e.x,e.y))}return i.raw?r:r.serialize()},nO=1,iO=1/3,rO=2/3;function sO(t){let e=t.graph._jumpOverUpdateList;if(null==e&&(e=t.graph._jumpOverUpdateList=[],t.graph.on("cell:mouseup",()=>{const e=t.graph._jumpOverUpdateList;for(let t=0;t<e.length;t+=1)e[t].update()}),t.graph.on("model:reseted",()=>{e=t.graph._jumpOverUpdateList=[]})),e.indexOf(t)<0){e.push(t);const n=()=>e.splice(e.indexOf(t),1);t.cell.once("change:connector",n),t.cell.once("removed",n)}}function oO(t,e,n=[]){const i=[t,...n,e],r=[];return i.forEach((t,e)=>{const n=i[e+1];null!=n&&r.push(new QC(t,n))}),r}function aO(t,e){const n=[];return e.forEach(e=>{const i=t.intersectsWithLine(e);i&&n.push(i)}),n}function lO(t,e){return new QC(t,e).squaredLength()}function hO(t,e,n){return e.reduce((i,r,s)=>{if(gO.includes(r))return i;const o=i.pop()||t,a=ZC.create(r).move(o.start,-n);let l=ZC.create(r).move(o.start,+n);const h=e[s+1];if(null!=h){const t=l.distance(h);t<=n&&(l=h.move(o.start,t),gO.push(h))}else{const t=a.distance(o.end);if(t<2*n+nO)return i.push(o),i}const c=l.distance(o.start);if(c<2*n+nO)return i.push(o),i;const u=new QC(a,l);return dO.push(u),i.push(new QC(o.start,a),u,new QC(l,o.end)),i},[])}function cO(t,e,n,i){const r=new xv;let s;return s=xv.createSegment("M",t[0].start),r.appendSegment(s),t.forEach((o,a)=>{if(dO.includes(o)){let t,i,a,l;if("arc"===n){t=-90,i=o.start.diff(o.end);const e=i.x<0||0===i.x&&i.y<0;e&&(t+=180);const n=o.getCenter(),h=new QC(n,o.end).rotate(t,n);let c;c=new QC(o.start,n),a=c.pointAt(2/3).rotate(t,o.start),l=h.pointAt(1/3).rotate(-t,h.end),s=xv.createSegment("C",a,l,h.end),r.appendSegment(s),c=new QC(n,o.end),a=h.pointAt(1/3).rotate(t,h.end),l=c.pointAt(1/3).rotate(-t,o.end),s=xv.createSegment("C",a,l,o.end),r.appendSegment(s)}else if("gap"===n)s=xv.createSegment("M",o.end),r.appendSegment(s);else if("cubic"===n){t=o.start.theta(o.end);const n=.6*e;let h=1.35*e;i=o.start.diff(o.end);const c=i.x<0||0===i.x&&i.y<0;c&&(h*=-1),a=new ZC(o.start.x+n,o.start.y+h).rotate(t,o.start),l=new ZC(o.end.x-n,o.end.y+h).rotate(t,o.end),s=xv.createSegment("C",a,l,o.end),r.appendSegment(s)}}else{const e=t[a+1];0===i||!e||dO.includes(e)?(s=xv.createSegment("L",o.end),r.appendSegment(s)):uO(i,r,o.end,o.start,e.end)}}),r}function uO(t,e,n,i,r){const s=n.distance(i)/2,o=n.distance(r)/2,a=-Math.min(t,s),l=-Math.min(t,o),h=n.clone().move(i,a).round(),c=n.clone().move(r,l).round(),u=new ZC(iO*h.x+rO*n.x,rO*n.y+iO*h.y),d=new ZC(iO*c.x+rO*n.x,rO*n.y+iO*c.y);let g;g=xv.createSegment("L",h),e.appendSegment(g),g=xv.createSegment("C",u,d,c),e.appendSegment(g)}let dO,gO;const pO=function(t,e,n,i={}){dO=[],gO=[],sO(this);const r=i.size||5,s=i.type||"arc",o=i.radius||0,a=i.ignoreConnectors||["smooth"],l=this.graph,h=l.model,c=h.getEdges();if(1===c.length)return cO(oO(t,e,n),r,s,o);const u=this.cell,d=c.indexOf(u),g=l.options.connecting.connector||{},p=c.filter((t,e)=>{const n=t.getConnector()||g;return!a.includes(n.name)&&(!(e>d)||"jumpover"!==n.name)}),f=p.map(t=>l.renderer.findViewByCell(t)),m=oO(t,e,n),b=f.map(t=>null==t?[]:t===this?m:oO(t.sourcePoint,t.targetPoint,t.routePoints)),y=[];m.forEach(t=>{const e=p.reduce((e,n,i)=>{if(n!==u){const n=aO(t,b[i]);e.push(...n)}return e},[]).sort((e,n)=>lO(t.start,e)-lO(t.start,n));e.length>0?y.push(...hO(t,e,r)):y.push(t)});const C=cO(y,r,s,o);return dO=[],gO=[],i.raw?C:C.serialize()};var fO;(function(t){t.presets=M,t.registry=Gw.create({type:"connector"}),t.registry.register(t.presets,!0)})(fO||(fO={}));const mO=Gw.create;class bO{constructor(t){this.cell=t,this.ids={},this.cache={}}get(){return Object.keys(this.ids)}start(t,e,n={},i="/"){const s=this.cell.getPropByPath(t),o=r.defaults(n,bO.defaultOptions),a=this.getTiming(o.timing),l=this.getInterp(o.interp,s,e);let c=0;const u=Array.isArray(t)?t.join(i):t,d=Array.isArray(t)?t:t.split(i),g=()=>{const t=(new Date).getTime();0===c&&(c=t);const e=t-c;let i=e/o.duration;i<1?this.ids[u]=h.requestAnimationFrame(g):i=1;const r=l(a(i));this.cell.setPropByPath(d,r),n.progress&&n.progress(Object.assign({progress:i,currentValue:r},this.getArgs(u))),1===i&&(this.cell.notify("transition:end",this.getArgs(u)),this.cell.notify("transition:complete",this.getArgs(u)),n.complete&&n.complete(this.getArgs(u)),this.cell.notify("transition:finish",this.getArgs(u)),n.finish&&n.finish(this.getArgs(u)),this.clean(u))};return setTimeout(()=>{this.stop(t,void 0,i),this.cache[u]={startValue:s,targetValue:e,options:o},this.ids[u]=h.requestAnimationFrame(g),this.cell.notify("transition:begin",this.getArgs(u)),this.cell.notify("transition:start",this.getArgs(u)),n.start&&n.start(this.getArgs(u))},n.delay),this.stop.bind(this,t,i,n)}stop(t,e={},n="/"){const i=Array.isArray(t)?t:t.split(n);return Object.keys(this.ids).filter(t=>r.isEqual(i,t.split(n).slice(0,i.length))).forEach(t=>{h.cancelAnimationFrame(this.ids[t]);const n=this.cache[t],i=this.getArgs(t),r=Object.assign(Object.assign({},n.options),e),s=r.jumpedToEnd;s&&null!=n.targetValue&&(this.cell.setPropByPath(t,n.targetValue),this.cell.notify("transition:end",Object.assign({},i)),this.cell.notify("transition:complete",Object.assign({},i)),r.complete&&r.complete(Object.assign({},i)));const o=Object.assign({jumpedToEnd:s},i);this.cell.notify("transition:stop",Object.assign({},o)),r.stop&&r.stop(Object.assign({},o)),this.cell.notify("transition:finish",Object.assign({},i)),r.finish&&r.finish(Object.assign({},i)),this.clean(t)}),this}clean(t){delete this.ids[t],delete this.cache[t]}getTiming(t){return"string"===typeof t?$E[t]:t}getInterp(t,e,n){return t?t(e,n):"number"===typeof n?GE.number(e,n):"string"===typeof n?"#"===n[0]?GE.color(e,n):GE.unit(e,n):GE.object(e,n)}getArgs(t){const e=this.cache[t];return{path:t,startValue:e.startValue,targetValue:e.targetValue,cell:this.cell}}}(function(t){t.defaultOptions={delay:10,duration:100,timing:"linear"}})(bO||(bO={}));var yO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class CO extends RE{constructor(t={}){super(),this.pending=!1,this.changing=!1,this.data={},this.mutate(r.cloneDeep(t)),this.changed={}}mutate(t,e={}){const n=!0===e.unset,i=!0===e.silent,s=[],o=this.changing;this.changing=!0,o||(this.previous=r.cloneDeep(this.data),this.changed={});const a=this.data,l=this.previous,h=this.changed;if(Object.keys(t).forEach(e=>{const i=e,o=t[i];r.isEqual(a[i],o)||s.push(i),r.isEqual(l[i],o)?delete h[i]:h[i]=o,n?delete a[i]:a[i]=o}),!i&&s.length>0&&(this.pending=!0,this.pendingOptions=e,s.forEach(t=>{this.emit("change:*",{key:t,options:e,store:this,current:a[t],previous:l[t]})})),o)return this;if(!i)while(this.pending)this.pending=!1,this.emit("changed",{current:a,previous:l,store:this,options:this.pendingOptions});return this.pending=!1,this.changing=!1,this.pendingOptions=null,this}get(t,e){if(null==t)return this.data;const n=this.data[t];return null==n?e:n}getPrevious(t){if(this.previous){const e=this.previous[t];return null==e?void 0:e}}set(t,e,n){return null!=t&&("object"===typeof t?this.mutate(t,e):this.mutate({[t]:e},n)),this}remove(t,e){const n=void 0,i={};let r;if("string"===typeof t)i[t]=n,r=e;else if(Array.isArray(t))t.forEach(t=>i[t]=n),r=e;else{for(const t in this.data)i[t]=n;r=t}return this.mutate(i,Object.assign(Object.assign({},r),{unset:!0})),this}getByPath(t){return r.getByPath(this.data,t,"/")}setByPath(t,e,n={}){const i="/",s=Array.isArray(t)?[...t]:t.split(i),o=Array.isArray(t)?t.join(i):t,a=s[0],l=s.length;if(n.propertyPath=o,n.propertyValue=e,n.propertyPathArray=s,1===l)this.set(a,e,n);else{const o={};let h=o,c=a;for(let t=1;t<l;t+=1){const e=s[t],n=Number.isFinite(Number(e));h=h[c]=n?[]:{},c=e}r.setByPath(o,s,e,i);const u=r.cloneDeep(this.data);n.rewrite&&r.unsetByPath(u,t,i);const d=r.merge(u,o);this.set(a,d[a],n)}return this}removeByPath(t,e){const n=Array.isArray(t)?t:t.split("/"),i=n[0];if(1===n.length)this.remove(i,e);else{const t=n.slice(1),s=r.cloneDeep(this.get(i));s&&r.unsetByPath(s,t),this.set(i,s,e)}return this}hasChanged(t){return null==t?Object.keys(this.changed).length>0:t in this.changed}getChanges(t){if(null==t)return this.hasChanged()?r.cloneDeep(this.changed):null;const e=this.changing?this.previous:this.data,n={};let i;for(const s in t){const o=t[s];r.isEqual(e[s],o)||(n[s]=o,i=!0)}return i?r.cloneDeep(n):null}toJSON(){return r.cloneDeep(this.data)}clone(){const t=this.constructor;return new t(this.data)}dispose(){this.off(),this.data={},this.previous={},this.changed={},this.pending=!1,this.changing=!1,this.pendingOptions=null,this.trigger("disposed",{store:this})}}yO([RE.dispose()],CO.prototype,"dispose",null);var vO,wO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},xO=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class MO extends RE{constructor(t={}){super();const e=this.constructor,n=e.getDefaults(!0),i=r.merge({},this.preprocess(n),this.preprocess(t));this.id=i.id||s.uuid(),this.store=new CO(i),this.animation=new bO(this),this.setup(),this.init(),this.postprocess(t)}static config(t){const{markup:e,propHooks:n,attrHooks:i}=t,s=xO(t,["markup","propHooks","attrHooks"]);null!=e&&(this.markup=e),n&&(this.propHooks=this.propHooks.slice(),Array.isArray(n)?this.propHooks.push(...n):"function"===typeof n?this.propHooks.push(n):Object.keys(n).forEach(t=>{const e=n[t];"function"===typeof e&&this.propHooks.push(e)})),i&&(this.attrHooks=Object.assign(Object.assign({},this.attrHooks),i)),this.defaults=r.merge({},this.defaults,s)}static getMarkup(){return this.markup}static getDefaults(t){return t?this.defaults:r.cloneDeep(this.defaults)}static getAttrHooks(){return this.attrHooks}static applyPropHooks(t,e){return this.propHooks.reduce((e,n)=>n?a.call(n,t,e):e,e)}get[Symbol.toStringTag](){return MO.toStringTag}init(){}get model(){return this._model}set model(t){this._model!==t&&(this._model=t)}preprocess(t,e){const n=t.id,i=this.constructor,r=i.applyPropHooks(this,t);return null==n&&!0!==e&&(r.id=s.uuid()),r}postprocess(t){}setup(){this.store.on("change:*",t=>{const{key:e,current:n,previous:i,options:r}=t;this.notify("change:*",{key:e,options:r,current:n,previous:i,cell:this}),this.notify("change:"+e,{options:r,current:n,previous:i,cell:this});const s=e;"source"!==s&&"target"!==s||this.notify("change:terminal",{type:s,current:n,previous:i,options:r,cell:this})}),this.store.on("changed",({options:t})=>this.notify("changed",{options:t,cell:this}))}notify(t,e){this.trigger(t,e);const n=this.model;return n&&(n.notify("cell:"+t,e),this.isNode()?n.notify("node:"+t,Object.assign(Object.assign({},e),{node:this})):this.isEdge()&&n.notify("edge:"+t,Object.assign(Object.assign({},e),{edge:this}))),this}isNode(){return!1}isEdge(){return!1}isSameStore(t){return this.store===t.store}get view(){return this.store.get("view")}get shape(){return this.store.get("shape","")}getProp(t,e){return null==t?this.store.get():this.store.get(t,e)}setProp(t,e,n){if("string"===typeof t)this.store.set(t,e,n);else{const n=this.preprocess(t,!0);this.store.set(r.merge({},this.getProp(),n),e),this.postprocess(t)}return this}removeProp(t,e){return"string"===typeof t||Array.isArray(t)?this.store.removeByPath(t,e):this.store.remove(e),this}hasChanged(t){return null==t?this.store.hasChanged():this.store.hasChanged(t)}getPropByPath(t){return this.store.getByPath(t)}setPropByPath(t,e,n={}){return this.model&&("children"===t?this._children=e?e.map(t=>this.model.getCell(t)).filter(t=>null!=t):null:"parent"===t&&(this._parent=e?this.model.getCell(e):null)),this.store.setByPath(t,e,n),this}removePropByPath(t,e={}){const n=Array.isArray(t)?t:t.split("/");return"attrs"===n[0]&&(e.dirty=!0),this.store.removeByPath(n,e),this}prop(t,e,n){return null==t?this.getProp():"string"===typeof t||Array.isArray(t)?1===arguments.length?this.getPropByPath(t):null==e?this.removePropByPath(t,n||{}):this.setPropByPath(t,e,n||{}):this.setProp(t,e||{})}previous(t){return this.store.getPrevious(t)}get zIndex(){return this.getZIndex()}set zIndex(t){null==t?this.removeZIndex():this.setZIndex(t)}getZIndex(){return this.store.get("zIndex")}setZIndex(t,e={}){return this.store.set("zIndex",t,e),this}removeZIndex(t={}){return this.store.remove("zIndex",t),this}toFront(t={}){const e=this.model;if(e){let n,i=e.getMaxZIndex();t.deep?(n=this.getDescendants({deep:!0,breadthFirst:!0}),n.unshift(this)):n=[this],i=i-n.length+1;const r=e.total();let s=e.indexOf(this)!==r-n.length;s||(s=n.some((t,e)=>t.getZIndex()!==i+e)),s&&this.batchUpdate("to-front",()=>{i+=n.length,n.forEach((e,n)=>{e.setZIndex(i+n,t)})})}return this}toBack(t={}){const e=this.model;if(e){let n,i=e.getMinZIndex();t.deep?(n=this.getDescendants({deep:!0,breadthFirst:!0}),n.unshift(this)):n=[this];let r=0!==e.indexOf(this);r||(r=n.some((t,e)=>t.getZIndex()!==i+e)),r&&this.batchUpdate("to-back",()=>{i-=n.length,n.forEach((e,n)=>{e.setZIndex(i+n,t)})})}return this}get markup(){return this.getMarkup()}set markup(t){null==t?this.removeMarkup():this.setMarkup(t)}getMarkup(){let t=this.store.get("markup");if(null==t){const e=this.constructor;t=e.getMarkup()}return t}setMarkup(t,e={}){return this.store.set("markup",t,e),this}removeMarkup(t={}){return this.store.remove("markup",t),this}get attrs(){return this.getAttrs()}set attrs(t){null==t?this.removeAttrs():this.setAttrs(t)}getAttrs(){const t=this.store.get("attrs");return t?Object.assign({},t):{}}setAttrs(t,e={}){if(null==t)this.removeAttrs(e);else{const n=t=>this.store.set("attrs",t,e);if(!0===e.overwrite)n(t);else{const i=this.getAttrs();!1===e.deep?n(Object.assign(Object.assign({},i),t)):n(r.merge({},i,t))}}return this}replaceAttrs(t,e={}){return this.setAttrs(t,Object.assign(Object.assign({},e),{overwrite:!0}))}updateAttrs(t,e={}){return this.setAttrs(t,Object.assign(Object.assign({},e),{deep:!1}))}removeAttrs(t={}){return this.store.remove("attrs",t),this}getAttrDefinition(t){if(!t)return null;const e=this.constructor,n=e.getAttrHooks()||{};let i=n[t]||vM.registry.get(t);if(!i){const e=s.camelCase(t);i=n[e]||vM.registry.get(e)}return i||null}getAttrByPath(t){return null==t||""===t?this.getAttrs():this.getPropByPath(this.prefixAttrPath(t))}setAttrByPath(t,e,n={}){return this.setPropByPath(this.prefixAttrPath(t),e,n),this}removeAttrByPath(t,e={}){return this.removePropByPath(this.prefixAttrPath(t),e),this}prefixAttrPath(t){return Array.isArray(t)?["attrs"].concat(t):"attrs/"+t}attr(t,e,n){return null==t?this.getAttrByPath():"string"===typeof t||Array.isArray(t)?1===arguments.length?this.getAttrByPath(t):null==e?this.removeAttrByPath(t,n||{}):this.setAttrByPath(t,e,n||{}):this.setAttrs(t,e||{})}get visible(){return this.isVisible()}set visible(t){this.setVisible(t)}setVisible(t,e={}){return this.store.set("visible",t,e),this}isVisible(){return!1!==this.store.get("visible")}show(t={}){return this.isVisible()||this.setVisible(!0,t),this}hide(t={}){return this.isVisible()&&this.setVisible(!1,t),this}toggleVisible(t,e={}){const n="boolean"===typeof t?t:!this.isVisible(),i="boolean"===typeof t?e:t;return n?this.show(i):this.hide(i),this}get data(){return this.getData()}set data(t){this.setData(t)}getData(){return this.store.get("data")}setData(t,e={}){if(null==t)this.removeData(e);else{const n=t=>this.store.set("data",t,e);if(!0===e.overwrite)n(t);else{const i=this.getData();!1===e.deep?n("object"===typeof t?Object.assign(Object.assign({},i),t):t):n(r.merge({},i,t))}}return this}replaceData(t,e={}){return this.setData(t,Object.assign(Object.assign({},e),{overwrite:!0}))}updateData(t,e={}){return this.setData(t,Object.assign(Object.assign({},e),{deep:!1}))}removeData(t={}){return this.store.remove("data",t),this}get parent(){return this.getParent()}get children(){return this.getChildren()}getParentId(){return this.store.get("parent")}getParent(){const t=this.getParentId();if(t&&this.model){const e=this.model.getCell(t);return this._parent=e,e}return null}getChildren(){const t=this.store.get("children");if(t&&t.length&&this.model){const e=t.map(t=>{var e;return null===(e=this.model)||void 0===e?void 0:e.getCell(t)}).filter(t=>null!=t);return this._children=e,[...e]}return null}hasParent(){return null!=this.parent}isParentOf(t){return null!=t&&t.getParent()===this}isChildOf(t){return null!=t&&this.getParent()===t}eachChild(t,e){return this.children&&this.children.forEach(t,e),this}filterChild(t,e){return this.children?this.children.filter(t,e):[]}getChildCount(){return null==this.children?0:this.children.length}getChildIndex(t){return null==this.children?-1:this.children.indexOf(t)}getChildAt(t){return null!=this.children&&t>=0?this.children[t]:null}getAncestors(t={}){const e=[];let n=this.getParent();while(n)e.push(n),n=!1!==t.deep?n.getParent():null;return e}getDescendants(t={}){if(!1!==t.deep){if(t.breadthFirst){const t=[],e=this.getChildren()||[];while(e.length>0){const n=e.shift(),i=n.getChildren();t.push(n),i&&e.push(...i)}return t}{const e=this.getChildren()||[];return e.forEach(n=>{e.push(...n.getDescendants(t))}),e}}return this.getChildren()||[]}isDescendantOf(t,e={}){if(null==t)return!1;if(!1!==e.deep){let e=this.getParent();while(e){if(e===t)return!0;e=e.getParent()}return!1}return this.isChildOf(t)}isAncestorOf(t,e={}){return null!=t&&t.isDescendantOf(this,e)}contains(t){return this.isAncestorOf(t)}getCommonAncestor(...t){return MO.getCommonAncestor(this,...t)}setParent(t,e={}){return this._parent=t,t?this.store.set("parent",t.id,e):this.store.remove("parent",e),this}setChildren(t,e={}){return this._children=t,null!=t?this.store.set("children",t.map(t=>t.id),e):this.store.remove("children",e),this}unembed(t,e={}){const n=this.children;if(null!=n&&null!=t){const i=this.getChildIndex(t);-1!==i&&(n.splice(i,1),t.setParent(null,e),this.setChildren(n,e))}return this}embed(t,e={}){return t.addTo(this,e),this}addTo(t,e={}){return MO.isCell(t)?t.addChild(this,e):t.addCell(this,e),this}insertTo(t,e,n={}){return t.insertChild(this,e,n),this}addChild(t,e={}){return this.insertChild(t,void 0,e)}insertChild(t,e,n={}){if(null!=t&&t!==this){const i=t.getParent(),r=this!==i;let s=e;if(null==s&&(s=this.getChildCount(),r||(s-=1)),i){const e=i.getChildren();if(e){const r=e.indexOf(t);r>=0&&(t.setParent(null,n),e.splice(r,1),i.setChildren(e,n))}}let o=this.children;if(null==o?(o=[],o.push(t)):o.splice(s,0,t),t.setParent(this,n),this.setChildren(o,n),r&&this.model){const t=this.model.getIncomingEdges(this),e=this.model.getOutgoingEdges(this);t&&t.forEach(t=>t.updateParent(n)),e&&e.forEach(t=>t.updateParent(n))}this.model&&this.model.addCell(t,n)}return this}removeFromParent(t={}){const e=this.getParent();if(null!=e){const n=e.getChildIndex(this);e.removeChildAt(n,t)}return this}removeChild(t,e={}){const n=this.getChildIndex(t);return this.removeChildAt(n,e)}removeChildAt(t,e={}){const n=this.getChildAt(t),i=this.children;return null!=i&&null!=n&&(this.unembed(n,e),n.remove(e)),n}remove(t={}){return this.batchUpdate("remove",()=>{const e=this.getParent();e&&e.removeChild(this,t),!1!==t.deep&&this.eachChild(e=>e.remove(t)),this.model&&this.model.removeCell(this,t)}),this}transition(t,e,n={},i="/"){return this.animation.start(t,e,n,i)}stopTransition(t,e,n="/"){return this.animation.stop(t,e,n),this}getTransitions(){return this.animation.get()}translate(t,e,n){return this}scale(t,e,n,i){return this}addTools(t,e,n){const i=Array.isArray(t)?t:[t],s="string"===typeof e?e:null,o="object"===typeof e?e:"object"===typeof n?n:{};if(o.reset)return this.setTools({name:s,items:i,local:o.local},o);let a=r.cloneDeep(this.getTools());return null==a||null==s||a.name===s?(null==a&&(a={}),a.items||(a.items=[]),a.name=s,a.items=[...a.items,...i],this.setTools(Object.assign({},a),o)):void 0}setTools(t,e={}){return null==t?this.removeTools():this.store.set("tools",MO.normalizeTools(t),e),this}getTools(){return this.store.get("tools")}removeTools(t={}){return this.store.remove("tools",t),this}hasTools(t){const e=this.getTools();return null!=e&&(null==t||e.name===t)}hasTool(t){const e=this.getTools();return null!=e&&e.items.some(e=>"string"===typeof e?e===t:e.name===t)}removeTool(t,e={}){const n=r.cloneDeep(this.getTools());if(n){let i=!1;const r=n.items.slice(),s=t=>{r.splice(t,1),i=!0};if("number"===typeof t)s(t);else for(let e=r.length-1;e>=0;e-=1){const n=r[e],i="string"===typeof n?n===t:n.name===t;i&&s(e)}i&&(n.items=r,this.setTools(n,e))}return this}getBBox(t){return new KC}getConnectionPoint(t,e){return new ZC}toJSON(t={}){const e=Object.assign({},this.store.get()),n=Object.prototype.toString,i=this.isNode()?"node":this.isEdge()?"edge":"cell";if(!e.shape){const t=this.constructor;throw new Error(`Unable to serialize ${i} missing "shape" prop, check the ${i} "${t.name||n.call(t)}"`)}const s=this.constructor,o=!0===t.diff,a=e.attrs||{},l=s.getDefaults(!0),h=o?this.preprocess(l,!0):l,c=h.attrs||{},u={};Object.keys(e).forEach(t=>{const s=e[t];if(null!=s&&!Array.isArray(s)&&"object"===typeof s&&!r.isPlainObject(s))throw new Error(`Can only serialize ${i} with plain-object props, but got a "${n.call(s)}" type of key "${t}" on ${i} "${this.id}"`);if("attrs"!==t&&"shape"!==t&&o){const n=h[t];r.isEqual(s,n)&&delete e[t]}}),Object.keys(a).forEach(t=>{const e=a[t],n=c[t];Object.keys(e).forEach(i=>{const s=e[i],o=n?n[i]:null;null==s||"object"!==typeof s||Array.isArray(s)?null!=n&&r.isEqual(o,s)||(null==u[t]&&(u[t]={}),u[t][i]=s):Object.keys(s).forEach(e=>{const a=s[e];if(null==n||null==o||!r.isObject(o)||!r.isEqual(o[e],a)){null==u[t]&&(u[t]={}),null==u[t][i]&&(u[t][i]={});const n=u[t][i];n[e]=a}})})});const d=Object.assign(Object.assign({},e),{attrs:r.isEmpty(u)?void 0:u});null==d.attrs&&delete d.attrs;const g=d;return 0===g.angle&&delete g.angle,r.cloneDeep(g)}clone(t={}){if(!t.deep){const e=Object.assign({},this.store.get());t.keepId||delete e.id,delete e.parent,delete e.children;const n=this.constructor;return new n(e)}const e=MO.deepClone(this);return e[this.id]}findView(t){return t.renderer.findViewByCell(this)}startBatch(t,e={},n=this.model){return this.notify("batch:start",{name:t,data:e,cell:this}),n&&n.startBatch(t,Object.assign(Object.assign({},e),{cell:this})),this}stopBatch(t,e={},n=this.model){return n&&n.stopBatch(t,Object.assign(Object.assign({},e),{cell:this})),this.notify("batch:stop",{name:t,data:e,cell:this}),this}batchUpdate(t,e,n){const i=this.model;this.startBatch(t,n,i);const r=e();return this.stopBatch(t,n,i),r}dispose(){this.removeFromParent(),this.store.dispose()}}MO.defaults={},MO.attrHooks={},MO.propHooks=[],wO([RE.dispose()],MO.prototype,"dispose",null),function(t){function e(t){return"string"===typeof t?{items:[t]}:Array.isArray(t)?{items:t}:t.items?t:{items:[t]}}t.normalizeTools=e}(MO||(MO={})),function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.isNode&&"function"===typeof i.isEdge&&"function"===typeof i.prop&&"function"===typeof i.attr}t.toStringTag="X6."+t.name,t.isCell=e}(MO||(MO={})),function(t){function e(...t){const e=t.filter(t=>null!=t).map(t=>t.getAncestors()).sort((t,e)=>t.length-e.length),n=e.shift();return n.find(t=>e.every(e=>e.includes(t)))||null}function n(t,e={}){let n=null;for(let i=0,r=t.length;i<r;i+=1){const r=t[i];let s=r.getBBox(e);if(s){if(r.isNode()){const t=r.getAngle();null!=t&&0!==t&&(s=s.bbox(t))}n=null==n?s:n.union(s)}}return n}function r(e){const n=[e,...e.getDescendants({deep:!0})];return t.cloneCells(n)}function s(t){const e=i.uniq(t),n=e.reduce((t,e)=>(t[e.id]=e.clone(),t),{});return e.forEach(t=>{const e=n[t.id];if(e.isEdge()){const t=e.getSourceCellId(),i=e.getTargetCellId();t&&n[t]&&e.setSource(Object.assign(Object.assign({},e.getSource()),{cell:n[t].id})),i&&n[i]&&e.setTarget(Object.assign(Object.assign({},e.getTarget()),{cell:n[i].id}))}const i=t.getParent();i&&n[i.id]&&e.setParent(n[i.id]);const r=t.getChildren();if(r&&r.length){const t=r.reduce((t,e)=>(n[e.id]&&t.push(n[e.id]),t),[]);t.length>0&&e.setChildren(t)}}),n}t.getCommonAncestor=e,t.getCellsBBox=n,t.deepClone=r,t.cloneCells=s}(MO||(MO={})),function(t){t.config({propHooks(e){var{tools:n}=e,i=xO(e,["tools"]);return n&&(i.tools=t.normalizeTools(n)),i}})}(MO||(MO={})),function(t){let e,n;function i(t,i){return i?null!=e&&e.exist(t):null!=n&&n.exist(t)}function r(t){e=t}function s(t){n=t}t.exist=i,t.setEdgeRegistry=r,t.setNodeRegistry=s}(vO||(vO={}));class EO{constructor(t){this.ports=[],this.groups={},this.init(r.cloneDeep(t))}getPorts(){return this.ports}getGroup(t){return null!=t?this.groups[t]:null}getPortsByGroup(t){return this.ports.filter(e=>e.group===t||null==e.group&&null==t)}getPortsLayoutByGroup(t,e){const n=this.getPortsByGroup(t),i=t?this.getGroup(t):null,r=i?i.position:null,s=r?r.name:null;let o;if(null!=s){const t=pE.registry.get(s);if(null==t)return pE.registry.onNotFound(s);o=t}else o=pE.presets.left;const a=n.map(t=>t&&t.position&&t.position.args||{}),l=r&&r.args||{},h=o(a,e,l);return h.map((t,i)=>{const r=n[i];return{portLayout:t,portId:r.id,portSize:r.size,portAttrs:r.attrs,labelSize:r.label.size,labelLayout:this.getPortLabelLayout(r,ZC.create(t.position),e)}})}init(t){const{groups:e,items:n}=t;null!=e&&Object.keys(e).forEach(t=>{this.groups[t]=this.parseGroup(e[t])}),Array.isArray(n)&&n.forEach(t=>{this.ports.push(this.parsePort(t))})}parseGroup(t){return Object.assign(Object.assign({},t),{label:this.getLabel(t,!0),position:this.getPortPosition(t.position,!0)})}parsePort(t){const e=Object.assign({},t),n=this.getGroup(t.group)||{};return e.markup=e.markup||n.markup,e.attrs=r.merge({},n.attrs,e.attrs),e.position=this.createPosition(n,e),e.label=r.merge({},n.label,this.getLabel(e)),e.zIndex=this.getZIndex(n,e),e.size=Object.assign(Object.assign({},n.size),e.size),e}getZIndex(t,e){return"number"===typeof e.zIndex?e.zIndex:"number"===typeof t.zIndex||"auto"===t.zIndex?t.zIndex:"auto"}createPosition(t,e){return r.merge({name:"left",args:{}},t.position,{args:e.args})}getPortPosition(t,e=!1){if(null==t){if(e)return{name:"left",args:{}}}else{if("string"===typeof t)return{name:t,args:{}};if(Array.isArray(t))return{name:"absolute",args:{x:t[0],y:t[1]}};if("object"===typeof t)return t}return{args:{}}}getPortLabelPosition(t,e=!1){if(null==t){if(e)return{name:"left",args:{}}}else{if("string"===typeof t)return{name:t,args:{}};if("object"===typeof t)return t}return{args:{}}}getLabel(t,e=!1){const n=t.label||{};return n.position=this.getPortLabelPosition(n.position,e),n}getPortLabelLayout(t,e,n){const i=t.label.position.name||"left",r=t.label.position.args||{},s=NE.registry.get(i)||NE.presets.left;return s?s(e,n,r):null}}var AO=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class SO extends MO{constructor(t={}){super(t),this.initPorts()}get[Symbol.toStringTag](){return SO.toStringTag}preprocess(t,e){const{x:n,y:i,width:r,height:s}=t,o=AO(t,["x","y","width","height"]);if(null!=n||null!=i){const t=o.position;o.position=Object.assign(Object.assign({},t),{x:null!=n?n:t?t.x:0,y:null!=i?i:t?t.y:0})}if(null!=r||null!=s){const t=o.size;o.size=Object.assign(Object.assign({},t),{width:null!=r?r:t?t.width:0,height:null!=s?s:t?t.height:0})}return super.preprocess(o,e)}isNode(){return!0}size(t,e,n){return void 0===t?this.getSize():"number"===typeof t?this.setSize(t,e,n):this.setSize(t,e)}getSize(){const t=this.store.get("size");return t?Object.assign({},t):{width:1,height:1}}setSize(t,e,n){return"object"===typeof t?this.resize(t.width,t.height,e):this.resize(t,e,n),this}resize(t,e,n={}){this.startBatch("resize",n);const i=n.direction;if(i){const r=this.getSize();switch(i){case"left":case"right":e=r.height;break;case"top":case"bottom":t=r.width;break;default:break}const s={right:0,"top-right":0,top:1,"top-left":1,left:2,"bottom-left":2,bottom:3,"bottom-right":3};let o=s[i];const a=_C.normalize(this.getAngle()||0);n.absolute&&(o+=Math.floor((a+45)/90),o%=4);const l=this.getBBox();let h;h=0===o?l.getBottomLeft():1===o?l.getCorner():2===o?l.getTopRight():l.getOrigin();const c=h.clone().rotate(-a,l.getCenter()),u=Math.sqrt(t*t+e*e)/2;let d=o*Math.PI/2;d+=Math.atan(o%2===0?e/t:t/e),d-=_C.toRad(a);const g=ZC.fromPolar(u,d,c),p=g.clone().translate(t/-2,e/-2);this.store.set("size",{width:t,height:e},n),this.setPosition(p.x,p.y,n)}else this.store.set("size",{width:t,height:e},n);return this.stopBatch("resize",n),this}scale(t,e,n,i={}){const r=this.getBBox().scale(t,e,null==n?void 0:n);return this.startBatch("scale",i),this.setPosition(r.x,r.y,i),this.resize(r.width,r.height,i),this.stopBatch("scale"),this}position(t,e,n){return"number"===typeof t?this.setPosition(t,e,n):this.getPosition(t)}getPosition(t={}){if(t.relative){const t=this.getParent();if(null!=t&&t.isNode()){const e=this.getPosition(),n=t.getPosition();return{x:e.x-n.x,y:e.y-n.y}}}const e=this.store.get("position");return e?Object.assign({},e):{x:0,y:0}}setPosition(t,e,n={}){let i,r,s;if("object"===typeof t?(i=t.x,r=t.y,s=e||{}):(i=t,r=e,s=n||{}),s.relative){const t=this.getParent();if(null!=t&&t.isNode()){const e=t.getPosition();i+=e.x,r+=e.y}}if(s.deep){const t=this.getPosition();this.translate(i-t.x,r-t.y,s)}else this.store.set("position",{x:i,y:r},s);return this}translate(t=0,e=0,n={}){if(0===t&&0===e)return this;n.translateBy=n.translateBy||this.id;const i=this.getPosition();if(null!=n.restrict&&n.translateBy===this.id){const r=this.getBBox({deep:!0}),s=n.restrict,o=i.x-r.x,a=i.y-r.y,l=Math.max(s.x+o,Math.min(s.x+s.width+o-r.width,i.x+t)),h=Math.max(s.y+a,Math.min(s.y+s.height+a-r.height,i.y+e));t=l-i.x,e=h-i.y}const r={x:i.x+t,y:i.y+e};return n.tx=t,n.ty=e,n.transition?("object"!==typeof n.transition&&(n.transition={}),this.transition("position",r,Object.assign(Object.assign({},n.transition),{interp:GE.object})),this.eachChild(i=>{var r;const s=null===(r=n.exclude)||void 0===r?void 0:r.includes(i);s||i.translate(t,e,n)})):(this.startBatch("translate",n),this.store.set("position",r,n),this.eachChild(i=>{var r;const s=null===(r=n.exclude)||void 0===r?void 0:r.includes(i);s||i.translate(t,e,n)}),this.stopBatch("translate",n)),this}angle(t,e){return null==t?this.getAngle():this.rotate(t,e)}getAngle(){return this.store.get("angle",0)}rotate(t,e={}){const n=this.getAngle();if(e.center){const i=this.getSize(),r=this.getPosition(),s=this.getBBox().getCenter();s.rotate(n-t,e.center);const o=s.x-i.width/2-r.x,a=s.y-i.height/2-r.y;this.startBatch("rotate",{angle:t,options:e}),this.setPosition(r.x+o,r.y+a,e),this.rotate(t,Object.assign(Object.assign({},e),{center:null})),this.stopBatch("rotate")}else this.store.set("angle",e.absolute?t:(n+t)%360,e);return this}getBBox(t={}){if(t.deep){const t=this.getDescendants({deep:!0,breadthFirst:!0});return t.push(this),MO.getCellsBBox(t)}return KC.fromPositionAndSize(this.getPosition(),this.getSize())}getConnectionPoint(t,e){const n=this.getBBox(),i=n.getCenter(),r=t.getTerminal(e);if(null==r)return i;const s=r.port;if(!s||!this.hasPort(s))return i;const o=this.getPort(s);if(!o||!o.group)return i;const a=this.getPortsPosition(o.group),l=a[s].position,h=ZC.create(l).translate(n.getOrigin()),c=this.getAngle();return c&&h.rotate(-c,i),h}fit(t={}){const e=this.getChildren()||[],n=e.filter(t=>t.isNode());if(0===n.length)return this;this.startBatch("fit-embeds",t),t.deep&&n.forEach(e=>e.fit(t));let{x:i,y:r,width:s,height:a}=MO.getCellsBBox(n);const l=o.normalizeSides(t.padding);return i-=l.left,r-=l.top,s+=l.left+l.right,a+=l.bottom+l.top,this.store.set({position:{x:i,y:r},size:{width:s,height:a}},t),this.stopBatch("fit-embeds"),this}get portContainerMarkup(){return this.getPortContainerMarkup()}set portContainerMarkup(t){this.setPortContainerMarkup(t)}getDefaultPortContainerMarkup(){return this.store.get("defaultPortContainerMarkup")||iA.getPortContainerMarkup()}getPortContainerMarkup(){return this.store.get("portContainerMarkup")||this.getDefaultPortContainerMarkup()}setPortContainerMarkup(t,e={}){return this.store.set("portContainerMarkup",iA.clone(t),e),this}get portMarkup(){return this.getPortMarkup()}set portMarkup(t){this.setPortMarkup(t)}getDefaultPortMarkup(){return this.store.get("defaultPortMarkup")||iA.getPortMarkup()}getPortMarkup(){return this.store.get("portMarkup")||this.getDefaultPortMarkup()}setPortMarkup(t,e={}){return this.store.set("portMarkup",iA.clone(t),e),this}get portLabelMarkup(){return this.getPortLabelMarkup()}set portLabelMarkup(t){this.setPortLabelMarkup(t)}getDefaultPortLabelMarkup(){return this.store.get("defaultPortLabelMarkup")||iA.getPortLabelMarkup()}getPortLabelMarkup(){return this.store.get("portLabelMarkup")||this.getDefaultPortLabelMarkup()}setPortLabelMarkup(t,e={}){return this.store.set("portLabelMarkup",iA.clone(t),e),this}get ports(){const t=this.store.get("ports",{items:[]});return null==t.items&&(t.items=[]),t}getPorts(){return r.cloneDeep(this.ports.items)}getPortsByGroup(t){return this.getPorts().filter(e=>e.group===t)}getPort(t){return r.cloneDeep(this.ports.items.find(e=>e.id&&e.id===t))}getPortAt(t){return this.ports.items[t]||null}hasPorts(){return this.ports.items.length>0}hasPort(t){return-1!==this.getPortIndex(t)}getPortIndex(t){const e="string"===typeof t?t:t.id;return null!=e?this.ports.items.findIndex(t=>t.id===e):-1}getPortsPosition(t){const e=this.getSize(),n=this.port.getPortsLayoutByGroup(t,new KC(0,0,e.width,e.height));return n.reduce((t,e)=>{const n=e.portLayout;return t[e.portId]={position:Object.assign({},n.position),angle:n.angle||0},t},{})}getPortProp(t,e){return this.getPropByPath(this.prefixPortPath(t,e))}setPortProp(t,e,n,i){if("string"===typeof e||Array.isArray(e)){const r=this.prefixPortPath(t,e),s=n;return this.setPropByPath(r,s,i)}const r=this.prefixPortPath(t),s=e;return this.setPropByPath(r,s,n)}removePortProp(t,e,n){return"string"===typeof e||Array.isArray(e)?this.removePropByPath(this.prefixPortPath(t,e),n):this.removePropByPath(this.prefixPortPath(t),e)}portProp(t,e,n,i){return null==e?this.getPortProp(t):"string"===typeof e||Array.isArray(e)?2===arguments.length?this.getPortProp(t,e):null==n?this.removePortProp(t,e,i):this.setPortProp(t,e,n,i):this.setPortProp(t,e,n)}prefixPortPath(t,e){const n=this.getPortIndex(t);if(-1===n)throw new Error(`Unable to find port with id: "${t}"`);return null==e||""===e?["ports","items",""+n]:Array.isArray(e)?["ports","items",""+n,...e]:`ports/items/${n}/${e}`}addPort(t,e){const n=[...this.ports.items];return n.push(t),this.setPropByPath("ports/items",n,e),this}addPorts(t,e){return this.setPropByPath("ports/items",[...this.ports.items,...t],e),this}insertPort(t,e,n){const i=[...this.ports.items];return i.splice(t,0,e),this.setPropByPath("ports/items",i,n),this}removePort(t,e={}){return this.removePortAt(this.getPortIndex(t),e)}removePortAt(t,e={}){if(t>=0){const n=[...this.ports.items];n.splice(t,1),e.rewrite=!0,this.setPropByPath("ports/items",n,e)}return this}removePorts(t,e){let n;if(Array.isArray(t)){if(n=e||{},t.length){n.rewrite=!0;const e=[...this.ports.items],i=e.filter(e=>!t.some(t=>{const n="string"===typeof t?t:t.id;return e.id===n}));this.setPropByPath("ports/items",i,n)}}else n=t||{},n.rewrite=!0,this.setPropByPath("ports/items",[],n);return this}getParsedPorts(){return this.port.getPorts()}getParsedGroups(){return this.port.groups}getPortsLayoutByGroup(t,e){return this.port.getPortsLayoutByGroup(t,e)}initPorts(){this.updatePortData(),this.on("change:ports",()=>{this.processRemovedPort(),this.updatePortData()})}processRemovedPort(){const t=this.ports,e={};t.items.forEach(t=>{t.id&&(e[t.id]=!0)});const n={},i=this.store.getPrevious("ports")||{items:[]};i.items.forEach(t=>{t.id&&!e[t.id]&&(n[t.id]=!0)});const s=this.model;if(s&&!r.isEmpty(n)){const t=s.getConnectedEdges(this,{incoming:!0});t.forEach(t=>{const e=t.getTargetPortId();e&&n[e]&&t.remove()});const e=s.getConnectedEdges(this,{outgoing:!0});e.forEach(t=>{const e=t.getSourcePortId();e&&n[e]&&t.remove()})}}validatePorts(){const t={},e=[];return this.ports.items.forEach(n=>{"object"!==typeof n&&e.push(`Invalid port ${n}.`),null==n.id&&(n.id=this.generatePortId()),t[n.id]&&e.push("Duplicitied port id."),t[n.id]=!0}),e}generatePortId(){return s.uuid()}updatePortData(){const t=this.validatePorts();if(t.length>0)throw this.store.set("ports",this.store.getPrevious("ports")),new Error(t.join(" "));const e=this.port?this.port.getPorts():null;this.port=new EO(this.ports);const n=this.port.getPorts(),i=e?n.filter(t=>e.find(e=>e.id===t.id)?null:t):[...n],r=e?e.filter(t=>n.find(e=>e.id===t.id)?null:t):[];i.length>0&&this.notify("ports:added",{added:i,cell:this,node:this}),r.length>0&&this.notify("ports:removed",{removed:r,cell:this,node:this})}}SO.defaults={angle:0,position:{x:0,y:0},size:{width:1,height:1}},function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.isNode&&"function"===typeof i.isEdge&&"function"===typeof i.prop&&"function"===typeof i.attr&&"function"===typeof i.size&&"function"===typeof i.position}t.toStringTag="X6."+t.name,t.isNode=e}(SO||(SO={})),function(t){t.config({propHooks(t){var{ports:e}=t,n=AO(t,["ports"]);return e&&(n.ports=Array.isArray(e)?{items:e}:e),n}})}(SO||(SO={})),function(t){t.registry=Gw.create({type:"node",process(e,n){if(vO.exist(e,!0))throw new Error(`Node with name '${e}' was registered by anthor Edge`);if("function"===typeof n)return n.config({shape:e}),n;let i=t;const{inherit:r}=n,s=AO(n,["inherit"]);if(r)if("string"===typeof r){const t=this.get(r);null==t?this.onNotFound(r,"inherited"):i=t}else i=r;null==s.constructorName&&(s.constructorName=e);const o=i.define.call(i,s);return o.config({shape:e}),o}}),vO.setNodeRegistry(t.registry)}(SO||(SO={})),function(t){let e=0;function n(t){return t?s.pascalCase(t):(e+=1,"CustomNode"+e)}function i(e){const{constructorName:i,overwrite:s}=e,o=AO(e,["constructorName","overwrite"]),a=r.createClass(n(i||o.shape),this);return a.config(o),o.shape&&t.registry.register(o.shape,a,s),a}function o(e){const n=e.shape||"rect",i=t.registry.get(n);return i?new i(e):t.registry.onNotFound(n)}t.define=i,t.create=o}(SO||(SO={}));var OO=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class PO extends SO{get label(){return this.getLabel()}set label(t){this.setLabel(t)}getLabel(){return this.getAttrByPath("text/text")}setLabel(t,e){return null==t?this.removeLabel():this.setAttrByPath("text/text",t,e),this}removeLabel(){return this.removeAttrByPath("text/text"),this}}(function(t){t.bodyAttr={fill:"#ffffff",stroke:"#333333",strokeWidth:2},t.labelAttr={fontSize:14,fill:"#000000",refX:.5,refY:.5,textAnchor:"middle",textVerticalAnchor:"middle",fontFamily:"Arial, helvetica, sans-serif"},t.config({attrs:{text:Object.assign({},t.labelAttr)},propHooks(t){const{label:e}=t,n=OO(t,["label"]);return e&&r.setByPath(n,"attrs/text/text",e),n},visible:!0})})(PO||(PO={}));var kO=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};function DO(t,e=!1){return`<g class="rotatable"><g class="scalable"><${t}/></g>${e?"":"<text/>"}</g>`}function TO(t){return"basic."+t}function NO(t="xlink:href"){const e=e=>{const{imageUrl:n,imageWidth:i,imageHeight:r}=e,s=kO(e,["imageUrl","imageWidth","imageHeight"]);if(null!=n||null!=i||null!=r){const e=()=>{if(s.attrs){const e=s.attrs.image;null!=n&&(e[t]=n),null!=i&&(e.width=i),null!=r&&(e.height=r),s.attrs.image=e}};s.attrs?(null==s.attrs.image&&(s.attrs.image={}),e()):(s.attrs={image:{}},e())}return s};return e}function jO(t,e,n={}){const i=TO(t),s={constructorName:i,attrs:{".":{fill:"#ffffff",stroke:"none"},[t]:{fill:"#ffffff",stroke:"#000000"}}};n.ignoreMarkup||(s.markup=DO(t,!0===n.noText));const o=n.parent||PO;return o.define(r.merge(s,e,{shape:i}))}jO("rect",{attrs:{rect:{width:100,height:60}}}),jO("circle",{width:60,height:60,attrs:{circle:{r:30,cx:30,cy:30}}}),jO("ellipse",{width:60,height:40,attrs:{ellipse:{rx:30,ry:20,cx:30,cy:20}}}),jO("polygon",{width:60,height:40,attrs:{text:{refY:null,refDy:16}}}),jO("polyline",{width:60,height:40,attrs:{text:{refY:null,refDy:16}}}),jO("image",{attrs:{text:{refY:null,refDy:16}},propHooks:NO()});var LO=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const FO=jO("path",{width:60,height:60,attrs:{text:{ref:"path",refY:null,refDy:16}},propHooks(t){const{d:e}=t,n=LO(t,["d"]);return null!=e&&r.setByPath(n,"attrs/path/d",e),n}});jO("rhombus",{d:"M 30 0 L 60 30 30 60 0 30 z",attrs:{text:{refY:.5,refDy:null}}},{parent:FO,ignoreMarkup:!0}),jO("cylinder",{width:40,height:40,attrs:{path:{fill:"#FFFFFF",stroke:"#cbd2d7",strokeWidth:3,d:["M 0 10 C 10 5, 30 5, 40 10 C 30 15, 10 15, 0 10","L 0 20","C 10 25, 30 25, 40 20","L 40 10"].join(" ")},text:{refY:.7,refDy:null,fill:"#435460"}}},{parent:FO,ignoreMarkup:!0});var zO=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class BO extends MO{constructor(t={}){super(t)}get[Symbol.toStringTag](){return BO.toStringTag}preprocess(t,e){const{source:n,sourceCell:i,sourcePort:r,sourcePoint:s,target:o,targetCell:a,targetPort:l,targetPoint:h}=t,c=zO(t,["source","sourceCell","sourcePort","sourcePoint","target","targetCell","targetPort","targetPoint"]),u=c,d=t=>"string"===typeof t||"number"===typeof t;if(null!=n)if(MO.isCell(n))u.source={cell:n.id};else if(d(n))u.source={cell:n};else if(ZC.isPoint(n))u.source=n.toJSON();else if(Array.isArray(n))u.source={x:n[0],y:n[1]};else{const t=n.cell;MO.isCell(t)?u.source=Object.assign(Object.assign({},n),{cell:t.id}):u.source=n}if(null!=i||null!=r){let t=u.source;if(null!=i){const e=d(i)?i:i.id;t?t.cell=e:t=u.source={cell:e}}null!=r&&t&&(t.port=r)}else null!=s&&(u.source=ZC.create(s).toJSON());if(null!=o)if(MO.isCell(o))u.target={cell:o.id};else if(d(o))u.target={cell:o};else if(ZC.isPoint(o))u.target=o.toJSON();else if(Array.isArray(o))u.target={x:o[0],y:o[1]};else{const t=o.cell;MO.isCell(t)?u.target=Object.assign(Object.assign({},o),{cell:t.id}):u.target=o}if(null!=a||null!=l){let t=u.target;if(null!=a){const e=d(a)?a:a.id;t?t.cell=e:t=u.target={cell:e}}null!=l&&t&&(t.port=l)}else null!=h&&(u.target=ZC.create(h).toJSON());return super.preprocess(u,e)}setup(){super.setup(),this.on("change:labels",t=>this.onLabelsChanged(t)),this.on("change:vertices",t=>this.onVertexsChanged(t))}isEdge(){return!0}disconnect(t={}){return this.store.set({source:{x:0,y:0},target:{x:0,y:0}},t),this}get source(){return this.getSource()}set source(t){this.setSource(t)}getSource(){return this.getTerminal("source")}getSourceCellId(){return this.source.cell}getSourcePortId(){return this.source.port}setSource(t,e,n={}){return this.setTerminal("source",t,e,n)}get target(){return this.getTarget()}set target(t){this.setTarget(t)}getTarget(){return this.getTerminal("target")}getTargetCellId(){return this.target.cell}getTargetPortId(){return this.target.port}setTarget(t,e,n={}){return this.setTerminal("target",t,e,n)}getTerminal(t){return Object.assign({},this.store.get(t))}setTerminal(t,e,n,i={}){if(MO.isCell(e))return this.store.set(t,r.merge({},n,{cell:e.id}),i),this;const s=e;return ZC.isPoint(e)||null!=s.x&&null!=s.y?(this.store.set(t,r.merge({},n,{x:s.x,y:s.y}),i),this):(this.store.set(t,r.cloneDeep(e),i),this)}getSourcePoint(){return this.getTerminalPoint("source")}getTargetPoint(){return this.getTerminalPoint("target")}getTerminalPoint(t){const e=this[t];if(ZC.isPointLike(e))return ZC.create(e);const n=this.getTerminalCell(t);return n?n.getConnectionPoint(this,t):new ZC}getSourceCell(){return this.getTerminalCell("source")}getTargetCell(){return this.getTerminalCell("target")}getTerminalCell(t){if(this.model){const e="source"===t?this.getSourceCellId():this.getTargetCellId();if(e)return this.model.getCell(e)}return null}getSourceNode(){return this.getTerminalNode("source")}getTargetNode(){return this.getTerminalNode("target")}getTerminalNode(t){let e=this;const n={};while(e&&e.isEdge()){if(n[e.id])return null;n[e.id]=!0,e=e.getTerminalCell(t)}return e&&e.isNode()?e:null}get router(){return this.getRouter()}set router(t){null==t?this.removeRouter():this.setRouter(t)}getRouter(){return this.store.get("router")}setRouter(t,e,n){return"object"===typeof t?this.store.set("router",t,e):this.store.set("router",{name:t,args:e},n),this}removeRouter(t={}){return this.store.remove("router",t),this}get connector(){return this.getConnector()}set connector(t){null==t?this.removeConnector():this.setConnector(t)}getConnector(){return this.store.get("connector")}setConnector(t,e,n){return"object"===typeof t?this.store.set("connector",t,e):this.store.set("connector",{name:t,args:e},n),this}removeConnector(t={}){return this.store.remove("connector",t)}get strategy(){return this.getStrategy()}set strategy(t){null==t?this.removeStrategy():this.setStrategy(t)}getStrategy(){return this.store.get("strategy")}setStrategy(t,e,n){return"object"===typeof t?this.store.set("strategy",t,e):this.store.set("strategy",{name:t,args:e},n),this}removeStrategy(t={}){return this.store.remove("strategy",t)}getDefaultLabel(){const t=this.constructor,e=this.store.get("defaultLabel")||t.defaultLabel||{};return r.cloneDeep(e)}get labels(){return this.getLabels()}set labels(t){this.setLabels(t)}getLabels(){return[...this.store.get("labels",[])].map(t=>this.parseLabel(t))}setLabels(t,e={}){return this.store.set("labels",Array.isArray(t)?t:[t],e),this}insertLabel(t,e,n={}){const i=this.getLabels(),r=i.length;let s=null!=e&&Number.isFinite(e)?e:r;return s<0&&(s=r+s+1),i.splice(s,0,this.parseLabel(t)),this.setLabels(i,n)}appendLabel(t,e={}){return this.insertLabel(t,-1,e)}getLabelAt(t){const e=this.getLabels();return null!=t&&Number.isFinite(t)?this.parseLabel(e[t]):null}setLabelAt(t,e,n={}){if(null!=t&&Number.isFinite(t)){const i=this.getLabels();i[t]=this.parseLabel(e),this.setLabels(i,n)}return this}removeLabelAt(t,e={}){const n=this.getLabels(),i=null!=t&&Number.isFinite(t)?t:-1,r=n.splice(i,1);return this.setLabels(n,e),r.length?r[0]:null}parseLabel(t){if("string"===typeof t){const e=this.constructor;return e.parseStringLabel(t)}return t}onLabelsChanged({previous:t,current:e}){const n=t&&e?e.filter(e=>t.find(t=>e===t||r.isEqual(e,t))?null:e):e?[...e]:[],i=t&&e?t.filter(t=>e.find(e=>t===e||r.isEqual(t,e))?null:t):t?[...t]:[];n.length>0&&this.notify("labels:added",{added:n,cell:this,edge:this}),i.length>0&&this.notify("labels:removed",{removed:i,cell:this,edge:this})}get vertexMarkup(){return this.getVertexMarkup()}set vertexMarkup(t){this.setVertexMarkup(t)}getDefaultVertexMarkup(){return this.store.get("defaultVertexMarkup")||iA.getEdgeVertexMarkup()}getVertexMarkup(){return this.store.get("vertexMarkup")||this.getDefaultVertexMarkup()}setVertexMarkup(t,e={}){return this.store.set("vertexMarkup",iA.clone(t),e),this}get vertices(){return this.getVertices()}set vertices(t){this.setVertices(t)}getVertices(){return[...this.store.get("vertices",[])]}setVertices(t,e={}){const n=Array.isArray(t)?t:[t];return this.store.set("vertices",n.map(t=>ZC.toJSON(t)),e),this}insertVertex(t,e,n={}){const i=this.getVertices(),r=i.length;let s=null!=e&&Number.isFinite(e)?e:r;return s<0&&(s=r+s+1),i.splice(s,0,ZC.toJSON(t)),this.setVertices(i,n)}appendVertex(t,e={}){return this.insertVertex(t,-1,e)}getVertexAt(t){if(null!=t&&Number.isFinite(t)){const e=this.getVertices();return e[t]}return null}setVertexAt(t,e,n={}){if(null!=t&&Number.isFinite(t)){const i=this.getVertices();i[t]=e,this.setVertices(i,n)}return this}removeVertexAt(t,e={}){const n=this.getVertices(),i=null!=t&&Number.isFinite(t)?t:-1;return n.splice(i,1),this.setVertices(n,e)}onVertexsChanged({previous:t,current:e}){const n=t&&e?e.filter(e=>t.find(t=>ZC.equals(e,t))?null:e):e?[...e]:[],i=t&&e?t.filter(t=>e.find(e=>ZC.equals(t,e))?null:t):t?[...t]:[];n.length>0&&this.notify("vertexs:added",{added:n,cell:this,edge:this}),i.length>0&&this.notify("vertexs:removed",{removed:i,cell:this,edge:this})}getDefaultMarkup(){return this.store.get("defaultMarkup")||iA.getEdgeMarkup()}getMarkup(){return super.getMarkup()||this.getDefaultMarkup()}get toolMarkup(){return this.getToolMarkup()}set toolMarkup(t){this.setToolMarkup(t)}getDefaultToolMarkup(){return this.store.get("defaultToolMarkup")||iA.getEdgeToolMarkup()}getToolMarkup(){return this.store.get("toolMarkup")||this.getDefaultToolMarkup()}setToolMarkup(t,e={}){return this.store.set("toolMarkup",t,e),this}get doubleToolMarkup(){return this.getDoubleToolMarkup()}set doubleToolMarkup(t){this.setDoubleToolMarkup(t)}getDefaultDoubleToolMarkup(){return this.store.get("defaultDoubleToolMarkup")}getDoubleToolMarkup(){return this.store.get("doubleToolMarkup")||this.getDefaultDoubleToolMarkup()}setDoubleToolMarkup(t,e={}){return this.store.set("doubleToolMarkup",t,e),this}get arrowheadMarkup(){return this.getArrowheadMarkup()}set arrowheadMarkup(t){this.setArrowheadMarkup(t)}getDefaultArrowheadMarkup(){return this.store.get("defaultArrowheadMarkup")||iA.getEdgeArrowheadMarkup()}getArrowheadMarkup(){return this.store.get("arrowheadMarkup")||this.getDefaultArrowheadMarkup()}setArrowheadMarkup(t,e={}){return this.store.set("arrowheadMarkup",t,e),this}translate(t,e,n={}){return n.translateBy=n.translateBy||this.id,n.tx=t,n.ty=e,this.applyToPoints(n=>({x:(n.x||0)+t,y:(n.y||0)+e}),n)}scale(t,e,n,i={}){return this.applyToPoints(i=>ZC.create(i).scale(t,e,n).toJSON(),i)}applyToPoints(t,e={}){const n={},i=this.getSource(),r=this.getTarget();ZC.isPointLike(i)&&(n.source=t(i)),ZC.isPointLike(r)&&(n.target=t(r));const s=this.getVertices();return s.length>0&&(n.vertices=s.map(t)),this.store.set(n,e),this}getBBox(){return this.getPolyline().bbox()}getConnectionPoint(){return this.getPolyline().pointAt(.5)}getPolyline(){const t=[this.getSourcePoint(),...this.getVertices().map(t=>ZC.create(t)),this.getTargetPoint()];return new ev(t)}updateParent(t){let e=null;const n=this.getSourceCell(),i=this.getTargetCell(),r=this.getParent();return n&&i&&(e=n===i||n.isDescendantOf(i)?i:i.isDescendantOf(n)?n:MO.getCommonAncestor(n,i)),!r||e&&e.id===r.id||r.unembed(this,t),e&&e.embed(this,t),e}hasLoop(t={}){const e=this.getSource(),n=this.getTarget(),i=e.cell,r=n.cell;if(!i||!r)return!1;let s=i===r;if(!s&&t.deep&&this._model){const e=this.getSourceCell(),n=this.getTargetCell();e&&n&&(s=e.isAncestorOf(n,t)||n.isAncestorOf(e,t))}return s}getFragmentAncestor(){const t=[this,this.getSourceNode(),this.getTargetNode()].filter(t=>null!=t);return this.getCommonAncestor(...t)}isFragmentDescendantOf(t){const e=this.getFragmentAncestor();return!!e&&(e.id===t.id||e.isDescendantOf(t))}}BO.defaults={},function(t){function e(t,e){const n=t,i=e;return n.cell===i.cell&&(n.port===i.port||null==n.port&&null==i.port)}t.equalTerminals=e}(BO||(BO={})),function(t){function e(t){return{attrs:{label:{text:t}}}}t.defaultLabel={markup:[{tagName:"rect",selector:"body"},{tagName:"text",selector:"label"}],attrs:{text:{fill:"#000",fontSize:14,textAnchor:"middle",textVerticalAnchor:"middle",pointerEvents:"none"},rect:{ref:"label",fill:"#fff",rx:3,ry:3,refWidth:1,refHeight:1,refX:0,refY:0}},position:{distance:.5}},t.parseStringLabel=e}(BO||(BO={})),function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.isNode&&"function"===typeof i.isEdge&&"function"===typeof i.prop&&"function"===typeof i.attr&&"function"===typeof i.disconnect&&"function"===typeof i.getSource&&"function"===typeof i.getTarget}t.toStringTag="X6."+t.name,t.isEdge=e}(BO||(BO={})),function(t){t.registry=Gw.create({type:"edge",process(e,n){if(vO.exist(e,!1))throw new Error(`Edge with name '${e}' was registered by anthor Node`);if("function"===typeof n)return n.config({shape:e}),n;let i=t;const{inherit:r="edge"}=n,s=zO(n,["inherit"]);if("string"===typeof r){const t=this.get(r||"edge");null==t&&r?this.onNotFound(r,"inherited"):i=t}else i=r;null==s.constructorName&&(s.constructorName=e);const o=i.define.call(i,s);return o.config({shape:e}),o}}),vO.setEdgeRegistry(t.registry)}(BO||(BO={})),function(t){let e=0;function n(t){return t?s.pascalCase(t):(e+=1,"CustomEdge"+e)}function i(e){const{constructorName:i,overwrite:s}=e,o=zO(e,["constructorName","overwrite"]),a=r.createClass(n(i||o.shape),this);return a.config(o),o.shape&&t.registry.register(o.shape,a,s),a}function o(e){const n=e.shape||"edge",i=t.registry.get(n);return i?new i(e):t.registry.onNotFound(n)}t.define=i,t.create=o}(BO||(BO={})),function(t){const e="basic.edge";t.config({shape:e,propHooks(e){const{label:n,vertices:i}=e,r=zO(e,["label","vertices"]);if(n){null==r.labels&&(r.labels=[]);const e="string"===typeof n?t.parseStringLabel(n):n;r.labels.push(e)}return i&&Array.isArray(i)&&(r.vertices=i.map(t=>ZC.create(t).toJSON())),r}}),t.registry.register(e,t)}(BO||(BO={}));var RO=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class IO extends lA{constructor(){super(...arguments),this.POINT_ROUNDING=2,this.markerCache={}}get[Symbol.toStringTag](){return IO.toStringTag}getContainerClassName(){return[super.getContainerClassName(),this.prefixClassName("edge")].join(" ")}get sourceBBox(){const t=this.sourceView;if(!t){const t=this.cell.getSource();return new KC(t.x,t.y)}const e=this.sourceMagnet;return t.isEdgeElement(e)?new KC(this.sourceAnchor.x,this.sourceAnchor.y):t.getBBoxOfElement(e||t.container)}get targetBBox(){const t=this.targetView;if(!t){const t=this.cell.getTarget();return new KC(t.x,t.y)}const e=this.targetMagnet;return t.isEdgeElement(e)?new KC(this.targetAnchor.x,this.targetAnchor.y):t.getBBoxOfElement(e||t.container)}isEdgeView(){return!0}confirmUpdate(t,e={}){let n=t;if(this.hasAction(n,"source")){if(!this.updateTerminalProperties("source"))return n;n=this.removeAction(n,"source")}if(this.hasAction(n,"target")){if(!this.updateTerminalProperties("target"))return n;n=this.removeAction(n,"target")}const i=this.graph,r=this.sourceView,s=this.targetView;return i&&(r&&!i.renderer.isViewMounted(r)||s&&!i.renderer.isViewMounted(s))?n:this.hasAction(n,"render")?(this.render(),n=this.removeAction(n,["render","update","vertices","labels","tools","widget"]),n):(n=this.handleAction(n,"vertices",()=>this.renderVertexMarkers()),n=this.handleAction(n,"update",()=>this.update(null,e)),n=this.handleAction(n,"labels",()=>this.onLabelsChange(e)),n=this.handleAction(n,"tools",()=>{this.renderTools(),this.updateToolsPosition()}),n=this.handleAction(n,"widget",()=>this.renderExternalTools()),n)}onLabelsChange(t={}){this.shouldRerenderLabels(t)?this.renderLabels():this.updateLabels(),this.updateLabelPositions()}shouldRerenderLabels(t={}){const e=this.cell.previous("labels");if(null==e)return!0;if("propertyPathArray"in t&&"propertyValue"in t){const n=t.propertyPathArray||[],i=n.length;if(i>1){const s=n[1];if(e[s]){if(2===i)return"object"===typeof t.propertyValue&&r.has(t.propertyValue,"markup");if("markup"!==n[2])return!1}}}return!0}render(){return this.empty(),this.containers={},this.renderMarkup(),this.renderLabels(),this.update(),this.renderExternalTools(),this}renderMarkup(){const t=this.cell.markup;if(t)return"string"===typeof t?this.renderStringMarkup(t):this.renderJSONMarkup(t);throw new TypeError("Invalid edge markup.")}renderJSONMarkup(t){const e=this.parseJSONMarkup(t,this.container);this.selectors=e.selectors,this.container.append(e.fragment)}renderStringMarkup(t){const e=this.containers,n=Mv.createVectors(t);n.forEach(t=>{const n=t.attr("class");n&&(e[s.camelCase(n)]=t.node)}),this.renderTools(),this.renderVertexMarkers(),this.renderArrowheadMarkers(),h.append(this.container,n.map(t=>t.node))}renderLabels(){const t=this.cell,e=t.getLabels(),n=e.length;let i=this.containers.labels;if(this.labelCache={},this.labelSelectors={},n<=0)return i&&i.parentNode&&i.parentNode.removeChild(i),this;i?this.empty(i):(i=h.createSvgElement("g"),this.addClass(this.prefixClassName("edge-labels"),i),this.containers.labels=i);for(let r=0,s=e.length;r<s;r+=1){const n=e[r],s=this.normalizeLabelMarkup(this.parseLabelMarkup(n.markup));let o,a;if(s)o=s.node,a=s.selectors;else{const e=t.getDefaultLabel(),n=this.normalizeLabelMarkup(this.parseLabelMarkup(e.markup));o=n.node,a=n.selectors}o.setAttribute("data-index",""+r),i.appendChild(o);const l=this.rootSelector;if(a[l])throw new Error("Ambiguous label root selector.");a[l]=o,this.labelCache[r]=o,this.labelSelectors[r]=a}return null==i.parentNode&&this.container.appendChild(i),this.updateLabels(),this.customizeLabels(),this}parseLabelMarkup(t){return t?"string"===typeof t?this.parseLabelStringMarkup(t):this.parseJSONMarkup(t):null}parseLabelStringMarkup(t){const e=Mv.createVectors(t),n=document.createDocumentFragment();for(let i=0,r=e.length;i<r;i+=1){const t=e[i].node;n.appendChild(t)}return{fragment:n,selectors:{}}}normalizeLabelMarkup(t){if(null==t)return;const e=t.fragment;if(!(e instanceof DocumentFragment)||!e.hasChildNodes())throw new Error("Invalid label markup.");let n;const i=e.childNodes;return n=i.length>1||"G"!==i[0].nodeName.toUpperCase()?Mv.create("g").append(e):Mv.create(i[0]),n.addClass(this.prefixClassName("edge-label")),{node:n.node,selectors:t.selectors}}updateLabels(){if(this.containers.labels){const t=this.cell,e=t.labels,n=this.can("edgeLabelMovable"),i=t.getDefaultLabel();for(let s=0,o=e.length;s<o;s+=1){const t=this.labelCache[s],o=this.labelSelectors[s];t.setAttribute("cursor",n?"move":"default");const a=e[s],l=r.merge({},i.attrs,a.attrs);this.updateAttrs(t,l,{selectors:o,rootBBox:a.size?KC.fromSize(a.size):void 0})}}}mergeLabelAttrs(t,e,n){if(null===e)return null;if(void 0===e){if(null===n)return null;if(void 0===n)return;return t?n:r.merge({},n)}return t?r.merge({},n,e):void 0}customizeLabels(){if(this.containers.labels){const t=this.cell,e=t.labels;for(let n=0,i=e.length;n<i;n+=1){const i=e[n],r=this.labelCache[n],s=this.labelSelectors[n];this.graph.hook.onEdgeLabelRendered({edge:t,label:i,container:r,selectors:s})}}}renderTools(){const t=this.containers.tools;if(null==t)return this;const e=this.cell.toolMarkup,n=this.$(t).empty();if(iA.isStringMarkup(e)){let t=s.template(e);const i=Mv.create(t());if(n.append(i.node),this.toolCache=i.node,this.options.doubleTools){let e;const r=this.cell.doubleToolMarkup;iA.isStringMarkup(r)?(t=s.template(r),e=Mv.create(t())):e=i.clone(),n.append(e.node),this.tool2Cache=e.node}}return this}renderExternalTools(){const t=this.cell.getTools();return this.addTools(t),this}renderVertexMarkers(){const t=this.containers.vertices;if(null==t)return this;const e=this.cell.vertexMarkup,n=this.$(t).empty();if(iA.isStringMarkup(e)){const t=s.template(e);this.cell.getVertices().forEach((e,i)=>{n.append(Mv.create(t(Object.assign({index:i},e))).node)})}return this}renderArrowheadMarkers(){const t=this.containers.arrowheads;if(null==t)return this;const e=this.cell.arrowheadMarkup,n=this.$(t).empty();if(iA.isStringMarkup(e)){const t=s.template(e),i=Mv.create(t({end:"source"})).node,r=Mv.create(t({end:"target"})).node;this.containers.sourceArrowhead=i,this.containers.targetArrowhead=r,n.append(i,r)}return this}update(t,e={}){this.cleanCache(),this.updateConnection(e);const n=this.cell.getAttrs();return null!=n&&this.updateAttrs(this.container,n,{attrs:t===n?null:t,selectors:this.selectors}),this.updateConnectionPath(),this.updateLabelPositions(),this.updateToolsPosition(),this.updateArrowheadMarkers(),this.updateTools(e),this}removeRedundantLinearVertices(t={}){const e=this.cell,n=e.getVertices(),i=[this.sourceAnchor,...n,this.targetAnchor],r=i.length,s=new ev(i);s.simplify({threshold:.01});const o=s.points.map(t=>t.toJSON()),a=o.length;return r===a?0:(e.setVertices(o.slice(1,a-1),t),r-a)}updateConnectionPath(){const t=this.containers;if(t.connection){const e=this.getConnectionPathData();t.connection.setAttribute("d",e)}if(t.connectionWrap){const e=this.getConnectionPathData();t.connectionWrap.setAttribute("d",e)}t.sourceMarker&&t.targetMarker&&this.translateAndAutoOrientArrows(t.sourceMarker,t.targetMarker)}getTerminalView(t){switch(t){case"source":return this.sourceView||null;case"target":return this.targetView||null;default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalAnchor(t){switch(t){case"source":return ZC.create(this.sourceAnchor);case"target":return ZC.create(this.targetAnchor);default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalConnectionPoint(t){switch(t){case"source":return ZC.create(this.sourcePoint);case"target":return ZC.create(this.targetPoint);default:throw new Error(`Unknown terminal type '${t}'`)}}getTerminalMagnet(t,e={}){switch(t){case"source":{if(e.raw)return this.sourceMagnet;const t=this.sourceView;return t?this.sourceMagnet||t.container:null}case"target":{if(e.raw)return this.targetMagnet;const t=this.targetView;return t?this.targetMagnet||t.container:null}default:throw new Error(`Unknown terminal type '${t}'`)}}updateConnection(t={}){const e=this.cell;if(t.translateBy&&e.isFragmentDescendantOf(t.translateBy)){const e=t.tx||0,n=t.ty||0;this.routePoints=new ev(this.routePoints).translate(e,n).points,this.translateConnectionPoints(e,n),this.path.translate(e,n)}else{const t=e.getVertices(),n=this.findAnchors(t);this.sourceAnchor=n.source,this.targetAnchor=n.target,this.routePoints=this.findRoutePoints(t);const i=this.findConnectionPoints(this.routePoints,this.sourceAnchor,this.targetAnchor);this.sourcePoint=i.source,this.targetPoint=i.target;const r=this.findMarkerPoints(this.routePoints,this.sourcePoint,this.targetPoint);this.path=this.findPath(this.routePoints,r.source||this.sourcePoint,r.target||this.targetPoint)}this.cleanCache()}findAnchors(t){const e=this.cell,n=e.source,i=e.target,r=t[0],s=t[t.length-1];return i.priority&&!n.priority?this.findAnchorsOrdered("target",s,"source",r):this.findAnchorsOrdered("source",r,"target",s)}findAnchorsOrdered(t,e,n,i){let r,s;const o=this.cell,a=o[t],l=o[n],h=this.getTerminalView(t),c=this.getTerminalView(n),u=this.getTerminalMagnet(t),d=this.getTerminalMagnet(n);if(h){let n;n=e?ZC.create(e):c?d:ZC.create(l),r=this.getAnchor(a.anchor,h,u,n,t)}else r=ZC.create(a);if(c){const t=ZC.create(i||r);s=this.getAnchor(l.anchor,c,d,t,n)}else s=ZC.isPointLike(l)?ZC.create(l):new ZC;return{[t]:r,[n]:s}}getAnchor(t,e,n,i,r){const s=e.isEdgeElement(n),o=this.graph.options.connecting;let l,h="string"===typeof t?{name:t}:t;if(!h){const t=s?("source"===r?o.sourceEdgeAnchor:o.targetEdgeAnchor)||o.edgeAnchor:("source"===r?o.sourceAnchor:o.targetAnchor)||o.anchor;h="string"===typeof t?{name:t}:t}if(!h)throw new Error("Anchor should be specified.");const c=h.name;if(s){const t=KA.registry.get(c);if("function"!==typeof t)return KA.registry.onNotFound(c);l=a.call(t,this,e,n,i,h.args||{},r)}else{const t=UA.registry.get(c);if("function"!==typeof t)return UA.registry.onNotFound(c);l=a.call(t,this,e,n,i,h.args||{},r)}return l?l.round(this.POINT_ROUNDING):new ZC}findRoutePoints(t=[]){const e=this.graph.options.connecting.router||ZS.presets.normal,n=this.cell.getRouter()||e;let i;if("function"===typeof n)i=a.call(n,this,t,{},this);else{const e="string"===typeof n?n:n.name,r="string"===typeof n?{}:n.args||{},s=e?ZS.registry.get(e):ZS.presets.normal;if("function"!==typeof s)return ZS.registry.onNotFound(e);i=a.call(s,this,t,r,this)}return null==i?t.map(t=>ZC.create(t)):i.map(t=>ZC.create(t))}findConnectionPoints(t,e,n){const i=this.cell,r=this.graph.options.connecting,s=i.getSource(),o=i.getTarget(),a=this.sourceView,l=this.targetView,h=t[0],c=t[t.length-1];let u,d;if(a&&!a.isEdgeElement(this.sourceMagnet)){const t=this.sourceMagnet||a.container,i=h||n,o=new QC(i,e),l=s.connectionPoint||r.sourceConnectionPoint||r.connectionPoint;u=this.getConnectionPoint(l,a,t,o,"source")}else u=e;if(l&&!l.isEdgeElement(this.targetMagnet)){const t=this.targetMagnet||l.container,i=o.connectionPoint||r.targetConnectionPoint||r.connectionPoint,s=c||e,a=new QC(s,n);d=this.getConnectionPoint(i,l,t,a,"target")}else d=n;return{source:u,target:d}}getConnectionPoint(t,e,n,i,r){const s=i.end;if(null==t)return s;const o="string"===typeof t?t:t.name,l="string"===typeof t?{}:t.args,h=aS.registry.get(o);if("function"!==typeof h)return aS.registry.onNotFound(o);const c=a.call(h,this,i,e,n,l||{},r);return c?c.round(this.POINT_ROUNDING):s}updateMarkerAttr(t){const e=this.cell.getAttrs(),n=`.${t}-marker`,i=e&&e[n];i&&this.updateAttrs(this.container,{},{attrs:{[n]:i},selectors:this.selectors})}findMarkerPoints(t,e,n){const i=t=>{const e=this.cell.getAttrs(),n=Object.keys(e);for(let i=0,r=n.length;i<r;i+=1){const r=e[n[i]];if(r[t+"Marker"]||r[t+"-marker"]){const t=r.strokeWidth||r["stroke-width"];if(t)return parseFloat(t);break}}return null},r=t[0],s=t[t.length-1],o=this.containers.sourceMarker,a=this.containers.targetMarker,l=this.markerCache;let c,u;if(o){if(this.updateMarkerAttr("source"),l.sourceBBox=l.sourceBBox||h.getBBox(o),l.sourceBBox.width>0){const t=h.scale(o);c=e.clone().move(r||n,l.sourceBBox.width*t.sx*-1)}}else{const t=i("source");t&&(c=e.clone().move(r||n,-t))}if(a){if(this.updateMarkerAttr("target"),l.targetBBox=l.targetBBox||h.getBBox(a),l.targetBBox.width>0){const t=h.scale(a);u=n.clone().move(s||e,l.targetBBox.width*t.sx*-1)}}else{const t=i("target");t&&(u=n.clone().move(s||e,-t))}return l.sourcePoint=c||e.clone(),l.targetPoint=u||n.clone(),{source:c,target:u}}findPath(t,e,n){const i=this.cell.getConnector()||this.graph.options.connecting.connector;let r,s,o;if("string"===typeof i?r=i:(r=i.name,s=i.args),r){const t=fO.registry.get(r);if("function"!==typeof t)return fO.registry.onNotFound(r);o=t}else o=fO.presets.normal;const l=a.call(o,this,e,n,t,Object.assign(Object.assign({},s),{raw:!0}),this);return"string"===typeof l?xv.parse(l):l}translateConnectionPoints(t,e){const n=this.markerCache;n.sourcePoint&&n.sourcePoint.translate(t,e),n.targetPoint&&n.targetPoint.translate(t,e),this.sourcePoint.translate(t,e),this.targetPoint.translate(t,e),this.sourceAnchor.translate(t,e),this.targetAnchor.translate(t,e)}updateLabelPositions(){if(null==this.containers.labels)return this;const t=this.path;if(!t)return this;const e=this.cell,n=e.getLabels();if(0===n.length)return this;const i=e.getDefaultLabel(),s=this.normalizeLabelPosition(i.position);for(let o=0,a=n.length;o<a;o+=1){const t=n[o],e=this.labelCache[o];if(!e)continue;const i=this.normalizeLabelPosition(t.position),a=r.merge({},s,i),l=this.getLabelTransformationMatrix(a);e.setAttribute("transform",h.matrixToTransformString(l))}return this}updateToolsPosition(){if(null==this.containers.tools)return this;let t="",e=this.options.toolsOffset;const n=this.getConnectionLength();if(null!=n){n<this.options.shortLength&&(t="scale(.5)",e/=2);let i=this.getPointAtLength(e);if(null!=i&&h.attr(this.toolCache,"transform",`translate(${i.x},${i.y}) ${t}`),this.options.doubleTools&&n>=this.options.longLength){const r=this.options.doubleToolsOffset||e;i=this.getPointAtLength(n-r),null!=i&&h.attr(this.tool2Cache,"transform",`translate(${i.x},${i.y}) ${t}`),h.attr(this.tool2Cache,"visibility","visible")}else this.options.doubleTools&&h.attr(this.tool2Cache,"visibility","hidden")}return this}updateArrowheadMarkers(){const t=this.containers.arrowheads;if(null==t)return this;if("none"===t.style.display)return this;const e=this.containers.sourceArrowhead,n=this.containers.targetArrowhead;if(e&&n){const t=this.getConnectionLength()||0,i=t<this.options.shortLength?.5:1;h.scale(e,i),h.scale(n,i),this.translateAndAutoOrientArrows(e,n)}return this}updateTerminalProperties(t){const e=this.cell,n=this.graph,i=e[t],r=i&&i.cell,s=t+"View";if(!r)return this[s]=null,this.updateTerminalMagnet(t),!0;const o=n.getCellById(r);if(!o)throw new Error(`Edge's ${t} node with id "${r}" not exists`);const a=o.findView(n);return!!a&&(this[s]=a,this.updateTerminalMagnet(t),!0)}updateTerminalMagnet(t){const e=t+"Magnet",n=this.getTerminalView(t);if(n){let i=n.getMagnetFromEdgeTerminal(this.cell[t]);i===n.container&&(i=null),this[e]=i}else this[e]=null}translateAndAutoOrientArrows(t,e){const n=this.routePoints;t&&h.translateAndAutoOrient(t,this.sourcePoint,n[0]||this.targetPoint,this.graph.view.stage),e&&h.translateAndAutoOrient(e,this.targetPoint,n[n.length-1]||this.sourcePoint,this.graph.view.stage)}getLabelPositionAngle(t){const e=this.cell.getLabelAt(t);return e&&e.position&&"object"===typeof e.position&&e.position.angle||0}getLabelPositionArgs(t){const e=this.cell.getLabelAt(t);if(e&&e.position&&"object"===typeof e.position)return e.position.options}getDefaultLabelPositionArgs(){const t=this.cell.getDefaultLabel();if(t&&t.position&&"object"===typeof t.position)return t.position.options}mergeLabelPositionArgs(t,e){return null===t?null:void 0===t?null===e?null:e:r.merge({},e,t)}addLabel(t,e,n,i){let r,s,o,a=0;"number"!==typeof t?(r=t.x,s=t.y,"number"===typeof e?(a=e,o=n):o=e):(r=t,s=e,"number"===typeof n?(a=n,o=i):o=n);const l=this.getDefaultLabelPositionArgs(),h=o,c=this.mergeLabelPositionArgs(h,l),u={position:this.getLabelPosition(r,s,a,c)},d=-1;return this.cell.insertLabel(u,d,o),d}addVertex(t,e,n){const i="number"!==typeof t,r=i?t.x:t,s=i?t.y:e,o=i?e:n,a={x:r,y:s},l=this.getVertexIndex(r,s);return this.cell.insertVertex(a,l,o),l}sendToken(t,e,n){let i,r,s,o,a="linear";"object"===typeof e?(i=e.duration,r=!0===e.reversed,s=e.selector,!1===e.rotate?o="":!0===e.rotate?o="auto":null!=e.rotate&&(o=""+e.rotate),e.timing&&(a=e.timing)):(i=e,r=!1,s=null),i=i||1e3;const l={dur:i+"ms",repeatCount:"1",calcMode:a,fill:"freeze"};if(o&&(l.rotate=o),r&&(l.keyPoints="1;0",l.keyTimes="0;1"),"object"===typeof e){const{duration:t,reversed:n,selector:i,rotate:r,timing:s}=e,o=RO(e,["duration","reversed","selector","rotate","timing"]);Object.keys(o).forEach(t=>{l[t]=o[t]})}let c;if(c="string"===typeof s?this.findOne(s,this.container,this.selectors):this.containers.connection?this.containers.connection:this.container.querySelector("path"),!(c instanceof SVGPathElement))throw new Error("Token animation requires a valid connection path.");const u="string"===typeof t?this.findOne(t):t;if(null==u)throw new Error("Token animation requires a valid token element.");const d=u.parentNode,g=()=>{d||h.remove(u)},p=Mv.create(u);d||p.appendTo(this.graph.view.stage);const f=l.complete;l.complete=t=>{g(),n&&n(),f&&f(t)};const m=p.animateAlongPath(l,c);return()=>{g(),m()}}getConnection(){return null!=this.path?this.path.clone():null}getConnectionPathData(){if(null==this.path)return"";const t=this.cache.pathCache;return r.has(t,"data")||(t.data=this.path.serialize()),t.data||""}getConnectionSubdivisions(){if(null==this.path)return null;const t=this.cache.pathCache;return r.has(t,"segmentSubdivisions")||(t.segmentSubdivisions=this.path.getSegmentSubdivisions()),t.segmentSubdivisions}getConnectionLength(){if(null==this.path)return 0;const t=this.cache.pathCache;return r.has(t,"length")||(t.length=this.path.length({segmentSubdivisions:this.getConnectionSubdivisions()})),t.length}getPointAtLength(t){return null==this.path?null:this.path.pointAtLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getPointAtRatio(t){return null==this.path?null:(o.isPercentage(t)&&(t=parseFloat(t)/100),this.path.pointAt(t,{segmentSubdivisions:this.getConnectionSubdivisions()}))}getTangentAtLength(t){return null==this.path?null:this.path.tangentAtLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getTangentAtRatio(t){return null==this.path?null:this.path.tangentAt(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPoint(t){return null==this.path?null:this.path.closestPoint(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointLength(t){return null==this.path?null:this.path.closestPointLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getClosestPointRatio(t){return null==this.path?null:this.path.closestPointNormalizedLength(t,{segmentSubdivisions:this.getConnectionSubdivisions()})}getLabelPosition(t,e,n,i){const r={distance:0};let s,o=0;"number"===typeof n?(o=n,s=i):s=n,null!=s&&(r.options=s);const a=s&&s.absoluteOffset,l=!(s&&s.absoluteDistance),h=s&&s.absoluteDistance&&s.reverseDistance,c=this.path,u={segmentSubdivisions:this.getConnectionSubdivisions()},d=new ZC(t,e),g=c.closestPointT(d,u),p=this.getConnectionLength()||0;let f,m,b=c.lengthAtT(g,u);if(l&&(b=p>0?b/p:0),h&&(b=-1*(p-b)||1),r.distance=b,a||(f=c.tangentAtT(g)),f)m=f.pointOffset(d);else{const t=c.pointAtT(g),e=d.diff(t);m={x:e.x,y:e.y}}return r.offset=m,r.angle=o,r}normalizeLabelPosition(t){return"number"===typeof t?{distance:t}:t}getLabelTransformationMatrix(t){const e=this.normalizeLabelPosition(t),n=e.options||{},i=e.angle||0,r=e.distance,s=r>0&&r<=1;let o=0;const a={x:0,y:0},l=e.offset;l&&("number"===typeof l?o=l:(null!=l.x&&(a.x=l.x),null!=l.y&&(a.y=l.y)));const c=0!==a.x||0!==a.y||0===o,u=n.keepGradient,d=n.ensureLegibility,g=this.path,p={segmentSubdivisions:this.getConnectionSubdivisions()},f=s?r*this.getConnectionLength():r,m=g.tangentAtLength(f,p);let b,y=i;if(m){if(c)b=m.start,b.translate(a);else{const t=m.clone();t.rotate(-90,m.start),t.setLength(o),b=t.end}u&&(y=m.angle()+i,d&&(y=_C.normalize((y+90)%180-90)))}else b=g.start,c&&b.translate(a);return h.createSVGMatrix().translate(b.x,b.y).rotate(y)}getLabelCoordinates(t){const e=this.getLabelTransformationMatrix(t);return new ZC(e.e,e.f)}getVertexIndex(t,e){const n=this.cell,i=n.getVertices(),r=this.getClosestPointLength(new ZC(t,e));let s=0;if(null!=r)for(const o=i.length;s<o;s+=1){const t=i[s],e=this.getClosestPointLength(t);if(null!=e&&r<e)break}return s}getEventArgs(t,e,n){const i=this,r=i.cell,s=r;return null==e||null==n?{e:t,view:i,edge:r,cell:s}:{e:t,x:e,y:n,view:i,edge:r,cell:s}}notifyUnhandledMouseDown(t,e,n){this.notify("edge:unhandled:mousedown",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})}notifyMouseDown(t,e,n){super.onMouseDown(t,e,n),this.notify("edge:mousedown",this.getEventArgs(t,e,n))}notifyMouseMove(t,e,n){super.onMouseMove(t,e,n),this.notify("edge:mousemove",this.getEventArgs(t,e,n))}notifyMouseUp(t,e,n){super.onMouseUp(t,e,n),this.notify("edge:mouseup",this.getEventArgs(t,e,n))}onClick(t,e,n){super.onClick(t,e,n),this.notify("edge:click",this.getEventArgs(t,e,n))}onDblClick(t,e,n){super.onDblClick(t,e,n),this.notify("edge:dblclick",this.getEventArgs(t,e,n))}onContextMenu(t,e,n){super.onContextMenu(t,e,n),this.notify("edge:contextmenu",this.getEventArgs(t,e,n))}onMouseDown(t,e,n){this.notifyMouseDown(t,e,n);const i=t.target.getAttribute("class");switch(i){case"vertex":return void this.startVertexDragging(t,e,n);case"vertex-remove":case"vertex-remove-area":return void this.handleVertexRemoving(t,e,n);case"connection":case"connection-wrap":return void this.handleVertexAdding(t,e,n);case"arrowhead":return void this.startArrowheadDragging(t,e,n);case"source-marker":case"target-marker":return void this.notifyUnhandledMouseDown(t,e,n);default:break}this.startEdgeDragging(t,e,n)}onMouseMove(t,e,n){const i=this.getEventData(t);switch(i.action){case"drag-vertex":this.dragVertex(t,e,n);break;case"drag-label":this.dragLabel(t,e,n);break;case"drag-arrowhead":this.dragArrowhead(t,e,n);break;case"drag-edge":this.dragEdge(t,e,n);break;default:break}return this.notifyMouseMove(t,e,n),i}onMouseUp(t,e,n){const i=this.getEventData(t);switch(i.action){case"drag-vertex":this.stopVertexDragging(t,e,n);break;case"drag-label":this.stopLabelDragging(t,e,n);break;case"drag-arrowhead":this.stopArrowheadDragging(t,e,n);break;case"drag-edge":this.stopEdgeDragging(t,e,n);break;default:break}return this.notifyMouseUp(t,e,n),this.checkMouseleave(t),i}onMouseOver(t){super.onMouseOver(t),this.notify("edge:mouseover",this.getEventArgs(t))}onMouseOut(t){super.onMouseOut(t),this.notify("edge:mouseout",this.getEventArgs(t))}onMouseEnter(t){super.onMouseEnter(t),this.notify("edge:mouseenter",this.getEventArgs(t))}onMouseLeave(t){super.onMouseLeave(t),this.notify("edge:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,i){super.onMouseWheel(t,e,n,i),this.notify("edge:mousewheel",Object.assign({delta:i},this.getEventArgs(t,e,n)))}onCustomEvent(t,e,n,i){const r=h.findParentByClass(t.target,"edge-tool",this.container);if(r){if(t.stopPropagation(),this.can("useEdgeTools")){if("edge:remove"===e)return void this.cell.remove({ui:!0});this.notify("edge:customevent",Object.assign({name:e},this.getEventArgs(t,n,i)))}this.notifyMouseDown(t,n,i)}else this.notify("edge:customevent",Object.assign({name:e},this.getEventArgs(t,n,i))),super.onCustomEvent(t,e,n,i)}onLabelMouseDown(t,e,n){this.notifyMouseDown(t,e,n),this.startLabelDragging(t,e,n);const i=this.getEventData(t).stopPropagation;i&&t.stopPropagation()}startEdgeDragging(t,e,n){this.can("edgeMovable")?this.setEventData(t,{x:e,y:n,moving:!1,action:"drag-edge"}):this.notifyUnhandledMouseDown(t,e,n)}dragEdge(t,e,n){const i=this.getEventData(t);i.moving||(i.moving=!0,this.addClass("edge-moving"),this.notify("edge:move",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})),this.cell.translate(e-i.x,n-i.y,{ui:!0}),this.setEventData(t,{x:e,y:n}),this.notify("edge:moving",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})}stopEdgeDragging(t,e,n){const i=this.getEventData(t);i.moving&&(this.removeClass("edge-moving"),this.notify("edge:moved",{e:t,x:e,y:n,view:this,cell:this.cell,edge:this.cell})),i.moving=!1}prepareArrowheadDragging(t,e){const n=this.getTerminalMagnet(t),i={action:"drag-arrowhead",x:e.x,y:e.y,isNewEdge:!0===e.isNewEdge,terminalType:t,initialMagnet:n,initialTerminal:r.clone(this.cell[t]),fallbackAction:e.fallbackAction||"revert",getValidateConnectionArgs:this.createValidateConnectionArgs(t),options:e.options};return this.beforeArrowheadDragging(i),i}createValidateConnectionArgs(t){const e=[];let n;e[4]=t,e[5]=this;let i=0,r=0;"source"===t?(i=2,n="target"):(r=2,n="source");const s=this.cell[n],o=s.cell;if(o){let t;const n=e[i]=this.graph.renderer.findViewByCell(o);n&&(t=n.getMagnetFromEdgeTerminal(s),t===n.container&&(t=void 0)),e[i+1]=t}return(t,n)=>(e[r]=t,e[r+1]=t.container===n?void 0:n,e)}beforeArrowheadDragging(t){t.zIndex=this.cell.zIndex,this.cell.toFront();const e=this.container.style;t.pointerEvents=e.pointerEvents,e.pointerEvents="none",this.graph.options.connecting.highlight&&this.highlightAvailableMagnets(t)}afterArrowheadDragging(t){null!=t.zIndex&&(this.cell.setZIndex(t.zIndex,{ui:!0}),t.zIndex=null);const e=this.container;e.style.pointerEvents=t.pointerEvents||"",this.graph.options.connecting.highlight&&this.unhighlightAvailableMagnets(t)}arrowheadDragging(t,e,n,i){i.x=e,i.y=n,i.currentTarget!==t&&(i.currentMagnet&&i.currentView&&i.currentView.unhighlight(i.currentMagnet,{type:"magnetAdsorbed"}),i.currentView=this.graph.renderer.findViewByElem(t),i.currentView?(i.currentMagnet=i.currentView.findMagnet(t),i.currentMagnet&&this.graph.hook.validateConnection(...i.getValidateConnectionArgs(i.currentView,i.currentMagnet),i.currentView.getEdgeTerminal(i.currentMagnet,e,n,this.cell,i.terminalType))?i.currentView.highlight(i.currentMagnet,{type:"magnetAdsorbed"}):i.currentMagnet=null):i.currentMagnet=null),i.currentTarget=t,this.cell.prop(i.terminalType,{x:e,y:n},Object.assign(Object.assign({},i.options),{ui:!0}))}arrowheadDragged(t,e,n){const i=t.currentView,r=t.currentMagnet;if(!r||!i)return;i.unhighlight(r,{type:"magnetAdsorbed"});const s=t.terminalType,o=i.getEdgeTerminal(r,e,n,this.cell,s);this.cell.setTerminal(s,o,{ui:!0})}snapArrowhead(t,e,n){const i=this.graph,{snap:r,allowEdge:s}=i.options.connecting,o="object"===typeof r&&r.radius||50,a={x:t-o,y:e-o,width:2*o,height:2*o},l=i.renderer.findViewsInArea(a);if(s){const t=i.renderer.findEdgeViewsInArea(a).filter(t=>t!==this);l.push(...t)}const h=n.closestView||null,c=n.closestMagnet||null;let u;n.closestView=null,n.closestMagnet=null;let d=Number.MAX_SAFE_INTEGER;const g=new ZC(t,e);let p;l.forEach(r=>{"false"!==r.container.getAttribute("magnet")&&(u=r.cell.getBBox().getCenter().distance(g),u<o&&u<d&&(c===r.container||i.hook.validateConnection(...n.getValidateConnectionArgs(r,null),r.getEdgeTerminal(r.container,t,e,this.cell,n.terminalType)))&&(d=u,n.closestView=r,n.closestMagnet=r.container)),r.container.querySelectorAll("[magnet]").forEach(s=>{if("false"!==s.getAttribute("magnet")){const a=r.getBBoxOfElement(s);u=g.distance(a.getCenter()),u<o&&u<d&&(c===s||i.hook.validateConnection(...n.getValidateConnectionArgs(r,s),r.getEdgeTerminal(s,t,e,this.cell,n.terminalType)))&&(d=u,n.closestView=r,n.closestMagnet=s)}})});const f=n.terminalType,m=n.closestView,b=n.closestMagnet,y=c!==b;if(h&&y&&h.unhighlight(c,{type:"magnetAdsorbed"}),m){if(!y)return;m.highlight(b,{type:"magnetAdsorbed"}),p=m.getEdgeTerminal(b,t,e,this.cell,f)}else p={x:t,y:e};this.cell.setTerminal(f,p,{},Object.assign(Object.assign({},n.options),{ui:!0}))}snapArrowheadEnd(t){const e=t.closestView,n=t.closestMagnet;e&&n&&(e.unhighlight(n,{type:"magnetAdsorbed"}),t.currentMagnet=e.findMagnet(n)),t.closestView=null,t.closestMagnet=null}finishEmbedding(t){this.graph.options.embedding.enabled&&this.cell.updateParent()&&(t.zIndex=null)}fallbackConnection(t){switch(t.fallbackAction){case"remove":this.cell.remove({ui:!0});break;case"revert":default:this.cell.prop(t.terminalType,t.initialTerminal,{ui:!0});break}}notifyConnectionEvent(t,e){const n=t.terminalType,i=t.initialTerminal,r=this.cell[n],s=r&&!BO.equalTerminals(i,r);if(s){const s=this.graph,o=i,a=o.cell?s.getCellById(o.cell):null,l=o.port,h=a?s.findViewByCell(a):null,c=a||t.isNewEdge?null:ZC.create(i).toJSON(),u=r,d=u.cell?s.getCellById(u.cell):null,g=u.port,p=d?s.findViewByCell(d):null,f=d?null:ZC.create(r).toJSON();this.notify("edge:connected",{e:e,previousCell:a,previousPort:l,previousView:h,previousPoint:c,currentCell:d,currentView:p,currentPort:g,currentPoint:f,previousMagnet:t.initialMagnet,currentMagnet:t.currentMagnet,edge:this.cell,view:this,type:n,isNew:t.isNewEdge})}}highlightAvailableMagnets(t){const e=this.graph,n=e.model.getCells();t.marked={};for(let i=0,r=n.length;i<r;i+=1){const r=e.renderer.findViewByCell(n[i]);if(!r)continue;const s=Array.prototype.slice.call(r.container.querySelectorAll("[magnet]"));"false"!==r.container.getAttribute("magnet")&&s.push(r.container);const o=s.filter(n=>e.hook.validateConnection(...t.getValidateConnectionArgs(r,n),r.getEdgeTerminal(n,t.x,t.y,this.cell,t.terminalType)));if(o.length>0){for(let t=0,e=o.length;t<e;t+=1)r.highlight(o[t],{type:"magnetAvailable"});r.highlight(null,{type:"nodeAvailable"}),t.marked[r.cell.id]=o}}}unhighlightAvailableMagnets(t){const e=t.marked||{};Object.keys(e).forEach(t=>{const n=this.graph.renderer.findViewByCell(t);if(n){const i=e[t];i.forEach(t=>{n.unhighlight(t,{type:"magnetAvailable"})}),n.unhighlight(null,{type:"nodeAvailable"})}}),t.marked=null}startArrowheadDragging(t,e,n){if(!this.can("arrowheadMovable"))return void this.notifyUnhandledMouseDown(t,e,n);const i=t.target,r=i.getAttribute("data-terminal"),s=this.prepareArrowheadDragging(r,{x:e,y:n});this.setEventData(t,s)}dragArrowhead(t,e,n){const i=this.getEventData(t);this.graph.options.connecting.snap?this.snapArrowhead(e,n,i):this.arrowheadDragging(this.getEventTarget(t),e,n,i)}stopArrowheadDragging(t,e,n){const i=this.graph,r=this.getEventData(t);i.options.connecting.snap?this.snapArrowheadEnd(r):this.arrowheadDragged(r,e,n);const s=i.hook.validateEdge(this.cell,r.terminalType,r.initialTerminal);s?(this.finishEmbedding(r),this.notifyConnectionEvent(r,t)):this.fallbackConnection(r),this.afterArrowheadDragging(r)}startLabelDragging(t,e,n){if(this.can("edgeLabelMovable")){const e=t.currentTarget,n=parseInt(e.getAttribute("data-index"),10),i=this.getLabelPositionAngle(n),r=this.getLabelPositionArgs(n),s=this.getDefaultLabelPositionArgs(),o=this.mergeLabelPositionArgs(r,s);this.setEventData(t,{index:n,positionAngle:i,positionArgs:o,stopPropagation:!0,action:"drag-label"})}else this.setEventData(t,{stopPropagation:!0});this.graph.view.delegateDragEvents(t,this)}dragLabel(t,e,n){const i=this.getEventData(t),s=this.cell.getLabelAt(i.index),o=r.merge({},s,{position:this.getLabelPosition(e,n,i.positionAngle,i.positionArgs)});this.cell.setLabelAt(i.index,o)}stopLabelDragging(t,e,n){}handleVertexAdding(t,e,n){if(!this.can("vertexAddable"))return void this.notifyUnhandledMouseDown(t,e,n);const i=this.addVertex({x:e,y:n},{ui:!0});this.setEventData(t,{index:i,action:"drag-vertex"})}handleVertexRemoving(t,e,n){if(!this.can("vertexDeletable"))return void this.notifyUnhandledMouseDown(t,e,n);const i=t.target,r=parseInt(i.getAttribute("idx"),10);this.cell.removeVertexAt(r)}startVertexDragging(t,e,n){if(!this.can("vertexMovable"))return void this.notifyUnhandledMouseDown(t,e,n);const i=t.target,r=parseInt(i.getAttribute("idx"),10);this.setEventData(t,{index:r,action:"drag-vertex"})}dragVertex(t,e,n){const i=this.getEventData(t);this.cell.setVertexAt(i.index,{x:e,y:n},{ui:!0})}stopVertexDragging(t,e,n){}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.isNodeView&&"function"===typeof i.isEdgeView&&"function"===typeof i.confirmUpdate&&"function"===typeof i.update&&"function"===typeof i.getConnection}t.toStringTag="X6."+t.name,t.isEdgeView=e})(IO||(IO={})),IO.config({isSvgElement:!0,priority:1,bootstrap:["render","source","target"],actions:{view:["render"],markup:["render"],attrs:["update"],source:["source","update"],target:["target","update"],router:["update"],connector:["update"],labels:["labels"],defaultLabel:["labels"],vertices:["vertices","update"],vertexMarkup:["vertices"],toolMarkup:["tools"],tools:["widget"]},shortLength:105,longLength:155,toolsOffset:40,doubleTools:!1,doubleToolsOffset:65,sampleInterval:50}),IO.registry.register("edge",IO,!0);class VO extends lA{constructor(){super(...arguments),this.scalableNode=null,this.rotatableNode=null,this.scalableSelector="scalable",this.rotatableSelector="rotatable",this.defaultPortMarkup=iA.getPortMarkup(),this.defaultPortLabelMarkup=iA.getPortLabelMarkup(),this.defaultPortContainerMarkup=iA.getPortContainerMarkup(),this.portsCache={}}get[Symbol.toStringTag](){return VO.toStringTag}getContainerClassName(){const t=[super.getContainerClassName(),this.prefixClassName("node")];return this.can("nodeMovable")||t.push(this.prefixClassName("node-immovable")),t.join(" ")}updateClassName(t){const e=t.target;if(e.hasAttribute("magnet")){const t=this.prefixClassName("port-unconnectable");this.can("magnetConnectable")?h.removeClass(e,t):h.addClass(e,t)}else{const t=this.prefixClassName("node-immovable");this.can("nodeMovable")?this.removeClass(t):this.addClass(t)}}isNodeView(){return!0}confirmUpdate(t,e={}){let n=t;return this.hasAction(n,"ports")&&(this.removePorts(),this.cleanPortsCache()),this.hasAction(n,"render")?(this.render(),n=this.removeAction(n,["render","update","resize","translate","rotate","ports","tools"])):(n=this.handleAction(n,"resize",()=>this.resize(e),"update"),n=this.handleAction(n,"update",()=>this.update(),UM.useCSSSelector?"ports":null),n=this.handleAction(n,"translate",()=>this.translate()),n=this.handleAction(n,"rotate",()=>this.rotate()),n=this.handleAction(n,"ports",()=>this.renderPorts()),n=this.handleAction(n,"tools",()=>this.renderTools())),n}update(t){this.cleanCache(),UM.useCSSSelector&&this.removePorts();const e=this.cell,n=e.getSize(),i=e.getAttrs();this.updateAttrs(this.container,i,{attrs:t===i?null:t,rootBBox:new KC(0,0,n.width,n.height),selectors:this.selectors,scalableNode:this.scalableNode,rotatableNode:this.rotatableNode}),UM.useCSSSelector&&this.renderPorts()}renderMarkup(){const t=this.cell.markup;if(t)return"string"===typeof t?this.renderStringMarkup(t):this.renderJSONMarkup(t);throw new TypeError("Invalid node markup.")}renderJSONMarkup(t){const e=this.parseJSONMarkup(t,this.container),n=t=>Array.isArray(t)?t[0]:t;this.selectors=e.selectors,this.rotatableNode=n(this.selectors[this.rotatableSelector]),this.scalableNode=n(this.selectors[this.scalableSelector]),this.container.appendChild(e.fragment)}renderStringMarkup(t){h.append(this.container,Mv.toNodes(Mv.createVectors(t))),this.rotatableNode=h.findOne(this.container,"."+this.rotatableSelector),this.scalableNode=h.findOne(this.container,"."+this.scalableSelector),this.selectors={},this.rootSelector&&(this.selectors[this.rootSelector]=this.container)}render(){return this.empty(),this.renderMarkup(),this.scalableNode&&this.update(),this.resize(),this.rotatableNode?(this.rotate(),this.translate()):this.updateTransform(),UM.useCSSSelector||this.renderPorts(),this.renderTools(),this}resize(t={}){if(this.scalableNode)return this.updateSize(t);this.cell.getAngle()&&this.rotate(),this.update()}translate(){if(this.rotatableNode)return this.updateTranslation();this.updateTransform()}rotate(){if(this.rotatableNode)return this.updateRotation(),void this.update();this.updateTransform()}getTranslationString(){const t=this.cell.getPosition();return`translate(${t.x},${t.y})`}getRotationString(){const t=this.cell.getAngle();if(t){const e=this.cell.getSize();return`rotate(${t},${e.width/2},${e.height/2})`}}updateTransform(){let t=this.getTranslationString();const e=this.getRotationString();e&&(t+=" "+e),this.container.setAttribute("transform",t)}updateRotation(){if(null!=this.rotatableNode){const t=this.getRotationString();null!=t?this.rotatableNode.setAttribute("transform",t):this.rotatableNode.removeAttribute("transform")}}updateTranslation(){this.container.setAttribute("transform",this.getTranslationString())}updateSize(t={}){const e=this.cell,n=e.getSize(),i=e.getAngle(),r=this.scalableNode;let s=!1;r.getElementsByTagName("path").length>0&&(s=!0);const o=h.getBBox(r,{recursive:s}),a=n.width/(o.width||1),l=n.height/(o.height||1);r.setAttribute("transform",`scale(${a},${l})`);const c=this.rotatableNode;if(null!=c){const s=c.getAttribute("transform");if(s){c.setAttribute("transform",`${s} rotate(${-i},${n.width/2},${n.height/2})`);const o=h.getBBox(r,{target:this.graph.view.stage});e.prop("position",{x:o.x,y:o.y},Object.assign({updated:!0},t)),this.translate(),this.rotate()}}this.update()}findPortElem(t,e){const n=t?this.portsCache[t]:null;if(!n)return null;const i=n.portContentElement,r=n.portContentSelectors||{};return this.findOne(e,i,r)}initializePorts(){this.cleanPortsCache()}refreshPorts(){this.removePorts(),this.cleanPortsCache(),this.renderPorts()}cleanPortsCache(){this.portsCache={}}removePorts(){Object.keys(this.portsCache).forEach(t=>{const e=this.portsCache[t];h.remove(e.portElement)})}renderPorts(){const t=this.getPortsContainer(),e=[];t.childNodes.forEach(t=>{e.push(t)});const n=i.groupBy(this.cell.getParsedPorts(),"zIndex"),r="auto";n[r]&&n[r].forEach(n=>{const i=this.getPortElement(n);t.append(i),e.push(i)}),Object.keys(n).forEach(t=>{if(t!==r){const i=parseInt(t,10);this.appendPorts(n[t],i,e)}}),this.updatePorts()}getPortsContainer(){return this.rotatableNode||this.container}appendPorts(t,e,n){const i=t.map(t=>this.getPortElement(t));n[e]||e<0?h.before(n[Math.max(e,0)],i):h.append(this.getPortsContainer(),i)}getPortElement(t){const e=this.portsCache[t.id];return e?e.portElement:this.createPortElement(t)}createPortElement(t){let e=iA.renderMarkup(this.getPortContainerMarkup());const n=e.elem;if(null==n)throw new Error("Invalid port container markup.");e=iA.renderMarkup(this.getPortMarkup(t));const i=e.elem,r=e.selectors;if(null==i)throw new Error("Invalid port markup.");this.setAttrs({port:t.id,"port-group":t.group},i),e=iA.renderMarkup(this.getPortLabelMarkup(t.label));const s=e.elem,o=e.selectors;if(null==s)throw new Error("Invalid port label markup.");let a;if(r&&o){for(const t in o)if(r[t]&&t!==this.rootSelector)throw new Error("Selectors within port must be unique.");a=Object.assign(Object.assign({},r),o)}else a=r||o;let l="x6-port";return t.group&&(l+=" x6-port-"+t.group),h.addClass(n,l),h.addClass(i,"x6-port-body"),h.addClass(s,"x6-port-label"),n.appendChild(i),n.appendChild(s),this.portsCache[t.id]={portElement:n,portSelectors:a,portLabelElement:s,portLabelSelectors:o,portContentElement:i,portContentSelectors:r},this.graph.hook.onPortRendered({port:t,node:this.cell,container:n,selectors:a,labelContainer:s,labelSelectors:o,contentContainer:i,contentSelectors:r}),n}updatePorts(){this.updatePortGroup();const t=this.cell.getParsedGroups();Object.keys(t).forEach(t=>this.updatePortGroup(t))}updatePortGroup(t){const e=KC.fromSize(this.cell.getSize()),n=this.cell.getPortsLayoutByGroup(t,e);for(let i=0,r=n.length;i<r;i+=1){const t=n[i],e=t.portId,r=this.portsCache[e]||{},s=t.portLayout;if(this.applyPortTransform(r.portElement,s),null!=t.portAttrs){const e={selectors:r.portSelectors||{}};t.portSize&&(e.rootBBox=KC.fromSize(t.portSize)),this.updateAttrs(r.portElement,t.portAttrs,e)}const o=t.labelLayout;if(o&&(this.applyPortTransform(r.portLabelElement,o,-(s.angle||0)),o.attrs)){const e={selectors:r.portLabelSelectors||{}};t.labelSize&&(e.rootBBox=KC.fromSize(t.labelSize)),this.updateAttrs(r.portLabelElement,o.attrs,e)}}}applyPortTransform(t,e,n=0){const i=e.angle,r=e.position,s=h.createSVGMatrix().rotate(n).translate(r.x||0,r.y||0).rotate(i||0);h.transform(t,s,{absolute:!0})}getPortContainerMarkup(){return this.cell.getPortContainerMarkup()||this.defaultPortContainerMarkup}getPortMarkup(t){return t.markup||this.cell.portMarkup||this.defaultPortMarkup}getPortLabelMarkup(t){return t.markup||this.cell.portLabelMarkup||this.defaultPortLabelMarkup}getEventArgs(t,e,n){const i=this,r=i.cell,s=r;return null==e||null==n?{e:t,view:i,node:r,cell:s}:{e:t,x:e,y:n,view:i,node:r,cell:s}}notifyMouseDown(t,e,n){super.onMouseDown(t,e,n),this.notify("node:mousedown",this.getEventArgs(t,e,n))}notifyMouseMove(t,e,n){super.onMouseMove(t,e,n),this.notify("node:mousemove",this.getEventArgs(t,e,n))}notifyMouseUp(t,e,n){super.onMouseUp(t,e,n),this.notify("node:mouseup",this.getEventArgs(t,e,n))}onClick(t,e,n){super.onClick(t,e,n),this.notify("node:click",this.getEventArgs(t,e,n))}onDblClick(t,e,n){super.onDblClick(t,e,n),this.notify("node:dblclick",this.getEventArgs(t,e,n))}onContextMenu(t,e,n){super.onContextMenu(t,e,n),this.notify("node:contextmenu",this.getEventArgs(t,e,n))}onMouseDown(t,e,n){if(this.isPropagationStopped(t))return;const i=t.target;h.clickable(i)||h.isInputElement(i)||(this.notifyMouseDown(t,e,n),this.startNodeDragging(t,e,n))}onMouseMove(t,e,n){const i=this.getEventData(t),r=i.action;if("magnet"===r)this.dragMagnet(t,e,n);else{if("move"===r){const r=i,s=r.targetView||this;s.dragNode(t,e,n),s.notify("node:moving",{e:t,x:e,y:n,view:s,cell:s.cell,node:s.cell})}this.notifyMouseMove(t,e,n)}this.setEventData(t,i)}onMouseUp(t,e,n){const i=this.getEventData(t),r=i.action;if("magnet"===r)this.stopMagnetDragging(t,e,n);else{const s=t.target;if(h.clickable(s)||h.isInputElement(s))return;if(this.notifyMouseUp(t,e,n),"move"===r){const r=i,s=r.targetView||this;s.stopNodeDragging(t,e,n)}}const s=i.targetMagnet;s&&this.onMagnetClick(t,s,e,n),this.checkMouseleave(t)}onMouseOver(t){super.onMouseOver(t),this.notify("node:mouseover",this.getEventArgs(t))}onMouseOut(t){super.onMouseOut(t),this.notify("node:mouseout",this.getEventArgs(t))}onMouseEnter(t){this.updateClassName(t),super.onMouseEnter(t),this.notify("node:mouseenter",this.getEventArgs(t))}onMouseLeave(t){super.onMouseLeave(t),this.notify("node:mouseleave",this.getEventArgs(t))}onMouseWheel(t,e,n,i){super.onMouseWheel(t,e,n,i),this.notify("node:mousewheel",Object.assign({delta:i},this.getEventArgs(t,e,n)))}onMagnetClick(t,e,n,i){const r=this.graph.view.getMouseMovedCount(t);r>this.graph.options.clickThreshold||this.notify("node:magnet:click",Object.assign({magnet:e},this.getEventArgs(t,n,i)))}onMagnetDblClick(t,e,n,i){this.notify("node:magnet:dblclick",Object.assign({magnet:e},this.getEventArgs(t,n,i)))}onMagnetContextMenu(t,e,n,i){this.notify("node:magnet:contextmenu",Object.assign({magnet:e},this.getEventArgs(t,n,i)))}onMagnetMouseDown(t,e,n,i){this.startMagnetDragging(t,n,i)}onCustomEvent(t,e,n,i){this.notify("node:customevent",Object.assign({name:e},this.getEventArgs(t,n,i))),super.onCustomEvent(t,e,n,i)}prepareEmbedding(t){const e=this.getEventData(t),n=e.cell||this.cell,i=this.graph.findViewByCell(n),r=this.graph.snapToGrid(t.clientX,t.clientY);this.notify("node:embed",{e:t,node:n,view:i,cell:n,x:r.x,y:r.y,currentParent:n.getParent()})}processEmbedding(t,e){const n=e.cell||this.cell,r=e.graph||this.graph,s=r.options.embedding,o=s.findParent;let l="function"===typeof o?a.call(o,r,{view:this,node:this.cell}).filter(t=>MO.isCell(t)&&this.cell.id!==t.id&&!t.isDescendantOf(this.cell)):r.model.getNodesUnderNode(n,{by:o});if(s.frontOnly&&l.length>0){const t=i.groupBy(l,"zIndex"),e=i.max(Object.keys(t).map(t=>parseInt(t,10)));e&&(l=t[e])}l=l.filter(t=>t.visible);let h=null;const c=e.candidateEmbedView,u=s.validate;for(let i=l.length-1;i>=0;i-=1){const t=l[i];if(c&&c.cell.id===t.id){h=c;break}{const e=t.findView(r);if(a.call(u,r,{child:this.cell,parent:e.cell,childView:this,parentView:e})){h=e;break}}}this.clearEmbedding(e),h&&h.highlight(null,{type:"embedding"}),e.candidateEmbedView=h;const d=r.snapToGrid(t.clientX,t.clientY);this.notify("node:embedding",{e:t,cell:n,node:n,view:r.findViewByCell(n),x:d.x,y:d.y,currentParent:n.getParent(),candidateParent:h?h.cell:null})}clearEmbedding(t){const e=t.candidateEmbedView;e&&(e.unhighlight(null,{type:"embedding"}),t.candidateEmbedView=null)}finalizeEmbedding(t,e){this.graph.startBatch("embedding");const n=e.cell||this.cell,i=e.graph||this.graph,r=i.findViewByCell(n),s=n.getParent(),o=e.candidateEmbedView;if(o?(o.unhighlight(null,{type:"embedding"}),e.candidateEmbedView=null,null!=s&&s.id===o.cell.id||o.cell.insertChild(n,void 0,{ui:!0})):s&&s.unembed(n,{ui:!0}),i.model.getConnectedEdges(n,{deep:!0}).forEach(t=>{t.updateParent({ui:!0})}),r&&o){const e=i.snapToGrid(t.clientX,t.clientY);r.notify("node:embedded",{e:t,cell:n,x:e.x,y:e.y,node:n,view:i.findViewByCell(n),previousParent:s,currentParent:n.getParent()})}this.graph.stopBatch("embedding")}getDelegatedView(){let t=this.cell,e=this;while(e){if(t.isEdge())break;if(!t.hasParent()||e.can("stopDelegateOnDragging"))return e;t=t.getParent(),e=this.graph.renderer.findViewByCell(t)}return null}startMagnetDragging(t,e,n){if(!this.can("magnetConnectable"))return;t.stopPropagation();const i=t.currentTarget,r=this.graph;this.setEventData(t,{targetMagnet:i}),r.hook.validateMagnet(this,i,t)?(r.options.magnetThreshold<=0&&this.startConnectting(t,i,e,n),this.setEventData(t,{action:"magnet"}),this.stopPropagation(t)):((h.hasClass(i,"x6-port-body")||P()(i).closest(".x6-port-body").length>0)&&this.stopPropagation(t),this.onMouseDown(t,e,n)),r.view.delegateDragEvents(t,this)}startConnectting(t,e,n,i){this.graph.model.startBatch("add-edge");const r=this.createEdgeFromMagnet(e,n,i);r.notifyMouseDown(t,n,i),r.setEventData(t,r.prepareArrowheadDragging("target",{x:n,y:i,isNewEdge:!0,fallbackAction:"remove"})),this.setEventData(t,{edgeView:r})}createEdgeFromMagnet(t,e,n){const i=this.graph,r=i.model,s=i.hook.getDefaultEdge(this,t);return s.setSource(Object.assign(Object.assign({},s.getSource()),this.getEdgeTerminal(t,e,n,s,"source"))),s.setTarget(Object.assign(Object.assign({},s.getTarget()),{x:e,y:n})),s.addTo(r,{async:!1,ui:!0}),s.findView(i)}dragMagnet(t,e,n){const i=this.getEventData(t),r=i.edgeView;if(r)r.onMouseMove(t,e,n),this.autoScrollGraph(t.clientX,t.clientY);else{const r=this.graph,s=r.options.magnetThreshold,o=this.getEventTarget(t),a=i.targetMagnet;if("onleave"===s){if(a===o||a.contains(o))return}else if(r.view.getMouseMovedCount(t)<=s)return;this.startConnectting(t,a,e,n)}}stopMagnetDragging(t,e,n){const i=this.eventData(t),r=i.edgeView;r&&(r.onMouseUp(t,e,n),this.graph.model.stopBatch("add-edge"))}notifyUnhandledMouseDown(t,e,n){this.notify("node:unhandled:mousedown",{e:t,x:e,y:n,view:this,cell:this.cell,node:this.cell})}notifyNodeMove(t,e,n,i,r){let s=[r];const o=this.graph.selection.widget;if(o&&o.options.movable){const t=this.graph.getSelectedCells();t.includes(r)&&(s=t.filter(t=>t.isNode()))}s.forEach(r=>{this.notify(t,{e:e,x:n,y:i,cell:r,node:r,view:r.findView(this.graph)})})}startNodeDragging(t,e,n){const i=this.getDelegatedView();if(null==i||!i.can("nodeMovable"))return this.notifyUnhandledMouseDown(t,e,n);this.setEventData(t,{targetView:i,action:"move"});const r=ZC.create(i.cell.getPosition());i.setEventData(t,{moving:!1,offset:r.diff(e,n),restrict:this.graph.hook.getRestrictArea(i)})}dragNode(t,e,n){const i=this.cell,r=this.graph,s=r.getGridSize(),o=this.getEventData(t),a=o.offset,l=o.restrict;o.moving||(o.moving=!0,this.addClass("node-moving"),this.notifyNodeMove("node:move",t,e,n,this.cell)),this.autoScrollGraph(t.clientX,t.clientY);const h=WM.snapToGrid(e+a.x,s),c=WM.snapToGrid(n+a.y,s);i.setPosition(h,c,{restrict:l,deep:!0,ui:!0}),r.options.embedding.enabled&&(o.embedding||(this.prepareEmbedding(t),o.embedding=!0),this.processEmbedding(t,o))}stopNodeDragging(t,e,n){const i=this.getEventData(t);i.embedding&&this.finalizeEmbedding(t,i),i.moving&&(this.removeClass("node-moving"),this.notifyNodeMove("node:moved",t,e,n,this.cell)),i.moving=!1,i.embedding=!1}autoScrollGraph(t,e){const n=this.graph.scroller.widget;n&&n.autoScroll(t,e)}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.isNodeView&&"function"===typeof i.isEdgeView&&"function"===typeof i.confirmUpdate&&"function"===typeof i.update&&"function"===typeof i.findPortElem&&"function"===typeof i.resize&&"function"===typeof i.rotate&&"function"===typeof i.translate}t.toStringTag="X6."+t.name,t.isNodeView=e})(VO||(VO={})),VO.config({isSvgElement:!0,priority:0,bootstrap:["render"],actions:{view:["render"],markup:["render"],attrs:["update"],size:["resize","ports","tools"],angle:["rotate","tools"],position:["translate","tools"],ports:["ports"],tools:["tools"]}}),VO.registry.register("node",VO,!0);const $O=TO("text");class GO extends(jO("text",{view:$O,attrs:{text:{fontSize:18,fill:"#000000",stroke:null,refX:.5,refY:.5}}},{noText:!0})){}(function(t){class e extends VO{confirmUpdate(t,e={}){let n=super.confirmUpdate(t,e);return this.hasAction(n,"scale")&&(this.resize(),n=this.removeAction(n,"scale")),n}}t.View=e,e.config({actions:{attrs:["scale"]}}),VO.registry.register($O,e)})(GO||(GO={}));class _O extends RE{constructor(t,e={}){super(),this.length=0,this.comparator=e.comparator||"zIndex",this.clean(),t&&this.reset(t,{silent:!0})}toJSON(){return this.cells.map(t=>t.toJSON())}add(t,e,n){let i,r;"number"===typeof e?(i=e,r=Object.assign({merge:!1},n)):(i=this.length,r=Object.assign({merge:!1},e)),i>this.length&&(i=this.length),i<0&&(i+=this.length+1);const s=Array.isArray(t)?t:[t],o=this.comparator&&"number"!==typeof e&&!1!==r.sort,a=this.comparator||null;let l=!1;const h=[],c=[];return s.forEach(t=>{const e=this.get(t);e?r.merge&&!t.isSameStore(e)&&(e.setProp(t.getProp(),n),c.push(e),o&&!l&&(l=null==a||"function"===typeof a?e.hasChanged():"string"===typeof a?e.hasChanged(a):a.some(t=>e.hasChanged(t)))):(h.push(t),this.reference(t))}),h.length&&(o&&(l=!0),this.cells.splice(i,0,...h),this.length=this.cells.length),l&&this.sort({silent:!0}),r.silent||(h.forEach((t,e)=>{const n={cell:t,index:i+e,options:r};this.trigger("added",n),r.dryrun||t.notify("added",Object.assign({},n))}),l&&this.trigger("sorted"),(h.length||c.length)&&this.trigger("updated",{added:h,merged:c,removed:[],options:r})),this}remove(t,e={}){const n=Array.isArray(t)?t:[t],i=this.removeCells(n,e);return!e.silent&&i.length>0&&this.trigger("updated",{options:e,removed:i,added:[],merged:[]}),Array.isArray(t)?i:i[0]}removeCells(t,e){const n=[];for(let i=0;i<t.length;i+=1){const r=this.get(t[i]);if(null==r)continue;const s=this.cells.indexOf(r);this.cells.splice(s,1),this.length-=1,delete this.map[r.id],n.push(r),this.unreference(r),e.dryrun||r.remove(),e.silent||(this.trigger("removed",{cell:r,index:s,options:e}),e.dryrun||r.notify("removed",{cell:r,index:s,options:e}))}return n}reset(t,e={}){const n=this.cells.slice();if(n.forEach(t=>this.unreference(t)),this.clean(),this.add(t,Object.assign({silent:!0},e)),!e.silent){const t=this.cells.slice();this.trigger("reseted",{options:e,previous:n,current:t});const i=[],r=[];t.forEach(t=>{const e=n.some(e=>e.id===t.id);e||i.push(t)}),n.forEach(e=>{const n=t.some(t=>t.id===e.id);n||r.push(e)}),this.trigger("updated",{options:e,added:i,removed:r,merged:[]})}return this}push(t,e){return this.add(t,this.length,e)}pop(t){const e=this.at(this.length-1);return this.remove(e,t)}unshift(t,e){return this.add(t,0,e)}shift(t){const e=this.at(0);return this.remove(e,t)}get(t){if(null==t)return null;const e="string"===typeof t||"number"===typeof t?t:t.id;return this.map[e]||null}has(t){return null!=this.get(t)}at(t){return t<0&&(t+=this.length),this.cells[t]||null}first(){return this.at(0)}last(){return this.at(-1)}indexOf(t){return this.cells.indexOf(t)}toArray(){return this.cells.slice()}sort(t={}){return null!=this.comparator&&(this.cells=i.sortBy(this.cells,this.comparator),t.silent||this.trigger("sorted")),this}clone(){const t=this.constructor;return new t(this.cells.slice(),{comparator:this.comparator})}reference(t){this.map[t.id]=t,t.on("*",this.notifyCellEvent,this)}unreference(t){t.off("*",this.notifyCellEvent,this),delete this.map[t.id]}notifyCellEvent(t,e){const n=e.cell;this.trigger("cell:"+t,e),n&&(n.isNode()?this.trigger("node:"+t,Object.assign(Object.assign({},e),{node:n})):n.isEdge()&&this.trigger("edge:"+t,Object.assign(Object.assign({},e),{edge:n})))}clean(){this.length=0,this.cells=[],this.map={}}}class HO extends RE{constructor(t=[]){super(),this.batches={},this.addings=new WeakMap,this.nodes={},this.edges={},this.outgoings={},this.incomings={},this.collection=new _O(t),this.setup()}get[Symbol.toStringTag](){return HO.toStringTag}notify(t,e){this.trigger(t,e);const n=this.graph;return n&&("sorted"===t||"reseted"===t||"updated"===t?n.trigger("model:"+t,e):n.trigger(t,e)),this}setup(){const t=this.collection;t.on("sorted",()=>this.notify("sorted",null)),t.on("updated",t=>this.notify("updated",t)),t.on("cell:change:zIndex",()=>this.sortOnChangeZ()),t.on("added",({cell:t})=>{this.onCellAdded(t)}),t.on("removed",t=>{const e=t.cell;this.onCellRemoved(e,t.options),this.notify("cell:removed",t),e.isNode()?this.notify("node:removed",Object.assign(Object.assign({},t),{node:e})):e.isEdge()&&this.notify("edge:removed",Object.assign(Object.assign({},t),{edge:e}))}),t.on("reseted",t=>{this.onReset(t.current),this.notify("reseted",t)}),t.on("edge:change:source",({edge:t})=>this.onEdgeTerminalChanged(t,"source")),t.on("edge:change:target",({edge:t})=>{this.onEdgeTerminalChanged(t,"target")})}sortOnChangeZ(){this.collection.sort()}onCellAdded(t){const e=t.id;t.isEdge()?(t.updateParent(),this.edges[e]=!0,this.onEdgeTerminalChanged(t,"source"),this.onEdgeTerminalChanged(t,"target")):this.nodes[e]=!0}onCellRemoved(t,e){const n=t.id;if(t.isEdge()){delete this.edges[n];const e=t.getSource(),i=t.getTarget();if(e&&e.cell){const t=this.outgoings[e.cell],i=t?t.indexOf(n):-1;i>=0&&(t.splice(i,1),0===t.length&&delete this.outgoings[e.cell])}if(i&&i.cell){const t=this.incomings[i.cell],e=t?t.indexOf(n):-1;e>=0&&(t.splice(e,1),0===t.length&&delete this.incomings[i.cell])}}else delete this.nodes[n];e.clear||(e.disconnectEdges?this.disconnectConnectedEdges(t,e):this.removeConnectedEdges(t,e)),t.model===this&&(t.model=null)}onReset(t){this.nodes={},this.edges={},this.outgoings={},this.incomings={},t.forEach(t=>this.onCellAdded(t))}onEdgeTerminalChanged(t,e){const n="source"===e?this.outgoings:this.incomings,i=t.previous(e);if(i&&i.cell){const e=MO.isCell(i.cell)?i.cell.id:i.cell,r=n[e],s=r?r.indexOf(t.id):-1;s>=0&&(r.splice(s,1),0===r.length&&delete n[e])}const r=t.getTerminal(e);if(r&&r.cell){const e=MO.isCell(r.cell)?r.cell.id:r.cell,i=n[e]||[],s=i.indexOf(t.id);-1===s&&i.push(t.id),n[e]=i}}prepareCell(t,e){return t.model||e&&e.dryrun||(t.model=this),null==t.zIndex&&t.setZIndex(this.getMaxZIndex()+1,{silent:!0}),t}resetCells(t,e={}){return t.map(t=>this.prepareCell(t,Object.assign(Object.assign({},e),{dryrun:!0}))),this.collection.reset(t,e),t.map(t=>this.prepareCell(t,{options:e})),this}clear(t={}){const e=this.getCells();if(0===e.length)return this;const n=Object.assign(Object.assign({},t),{clear:!0});return this.batchUpdate("clear",()=>{const t=e.sort((t,e)=>{const n=t.isEdge()?1:2,i=e.isEdge()?1:2;return n-i});while(t.length>0){const e=t.shift();e&&e.remove(n)}},n),this}addNode(t,e={}){const n=SO.isNode(t)?t:this.createNode(t);return this.addCell(n,e),n}createNode(t){return SO.create(t)}addEdge(t,e={}){const n=BO.isEdge(t)?t:this.createEdge(t);return this.addCell(n,e),n}createEdge(t){return BO.create(t)}addCell(t,e={}){return Array.isArray(t)?this.addCells(t,e):(this.collection.has(t)||this.addings.has(t)||(this.addings.set(t,!0),this.collection.add(this.prepareCell(t,e),e),t.eachChild(t=>this.addCell(t,e)),this.addings.delete(t)),this)}addCells(t,e={}){const n=t.length;if(0===n)return this;const i=Object.assign(Object.assign({},e),{position:n-1,maxPosition:n-1});return this.startBatch("add",Object.assign(Object.assign({},i),{cells:t})),t.forEach(t=>{this.addCell(t,i),i.position-=1}),this.stopBatch("add",Object.assign(Object.assign({},i),{cells:t})),this}removeCell(t,e={}){const n="string"===typeof t?this.getCell(t):t;return n&&this.has(n)?this.collection.remove(n,e):null}updateCellId(t,e){this.startBatch("update",{id:e}),t.prop("id",e);const n=t.clone({keepId:!0});this.addCell(n);const i=this.getConnectedEdges(t);return i.forEach(n=>{const i=n.getSourceCell(),r=n.getTargetCell();i===t&&n.setSource(Object.assign(Object.assign({},n.getSource()),{cell:e})),r===t&&n.setTarget(Object.assign(Object.assign({},n.getTarget()),{cell:e}))}),this.removeCell(t),this.stopBatch("update",{id:e}),n}removeCells(t,e={}){return t.length?this.batchUpdate("remove",()=>t.map(t=>this.removeCell(t,e))):[]}removeConnectedEdges(t,e={}){const n=this.getConnectedEdges(t);return n.forEach(t=>{t.remove(e)}),n}disconnectConnectedEdges(t,e={}){const n="string"===typeof t?t:t.id;this.getConnectedEdges(t).forEach(t=>{const i=t.getSourceCell(),r=t.getTargetCell();i&&i.id===n&&t.setSource({x:0,y:0},e),r&&r.id===n&&t.setTarget({x:0,y:0},e)})}has(t){return this.collection.has(t)}total(){return this.collection.length}indexOf(t){return this.collection.indexOf(t)}getCell(t){return this.collection.get(t)}getCells(){return this.collection.toArray()}getFirstCell(){return this.collection.first()}getLastCell(){return this.collection.last()}getMinZIndex(){const t=this.collection.first();return t&&t.getZIndex()||0}getMaxZIndex(){const t=this.collection.last();return t&&t.getZIndex()||0}getCellsFromCache(t){return t?Object.keys(t).map(t=>this.getCell(t)).filter(t=>null!=t):[]}getNodes(){return this.getCellsFromCache(this.nodes)}getEdges(){return this.getCellsFromCache(this.edges)}getOutgoingEdges(t){const e="string"===typeof t?t:t.id,n=this.outgoings[e];return n?n.map(t=>this.getCell(t)).filter(t=>t&&t.isEdge()):null}getIncomingEdges(t){const e="string"===typeof t?t:t.id,n=this.incomings[e];return n?n.map(t=>this.getCell(t)).filter(t=>t&&t.isEdge()):null}getConnectedEdges(t,e={}){const n=[],i="string"===typeof t?this.getCell(t):t;if(null==i)return n;const r={},s=e.indirect;let o=e.incoming,a=e.outgoing;null==o&&null==a&&(o=a=!0);const l=(t,e)=>{const i=e?this.getOutgoingEdges(t):this.getIncomingEdges(t);if(null!=i&&i.forEach(t=>{r[t.id]||(n.push(t),r[t.id]=!0,s&&(o&&l(t,!1),a&&l(t,!0)))}),s&&t.isEdge()){const i=e?t.getTargetCell():t.getSourceCell();i&&i.isEdge()&&(r[i.id]||(n.push(i),l(i,e)))}};if(a&&l(i,!0),o&&l(i,!1),e.deep){const t=i.getDescendants({deep:!0}),s={};t.forEach(t=>{t.isNode()&&(s[t.id]=!0)});const l=(t,i)=>{const o=i?this.getOutgoingEdges(t.id):this.getIncomingEdges(t.id);null!=o&&o.forEach(t=>{if(!r[t.id]){const i=t.getSourceCell(),o=t.getTargetCell();if(!e.enclosed&&i&&s[i.id]&&o&&s[o.id])return;n.push(t),r[t.id]=!0}})};t.forEach(t=>{t.isEdge()||(a&&l(t,!0),o&&l(t,!1))})}return n}isBoundary(t,e){const n="string"===typeof t?this.getCell(t):t,i=e?this.getIncomingEdges(n):this.getOutgoingEdges(n);return null==i||0===i.length}getBoundaryNodes(t){const e=[];return Object.keys(this.nodes).forEach(n=>{if(this.isBoundary(n,t)){const t=this.getCell(n);t&&e.push(t)}}),e}getRoots(){return this.getBoundaryNodes(!0)}getLeafs(){return this.getBoundaryNodes(!1)}isRoot(t){return this.isBoundary(t,!0)}isLeaf(t){return this.isBoundary(t,!1)}getNeighbors(t,e={}){let n=e.incoming,i=e.outgoing;null==n&&null==i&&(n=i=!0);const r=this.getConnectedEdges(t,e),s=r.reduce((r,s)=>{const o=s.hasLoop(e),a=s.getSourceCell(),l=s.getTargetCell();return n&&a&&a.isNode()&&!r[a.id]&&(!o&&(a===t||e.deep&&a.isDescendantOf(t))||(r[a.id]=a)),i&&l&&l.isNode()&&!r[l.id]&&(!o&&(l===t||e.deep&&l.isDescendantOf(t))||(r[l.id]=l)),r},{});if(t.isEdge()){if(n){const e=t.getSourceCell();e&&e.isNode()&&!s[e.id]&&(s[e.id]=e)}if(i){const e=t.getTargetCell();e&&e.isNode()&&!s[e.id]&&(s[e.id]=e)}}return Object.keys(s).map(t=>s[t])}isNeighbor(t,e,n={}){let i=n.incoming,r=n.outgoing;return null==i&&null==r&&(i=r=!0),this.getConnectedEdges(t,n).some(t=>{const n=t.getSourceCell(),s=t.getTargetCell();return!(!i||!n||n.id!==e.id)||!(!r||!s||s.id!==e.id)})}getSuccessors(t,e={}){const n=[];return this.search(t,(i,r)=>{i!==t&&this.matchDistance(r,e.distance)&&n.push(i)},Object.assign(Object.assign({},e),{outgoing:!0})),n}isSuccessor(t,e,n={}){let i=!1;return this.search(t,(r,s)=>{if(r===e&&r!==t&&this.matchDistance(s,n.distance))return i=!0,!1},Object.assign(Object.assign({},n),{outgoing:!0})),i}getPredecessors(t,e={}){const n=[];return this.search(t,(i,r)=>{i!==t&&this.matchDistance(r,e.distance)&&n.push(i)},Object.assign(Object.assign({},e),{incoming:!0})),n}isPredecessor(t,e,n={}){let i=!1;return this.search(t,(r,s)=>{if(r===e&&r!==t&&this.matchDistance(s,n.distance))return i=!0,!1},Object.assign(Object.assign({},n),{incoming:!0})),i}matchDistance(t,e){return null==e||("function"===typeof e?e(t):!(!Array.isArray(e)||!e.includes(t))||t===e)}getCommonAncestor(...t){const e=[];return t.forEach(t=>{t&&(Array.isArray(t)?e.push(...t):e.push(t))}),MO.getCommonAncestor(...e)}getSubGraph(t,e={}){const n=[],i={},r=[],s=[],o=t=>{i[t.id]||(n.push(t),i[t.id]=t,t.isEdge()&&s.push(t),t.isNode()&&r.push(t))};return t.forEach(t=>{if(o(t),e.deep){const e=t.getDescendants({deep:!0});e.forEach(t=>o(t))}}),s.forEach(t=>{const e=t.getSourceCell(),s=t.getTargetCell();e&&!i[e.id]&&(n.push(e),i[e.id]=e,e.isNode()&&r.push(e)),s&&!i[s.id]&&(n.push(s),i[s.id]=s,s.isNode()&&r.push(s))}),r.forEach(t=>{const r=this.getConnectedEdges(t,e);r.forEach(t=>{const e=t.getSourceCell(),r=t.getTargetCell();!i[t.id]&&e&&i[e.id]&&r&&i[r.id]&&(n.push(t),i[t.id]=t)})}),n}cloneSubGraph(t,e={}){const n=this.getSubGraph(t,e);return this.cloneCells(n)}cloneCells(t){return MO.cloneCells(t)}getNodesFromPoint(t,e){const n="number"===typeof t?{x:t,y:e||0}:t;return this.getNodes().filter(t=>t.getBBox().containsPoint(n))}getNodesInArea(t,e,n,i,r){const s="number"===typeof t?new KC(t,e,n,i):KC.create(t),o="number"===typeof t?r:e,a=o&&o.strict;return this.getNodes().filter(t=>{const e=t.getBBox();return a?s.containsRect(e):s.isIntersectWithRect(e)})}getEdgesInArea(t,e,n,i,r){const s="number"===typeof t?new KC(t,e,n,i):KC.create(t),o="number"===typeof t?r:e,a=o&&o.strict;return this.getEdges().filter(t=>{const e=t.getBBox();return 0===e.width?e.inflate(1,0):0===e.height&&e.inflate(0,1),a?s.containsRect(e):s.isIntersectWithRect(e)})}getNodesUnderNode(t,e={}){const n=t.getBBox(),i=null==e.by||"bbox"===e.by?this.getNodesInArea(n):this.getNodesFromPoint(n[e.by]);return i.filter(e=>t.id!==e.id&&!e.isDescendantOf(t))}getAllCellsBBox(){return this.getCellsBBox(this.getCells())}getCellsBBox(t,e={}){return MO.getCellsBBox(t,e)}search(t,e,n={}){n.breadthFirst?this.breadthFirstSearch(t,e,n):this.depthFirstSearch(t,e,n)}breadthFirstSearch(t,e,n={}){const i=[],r={},s={};i.push(t),s[t.id]=0;while(i.length>0){const t=i.shift();if(null==t||r[t.id])continue;if(r[t.id]=!0,!1===a.call(e,this,t,s[t.id]))continue;const o=this.getNeighbors(t,n);o.forEach(e=>{s[e.id]=s[t.id]+1,i.push(e)})}}depthFirstSearch(t,e,n={}){const i=[],r={},s={};i.push(t),s[t.id]=0;while(i.length>0){const t=i.pop();if(null==t||r[t.id])continue;if(r[t.id]=!0,!1===a.call(e,this,t,s[t.id]))continue;const o=this.getNeighbors(t,n),l=i.length;o.forEach(e=>{s[e.id]=s[t.id]+1,i.splice(l,0,e)})}}getShortestPath(t,e,n={}){const i={};this.getEdges().forEach(t=>{const e=t.getSourceCellId(),r=t.getTargetCellId();e&&r&&(i[e]||(i[e]=[]),i[r]||(i[r]=[]),i[e].push(r),n.directed||i[r].push(e))});const r="string"===typeof t?t:t.id,s=VE.run(i,r,n.weight),o=[];let a="string"===typeof e?e:e.id;s[a]&&o.push(a);while(a=s[a])o.unshift(a);return o}translate(t,e,n){return this.getCells().filter(t=>!t.hasParent()).forEach(i=>i.translate(t,e,n)),this}resize(t,e,n){return this.resizeCells(t,e,this.getCells(),n)}resizeCells(t,e,n,i={}){const r=this.getCellsBBox(n);if(r){const s=Math.max(t/r.width,0),o=Math.max(e/r.height,0),a=r.getOrigin();n.forEach(t=>t.scale(s,o,a,i))}return this}toJSON(t={}){return HO.toJSON(this.getCells(),t)}parseJSON(t){return HO.fromJSON(t)}fromJSON(t,e={}){const n=this.parseJSON(t);return this.resetCells(n,e),this}startBatch(t,e={}){return this.batches[t]=(this.batches[t]||0)+1,this.notify("batch:start",{name:t,data:e}),this}stopBatch(t,e={}){return this.batches[t]=(this.batches[t]||0)-1,this.notify("batch:stop",{name:t,data:e}),this}batchUpdate(t,e,n={}){this.startBatch(t,n);const i=e();return this.stopBatch(t,n),i}hasActiveBatch(t=Object.keys(this.batches)){const e=Array.isArray(t)?t:[t];return e.some(t=>this.batches[t]>0)}}(function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&"function"===typeof i.addNode&&"function"===typeof i.addEdge&&null!=i.collection}t.toStringTag="X6."+t.name,t.isModel=e})(HO||(HO={})),function(t){function e(t,e={}){return{cells:t.map(t=>t.toJSON(e))}}function n(t){const e=[];return Array.isArray(t)?e.push(...t):(t.cells&&e.push(...t.cells),t.nodes&&t.nodes.forEach(t=>{null==t.shape&&(t.shape="rect"),e.push(t)}),t.edges&&t.edges.forEach(t=>{null==t.shape&&(t.shape="edge"),e.push(t)})),e.map(t=>{const e=t.shape;if(e){if(SO.registry.exist(e))return SO.create(t);if(BO.registry.exist(e))return BO.create(t)}throw new Error("The `shape` should be specified when creating a node/edge instance")})}t.toJSON=e,t.fromJSON=n}(HO||(HO={}));const UO=".text-block-content",WO=TO("text-block");class XO extends SO{get content(){return this.getContent()}set content(t){this.setContent(t)}getContent(){return this.store.get("content","")}setContent(t,e={}){this.store.set("content",t,e)}setup(){super.setup(),this.store.on("change:*",t=>{const e=t.key;"content"===e?this.updateContent(this.getContent()):"size"===e&&this.updateSize(this.getSize())}),this.updateSize(this.getSize()),this.updateContent(this.getContent())}updateSize(t){U.SUPPORT_FOREIGNOBJECT&&this.setAttrs({foreignObject:Object.assign({},t),[UO]:{style:Object.assign({},t)}})}updateContent(t){U.SUPPORT_FOREIGNOBJECT?this.setAttrs({[UO]:{html:t?s.sanitizeHTML(t):""}}):this.setAttrs({[UO]:{text:t}})}}(function(t){t.config({type:WO,view:WO,markup:['<g class="rotatable">','<g class="scalable"><rect/></g>',U.SUPPORT_FOREIGNOBJECT?["<foreignObject>",'<body xmlns="http://www.w3.org/1999/xhtml">',`<div class="${UO.substr(1)}" />`,"</body>","</foreignObject>"].join(""):`<text class="${UO.substr(1)}"/>`,"</g>"].join(""),attrs:{".":{fill:"#ffffff",stroke:"none"},rect:{fill:"#ffffff",stroke:"#000000",width:80,height:100},text:{fill:"#000000",fontSize:14,fontFamily:"Arial, helvetica, sans-serif"},body:{style:{background:"transparent",position:"static",margin:0,padding:0}},foreignObject:{style:{overflow:"hidden"}},[UO]:{refX:.5,refY:.5,yAlign:"middle",xAlign:"middle",style:{textAlign:"center",verticalAlign:"middle",display:"table-cell",padding:"0 5px",margin:0}}}}),SO.registry.register(WO,t)})(XO||(XO={})),function(t){const e="content";class n extends VO{confirmUpdate(t,n={}){let i=super.confirmUpdate(t,n);return this.hasAction(i,e)&&(this.updateContent(),i=this.removeAction(i,e)),i}update(t){if(U.SUPPORT_FOREIGNOBJECT)super.update(t);else{const e=this.cell,n=Object.assign({},t||e.getAttrs());delete n[UO],super.update(n),t&&!r.has(t,UO)||this.updateContent(t)}}updateContent(t){if(U.SUPPORT_FOREIGNOBJECT)super.update(t);else{const e=this.cell,n=(t||e.getAttrs())[UO],i=h.breakText(e.getContent(),e.getSize(),n,{svgDocument:this.graph.view.svg}),s={[UO]:r.merge({},n,{text:i})};super.update(s)}}}t.View=n,function(t){t.config({bootstrap:["render",e],actions:U.SUPPORT_FOREIGNOBJECT?{}:{size:e,content:e}}),VO.registry.register(WO,t)}(n=t.View||(t.View={}))}(XO||(XO={}));const qO=PO.define({shape:"empty"});function YO(t,e="body"){return[{tagName:t,selector:e},{tagName:"text",selector:"label"}]}function JO(t,e,n={}){const i={constructorName:t,markup:YO(t,n.selector),attrs:{[t]:Object.assign({},PO.bodyAttr)}},s=n.parent||PO;return s.define(r.merge(i,e,{shape:t}))}const ZO=JO("rect",{attrs:{body:{refWidth:"100%",refHeight:"100%"}}}),KO=SO.define({shape:"rect-headered",markup:[{tagName:"rect",selector:"body"},{tagName:"rect",selector:"header"},{tagName:"text",selector:"headerText"},{tagName:"text",selector:"bodyText"}],attrs:{body:Object.assign(Object.assign({},PO.bodyAttr),{refWidth:"100%",refHeight:"100%"}),header:Object.assign(Object.assign({},PO.bodyAttr),{refWidth:"100%",height:30,stroke:"#000000"}),headerText:Object.assign(Object.assign({},PO.labelAttr),{refX:"50%",refY:15,fontSize:16}),bodyText:Object.assign(Object.assign({},PO.labelAttr),{refY2:15})}}),QO=JO("circle",{attrs:{body:{refCx:"50%",refCy:"50%",refR:"50%"}}}),tP=10,eP=PO.define({shape:"cylinder",overwrite:!0,markup:[{tagName:"path",selector:"body"},{tagName:"ellipse",selector:"top"},{tagName:"text",selector:"label"}],attrs:{body:Object.assign(Object.assign({},PO.bodyAttr),{lateral:tP}),top:Object.assign(Object.assign({},PO.bodyAttr),{refCx:"50%",refRx:"50%",cy:tP,ry:tP})},attrHooks:{lateral:{set(t,{refBBox:e}){const n=o.isPercentage(t);n&&(t=parseFloat(t)/100);const i=e.x,r=e.y,s=e.width,a=e.height,l=s/2,h=n?a*t:t,c=.551784,u=c*l,d=c*h,g=i,p=i+s/2,f=i+s,m=r+h,b=m-h,y=r+a-h,C=r+a,v=["M",g,m,"L",g,y,"C",i,y+d,p-u,C,p,C,"C",p+u,C,f,y+d,f,y,"L",f,m,"C",f,m-d,p+u,b,p,b,"C",p-u,b,g,m-d,g,m,"Z"];return{d:v.join(" ")}}}},knob:{enabled:!0,position({node:t}){const e=t.attr("body/lateral");return{x:0,y:e}},onMouseMove({node:t,data:e,deltaY:n}){if(0!==n){const i=t.getBBox(),r=t.attr("body/lateral");null==e.round&&(e.round=r);const s=0,a=i.height/2,l=o.clamp(e.round+n,s,a);l!==r&&t.attr({body:{lateral:l},top:{cy:l,ry:l}})}}}}),nP=JO("ellipse",{attrs:{body:{refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}}});var iP=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class rP extends PO{get points(){return this.getPoints()}set points(t){this.setPoints(t)}getPoints(){return this.getAttrByPath("body/refPoints")}setPoints(t,e){return null==t?this.removePoints():this.setAttrByPath("body/refPoints",rP.pointsToString(t),e),this}removePoints(){return this.removeAttrByPath("body/refPoints"),this}}(function(t){function e(t){return"string"===typeof t?t:t.map(t=>Array.isArray(t)?t.join(","):ZC.isPointLike(t)?`${t.x}, ${t.y}`:"").join(" ")}t.pointsToString=e,t.config({propHooks(t){const{points:n}=t,i=iP(t,["points"]);if(n){const t=e(n);t&&r.setByPath(i,"attrs/body/refPoints",t)}return i}})})(rP||(rP={}));const sP=JO("polygon",{},{parent:rP}),oP=JO("polyline",{},{parent:rP});var aP=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const lP=PO.define({shape:"path",markup:[{tagName:"rect",selector:"bg"},{tagName:"path",selector:"body"},{tagName:"text",selector:"label"}],attrs:{bg:{refWidth:"100%",refHeight:"100%",fill:"none",stroke:"none",pointerEvents:"all"},body:{fill:"none",stroke:"#000",strokeWidth:2}},propHooks(t){const{path:e}=t,n=aP(t,["path"]);return e&&r.setByPath(n,"attrs/body/refD",e),n}});var hP=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};const cP=PO.define({shape:"text-block",markup:[{tagName:"rect",selector:"body"},U.SUPPORT_FOREIGNOBJECT?{tagName:"foreignObject",selector:"foreignObject",children:[{tagName:"div",ns:h.ns.xhtml,selector:"label",style:{width:"100%",height:"100%",position:"static",backgroundColor:"transparent",textAlign:"center",margin:0,padding:"0px 5px",boxSizing:"border-box",display:"flex",alignItems:"center",justifyContent:"center"}}]}:{tagName:"text",selector:"label",attrs:{textAnchor:"middle"}}],attrs:{body:Object.assign(Object.assign({},PO.bodyAttr),{refWidth:"100%",refHeight:"100%"}),foreignObject:{refWidth:"100%",refHeight:"100%"},label:{style:{fontSize:14}}},propHooks(t){const{text:e}=t,n=hP(t,["text"]);return e&&r.setByPath(n,"attrs/label/text",e),n},attrHooks:{text:{set(t,{cell:e,view:n,refBBox:i,elem:r,attrs:s}){if(!(r instanceof HTMLElement)){const o=s.style||{},l={text:t,width:-5,height:"100%"},h=Object.assign({textVerticalAnchor:"middle"},o),c=vM.presets.textWrap;return a.call(c.set,this,l,{cell:e,view:n,elem:r,refBBox:i,attrs:h}),{fill:o.color||null}}r.textContent=t},position(t,{refBBox:e,elem:n}){if(n instanceof SVGElement)return e.getCenter()}}}}),uP=JO("image",{attrs:{image:{refWidth:"100%",refHeight:"100%"}},propHooks:NO()},{selector:"image"}),dP=JO("image-bordered",{markup:[{tagName:"rect",selector:"background",attrs:{stroke:"none"}},{tagName:"image",selector:"image"},{tagName:"rect",selector:"border",attrs:{fill:"none"}},{tagName:"text",selector:"label"}],attrs:{background:{refWidth:-1,refHeight:-1,x:.5,y:.5,fill:"#ffffff"},border:{refWidth:"100%",refHeight:"100%",stroke:"#333333",strokeWidth:2},image:{refWidth:-1,refHeight:-1,x:.5,y:.5}},propHooks:NO()}),gP=JO("image-embedded",{markup:[{tagName:"rect",selector:"body"},{tagName:"image",selector:"image"},{tagName:"text",selector:"label"}],attrs:{body:{refWidth:"100%",refHeight:"100%",stroke:"#333333",fill:"#FFFFFF",strokeWidth:2},image:{refWidth:"30%",refHeight:-20,x:10,y:10,preserveAspectRatio:"xMidYMin"}},propHooks:NO()}),pP=JO("image-inscribed",{propHooks:NO(),markup:[{tagName:"ellipse",selector:"background"},{tagName:"image",selector:"image"},{tagName:"ellipse",selector:"border",attrs:{fill:"none"}},{tagName:"text",selector:"label"}],attrs:{border:{refRx:"50%",refRy:"50%",refCx:"50%",refCy:"50%",stroke:"#333333",strokeWidth:2},background:{refRx:"50%",refRy:"50%",refCx:"50%",refCy:"50%",fill:"#ffffff"},image:{refWidth:"68%",refHeight:"68%",refX:"16%",refY:"16%",preserveAspectRatio:"xMidYMid"}}}),fP=BO.define({shape:"edge",markup:[{tagName:"path",selector:"wrap",groupSelector:"lines",attrs:{fill:"none",cursor:"pointer",stroke:"transparent",strokeLinecap:"round"}},{tagName:"path",selector:"line",groupSelector:"lines",attrs:{fill:"none",pointerEvents:"none"}}],attrs:{lines:{connection:!0,strokeLinejoin:"round"},wrap:{strokeWidth:10},line:{stroke:"#333",strokeWidth:2,targetMarker:"classic"}}}),mP=BO.define({shape:"shadow-edge",markup:[{tagName:"path",selector:"shadow",attrs:{fill:"none"}},{tagName:"path",selector:"line",attrs:{fill:"none",cursor:"pointer"}}],attrs:{line:{connection:!0,stroke:"#FF0000",strokeWidth:20,strokeLinejoin:"round",targetMarker:{name:"path",stroke:"none",d:"M 0 -10 -10 0 0 10 z",offsetX:-5},sourceMarker:{name:"path",stroke:"none",d:"M -10 -10 0 0 -10 10 0 10 0 -10 z",offsetX:-5}},shadow:{connection:!0,refX:3,refY:6,stroke:"#000000",strokeOpacity:.2,strokeWidth:20,strokeLinejoin:"round",targetMarker:{name:"path",d:"M 0 -10 -10 0 0 10 z",stroke:"none",offsetX:-5},sourceMarker:{name:"path",stroke:"none",d:"M -10 -10 0 0 -10 10 0 10 0 -10 z",offsetX:-5}}}}),bP=BO.define({shape:"double-edge",markup:[{tagName:"path",selector:"outline",attrs:{fill:"none"}},{tagName:"path",selector:"line",attrs:{fill:"none",cursor:"pointer"}}],attrs:{line:{connection:!0,stroke:"#dddddd",strokeWidth:4,strokeLinejoin:"round",targetMarker:{tagName:"path",stroke:"#000000",d:"M 10 -3 10 -10 -2 0 10 10 10 3"}},outline:{connection:!0,stroke:"#000000",strokeWidth:6,strokeLinejoin:"round"}}});class yP extends PO{get html(){return this.getHTML()}set html(t){this.setHTML(t)}getHTML(){return this.store.get("html")}setHTML(t,e={}){return null==t?this.removeHTML(e):this.store.set("html",t,e),this}removeHTML(t={}){return this.store.remove("html",t)}}(function(t){class e extends VO{init(){super.init(),this.cell.on("change:*",()=>{const t=this.graph.hook.shouldUpdateHTMLComponent(this.cell);t&&this.renderHTMLComponent()})}confirmUpdate(t){const n=super.confirmUpdate(t);return this.handleAction(n,e.action,()=>this.renderHTMLComponent())}renderHTMLComponent(){const t=this.selectors&&this.selectors.foContent;if(t){const e=this.$(t).empty(),n=this.graph.hook.getHTMLComponent(this.cell);n&&("string"===typeof n?e.html(n):e.append(n))}}}t.View=e,function(t){t.action="html",t.config({bootstrap:[t.action],actions:{html:t.action}}),VO.registry.register("html-view",t)}(e=t.View||(t.View={}))})(yP||(yP={})),function(t){t.config({view:"html-view",markup:[{tagName:"rect",selector:"body"},Object.assign({},iA.getForeignObjectMarkup()),{tagName:"text",selector:"label"}],attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"}}}),SO.registry.register("html",t)}(yP||(yP={})),function(t){t.componentRegistry=Gw.create({type:"html componnet"})}(yP||(yP={}));var CP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class vP extends IE{constructor(t){super(),this.delay=10,this.throttle=2,this.threshold=5,this.changeCount=0,this.timestamp=0,this.options=Object.assign(Object.assign({},vP.defaultOptions),t),this.graph.model.on("cell:change:*",this.onModelChanged,this)}get graph(){return this.options.graph}onModelChanged(){if(this.disabled)return;const t=(new Date).getTime(),e=(t-this.timestamp)/1e3;e>this.delay||this.changeCount>=this.threshold&&e>this.throttle?(this.save(),this.reset()):this.changeCount+=1}save(){this.trigger("save")}reset(){this.changeCount=0,this.timestamp=(new Date).getTime()}dispose(){this.graph.model.off("cell:change:*",this.onModelChanged,this)}}CP([IE.dispose()],vP.prototype,"dispose",null),function(t){t.defaultOptions={delay:10,throttle:2,threshold:5}}(vP||(vP={}));class wP extends zE{constructor(t){super(),this.graph=t,this.init()}get options(){return this.graph.options}get model(){return this.graph.model}get view(){return this.graph.view}init(){}}var xP,MP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class EP extends qE{constructor(t){super(),this.graph=t;const{selectors:e,fragment:n}=iA.parseJSONMarkup(EP.markup);this.background=e.background,this.grid=e.grid,this.svg=e.svg,this.defs=e.defs,this.viewport=e.viewport,this.primer=e.primer,this.stage=e.stage,this.decorator=e.decorator,this.overlay=e.overlay,this.container=this.options.container,this.restore=EP.snapshoot(this.container),this.$(this.container).addClass(this.prefixClassName("graph")).append(n),this.delegateEvents()}get model(){return this.graph.model}get options(){return this.graph.options}delegateEvents(){const t=this.constructor;return super.delegateEvents(t.events),this}guard(t,e){return"mousedown"===t.type&&2===t.button||(!(!this.options.guard||!this.options.guard(t,e))||(t.data&&void 0!==t.data.guarded?t.data.guarded:!(e&&e.cell&&MO.isCell(e.cell))&&(this.svg!==t.target&&this.container!==t.target&&!P.a.contains(this.svg,t.target))))}findView(t){return this.graph.renderer.findViewByElem(t)}onDblClick(t){this.options.preventDefaultDblClick&&t.preventDefault();const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const i=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onDblClick(e,i.x,i.y):this.graph.trigger("blank:dblclick",{e:e,x:i.x,y:i.y})}onClick(t){if(this.getMouseMovedCount(t)<=this.options.clickThreshold){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const i=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onClick(e,i.x,i.y):this.graph.trigger("blank:click",{e:e,x:i.x,y:i.y})}}isPreventDefaultContextMenu(t,e){let n=this.options.preventDefaultContextMenu;return"function"===typeof n&&(n=a.call(n,this.graph,{view:e})),n}onContextMenu(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.isPreventDefaultContextMenu(e,n)&&t.preventDefault(),this.guard(e,n))return;const i=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onContextMenu(e,i.x,i.y):this.graph.trigger("blank:contextmenu",{e:e,x:i.x,y:i.y})}delegateDragEvents(t,e){null==t.data&&(t.data={}),this.setEventData(t,{currentView:e||null,mouseMovedCount:0,startPosition:{x:t.clientX,y:t.clientY}});const n=this.constructor;this.delegateDocumentEvents(n.documentEvents,t.data),this.undelegateEvents()}getMouseMovedCount(t){const e=this.getEventData(t);return e.mouseMovedCount||0}onMouseDown(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;this.options.preventDefaultMouseDown&&e.preventDefault();const i=this.graph.snapToGrid(e.clientX,e.clientY);n?n.onMouseDown(e,i.x,i.y):(this.options.preventDefaultBlankAction&&["touchstart"].includes(e.type)&&e.preventDefault(),this.graph.trigger("blank:mousedown",{e:e,x:i.x,y:i.y})),this.delegateDragEvents(e,n)}onMouseMove(t){const e=this.getEventData(t),n=e.startPosition;if(n&&n.x===t.clientX&&n.y===t.clientY)return;null==e.mouseMovedCount&&(e.mouseMovedCount=0),e.mouseMovedCount+=1;const i=e.mouseMovedCount;if(i<=this.options.moveThreshold)return;const r=this.normalizeEvent(t),s=this.graph.snapToGrid(r.clientX,r.clientY),o=e.currentView;o?o.onMouseMove(r,s.x,s.y):this.graph.trigger("blank:mousemove",{e:r,x:s.x,y:s.y}),this.setEventData(r,e)}onMouseUp(t){this.undelegateDocumentEvents();const e=this.normalizeEvent(t),n=this.graph.snapToGrid(e.clientX,e.clientY),i=this.getEventData(t),r=i.currentView;r?r.onMouseUp(e,n.x,n.y):this.graph.trigger("blank:mouseup",{e:e,x:n.x,y:n.y}),t.isPropagationStopped()||this.onClick(P.a.Event(t,{type:"click",data:t.data})),t.stopImmediatePropagation(),this.delegateEvents()}onMouseOver(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(!this.guard(e,n))if(n)n.onMouseOver(e);else{if(this.container===e.target)return;this.graph.trigger("blank:mouseover",{e:e})}}onMouseOut(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(!this.guard(e,n))if(n)n.onMouseOut(e);else{if(this.container===e.target)return;this.graph.trigger("blank:mouseout",{e:e})}}onMouseEnter(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const i=this.graph.renderer.findViewByElem(e.relatedTarget);if(n){if(i===n)return;n.onMouseEnter(e)}else{if(i)return;this.graph.trigger("graph:mouseenter",{e:e})}}onMouseLeave(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const i=this.graph.renderer.findViewByElem(e.relatedTarget);if(n){if(i===n)return;n.onMouseLeave(e)}else{if(i)return;this.graph.trigger("graph:mouseleave",{e:e})}}onMouseWheel(t){const e=this.normalizeEvent(t),n=this.findView(e.target);if(this.guard(e,n))return;const i=e.originalEvent,r=this.graph.snapToGrid(i.clientX,i.clientY),s=Math.max(-1,Math.min(1,i.wheelDelta||-i.detail));n?n.onMouseWheel(e,r.x,r.y,s):this.graph.trigger("blank:mousewheel",{e:e,delta:s,x:r.x,y:r.y})}onCustomEvent(t){const e=t.currentTarget,n=e.getAttribute("event")||e.getAttribute("data-event");if(n){const i=this.findView(e);if(i){const e=this.normalizeEvent(t);if(this.guard(e,i))return;const r=this.graph.snapToGrid(e.clientX,e.clientY);i.onCustomEvent(e,n,r.x,r.y)}}}handleMagnetEvent(t,e){const n=t.currentTarget,i=n.getAttribute("magnet");if(i&&"false"!==i.toLowerCase()){const i=this.findView(n);if(i){const r=this.normalizeEvent(t);if(this.guard(r,i))return;const s=this.graph.snapToGrid(r.clientX,r.clientY);a.call(e,this.graph,i,r,n,s.x,s.y)}}}onMagnetMouseDown(t){this.handleMagnetEvent(t,(t,e,n,i,r)=>{t.onMagnetMouseDown(e,n,i,r)})}onMagnetDblClick(t){this.handleMagnetEvent(t,(t,e,n,i,r)=>{t.onMagnetDblClick(e,n,i,r)})}onMagnetContextMenu(t){const e=this.normalizeEvent(t),n=this.findView(e.target);this.isPreventDefaultContextMenu(e,n)&&e.preventDefault(),this.handleMagnetEvent(e,(t,e,n,i,r)=>{t.onMagnetContextMenu(e,n,i,r)})}onLabelMouseDown(t){const e=t.currentTarget,n=this.findView(e);if(n){const e=this.normalizeEvent(t);if(this.guard(e,n))return;const i=this.graph.snapToGrid(e.clientX,e.clientY);n.onLabelMouseDown(e,i.x,i.y)}}onImageDragStart(){return!1}dispose(){this.undelegateEvents(),this.undelegateDocumentEvents(),this.restore(),this.restore=()=>{}}}MP([qE.dispose()],EP.prototype,"dispose",null),function(t){const e=UM.prefixCls+"-graph";function n(t){const e=t.cloneNode();return t.childNodes.forEach(t=>e.appendChild(t)),()=>{h.empty(t);while(t.attributes.length>0)t.removeAttribute(t.attributes[0].name);for(let n=0,i=e.attributes.length;n<i;n+=1){const i=e.attributes[n];t.setAttribute(i.name,i.value)}e.childNodes.forEach(e=>t.appendChild(e))}}t.markup=[{ns:h.ns.xhtml,tagName:"div",selector:"background",className:e+"-background"},{ns:h.ns.xhtml,tagName:"div",selector:"grid",className:e+"-grid"},{ns:h.ns.svg,tagName:"svg",selector:"svg",className:e+"-svg",attrs:{width:"100%",height:"100%","xmlns:xlink":h.ns.xlink},children:[{tagName:"defs",selector:"defs"},{tagName:"g",selector:"viewport",className:e+"-svg-viewport",children:[{tagName:"g",selector:"primer",className:e+"-svg-primer"},{tagName:"g",selector:"stage",className:e+"-svg-stage"},{tagName:"g",selector:"decorator",className:e+"-svg-decorator"},{tagName:"g",selector:"overlay",className:e+"-svg-overlay"}]}]}],t.snapshoot=n}(EP||(EP={})),function(t){const e=UM.prefixCls;t.events={dblclick:"onDblClick",contextmenu:"onContextMenu",touchstart:"onMouseDown",mousedown:"onMouseDown",mouseover:"onMouseOver",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousewheel:"onMouseWheel",DOMMouseScroll:"onMouseWheel",[`mouseenter .${e}-cell`]:"onMouseEnter",[`mouseleave .${e}-cell`]:"onMouseLeave",[`mouseenter .${e}-cell-tools`]:"onMouseEnter",[`mouseleave .${e}-cell-tools`]:"onMouseLeave",[`mousedown .${e}-cell [event]`]:"onCustomEvent",[`touchstart .${e}-cell [event]`]:"onCustomEvent",[`mousedown .${e}-cell [data-event]`]:"onCustomEvent",[`touchstart .${e}-cell [data-event]`]:"onCustomEvent",[`dblclick .${e}-cell [magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [magnet]`]:"onMagnetMouseDown",[`dblclick .${e}-cell [data-magnet]`]:"onMagnetDblClick",[`contextmenu .${e}-cell [data-magnet]`]:"onMagnetContextMenu",[`mousedown .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`touchstart .${e}-cell [data-magnet]`]:"onMagnetMouseDown",[`dragstart .${e}-cell image`]:"onImageDragStart",[`mousedown .${e}-edge .${e}-edge-label`]:"onLabelMouseDown",[`touchstart .${e}-edge .${e}-edge-label`]:"onLabelMouseDown"},t.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"}}(EP||(EP={})),function(t){function e(t,e){return(n,i,r)=>{const s=r.value;r.value=function(...n){const r=this.scroller.widget;if(null==r){const n=`Shoule enable scroller to use method '${i}'`;if(!1!==t)throw console.error(n),new Error(n);return!1!==e&&console.warn(n),this}return s.call(this,...n)}}}t.checkScroller=e}(xP||(xP={}));const AP=".x6-graph {\n position: relative;\n outline: none;\n touch-action: none;\n}\n.x6-graph-background,\n.x6-graph-grid,\n.x6-graph-svg {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.x6-graph-background-stage,\n.x6-graph-grid-stage,\n.x6-graph-svg-stage {\n user-select: none;\n}\n.x6-graph.x6-graph-pannable {\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n}\n.x6-graph.x6-graph-panning {\n cursor: grabbing;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n}\n.x6-node {\n cursor: move;\n /* stylelint-disable-next-line */\n}\n.x6-node.x6-node-immovable {\n cursor: default;\n}\n.x6-node * {\n -webkit-user-drag: none;\n}\n.x6-node .scalable * {\n vector-effect: non-scaling-stroke;\n}\n.x6-node [magnet='true'] {\n cursor: crosshair;\n transition: opacity 0.3s;\n}\n.x6-node [magnet='true']:hover {\n opacity: 0.7;\n}\n.x6-node foreignObject {\n display: block;\n overflow: visible;\n background-color: transparent;\n}\n.x6-node foreignObject > body {\n position: static;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n overflow: visible;\n background-color: transparent;\n}\n.x6-edge .source-marker,\n.x6-edge .target-marker {\n vector-effect: non-scaling-stroke;\n}\n.x6-edge .connection {\n stroke-linejoin: round;\n fill: none;\n}\n.x6-edge .connection-wrap {\n cursor: move;\n opacity: 0;\n fill: none;\n stroke: #000;\n stroke-width: 15;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n.x6-edge .connection-wrap:hover {\n opacity: 0.4;\n stroke-opacity: 0.4;\n}\n.x6-edge .vertices {\n cursor: move;\n opacity: 0;\n}\n.x6-edge .vertices .vertex {\n fill: #1abc9c;\n}\n.x6-edge .vertices .vertex :hover {\n fill: #34495e;\n stroke: none;\n}\n.x6-edge .vertices .vertex-remove {\n cursor: pointer;\n fill: #fff;\n}\n.x6-edge .vertices .vertex-remove-area {\n cursor: pointer;\n opacity: 0.1;\n}\n.x6-edge .vertices .vertex-group:hover .vertex-remove-area {\n opacity: 1;\n}\n.x6-edge .arrowheads {\n cursor: move;\n opacity: 0;\n}\n.x6-edge .arrowheads .arrowhead {\n fill: #1abc9c;\n}\n.x6-edge .arrowheads .arrowhead :hover {\n fill: #f39c12;\n stroke: none;\n}\n.x6-edge .tools {\n cursor: pointer;\n opacity: 0;\n}\n.x6-edge .tools .tool-options {\n display: none;\n}\n.x6-edge .tools .tool-remove circle {\n fill: #f00;\n}\n.x6-edge .tools .tool-remove path {\n fill: #fff;\n}\n.x6-edge:hover .vertices,\n.x6-edge:hover .arrowheads,\n.x6-edge:hover .tools {\n opacity: 1;\n}\n.x6-highlight-opacity {\n opacity: 0.3;\n}\n@keyframes halo-pie-visibility {\n 0% {\n visibility: hidden;\n }\n 100% {\n visibility: visible;\n }\n}\n@keyframes halo-pie-opening {\n 0% {\n transform: scale(0.4) rotate(-20deg);\n }\n 100% {\n transform: scale(1) rotate(0);\n }\n}\n.x6-widget-handle {\n position: absolute;\n width: 20px;\n height: 20px;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: 0 0;\n background-size: 20px 20px;\n cursor: pointer;\n user-select: none;\n pointer-events: auto;\n -webkit-user-drag: none;\n user-drag: none;\n /* stylelint-disable-line */\n}\n.x6-widget-handle.hidden {\n display: none;\n}\n.x6-widget-handle-selected {\n background-color: rgba(0, 0, 0, 0.1);\n border-radius: 3px;\n}\n.x6-widget-handle-remove {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M15.386%2C3.365c-3.315-3.314-8.707-3.313-12.021%2C0c-3.314%2C3.315-3.314%2C8.706%2C0%2C12.02%20c3.314%2C3.314%2C8.707%2C3.314%2C12.021%2C0S18.699%2C6.68%2C15.386%2C3.365L15.386%2C3.365z%20M4.152%2C14.598C1.273%2C11.719%2C1.273%2C7.035%2C4.153%2C4.154%20c2.88-2.88%2C7.563-2.88%2C10.443%2C0c2.881%2C2.88%2C2.881%2C7.562%2C0%2C10.443C11.716%2C17.477%2C7.032%2C17.477%2C4.152%2C14.598L4.152%2C14.598z%22%2F%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M12.157%2C11.371L7.38%2C6.593C7.162%2C6.375%2C6.809%2C6.375%2C6.592%2C6.592c-0.218%2C0.219-0.218%2C0.572%2C0%2C0.79%20l4.776%2C4.776c0.218%2C0.219%2C0.571%2C0.219%2C0.79%2C0C12.375%2C11.941%2C12.375%2C11.588%2C12.157%2C11.371L12.157%2C11.371z%22%2F%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M11.369%2C6.593l-4.777%2C4.778c-0.217%2C0.217-0.217%2C0.568%2C0%2C0.787c0.219%2C0.219%2C0.571%2C0.217%2C0.788%2C0l4.777-4.777%20c0.218-0.218%2C0.218-0.571%2C0.001-0.789C11.939%2C6.375%2C11.587%2C6.375%2C11.369%2C6.593L11.369%2C6.593z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n cursor: pointer;\n}\n.x6-widget-handle-remove:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M15.386%2C3.365c-3.315-3.314-8.707-3.313-12.021%2C0c-3.314%2C3.315-3.314%2C8.706%2C0%2C12.02%20c3.314%2C3.314%2C8.707%2C3.314%2C12.021%2C0S18.699%2C6.68%2C15.386%2C3.365L15.386%2C3.365z%22%2F%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M12.157%2C11.371L7.38%2C6.593C7.162%2C6.375%2C6.809%2C6.375%2C6.592%2C6.592c-0.218%2C0.219-0.218%2C0.572%2C0%2C0.79%20l4.776%2C4.776c0.218%2C0.219%2C0.571%2C0.219%2C0.79%2C0C12.375%2C11.941%2C12.375%2C11.588%2C12.157%2C11.371L12.157%2C11.371z%22%2F%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M11.369%2C6.593l-4.777%2C4.778c-0.217%2C0.217-0.217%2C0.568%2C0%2C0.787c0.219%2C0.219%2C0.571%2C0.217%2C0.788%2C0l4.777-4.777%20c0.218-0.218%2C0.218-0.571%2C0.001-0.789C11.939%2C6.375%2C11.587%2C6.375%2C11.369%2C6.593L11.369%2C6.593z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-rotate {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M9.374%2C17.592c-4.176%2C0-7.57-3.401-7.57-7.575c0-4.175%2C3.395-7.574%2C7.57-7.574c0.28%2C0%2C0.56%2C0.018%2C0.837%2C0.05%20V1.268c0-0.158%2C0.099-0.3%2C0.239-0.36c0.151-0.058%2C0.315-0.026%2C0.428%2C0.086l2.683%2C2.688c0.152%2C0.154%2C0.152%2C0.399%2C0%2C0.553l-2.68%2C2.693%20c-0.115%2C0.112-0.279%2C0.147-0.431%2C0.087c-0.141-0.063-0.239-0.205-0.239-0.361V5.296C9.934%2C5.243%2C9.654%2C5.22%2C9.374%2C5.22%20c-2.646%2C0-4.796%2C2.152-4.796%2C4.797s2.154%2C4.798%2C4.796%2C4.798c2.645%2C0%2C4.798-2.153%2C4.798-4.798c0-0.214%2C0.174-0.391%2C0.391-0.391h1.991%20c0.217%2C0%2C0.394%2C0.177%2C0.394%2C0.391C16.947%2C14.19%2C13.549%2C17.592%2C9.374%2C17.592L9.374%2C17.592z%20M9.374%2C17.592%22%2F%3E%3C%2Fsvg%3E%20');\n cursor: move;\n}\n.x6-widget-handle-rotate:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M9.374%2C17.592c-4.176%2C0-7.57-3.401-7.57-7.575c0-4.175%2C3.395-7.574%2C7.57-7.574c0.28%2C0%2C0.56%2C0.018%2C0.837%2C0.05%20V1.268c0-0.158%2C0.099-0.3%2C0.239-0.36c0.151-0.058%2C0.315-0.026%2C0.428%2C0.086l2.683%2C2.688c0.152%2C0.154%2C0.152%2C0.399%2C0%2C0.553l-2.68%2C2.693%20c-0.115%2C0.112-0.279%2C0.147-0.431%2C0.087c-0.141-0.063-0.239-0.205-0.239-0.361V5.296C9.934%2C5.243%2C9.654%2C5.22%2C9.374%2C5.22%20c-2.646%2C0-4.796%2C2.152-4.796%2C4.797s2.154%2C4.798%2C4.796%2C4.798c2.645%2C0%2C4.798-2.153%2C4.798-4.798c0-0.214%2C0.174-0.391%2C0.391-0.391h1.991%20c0.217%2C0%2C0.394%2C0.177%2C0.394%2C0.391C16.947%2C14.19%2C13.549%2C17.592%2C9.374%2C17.592L9.374%2C17.592z%20M9.374%2C17.592%22%2F%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-resize {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20height%3D%2224px%22%20version%3D%221.1%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2224px%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Asketch%3D%22http%3A%2F%2Fwww.bohemiancoding.com%2Fsketch%2Fns%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Ctitle%2F%3E%3Cdesc%2F%3E%3Cdefs%2F%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20id%3D%22miu%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%3E%3Cg%20id%3D%22Artboard-1%22%20transform%3D%22translate(-251.000000%2C%20-443.000000)%22%3E%3Cg%20id%3D%22slice%22%20transform%3D%22translate(215.000000%2C%20119.000000)%22%2F%3E%3Cpath%20d%3D%22M252%2C448%20L256%2C448%20L256%2C444%20L252%2C444%20L252%2C448%20Z%20M257%2C448%20L269%2C448%20L269%2C446%20L257%2C446%20L257%2C448%20Z%20M257%2C464%20L269%2C464%20L269%2C462%20L257%2C462%20L257%2C464%20Z%20M270%2C444%20L270%2C448%20L274%2C448%20L274%2C444%20L270%2C444%20Z%20M252%2C462%20L252%2C466%20L256%2C466%20L256%2C462%20L252%2C462%20Z%20M270%2C462%20L270%2C466%20L274%2C466%20L274%2C462%20L270%2C462%20Z%20M254%2C461%20L256%2C461%20L256%2C449%20L254%2C449%20L254%2C461%20Z%20M270%2C461%20L272%2C461%20L272%2C449%20L270%2C449%20L270%2C461%20Z%22%20fill%3D%22%236A6C8A%22%20id%3D%22editor-crop-glyph%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E');\n cursor: se-resize;\n}\n.x6-widget-handle-resize:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3Csvg%20height%3D%2224px%22%20version%3D%221.1%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2224px%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Asketch%3D%22http%3A%2F%2Fwww.bohemiancoding.com%2Fsketch%2Fns%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Ctitle%2F%3E%3Cdesc%2F%3E%3Cdefs%2F%3E%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20id%3D%22miu%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%3E%3Cg%20id%3D%22Artboard-1%22%20transform%3D%22translate(-251.000000%2C%20-443.000000)%22%3E%3Cg%20id%3D%22slice%22%20transform%3D%22translate(215.000000%2C%20119.000000)%22%2F%3E%3Cpath%20d%3D%22M252%2C448%20L256%2C448%20L256%2C444%20L252%2C444%20L252%2C448%20Z%20M257%2C448%20L269%2C448%20L269%2C446%20L257%2C446%20L257%2C448%20Z%20M257%2C464%20L269%2C464%20L269%2C462%20L257%2C462%20L257%2C464%20Z%20M270%2C444%20L270%2C448%20L274%2C448%20L274%2C444%20L270%2C444%20Z%20M252%2C462%20L252%2C466%20L256%2C466%20L256%2C462%20L252%2C462%20Z%20M270%2C462%20L270%2C466%20L274%2C466%20L274%2C462%20L270%2C462%20Z%20M254%2C461%20L256%2C461%20L256%2C449%20L254%2C449%20L254%2C461%20Z%20M270%2C461%20L272%2C461%20L272%2C449%20L270%2C449%20L270%2C461%20Z%22%20fill%3D%22%23FD6EB6%22%20id%3D%22editor-crop-glyph%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E');\n}\n.x6-widget-handle-clone {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M12.852%2C0.875h-9.27c-0.853%2C0-1.547%2C0.694-1.547%2C1.547v10.816h1.547V2.422h9.27V0.875z%20M15.172%2C3.965h-8.5%20c-0.849%2C0-1.547%2C0.698-1.547%2C1.547v10.816c0%2C0.849%2C0.698%2C1.547%2C1.547%2C1.547h8.5c0.85%2C0%2C1.543-0.698%2C1.543-1.547V5.512%20C16.715%2C4.663%2C16.021%2C3.965%2C15.172%2C3.965L15.172%2C3.965z%20M15.172%2C16.328h-8.5V5.512h8.5V16.328z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n cursor: move;\n}\n.x6-widget-handle-clone:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M12.852%2C0.875h-9.27c-0.853%2C0-1.547%2C0.694-1.547%2C1.547v10.816h1.547V2.422h9.27V0.875z%20M15.172%2C3.965h-8.5%20c-0.849%2C0-1.547%2C0.698-1.547%2C1.547v10.816c0%2C0.849%2C0.698%2C1.547%2C1.547%2C1.547h8.5c0.849%2C0%2C1.543-0.698%2C1.543-1.547V5.512%20C16.715%2C4.663%2C16.021%2C3.965%2C15.172%2C3.965L15.172%2C3.965z%20M15.172%2C16.328h-8.5V5.512h8.5V16.328z%20M15.172%2C16.328%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-link {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M9.884%2C9.838c0.54-0.551%2C1.005-0.955%2C1.384-1.201c0.463-0.308%2C0.749-0.352%2C0.887-0.352h1.34v1.367%20c0%2C0.104%2C0.061%2C0.2%2C0.154%2C0.242s0.204%2C0.027%2C0.284-0.038l3.168-2.669c0.06-0.051%2C0.096-0.125%2C0.096-0.203S17.16%2C6.83%2C17.101%2C6.781%20l-3.168-2.677c-0.08-0.067-0.19-0.081-0.284-0.038c-0.094%2C0.045-0.154%2C0.139-0.154%2C0.242v1.414h-1.343%20c-1.24%2C0.014-2.215%2C0.67-2.927%2C1.242c-0.797%2C0.65-1.533%2C1.447-2.245%2C2.217c-0.361%2C0.391-0.7%2C0.759-1.044%2C1.1%20c-0.541%2C0.549-1.011%2C0.951-1.395%2C1.199c-0.354%2C0.231-0.678%2C0.357-0.921%2C0.357h-1.8c-0.146%2C0-0.266%2C0.12-0.266%2C0.265v2.029%20c0%2C0.148%2C0.12%2C0.268%2C0.266%2C0.268h1.8l0%2C0c1.255-0.014%2C2.239-0.667%2C2.958-1.24c0.82-0.661%2C1.572-1.475%2C2.297-2.256%20C9.225%2C10.524%2C9.555%2C10.169%2C9.884%2C9.838z%22%2F%3E%3C%2Fsvg%3E%20');\n cursor: move;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n}\n.x6-widget-handle-link:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M9.884%2C9.838c0.54-0.551%2C1.005-0.955%2C1.384-1.201c0.463-0.308%2C0.749-0.352%2C0.887-0.352h1.34v1.367%20c0%2C0.104%2C0.061%2C0.2%2C0.154%2C0.242s0.204%2C0.027%2C0.284-0.038l3.168-2.669c0.06-0.051%2C0.096-0.125%2C0.096-0.203S17.16%2C6.83%2C17.101%2C6.781%20l-3.168-2.677c-0.08-0.067-0.19-0.081-0.284-0.038c-0.094%2C0.045-0.154%2C0.139-0.154%2C0.242v1.414h-1.343%20c-1.24%2C0.014-2.215%2C0.67-2.927%2C1.242c-0.797%2C0.65-1.533%2C1.447-2.245%2C2.217c-0.361%2C0.391-0.7%2C0.759-1.044%2C1.1%20c-0.541%2C0.549-1.011%2C0.951-1.395%2C1.199c-0.354%2C0.231-0.678%2C0.357-0.921%2C0.357h-1.8c-0.146%2C0-0.266%2C0.12-0.266%2C0.265v2.029%20c0%2C0.148%2C0.12%2C0.268%2C0.266%2C0.268h1.8l0%2C0c1.255-0.014%2C2.239-0.667%2C2.958-1.24c0.82-0.661%2C1.572-1.475%2C2.297-2.256%20C9.225%2C10.524%2C9.555%2C10.169%2C9.884%2C9.838z%22%2F%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-fork {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cg%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%236A6C8A%22%20d%3D%22M13.307%2C11.593c-0.69%2C0-1.299%2C0.33-1.693%2C0.835l-4.136-2.387%20C7.552%2C9.82%2C7.602%2C9.589%2C7.602%2C9.344c0-0.25-0.051-0.487-0.129-0.71l4.097-2.364c0.393%2C0.536%2C1.022%2C0.888%2C1.737%2C0.888%20c1.193%2C0%2C2.16-0.967%2C2.16-2.159s-0.967-2.159-2.16-2.159c-1.191%2C0-2.158%2C0.967-2.158%2C2.159c0%2C0.076%2C0.014%2C0.149%2C0.021%2C0.223%20L6.848%2C7.716C6.469%2C7.39%2C5.982%2C7.185%2C5.442%2C7.185c-1.191%2C0-2.158%2C0.967-2.158%2C2.159s0.967%2C2.159%2C2.158%2C2.159%20c0.545%2C0%2C1.037-0.208%2C1.417-0.541l4.319%2C2.493c-0.014%2C0.098-0.029%2C0.194-0.029%2C0.296c0%2C1.193%2C0.967%2C2.159%2C2.158%2C2.159%20c1.193%2C0%2C2.16-0.966%2C2.16-2.159C15.467%2C12.559%2C14.5%2C11.593%2C13.307%2C11.593z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n cursor: move;\n}\n.x6-widget-handle-fork:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cg%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20fill%3D%22%23FD6EB6%22%20d%3D%22M13.307%2C11.593c-0.69%2C0-1.299%2C0.33-1.693%2C0.835l-4.136-2.387%20c0.075-0.22%2C0.125-0.452%2C0.125-0.697c0-0.25-0.051-0.487-0.129-0.71l4.097-2.365c0.394%2C0.536%2C1.022%2C0.888%2C1.737%2C0.888%20c1.193%2C0%2C2.16-0.967%2C2.16-2.159s-0.967-2.159-2.16-2.159c-1.191%2C0-2.158%2C0.967-2.158%2C2.159c0%2C0.076%2C0.015%2C0.148%2C0.022%2C0.223%20L6.848%2C7.716C6.469%2C7.39%2C5.981%2C7.185%2C5.442%2C7.185c-1.191%2C0-2.158%2C0.967-2.158%2C2.159s0.967%2C2.159%2C2.158%2C2.159%20c0.545%2C0%2C1.037-0.208%2C1.417-0.541l4.319%2C2.493c-0.013%2C0.098-0.029%2C0.194-0.029%2C0.296c0%2C1.193%2C0.967%2C2.159%2C2.158%2C2.159%20c1.193%2C0%2C2.16-0.966%2C2.16-2.159C15.467%2C12.559%2C14.5%2C11.593%2C13.307%2C11.593z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-unlink {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cg%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M12.285%2C9.711l-2.104-0.302L9.243%2C8.568L6.669%2C7.095C6.948%2C6.6%2C6.995%2C6.026%2C6.845%2C5.474%20c-0.191-0.698-0.695-1.36-1.438-1.786C4.068%2C2.922%2C2.464%2C3.214%2C1.82%2C4.338C1.536%2C4.836%2C1.489%2C5.414%2C1.64%2C5.97%20c0.189%2C0.698%2C0.694%2C1.36%2C1.438%2C1.787c0.328%2C0.187%2C0.67%2C0.31%2C1.01%2C0.372c0.002%2C0%2C0.006%2C0.002%2C0.008%2C0.004%20c0.027%2C0.004%2C0.057%2C0.009%2C0.088%2C0.011c2.12%2C0.316%2C3.203%2C0.915%2C3.73%2C1.337c-0.527%2C0.424-1.61%2C1.021-3.731%2C1.339%20c-0.029%2C0.003-0.058%2C0.007-0.087%2C0.012c-0.002%2C0.002-0.004%2C0.002-0.007%2C0.003c-0.341%2C0.062-0.684%2C0.187-1.013%2C0.374%20c-0.74%2C0.425-1.246%2C1.089-1.437%2C1.787c-0.149%2C0.555-0.105%2C1.133%2C0.181%2C1.632c0.011%2C0.018%2C0.021%2C0.033%2C0.033%2C0.049l0.883%2C0.783%20c0.765%2C0.366%2C1.775%2C0.328%2C2.67-0.184c0.744-0.425%2C1.248-1.088%2C1.439-1.786c0.148-0.552%2C0.104-1.126-0.176-1.62l2.573-1.473%20c0.573%2C0.287%2C2.299%2C1.292%2C2.299%2C1.292s3.602%2C1.445%2C4.241%2C1.812c0.773%2C0.191%2C0.566-0.151%2C0.566-0.151L12.285%2C9.711z%20M5.571%2C6.482%20C5.279%2C6.993%2C4.425%2C7.076%2C3.705%2C6.664C3.282%2C6.424%2C2.966%2C6.039%2C2.856%2C5.64C2.81%2C5.464%2C2.778%2C5.203%2C2.917%2C4.963%20c0.291-0.51%2C1.146-0.593%2C1.866-0.182C5.21%2C5.027%2C5.521%2C5.4%2C5.632%2C5.807C5.679%2C5.98%2C5.708%2C6.242%2C5.571%2C6.482z%20M5.632%2C13.159%20c-0.111%2C0.406-0.422%2C0.778-0.848%2C1.025c-0.719%2C0.409-1.576%2C0.327-1.867-0.184c-0.137-0.239-0.106-0.499-0.06-0.676%20c0.108-0.398%2C0.426-0.781%2C0.847-1.022c0.72-0.412%2C1.574-0.329%2C1.866%2C0.181C5.708%2C12.723%2C5.679%2C12.983%2C5.632%2C13.159z%20M16.181%2C5.139%20c-0.448%2C0.258-4.435%2C1.9-4.435%2C1.9s-1.556%2C0.855-2.104%2C1.13l0.937%2C0.843l2.057-0.229l4.11-3.638%20C16.745%2C5.146%2C17.013%2C4.664%2C16.181%2C5.139z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-unlink:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2218.75px%22%20height%3D%2218.75px%22%20viewBox%3D%220%200%2018.75%2018.75%22%20enable-background%3D%22new%200%200%2018.75%2018.75%22%20xml%3Aspace%3D%22preserve%22%3E%3Cg%3E%3Cg%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M12.285%2C9.711l-2.104-0.302L9.243%2C8.568L6.669%2C7.095C6.948%2C6.6%2C6.995%2C6.026%2C6.845%2C5.474%20c-0.191-0.698-0.695-1.36-1.438-1.786C4.068%2C2.922%2C2.464%2C3.214%2C1.82%2C4.338C1.536%2C4.836%2C1.489%2C5.414%2C1.64%2C5.97%20c0.189%2C0.698%2C0.694%2C1.36%2C1.438%2C1.787c0.328%2C0.187%2C0.67%2C0.31%2C1.01%2C0.372c0.002%2C0%2C0.006%2C0.002%2C0.008%2C0.004%20c0.027%2C0.004%2C0.057%2C0.009%2C0.088%2C0.011c2.12%2C0.316%2C3.203%2C0.915%2C3.73%2C1.337c-0.527%2C0.424-1.61%2C1.021-3.731%2C1.339%20c-0.029%2C0.003-0.058%2C0.007-0.087%2C0.012c-0.002%2C0.002-0.004%2C0.002-0.007%2C0.003c-0.341%2C0.062-0.684%2C0.187-1.013%2C0.374%20c-0.74%2C0.425-1.246%2C1.089-1.437%2C1.787c-0.149%2C0.555-0.105%2C1.133%2C0.181%2C1.632c0.011%2C0.018%2C0.021%2C0.033%2C0.033%2C0.049l0.883%2C0.783%20c0.765%2C0.366%2C1.775%2C0.328%2C2.67-0.184c0.744-0.425%2C1.248-1.088%2C1.439-1.786c0.148-0.552%2C0.104-1.126-0.176-1.62l2.573-1.473%20c0.573%2C0.287%2C2.299%2C1.292%2C2.299%2C1.292s3.602%2C1.445%2C4.241%2C1.812c0.773%2C0.191%2C0.566-0.151%2C0.566-0.151L12.285%2C9.711z%20M5.571%2C6.482%20C5.279%2C6.993%2C4.425%2C7.076%2C3.705%2C6.664C3.282%2C6.424%2C2.966%2C6.039%2C2.856%2C5.64C2.81%2C5.464%2C2.778%2C5.203%2C2.917%2C4.963%20c0.291-0.51%2C1.146-0.593%2C1.866-0.182C5.21%2C5.027%2C5.521%2C5.4%2C5.632%2C5.807C5.679%2C5.98%2C5.708%2C6.242%2C5.571%2C6.482z%20M5.632%2C13.159%20c-0.111%2C0.406-0.422%2C0.778-0.848%2C1.025c-0.719%2C0.409-1.576%2C0.327-1.867-0.184c-0.137-0.239-0.106-0.499-0.06-0.676%20c0.108-0.398%2C0.426-0.781%2C0.847-1.022c0.72-0.412%2C1.574-0.329%2C1.866%2C0.181C5.708%2C12.723%2C5.679%2C12.983%2C5.632%2C13.159z%20M16.181%2C5.139%20c-0.448%2C0.258-4.435%2C1.9-4.435%2C1.9s-1.556%2C0.855-2.104%2C1.13l0.937%2C0.843l2.057-0.229l4.11-3.638%20C16.745%2C5.146%2C17.013%2C4.664%2C16.181%2C5.139z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E%20');\n}\n.x6-widget-handle-direction {\n background-image: url(\"data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3C!DOCTYPE%20svg%20%20PUBLIC%20'-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN'%20%20'http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd'%3E%3Csvg%20id%3D%22Layer_1%22%20style%3D%22enable-background%3Anew%200%200%20512%20512%3B%22%20version%3D%221.1%22%20viewBox%3D%220%200%20512%20512%22%20xml%3Aspace%3D%22preserve%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%0A%09.st0%7Bfill%3A%236A6C8A%3Bstroke%3A%236A6C8A%3Bstroke-width%3A30%7D%0A%09.dot%7Bfill%3A%236A6C8A%3B%7D%0A%3C%2Fstyle%3E%3Cg%3E%3Cg%20id%3D%22XMLID_475_%22%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M133.1%2C277.1c1.8%2C0%2C3.7-0.6%2C5.4-1.7c4.1-3%2C5-8.7%2C2-12.8c-3-4.1-8.7-5-12.8-2c0%2C0%2C0%2C0%2C0%2C0%20%20%20%20%20c-4.1%2C3-5%2C8.7-2%2C12.8C127.5%2C275.8%2C130.3%2C277.1%2C133.1%2C277.1z%22%20id%3D%22XMLID_489_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M138.5%2C359.6c-4.1-3-9.8-2.1-12.8%2C2c-3%2C4.1-2.1%2C9.8%2C2%2C12.8c1.6%2C1.2%2C3.5%2C1.7%2C5.4%2C1.7%20%20%20%20%20c2.8%2C0%2C5.6-1.3%2C7.4-3.7C143.5%2C368.3%2C142.6%2C362.6%2C138.5%2C359.6z%22%20id%3D%22XMLID_726_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M108.1%2C327.7c-4.8%2C1.6-7.4%2C6.7-5.9%2C11.5c1.3%2C3.9%2C4.8%2C6.3%2C8.7%2C6.3c0.9%2C0%2C1.9-0.1%2C2.8-0.4%20%20%20%20%20c4.8-1.6%2C7.4-6.7%2C5.9-11.5C118%2C328.8%2C112.9%2C326.2%2C108.1%2C327.7z%22%20id%3D%22XMLID_776_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M108.1%2C307.3c0.9%2C0.3%2C1.9%2C0.4%2C2.8%2C0.4c3.8%2C0%2C7.4-2.4%2C8.7-6.3c1.6-4.8-1.1-9.9-5.9-11.5%20%20%20%20%20c-4.8-1.6-9.9%2C1.1-11.5%2C5.9C100.7%2C300.6%2C103.3%2C305.7%2C108.1%2C307.3z%22%20id%3D%22XMLID_777_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M169.2%2C265.4c2.4%2C0%2C4.7-1%2C6.5-2.6c1.7-1.7%2C2.7-4.1%2C2.7-6.5c0-2.4-1-4.8-2.7-6.5%20%20%20%20%20c-1.7-1.7-4.1-2.7-6.5-2.7s-4.7%2C1-6.5%2C2.7c-1.7%2C1.7-2.7%2C4-2.7%2C6.5c0%2C2.4%2C1%2C4.7%2C2.7%2C6.5C164.4%2C264.4%2C166.8%2C265.4%2C169.2%2C265.4z%22%20id%3D%22XMLID_797_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M247.7%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C243.7%2C265.4%2C247.7%2C261.3%2C247.7%2C256.3z%22%20id%3D%22XMLID_798_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M213%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C208.9%2C265.4%2C213%2C261.3%2C213%2C256.3z%22%20id%3D%22XMLID_799_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M317.2%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C313.1%2C265.4%2C317.2%2C261.3%2C317.2%2C256.3z%22%20id%3D%22XMLID_800_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M282.5%2C256.3c0-5-4.1-9.1-9.1-9.1s-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20S282.5%2C261.3%2C282.5%2C256.3z%22%20id%3D%22XMLID_801_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M401.1%2C185.2c0.9%2C0%2C1.9-0.1%2C2.8-0.5c4.8-1.6%2C7.4-6.7%2C5.9-11.5c-1.6-4.8-6.7-7.4-11.5-5.8%20%20%20%20%20c-4.8%2C1.6-7.4%2C6.7-5.8%2C11.5C393.6%2C182.8%2C397.2%2C185.2%2C401.1%2C185.2z%22%20id%3D%22XMLID_802_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M403.9%2C205.2c-4.8-1.6-9.9%2C1-11.5%2C5.9l0%2C0c-1.6%2C4.8%2C1.1%2C9.9%2C5.9%2C11.5%20%20%20%20%20c0.9%2C0.3%2C1.9%2C0.5%2C2.8%2C0.5c3.9%2C0%2C7.4-2.5%2C8.7-6.3c0%2C0%2C0%2C0%2C0%2C0C411.3%2C211.9%2C408.7%2C206.8%2C403.9%2C205.2z%22%20id%3D%22XMLID_803_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M373.5%2C237.2L373.5%2C237.2c-4.1%2C3-5%2C8.7-2%2C12.8c1.8%2C2.4%2C4.6%2C3.7%2C7.4%2C3.7%20%20%20%20%20c1.8%2C0%2C3.7-0.6%2C5.4-1.8c4.1-3%2C4.9-8.7%2C2-12.8C383.3%2C235.1%2C377.6%2C234.2%2C373.5%2C237.2z%22%20id%3D%22XMLID_804_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M373.5%2C152.9c1.6%2C1.2%2C3.5%2C1.8%2C5.4%2C1.8c2.8%2C0%2C5.6-1.3%2C7.4-3.8c3-4.1%2C2.1-9.8-2-12.7%20%20%20%20%20c-4.1-3-9.8-2.1-12.7%2C2C368.5%2C144.2%2C369.4%2C149.9%2C373.5%2C152.9z%22%20id%3D%22XMLID_805_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M342.8%2C247.1c-2.4%2C0-4.8%2C1-6.5%2C2.7c-1.7%2C1.7-2.7%2C4-2.7%2C6.5c0%2C2.4%2C1%2C4.7%2C2.7%2C6.4%20%20%20%20%20c1.7%2C1.7%2C4%2C2.7%2C6.5%2C2.7c2.4%2C0%2C4.7-1%2C6.5-2.7c1.7-1.7%2C2.7-4%2C2.7-6.4c0-2.4-1-4.8-2.7-6.5C347.6%2C248.1%2C345.2%2C247.1%2C342.8%2C247.1z%22%20id%3D%22XMLID_806_%22%2F%3E%0A%3Cpath%20class%3D%22st0%22%20d%3D%22M342.8%2C124.7H206.6l36.4-36.4c3.6-3.6%2C3.6-9.3%2C0-12.9c-3.6-3.6-9.3-3.6-12.9%2C0l-51.5%2C51.5%20%20%20%20%20c-1.9%2C1.9-2.8%2C4.4-2.7%2C6.9c-0.1%2C2.5%2C0.7%2C5%2C2.7%2C6.9l51.5%2C51.5c1.8%2C1.8%2C4.1%2C2.7%2C6.5%2C2.7c2.3%2C0%2C4.7-0.9%2C6.5-2.7%20%20%20%20%20c3.6-3.6%2C3.6-9.3%2C0-12.9l-36.4-36.4h136.1c0%2C0%2C0.1%2C0%2C0.1%2C0c0.6%2C0%2C1.2-0.1%2C1.8-0.2c0.2%2C0%2C0.4-0.1%2C0.6-0.1c0.1%2C0%2C0.2%2C0%2C0.3-0.1%20%20%20%20%20c3.2-1%2C5.6-3.6%2C6.3-6.9c0.1-0.6%2C0.2-1.2%2C0.2-1.8c0-0.6-0.1-1.2-0.2-1.8C351%2C127.8%2C347.3%2C124.7%2C342.8%2C124.7z%22%20id%3D%22XMLID_807_%22%2F%3E%0A%3Cpath%20class%3D%22st0%22%20d%3D%22M322.1%2C371.3l-51.5-51.5c-3.6-3.6-9.3-3.6-12.9%2C0c-3.6%2C3.6-3.6%2C9.3%2C0%2C12.9l36.9%2C36.9H169.2%20%20%20%20%20c-2.8%2C0-5.4%2C1.3-7%2C3.3c-0.1%2C0.1-0.2%2C0.2-0.3%2C0.4c-0.1%2C0.1-0.2%2C0.2-0.2%2C0.3c-0.1%2C0.1-0.1%2C0.2-0.2%2C0.4c-0.1%2C0.1-0.2%2C0.3-0.2%2C0.4%20%20%20%20%20c0%2C0.1-0.1%2C0.2-0.1%2C0.2c-0.1%2C0.2-0.2%2C0.4-0.3%2C0.6c0%2C0%2C0%2C0%2C0%2C0.1c-0.4%2C1.1-0.7%2C2.2-0.7%2C3.4c0%2C1.5%2C0.4%2C2.9%2C1%2C4.2c0%2C0%2C0%2C0.1%2C0.1%2C0.1%20%20%20%20%20c0.1%2C0.1%2C0.1%2C0.2%2C0.2%2C0.3c0.4%2C0.7%2C0.9%2C1.3%2C1.4%2C1.8c0.4%2C0.4%2C0.7%2C0.7%2C1.2%2C1c0.1%2C0.1%2C0.1%2C0.1%2C0.2%2C0.2c0%2C0%2C0.1%2C0%2C0.1%2C0.1%20%20%20%20%20c1.4%2C0.9%2C3.1%2C1.5%2C5%2C1.5h124.4l-36%2C36c-3.6%2C3.6-3.6%2C9.3%2C0%2C12.9c1.8%2C1.8%2C4.1%2C2.7%2C6.5%2C2.7c2.3%2C0%2C4.7-0.9%2C6.5-2.7l51.5-51.5%20%20%20%20%20c1.9-1.9%2C2.8-4.4%2C2.7-6.9C324.8%2C375.7%2C324%2C373.2%2C322.1%2C371.3z%22%20id%3D%22XMLID_808_%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E\");\n}\n.x6-widget-handle-direction:hover {\n background-image: url(\"data:image/svg+xml;charset=UTF-8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3C!DOCTYPE%20svg%20%20PUBLIC%20'-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN'%20%20'http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd'%3E%3Csvg%20id%3D%22Layer_1%22%20style%3D%22enable-background%3Anew%200%200%20512%20512%3B%22%20version%3D%221.1%22%20viewBox%3D%220%200%20512%20512%22%20xml%3Aspace%3D%22preserve%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%0A%09.st0%7Bfill%3A%23FD6EB6%3Bstroke%3A%23FD6EB6%3Bstroke-width%3A30%7D%0A%09.dot%7Bfill%3A%23FD6EB6%3B%7D%0A%3C%2Fstyle%3E%3Cg%3E%3Cg%20id%3D%22XMLID_475_%22%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M133.1%2C277.1c1.8%2C0%2C3.7-0.6%2C5.4-1.7c4.1-3%2C5-8.7%2C2-12.8c-3-4.1-8.7-5-12.8-2c0%2C0%2C0%2C0%2C0%2C0%20%20%20%20%20c-4.1%2C3-5%2C8.7-2%2C12.8C127.5%2C275.8%2C130.3%2C277.1%2C133.1%2C277.1z%22%20id%3D%22XMLID_489_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M138.5%2C359.6c-4.1-3-9.8-2.1-12.8%2C2c-3%2C4.1-2.1%2C9.8%2C2%2C12.8c1.6%2C1.2%2C3.5%2C1.7%2C5.4%2C1.7%20%20%20%20%20c2.8%2C0%2C5.6-1.3%2C7.4-3.7C143.5%2C368.3%2C142.6%2C362.6%2C138.5%2C359.6z%22%20id%3D%22XMLID_726_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M108.1%2C327.7c-4.8%2C1.6-7.4%2C6.7-5.9%2C11.5c1.3%2C3.9%2C4.8%2C6.3%2C8.7%2C6.3c0.9%2C0%2C1.9-0.1%2C2.8-0.4%20%20%20%20%20c4.8-1.6%2C7.4-6.7%2C5.9-11.5C118%2C328.8%2C112.9%2C326.2%2C108.1%2C327.7z%22%20id%3D%22XMLID_776_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M108.1%2C307.3c0.9%2C0.3%2C1.9%2C0.4%2C2.8%2C0.4c3.8%2C0%2C7.4-2.4%2C8.7-6.3c1.6-4.8-1.1-9.9-5.9-11.5%20%20%20%20%20c-4.8-1.6-9.9%2C1.1-11.5%2C5.9C100.7%2C300.6%2C103.3%2C305.7%2C108.1%2C307.3z%22%20id%3D%22XMLID_777_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M169.2%2C265.4c2.4%2C0%2C4.7-1%2C6.5-2.6c1.7-1.7%2C2.7-4.1%2C2.7-6.5c0-2.4-1-4.8-2.7-6.5%20%20%20%20%20c-1.7-1.7-4.1-2.7-6.5-2.7s-4.7%2C1-6.5%2C2.7c-1.7%2C1.7-2.7%2C4-2.7%2C6.5c0%2C2.4%2C1%2C4.7%2C2.7%2C6.5C164.4%2C264.4%2C166.8%2C265.4%2C169.2%2C265.4z%22%20id%3D%22XMLID_797_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M247.7%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C243.7%2C265.4%2C247.7%2C261.3%2C247.7%2C256.3z%22%20id%3D%22XMLID_798_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M213%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C208.9%2C265.4%2C213%2C261.3%2C213%2C256.3z%22%20id%3D%22XMLID_799_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M317.2%2C256.3c0-5-4.1-9.1-9.1-9.1c-5%2C0-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20C313.1%2C265.4%2C317.2%2C261.3%2C317.2%2C256.3z%22%20id%3D%22XMLID_800_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M282.5%2C256.3c0-5-4.1-9.1-9.1-9.1s-9.1%2C4.1-9.1%2C9.1c0%2C5%2C4.1%2C9.1%2C9.1%2C9.1%20%20%20%20%20S282.5%2C261.3%2C282.5%2C256.3z%22%20id%3D%22XMLID_801_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M401.1%2C185.2c0.9%2C0%2C1.9-0.1%2C2.8-0.5c4.8-1.6%2C7.4-6.7%2C5.9-11.5c-1.6-4.8-6.7-7.4-11.5-5.8%20%20%20%20%20c-4.8%2C1.6-7.4%2C6.7-5.8%2C11.5C393.6%2C182.8%2C397.2%2C185.2%2C401.1%2C185.2z%22%20id%3D%22XMLID_802_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M403.9%2C205.2c-4.8-1.6-9.9%2C1-11.5%2C5.9l0%2C0c-1.6%2C4.8%2C1.1%2C9.9%2C5.9%2C11.5%20%20%20%20%20c0.9%2C0.3%2C1.9%2C0.5%2C2.8%2C0.5c3.9%2C0%2C7.4-2.5%2C8.7-6.3c0%2C0%2C0%2C0%2C0%2C0C411.3%2C211.9%2C408.7%2C206.8%2C403.9%2C205.2z%22%20id%3D%22XMLID_803_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M373.5%2C237.2L373.5%2C237.2c-4.1%2C3-5%2C8.7-2%2C12.8c1.8%2C2.4%2C4.6%2C3.7%2C7.4%2C3.7%20%20%20%20%20c1.8%2C0%2C3.7-0.6%2C5.4-1.8c4.1-3%2C4.9-8.7%2C2-12.8C383.3%2C235.1%2C377.6%2C234.2%2C373.5%2C237.2z%22%20id%3D%22XMLID_804_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M373.5%2C152.9c1.6%2C1.2%2C3.5%2C1.8%2C5.4%2C1.8c2.8%2C0%2C5.6-1.3%2C7.4-3.8c3-4.1%2C2.1-9.8-2-12.7%20%20%20%20%20c-4.1-3-9.8-2.1-12.7%2C2C368.5%2C144.2%2C369.4%2C149.9%2C373.5%2C152.9z%22%20id%3D%22XMLID_805_%22%2F%3E%0A%3Cpath%20class%3D%22dot%22%20d%3D%22M342.8%2C247.1c-2.4%2C0-4.8%2C1-6.5%2C2.7c-1.7%2C1.7-2.7%2C4-2.7%2C6.5c0%2C2.4%2C1%2C4.7%2C2.7%2C6.4%20%20%20%20%20c1.7%2C1.7%2C4%2C2.7%2C6.5%2C2.7c2.4%2C0%2C4.7-1%2C6.5-2.7c1.7-1.7%2C2.7-4%2C2.7-6.4c0-2.4-1-4.8-2.7-6.5C347.6%2C248.1%2C345.2%2C247.1%2C342.8%2C247.1z%22%20id%3D%22XMLID_806_%22%2F%3E%0A%3Cpath%20class%3D%22st0%22%20d%3D%22M342.8%2C124.7H206.6l36.4-36.4c3.6-3.6%2C3.6-9.3%2C0-12.9c-3.6-3.6-9.3-3.6-12.9%2C0l-51.5%2C51.5%20%20%20%20%20c-1.9%2C1.9-2.8%2C4.4-2.7%2C6.9c-0.1%2C2.5%2C0.7%2C5%2C2.7%2C6.9l51.5%2C51.5c1.8%2C1.8%2C4.1%2C2.7%2C6.5%2C2.7c2.3%2C0%2C4.7-0.9%2C6.5-2.7%20%20%20%20%20c3.6-3.6%2C3.6-9.3%2C0-12.9l-36.4-36.4h136.1c0%2C0%2C0.1%2C0%2C0.1%2C0c0.6%2C0%2C1.2-0.1%2C1.8-0.2c0.2%2C0%2C0.4-0.1%2C0.6-0.1c0.1%2C0%2C0.2%2C0%2C0.3-0.1%20%20%20%20%20c3.2-1%2C5.6-3.6%2C6.3-6.9c0.1-0.6%2C0.2-1.2%2C0.2-1.8c0-0.6-0.1-1.2-0.2-1.8C351%2C127.8%2C347.3%2C124.7%2C342.8%2C124.7z%22%20id%3D%22XMLID_807_%22%2F%3E%0A%3Cpath%20class%3D%22st0%22%20d%3D%22M322.1%2C371.3l-51.5-51.5c-3.6-3.6-9.3-3.6-12.9%2C0c-3.6%2C3.6-3.6%2C9.3%2C0%2C12.9l36.9%2C36.9H169.2%20%20%20%20%20c-2.8%2C0-5.4%2C1.3-7%2C3.3c-0.1%2C0.1-0.2%2C0.2-0.3%2C0.4c-0.1%2C0.1-0.2%2C0.2-0.2%2C0.3c-0.1%2C0.1-0.1%2C0.2-0.2%2C0.4c-0.1%2C0.1-0.2%2C0.3-0.2%2C0.4%20%20%20%20%20c0%2C0.1-0.1%2C0.2-0.1%2C0.2c-0.1%2C0.2-0.2%2C0.4-0.3%2C0.6c0%2C0%2C0%2C0%2C0%2C0.1c-0.4%2C1.1-0.7%2C2.2-0.7%2C3.4c0%2C1.5%2C0.4%2C2.9%2C1%2C4.2c0%2C0%2C0%2C0.1%2C0.1%2C0.1%20%20%20%20%20c0.1%2C0.1%2C0.1%2C0.2%2C0.2%2C0.3c0.4%2C0.7%2C0.9%2C1.3%2C1.4%2C1.8c0.4%2C0.4%2C0.7%2C0.7%2C1.2%2C1c0.1%2C0.1%2C0.1%2C0.1%2C0.2%2C0.2c0%2C0%2C0.1%2C0%2C0.1%2C0.1%20%20%20%20%20c1.4%2C0.9%2C3.1%2C1.5%2C5%2C1.5h124.4l-36%2C36c-3.6%2C3.6-3.6%2C9.3%2C0%2C12.9c1.8%2C1.8%2C4.1%2C2.7%2C6.5%2C2.7c2.3%2C0%2C4.7-0.9%2C6.5-2.7l51.5-51.5%20%20%20%20%20c1.9-1.9%2C2.8-4.4%2C2.7-6.9C324.8%2C375.7%2C324%2C373.2%2C322.1%2C371.3z%22%20id%3D%22XMLID_808_%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E\");\n}\n.x6-widget-handle-surround .x6-widget-handle-animate .x6-widget-handle {\n transition: background-size 80ms, width 80ms, height 80ms, top 150ms, left 150ms, bottom 150ms, right 150ms;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-se {\n right: -25px;\n bottom: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-nw {\n top: -21px;\n left: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-n {\n top: -22px;\n left: 50%;\n margin-left: -10px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-e {\n top: -webkit-calc(40%);\n top: calc(50% - 10px);\n right: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-ne {\n top: -21px;\n right: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-w {\n top: 50%;\n left: -25px;\n margin-top: -10px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-sw {\n bottom: -25px;\n left: -25px;\n}\n.x6-widget-handle-surround .x6-widget-handle-pos-s {\n bottom: -24px;\n left: 50%;\n margin-left: -10px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle {\n width: 15px;\n height: 15px;\n font-size: 15px;\n background-size: 15px 15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-se {\n right: -19px;\n bottom: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-nw {\n top: -19px;\n left: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-n {\n top: -19px;\n margin-left: -7.5px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-e {\n top: -webkit-calc(42%);\n top: calc(50% - 8px);\n right: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-ne {\n top: -19px;\n right: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-w {\n left: -19px;\n margin-top: -8px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-sw {\n bottom: -19px;\n left: -19px;\n}\n.x6-widget-handle-surround .x6-widget-handle-small .x6-widget-handle-pos-s {\n bottom: -19px;\n margin-left: -7.5px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle {\n width: 10px;\n height: 10px;\n font-size: 10px;\n background-size: 10px 10px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-se {\n right: -15px;\n bottom: -13px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-nw {\n top: -13px;\n left: -15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-n {\n top: -13px;\n margin-left: -5px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-e {\n top: -webkit-calc(45%);\n top: calc(50% - 5px);\n right: -15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-ne {\n top: -13px;\n right: -15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-w {\n left: -15px;\n margin-top: -5px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-sw {\n bottom: -13px;\n left: -15px;\n}\n.x6-widget-handle-surround .x6-widget-handle-tiny .x6-widget-handle-pos-s {\n bottom: -13px;\n margin-left: -5px;\n}\n.x6-widget-handle-toolbar {\n position: absolute;\n top: -50px;\n display: table-row;\n padding: 7px 5px;\n}\n.x6-widget-handle-toolbar::after {\n position: absolute;\n top: 100%;\n left: 10px;\n width: 0;\n height: 0;\n margin-top: 4px;\n border-right: 10px solid transparent;\n border-left: 10px solid transparent;\n content: '';\n}\n.x6-widget-handle-toolbar .x6-widget-handle {\n position: relative;\n display: table-cell;\n min-width: 20px;\n margin: 0 2px;\n background-position: 3px 3px;\n background-size: 16px 16px;\n}\n.x6-widget-handle-toolbar .x6-widget-handle::after {\n position: absolute;\n bottom: -11px;\n width: 100%;\n content: '';\n}\n.x6-widget-handle-pie {\n position: absolute;\n top: -webkit-calc(0%);\n top: calc(50% - 50px);\n right: -50px;\n z-index: 1;\n display: none;\n width: 100px;\n height: 100px;\n margin: -2px -2px 0 0;\n border-radius: 50%;\n cursor: default;\n pointer-events: visiblePainted;\n}\n.x6-widget-handle-pie .x6-widget-handle {\n width: 1px;\n height: auto;\n pointer-events: visiblePainted;\n}\n.x6-widget-handle-pie-slice-svg {\n width: 100%;\n height: 100%;\n overflow: visible !important;\n}\n.x6-widget-handle-pie-slice-img,\n.x6-widget-handle-pie-slice-txt {\n display: none;\n pointer-events: none;\n}\n.x6-widget-handle-pie[data-pie-toggle-position='e'] {\n top: calc(50% - 50px);\n right: -50px;\n left: auto;\n}\n.x6-widget-handle-pie[data-pie-toggle-position='w'] {\n top: calc(50% - 50px);\n right: auto;\n left: -52px;\n}\n.x6-widget-handle-pie[data-pie-toggle-position='n'] {\n top: -50px;\n right: auto;\n bottom: auto;\n left: calc(50% - 52px);\n}\n.x6-widget-handle-pie[data-pie-toggle-position='s'] {\n top: auto;\n right: auto;\n bottom: -52px;\n left: calc(50% - 52px);\n}\n.x6-widget-handle-pie-opened {\n display: block;\n animation: halo-pie-visibility 0.1s, halo-pie-opening 0.1s;\n animation-timing-function: step-end, ease;\n animation-delay: 0s, 0.1s;\n}\n.x6-widget-handle-pie-toggle {\n position: absolute;\n top: -webkit-calc(35%);\n top: calc(50% - 15px);\n right: -15px;\n z-index: 2;\n display: block;\n box-sizing: border-box;\n width: 30px;\n height: 30px;\n background-repeat: no-repeat;\n background-position: center;\n background-size: 20px 20px;\n border-radius: 50%;\n cursor: pointer;\n user-select: none;\n pointer-events: visiblePainted;\n -webkit-user-drag: none;\n user-drag: none;\n /* stylelint-disable-line */\n}\n.x6-widget-handle-pie-toggle-pos-e {\n top: -webkit-calc(35%);\n top: calc(50% - 15px);\n right: -15px;\n bottom: auto;\n left: auto;\n}\n.x6-widget-handle-pie-toggle-pos-w {\n top: -webkit-calc(35%);\n top: calc(50% - 15px);\n right: auto;\n bottom: auto;\n left: -15px;\n}\n.x6-widget-handle-pie-toggle-pos-n {\n top: -15px;\n right: auto;\n bottom: auto;\n left: -webkit-calc(35%);\n left: calc(50% - 15px);\n}\n.x6-widget-handle-pie-toggle-pos-s {\n top: auto;\n right: auto;\n bottom: -15px;\n left: -webkit-calc(35%);\n left: calc(50% - 15px);\n}\n.x6-widget-handle-pie-toggle-opened {\n transition: 0.1s background-image;\n}\n.x6-widget-handle-toolbar {\n position: static;\n display: inline-block;\n margin-top: -50px;\n margin-left: 45px;\n white-space: nowrap;\n vertical-align: top;\n background-color: #f5f5f5;\n border-bottom: 3px solid #333;\n border-radius: 5px;\n box-shadow: 0 1px 2px #222;\n}\n.x6-widget-handle-toolbar::after {\n top: -12px;\n left: 55px;\n margin-top: 0;\n border-top: 6px solid #333;\n border-right: 10px solid transparent;\n border-left: 10px solid transparent;\n}\n.x6-widget-handle-toolbar .x6-widget-handle {\n display: inline-block;\n vertical-align: top;\n}\n.x6-widget-handle-toolbar .x6-widget-handle:hover::after {\n border-bottom: 4px solid #fc6cb8;\n}\n.x6-widget-handle-toolbar .x6-widget-handle-rotate {\n position: absolute;\n top: 100%;\n right: 100%;\n margin-top: 3px;\n margin-right: 6px;\n}\n.x6-widget-handle-toolbar .x6-widget-handle-remove:hover::after,\n.x6-widget-handle-toolbar .x6-widget-handle-rotate:hover::after {\n border-bottom: none;\n}\n.x6-widget-handle-toolbar .x6-widget-handle + .x6-widget-handle {\n margin-left: 4px;\n}\n.x6-widget-handle-pie {\n box-sizing: content-box;\n background-color: #f5f5f5;\n border: 2px solid #404040;\n}\n.x6-widget-handle-pie-slice {\n fill: transparent;\n stroke: #e9e9e9;\n stroke-width: 1;\n}\n.x6-widget-handle-pie-slice:hover {\n fill: #fff;\n}\n.x6-widget-handle-pie-slice-img {\n display: block;\n}\n.x6-widget-handle-selected .x6-widget-handle-pie-slice {\n fill: #fff;\n}\n.x6-widget-handle-pie-toggle {\n background-color: #f6f6f6;\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20height%3D%2216px%22%20id%3D%22Layer_1%22%20style%3D%22enable-background%3Anew%200%200%2016%2016%3B%22%20version%3D%221.1%22%20viewBox%3D%220%200%2016%2016%22%20width%3D%2216px%22%20xml%3Aspace%3D%22preserve%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cpath%20fill%3D%22%236A6C8A%22%20d%3D%22M15%2C6h-5V1c0-0.55-0.45-1-1-1H7C6.45%2C0%2C6%2C0.45%2C6%2C1v5H1C0.45%2C6%2C0%2C6.45%2C0%2C7v2c0%2C0.55%2C0.45%2C1%2C1%2C1h5v5c0%2C0.55%2C0.45%2C1%2C1%2C1h2%20c0.55%2C0%2C1-0.45%2C1-1v-5h5c0.55%2C0%2C1-0.45%2C1-1V7C16%2C6.45%2C15.55%2C6%2C15%2C6z%22%2F%3E%3C%2Fsvg%3E');\n background-size: 16px 16px;\n border: 2px solid #3b425f;\n}\n.x6-widget-handle-pie-toggle:hover {\n background-color: #fff;\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20height%3D%2216px%22%20id%3D%22Layer_1%22%20style%3D%22enable-background%3Anew%200%200%2016%2016%3B%22%20version%3D%221.1%22%20viewBox%3D%220%200%2016%2016%22%20width%3D%2216px%22%20xml%3Aspace%3D%22preserve%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cpath%20fill%3D%22%23FD6EB6%22%20d%3D%22M15%2C6h-5V1c0-0.55-0.45-1-1-1H7C6.45%2C0%2C6%2C0.45%2C6%2C1v5H1C0.45%2C6%2C0%2C6.45%2C0%2C7v2c0%2C0.55%2C0.45%2C1%2C1%2C1h5v5c0%2C0.55%2C0.45%2C1%2C1%2C1h2%20c0.55%2C0%2C1-0.45%2C1-1v-5h5c0.55%2C0%2C1-0.45%2C1-1V7C16%2C6.45%2C15.55%2C6%2C15%2C6z%22%2F%3E%3C%2Fsvg%3E');\n border-color: #fd6eb6;\n}\n.x6-widget-handle-pie-toggle-opened {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20xmlns%3Adc%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22%20xmlns%3Acc%3D%22http%3A%2F%2Fcreativecommons.org%2Fns%23%22%20xmlns%3Ardf%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22%20xmlns%3Asvg%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20id%3D%22Layer_1%22%20xml%3Aspace%3D%22preserve%22%3E%3Cmetadata%20id%3D%22metadata9%22%3E%3Crdf%3ARDF%3E%3Ccc%3AWork%20rdf%3Aabout%3D%22%22%3E%3Cdc%3Aformat%3Eimage%2Fsvg%2Bxml%3C%2Fdc%3Aformat%3E%3Cdc%3Atype%20rdf%3Aresource%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Fdcmitype%2FStillImage%22%20%2F%3E%3Cdc%3Atitle%3E%3C%2Fdc%3Atitle%3E%3C%2Fcc%3AWork%3E%3C%2Frdf%3ARDF%3E%3C%2Fmetadata%3E%3Cdefs%20id%3D%22defs7%22%20%2F%3E%3Cpath%20d%3D%22M%2015%2C6%2010%2C6%20C%201.0301983%2C6.00505%2015.002631%2C6.011353%206%2C6%20L%201%2C6%20C%200.45%2C6%200%2C6.45%200%2C7%20l%200%2C2%20c%200%2C0.55%200.45%2C1%201%2C1%20l%205%2C0%20c%208.988585%2C-0.019732%20-5.02893401%2C-0.018728%204%2C0%20l%205%2C0%20c%200.55%2C0%201%2C-0.45%201%2C-1%20L%2016%2C7%20C%2016%2C6.45%2015.55%2C6%2015%2C6%20z%22%20id%3D%22path3%22%20style%3D%22fill%3A%236a6c8a%22%20%2F%3E%3C%2Fsvg%3E');\n}\n.x6-widget-handle-pie-toggle-opened:hover {\n background-image: url('data:image/svg+xml;charset=utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%20standalone%3D%22no%22%3F%3E%3Csvg%20xmlns%3Adc%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%22%20xmlns%3Acc%3D%22http%3A%2F%2Fcreativecommons.org%2Fns%23%22%20xmlns%3Ardf%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22%20xmlns%3Asvg%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%20id%3D%22Layer_1%22%20xml%3Aspace%3D%22preserve%22%3E%3Cmetadata%20id%3D%22metadata9%22%3E%3Crdf%3ARDF%3E%3Ccc%3AWork%20rdf%3Aabout%3D%22%22%3E%3Cdc%3Aformat%3Eimage%2Fsvg%2Bxml%3C%2Fdc%3Aformat%3E%3Cdc%3Atype%20rdf%3Aresource%3D%22http%3A%2F%2Fpurl.org%2Fdc%2Fdcmitype%2FStillImage%22%20%2F%3E%3Cdc%3Atitle%3E%3C%2Fdc%3Atitle%3E%3C%2Fcc%3AWork%3E%3C%2Frdf%3ARDF%3E%3C%2Fmetadata%3E%3Cdefs%20id%3D%22defs7%22%20%2F%3E%3Cpath%20d%3D%22M%2015%2C6%2010%2C6%20C%201.0301983%2C6.00505%2015.002631%2C6.011353%206%2C6%20L%201%2C6%20C%200.45%2C6%200%2C6.45%200%2C7%20l%200%2C2%20c%200%2C0.55%200.45%2C1%201%2C1%20l%205%2C0%20c%208.988585%2C-0.019732%20-5.02893401%2C-0.018728%204%2C0%20l%205%2C0%20c%200.55%2C0%201%2C-0.45%201%2C-1%20L%2016%2C7%20C%2016%2C6.45%2015.55%2C6%2015%2C6%20z%22%20id%3D%22path3%22%20style%3D%22fill%3A%23FD6EB6%22%20%2F%3E%3C%2Fsvg%3E');\n}\n.x6-widget-dnd {\n position: absolute;\n top: -10000px;\n left: -10000px;\n z-index: 999999;\n display: none;\n cursor: move;\n opacity: 0.7;\n pointer-events: 'cursor';\n}\n.x6-widget-dnd.dragging {\n display: inline-block;\n}\n.x6-widget-dnd.dragging * {\n pointer-events: none !important;\n}\n.x6-widget-dnd .x6-graph {\n background: transparent;\n box-shadow: none;\n}\n.x6-widget-halo {\n position: absolute;\n pointer-events: none;\n}\n.x6-widget-halo-content {\n position: absolute;\n top: 100%;\n padding: 6px;\n font-size: 10px;\n line-height: 14px;\n text-align: center;\n border-radius: 6px;\n}\n.x6-widget-halo-handles + .x6-widget-halo-content {\n right: -20px;\n left: -20px;\n margin-top: 30px;\n}\n.x6-widget-halo-handles.x6-widget-handle-small + .x6-widget-halo-content {\n margin-top: 25px;\n}\n.x6-widget-halo-handles.x6-widget-handle-small + .x6-widget-halo-content {\n margin-top: 20px;\n}\n.x6-widget-halo-handles.x6-widget-handle-pie + .x6-widget-halo-content {\n right: 0;\n left: 0;\n margin-top: 10px;\n}\n.x6-widget-halo-content {\n color: #fff;\n background-color: #6a6b8a;\n}\n.x6-widget-halo.type-node .x6-widget-handle-toolbar .x6-widget-handle-remove {\n position: absolute;\n right: 100%;\n bottom: 100%;\n margin-right: 6px;\n margin-bottom: 3px;\n}\n.x6-widget-halo.type-edge .x6-widget-handle-surround .x6-widget-handle-remove {\n background-color: #fff;\n border-radius: 50%;\n}\n.x6-widget-halo.type-edge .x6-widget-handle-toolbar {\n margin-top: -60px;\n margin-left: -18px;\n}\n.x6-widget-halo.type-edge .x6-widget-handle-toolbar::after {\n top: -22px;\n left: -9px;\n}\n.x6-widget-minimap {\n position: relative;\n display: table-cell;\n box-sizing: border-box;\n overflow: hidden;\n text-align: center;\n vertical-align: middle;\n background-color: #fff;\n user-select: none;\n}\n.x6-widget-minimap .x6-graph {\n display: inline-block;\n box-shadow: 0 0 4px 0 #eee;\n cursor: pointer;\n}\n.x6-widget-minimap .x6-graph > svg {\n pointer-events: none;\n shape-rendering: optimizeSpeed;\n}\n.x6-widget-minimap .x6-graph .x6-node * {\n /* stylelint-disable-next-line */\n vector-effect: initial;\n}\n.x6-widget-minimap-viewport {\n position: absolute;\n box-sizing: content-box !important;\n margin: -2px 0 0 -2px;\n border: 2px solid #31d0c6;\n cursor: move;\n}\n.x6-widget-minimap-viewport-zoom {\n position: absolute;\n right: 0;\n bottom: 0;\n box-sizing: border-box;\n width: 12px;\n height: 12px;\n margin: 0 -6px -6px 0;\n background-color: #fff;\n border: 2px solid #31d0c6;\n border-radius: 50%;\n cursor: nwse-resize;\n}\n.x6-graph-scroller {\n position: relative;\n box-sizing: border-box;\n overflow: scroll;\n outline: none;\n}\n.x6-graph-scroller-content {\n position: relative;\n}\n.x6-graph-scroller-background {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.x6-graph-scroller .x6-graph {\n position: absolute;\n display: inline-block;\n margin: 0;\n box-shadow: none;\n}\n.x6-graph-scroller .x6-graph > svg {\n display: block;\n}\n.x6-graph-scroller.x6-graph-scroller-paged .x6-graph {\n box-shadow: 0 0 4px 0 #eee;\n}\n.x6-graph-scroller.x6-graph-scroller-pannable[data-panning='false'] {\n cursor: grab;\n cursor: -moz-grab;\n cursor: -webkit-grab;\n}\n.x6-graph-scroller.x6-graph-scroller-pannable[data-panning='true'] {\n cursor: grabbing;\n cursor: -moz-grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n}\n.x6-graph-pagebreak {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.x6-graph-pagebreak-vertical {\n position: absolute;\n top: 0;\n bottom: 0;\n box-sizing: border-box;\n width: 1px;\n border-left: 1px dashed #bdbdbd;\n}\n.x6-graph-pagebreak-horizontal {\n position: absolute;\n right: 0;\n left: 0;\n box-sizing: border-box;\n height: 1px;\n border-top: 1px dashed #bdbdbd;\n}\n.x6-widget-selection {\n position: absolute;\n display: none;\n width: 0;\n height: 0;\n touch-action: none;\n}\n.x6-widget-selection-rubberband {\n display: block;\n overflow: visible;\n opacity: 0.3;\n}\n.x6-widget-selection-selected {\n display: block;\n}\n.x6-widget-selection-box {\n cursor: move;\n}\n.x6-widget-selection-inner[data-selection-length='0'],\n.x6-widget-selection-inner[data-selection-length='1'] {\n display: none;\n}\n.x6-widget-selection-content {\n position: absolute;\n top: 100%;\n right: -20px;\n left: -20px;\n margin-top: 30px;\n padding: 6px;\n line-height: 14px;\n text-align: center;\n border-radius: 6px;\n}\n.x6-widget-selection-content:empty {\n display: none;\n}\n.x6-widget-selection-rubberband {\n background-color: #3498db;\n border: 2px solid #2980b9;\n}\n.x6-widget-selection-box {\n box-sizing: content-box !important;\n margin-top: -4px;\n margin-left: -4px;\n padding-right: 4px;\n padding-bottom: 4px;\n border: 2px dashed #feb663;\n box-shadow: 2px 2px 5px #d3d3d3;\n}\n.x6-widget-selection-inner {\n box-sizing: content-box !important;\n margin-top: -8px;\n margin-left: -8px;\n padding-right: 12px;\n padding-bottom: 12px;\n border: 2px solid #feb663;\n box-shadow: 2px 2px 5px #d3d3d3;\n}\n.x6-widget-selection-content {\n color: #fff;\n font-size: 10px;\n background-color: #6a6b8a;\n}\n.x6-widget-snapline {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n}\n.x6-widget-snapline-vertical,\n.x6-widget-snapline-horizontal {\n stroke: #2ecc71;\n stroke-width: 1px;\n}\n.x6-widget-stencil {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n.x6-widget-stencil::after {\n position: absolute;\n top: 0;\n display: block;\n width: 100%;\n height: 20px;\n padding: 8px 0;\n line-height: 20px;\n text-align: center;\n opacity: 0;\n transition: top 0.1s linear, opacity 0.1s linear;\n content: ' ';\n pointer-events: none;\n}\n.x6-widget-stencil-content {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n height: auto;\n overflow-x: hidden;\n overflow-y: auto;\n}\n.x6-widget-stencil .x6-node [magnet]:not([magnet='passive']) {\n pointer-events: none;\n}\n.x6-widget-stencil-group {\n padding: 0;\n padding-bottom: 8px;\n overflow: hidden;\n user-select: none;\n}\n.x6-widget-stencil-group.collapsed {\n height: auto;\n padding-bottom: 0;\n}\n.x6-widget-stencil-group-title {\n position: relative;\n margin-top: 0;\n margin-bottom: 0;\n padding: 4px;\n cursor: pointer;\n}\n.x6-widget-stencil-title,\n.x6-widget-stencil-group > .x6-widget-stencil-group-title {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n user-select: none;\n}\n.x6-widget-stencil .unmatched {\n opacity: 0.3;\n}\n.x6-widget-stencil .x6-node.unmatched {\n display: none;\n}\n.x6-widget-stencil-group.unmatched {\n display: none;\n}\n.x6-widget-stencil-search-text {\n position: relative;\n z-index: 1;\n box-sizing: border-box;\n width: 100%;\n height: 30px;\n max-height: 30px;\n line-height: 30px;\n outline: 0;\n}\n.x6-widget-stencil.not-found::after {\n opacity: 1;\n content: attr(data-not-found-text);\n}\n.x6-widget-stencil.not-found.searchable::after {\n top: 30px;\n}\n.x6-widget-stencil.not-found.searchable.collapsable::after {\n top: 50px;\n}\n.x6-widget-stencil {\n color: #333;\n background: #f5f5f5;\n}\n.x6-widget-stencil-content {\n position: absolute;\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-content {\n top: 32px;\n}\n.x6-widget-stencil.searchable > .x6-widget-stencil-content {\n top: 80px;\n}\n.x6-widget-stencil.not-found::after {\n position: absolute;\n}\n.x6-widget-stencil.not-found.searchable.collapsable::after {\n top: 80px;\n}\n.x6-widget-stencil.not-found.searchable::after {\n top: 60px;\n}\n.x6-widget-stencil-group {\n height: auto;\n margin-bottom: 1px;\n padding: 0;\n transition: none;\n}\n.x6-widget-stencil-group .x6-graph {\n background: transparent;\n box-shadow: none;\n}\n.x6-widget-stencil-group.collapsed {\n height: auto;\n max-height: 31px;\n}\n.x6-widget-stencil-title,\n.x6-widget-stencil-group > .x6-widget-stencil-group-title {\n position: relative;\n left: 0;\n box-sizing: border-box;\n width: 100%;\n height: 32px;\n padding: 0 5px 0 8px;\n color: #666;\n font-weight: 700;\n font-size: 12px;\n line-height: 32px;\n cursor: default;\n transition: all 0.3;\n}\n.x6-widget-stencil-title:hover,\n.x6-widget-stencil-group > .x6-widget-stencil-group-title:hover {\n color: #444;\n}\n.x6-widget-stencil-title {\n background: #e9e9e9;\n}\n.x6-widget-stencil-group > .x6-widget-stencil-group-title {\n background: #ededed;\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-title,\n.x6-widget-stencil-group.collapsable > .x6-widget-stencil-group-title {\n padding-left: 32px;\n cursor: pointer;\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-title::before,\n.x6-widget-stencil-group.collapsable > .x6-widget-stencil-group-title::before {\n position: absolute;\n top: 6px;\n left: 8px;\n display: block;\n width: 18px;\n height: 18px;\n margin: 0;\n padding: 0;\n background-color: transparent;\n background-repeat: no-repeat;\n background-position: 0 0;\n border: none;\n content: ' ';\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-title::before,\n.x6-widget-stencil-group.collapsable > .x6-widget-stencil-group-title::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNOS4zNzUuNUM0LjY4Ny41Ljg3NSA0LjMxMy44NzUgOWMwIDQuNjg4IDMuODEyIDguNSA4LjUgOC41IDQuNjg3IDAgOC41LTMuODEyIDguNS04LjUgMC00LjY4Ny0zLjgxMy04LjUtOC41LTguNXptMCAxNS44ODZDNS4zMDMgMTYuMzg2IDEuOTkgMTMuMDcyIDEuOTkgOXMzLjMxMi03LjM4NSA3LjM4NS03LjM4NVMxNi43NiA0LjkyOCAxNi43NiA5YzAgNC4wNzItMy4zMTMgNy4zODYtNy4zODUgNy4zODZ6Ii8+PHBhdGggZD0iTTEyLjc1MyA4LjQ0M0g1Ljk5N2EuNTU4LjU1OCAwIDAwMCAxLjExNmg2Ljc1NmEuNTU4LjU1OCAwIDAwMC0xLjExNnoiLz48L2c+PC9zdmc+');\n opacity: 0.4;\n transition: all 0.3s;\n}\n.x6-widget-stencil.collapsable > .x6-widget-stencil-title:hover::before,\n.x6-widget-stencil-group.collapsable > .x6-widget-stencil-group-title:hover::before {\n opacity: 0.6;\n}\n.x6-widget-stencil.collapsable.collapsed > .x6-widget-stencil-title::before,\n.x6-widget-stencil-group.collapsable.collapsed > .x6-widget-stencil-group-title::before {\n background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJub256ZXJvIj48cGF0aCBkPSJNOS4zNzUuNUM0LjY4Ny41Ljg3NSA0LjMxMy44NzUgOWMwIDQuNjg4IDMuODEyIDguNSA4LjUgOC41IDQuNjg3IDAgOC41LTMuODEyIDguNS04LjUgMC00LjY4Ny0zLjgxMy04LjUtOC41LTguNXptMCAxNS44ODZDNS4zMDMgMTYuMzg2IDEuOTkgMTMuMDcyIDEuOTkgOXMzLjMxMi03LjM4NSA3LjM4NS03LjM4NVMxNi43NiA0LjkyOCAxNi43NiA5YzAgNC4wNzItMy4zMTMgNy4zODYtNy4zODUgNy4zODZ6Ii8+PHBhdGggZD0iTTEyLjc1MyA4LjQ0M0g1Ljk5N2EuNTU4LjU1OCAwIDAwMCAxLjExNmg2Ljc1NmEuNTU4LjU1OCAwIDAwMC0xLjExNnoiLz48cGF0aCBkPSJNOC44MTcgNS42MjN2Ni43NTZhLjU1OC41NTggMCAwMDEuMTE2IDBWNS42MjNhLjU1OC41NTggMCAxMC0xLjExNiAweiIvPjwvZz48L3N2Zz4=');\n opacity: 0.4;\n}\n.x6-widget-stencil.collapsable.collapsed > .x6-widget-stencil-title:hover::before,\n.x6-widget-stencil-group.collapsable.collapsed > .x6-widget-stencil-group-title:hover::before {\n opacity: 0.6;\n}\n.x6-widget-stencil input[type='search'] {\n -webkit-appearance: textfield;\n}\n.x6-widget-stencil input[type='search']::-webkit-search-cancel-button,\n.x6-widget-stencil input[type='search']::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n.x6-widget-stencil-search-text {\n display: block;\n width: 90%;\n margin: 8px 5%;\n padding-left: 8px;\n color: #333;\n background: #fff;\n border: 1px solid #e9e9e9;\n border-radius: 12px;\n outline: 0;\n}\n.x6-widget-stencil-search-text:focus {\n outline: 0;\n}\n.x6-widget-stencil::after {\n color: #808080;\n font-weight: 600;\n font-size: 12px;\n background: 0 0;\n}\n.x6-widget-transform {\n position: absolute;\n box-sizing: content-box !important;\n margin: -5px 0 0 -5px;\n padding: 4px;\n border: 1px dashed #000;\n border-radius: 5px;\n user-select: none;\n pointer-events: none;\n}\n.x6-widget-transform > div {\n position: absolute;\n box-sizing: border-box;\n background-color: #fff;\n border: 1px solid #000;\n transition: background-color 0.2s;\n pointer-events: auto;\n -webkit-user-drag: none;\n user-drag: none;\n /* stylelint-disable-line */\n}\n.x6-widget-transform > div:hover {\n background-color: #d3d3d3;\n}\n.x6-widget-transform-cursor-n {\n cursor: n-resize;\n}\n.x6-widget-transform-cursor-s {\n cursor: s-resize;\n}\n.x6-widget-transform-cursor-e {\n cursor: e-resize;\n}\n.x6-widget-transform-cursor-w {\n cursor: w-resize;\n}\n.x6-widget-transform-cursor-ne {\n cursor: ne-resize;\n}\n.x6-widget-transform-cursor-nw {\n cursor: nw-resize;\n}\n.x6-widget-transform-cursor-se {\n cursor: se-resize;\n}\n.x6-widget-transform-cursor-sw {\n cursor: sw-resize;\n}\n.x6-widget-transform-resize {\n width: 10px;\n height: 10px;\n border-radius: 6px;\n}\n.x6-widget-transform-resize[data-position='top-left'] {\n top: -5px;\n left: -5px;\n}\n.x6-widget-transform-resize[data-position='top-right'] {\n top: -5px;\n right: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom-left'] {\n bottom: -5px;\n left: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom-right'] {\n right: -5px;\n bottom: -5px;\n}\n.x6-widget-transform-resize[data-position='top'] {\n top: -5px;\n left: 50%;\n margin-left: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom'] {\n bottom: -5px;\n left: 50%;\n margin-left: -5px;\n}\n.x6-widget-transform-resize[data-position='left'] {\n top: 50%;\n left: -5px;\n margin-top: -5px;\n}\n.x6-widget-transform-resize[data-position='right'] {\n top: 50%;\n right: -5px;\n margin-top: -5px;\n}\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='top'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='bottom'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='left'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='right'] {\n display: none;\n}\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='bottom'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='left'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='right'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='top'] {\n display: none;\n}\n.x6-widget-transform.no-resize .x6-widget-transform-resize {\n display: none;\n}\n.x6-widget-transform-rotate {\n top: -20px;\n left: -20px;\n width: 12px;\n height: 12px;\n border-radius: 6px;\n cursor: crosshair;\n}\n.x6-widget-transform.no-rotate .x6-widget-transform-rotate {\n display: none;\n}\n.x6-widget-transform-active {\n border-color: transparent;\n pointer-events: all;\n}\n.x6-widget-transform-active > div {\n display: none;\n}\n.x6-widget-transform-active > .x6-widget-transform-active-handle {\n display: block;\n background-color: #808080;\n}\n.x6-widget-knob {\n position: absolute;\n box-sizing: border-box;\n width: 16px;\n height: 16px;\n margin-top: -8px;\n margin-left: -8px;\n cursor: pointer;\n user-select: none;\n}\n.x6-widget-knob::before,\n.x6-widget-knob::after {\n position: absolute;\n transform: rotate(45deg);\n content: '';\n}\n.x6-widget-knob::before {\n top: 4px;\n left: 4px;\n box-sizing: border-box;\n width: 8px;\n height: 8px;\n background-color: #fff;\n}\n.x6-widget-knob::after {\n top: 5px;\n left: 5px;\n box-sizing: border-box;\n width: 6px;\n height: 6px;\n background-color: #fca000;\n}\n.x6-graph-print {\n position: relative;\n}\n.x6-graph-print .x6-graph-print-ready {\n display: none;\n}\n.x6-graph-print .x6-graph-print-preview {\n overflow: hidden !important;\n background: #fff !important;\n}\n@media print {\n html,\n html > body.x6-graph-printing {\n position: relative !important;\n width: 100% !important;\n height: 100% !important;\n margin: 0 !important;\n padding: 0 !important;\n }\n html > body.x6-graph-printing > * {\n display: none !important;\n }\n html > body.x6-graph-printing > .x6-graph-print {\n display: block !important;\n }\n .x6-graph-print {\n top: 0 !important;\n left: 0 !important;\n margin: 0 !important;\n padding: 0 !important;\n overflow: hidden !important;\n page-break-after: always;\n background: #fff !important;\n }\n .x6-graph-print .x6-graph-print-ready {\n display: none;\n }\n}\n.x6-cell-tool-editor {\n position: relative;\n display: inline-block;\n min-height: 1em;\n margin: 0;\n padding: 0;\n line-height: 1;\n white-space: normal;\n text-align: center;\n vertical-align: top;\n overflow-wrap: normal;\n outline: none;\n transform-origin: 0 0;\n -webkit-user-drag: none;\n}\n.x6-edge-tool-editor {\n border: 1px solid #275fc5;\n border-radius: 2px;\n}\n";var SP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class OP extends wP{init(){UM.autoInsertCSS&&OP.ensure()}dispose(){OP.clean()}}SP([OP.dispose()],OP.prototype,"dispose",null),function(t){let e,n=0;function i(){if(n+=1,!(n>1)&&!U.isApplyingHMR()){e=document.createElement("style"),e.setAttribute("type","text/css"),e.textContent=AP;const t=document.querySelector("head");t&&t.insertBefore(e,t.firstChild)}}function r(){n-=1,n>0||(e&&e.parentNode&&e.parentNode.removeChild(e),e=null)}t.ensure=i,t.clean=r}(OP||(OP={}));var PP,kP=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class DP{get handleClassName(){return PP.handle}get pie(){return Object.assign(Object.assign({},DP.defaultPieOptions),this.handleOptions.pie)}initHandles(){if(this.handles=[],this.handleOptions.handles&&this.handleOptions.handles.forEach(t=>this.addHandle(t)),"pie"===this.handleOptions.type){if(this.pie.toggles){const t=PP.pieToggle;this.$pieToggles={},this.pie.toggles.forEach(e=>{const n=this.$("<div/>");this.applyAttrs(n,e.attrs),n.addClass(t).addClass(`${t}-pos-${e.position||"e"}`).attr("data-name",e.name).appendTo(this.container),this.$pieToggles[e.name]=n})}this.setPieIcons()}if(this.$handleContainer){const t=this.handleOptions.type||"surround";this.$handleContainer.addClass(PP.wrap).addClass(PP.animate).addClass(`${PP.handle}-${t}`)}this.delegateEvents({["mousedown ."+PP.handle]:"onHandleMouseDown",["touchstart ."+PP.handle]:"onHandleMouseDown",["mousedown ."+PP.pieToggle]:"onPieToggleMouseDown",["touchstart ."+PP.pieToggle]:"onPieToggleMouseDown"})}onHandleMouseDown(t){const e=this.$(t.currentTarget).closest("."+PP.handle).attr("data-action");e&&(t.preventDefault(),t.stopPropagation(),this.setEventData(t,{action:e,clientX:t.clientX,clientY:t.clientY,startX:t.clientX,startY:t.clientY}),"mousedown"===t.type&&2===t.button?this.triggerHandleAction(e,"contextmenu",t):(this.triggerHandleAction(e,"mousedown",t),this.delegateDocumentEvents({mousemove:"onHandleMouseMove",touchmove:"onHandleMouseMove",mouseup:"onHandleMouseUp",touchend:"onHandleMouseUp",touchcancel:"onHandleMouseUp"},t.data)))}onHandleMouseMove(t){const e=this.getEventData(t),n=e.action;n&&this.triggerHandleAction(n,"mousemove",t)}onHandleMouseUp(t){const e=this.getEventData(t),n=e.action;n&&(this.triggerHandleAction(n,"mouseup",t),this.undelegateDocumentEvents())}triggerHandleAction(t,e,n,i){n.preventDefault(),n.stopPropagation();const r=this.normalizeEvent(n),s=this.getEventData(r),o=this.graph.snapToGrid(r.clientX,r.clientY),a=this.graph.snapToGrid(s.clientX,s.clientY),l=o.x-a.x,h=o.y-a.y;this.trigger(`action:${t}:${e}`,Object.assign({e:r,dx:l,dy:h,x:o.x,y:o.y,offsetX:n.clientX-s.startX,offsetY:n.clientY-s.startY},i)),s.clientX=n.clientX,s.clientY=n.clientY}onPieToggleMouseDown(t){t.stopPropagation();const e=this.$(t.target).closest("."+PP.pieToggle).attr("data-name");this.isOpen(e)||this.isOpen()&&this.toggleState(),this.toggleState(e)}setPieIcons(){"pie"===this.handleOptions.type&&this.$handleContainer.find("."+PP.handle).each((t,e)=>{const n=this.$(e),i=n.attr("data-action"),r=PP.pieSlice,s=this.getHandle(i);if(!s||!s.icon){const t=window.getComputedStyle(e,":before").getPropertyValue("content");if(t&&"none"!==t){const e=n.find(`.${r}-txt`);e.length&&Mv.create(e[0]).text(t.replace(/['"]/g,""))}const i=n.css("background-image");if(i){const t=i.match(/url\(['"]?([^'"]+)['"]?\)/);if(t){const e=t[1],i=n.find(`.${r}-img`);i.length>0&&Mv.create(i[0]).attr("xlink:href",e)}}}})}getHandleIdx(t){return this.handles.findIndex(e=>e.name===t)}hasHandle(t){return this.getHandleIdx(t)>=0}getHandle(t){return this.handles.find(e=>e.name===t)}renderHandle(t){const e=this.$("<div/>").addClass(`${PP.handle} ${PP.handle}-${t.name}`).attr("data-action",t.name).prop("draggable",!1);if("pie"===this.handleOptions.type){const n=this.getHandleIdx(t.name),i=this.pie,r=i.outerRadius,s=i.innerRadius,o=(r+s)/2,a=new ZC(r,r),l=_C.toRad(i.sliceAngle),c=n*l+_C.toRad(i.startAngle),u=c+l,d=h.createSlicePathData(s,r,c,u),g=Mv.create("svg").addClass(PP.pieSlice+"-svg"),p=Mv.create("path").addClass(PP.pieSlice).attr("d",d).translate(r,r),f=ZC.fromPolar(o,-c-l/2,a).toJSON(),m=i.iconSize,b=Mv.create("image").attr(f).addClass(PP.pieSlice+"-img");f.y=f.y+m-2;const y=Mv.create("text",{"font-size":m}).attr(f).addClass(PP.pieSlice+"-txt");b.attr({width:m,height:m}),b.translate(-m/2,-m/2),y.translate(-m/2,-m/2),g.append([p,b,y]),e.append(g.node)}else e.addClass(`${PP.handle}-pos-${t.position}`),t.content&&("string"===typeof t.content?e.html(t.content):e.append(t.content));return this.updateHandleIcon(e,t.icon),this.applyAttrs(e,t.attrs),e}addHandle(t){if(!this.hasHandle(t.name)){this.handles.push(t);const e=t.events;e&&Object.keys(e).forEach(n=>{const i=e[n],r=`action:${t.name}:${n}`;"string"===typeof i?this.on(r,this[i],this):this.on(r,i)}),this.$handleContainer&&this.$handleContainer.append(this.renderHandle(t))}return this}addHandles(t){return t.forEach(t=>this.addHandle(t)),this}removeHandles(){while(this.handles.length)this.removeHandle(this.handles[0].name);return this}removeHandle(t){const e=this.getHandleIdx(t),n=this.handles[e];return n&&(n.events&&Object.keys(n.events).forEach(e=>{this.off(`action:${t}:${e}`)}),this.getHandleElem(t).remove(),this.handles.splice(e,1)),this}changeHandle(t,e){const n=this.getHandle(t);return n&&(this.removeHandle(t),this.addHandle(Object.assign(Object.assign({},n),e))),this}toggleHandle(t,e){const n=this.getHandle(t);if(n){const i=this.getHandleElem(t),r=PP.handle+"-selected";void 0===e&&(e=!i.hasClass(r)),i.toggleClass(r,e);const s=e?n.iconSelected:n.icon;s&&this.updateHandleIcon(i,s)}return this}selectHandle(t){return this.toggleHandle(t,!0)}deselectHandle(t){return this.toggleHandle(t,!1)}deselectAllHandles(){return this.handles.forEach(t=>this.deselectHandle(t.name)),this}getHandleElem(t){return this.$handleContainer.find(`.${PP.handle}-${t}`)}updateHandleIcon(t,e){if("pie"===this.handleOptions.type){const n=t.find("."+PP.pieSliceImg);this.$(n[0]).attr("xlink:href",e||"")}else t.css("background-image",e?`url(${e})`:"")}isRendered(){return null!=this.$handleContainer}isOpen(t){return!!this.isRendered()&&(t?this.$pieToggles[t].hasClass(PP.pieToggleOpened):this.$handleContainer.hasClass(""+PP.pieOpended))}toggleState(t){if(this.isRendered()){const e=this.$handleContainer;if(Object.keys(this.$pieToggles).forEach(t=>{const e=this.$pieToggles[t];e.removeClass(PP.pieToggleOpened)}),this.isOpen())this.trigger("pie:close",{name:t}),e.removeClass(PP.pieOpended);else{if(this.trigger("pie:open",{name:t}),t){const n=this.pie.toggles,i=n&&n.find(e=>e.name===t);i&&e.attr({"data-pie-toggle-name":i.name,"data-pie-toggle-position":i.position}),this.$pieToggles[t].addClass(PP.pieToggleOpened)}e.addClass(PP.pieOpended)}}}applyAttrs(t,e){if(e){const n=qE.$(t);Object.keys(e).forEach(t=>{const i=n.find(t).addBack().filter(t),r=e[t],{class:s}=r,o=kP(r,["class"]);s&&i.addClass(s),i.attr(o)})}}}(function(t){t.defaultPieOptions={innerRadius:20,outerRadius:50,sliceAngle:45,startAngle:0,iconSize:14,toggles:[{name:"default",position:"e"}]}})(DP||(DP={})),function(t){t.handle=qE.prototype.prefixClassName("widget-handle"),t.wrap=t.handle+"-wrap",t.animate=t.handle+"-animate",t.pieOpended=t.handle+"-pie-opened",t.pieToggle=t.handle+"-pie-toggle",t.pieToggleOpened=t.handle+"-pie-toggle-opened",t.pieSlice=t.handle+"-pie-slice",t.pieSliceImg=t.handle+"-pie-slice-img"}(PP||(PP={}));var TP,NP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},jP=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class LP extends qE{constructor(t){super();const e=t,{view:n,cell:i,node:r,edge:s,graph:o}=e,a=jP(e,["view","cell","node","edge","graph"]);n?(this.view=n,this.cell=n.cell,this.graph=n.graph,this.model=this.graph.model):(i||s||r)&&o&&(this.cell=r||s||i,this.view=o.renderer.findViewByCell(this.cell),this.graph=o,this.model=this.graph.model);const l=this.constructor;!1!==t.clearAll&&l.removeInstances(this.graph),l.register(this),this.init(a)}static ensureCache(){return this.instanceCache.has(this)||this.instanceCache.set(this,{}),this.instanceCache.get(this)}static register(t,e){null==e&&(e=t.graph);const n=this.ensureCache();let i=n[e.view.cid];null==i&&(i=n[e.view.cid]={}),i[t.cid]=t}static unregister(t,e){null==e&&(e=t.graph);const n=this.ensureCache();n[e.view.cid]&&delete n[e.view.cid][t.cid]}static removeInstances(t){const e=this.ensureCache(),n=e[t.view.cid];n&&Object.keys(n).forEach(t=>{const e=n[t];e&&e.remove()})}static getInstances(t){const e=this.ensureCache();return e[t.view.cid]||{}}init(t){}render(){return this}startListening(){!1!==this.options.clearOnBlankMouseDown&&this.graph.on("blank:mousedown",this.remove,this)}stopListening(){!1!==this.options.clearOnBlankMouseDown&&this.graph.off("blank:mousedown",this.remove,this)}remove(){this.stopListening();const t=this.constructor;return t.unregister(this),super.remove()}dispose(){this.remove()}}LP.instanceCache=new WeakMap,NP([qE.dispose()],LP.prototype,"dispose",null);class FP extends LP{get node(){return this.cell}get metadata(){const t=this.cell.prop("knob");return Array.isArray(t)?null!=this.options.index?t[this.options.index]:null:t}init(t){this.options=Object.assign({},t),this.render(),this.startListening()}startListening(){this.delegateEvents({mousedown:"onMouseDown",touchstart:"onMouseDown"}),this.model.on("*",this.update,this),this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this),this.model.on("reseted",this.remove,this),this.node.on("removed",this.remove,this),this.view.on("node:resize:mousedown",this.onTransform,this),this.view.on("node:rotate:mousedown",this.onTransform,this),this.view.on("node:resize:mouseup",this.onTransformed,this),this.view.on("node:rotate:mouseup",this.onTransformed,this),this.view.on("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.on("cell:knob:mouseup",this.onKnobMouseUp,this),super.startListening()}stopListening(){this.undelegateEvents(),this.model.off("*",this.update,this),this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this),this.model.off("reseted",this.remove,this),this.node.off("removed",this.remove,this),this.view.off("node:resize:mousedown",this.onTransform,this),this.view.off("node:rotate:mousedown",this.onTransform,this),this.view.off("node:resize:mouseup",this.onTransformed,this),this.view.off("node:rotate:mouseup",this.onTransformed,this),this.view.off("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.off("cell:knob:mouseup",this.onKnobMouseUp,this),super.stopListening()}render(){return this.container=document.createElement("div"),h.addClass(this.container,this.prefixClassName("widget-knob")),this.options.className&&h.addClass(this.container,this.options.className),this.view.addClass(TP.KNOB),this.graph.container.appendChild(this.container),this.update(),this}remove(){return this.view.removeClass(TP.KNOB),super.remove()}update(){if(this.metadata){const{update:t,position:e}=this.metadata,n={knob:this,cell:this.cell,node:this.node};if(e){const t=e.call(this.graph,Object.assign({},n));if(t){const e=this.graph.matrix(),n=this.node.getBBox(),i=_C.normalize(this.node.getAngle()),r=ZC.create(t);0!==i&&r.rotate(-i,{x:n.width/2,y:n.height/2}),r.translate(n).scale(e.a,e.d).translate(e.e,e.f),this.container.style.left=r.x+"px",this.container.style.top=r.y+"px"}}t&&t.call(this.graph,Object.assign({},n))}}hide(){this.container.style.display="none"}show(){this.container.style.display=""}onTransform(){this.hide()}onTransformed(){this.show()}onKnobMouseDown({knob:t}){this.cid!==t.cid&&this.hide()}onKnobMouseUp(){this.show()}notify(t,e){if(this.view){const n=this.view.normalizeEvent(e),i=this.graph.snapToGrid(n.clientX,n.clientY);this.view.notify("cell:"+t,{e:n,view:this.view,node:this.node,cell:this.cell,x:i.x,y:i.y,knob:this}),this.cell.isNode()?this.view.notify("node:"+t,{e:n,view:this.view,node:this.node,cell:this.cell,x:i.x,y:i.y,knob:this}):this.cell.isEdge()&&this.view.notify("edge:"+t,{e:n,view:this.view,edge:this.cell,cell:this.cell,x:i.x,y:i.y,knob:this})}}onMouseDown(t){t.stopPropagation(),this.setEventData(t,{knobbing:!1,originX:t.clientX,originY:t.clientY,clientX:t.clientX,clientY:t.clientY}),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(TP.documentEvents,t.data),this.metadata&&this.metadata.onMouseDown&&this.metadata.onMouseDown.call(this.graph,{e:t,data:this.getEventData(t),knob:this,cell:this.cell,node:this.node}),this.notify("knob:mousedown",t)}onMouseMove(t){const e=this.getEventData(t),n=this.graph.findViewByCell(this.node);if(e.knobbing||(e.knobbing=!0,n&&(n.addClass(TP.KNOBBING),this.notify("knob",t)),this.model.startBatch("knob",{cid:this.cid})),e.clientX=t.clientX,e.clientY=t.clientY,this.metadata&&this.metadata.onMouseMove){const n=this.graph.matrix(),i=(t.clientX-e.originX)/n.a,r=(t.clientY-e.originY)/n.d,s=this.node.getAngle(),o=new ZC(i,r).rotate(s);this.metadata.onMouseMove.call(this.graph,{e:t,data:e,deltaX:o.x,deltaY:o.y,knob:this,cell:this.cell,node:this.node})}this.notify("knobbing",t),this.notify("knob:mousemove",t)}onMouseUp(t){this.undelegateDocumentEvents(),this.graph.view.delegateEvents();const e=this.getEventData(t),n=this.graph.findViewByCell(this.node);e.knobbing&&(n&&n.removeClass(TP.KNOBBING),this.metadata&&this.metadata.onMouseUp&&this.metadata.onMouseUp.call(this.graph,{e:t,data:e,knob:this,cell:this.cell,node:this.node}),this.model.stopBatch("knob",{cid:this.cid}),this.notify("knobbed",t)),this.notify("knob:mouseup",t)}}(function(t){t.KNOB="has-widget-knob",t.KNOBBING="node-knobbing",t.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp"}})(TP||(TP={}));var zP,BP,RP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};(function(t){t.root="widget-minimap",t.viewport=t.root+"-viewport",t.zoom=t.viewport+"-zoom"})(zP||(zP={}));class IP extends qE{constructor(t){super(),this.options=Object.assign(Object.assign({},BP.defaultOptions),t),this.updateViewport=a.debounce(this.updateViewport.bind(this),0),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(this.prefixClassName(zP.root));const e=document.createElement("div");this.container.appendChild(e),this.$viewport=this.$("<div>").addClass(this.prefixClassName(zP.viewport)),this.options.scalable&&(this.zoomHandle=this.$("<div>").addClass(this.prefixClassName(zP.zoom)).appendTo(this.$viewport).get(0)),this.$container.append(this.$viewport).css({width:this.options.width,height:this.options.height,padding:this.options.padding}),this.options.container&&this.options.container.appendChild(this.container),this.sourceGraph=this.graph;const n=Object.assign(Object.assign({},this.options.graphOptions),{container:e,model:this.sourceGraph.model,frozen:!0,async:this.sourceGraph.isAsync(),interacting:!1,grid:!1,background:!1,rotating:!1,resizing:!1,embedding:!1,selecting:!1,snapline:!1,clipboard:!1,history:!1,scroller:!1});this.targetGraph=this.options.createGraph?this.options.createGraph(n):new Kk(n),this.targetGraph.renderer.unfreeze(),this.updatePaper(this.sourceGraph.options.width,this.sourceGraph.options.height),this.startListening()}get graph(){return this.options.graph}get scroller(){return this.graph.scroller.widget}get graphContainer(){return this.scroller?this.scroller.container:this.graph.container}get $graphContainer(){return this.scroller?this.scroller.$container:this.$(this.graph.container)}startListening(){this.scroller?this.$graphContainer.on("scroll"+this.getEventNamespace(),this.updateViewport):(this.sourceGraph.on("translate",this.onTransform,this),this.sourceGraph.on("scale",this.onTransform,this),this.sourceGraph.on("model:updated",this.onModelUpdated,this)),this.sourceGraph.on("resize",this.updatePaper,this),this.delegateEvents({mousedown:"startAction",touchstart:"startAction",["mousedown ."+this.prefixClassName("graph")]:"scrollTo",["touchstart ."+this.prefixClassName("graph")]:"scrollTo"})}stopListening(){this.scroller?this.$graphContainer.off(this.getEventNamespace()):(this.sourceGraph.off("translate",this.onTransform,this),this.sourceGraph.off("scale",this.onTransform,this),this.sourceGraph.off("model:updated",this.onModelUpdated,this)),this.sourceGraph.off("resize",this.updatePaper,this),this.undelegateEvents()}onRemove(){this.targetGraph.view.remove(),this.stopListening(),this.targetGraph.dispose()}onTransform(t){(t.ui||this.targetGraphTransforming)&&this.updateViewport()}onModelUpdated(){this.targetGraph.zoomToFit()}updatePaper(t,e){let n,i;"object"===typeof t?(n=t.width,i=t.height):(n=t,i=e);const r=this.sourceGraph.options,s=this.sourceGraph.transform.getScale(),o=this.options.width-2*this.options.padding,a=this.options.height-2*this.options.padding;n/=s.sx,i/=s.sy,this.ratio=Math.min(o/n,a/i);const l=this.ratio,h=r.x*l/s.sx,c=r.y*l/s.sy;return n*=l,i*=l,this.targetGraph.resizeGraph(n,i),this.targetGraph.translate(h,c),this.scroller?this.targetGraph.scale(l,l):this.targetGraph.zoomToFit(),this.updateViewport(),this}updateViewport(){const t=this.sourceGraph.transform.getScale(),e=this.targetGraph.transform.getScale();let n=null;n=this.scroller?this.scroller.clientToLocalPoint(0,0):this.graph.graphToLocal(0,0);const i=this.$(this.targetGraph.container).position(),r=this.targetGraph.translate();r.ty=r.ty||0,this.geometry={top:i.top+n.y*e.sy+r.ty,left:i.left+n.x*e.sx+r.tx,width:this.$graphContainer.innerWidth()*e.sx/t.sx,height:this.$graphContainer.innerHeight()*e.sy/t.sy},this.$viewport.css(this.geometry)}startAction(t){const e=this.normalizeEvent(t),n=e.target===this.zoomHandle?"zooming":"panning",{tx:i,ty:r}=this.sourceGraph.translate(),s={action:n,clientX:e.clientX,clientY:e.clientY,scrollLeft:this.graphContainer.scrollLeft,scrollTop:this.graphContainer.scrollTop,zoom:this.sourceGraph.zoom(),scale:this.sourceGraph.transform.getScale(),geometry:this.geometry,translateX:i,translateY:r};this.targetGraphTransforming=!0,this.delegateDocumentEvents(BP.documentEvents,s)}doAction(t){const e=this.normalizeEvent(t),n=e.clientX,i=e.clientY,r=e.data;switch(r.action){case"panning":{const t=this.sourceGraph.transform.getScale(),e=(n-r.clientX)*t.sx,s=(i-r.clientY)*t.sy;this.scroller?(this.graphContainer.scrollLeft=r.scrollLeft+e/this.ratio,this.graphContainer.scrollTop=r.scrollTop+s/this.ratio):this.sourceGraph.translate(r.translateX-e/this.ratio,r.translateY-s/this.ratio);break}case"zooming":{const t=r.scale,e=r.geometry,i=1+(r.clientX-n)/e.width/t.sx;r.frameId&&cancelAnimationFrame(r.frameId),r.frameId=requestAnimationFrame(()=>{this.sourceGraph.zoom(i*r.zoom,{absolute:!0,minScale:this.options.minScale,maxScale:this.options.maxScale})});break}default:break}}stopAction(){this.undelegateDocumentEvents(),this.targetGraphTransforming=!1}scrollTo(t){const e=this.normalizeEvent(t);let n,i;const r=this.targetGraph.translate();if(r.ty=r.ty||0,null==e.offsetX){const t=this.$(this.targetGraph.container).offset();n=e.pageX-t.left,i=e.pageY-t.top}else n=e.offsetX,i=e.offsetY;const s=(n-r.tx)/this.ratio,o=(i-r.ty)/this.ratio;this.sourceGraph.centerPoint(s,o)}dispose(){this.remove()}}RP([qE.dispose()],IP.prototype,"dispose",null),function(t){t.defaultOptions={width:300,height:200,padding:10,scalable:!0,minScale:.01,maxScale:16,graphOptions:{},createGraph:t=>new Kk(t)},t.documentEvents={mousemove:"doAction",touchmove:"doAction",mouseup:"stopAction",touchend:"stopAction"}}(BP||(BP={}));var VP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},$P=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class GP extends qE{constructor(t){super();const{graph:e}=t,n=$P(t,["graph"]);this.graph=e,this.options=Object.assign({tolerance:10},n),this.offset={x:0,y:0},this.render(),this.parseFilter(),this.disabled||this.startListening()}get model(){return this.graph.model}get containerClassName(){return this.prefixClassName("widget-snapline")}get verticalClassName(){return this.containerClassName+"-vertical"}get horizontalClassName(){return this.containerClassName+"-horizontal"}get disabled(){return!0!==this.options.enabled||!0!==this.graph.options.snapline.enabled}enable(){this.disabled&&(this.options.enabled=!0,this.graph.options.snapline.enabled=!0,this.startListening())}disable(){this.disabled||(this.options.enabled=!1,this.graph.options.snapline.enabled=!1,this.stopListening())}setFilter(t){this.options.filter=t,this.parseFilter()}render(){const t=this.containerWrapper=new Mv("svg"),e=this.horizontal=new Mv("line"),n=this.vertical=new Mv("line");t.addClass(this.containerClassName),e.addClass(this.horizontalClassName),n.addClass(this.verticalClassName),t.setAttribute("width","100%"),t.setAttribute("height","100%"),e.setAttribute("display","none"),n.setAttribute("display","none"),t.append([e,n]),this.options.className&&t.addClass(this.options.className),this.container=this.containerWrapper.node}startListening(){this.stopListening(),this.graph.on("node:mousedown",this.captureCursorOffset,this),this.graph.on("node:mousemove",this.snapOnMoving,this),this.model.on("batch:stop",this.onBatchStop,this),this.delegateDocumentEvents({mouseup:"hide",touchend:"hide"})}stopListening(){this.graph.off("node:mousedown",this.captureCursorOffset,this),this.graph.off("node:mousemove",this.snapOnMoving,this),this.model.off("batch:stop",this.onBatchStop,this),this.undelegateDocumentEvents()}parseFilter(){this.filterShapes={},this.filterCells={},this.filterFunction=null;const t=this.options.filter;Array.isArray(t)?t.forEach(t=>{"string"===typeof t?this.filterShapes[t]=!0:this.filterCells[t.id]=!0}):"function"===typeof t&&(this.filterFunction=t)}onBatchStop({name:t,data:e}){"resize"===t&&this.snapOnResizing(e.cell,e)}captureCursorOffset({view:t,x:e,y:n}){const i=t.getDelegatedView();if(i&&this.isNodeMovable(i)){const i=t.cell.getPosition();this.offset={x:e-i.x,y:n-i.y}}}isNodeMovable(t){return t&&t.cell.isNode()&&t.can("nodeMovable")}snapOnResizing(t,e){if(this.options.resizing&&!e.snapped&&e.ui&&e.direction&&e.trueDirection){const n=this.graph.renderer.findViewByCell(t);if(n&&n.cell.isNode()){const r=t.getBBox(),s=r.bbox(t.getAngle()),o=s.getTopLeft(),a=s.getBottomRight(),l=_C.normalize(t.getAngle()),h=this.options.tolerance||0;let c,u,d,g,p,f;const m={vertical:0,horizontal:0},b=e.direction,y=e.trueDirection,C=e.relativeDirection;-1!==y.indexOf("right")?m.vertical=a.x:m.vertical=o.x,-1!==y.indexOf("bottom")?m.horizontal=a.y:m.horizontal=o.y,this.model.getNodes().some(e=>{if(this.isIgnored(t,e))return!1;const n=e.getBBox().bbox(e.getAngle()),r=n.getTopLeft(),o=n.getBottomRight(),l={vertical:[r.x,o.x],horizontal:[r.y,o.y]},b={};return Object.keys(l).forEach(t=>{const e=t,n=l[e].map(t=>({position:t,distance:Math.abs(t-m[e])})).filter(t=>t.distance<=h);b[e]=i.sortBy(n,t=>t.distance)}),null==c&&b.vertical.length>0&&(c=b.vertical[0].position,u=Math.min(s.y,n.y),d=Math.max(a.y,o.y)-u),null==g&&b.horizontal.length>0&&(g=b.horizontal[0].position,p=Math.min(s.x,n.x),f=Math.max(a.x,o.x)-p),null!=c&&null!=g}),this.hide();let v=0,w=0;null==g&&null==c||(null!=c&&(v=-1!==y.indexOf("right")?c-a.x:o.x-c),null!=g&&(w=-1!==y.indexOf("bottom")?g-a.y:o.y-g));let x=0,M=0;if(l%90===0)90===l||270===l?(x=w,M=v):(x=v,M=w);else{const t=l>=0&&l<90?1:l>=90&&l<180?4:l>=180&&l<270?3:2;null!=g&&null!=c&&(v<w?(w=0,g=void 0):(v=0,c=void 0));const e=_C.toRad(l%90);v&&(x=3===t?v/Math.cos(e):v/Math.sin(e)),w&&(M=3===t?w/Math.cos(e):w/Math.sin(e));const n=1===t||3===t;switch(C){case"top":case"bottom":M=w?w/(n?Math.cos(e):Math.sin(e)):v/(n?Math.sin(e):Math.cos(e));break;case"left":case"right":x=v?v/(n?Math.cos(e):Math.sin(e)):w/(n?Math.sin(e):Math.cos(e));break;default:break}}switch(C){case"top":case"bottom":x=0;break;case"left":case"right":M=0;break;default:break}const E=this.graph.getGridSize();let A=Math.max(r.width+x,E),S=Math.max(r.height+M,E);e.minWidth&&e.minWidth>E&&(A=Math.max(A,e.minWidth)),e.minHeight&&e.minHeight>E&&(S=Math.max(S,e.minHeight)),e.maxWidth&&(A=Math.min(A,e.maxWidth)),e.maxHeight&&(S=Math.min(S,e.maxHeight)),e.preserveAspectRatio&&(M<x?S=A*(r.height/r.width):A=S*(r.width/r.height)),A===r.width&&S===r.height||(t.resize(A,S,{direction:b,relativeDirection:C,trueDirection:y,snapped:!0,snaplines:this.cid,restrict:this.graph.hook.getRestrictArea(n)}),d&&(d+=S-r.height),f&&(f+=A-r.width));const O=t.getBBox().bbox(l);c&&Math.abs(O.x-c)>1&&Math.abs(O.width+O.x-c)>1&&(c=void 0),g&&Math.abs(O.y-g)>1&&Math.abs(O.height+O.y-g)>1&&(g=void 0),this.update({verticalLeft:c,verticalTop:u,verticalHeight:d,horizontalTop:g,horizontalLeft:p,horizontalWidth:f})}}}snapOnMoving({view:t,e:e,x:n,y:i}){const r=t.getEventData(e).delegatedView||t;if(!this.isNodeMovable(r))return;const s=r.cell,o=s.getSize(),a=s.getPosition(),l=new KC(n-this.offset.x,i-this.offset.y,o.width,o.height),h=s.getAngle(),c=l.getCenter(),u=l.bbox(h),d=u.getTopLeft(),g=u.getBottomRight(),p=this.options.tolerance||0;let f,m,b,y,C,v,w=0,x=0;if(this.model.getNodes().some(t=>{if(this.isIgnored(s,t))return!1;const e=t.getBBox().bbox(t.getAngle()),n=e.getCenter(),i=e.getTopLeft(),r=e.getBottomRight();return null==f&&(Math.abs(n.x-c.x)<p?(f=n.x,w=.5):Math.abs(i.x-d.x)<p?(f=i.x,w=0):Math.abs(i.x-g.x)<p?(f=i.x,w=1):Math.abs(r.x-g.x)<p?(f=r.x,w=1):Math.abs(r.x-d.x)<p&&(f=r.x),null!=f&&(m=Math.min(u.y,e.y),b=Math.max(g.y,r.y)-m)),null==y&&(Math.abs(n.y-c.y)<p?(y=n.y,x=.5):Math.abs(i.y-d.y)<p?y=i.y:Math.abs(i.y-g.y)<p?(y=i.y,x=1):Math.abs(r.y-g.y)<p?(y=r.y,x=1):Math.abs(r.y-d.y)<p&&(y=r.y),null!=y&&(C=Math.min(u.x,e.x),v=Math.max(g.x,r.x)-C)),null!=f&&null!=y}),this.hide(),null!=y||null!=f){null!=y&&(u.y=y-x*u.height),null!=f&&(u.x=f-w*u.width);const t=u.getCenter(),e=t.x-l.width/2,n=t.y-l.height/2,i=e-a.x,o=n-a.y;0===i&&0===o||(s.translate(i,o,{snapped:!0,restrict:this.graph.hook.getRestrictArea(r)}),v&&(v+=i),b&&(b+=o)),this.update({verticalLeft:f,verticalTop:m,verticalHeight:b,horizontalTop:y,horizontalLeft:C,horizontalWidth:v})}}isIgnored(t,e){return e.id===t.id||e.isDescendantOf(t)||this.filterShapes[e.shape]||this.filterCells[e.id]||this.filterFunction&&a.call(this.filterFunction,this.graph,e)}update(t){if(t.horizontalTop){const e=this.graph.localToGraph(new ZC(t.horizontalLeft,t.horizontalTop)),n=this.graph.localToGraph(new ZC(t.horizontalLeft+t.horizontalWidth,t.horizontalTop));this.horizontal.setAttributes({x1:this.options.sharp?""+e.x:"0",y1:""+e.y,x2:this.options.sharp?""+n.x:"100%",y2:""+n.y,display:"inherit"})}else this.horizontal.setAttribute("display","none");if(t.verticalLeft){const e=this.graph.localToGraph(new ZC(t.verticalLeft,t.verticalTop)),n=this.graph.localToGraph(new ZC(t.verticalLeft,t.verticalTop+t.verticalHeight));this.vertical.setAttributes({x1:""+e.x,y1:this.options.sharp?""+e.y:"0",x2:""+n.x,y2:this.options.sharp?""+n.y:"100%",display:"inherit"})}else this.vertical.setAttribute("display","none");this.show()}resetTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){return this.resetTimer(),null==this.container.parentNode&&this.graph.container.appendChild(this.container),this}hide(){this.resetTimer(),this.vertical.setAttribute("display","none"),this.horizontal.setAttribute("display","none");const t=this.options.clean,e="number"===typeof t?t:!1!==t?3e3:0;return e>0&&(this.timer=window.setTimeout(()=>{null!==this.container.parentNode&&this.unmount()},e)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}VP([qE.dispose()],GP.prototype,"dispose",null);var _P=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class HP extends wP{init(){this.resetUpdates(),this.startListening(),this.resetViews(this.model.getCells()),!this.isFrozen()&&this.isAsync()&&this.updateViewsAsync()}startListening(){this.model.on("sorted",this.onSortModel,this),this.model.on("reseted",this.onModelReseted,this),this.model.on("batch:stop",this.onBatchStop,this),this.model.on("cell:added",this.onCellAdded,this),this.model.on("cell:removed",this.onCellRemoved,this),this.model.on("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.on("cell:change:visible",this.onCellVisibleChanged,this)}stopListening(){this.model.off("sorted",this.onSortModel,this),this.model.off("reseted",this.onModelReseted,this),this.model.off("batch:stop",this.onBatchStop,this),this.model.off("cell:added",this.onCellAdded,this),this.model.off("cell:removed",this.onCellRemoved,this),this.model.off("cell:change:zIndex",this.onCellZIndexChanged,this),this.model.off("cell:change:visible",this.onCellVisibleChanged,this)}resetUpdates(){this.updates={priorities:[{},{},{}],mounted:{},mountedCids:[],unmounted:{},unmountedCids:[],count:0,sort:!1,frozen:!1,freezeKey:null,animationId:null}}onSortModel(){this.model.hasActiveBatch(HP.SORT_DELAYING_BATCHES)||this.sortViews()}onModelReseted({options:t}){this.removeZPivots(),this.resetViews(this.model.getCells(),t)}onBatchStop({name:t,data:e}){if(this.isFrozen())return;const n=this.model;if(!this.isAsync()){const i=HP.UPDATE_DELAYING_BATCHES;i.includes(t)&&!n.hasActiveBatch(i)&&this.updateViews(e)}const i=HP.SORT_DELAYING_BATCHES;i.includes(t)&&!n.hasActiveBatch(i)&&this.sortViews()}onCellAdded({cell:t,options:e}){const n=e.position;this.isAsync()||"number"!==typeof n?this.renderView(t,e):(e.maxPosition===n&&this.freeze({key:"addCells"}),this.renderView(t,e),0===n&&this.unfreeze({key:"addCells"}))}onCellRemoved({cell:t,options:e}){const n=this.findViewByCell(t);n&&this.requestViewUpdate(n,HP.FLAG_REMOVE,n.priority,e)}onCellZIndexChanged({cell:t,options:e}){if("approx"===this.options.sorting){const n=this.findViewByCell(t);n&&this.requestViewUpdate(n,HP.FLAG_INSERT,n.priority,e)}}onCellVisibleChanged({cell:t,current:e,options:n}){e||this.processEdgeOnTerminalVisibleChanged(t,!1);const i=this.findViewByCell(t);!e&&i?this.removeView(t):e&&null==i&&this.renderView(t,n),e&&this.processEdgeOnTerminalVisibleChanged(t,!0)}processEdgeOnTerminalVisibleChanged(t,e){const n=(t,e)=>{const n=t.getSourceCellId();if(n!==e.id)return t.getSourceCell();const i=t.getTargetCellId();return i!==e.id?t.getTargetCell():null};this.model.getConnectedEdges(t).forEach(i=>{const r=n(i,t);(null==r||r.isVisible())&&(e?i.show():i.hide())})}isEdgeTerminalVisible(t,e){const n="source"===e?t.getSourceCellId():t.getTargetCellId(),i=n?this.model.getCell(n):null;return!(i&&!i.isVisible())}requestConnectedEdgesUpdate(t,e={}){if(lA.isCellView(t)){const n=t.cell,i=this.model.getConnectedEdges(n);for(let t=0,r=i.length;t<r;t+=1){const r=i[t],s=this.findViewByCell(r);if(!s)continue;const o=["update"];r.getTargetCell()===n&&o.push("target"),r.getSourceCell()===n&&o.push("source"),this.scheduleViewUpdate(s,s.getFlag(o),s.priority,e)}}}forcePostponedViewUpdate(t,e){if(!t||!lA.isCellView(t))return!1;const n=t.cell;if(n.isNode())return!1;const i=t;if(n.isEdge()&&0===(e&t.getFlag(["source","target"]))){let t=0;const e=this.findViewByCell(n.getSourceCell());e&&!this.isViewMounted(e)&&(t=this.dumpView(e),i.updateTerminalMagnet("source"));let r=0;const s=this.findViewByCell(n.getTargetCell());if(s&&!this.isViewMounted(s)&&(r=this.dumpView(s),i.updateTerminalMagnet("target")),0===t&&0===r)return!this.dumpView(i)}return!1}scheduleViewUpdate(t,e,n,i={}){const r=t.cid,s=this.updates;let o=s.priorities[n];o||(o=s.priorities[n]={});const a=o[r]||0;(a&e)!==e&&(a||(s.count+=1),e&HP.FLAG_REMOVE&&a&HP.FLAG_INSERT?o[r]^=HP.FLAG_INSERT:e&HP.FLAG_INSERT&&a&HP.FLAG_REMOVE&&(o[r]^=HP.FLAG_REMOVE),o[r]|=e,this.graph.hook.onViewUpdated(t,e,i))}requestViewUpdate(t,e,n,i={}){this.scheduleViewUpdate(t,e,n,i);const r=this.isAsync();if(this.isFrozen()||r&&!1!==i.async||this.model.hasActiveBatch(HP.UPDATE_DELAYING_BATCHES))return;const s=this.updateViews(i);r&&this.graph.trigger("render:done",{stats:s,options:i})}dumpView(t,e={}){if(null==t)return 0;const n=t.cid,i=this.updates,r=i.priorities[t.priority],s=this.registerMountedView(t)|r[n];return delete r[n],s?this.updateView(t,s,e):0}dumpViews(t={}){this.checkView(t),this.updateViews(t)}requireView(t,e={}){const n=this.findViewByCell(t);return null==n?null:(this.dumpView(n,e),n)}updateView(t,e,n={}){if(null==t)return 0;if(lA.isCellView(t)){if(e&HP.FLAG_REMOVE)return this.removeView(t.cell),0;e&HP.FLAG_INSERT&&(this.insertView(t),e^=HP.FLAG_INSERT)}return e?t.confirmUpdate(e,n):0}updateViews(t={}){let e,n=0,i=0,r=HP.MIN_PRIORITY;do{e=this.updateViewsBatch(t),n+=1,i+=e.updatedCount,r=Math.min(e.priority,r)}while(!e.empty);return{priority:r,batchCount:n,updatedCount:i}}updateViewsBatch(t={}){const e=this.updates,n=e.priorities,i=t.batchSize||HP.UPDATE_BATCH_SIZE;let r=!0,s=HP.MIN_PRIORITY,o=0,l=0,h=0,c=0,u=t.checkView||this.options.checkView;"function"!==typeof u&&(u=null);t:for(let d=0,g=n.length;d<g;d+=1){const g=n[d];for(const n in g){if(h>=i){r=!1;break t}const p=qE.views[n];if(!p){delete g[n];continue}let f=g[n];if(0===(f&HP.FLAG_REMOVE)){const t=n in e.unmounted;if(u&&!a.call(u,this.graph,{view:p,unmounted:t})){t||(this.registerUnmountedView(p),p.unmount()),e.unmounted[n]|=f,delete g[n],l+=1;continue}t&&(f|=HP.FLAG_INSERT,o+=1),f|=this.registerMountedView(p)}const m=p;let b=this.updateView(p,f,t);if(b>0){const t=m.cell;t&&t.isEdge()&&(m.hasAction(b,"source")&&!this.isEdgeTerminalVisible(t,"source")&&(b=m.removeAction(b,"source"),b|=HP.FLAG_REMOVE),m.hasAction(b,"target")&&!this.isEdgeTerminalVisible(t,"target")&&(b=m.removeAction(b,"target"),b|=HP.FLAG_REMOVE))}b>0&&(g[n]=b,!this.graph.hook.onViewPostponed(m,b,t)||g[n])?(c+=1,r=!1):(s>d&&(s=d),h+=1,delete g[n])}}return{empty:r,priority:s,mountedCount:o,unmountedCount:l,updatedCount:h,postponedCount:c}}updateViewsAsync(t={},e={processed:0,priority:HP.MIN_PRIORITY}){const n=this.updates,i=n.animationId;if(i){if(h.cancelAnimationFrame(i),0===e.processed){const e=t.before;"function"===typeof e&&a.call(e,this.graph,this.graph)}const r=this.updateViewsBatch(t),s=this.checkViewImpl({checkView:t.checkView,mountedBatchSize:HP.MOUNT_BATCH_SIZE-r.mountedCount,unmountedBatchSize:HP.MOUNT_BATCH_SIZE-r.unmountedCount});let o=e.processed;const l=n.count,c=s.mountedCount,u=s.unmountedCount;r.updatedCount>0&&(o+=r.updatedCount+r.unmountedCount,e.priority=Math.min(r.priority,e.priority),r.empty&&0===c?(r.priority=e.priority,r.mountedCount+=c,r.unmountedCount+=u,this.graph.trigger("render:done",{stats:r,options:t}),e.processed=0,n.count=0):e.processed=o);const d=t.progress;if(l&&"function"===typeof d&&a.call(d,this.graph,{total:l,done:r.empty,current:o}),n.animationId!==i)return}n.animationId=h.requestAnimationFrame(()=>{this.updateViewsAsync(t,e)})}registerMountedView(t){const e=t.cid,n=this.updates;if(e in n.mounted)return 0;n.mounted[e]=!0,n.mountedCids.push(e);const i=n.unmounted[e]||0;return delete n.unmounted[e],i}registerUnmountedView(t){const e=t.cid,n=this.updates;if(e in n.unmounted)return 0;n.unmounted[e]|=HP.FLAG_INSERT;const i=n.unmounted[e];return n.unmountedCids.push(e),delete n.mounted[e],i}isViewMounted(t){if(null==t)return!1;const e=t.cid;return e in this.updates.mounted}getMountedViews(){return Object.keys(this.updates.mounted).map(t=>lA.views[t])}getUnmountedViews(){return Object.keys(this.updates.unmounted).map(t=>lA.views[t])}checkMountedViews(t,e){let n=0;if("function"!==typeof t)return n;const i=this.updates,r=i.mounted,s=i.mountedCids,o=null==e?s.length:Math.min(s.length,e);for(let l=0;l<o;l+=1){const e=s[l];if(!(e in r))continue;const i=lA.views[e];if(null==i)continue;const o=a.call(t,this.graph,{view:i,unmounted:!0});if(o){s.push(e);continue}n+=1;const h=this.registerUnmountedView(i);h&&i.unmount()}return s.splice(0,o),n}checkUnmountedViews(t,e){let n=0;"function"!==typeof t&&(t=null);const i=this.updates,r=i.unmounted,s=i.unmountedCids,o=null==e?s.length:Math.min(s.length,e);for(let l=0;l<o;l+=1){const e=s[l];if(!(e in r))continue;const i=lA.views[e];if(null==i)continue;if(t&&!a.call(t,this.graph,{view:i,unmounted:!1})){s.push(e);continue}n+=1;const o=this.registerMountedView(i);o&&this.scheduleViewUpdate(i,o,i.priority,{mounting:!0})}return s.splice(0,o),n}checkViewImpl(t={mountedBatchSize:Number.MAX_SAFE_INTEGER,unmountedBatchSize:Number.MAX_SAFE_INTEGER}){const e=t.checkView||this.options.checkView,n=this.checkMountedViews(e,t.unmountedBatchSize),i=this.checkUnmountedViews(e,n>0?Math.min(this.updates.unmountedCids.length-n,t.mountedBatchSize):t.mountedBatchSize);return{mountedCount:i,unmountedCount:n}}checkView(t={}){return this.checkViewImpl(t)}isFrozen(){return!!this.options.frozen}freeze(t={}){const e=t.key,n=this.updates,i=this.options.frozen,r=n.freezeKey;if(e&&e!==r){if(i&&r)return;n.frozen=i,n.freezeKey=e}this.options.frozen=!0;const s=n.animationId;n.animationId=null,this.isAsync()&&null!=s&&h.cancelAnimationFrame(s),this.graph.trigger("freeze",{key:e})}unfreeze(t={}){const e=t.key,n=this.updates,i=n.freezeKey;if(e&&i&&e!==i)return;if(n.freezeKey=null,e&&e===i&&n.frozen)return;const r=()=>{this.options.frozen=n.frozen=!1,n.sort&&(this.sortViews(),n.sort=!1);const i=t.after;i&&a.call(i,this.graph,this.graph),this.graph.trigger("unfreeze",{key:e})};if(this.isAsync()){this.freeze();const e=t.progress;this.updateViewsAsync(Object.assign(Object.assign({},t),{progress:({done:t,current:n,total:i})=>{e&&a.call(e,this.graph,{done:t,current:n,total:i}),t&&r()}}))}else this.updateViews(t),r()}isAsync(){return!!this.options.async}setAsync(t){this.options.async=t}onRemove(){this.freeze(),this.removeViews()}resetViews(t=[],e={}){this.resetUpdates(),this.removeViews(),this.freeze({key:"reset"});for(let n=0,i=t.length;n<i;n+=1)this.renderView(t[n],e);this.unfreeze({key:"reset"}),this.sortViews()}removeView(t){const e=this.views[t.id];if(e){const n=e.cid,i=this.updates,r=i.mounted,s=i.unmounted;e.remove(),delete this.views[t.id],delete r[n],delete s[n]}return e}removeViews(){this.views&&Object.keys(this.views).forEach(t=>{const e=this.views[t];e&&this.removeView(e.cell)}),this.views={}}renderView(t,e={}){const n=t.id,i=this.views;let r=0,s=i[n];if(t.isVisible()&&(!t.isEdge()||this.isEdgeTerminalVisible(t,"source")&&this.isEdgeTerminalVisible(t,"target"))){if(s)r=HP.FLAG_INSERT;else{const e=this.graph.hook.createCellView(t);e&&(s=i[t.id]=e,s.graph=this.graph,r=this.registerUnmountedView(s)|s.getBootstrapFlag())}s&&this.requestViewUpdate(s,r,s.priority,e)}}isExactSorting(){return"exact"===this.options.sorting}sortViews(){this.isExactSorting()&&(this.isFrozen()?this.updates.sort=!0:this.sortViewsExact())}sortElements(t,e){const n=t.map(t=>{const e=t.parentNode,n=e.insertBefore(document.createTextNode(""),t.nextSibling);return t=>{if(e===t)throw new Error("You can't sort elements if any one is a descendant of another.");e.insertBefore(t,n),e.removeChild(n)}});t.sort(e).forEach((t,e)=>n[e](t))}sortViewsExact(){const t=this.view.$(this.view.stage).children("[data-cell-id]").toArray(),e=this.model;this.sortElements(t,(t,n)=>{const i=e.getCell(t.getAttribute("data-cell-id")||""),r=e.getCell(n.getAttribute("data-cell-id")||""),s=i.getZIndex()||0,o=r.getZIndex()||0;return s===o?0:s<o?-1:1})}addZPivot(t=0){null==this.zPivots&&(this.zPivots={});const e=this.zPivots;let n=e[t];if(n)return n;n=e[t]=document.createComment("z-index:"+(t+1));let i=-1/0;for(const s in e){const e=+s;e<t&&e>i&&(i=e)}const r=this.view.stage;if(i!==-1/0){const t=e[i];r.insertBefore(n,t.nextSibling)}else r.insertBefore(n,r.firstChild);return n}removeZPivots(){this.zPivots&&Object.keys(this.zPivots).forEach(t=>{const e=this.zPivots[t];e&&e.parentNode&&e.parentNode.removeChild(e)}),this.zPivots={}}insertView(t){const e=this.view.stage;switch(this.options.sorting){case"approx":{const n=t.cell.getZIndex(),i=this.addZPivot(n);e.insertBefore(t.container,i);break}case"exact":default:e.appendChild(t.container);break}}findViewByCell(t){if(null==t)return null;const e=MO.isCell(t)?t.id:t;return this.views[e]}findViewByElem(t){if(null==t)return null;const e="string"===typeof t?this.view.stage.querySelector(t):t instanceof Element?t:t[0];if(e){const t=this.view.findAttr("data-cell-id",e);if(t)return this.views[t]}return null}findViewsFromPoint(t){const e={x:t.x,y:t.y};return this.model.getCells().map(t=>this.findViewByCell(t)).filter(t=>null!=t&&h.getBBox(t.container,{target:this.view.stage}).containsPoint(e))}findEdgeViewsInArea(t,e={}){const n=KC.create(t);return this.model.getEdges().map(t=>this.findViewByCell(t)).filter(t=>{if(t){const i=h.getBBox(t.container,{target:this.view.stage});return 0===i.width?i.inflate(1,0):0===i.height&&i.inflate(0,1),e.strict?n.containsRect(i):n.isIntersectWithRect(i)}return!1})}findViewsInArea(t,e={}){const n=KC.create(t);return this.model.getNodes().map(t=>this.findViewByCell(t)).filter(t=>{if(t){const i=h.getBBox(t.container,{target:this.view.stage});return e.strict?n.containsRect(i):n.isIntersectWithRect(i)}return!1})}dispose(){this.resetUpdates(),this.stopListening()}}_P([wP.dispose()],HP.prototype,"dispose",null),function(t){t.FLAG_INSERT=1<<30,t.FLAG_REMOVE=1<<29,t.MOUNT_BATCH_SIZE=1e3,t.UPDATE_BATCH_SIZE=1e3,t.MIN_PRIORITY=2,t.SORT_DELAYING_BATCHES=["add","to-front","to-back"],t.UPDATE_DELAYING_BATCHES=["translate"]}(HP||(HP={}));var UP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class WP extends wP{get elem(){return this.view.background}init(){this.startListening(),this.options.background&&this.draw(this.options.background)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}updateBackgroundImage(t={}){let e=t.size||"auto auto",n=t.position||"center";const i=this.graph.transform.getScale(),r=this.graph.translate();if("object"===typeof n){const t=r.tx+i.sx*(n.x||0),e=r.ty+i.sy*(n.y||0);n=`${t}px ${e}px`}"object"===typeof e&&(e=KC.fromSize(e).scale(i.sx,i.sy),e=`${e.width}px ${e.height}px`),this.elem.style.backgroundSize=e,this.elem.style.backgroundPosition=n}drawBackgroundImage(t,e={}){if(!(t instanceof HTMLImageElement))return void(this.elem.style.backgroundImage="");const n=this.optionsCache;if(n&&n.image!==e.image)return;let i;const s=e.opacity,o=e.size;let a=e.repeat||"no-repeat";const l=HM.registry.get(a);if("function"===typeof l){const n=e.quality||1;t.width*=n,t.height*=n;const r=l(t,e);if(!(r instanceof HTMLCanvasElement))throw new Error("Background pattern must return an HTML Canvas instance");i=r.toDataURL("image/png"),a=e.repeat&&a!==e.repeat?e.repeat:"repeat","object"===typeof o?(o.width*=r.width/t.width,o.height*=r.height/t.height):void 0===o&&(e.size={width:r.width/n,height:r.height/n})}else i=t.src,void 0===o&&(e.size={width:t.width,height:t.height});null!=n&&"object"===typeof e.size&&e.image===n.image&&e.repeat===n.repeat&&e.quality===n.quality&&(n.size=r.clone(e.size));const h=this.elem.style;h.backgroundImage=`url(${i})`,h.backgroundRepeat=a,h.opacity=null==s||s>=1?"":""+s,this.updateBackgroundImage(e)}updateBackgroundColor(t){this.elem.style.backgroundColor=t||""}updateBackgroundOptions(t){this.graph.options.background=t}update(){this.optionsCache&&this.updateBackgroundImage(this.optionsCache)}draw(t){const e=t||{};if(this.updateBackgroundOptions(t),this.updateBackgroundColor(e.color),e.image){this.optionsCache=r.clone(e);const n=document.createElement("img");n.onload=()=>this.drawBackgroundImage(n,t),n.setAttribute("crossorigin","anonymous"),n.src=e.image}else this.drawBackgroundImage(null),this.optionsCache=null}clear(){this.draw()}dispose(){this.clear(),this.stopListening()}}UP([wP.dispose()],WP.prototype,"dispose",null);var XP,qP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},YP=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class JP extends qE{constructor(t){super(),this.padding={left:0,top:0,right:0,bottom:0},this.options=XP.getOptions(t);const e=this.graph.transform.getScale();this.sx=e.sx,this.sy=e.sy;const n=this.options.width||this.graph.options.width,i=this.options.height||this.graph.options.height;this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(this.prefixClassName(XP.containerClass)).css({width:n,height:i}),this.options.pageVisible&&this.$container.addClass(this.prefixClassName(XP.pagedClass)),this.options.className&&this.$container.addClass(this.options.className);const r=this.graph.container;r.parentNode&&this.$container.insertBefore(r);const s=r.getAttribute("style");if(s){const t={},e=s.split(";");e.forEach(e=>{const n=e.trim();if(n){const e=n.split(":");e.length&&(t[e[0].trim()]=e[1]?e[1].trim():"")}}),Object.keys(t).forEach(e=>{"width"!==e&&"height"!==e&&(r.style[e]="",this.container.style[e]=t[e])})}this.content=document.createElement("div"),this.$content=this.$(this.content).addClass(this.prefixClassName(XP.contentClass)).css({width:this.graph.options.width,height:this.graph.options.height}),this.background=document.createElement("div"),this.$background=this.$(this.background).addClass(this.prefixClassName(XP.backgroundClass)),this.$content.append(this.background),this.options.pageVisible||this.$content.append(this.graph.view.grid),this.$content.append(r),this.$content.appendTo(this.container),this.startListening(),this.options.pageVisible||this.graph.grid.update(),this.backgroundManager=new JP.Background(this),this.options.autoResize||this.update()}get graph(){return this.options.graph}get model(){return this.graph.model}startListening(){const t=this.graph,e=this.model;t.on("scale",this.onScale,this),t.on("resize",this.onResize,this),t.on("before:print",this.storeScrollPosition,this),t.on("before:export",this.storeScrollPosition,this),t.on("after:print",this.restoreScrollPosition,this),t.on("after:export",this.restoreScrollPosition,this),t.on("render:done",this.onRenderDone,this),t.on("unfreeze",this.onUpdate,this),e.on("reseted",this.onUpdate,this),e.on("cell:added",this.onUpdate,this),e.on("cell:removed",this.onUpdate,this),e.on("cell:changed",this.onUpdate,this),e.on("batch:stop",this.onBatchStop,this),this.delegateBackgroundEvents()}stopListening(){const t=this.graph,e=this.model;t.off("scale",this.onScale,this),t.off("resize",this.onResize,this),t.off("beforeprint",this.storeScrollPosition,this),t.off("beforeexport",this.storeScrollPosition,this),t.off("afterprint",this.restoreScrollPosition,this),t.off("afterexport",this.restoreScrollPosition,this),t.off("render:done",this.onRenderDone,this),t.off("unfreeze",this.onUpdate,this),e.off("reseted",this.onUpdate,this),e.off("cell:added",this.onUpdate,this),e.off("cell:removed",this.onUpdate,this),e.off("cell:changed",this.onUpdate,this),e.off("batch:stop",this.onBatchStop,this),this.undelegateBackgroundEvents()}enableAutoResize(){this.options.autoResize=!0}disableAutoResize(){this.options.autoResize=!1}onUpdate(){!this.graph.isAsync()&&this.options.autoResize&&this.update()}onBatchStop(t){!this.graph.isAsync()&&this.options.autoResize&&HP.UPDATE_DELAYING_BATCHES.includes(t.name)&&this.update()}delegateBackgroundEvents(t){const e=t||EP.events;this.delegatedHandlers=Object.keys(e).reduce((t,n)=>{const i=e[n];if(-1===n.indexOf(" "))if("function"===typeof i)t[n]=i;else{let e=this.graph.view[i];"function"===typeof e&&(e=e.bind(this.graph.view),t[n]=e)}return t},{}),this.onBackgroundEvent=this.onBackgroundEvent.bind(this),Object.keys(this.delegatedHandlers).forEach(t=>{this.delegateEvent(t,{guarded:!1},this.onBackgroundEvent)})}undelegateBackgroundEvents(){Object.keys(this.delegatedHandlers).forEach(t=>{this.undelegateEvent(t,this.onBackgroundEvent)})}onBackgroundEvent(t){let e=!1;const n=t.target;if(this.options.pageVisible)e=this.options.background?this.background===n:this.content===n;else{const t=this.graph.view;e=t.background===n||t.grid===n}if(e){const e=this.delegatedHandlers[t.type];"function"===typeof e&&e.apply(this.graph,arguments)}}onRenderDone({stats:t}){this.options.autoResize&&t.priority<2&&this.update()}onResize(){this.cachedCenterPoint&&(this.centerPoint(this.cachedCenterPoint.x,this.cachedCenterPoint.y),this.updatePageBreak())}onScale({sx:t,sy:e,ox:n,oy:i}){this.updateScale(t,e),(n||i)&&(this.centerPoint(n,i),this.updatePageBreak());const r=this.options.autoResizeOptions||this.options.fitTocontentOptions;"function"===typeof r&&this.update()}storeScrollPosition(){this.cachedScrollLeft=this.container.scrollLeft,this.cachedScrollTop=this.container.scrollTop}restoreScrollPosition(){this.container.scrollLeft=this.cachedScrollLeft,this.container.scrollTop=this.cachedScrollTop,this.cachedScrollLeft=null,this.cachedScrollTop=null}storeClientSize(){this.cachedClientSize={width:this.container.clientWidth,height:this.container.clientHeight}}restoreClientSize(){this.cachedClientSize=null}beforeManipulation(){(U.IS_IE||U.IS_EDGE)&&this.$container.css("visibility","hidden")}afterManipulation(){(U.IS_IE||U.IS_EDGE)&&this.$container.css("visibility","visible")}updatePageSize(t,e){null!=t&&(this.options.pageWidth=t),null!=e&&(this.options.pageHeight=e),this.updatePageBreak()}updatePageBreak(){if(this.pageBreak&&this.pageBreak.parentNode&&this.pageBreak.parentNode.removeChild(this.pageBreak),this.pageBreak=null,this.options.pageVisible&&this.options.pageBreak){const t=this.graph.options.width,e=this.graph.options.height,n=this.options.pageWidth*this.sx,i=this.options.pageHeight*this.sy;if(0===n||0===i)return;if(t>n||e>i){let r=!1;const s=document.createElement("div");for(let e=1,i=Math.floor(t/n);e<i;e+=1)this.$("<div/>").addClass(this.prefixClassName("graph-pagebreak-vertical")).css({left:e*n}).appendTo(s),r=!0;for(let t=1,n=Math.floor(e/i);t<n;t+=1)this.$("<div/>").addClass(this.prefixClassName("graph-pagebreak-horizontal")).css({top:t*i}).appendTo(s),r=!0;r&&(h.addClass(s,this.prefixClassName("graph-pagebreak")),this.$(this.graph.view.grid).after(s),this.pageBreak=s)}}}update(){const t=this.getClientSize();this.cachedCenterPoint=this.clientToLocalPoint(t.width/2,t.height/2);let e=this.options.autoResizeOptions||this.options.fitTocontentOptions;"function"===typeof e&&(e=a.call(e,this,this));const n=Object.assign({gridWidth:this.options.pageWidth,gridHeight:this.options.pageHeight,allowNewOrigin:"negative",contentArea:this.calcContextArea(e)},e);this.graph.fitToContent(this.getFitToContentOptions(n))}calcContextArea(t){const e=null===t||void 0===t?void 0:t.direction;if(!e)return this.graph.transform.getContentArea(t);function n(t){let e=t.getBBox();if(e&&t.isNode()){const n=t.getAngle();null!=n&&0!==n&&(e=e.bbox(n))}return e}const i=this.options.pageWidth||1,r=this.options.pageHeight||1;let s=this.graph.getCells();return e.includes("top")||(s=s.filter(t=>{const e=n(t);return e.y>=0})),e.includes("left")||(s=s.filter(t=>{const e=n(t);return e.x>=0})),e.includes("right")||(s=s.filter(t=>{const e=n(t);return e.x+e.width<=i})),e.includes("bottom")||(s=s.filter(t=>{const e=n(t);return e.y+e.height<=r})),this.model.getCellsBBox(s)||new KC}getFitToContentOptions(t){const e=this.sx,n=this.sy;return t.gridWidth&&(t.gridWidth*=e),t.gridHeight&&(t.gridHeight*=n),t.minWidth&&(t.minWidth*=e),t.minHeight&&(t.minHeight*=n),"object"===typeof t.padding?t.padding={left:(t.padding.left||0)*e,right:(t.padding.right||0)*e,top:(t.padding.top||0)*n,bottom:(t.padding.bottom||0)*n}:"number"===typeof t.padding&&(t.padding*=e),this.options.autoResize||(t.contentArea=KC.create()),t}updateScale(t,e){const n=this.graph.options,i=t/this.sx,r=e/this.sy;this.sx=t,this.sy=e,this.graph.translate(n.x*i,n.y*r),this.graph.resizeGraph(n.width*i,n.height*r)}scrollbarPosition(t,e,n){if(null==t&&null==e)return{left:this.container.scrollLeft,top:this.container.scrollTop};const i={};return"number"===typeof t&&(i.scrollLeft=t),"number"===typeof e&&(i.scrollTop=e),n&&n.animation?this.$container.animate(i,n.animation):this.$container.prop(i),this}scrollToPoint(t,e,n){const i=this.getClientSize(),r=this.graph.matrix(),s={};return"number"===typeof t&&(s.scrollLeft=t-i.width/2+r.e+(this.padding.left||0)),"number"===typeof e&&(s.scrollTop=e-i.height/2+r.f+(this.padding.top||0)),n&&n.animation?this.$container.animate(s,n.animation):this.$container.prop(s),this}scrollToContent(t){const e=this.sx,n=this.sy,i=this.graph.getContentArea().getCenter();return this.scrollToPoint(i.x*e,i.y*n,t)}scrollToCell(t,e){const n=this.sx,i=this.sy,r=t.getBBox().getCenter();return this.scrollToPoint(r.x*n,r.y*i,e)}center(t){return this.centerPoint(t)}centerPoint(t,e,n){const i=this.graph.matrix(),r=i.a,s=i.d,o=-i.e,a=-i.f,l=o+this.graph.options.width,h=a+this.graph.options.height;let c;if(this.storeClientSize(),"number"===typeof t||"number"===typeof e){c=n;const i=this.getVisibleArea().getCenter();"number"===typeof t?t*=r:t=i.x,"number"===typeof e?e*=s:e=i.y}else c=t,t=(o+l)/2,e=(a+h)/2;if(c&&c.padding)return this.positionPoint({x:t,y:e},"50%","50%",c);const u=this.getPadding(),d=this.getClientSize(),g=d.width/2,p=d.height/2,f=g-u.left-t+o,m=g-u.right+t-l,b=p-u.top-e+a,y=p-u.bottom+e-h;this.addPadding(Math.max(f,0),Math.max(m,0),Math.max(b,0),Math.max(y,0));const C=this.scrollToPoint(t,e,c||void 0);return this.restoreClientSize(),C}centerContent(t){return this.positionContent("center",t)}centerCell(t,e){return this.positionCell(t,"center",e)}positionContent(t,e){const n=this.graph.getContentArea(e);return this.positionRect(n,t,e)}positionCell(t,e,n){const i=t.getBBox();return this.positionRect(i,e,n)}positionRect(t,e,n){const i=KC.create(t);switch(e){case"center":return this.positionPoint(i.getCenter(),"50%","50%",n);case"top":return this.positionPoint(i.getTopCenter(),"50%",0,n);case"top-right":return this.positionPoint(i.getTopRight(),"100%",0,n);case"right":return this.positionPoint(i.getRightMiddle(),"100%","50%",n);case"bottom-right":return this.positionPoint(i.getBottomRight(),"100%","100%",n);case"bottom":return this.positionPoint(i.getBottomCenter(),"50%","100%",n);case"bottom-left":return this.positionPoint(i.getBottomLeft(),0,"100%",n);case"left":return this.positionPoint(i.getLeftMiddle(),0,"50%",n);case"top-left":return this.positionPoint(i.getTopLeft(),0,0,n);default:return this}}positionPoint(t,e,n,i={}){const{padding:r}=i,s=YP(i,["padding"]),a=o.normalizeSides(r),l=KC.fromSize(this.getClientSize()),h=l.clone().moveAndExpand({x:a.left,y:a.top,width:-a.right-a.left,height:-a.top-a.bottom});e=o.normalizePercentage(e,Math.max(0,h.width)),e<0&&(e=h.width+e),n=o.normalizePercentage(n,Math.max(0,h.height)),n<0&&(n=h.height+n);const c=h.getTopLeft().translate(e,n),u=l.getCenter().diff(c),d=this.zoom(),g=u.scale(1/d,1/d),p=ZC.create(t).translate(g);return this.centerPoint(p.x,p.y,s)}zoom(t,e){if(null==t)return this.sx;let n,i;e=e||{};const r=this.getClientSize(),s=this.clientToLocalPoint(r.width/2,r.height/2);let o=t,a=t;if(e.absolute||(o+=this.sx,a+=this.sy),e.scaleGrid&&(o=Math.round(o/e.scaleGrid)*e.scaleGrid,a=Math.round(a/e.scaleGrid)*e.scaleGrid),e.maxScale&&(o=Math.min(e.maxScale,o),a=Math.min(e.maxScale,a)),e.minScale&&(o=Math.max(e.minScale,o),a=Math.max(e.minScale,a)),o=this.graph.transform.clampScale(o),a=this.graph.transform.clampScale(a),e.center){const t=o/this.sx,r=a/this.sy;n=e.center.x-(e.center.x-s.x)/t,i=e.center.y-(e.center.y-s.y)/r}else n=s.x,i=s.y;return this.beforeManipulation(),this.graph.transform.scale(o,a),this.centerPoint(n,i),this.afterManipulation(),this}zoomToRect(t,e={}){const n=KC.create(t),i=this.graph;e.contentArea=n,null==e.viewportArea&&(e.viewportArea={x:i.options.x,y:i.options.y,width:this.$container.width(),height:this.$container.height()}),this.beforeManipulation(),i.transform.scaleContentToFitImpl(e,!1);const r=n.getCenter();return this.centerPoint(r.x,r.y),this.afterManipulation(),this}zoomToFit(t={}){return this.zoomToRect(this.graph.getContentArea(t),t)}transitionToPoint(t,e,n){let i,r;"object"===typeof t?(n=e,e=t.y,t=t.x):e=e,null==n&&(n={});const s=this.sx,o=Math.max(n.scale||s,1e-6),l=this.getClientSize(),h=new ZC(t,e),c=this.clientToLocalPoint(l.width/2,l.height/2);if(s===o){const t=c.diff(h).scale(s,s).round();i=`translate(${t.x}px,${t.y}px)`}else{const t=o/(s-o)*h.distance(c),e=c.clone().move(h,t),n=this.localToBackgroundPoint(e).round();i=`scale(${o/s})`,r=`${n.x}px ${n.y}px`}const u=n.onTransitionEnd;return this.$container.addClass(XP.transitionClassName),this.$content.off(XP.transitionEventName).on(XP.transitionEventName,n=>{this.syncTransition(o,{x:t,y:e}),"function"===typeof u&&a.call(u,this,n.originalEvent)}).css({transform:i,transformOrigin:r,transition:"transform",transitionDuration:n.duration||"1s",transitionDelay:n.delay,transitionTimingFunction:n.timing}),this}syncTransition(t,e){return this.beforeManipulation(),this.graph.scale(t),this.removeTransition(),this.centerPoint(e.x,e.y),this.afterManipulation(),this}removeTransition(){return this.$container.removeClass(XP.transitionClassName),this.$content.off(XP.transitionEventName).css({transform:"",transformOrigin:"",transition:"",transitionDuration:"",transitionDelay:"",transitionTimingFunction:""}),this}transitionToRect(t,e={}){const n=KC.create(t),i=e.maxScale||1/0,r=e.minScale||Number.MIN_VALUE,s=e.scaleGrid||null,o=e.visibility||1,a=e.center?ZC.create(e.center):n.getCenter(),l=this.getClientSize(),h=l.width*o,c=l.height*o;let u=new KC(a.x-h/2,a.y-c/2,h,c).getMaxUniformScaleToFit(n,a);return u=Math.min(u,i),s&&(u=Math.floor(u/s)*s),u=Math.max(r,u),this.transitionToPoint(a,Object.assign({scale:u},e))}startPanning(t){const e=this.normalizeEvent(t);this.clientX=e.clientX,this.clientY=e.clientY,this.trigger("pan:start",{e:e}),this.$(document.body).on({"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),this.$(window).on("mouseup.panning",this.stopPanning.bind(this))}pan(t){const e=this.normalizeEvent(t),n=e.clientX-this.clientX,i=e.clientY-this.clientY;this.container.scrollTop-=i,this.container.scrollLeft-=n,this.clientX=e.clientX,this.clientY=e.clientY,this.trigger("panning",{e:e})}stopPanning(t){this.$(document.body).off(".panning"),this.$(window).off(".panning"),this.trigger("pan:stop",{e:t})}clientToLocalPoint(t,e){let n="object"===typeof t?t.x:t,i="object"===typeof t?t.y:e;const r=this.graph.matrix();return n+=this.container.scrollLeft-this.padding.left-r.e,i+=this.container.scrollTop-this.padding.top-r.f,new ZC(n/r.a,i/r.d)}localToBackgroundPoint(t,e){const n="object"===typeof t?ZC.create(t):new ZC(t,e),i=this.graph.matrix(),r=this.padding;return h.transformPoint(n,i).translate(r.left,r.top)}resize(t,e){let n=null!=t?t:this.container.offsetWidth,i=null!=e?e:this.container.offsetHeight;"number"===typeof n&&(n=Math.round(n)),"number"===typeof i&&(i=Math.round(i)),this.options.width=n,this.options.height=i,this.$container.css({width:n,height:i}),this.update()}getClientSize(){return this.cachedClientSize?this.cachedClientSize:{width:this.container.clientWidth,height:this.container.clientHeight}}autoScroll(t,e){const n=10,i=this.container,r=i.getBoundingClientRect();let s=0,o=0;return t<=r.left+n&&(s=-n),e<=r.top+n&&(o=-n),t>=r.right-n&&(s=n),e>=r.bottom-n&&(o=n),0!==s&&(i.scrollLeft+=s),0!==o&&(i.scrollTop+=o),{scrollerX:s,scrollerY:o}}addPadding(t,e,n,i){let r=this.getPadding();this.padding={left:Math.round(r.left+(t||0)),top:Math.round(r.top+(n||0)),bottom:Math.round(r.bottom+(i||0)),right:Math.round(r.right+(e||0))},r=this.padding,this.$content.css({width:r.left+this.graph.options.width+r.right,height:r.top+this.graph.options.height+r.bottom});const s=this.graph.container;return s.style.left=this.padding.left+"px",s.style.top=this.padding.top+"px",this}getPadding(){const t=this.options.padding;return"function"===typeof t?o.normalizeSides(a.call(t,this,this)):o.normalizeSides(t)}getVisibleArea(){const t=this.graph.matrix(),e=this.getClientSize(),n={x:this.container.scrollLeft||0,y:this.container.scrollTop||0,width:e.width,height:e.height},i=h.transformRectangle(n,t.inverse());return i.x-=(this.padding.left||0)/this.sx,i.y-=(this.padding.top||0)/this.sy,i}isCellVisible(t,e={}){const n=t.getBBox(),i=this.getVisibleArea();return e.strict?i.containsRect(n):i.isIntersectWithRect(n)}isPointVisible(t){return this.getVisibleArea().containsPoint(t)}lock(){return this.$container.css("overflow","hidden"),this}unlock(){return this.$container.css("overflow","scroll"),this}onRemove(){this.stopListening()}dispose(){this.$(this.graph.container).insertBefore(this.$container),this.remove()}}function ZP(t,e,n,i={}){if(n){const r=n.graph,s=r.view.normalizeEvent(e),o=r.snapToGrid(s.clientX,s.clientY);n.notify(t,Object.assign({e:s,view:n,node:n.cell,cell:n.cell,x:o.x,y:o.y},i))}}qP([qE.dispose()],JP.prototype,"dispose",null),function(t){class e extends WP{constructor(t){super(t.graph),this.scroller=t,t.options.background&&this.draw(t.options.background)}get elem(){return this.scroller.background}init(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}updateBackgroundOptions(t){this.scroller.options.background=t}}t.Background=e}(JP||(JP={})),function(t){function e(e){const n=r.merge({},t.defaultOptions,e);return null==n.pageWidth&&(n.pageWidth=e.graph.options.width),null==n.pageHeight&&(n.pageHeight=e.graph.options.height),n}t.containerClass="graph-scroller",t.panningClass=t.containerClass+"-panning",t.pannableClass=t.containerClass+"-pannable",t.pagedClass=t.containerClass+"-paged",t.contentClass=t.containerClass+"-content",t.backgroundClass=t.containerClass+"-background",t.transitionClassName="transition-in-progress",t.transitionEventName="transitionend.graph-scroller-transition",t.defaultOptions={padding(){const t=this.getClientSize(),e=Math.max(this.options.minVisibleWidth||0,1)||1,n=Math.max(this.options.minVisibleHeight||0,1)||1,i=Math.max(t.width-e,0),r=Math.max(t.height-n,0);return{left:i,top:r,right:i,bottom:r}},minVisibleWidth:50,minVisibleHeight:50,pageVisible:!1,pageBreak:!1,autoResize:!0},t.getOptions=e}(XP||(XP={}));var KP,QP,tk=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class ek extends qE{constructor(t){super(),this.options=r.merge({},KP.defaultOptions,t),this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new _O([],{comparator:KP.depthComparator}),this.options.collection=this.collection),this.boxCount=0,this.createContainer(),this.initHandles(),this.startListening()}get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(KP.classNames.box)}get $boxes(){return this.$container.children("."+this.boxClassName)}get handleOptions(){return this.options}startListening(){const t=this.graph,e=this.collection;this.delegateEvents({["mousedown ."+this.boxClassName]:"onSelectionBoxMouseDown",["touchstart ."+this.boxClassName]:"onSelectionBoxMouseDown"},!0),t.on("scale",this.onGraphTransformed,this),t.on("translate",this.onGraphTransformed,this),t.model.on("updated",this.onModelUpdated,this),e.on("added",this.onCellAdded,this),e.on("removed",this.onCellRemoved,this),e.on("reseted",this.onReseted,this),e.on("updated",this.onCollectionUpdated,this),e.on("node:change:position",this.onNodePositionChanged,this),e.on("cell:changed",this.onCellChanged,this)}stopListening(){const t=this.graph,e=this.collection;this.undelegateEvents(),t.off("scale",this.onGraphTransformed,this),t.off("translate",this.onGraphTransformed,this),t.model.off("updated",this.onModelUpdated,this),e.off("added",this.onCellAdded,this),e.off("removed",this.onCellRemoved,this),e.off("reseted",this.onReseted,this),e.off("updated",this.onCollectionUpdated,this),e.off("node:change:position",this.onNodePositionChanged,this),e.off("cell:changed",this.onCellChanged,this)}onRemove(){this.stopListening()}onGraphTransformed(){this.updateSelectionBoxes({async:!1})}onCellChanged(){this.updateSelectionBoxes()}onNodePositionChanged({node:t,options:e}){const{showNodeSelectionBox:n,pointerEvents:i}=this.options,{ui:r,selection:s,translateBy:o,snapped:a}=e,l=(!0!==n||"none"===i)&&!this.translating&&!s,h=r&&o&&t.id===o;if(l&&(h||a)){this.translating=!0;const n=t.position(),i=t.previous("position"),r=n.x-i.x,s=n.y-i.y;0===r&&0===s||this.translateSelectedNodes(r,s,t,e),this.translating=!1}}onModelUpdated({removed:t}){t&&t.length&&this.unselect(t)}isEmpty(){return this.length<=0}isSelected(t){return this.collection.has(t)}get length(){return this.collection.length}get cells(){return this.collection.toArray()}select(t,e={}){e.dryrun=!0;const n=this.filter(Array.isArray(t)?t:[t]);return this.collection.add(n,e),this}unselect(t,e={}){return e.dryrun=!0,this.collection.remove(Array.isArray(t)?t:[t],e),this}reset(t,e={}){if(t){if(e.batch){const n=this.filter(Array.isArray(t)?t:[t]);return this.collection.reset(n,Object.assign(Object.assign({},e),{ui:!0})),this}const n=this.cells,i=this.filter(Array.isArray(t)?t:[t]),r={},s={};n.forEach(t=>r[t.id]=t),i.forEach(t=>s[t.id]=t);const o=[],a=[];return i.forEach(t=>{r[t.id]||o.push(t)}),n.forEach(t=>{s[t.id]||a.push(t)}),a.length&&this.unselect(a,Object.assign(Object.assign({},e),{ui:!0})),o.length&&this.select(o,Object.assign(Object.assign({},e),{ui:!0})),0===a.length&&0===o.length&&this.updateContainer(),this}return this.clean(e)}clean(t={}){return this.length&&(!1===t.batch?this.unselect(this.cells,t):this.collection.reset([],Object.assign(Object.assign({},t),{ui:!0}))),this}setFilter(t){this.options.filter=t}setContent(t){this.options.content=t}startSelecting(t){let e,n;t=this.normalizeEvent(t),this.clean();const i=this.graph.container;if(null!=t.offsetX&&null!=t.offsetY&&i.contains(t.target))e=t.offsetX,n=t.offsetY;else{const r=this.$(i).offset(),s=i.scrollLeft,o=i.scrollTop;e=t.clientX-r.left+window.pageXOffset+s,n=t.clientY-r.top+window.pageYOffset+o}this.$container.css({top:n,left:e,width:1,height:1}),this.setEventData(t,{action:"selecting",clientX:t.clientX,clientY:t.clientY,offsetX:e,offsetY:n,scrollerX:0,scrollerY:0,moving:!1}),this.delegateDocumentEvents(KP.documentEvents,t.data)}filter(t){const e=this.options.filter;return Array.isArray(e)?t.filter(t=>!e.includes(t)&&!e.includes(t.shape)):"function"===typeof e?t.filter(t=>a.call(e,this.graph,t)):t}stopSelecting(t){const e=this.graph,n=this.getEventData(t),i=n.action;switch(i){case"selecting":{let t=this.$container.width(),n=this.$container.height();const i=this.$container.offset(),r=e.pageToLocal(i.left,i.top),s=e.transform.getScale();t/=s.sx,n/=s.sy;const o=new KC(r.x,r.y,t,n),a=this.getCellViewsInArea(o).map(t=>t.cell);this.reset(a,{batch:!0}),this.hideRubberband();break}case"translating":{const i=e.snapToGrid(t.clientX,t.clientY);if(!this.options.following){const t=n;this.updateSelectedNodesPosition({dx:t.clientX-t.originX,dy:t.clientY-t.originY})}this.graph.model.stopBatch("move-selection"),this.notifyBoxEvent("box:mouseup",t,i.x,i.y);break}default:this.clean();break}}onMouseUp(t){const e=this.getEventData(t).action;e&&(this.stopSelecting(t),this.undelegateDocumentEvents())}onSelectionBoxMouseDown(t){this.options.following||t.stopPropagation();const e=this.normalizeEvent(t);this.options.movable&&this.startTranslating(e);const n=this.getCellViewFromElem(e.target);this.setEventData(e,{activeView:n});const i=this.graph.snapToGrid(e.clientX,e.clientY);this.notifyBoxEvent("box:mousedown",e,i.x,i.y),this.delegateDocumentEvents(KP.documentEvents,e.data)}startTranslating(t){this.graph.model.startBatch("move-selection");const e=this.graph.snapToGrid(t.clientX,t.clientY);this.setEventData(t,{action:"translating",clientX:e.x,clientY:e.y,originX:e.x,originY:e.y})}getSelectionOffset(t,e){let n=t.x-e.clientX,i=t.y-e.clientY;const r=this.graph.hook.getRestrictArea();if(r){const s=this.collection.toArray(),o=MO.getCellsBBox(s,{deep:!0})||KC.create(),a=r.x-o.x,l=r.y-o.y,h=r.x+r.width-(o.x+o.width),c=r.y+r.height-(o.y+o.height);if(n<a&&(n=a),i<l&&(i=l),h<n&&(n=h),c<i&&(i=c),!this.options.following){const r=t.x-e.originX,s=t.y-e.originY;n=r<=a||r>=h?0:n,i=s<=l||s>=c?0:i}}return{dx:n,dy:i}}updateSelectedNodesPosition(t){const{dx:e,dy:n}=t;if(e||n)if(this.translateSelectedNodes(e,n),this.boxesUpdated)this.collection.length>1&&this.updateSelectionBoxes();else{const t=this.graph.transform.getScale();this.$boxes.add(this.$selectionContainer).css({left:"+="+e*t.sx,top:"+="+n*t.sy})}}autoScrollGraph(t,e){const n=this.graph.scroller.widget;return n?n.autoScroll(t,e):{scrollerX:0,scrollerY:0}}adjustSelection(t){const e=this.normalizeEvent(t),n=this.getEventData(e),i=n.action;switch(i){case"selecting":{const t=n;!0!==t.moving&&(this.$container.appendTo(this.graph.container),this.showRubberband(),t.moving=!0);const{scrollerX:i,scrollerY:r}=this.autoScrollGraph(e.clientX,e.clientY);t.scrollerX+=i,t.scrollerY+=r;const s=e.clientX-t.clientX+t.scrollerX,o=e.clientY-t.clientY+t.scrollerY,a=parseInt(this.$container.css("left"),10),l=parseInt(this.$container.css("top"),10);this.$container.css({left:s<0?t.offsetX+s:a,top:o<0?t.offsetY+o:l,width:Math.abs(s),height:Math.abs(o)});break}case"translating":{const i=this.graph.snapToGrid(e.clientX,e.clientY),r=n,s=this.getSelectionOffset(i,r);this.options.following?this.updateSelectedNodesPosition(s):this.updateContainerPosition(s),s.dx&&(r.clientX=i.x),s.dy&&(r.clientY=i.y),this.notifyBoxEvent("box:mousemove",t,i.x,i.y);break}default:break}this.boxesUpdated=!1}translateSelectedNodes(t,e,n,i){const r={},s=[];if(n&&(r[n.id]=!0),this.collection.toArray().forEach(t=>{t.getDescendants({deep:!0}).forEach(t=>{r[t.id]=!0})}),i&&i.translateBy){const t=this.graph.getCellById(i.translateBy);t&&(r[t.id]=!0,t.getDescendants({deep:!0}).forEach(t=>{r[t.id]=!0}),s.push(t))}this.collection.toArray().forEach(n=>{if(!r[n.id]){const o=Object.assign(Object.assign({},i),{selection:this.cid,exclude:s});n.translate(t,e,o),this.graph.model.getConnectedEdges(n).forEach(n=>{r[n.id]||(n.translate(t,e,o),r[n.id]=!0)})}})}getCellViewsInArea(t){const e=this.graph,n={strict:this.options.strict};let i=[];return this.options.rubberNode&&(i=this.options.useCellGeometry?i.concat(e.model.getNodesInArea(t,n).map(t=>e.renderer.findViewByCell(t)).filter(t=>null!=t)):i.concat(e.renderer.findViewsInArea(t,n))),this.options.rubberEdge&&(i=this.options.useCellGeometry?i.concat(e.model.getEdgesInArea(t,n).map(t=>e.renderer.findViewByCell(t)).filter(t=>null!=t)):i.concat(e.renderer.findEdgeViewsInArea(t,n))),i}notifyBoxEvent(t,e,n,i){const r=this.getEventData(e),s=r.activeView;this.trigger(t,{e:e,view:s,x:n,y:i,cell:s.cell})}getSelectedClassName(t){return this.prefixClassName((t.isNode()?"node":"edge")+"-selected")}addCellSelectedClassName(t){const e=this.graph.renderer.findViewByCell(t);e&&e.addClass(this.getSelectedClassName(t))}removeCellUnSelectedClassName(t){const e=this.graph.renderer.findViewByCell(t);e&&e.removeClass(this.getSelectedClassName(t))}destroySelectionBox(t){this.removeCellUnSelectedClassName(t),this.canShowSelectionBox(t)&&(this.$container.find(`[data-cell-id="${t.id}"]`).remove(),0===this.$boxes.length&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))}destroyAllSelectionBoxes(t){t.forEach(t=>this.removeCellUnSelectedClassName(t)),this.hide(),this.$boxes.remove(),this.boxCount=0}hide(){this.$container.removeClass(this.prefixClassName(KP.classNames.rubberband)).removeClass(this.prefixClassName(KP.classNames.selected))}showRubberband(){this.$container.addClass(this.prefixClassName(KP.classNames.rubberband))}hideRubberband(){this.$container.removeClass(this.prefixClassName(KP.classNames.rubberband))}showSelected(){this.$container.removeAttr("style").addClass(this.prefixClassName(KP.classNames.selected))}createContainer(){this.container=document.createElement("div"),this.$container=this.$(this.container),this.$container.addClass(this.prefixClassName(KP.classNames.root)),this.options.className&&this.$container.addClass(this.options.className),this.$selectionContainer=this.$("<div/>").addClass(this.prefixClassName(KP.classNames.inner)),this.$selectionContent=this.$("<div/>").addClass(this.prefixClassName(KP.classNames.content)),this.$selectionContainer.append(this.$selectionContent),this.$selectionContainer.attr("data-selection-length",this.collection.length),this.$container.prepend(this.$selectionContainer),this.$handleContainer=this.$selectionContainer}updateContainerPosition(t){(t.dx||t.dy)&&this.$selectionContainer.css({left:"+="+t.dx,top:"+="+t.dy})}updateContainer(){const t={x:1/0,y:1/0},e={x:0,y:0},n=this.collection.toArray().filter(t=>this.canShowSelectionBox(t));n.forEach(n=>{const i=this.graph.renderer.findViewByCell(n);if(i){const n=i.getBBox({useCellGeometry:this.options.useCellGeometry});t.x=Math.min(t.x,n.x),t.y=Math.min(t.y,n.y),e.x=Math.max(e.x,n.x+n.width),e.y=Math.max(e.y,n.y+n.height)}}),this.$selectionContainer.css({position:"absolute",pointerEvents:"none",left:t.x,top:t.y,width:e.x-t.x,height:e.y-t.y}).attr("data-selection-length",this.collection.length);const i=this.options.content;if(i)if("function"===typeof i){const t=a.call(i,this.graph,this,this.$selectionContent[0]);t&&this.$selectionContent.html(t)}else this.$selectionContent.html(i);this.collection.length>0&&!this.container.parentNode?this.$container.appendTo(this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}canShowSelectionBox(t){return t.isNode()&&!0===this.options.showNodeSelectionBox||t.isEdge()&&!0===this.options.showEdgeSelectionBox}createSelectionBox(t){if(this.addCellSelectedClassName(t),this.canShowSelectionBox(t)){const e=this.graph.renderer.findViewByCell(t);if(e){const n=e.getBBox({useCellGeometry:this.options.useCellGeometry}),i=this.boxClassName;this.$("<div/>").addClass(i).addClass(`${i}-${t.isNode()?"node":"edge"}`).attr("data-cell-id",t.id).css({position:"absolute",left:n.x,top:n.y,width:n.width,height:n.height,pointerEvents:this.options.pointerEvents||"auto"}).appendTo(this.container),this.showSelected(),this.boxCount+=1}}}updateSelectionBoxes(t={}){this.collection.length>0&&(this.boxesUpdated=!0,this.graph.renderer.requestViewUpdate(this,1,2,t))}confirmUpdate(){return this.boxCount&&(this.hide(),this.$boxes.each((t,e)=>{const n=this.$(e).remove().attr("data-cell-id"),i=this.collection.get(n);i&&this.createSelectionBox(i)}),this.updateContainer()),0}getCellViewFromElem(t){const e=t.getAttribute("data-cell-id");if(e){const t=this.collection.get(e);if(t)return this.graph.renderer.findViewByCell(t)}return null}onCellRemoved({cell:t}){this.destroySelectionBox(t),this.updateContainer()}onReseted({previous:t,current:e}){this.destroyAllSelectionBoxes(t),e.forEach(t=>{this.listenCellRemoveEvent(t),this.createSelectionBox(t)}),this.updateContainer()}onCellAdded({cell:t}){this.listenCellRemoveEvent(t),this.createSelectionBox(t),this.updateContainer()}listenCellRemoveEvent(t){t.off("removed",this.onCellRemoved,this),t.on("removed",this.onCellRemoved,this)}onCollectionUpdated({added:t,removed:e,options:n}){t.forEach(t=>{this.trigger("cell:selected",{cell:t,options:n}),this.graph.trigger("cell:selected",{cell:t,options:n}),t.isNode()?(this.trigger("node:selected",{cell:t,options:n,node:t}),this.graph.trigger("node:selected",{cell:t,options:n,node:t})):t.isEdge()&&(this.trigger("edge:selected",{cell:t,options:n,edge:t}),this.graph.trigger("edge:selected",{cell:t,options:n,edge:t}))}),e.forEach(t=>{this.trigger("cell:unselected",{cell:t,options:n}),this.graph.trigger("cell:unselected",{cell:t,options:n}),t.isNode()?(this.trigger("node:unselected",{cell:t,options:n,node:t}),this.graph.trigger("node:unselected",{cell:t,options:n,node:t})):t.isEdge()&&(this.trigger("edge:unselected",{cell:t,options:n,edge:t}),this.graph.trigger("edge:unselected",{cell:t,options:n,edge:t}))});const i={added:t,removed:e,options:n,selected:this.cells.filter(t=>!!this.graph.getCellById(t.id))};this.trigger("selection:changed",i),this.graph.trigger("selection:changed",i)}deleteSelectedCells(){const t=this.collection.toArray();this.clean(),this.graph.model.removeCells(t,{selection:this.cid})}startRotate({e:t}){const e=this.collection.toArray(),n=MO.getCellsBBox(e).getCenter(),i=this.graph.snapToGrid(t.clientX,t.clientY),r=e.reduce((t,e)=>(t[e.id]=_C.normalize(e.getAngle()),t),{});this.setEventData(t,{center:n,angles:r,start:i.theta(n)})}doRotate({e:t}){const e=this.getEventData(t),n=this.graph.options.rotating.grid,i="function"===typeof n?a.call(n,this.graph,null):n,r=this.graph.snapToGrid(t.clientX,t.clientY),s=e.start-r.theta(e.center);e.rotated||(e.rotated=!0),Math.abs(s)>.001&&(this.collection.toArray().forEach(t=>{const n=WM.snapToGrid(e.angles[t.id]+s,i||15);t.rotate(n,{absolute:!0,center:e.center,selection:this.cid})}),this.updateSelectionBoxes())}stopRotate({e:t}){const e=this.getEventData(t);e.rotated&&(e.rotated=!1,this.collection.toArray().forEach(e=>{ZP("node:rotated",t,this.graph.findViewByCell(e))}))}startResize({e:t}){const e=this.graph.getGridSize(),n=this.collection.toArray(),i=MO.getCellsBBox(n),r=n.map(t=>t.getBBox()),s=r.reduce((t,e)=>e.width<t?e.width:t,1/0),o=r.reduce((t,e)=>e.height<t?e.height:t,1/0);this.setEventData(t,{bbox:i,cells:this.graph.model.getSubGraph(n),minWidth:e*i.width/s,minHeight:e*i.height/o})}doResize({e:t,dx:e,dy:n}){const i=this.eventData(t),r=i.bbox,s=r.width,o=r.height,a=Math.max(s+e,i.minWidth),l=Math.max(o+n,i.minHeight);i.resized||(i.resized=!0),(Math.abs(s-a)>.001||Math.abs(o-l)>.001)&&(this.graph.model.resizeCells(a,l,i.cells,{selection:this.cid}),r.width=a,r.height=l,this.updateSelectionBoxes())}stopResize({e:t}){const e=this.eventData(t);e.resized&&(e.resized=!1,this.collection.toArray().forEach(e=>{ZP("node:resized",t,this.graph.findViewByCell(e))}))}dispose(){this.clean(),this.remove()}}tk([qE.dispose()],ek.prototype,"dispose",null),r.applyMixins(ek,DP),function(t){const e="widget-selection";function n(t){return t.getAncestors().length}t.classNames={root:e,inner:e+"-inner",box:e+"-box",content:e+"-content",rubberband:e+"-rubberband",selected:e+"-selected"},t.documentEvents={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},t.defaultOptions={movable:!0,following:!0,strict:!1,useCellGeometry:!1,content(t){return s.template('<%= length %> node<%= length > 1 ? "s":"" %> selected.')({length:t.length})},handles:[{name:"remove",position:"nw",events:{mousedown:"deleteSelectedCells"}},{name:"rotate",position:"sw",events:{mousedown:"startRotate",mousemove:"doRotate",mouseup:"stopRotate"}},{name:"resize",position:"se",events:{mousedown:"startResize",mousemove:"doResize",mouseup:"stopResize"}}]},t.depthComparator=n}(KP||(KP={}));class nk extends LP{get node(){return this.cell}get containerClassName(){return this.prefixClassName("widget-transform")}get resizeClassName(){return this.containerClassName+"-resize"}get rotateClassName(){return this.containerClassName+"-rotate"}init(t){this.options=Object.assign(Object.assign({},QP.defaultOptions),t),this.render(),this.startListening()}startListening(){this.delegateEvents({["mousedown ."+this.resizeClassName]:"startResizing",["touchstart ."+this.resizeClassName]:"startResizing",["mousedown ."+this.rotateClassName]:"startRotating",["touchstart ."+this.rotateClassName]:"startRotating"}),this.model.on("*",this.update,this),this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this),this.node.on("removed",this.remove,this),this.model.on("reseted",this.remove,this),this.view.on("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.on("cell:knob:mouseup",this.onKnobMouseUp,this),super.startListening()}stopListening(){this.undelegateEvents(),this.model.off("*",this.update,this),this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this),this.node.off("removed",this.remove,this),this.model.off("reseted",this.remove,this),this.view.off("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.off("cell:knob:mouseup",this.onKnobMouseUp,this),super.stopListening()}renderHandles(){this.container=document.createElement("div"),this.$container=this.$(this.container);const t=this.$("<div/>").prop("draggable",!1),e=t.clone().addClass(this.rotateClassName),n=QP.POSITIONS.map(e=>t.clone().addClass(this.resizeClassName).attr("data-position",e));this.empty(),this.$container.append(n,e)}render(){return this.renderHandles(),this.view.addClass(QP.NODE_CLS),this.$container.addClass(this.containerClassName).toggleClass("no-orth-resize",this.options.preserveAspectRatio||!this.options.orthogonalResizing).toggleClass("no-resize",!this.options.resizable).toggleClass("no-rotate",!this.options.rotatable),this.options.className&&this.$container.addClass(this.options.className),this.graph.container.appendChild(this.container),this.update()}update(){const t=this.graph.matrix(),e=this.node.getBBox();e.x*=t.a,e.x+=t.e,e.y*=t.d,e.y+=t.f,e.width*=t.a,e.height*=t.d;const n=_C.normalize(this.node.getAngle()),i=0!==n?`rotate(${n}deg)`:"";return this.$container.css({transform:i,width:e.width,height:e.height,left:e.x,top:e.y}),this.updateResizerDirections(),this}remove(){return this.view.removeClass(QP.NODE_CLS),super.remove()}onKnobMouseDown(){this.startHandle()}onKnobMouseUp(){this.stopHandle()}updateResizerDirections(){const t=_C.normalize(this.node.getAngle()),e=Math.floor(t*(QP.DIRECTIONS.length/360));if(e!==this.prevShift){const t=QP.DIRECTIONS.slice(e).concat(QP.DIRECTIONS.slice(0,e)),n=t=>`${this.containerClassName}-cursor-${t}`;this.$container.find("."+this.resizeClassName).removeClass(QP.DIRECTIONS.map(t=>n(t)).join(" ")).each((e,i)=>{this.$(i).addClass(n(t[e]))}),this.prevShift=e}}getTrueDirection(t){const e=_C.normalize(this.node.getAngle());let n=QP.POSITIONS.indexOf(t);return n+=Math.floor(e*(QP.POSITIONS.length/360)),n%=QP.POSITIONS.length,QP.POSITIONS[n]}toValidResizeDirection(t){return{top:"top-left",bottom:"bottom-right",left:"bottom-left",right:"top-right"}[t]||t}startResizing(t){t.stopPropagation(),this.model.startBatch("resize",{cid:this.cid});const e=this.$(t.target).attr("data-position"),n=this.graph.findViewByCell(this.node);this.prepareResizing(t,e),this.startAction(t),ZP("node:resize:mousedown",t,n)}prepareResizing(t,e){const n=this.getTrueDirection(e);let i=0,r=0;e.split("-").forEach(t=>{i={left:-1,right:1}[t]||i,r={top:-1,bottom:1}[t]||r});const s=this.toValidResizeDirection(e),o={"top-right":"bottomLeft","top-left":"bottomRight","bottom-left":"topRight","bottom-right":"topLeft"}[s],a=_C.normalize(this.node.getAngle());this.setEventData(t,{selector:o,direction:s,trueDirection:n,relativeDirection:e,angle:a,resizeX:i,resizeY:r,action:"resizing"})}startRotating(t){t.stopPropagation(),this.model.startBatch("rotate",{cid:this.cid});const e=this.graph.findViewByCell(this.node),n=this.node.getBBox().getCenter(),i=this.normalizeEvent(t),r=this.graph.snapToGrid(i.clientX,i.clientY);this.setEventData(t,{center:n,action:"rotating",angle:_C.normalize(this.node.getAngle()),start:ZC.create(r).theta(n)}),this.startAction(t),ZP("node:rotate:mousedown",t,e)}onMouseMove(t){const e=this.graph.findViewByCell(this.node);let n=this.getEventData(t);if(n.action){const i=this.normalizeEvent(t);let r=i.clientX,s=i.clientY;const a=this.graph.scroller.widget,l=this.options.restrictedResizing;if(!0===l||"number"===typeof l){const t=!0===l?0:l,e=a?Math.max(t,8):t,n=this.graph.container.getBoundingClientRect();r=o.clamp(r,n.left+e,n.right-e),s=o.clamp(s,n.top+e,n.bottom-e)}else this.options.autoScrollOnResizing&&a&&a.autoScroll(r,s);const h=this.graph.snapToGrid(r,s),c=this.graph.getGridSize(),u=this.node,d=this.options;if("resizing"===n.action){n=n,n.resized||(e&&(e.addClass("node-resizing"),ZP("node:resize",t,e)),n.resized=!0);const i=u.getBBox(),r=ZC.create(h).rotate(n.angle,i.getCenter()).diff(i[n.selector]);let s=n.resizeX?r.x*n.resizeX:i.width,o=n.resizeY?r.y*n.resizeY:i.height;const a=s,l=o;if(s=WM.snapToGrid(s,c),o=WM.snapToGrid(o,c),s=Math.max(s,d.minWidth||c),o=Math.max(o,d.minHeight||c),s=Math.min(s,d.maxWidth||1/0),o=Math.min(o,d.maxHeight||1/0),d.preserveAspectRatio){const t=i.width*o/i.height,e=i.height*s/i.width;s<t?o=e:s=t}const g=n.relativeDirection;if(d.allowReverse&&(a<=-s||l<=-o)){let e;"left"===g?a<=-s&&(e="right"):"right"===g?a<=-s&&(e="left"):"top"===g?l<=-o&&(e="bottom"):"bottom"===g?l<=-o&&(e="top"):"top-left"===g?a<=-s&&l<=-o?e="bottom-right":a<=-s?e="top-right":l<=-o&&(e="bottom-left"):"top-right"===g?a<=-s&&l<=-o?e="bottom-left":a<=-s?e="top-left":l<=-o&&(e="bottom-right"):"bottom-left"===g?a<=-s&&l<=-o?e="top-right":a<=-s?e="bottom-right":l<=-o&&(e="top-left"):"bottom-right"===g&&(a<=-s&&l<=-o?e="top-left":a<=-s?e="bottom-left":l<=-o&&(e="top-right"));const n=e;this.stopHandle();const i=this.$container.find(`.${this.resizeClassName}[data-position="${n}"]`);this.startHandle(i[0]),this.prepareResizing(t,n),this.onMouseMove(t)}if(i.width!==s||i.height!==o){const i={ui:!0,direction:n.direction,relativeDirection:n.relativeDirection,trueDirection:n.trueDirection,minWidth:d.minWidth,minHeight:d.minHeight,maxWidth:d.maxWidth,maxHeight:d.maxHeight,preserveAspectRatio:!0===d.preserveAspectRatio};u.resize(s,o,i),ZP("node:resizing",t,e)}ZP("node:resize:mousemove",t,e)}else if("rotating"===n.action){n=n,n.rotated||(e&&(e.addClass("node-rotating"),ZP("node:rotate",t,e)),n.rotated=!0);const i=u.getAngle(),r=n.start-ZC.create(h).theta(n.center);let s=n.angle+r;d.rotateGrid&&(s=WM.snapToGrid(s,d.rotateGrid)),s=_C.normalize(s),i!==s&&(u.rotate(s,{absolute:!0}),ZP("node:rotating",t,e)),ZP("node:rotate:mousemove",t,e)}}}onMouseUp(t){const e=this.graph.findViewByCell(this.node),n=this.getEventData(t);n.action&&(this.stopAction(t),this.model.stopBatch("resizing"===n.action?"resize":"rotate",{cid:this.cid}),"resizing"===n.action?ZP("node:resize:mouseup",t,e):"rotating"===n.action&&ZP("node:rotate:mouseup",t,e))}startHandle(t){if(this.handle=t||null,this.$container.addClass(this.containerClassName+"-active"),t){this.$(t).addClass(this.containerClassName+"-active-handle");const e=t.getAttribute("data-position");if(e){const t=QP.DIRECTIONS[QP.POSITIONS.indexOf(e)];this.$container.addClass(`${this.containerClassName}-cursor-${t}`)}}}stopHandle(){if(this.$container.removeClass(this.containerClassName+"-active"),this.handle){this.$(this.handle).removeClass(this.containerClassName+"-active-handle");const t=this.handle.getAttribute("data-position");if(t){const e=QP.DIRECTIONS[QP.POSITIONS.indexOf(t)];this.$container.removeClass(`${this.containerClassName}-cursor-${e}`)}this.handle=null}}startAction(t){this.startHandle(t.target),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(QP.documentEvents,t.data)}stopAction(t){this.stopHandle(),this.undelegateDocumentEvents(),this.graph.view.delegateEvents();const e=this.graph.findViewByCell(this.node),n=this.getEventData(t);e&&(e.removeClass("node-"+n.action),"resizing"===n.action&&n.resized?ZP("node:resized",t,e):"rotating"===n.action&&n.rotated&&ZP("node:rotated",t,e))}onRemove(){this.stopListening(),super.onRemove()}}(function(t){t.NODE_CLS="has-widget-transform",t.DIRECTIONS=["nw","n","ne","e","se","s","sw","w"],t.POSITIONS=["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"],t.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp"},t.defaultOptions={minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,rotateGrid:15,rotatable:!0,preserveAspectRatio:!1,orthogonalResizing:!0,restrictedResizing:!1,autoScrollOnResizing:!0,allowReverse:!0}})(QP||(QP={}));var ik,rk=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};(function(t){function e(t,e,n){const i={};return Object.keys(n||{}).forEach(r=>{const s=n[r];i[r]="function"===typeof s?s.call(t,e):s}),i}t.parseOptionGroup=e})(ik||(ik={})),function(t){function e(e){const{grid:n,panning:i,selecting:s,embedding:o,snapline:a,resizing:l,rotating:h,knob:c,clipboard:u,history:d,scroller:g,minimap:p,keyboard:f,mousewheel:m}=e,b=rk(e,["grid","panning","selecting","embedding","snapline","resizing","rotating","knob","clipboard","history","scroller","minimap","keyboard","mousewheel"]),y=e.container;if(null==y)throw new Error("Ensure the container of the graph is specified and valid");null==b.width&&(b.width=y.clientWidth),null==b.height&&(b.height=y.clientHeight);const C=r.merge({},t.defaults,b),v={size:10,visible:!1};C.grid="number"===typeof n?{size:n,visible:!1}:"boolean"===typeof n?Object.assign(Object.assign({},v),{visible:n}):Object.assign(Object.assign({},v),n);const w=["panning","selecting","embedding","snapline","resizing","rotating","knob","clipboard","history","scroller","minimap","keyboard","mousewheel"];return w.forEach(t=>{const n=e[t];"boolean"===typeof n?C[t].enabled=n:C[t]=Object.assign(Object.assign({},C[t]),n)}),C.background&&C.scroller.enabled&&null==C.scroller.background&&(C.scroller.background=C.background,delete C.background),C}t.get=e}(ik||(ik={})),function(t){t.defaults={x:0,y:0,grid:{size:10,visible:!1},scaling:{min:.01,max:16},background:!1,highlighting:{default:{name:"stroke",args:{padding:3}},nodeAvailable:{name:"className",args:{className:WM.prefix("available-node")}},magnetAvailable:{name:"className",args:{className:WM.prefix("available-magnet")}}},connecting:{snap:!1,multi:!0,dangling:!0,allowLoop:!0,allowNode:!0,allowEdge:!1,allowPort:!0,highlight:!1,anchor:"center",edgeAnchor:"ratio",connectionPoint:"boundary",strategy:null,router:"normal",connector:"normal",validateConnection({type:t,sourceView:e,targetView:n}){const i="target"===t?n:e;return null!=i},createEdge(){return new fP}},transforming:{clearAll:!0,clearOnBlankMouseDown:!0},resizing:{enabled:!1,minWidth:0,minHeight:0,maxWidth:Number.MAX_SAFE_INTEGER,maxHeight:Number.MAX_SAFE_INTEGER,orthogonal:!0,restricted:!1,autoScroll:!0,preserveAspectRatio:!1,allowReverse:!0},rotating:{enabled:!1,grid:15},translating:{restrict:!1},knob:{enabled:!1,clearAll:!0,clearOnBlankMouseDown:!0},embedding:{enabled:!1,findParent:"bbox",frontOnly:!0,validate:()=>!0},selecting:{enabled:!1,rubberband:!1,rubberNode:!0,rubberEdge:!1,pointerEvents:"auto",multiple:!0,multipleSelectionModifiers:["ctrl","meta"],movable:!0,strict:!1,useCellGeometry:!1,selectCellOnMoved:!1,selectNodeOnMoved:!1,selectEdgeOnMoved:!1,content:null,handles:null},panning:{enabled:!1,eventTypes:["leftMouseDown"]},snapline:{enabled:!1},clipboard:{enabled:!1},history:{enabled:!1},scroller:{enabled:!1},keyboard:{enabled:!1},mousewheel:{enabled:!1,factor:1.2,zoomAtMousePosition:!0},async:!1,frozen:!1,sorting:"exact",moveThreshold:0,clickThreshold:0,magnetThreshold:0,preventDefaultDblClick:!0,preventDefaultMouseDown:!1,preventDefaultContextMenu:!0,preventDefaultBlankAction:!0,interacting:{edgeLabelMovable:!1},guard:()=>!1}}(ik||(ik={}));var sk=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class ok extends wP{get cid(){return this.graph.view.cid}get svg(){return this.view.svg}get defs(){return this.view.defs}isDefined(t){return null!=this.svg.getElementById(t)}filter(t){let e=t.id;const n=t.name;if(e||(e=`filter-${n}-${this.cid}-${s.hashcode(JSON.stringify(t))}`),!this.isDefined(e)){const i=IM.registry.get(n);if(null==i)return IM.registry.onNotFound(n);const r=i(t.args||{}),s=Object.assign(Object.assign({x:-1,y:-1,width:3,height:3,filterUnits:"objectBoundingBox"},t.attrs),{id:e});Mv.create(iA.sanitize(r),s).appendTo(this.defs)}return e}gradient(t){let e=t.id;const n=t.type;if(e||(e=`gradient-${n}-${this.cid}-${s.hashcode(JSON.stringify(t))}`),!this.isDefined(e)){const i=t.stops,r=i.map(t=>{const e=null!=t.opacity&&Number.isFinite(t.opacity)?t.opacity:1;return`<stop offset="${t.offset}" stop-color="${t.color}" stop-opacity="${e}"/>`}),s=`<${n}>${r.join("")}</${n}>`,o=Object.assign({id:e},t.attrs);Mv.create(s,o).appendTo(this.defs)}return e}marker(t){const{id:e,refX:n,refY:i,markerUnits:r,markerOrient:o,tagName:a,children:l}=t,c=sk(t,["id","refX","refY","markerUnits","markerOrient","tagName","children"]);let u=e;if(u||(u=`marker-${this.cid}-${s.hashcode(JSON.stringify(t))}`),!this.isDefined(u)){"path"!==a&&delete c.d;const t=Mv.create("marker",{refX:n,refY:i,id:u,overflow:"visible",orient:null!=o?o:"auto",markerUnits:r||"userSpaceOnUse"},l?l.map(t=>{var{tagName:e}=t,n=sk(t,["tagName"]);return Mv.create(""+e||"path",h.kebablizeAttrs(Object.assign(Object.assign({},c),n)))}):[Mv.create(a||"path",h.kebablizeAttrs(c))]);this.defs.appendChild(t.node)}return u}remove(t){const e=this.svg.getElementById(t);e&&e.parentNode&&e.parentNode.removeChild(e)}}var ak=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},lk=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class hk extends wP{get elem(){return this.view.grid}get grid(){return this.options.grid}init(){this.startListening(),this.draw(this.grid)}startListening(){this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this)}stopListening(){this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this)}setVisible(t){this.grid.visible!==t&&(this.grid.visible=t,this.update())}getGridSize(){return this.grid.size}setGridSize(t){this.grid.size=Math.max(t,1),this.update()}show(){this.setVisible(!0),this.update()}hide(){this.setVisible(!1),this.update()}clear(){this.elem.style.backgroundImage=""}draw(t){this.clear(),this.instance=null,Object.assign(this.grid,t),this.patterns=this.resolveGrid(t),this.update()}update(t={}){const e=this.grid.size;if(e<=1||!this.grid.visible)return this.clear();const n=this.graph.matrix(),i=this.getInstance(),r=Array.isArray(t)?t:[t];this.patterns.forEach((t,s)=>{const o="pattern_"+s,a=n.a||1,l=n.d||1,{update:c,markup:u}=t,d=lk(t,["update","markup"]),g=Object.assign(Object.assign(Object.assign({},d),r[s]),{sx:a,sy:l,ox:n.e||0,oy:n.f||0,width:e*a,height:e*l});i.has(o)||i.add(o,Mv.create("pattern",{id:o,patternUnits:"userSpaceOnUse"},Mv.createVectors(u)).node);const p=i.get(o);"function"===typeof c&&c(p.childNodes[0],g);let f=g.ox%g.width;f<0&&(f+=g.width);let m=g.oy%g.height;m<0&&(m+=g.height),h.attr(p,{x:f,y:m,width:g.width,height:g.height})});const s=(new XMLSerializer).serializeToString(i.root),o=`url(data:image/svg+xml;base64,${btoa(s)})`;this.elem.style.backgroundImage=o}getInstance(){return this.instance||(this.instance=new AM),this.instance}resolveGrid(t){if(!t)return[];const e=t.type;if(null==e)return[Object.assign(Object.assign({},AM.presets.dot),t.args)];const n=AM.registry.get(e);if(n){let e=t.args||[];return Array.isArray(e)||(e=[e]),Array.isArray(n)?n.map((t,n)=>Object.assign(Object.assign({},t),e[n])):[Object.assign(Object.assign({},n),e[0])]}return AM.registry.onNotFound(e)}dispose(){this.stopListening(),this.clear()}}ak([wP.dispose()],hk.prototype,"dispose",null);class ck extends wP{getClientMatrix(){return h.createSVGMatrix(this.view.stage.getScreenCTM())}getClientOffset(){const t=this.view.svg.getBoundingClientRect();return new ZC(t.left,t.top)}getPageOffset(){return this.getClientOffset().translate(window.scrollX,window.scrollY)}snapToGrid(t,e){const n="number"===typeof t?this.clientToLocalPoint(t,e):this.clientToLocalPoint(t.x,t.y);return n.snapToGrid(this.graph.getGridSize())}localToGraphPoint(t,e){const n=ZC.create(t,e);return h.transformPoint(n,this.graph.matrix())}localToClientPoint(t,e){const n=ZC.create(t,e);return h.transformPoint(n,this.getClientMatrix())}localToPagePoint(t,e){const n="number"===typeof t?this.localToGraphPoint(t,e):this.localToGraphPoint(t);return n.translate(this.getPageOffset())}localToGraphRect(t,e,n,i){const r=KC.create(t,e,n,i);return h.transformRectangle(r,this.graph.matrix())}localToClientRect(t,e,n,i){const r=KC.create(t,e,n,i);return h.transformRectangle(r,this.getClientMatrix())}localToPageRect(t,e,n,i){const r="number"===typeof t?this.localToGraphRect(t,e,n,i):this.localToGraphRect(t);return r.translate(this.getPageOffset())}graphToLocalPoint(t,e){const n=ZC.create(t,e);return h.transformPoint(n,this.graph.matrix().inverse())}clientToLocalPoint(t,e){const n=ZC.create(t,e);return h.transformPoint(n,this.getClientMatrix().inverse())}clientToGraphPoint(t,e){const n=ZC.create(t,e);return h.transformPoint(n,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalPoint(t,e){const n=ZC.create(t,e),i=n.diff(this.getPageOffset());return this.graphToLocalPoint(i)}graphToLocalRect(t,e,n,i){const r=KC.create(t,e,n,i);return h.transformRectangle(r,this.graph.matrix().inverse())}clientToLocalRect(t,e,n,i){const r=KC.create(t,e,n,i);return h.transformRectangle(r,this.getClientMatrix().inverse())}clientToGraphRect(t,e,n,i){const r=KC.create(t,e,n,i);return h.transformRectangle(r,this.graph.matrix().multiply(this.getClientMatrix().inverse()))}pageToLocalRect(t,e,n,i){const r=KC.create(t,e,n,i),s=this.getPageOffset();return r.x-=s.x,r.y-=s.y,this.graphToLocalRect(r)}}var uk,dk=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class gk extends wP{constructor(){super(...arguments),this.widget=this.graph.hook.createSnapline()}dispose(){this.widget.dispose()}}dk([wP.dispose()],gk.prototype,"dispose",null),function(t){function e(t){const e=[],n=[];return Array.isArray(t)?e.push(...t):t.split("|").forEach(t=>{-1===t.indexOf("&")?e.push(t):n.push(...t.split("&"))}),{or:e,and:n}}function n(t,n){if(null!=t&&null!=n){const i=e(t),r=e(n),s=i.or.sort(),o=r.or.sort(),a=i.and.sort(),l=r.and.sort(),h=(t,e)=>t.length===e.length&&(0===t.length||t.every((t,n)=>t===e[n]));return h(s,o)&&h(a,l)}return null==t&&null==n}function i(t,n,i){if(null==n||Array.isArray(n)&&0===n.length)return!i||!0!==t.altKey&&!0!==t.ctrlKey&&!0!==t.metaKey&&!0!==t.shiftKey;const{or:r,and:s}=e(n),o=e=>{const n=e.toLowerCase()+"Key";return!0===t[n]};return r.some(t=>o(t))&&s.every(t=>o(t))}t.parse=e,t.equals=n,t.isMatch=i}(uk||(uk={}));var pk=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class fk extends wP{get widgetOptions(){return this.options.scroller}get pannable(){return!!this.widgetOptions&&("object"===typeof this.widgetOptions.pannable?this.widgetOptions.pannable.enabled:!!this.widgetOptions.pannable)}init(){this.widget=this.graph.hook.createScroller(),this.startListening(),this.updateClassName(),this.widget&&this.widget.center()}startListening(){let t=[];const e=this.widgetOptions.pannable;t="object"===typeof e?e.eventTypes||[]:["leftMouseDown"],t.includes("leftMouseDown")&&(this.graph.on("blank:mousedown",this.preparePanning,this),this.graph.on("node:unhandled:mousedown",this.preparePanning,this),this.graph.on("edge:unhandled:mousedown",this.preparePanning,this)),t.includes("rightMouseDown")&&(this.onRightMouseDown=this.onRightMouseDown.bind(this),this.view.$(this.widget.container).on("mousedown",this.onRightMouseDown))}stopListening(){let t=[];const e=this.widgetOptions.pannable;t="object"===typeof e?e.eventTypes||[]:["leftMouseDown"],t.includes("leftMouseDown")&&(this.graph.off("blank:mousedown",this.preparePanning,this),this.graph.off("node:unhandled:mousedown",this.preparePanning,this),this.graph.off("edge:unhandled:mousedown",this.preparePanning,this)),t.includes("rightMouseDown")&&this.view.$(this.widget.container).off("mousedown",this.onRightMouseDown)}onRightMouseDown(t){2===t.button&&this.allowPanning(t,!0)&&this.widget&&(this.updateClassName(!0),this.widget.startPanning(t),this.widget.once("pan:stop",()=>this.updateClassName(!1)))}preparePanning({e:t}){this.widget&&(this.allowPanning(t,!0)||this.allowPanning(t)&&!this.graph.selection.allowRubberband(t,!0))&&(this.updateClassName(!0),this.widget.startPanning(t),this.widget.once("pan:stop",()=>this.updateClassName(!1)))}allowPanning(t,e){return this.widget&&this.pannable&&uk.isMatch(t,this.widgetOptions.modifiers,e)&&this.graph.hook.allowPanning(t)}updateClassName(t){if(null==this.widget)return;const e=this.widget.container,n=this.view.prefixClassName("graph-scroller-pannable");this.pannable?(h.addClass(e,n),e.dataset.panning=(!!t).toString()):h.removeClass(e,n)}enablePanning(){this.pannable||(this.widgetOptions.pannable=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.widgetOptions.pannable=!1,this.updateClassName())}lock(){this.widget&&this.widget.lock()}unlock(){this.widget&&this.widget.unlock()}update(){this.widget&&this.widget.update()}enableAutoResize(){this.widget&&this.widget.enableAutoResize()}disableAutoResize(){this.widget&&this.widget.disableAutoResize()}resize(t,e){this.widget&&this.widget.resize(t,e)}dispose(){this.widget&&this.widget.dispose(),this.stopListening()}}pk([wP.dispose()],fk.prototype,"dispose",null);var mk=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},bk=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class yk extends wP{get commonOptions(){const t=this.instanceOptions,{enabled:e}=t,n=bk(t,["enabled"]);return n}get instanceOptions(){return this.options.clipboard}get cells(){return this.widget.cells}get disabled(){return!0!==this.instanceOptions.enabled}init(){this.widget=this.graph.hook.createClipboard(),this.widget.deserialize(this.instanceOptions)}enable(){this.disabled&&(this.instanceOptions.enabled=!0)}disable(){this.disabled||(this.instanceOptions.enabled=!1)}copy(t,e={}){this.disabled||(this.widget.copy(t,this.graph,Object.assign(Object.assign({},this.commonOptions),e)),this.graph.trigger("clipboard:changed",{cells:t}))}cut(t,e={}){this.disabled||(this.widget.cut(t,this.graph,Object.assign(Object.assign({},this.commonOptions),e)),this.graph.trigger("clipboard:changed",{cells:t}))}paste(t={},e=this.graph){return this.disabled?[]:this.widget.paste(e,Object.assign(Object.assign({},this.commonOptions),t))}clean(t){this.disabled&&!t||(this.widget.clean(),this.graph.trigger("clipboard:changed",{cells:[]}))}isEmpty(){return this.widget.isEmpty()}dispose(){this.clean(!0)}}mk([wP.dispose()],yk.prototype,"dispose",null);var Ck=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class vk extends wP{constructor(){super(...arguments),this.highlights={}}init(){this.startListening()}startListening(){this.graph.on("cell:highlight",this.onCellHighlight,this),this.graph.on("cell:unhighlight",this.onCellUnhighlight,this)}stopListening(){this.graph.off("cell:highlight",this.onCellHighlight,this),this.graph.off("cell:unhighlight",this.onCellUnhighlight,this)}onCellHighlight({view:t,magnet:e,options:n={}}){const i=this.resolveHighlighter(n);if(!i)return;const r=this.getHighlighterId(e,i);if(!this.highlights[r]){const n=i.highlighter;n.highlight(t,e,Object.assign({},i.args)),this.highlights[r]={cellView:t,magnet:e,highlighter:n,args:i.args}}}onCellUnhighlight({magnet:t,options:e={}}){const n=this.resolveHighlighter(e);if(!n)return;const i=this.getHighlighterId(t,n);this.unhighlight(i)}resolveHighlighter(t){const e=this.options;let n=t.highlighter;if(null==n){const i=t.type;n=i&&e.highlighting[i]||e.highlighting.default}if(null==n)return null;const i="string"===typeof n?{name:n}:n,r=i.name,s=tE.registry.get(r);return null==s?tE.registry.onNotFound(r):(tE.check(r,s),{name:r,highlighter:s,args:i.args||{}})}getHighlighterId(t,e){return h.ensureId(t),e.name+t.id+JSON.stringify(e.args)}unhighlight(t){const e=this.highlights[t];e&&(e.highlighter.unhighlight(e.cellView,e.magnet,e.args),delete this.highlights[t])}dispose(){Object.keys(this.highlights).forEach(t=>this.unhighlight(t)),this.stopListening()}}Ck([vk.dispose()],vk.prototype,"dispose",null);var wk=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class xk extends wP{constructor(){super(...arguments),this.widgets=new Map}get container(){return this.graph.view.container}get viewport(){return this.graph.view.viewport}get isSelectionEnabled(){return!0===this.options.selecting.enabled}init(){this.startListening(),this.resize()}startListening(){this.graph.on("node:mouseup",this.onNodeMouseUp,this),this.graph.on("node:selected",this.onNodeSelected,this),this.graph.on("node:unselected",this.onNodeUnSelected,this)}stopListening(){this.graph.off("node:mouseup",this.onNodeMouseUp,this),this.graph.off("node:selected",this.onNodeSelected,this),this.graph.off("node:unselected",this.onNodeUnSelected,this)}onNodeMouseUp({node:t}){if(!this.isSelectionEnabled){const e=this.graph.hook.createTransform(t,{clearAll:!0});e&&this.widgets.set(t,e)}}onNodeSelected({node:t}){if(this.isSelectionEnabled){const e=this.graph.hook.createTransform(t,{clearAll:!1});e&&this.widgets.set(t,e)}}onNodeUnSelected({node:t}){if(this.isSelectionEnabled){const e=this.widgets.get(t);e&&e.dispose(),this.widgets.delete(t)}}getMatrix(){const t=this.viewport.getAttribute("transform");return t!==this.viewportTransformString&&(this.viewportMatrix=this.viewport.getCTM(),this.viewportTransformString=t),h.createSVGMatrix(this.viewportMatrix)}setMatrix(t){const e=h.createSVGMatrix(t),n=h.matrixToTransformString(e);this.viewport.setAttribute("transform",n),this.viewportMatrix=e,this.viewportTransformString=n}resize(t,e){let n=void 0===t?this.options.width:t,i=void 0===e?this.options.height:e;this.options.width=n,this.options.height=i,"number"===typeof n&&(n=Math.round(n)),"number"===typeof i&&(i=Math.round(i)),this.container.style.width=null==n?"":n+"px",this.container.style.height=null==i?"":i+"px";const r=this.getComputedSize();return this.graph.trigger("resize",Object.assign({},r)),this}getComputedSize(){let t=this.options.width,e=this.options.height;return o.isNumber(t)||(t=this.container.clientWidth),o.isNumber(e)||(e=this.container.clientHeight),{width:t,height:e}}getScale(){return h.matrixToScale(this.getMatrix())}scale(t,e=t,n=0,i=0,r={}){if(t=this.clampScale(t),e=this.clampScale(e),n||i){const r=this.getTranslation(),s=r.tx-n*(t-1),o=r.ty-i*(e-1);s===r.tx&&o===r.ty||this.translate(s,o)}const s=this.getMatrix();return s.a=t,s.d=e,this.setMatrix(s),this.graph.trigger("scale",Object.assign({sx:t,sy:e,ox:n,oy:i},r)),this}clampScale(t){const e=this.graph.options.scaling;return o.clamp(t,e.min||.01,e.max||16)}getZoom(){return this.getScale().sx}zoom(t,e){e=e||{};let n=t,i=t;const r=this.getScale(),s=this.getComputedSize();let o=s.width/2,a=s.height/2;if(e.absolute||(n+=r.sx,i+=r.sy),e.scaleGrid&&(n=Math.round(n/e.scaleGrid)*e.scaleGrid,i=Math.round(i/e.scaleGrid)*e.scaleGrid),e.maxScale&&(n=Math.min(e.maxScale,n),i=Math.min(e.maxScale,i)),e.minScale&&(n=Math.max(e.minScale,n),i=Math.max(e.minScale,i)),e.center&&(o=e.center.x,a=e.center.y),n=this.clampScale(n),i=this.clampScale(i),o||a){const t=this.getTranslation(),s=o-(o-t.tx)*(n/r.sx),l=a-(a-t.ty)*(i/r.sy);s===t.tx&&l===t.ty||this.translate(s,l,{ui:e.ui})}return this.scale(n,i,0,0,{ui:e.ui}),this}getRotation(){return h.matrixToRotation(this.getMatrix())}rotate(t,e,n){if(null==e||null==n){const t=h.getBBox(this.graph.view.stage);e=t.width/2,n=t.height/2}const i=this.getMatrix().translate(e,n).rotate(t).translate(-e,-n);return this.setMatrix(i),this}getTranslation(){return h.matrixToTranslation(this.getMatrix())}translate(t,e,n={}){const i=this.getMatrix();i.e=t||0,i.f=e||0,this.setMatrix(i);const r=this.getTranslation();return this.options.x=r.tx,this.options.y=r.ty,this.graph.trigger("translate",Object.assign(Object.assign({},r),n)),this}setOrigin(t,e){return this.translate(t||0,e||0)}fitToContent(t,e,n,i){if("object"===typeof t){const r=t;t=r.gridWidth||1,e=r.gridHeight||1,n=r.padding||0,i=r}else t=t||1,e=e||1,n=n||0,null==i&&(i={});const r=o.normalizeSides(n),s=i.border||0,a=i.contentArea?KC.create(i.contentArea):this.getContentArea(i);s>0&&a.inflate(s);const l=this.getScale(),h=this.getTranslation(),c=l.sx,u=l.sy;a.x*=c,a.y*=u,a.width*=c,a.height*=u;let d=Math.max(Math.ceil((a.width+a.x)/t),1)*t,g=Math.max(Math.ceil((a.height+a.y)/e),1)*e,p=0,f=0;("negative"===i.allowNewOrigin&&a.x<0||"positive"===i.allowNewOrigin&&a.x>=0||"any"===i.allowNewOrigin)&&(p=Math.ceil(-a.x/t)*t,p+=r.left,d+=p),("negative"===i.allowNewOrigin&&a.y<0||"positive"===i.allowNewOrigin&&a.y>=0||"any"===i.allowNewOrigin)&&(f=Math.ceil(-a.y/e)*e,f+=r.top,g+=f),d+=r.right,g+=r.bottom,d=Math.max(d,i.minWidth||0),g=Math.max(g,i.minHeight||0),d=Math.min(d,i.maxWidth||Number.MAX_SAFE_INTEGER),g=Math.min(g,i.maxHeight||Number.MAX_SAFE_INTEGER);const m=this.getComputedSize(),b=d!==m.width||g!==m.height,y=p!==h.tx||f!==h.ty;return y&&this.translate(p,f),b&&this.resize(d,g),new KC(-p/c,-f/u,d/c,g/u)}scaleContentToFit(t={}){this.scaleContentToFitImpl(t)}scaleContentToFitImpl(t={},e=!0){let n,i;if(t.contentArea){const e=t.contentArea;n=this.graph.localToGraph(e),i=ZC.create(e)}else n=this.getContentBBox(t),i=this.graph.graphToLocal(n);if(!n.width||!n.height)return;const r=o.normalizeSides(t.padding),s=t.minScale||0,a=t.maxScale||Number.MAX_SAFE_INTEGER,l=t.minScaleX||s,h=t.maxScaleX||a,c=t.minScaleY||s,u=t.maxScaleY||a;let d;if(t.viewportArea)d=t.viewportArea;else{const t=this.getComputedSize(),e=this.getTranslation();d={x:e.tx,y:e.ty,width:t.width,height:t.height}}d=KC.create(d).moveAndExpand({x:r.left,y:r.top,width:-r.left-r.right,height:-r.top-r.bottom});const g=this.getScale();let p=d.width/n.width*g.sx,f=d.height/n.height*g.sy;!1!==t.preserveAspectRatio&&(p=f=Math.min(p,f));const m=t.scaleGrid;if(m&&(p=m*Math.floor(p/m),f=m*Math.floor(f/m)),p=o.clamp(p,l,h),f=o.clamp(f,c,u),this.scale(p,f),e){const t=this.options,e=d.x-i.x*p-t.x,n=d.y-i.y*f-t.y;this.translate(e,n)}}getContentArea(t={}){return t.useCellGeometry?this.model.getAllCellsBBox()||new KC:h.getBBox(this.graph.view.stage)}getContentBBox(t={}){return this.graph.localToGraph(this.getContentArea(t))}getGraphArea(){const t=KC.fromSize(this.getComputedSize());return this.graph.graphToLocal(t)}zoomToRect(t,e={}){const n=KC.create(t),i=this.graph;e.contentArea=n,null==e.viewportArea&&(e.viewportArea={x:i.options.x,y:i.options.y,width:this.options.width,height:this.options.height}),this.scaleContentToFitImpl(e,!1);const r=n.getCenter();return this.centerPoint(r.x,r.y),this}zoomToFit(t={}){return this.zoomToRect(this.getContentArea(t),t)}centerPoint(t,e){const n=this.getComputedSize(),i=this.getScale(),r=this.getTranslation(),s=n.width/2,o=n.height/2;t="number"===typeof t?t:s,e="number"===typeof e?e:o,t=s-t*i.sx,e=o-e*i.sy,r.tx===t&&r.ty===e||this.translate(t,e)}centerContent(t){const e=this.graph.getContentArea(t),n=e.getCenter();this.centerPoint(n.x,n.y)}centerCell(t){return this.positionCell(t,"center")}positionPoint(t,e,n){const i=this.getComputedSize();e=o.normalizePercentage(e,Math.max(0,i.width)),e<0&&(e=i.width+e),n=o.normalizePercentage(n,Math.max(0,i.height)),n<0&&(n=i.height+n);const r=this.getTranslation(),s=this.getScale(),a=e-t.x*s.sx,l=n-t.y*s.sy;r.tx===a&&r.ty===l||this.translate(a,l)}positionRect(t,e){const n=KC.create(t);switch(e){case"center":return this.positionPoint(n.getCenter(),"50%","50%");case"top":return this.positionPoint(n.getTopCenter(),"50%",0);case"top-right":return this.positionPoint(n.getTopRight(),"100%",0);case"right":return this.positionPoint(n.getRightMiddle(),"100%","50%");case"bottom-right":return this.positionPoint(n.getBottomRight(),"100%","100%");case"bottom":return this.positionPoint(n.getBottomCenter(),"50%","100%");case"bottom-left":return this.positionPoint(n.getBottomLeft(),0,"100%");case"left":return this.positionPoint(n.getLeftMiddle(),0,"50%");case"top-left":return this.positionPoint(n.getTopLeft(),0,0);default:return this}}positionCell(t,e){const n=t.getBBox();return this.positionRect(n,e)}positionContent(t,e){const n=this.graph.getContentArea(e);return this.positionRect(n,t)}dispose(){this.widgets.forEach(t=>t.dispose()),this.widgets.clear(),this.stopListening()}}wk([xk.dispose()],xk.prototype,"dispose",null);var Mk=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class Ek extends wP{constructor(){super(...arguments),this.movedMap=new WeakMap,this.unselectMap=new WeakMap}get widgetOptions(){return this.options.selecting}get rubberbandDisabled(){return!0!==this.widgetOptions.enabled||!0!==this.widgetOptions.rubberband}get disabled(){return!0!==this.widgetOptions.enabled}get length(){return this.widget.length}get cells(){return this.widget.cells}init(){this.widget=this.graph.hook.createSelection(),this.startListening()}startListening(){this.graph.on("blank:mousedown",this.onBlankMouseDown,this),this.graph.on("blank:click",this.onBlankClick,this),this.graph.on("cell:mousemove",this.onCellMouseMove,this),this.graph.on("cell:mouseup",this.onCellMouseUp,this),this.widget.on("box:mousedown",this.onBoxMouseDown,this)}stopListening(){this.graph.off("blank:mousedown",this.onBlankMouseDown,this),this.graph.off("blank:click",this.onBlankClick,this),this.graph.off("cell:mousemove",this.onCellMouseMove,this),this.graph.off("cell:mouseup",this.onCellMouseUp,this),this.widget.off("box:mousedown",this.onBoxMouseDown,this)}onBlankMouseDown({e:t}){(this.allowRubberband(t,!0)||this.allowRubberband(t)&&!this.graph.scroller.allowPanning(t,!0)&&!this.graph.panning.allowPanning(t,!0))&&this.startRubberband(t)}onBlankClick(){this.clean()}allowRubberband(t,e){return!this.rubberbandDisabled&&uk.isMatch(t,this.widgetOptions.modifiers,e)&&this.graph.hook.allowRubberband(t)}allowMultipleSelection(t){return this.isMultiple()&&uk.isMatch(t,this.widgetOptions.multipleSelectionModifiers)}onCellMouseMove({cell:t}){this.movedMap.set(t,!0)}onCellMouseUp({e:t,cell:e}){const n=this.widgetOptions;let i=this.disabled;!i&&this.movedMap.has(e)&&(i=!1===n.selectCellOnMoved,i||(i=!1===n.selectNodeOnMoved&&e.isNode()),i||(i=!1===n.selectEdgeOnMoved&&e.isEdge())),i||(this.allowMultipleSelection(t)?this.unselectMap.has(e)?this.unselectMap.delete(e):this.isSelected(e)?this.unselect(e):this.select(e):this.reset(e)),this.movedMap.delete(e)}onBoxMouseDown({e:t,cell:e}){this.disabled||this.allowMultipleSelection(t)&&(this.unselect(e),this.unselectMap.set(e,!0))}isEmpty(){return this.length<=0}isSelected(t){return this.widget.isSelected(t)}getCells(t){return(Array.isArray(t)?t:[t]).map(t=>"string"===typeof t?this.graph.getCellById(t):t).filter(t=>null!=t)}select(t,e={}){const n=this.getCells(t);return n.length&&(this.isMultiple()?this.widget.select(n,e):this.reset(n.slice(0,1),e)),this}unselect(t,e={}){return this.widget.unselect(this.getCells(t),e),this}reset(t,e={}){return this.widget.reset(t?this.getCells(t):[],e),this}clean(t={}){return this.widget.clean(t),this}enable(){return this.disabled&&(this.widgetOptions.enabled=!0),this}disable(){return this.disabled||(this.widgetOptions.enabled=!1),this}startRubberband(t){return this.rubberbandDisabled||this.widget.startSelecting(t),this}enableRubberband(){return this.rubberbandDisabled&&(this.widgetOptions.rubberband=!0),this}disableRubberband(){return this.rubberbandDisabled||(this.widgetOptions.rubberband=!1),this}isMultiple(){return!1!==this.widgetOptions.multiple}enableMultiple(){return this.widgetOptions.multiple=!0,this}disableMultiple(){return this.widgetOptions.multiple=!1,this}setModifiers(t){return this.widgetOptions.modifiers=t,this}setContent(t){return this.widget.setContent(t),this}setFilter(t){return this.widget.setFilter(t),this}dispose(){this.stopListening(),this.widget.dispose()}}Mk([wP.dispose()],Ek.prototype,"dispose",null);var Ak,Sk=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Ok=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class Pk extends RE{constructor(t){super(),this.batchCommands=null,this.batchLevel=0,this.lastBatchIndex=-1,this.freezed=!1,this.handlers=[],this.graph=t.graph,this.model=t.graph.model,this.options=Ak.getOptions(t),this.validator=new Pk.Validator({history:this,cancelInvalid:this.options.cancelInvalid}),this.clean(),this.startListening()}get disabled(){return!0!==this.options.enabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}undo(t={}){if(!this.disabled){const e=this.undoStack.pop();e&&(this.revertCommand(e,t),this.redoStack.push(e),this.notify("undo",e,t))}return this}redo(t={}){if(!this.disabled){const e=this.redoStack.pop();e&&(this.applyCommand(e,t),this.undoStack.push(e),this.notify("redo",e,t))}return this}cancel(t={}){if(!this.disabled){const e=this.undoStack.pop();e&&(this.revertCommand(e,t),this.redoStack=[],this.notify("cancel",e,t))}return this}clean(t={}){return this.undoStack=[],this.redoStack=[],this.notify("clean",null,t),this}canUndo(){return!this.disabled&&this.undoStack.length>0}canRedo(){return!this.disabled&&this.redoStack.length>0}validate(t,...e){return this.validator.validate(t,...e),this}dispose(){this.validator.dispose(),this.clean(),this.stopListening()}startListening(){this.model.on("batch:start",this.initBatchCommand,this),this.model.on("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&this.options.eventNames.forEach((t,e)=>{this.handlers[e]=this.addCommand.bind(this,t),this.model.on(t,this.handlers[e])}),this.validator.on("invalid",t=>this.trigger("invalid",t))}stopListening(){this.model.off("batch:start",this.initBatchCommand,this),this.model.off("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&(this.options.eventNames.forEach((t,e)=>{this.model.off(t,this.handlers[e])}),this.handlers.length=0),this.validator.off("invalid")}createCommand(t){return{batch:!!t&&t.batch,data:{}}}revertCommand(t,e){this.freezed=!0;const n=Array.isArray(t)?Ak.sortBatchCommands(t):[t];for(let i=n.length-1;i>=0;i-=1){const t=n[i],s=Object.assign(Object.assign({},e),r.pick(t.options,this.options.revertOptionsList||[]));this.executeCommand(t,!0,s)}this.freezed=!1}applyCommand(t,e){this.freezed=!0;const n=Array.isArray(t)?Ak.sortBatchCommands(t):[t];for(let i=0;i<n.length;i+=1){const t=n[i],s=Object.assign(Object.assign({},e),r.pick(t.options,this.options.applyOptionsList||[]));this.executeCommand(t,!1,s)}this.freezed=!1}executeCommand(t,e,n){const i=this.model,r=i.getCell(t.data.id),s=t.event;if(Ak.isAddEvent(s)&&e||Ak.isRemoveEvent(s)&&!e)r&&r.remove(n);else if(Ak.isAddEvent(s)&&!e||Ak.isRemoveEvent(s)&&e){const e=t.data;e.node?i.addNode(e.props,n):e.edge&&i.addEdge(e.props,n)}else if(Ak.isChangeEvent(s)){const i=t.data,s=i.key;if(s&&r){const t=e?i.prev[s]:i.next[s];r.prop(s,t,n)}}else{const i=this.options.executeCommand;i&&a.call(i,this,t,e,n)}}addCommand(t,e){if(this.freezed||this.disabled)return;const n=e,i=n.options||{};if(i.dryrun)return;if(Ak.isAddEvent(t)&&this.options.ignoreAdd||Ak.isRemoveEvent(t)&&this.options.ignoreRemove||Ak.isChangeEvent(t)&&this.options.ignoreChange)return;const s=this.options.beforeAddCommand;if(null!=s&&!1===a.call(s,this,t,e))return;"cell:change:*"===t&&(t="cell:change:"+n.key);const o=n.cell,l=HO.isModel(o);let h;if(this.batchCommands){h=this.batchCommands[Math.max(this.lastBatchIndex,0)];const e=l&&!h.modelChange||h.data.id!==o.id,n=h.event!==t;if(this.lastBatchIndex>=0&&(e||n)){const e=this.batchCommands.findIndex(e=>(l&&e.modelChange||e.data.id===o.id)&&e.event===t);e<0||Ak.isAddEvent(t)||Ak.isRemoveEvent(t)?h=this.createCommand({batch:!0}):(h=this.batchCommands[e],this.batchCommands.splice(e,1)),this.batchCommands.push(h),this.lastBatchIndex=this.batchCommands.length-1}}else h=this.createCommand({batch:!1});if(Ak.isAddEvent(t)||Ak.isRemoveEvent(t)){const e=h.data;return h.event=t,h.options=i,e.id=o.id,e.props=r.cloneDeep(o.toJSON()),o.isEdge()?e.edge=!0:o.isNode()&&(e.node=!0),this.push(h,i)}if(Ak.isChangeEvent(t)){const n=e.key,s=h.data;return h.batch&&h.event||(h.event=t,h.options=i,s.key=n,null==s.prev&&(s.prev={}),s.prev[n]=r.clone(o.previous(n)),l?h.modelChange=!0:s.id=o.id),null==s.next&&(s.next={}),s.next[n]=r.clone(o.prop(n)),this.push(h,i)}const c=this.options.afterAddCommand;c&&a.call(c,this,t,e,h),this.push(h,i)}initBatchCommand(t){this.freezed||(this.batchCommands?this.batchLevel+=1:(this.batchCommands=[this.createCommand({batch:!0})],this.batchLevel=0,this.lastBatchIndex=-1))}storeBatchCommand(t){if(!this.freezed)if(this.batchCommands&&this.batchLevel<=0){const e=this.filterBatchCommand(this.batchCommands);e.length>0&&(this.redoStack=[],this.undoStack.push(e),this.consolidateCommands(),this.notify("add",e,t)),this.batchCommands=null,this.lastBatchIndex=-1,this.batchLevel=0}else this.batchCommands&&this.batchLevel>0&&(this.batchLevel-=1)}filterBatchCommand(t){let e=t.slice();const n=[];while(e.length>0){const t=e.shift(),i=t.event,s=t.data.id;if(null!=i&&(null!=s||t.modelChange)){if(Ak.isAddEvent(i)){const t=e.findIndex(t=>Ak.isRemoveEvent(t.event)&&t.data.id===s);if(t>=0){e=e.filter((e,n)=>t<n||e.data.id!==s);continue}}else if(Ak.isRemoveEvent(i)){const t=e.findIndex(t=>Ak.isAddEvent(t.event)&&t.data.id===s);if(t>=0){e.splice(t,1);continue}}else if(Ak.isChangeEvent(i)){const e=t.data;if(r.isEqual(e.prev,e.next))continue}n.push(t)}}return n}notify(t,e,n){const i=null==e?null:Array.isArray(e)?e:[e];this.emit(t,{cmds:i,options:n}),this.emit("change",{cmds:i,options:n})}push(t,e){this.redoStack=[],t.batch?(this.lastBatchIndex=Math.max(this.lastBatchIndex,0),this.emit("batch",{cmd:t,options:e})):(this.undoStack.push(t),this.consolidateCommands(),this.notify("add",t,e))}consolidateCommands(){var t;const e=this.undoStack[this.undoStack.length-1],n=this.undoStack[this.undoStack.length-2];if(!Array.isArray(e))return;const i=new Set(e.map(t=>t.event));if(2!==i.size||!i.has("cell:change:parent")||!i.has("cell:change:children"))return;if(!e.every(t=>{var e;return t.batch&&(null===(e=t.options)||void 0===e?void 0:e.ui)}))return;if(!Array.isArray(n)||1!==n.length)return;const r=n[0];"cell:change:position"===r.event&&(null===(t=r.options)||void 0===t?void 0:t.ui)&&(n.push(...e),this.undoStack.pop())}}Sk([RE.dispose()],Pk.prototype,"dispose",null),function(t){class e extends RE{constructor(t){super(),this.map={},this.command=t.history,this.cancelInvalid=!1!==t.cancelInvalid,this.command.on("add",this.onCommandAdded,this)}onCommandAdded({cmds:t}){return Array.isArray(t)?t.every(t=>this.isValidCommand(t)):this.isValidCommand(t)}isValidCommand(t){if(t.options&&!1===t.options.validation)return!0;const e=t.event&&this.map[t.event]||[];let n=null;return e.forEach(e=>{let i=0;const r=s=>{const o=e[i];i+=1;try{if(!o)return void(n=s);o(s,t,r)}catch(s){r(s)}};r(n)}),!n||(this.cancelInvalid&&this.command.cancel(),this.emit("invalid",{err:n}),!1)}validate(t,...e){const n=Array.isArray(t)?t:t.split(/\s+/);return e.forEach(t=>{if("function"!==typeof t)throw new Error(n.join(" ")+" requires callback functions.")}),n.forEach(t=>{null==this.map[t]&&(this.map[t]=[]),this.map[t].push(e)}),this}dispose(){this.command.off("add",this.onCommandAdded,this)}}Sk([RE.dispose()],e.prototype,"dispose",null),t.Validator=e}(Pk||(Pk={})),function(t){function e(t){return"cell:added"===t}function n(t){return"cell:removed"===t}function i(t){return null!=t&&t.startsWith("cell:change:")}function r(e){const{graph:n}=e,i=Ok(e,["graph"]),r=["cell:added","cell:removed","cell:change:*"],s=["batch:start","batch:stop"],o=e.eventNames?e.eventNames.filter(e=>!(t.isChangeEvent(e)||r.includes(e)||s.includes(e))):r;return Object.assign(Object.assign({},i),{eventNames:o,applyOptionsList:e.applyOptionsList||["propertyPath"],revertOptionsList:e.revertOptionsList||["propertyPath"]})}function s(e){const n=[];for(let i=0,r=e.length;i<r;i+=1){const r=e[i];let s=null;if(t.isAddEvent(r.event)){const t=r.data.id;for(let n=0;n<i;n+=1)if(e[n].data.id===t){s=n;break}}null!==s?n.splice(s,0,r):n.push(r)}return n}t.isAddEvent=e,t.isRemoveEvent=n,t.isChangeEvent=i,t.getOptions=r,t.sortBatchCommands=s}(Ak||(Ak={}));var kk=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class Dk extends wP{get widgetOptions(){return this.options.minimap}init(){this.widget=this.graph.hook.createMiniMap()}dispose(){this.widget&&this.widget.dispose()}}kk([wP.dispose()],Dk.prototype,"dispose",null);var Tk=n("b0ff"),Nk=n.n(Tk),jk=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class Lk extends zE{constructor(t){super(),this.options=t;const e=this.graph.scroller.widget;this.container=e?e.container:this.graph.container,t.global?this.target=document:(this.target=this.container,this.disabled||this.target.setAttribute("tabindex","-1"),this.graph.on("cell:mouseup",this.focus,this),this.graph.on("blank:mouseup",this.focus,this)),this.mousetrap=Lk.createMousetrap(this)}get graph(){return this.options.graph}get disabled(){return!0!==this.options.enabled}enable(){this.disabled&&(this.options.enabled=!0,this.graph.options.keyboard.enabled=!0,this.target instanceof HTMLElement&&this.target.setAttribute("tabindex","-1"))}disable(){this.disabled||(this.options.enabled=!1,this.graph.options.keyboard.enabled=!1,this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))}on(t,e,n){this.mousetrap.bind(this.getKeys(t),e,n)}off(t,e){this.mousetrap.unbind(this.getKeys(t),e)}focus(t){const e=this.isInputEvent(t.e);if(e)return;const n=this.target;n.focus({preventScroll:!0})}getKeys(t){return(Array.isArray(t)?t:[t]).map(t=>this.formatkey(t))}formatkey(t){const e=t.toLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command"),n=this.options.format;return n?a.call(n,this.graph,e):e}isGraphEvent(t){const e=t.srcElement||t.target,n=t.currentTarget;return!!e&&(e===this.target||n===this.target||e===document.body||h.contains(this.container,e))}isInputEvent(t){var e;const n=t.target,i=null===(e=null===n||void 0===n?void 0:n.tagName)||void 0===e?void 0:e.toLowerCase();return["input","textarea"].includes(i)}isEnabledForEvent(t){const e=!this.disabled&&this.isGraphEvent(t),n=this.isInputEvent(t);if(e){const e=t.keyCode||t.which;if(n&&(8===e||46===e))return!1;if(this.options.guard)return a.call(this.options.guard,this.graph,t)}return e}dispose(){this.mousetrap.reset()}}jk([zE.dispose()],Lk.prototype,"dispose",null),function(t){function e(t){const e=new Nk.a(t.target),n=e.stopCallback;return e.stopCallback=(i,r,s)=>!t.isEnabledForEvent(i)||!!n&&n.call(e,i,r,s),e}t.createMousetrap=e}(Lk||(Lk={}));var Fk=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class zk extends zE{constructor(t){super(),this.options=t,this.cumulatedFactor=1;const e=this.graph.scroller.widget;this.container=e?e.container:this.graph.container,this.target=this.options.global?document:this.container,this.mousewheelHandle=new h.MouseWheelHandle(this.target,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.options.enabled&&this.enable(!0)}get graph(){return this.options.graph}get disabled(){return!0!==this.options.enabled}enable(t){(this.disabled||t)&&(this.options.enabled=!0,this.graph.options.mousewheel.enabled=!0,this.mousewheelHandle.enable())}disable(){this.disabled||(this.options.enabled=!1,this.graph.options.mousewheel.enabled=!1,this.mousewheelHandle.disable())}allowMouseWheel(t){const e=t.originalEvent||t,n=this.options.guard;return(null==n||n.call(this.graph,e))&&uk.isMatch(e,this.options.modifiers)}onMouseWheel(t){const e=t.originalEvent||t,n=this.options.guard;if((null==n||n.call(this.graph,e))&&uk.isMatch(e,this.options.modifiers)){const e=this.options.factor||1.2;null==this.currentScale&&(this.startPos={x:t.clientX,y:t.clientY},this.currentScale=this.graph.scroller.widget?this.graph.scroller.widget.zoom():this.graph.transform.getScale().sx);const n=t.deltaY;n<0?this.currentScale<.15?this.cumulatedFactor=(this.currentScale+.01)/this.currentScale:this.cumulatedFactor=Math.round(this.currentScale*e*20)/20/this.currentScale:this.currentScale<=.15?this.cumulatedFactor=(this.currentScale-.01)/this.currentScale:this.cumulatedFactor=Math.round(this.currentScale*(1/e)*20)/20/this.currentScale,this.cumulatedFactor=Math.max(.01,Math.min(this.currentScale*this.cumulatedFactor,160)/this.currentScale);const i=this.graph.scroller.widget,r=this.currentScale;let s=this.graph.transform.clampScale(r*this.cumulatedFactor);const a=this.options.minScale||Number.MIN_SAFE_INTEGER,l=this.options.maxScale||Number.MAX_SAFE_INTEGER;if(s=o.clamp(s,a,l),s!==r)if(i)if(this.options.zoomAtMousePosition){const t=this.graph.coord.clientToLocalPoint(this.startPos);i.zoom(s,{absolute:!0,center:t.clone()})}else i.zoom(s,{absolute:!0});else if(this.options.zoomAtMousePosition){const t=this.graph.coord.clientToGraphPoint(this.startPos);this.graph.transform.zoom(s,{absolute:!0,center:t.clone(),ui:!0})}else this.graph.transform.zoom(s,{absolute:!0,ui:!0});this.currentScale=null,this.cumulatedFactor=1}}dispose(){this.disable()}}Fk([zE.dispose()],zk.prototype,"dispose",null);var Bk=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class Rk extends wP{show(t={}){const e=Object.assign(Object.assign({},Rk.defaultOptions),t),n=this.createPrintPages(e);e.ready(n,t=>this.showPrintWindow(t,e),{sheetSize:this.getSheetSize(e)})}get className(){return this.view.prefixClassName("graph-print")}showPrintWindow(t,e){if(t){const n=P()(document.body),i=P()(this.view.container),r=this.view.prefixClassName("graph-printing");n.addClass(r);const s=i.children().detach();t.forEach(t=>{t.removeClass(this.className+"-preview").addClass(this.className+"-ready").appendTo(n)});let o=!1;const a=()=>{o||(o=!0,n.removeClass(r),t.forEach(t=>t.remove()),i.append(s),P()("#"+this.styleSheetId).remove(),this.graph.trigger("after:print",e),P()(window).off("afterprint",a))};P()(window).one("afterprint",a),setTimeout(a,200),window.print()}}createPrintPage(t,e){this.graph.trigger("before:print",e);const n=P()("<div/>").addClass(this.className),i=P()("<div/>").addClass(this.view.prefixClassName("graph-print-inner")).css("position","relative");e.size&&n.addClass(`${this.className}-size-${e.size}`);const r=Mv.create(this.view.svg).clone(),s=r.findOne("."+this.view.prefixClassName("graph-svg-stage"));i.append(r.node);const o=this.getSheetSize(e),a=this.graph.transform.getGraphArea(),l=this.graph.transform.getScale(),c=this.graph.translate(),u=h.createSVGMatrix().translate(c.tx/l.sx,c.ty/l.sy),d=this.getPageInfo(a,t,o),g=d.scale,p=d.bbox;return i.css({left:0,top:0}),r.attr({width:p.width*g,height:p.height*g,style:"position:relative",viewBox:[p.x,p.y,p.width,p.height].join(" ")}),s.attr("transform",h.matrixToTransformString(u)),n.append(i),n.addClass(this.className+"-preview"),{$page:n,sheetSize:o}}createPrintPages(t){let e;const n=this.getPrintArea(t),i=[];if(t.page){const r=this.getPageSize(n,t.page),s=this.getPageAreas(n,r);s.forEach(n=>{e=this.createPrintPage(n,t),i.push(e.$page)})}else e=this.createPrintPage(n,t),i.push(e.$page);if(e){const n={width:e.sheetSize.cssWidth,height:e.sheetSize.cssHeight};this.updatePrintStyle(n,t)}return i}get styleSheetId(){return this.view.prefixClassName("graph-print-style")}updatePrintStyle(t,e){const n=Object.keys(t).reduce((e,n)=>`${e} ${n}:${t[n]};`,""),i=o.normalizeSides(e.margin),r=e.marginUnit||"",s=e.sheetUnit||"",a=`\n @media print {\n .${this.className}.${this.className}-ready {\n ${n}\n }\n\n @page {\n margin:\n ${[i.top+r,i.right+r,i.bottom+r,i.left+r].join(" ")};\n size: ${e.sheet.width+s} ${e.sheet.height+s};\n\n .${this.className}.${this.className}-preview {\n ${n}\n }\n }`,l=this.styleSheetId,h=P()("#"+l);h.length?h.html(a):P()("head").append(`'<style type="text/css" id="${l}">${a}</style>'`)}getPrintArea(t){let e=t.area;if(!e){const n=o.normalizeSides(t.padding);e=this.graph.getContentArea().moveAndExpand({x:-n.left,y:-n.top,width:n.left+n.right,height:n.top+n.bottom})}return e}getPageSize(t,e){if("object"===typeof e){const n=e,i={width:n.width,height:n.height};return null==i.width&&(i.width=Math.ceil(t.width/(n.columns||1))),null==i.height&&(i.height=Math.ceil(t.height/(n.rows||1))),i}return{width:t.width,height:t.height}}getPageAreas(t,e){const n=[],i=e.width,r=e.height;for(let s=0,o=0;s<t.height&&o<200;s+=r,o+=1)for(let e=0,a=0;e<t.width&&a<200;e+=i,a+=1)n.push(new KC(t.x+e,t.y+s,i,r));return n}getSheetSize(t){const e=t.sheet,n=o.normalizeSides(t.margin),i=t.marginUnit||"",r=t.sheetUnit||"",s=`calc(${e.width}${r} - ${n.left+n.right}${i})`,a=`calc(${e.height}${r} - ${n.top+n.bottom}${i})`,l=kC.measure(s,a);return{cssWidth:s,cssHeight:a,width:l.width,height:l.height}}getPageInfo(t,e,n){const i=new KC(e.x-t.x,e.y-t.y,e.width,e.height),r=i.width/i.height,s=n.width/n.height;return{bbox:i,scale:s<r?n.width/i.width:n.height/i.height,fitHorizontal:s<r}}dispose(){}}Bk([wP.dispose()],Rk.prototype,"dispose",null),function(t){t.defaultOptions={page:!1,sheet:{width:210,height:297},sheetUnit:"mm",margin:.4,marginUnit:"in",padding:5,ready:(t,e)=>e(t)}}(Rk||(Rk={}));class Ik extends wP{toSVG(t,e={}){this.graph.trigger("before:export",e);const n=this.view.svg,i=Mv.create(n).clone();let r=i.node;const s=i.findOne("."+this.view.prefixClassName("graph-svg-stage")),l=e.viewBox||this.graph.graphToLocal(this.graph.getContentBBox()),h=e.preserveDimensions;if(h){const t="boolean"===typeof h?l:h;i.attr({width:t.width,height:t.height})}if(i.removeAttribute("style").attr("viewBox",[l.x,l.y,l.width,l.height].join(" ")),s.removeAttribute("transform"),!1!==e.copyStyles){const t=n.ownerDocument,e=Array.from(n.querySelectorAll("*")),i=Array.from(r.querySelectorAll("*")),s=t.styleSheets.length,a=[];for(let n=s-1;n>=0;n-=1)a[n]=t.styleSheets[n],t.styleSheets[n].disabled=!0;const l={};e.forEach((t,e)=>{const n=window.getComputedStyle(t,null),i={};Object.keys(n).forEach(t=>{i[t]=n.getPropertyValue(t)}),l[e]=i}),s!==t.styleSheets.length&&a.forEach((e,n)=>{t.styleSheets[n]=e});for(let n=0;n<s;n+=1)t.styleSheets[n].disabled=!1;const h={};e.forEach((t,e)=>{const n=window.getComputedStyle(t,null),i=l[e],r={};Object.keys(n).forEach(t=>{o.isNumeric(t)||n.getPropertyValue(t)===i[t]||(r[t]=n.getPropertyValue(t))}),h[e]=r}),i.forEach((t,e)=>{P()(t).css(h[e])})}const c=e.stylesheet;if("string"===typeof c){const t=n.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(c);i.prepend(Mv.create("style",{type:"text/css"},[t]))}const u=()=>{const n=e.beforeSerialize;if("function"===typeof n){const t=a.call(n,this.graph,r);t instanceof SVGSVGElement&&(r=t)}const i=(new XMLSerializer).serializeToString(r).replace(/ /g," ");this.graph.trigger("after:export",e),t(i)};if(e.serializeImages){const t=i.find("image").map(t=>new Promise(e=>{const n=t.attr("xlink:href")||t.attr("href");SC.imageToDataUri(n,(n,i)=>{!n&&i&&t.attr("xlink:href",i),e()})}));Promise.all(t).then(u)}else u()}toDataURL(t,e){let n=e.viewBox||this.graph.getContentBBox();const i=o.normalizeSides(e.padding);e.width&&e.height&&(i.left+i.right>=e.width&&(i.left=i.right=0),i.top+i.bottom>=e.height&&(i.top=i.bottom=0));const r=new KC(-i.left,-i.top,i.left+i.right,i.top+i.bottom);if(e.width&&e.height){const t=n.width+i.left+i.right,s=n.height+i.top+i.bottom;r.scale(t/e.width,s/e.height)}n=KC.create(n).moveAndExpand(r);const s="number"===typeof e.width&&"number"===typeof e.height?{width:e.width,height:e.height}:n;let a=e.ratio?parseFloat(e.ratio):1;Number.isFinite(a)&&0!==a||(a=1);const l={width:Math.max(Math.round(s.width*a),1),height:Math.max(Math.round(s.height*a),1)};{const t=document.createElement("canvas"),e=t.getContext("2d");t.width=l.width,t.height=l.height;const n=l.width-1,i=l.height-1;e.fillStyle="rgb(1,1,1)",e.fillRect(n,i,1,1);const r=e.getImageData(n,i,1,1).data;if(1!==r[0]||1!==r[1]||1!==r[2])throw new Error("size exceeded")}const h=new Image;h.onload=()=>{const n=document.createElement("canvas");n.width=l.width,n.height=l.height;const i=n.getContext("2d");i.fillStyle=e.backgroundColor||"white",i.fillRect(0,0,l.width,l.height);try{i.drawImage(h,0,0,l.width,l.height);const r=n.toDataURL(e.type,e.quality);t(r)}catch(r){}},this.toSVG(t=>{h.src="data:image/svg+xml,"+encodeURIComponent(t)},Object.assign(Object.assign({},e),{viewBox:n,serializeImages:!0,preserveDimensions:Object.assign({},l)}))}toPNG(t,e={}){this.toDataURL(t,Object.assign(Object.assign({},e),{type:"image/png"}))}toJPEG(t,e={}){this.toDataURL(t,Object.assign(Object.assign({},e),{type:"image/jpeg"}))}}class Vk extends wP{constructor(){super(...arguments),this.widgets=new Map}get isSelectionEnabled(){return!0===this.options.selecting.enabled}init(){this.startListening()}startListening(){this.graph.on("node:mouseup",this.onNodeMouseUp,this),this.graph.on("node:selected",this.onNodeSelected,this),this.graph.on("node:unselected",this.onNodeUnSelected,this)}stopListening(){this.graph.off("node:mouseup",this.onNodeMouseUp,this),this.graph.off("node:selected",this.onNodeSelected,this),this.graph.off("node:unselected",this.onNodeUnSelected,this)}onNodeMouseUp({node:t}){if(!this.isSelectionEnabled){const e=this.graph.hook.createKnob(t,{clearAll:!0});e&&this.widgets.set(t,e)}}onNodeSelected({node:t}){if(this.isSelectionEnabled){const e=this.graph.hook.createKnob(t,{clearAll:!1});e&&this.widgets.set(t,e)}}onNodeUnSelected({node:t}){if(this.isSelectionEnabled){const e=this.widgets.get(t);e&&e.forEach(t=>t.dispose()),this.widgets.delete(t)}}}var $k=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class Gk extends wP{get widgetOptions(){return this.options.panning}get pannable(){return this.widgetOptions&&!0===this.widgetOptions.enabled}init(){this.startListening(),this.updateClassName()}startListening(){const t=this.widgetOptions.eventTypes;t&&(t.includes("leftMouseDown")&&(this.graph.on("blank:mousedown",this.preparePanning,this),this.graph.on("node:unhandled:mousedown",this.preparePanning,this),this.graph.on("edge:unhandled:mousedown",this.preparePanning,this)),t.includes("rightMouseDown")&&(this.onRightMouseDown=this.onRightMouseDown.bind(this),this.view.$(this.graph.container).on("mousedown",this.onRightMouseDown)),t.includes("mouseWheel")&&(this.mousewheelHandle=new h.MouseWheelHandle(this.graph.container,this.onMouseWheel.bind(this),this.allowMouseWheel.bind(this)),this.mousewheelHandle.enable()))}stopListening(){const t=this.widgetOptions.eventTypes;t&&(t.includes("leftMouseDown")&&(this.graph.off("blank:mousedown",this.preparePanning,this),this.graph.off("node:unhandled:mousedown",this.preparePanning,this),this.graph.off("edge:unhandled:mousedown",this.preparePanning,this)),t.includes("rightMouseDown")&&this.view.$(this.graph.container).off("mousedown",this.onRightMouseDown),t.includes("mouseWheel")&&this.mousewheelHandle&&this.mousewheelHandle.disable())}preparePanning({e:t}){(this.allowPanning(t,!0)||this.allowPanning(t)&&!this.graph.selection.allowRubberband(t,!0))&&this.startPanning(t)}allowPanning(t,e){return this.pannable&&uk.isMatch(t,this.widgetOptions.modifiers,e)&&this.graph.hook.allowPanning(t)}startPanning(t){const e=this.view.normalizeEvent(t);this.clientX=e.clientX,this.clientY=e.clientY,this.panning=!0,this.updateClassName(),this.view.$(document.body).on({"mousemove.panning touchmove.panning":this.pan.bind(this),"mouseup.panning touchend.panning":this.stopPanning.bind(this),"mouseleave.panning":this.stopPanning.bind(this)}),this.view.$(window).on("mouseup.panning",this.stopPanning.bind(this))}pan(t){const e=this.view.normalizeEvent(t),n=e.clientX-this.clientX,i=e.clientY-this.clientY;this.clientX=e.clientX,this.clientY=e.clientY;const r=this.graph.transform.getTranslation(),s=r.tx+n,o=r.ty+i;this.graph.transform.translate(s,o,{ui:!0})}stopPanning(t){this.panning=!1,this.updateClassName(),this.view.$(document.body).off(".panning"),this.view.$(window).off(".panning")}updateClassName(){const t=this.view.container,e=this.view.prefixClassName("graph-panning"),n=this.view.prefixClassName("graph-pannable");this.pannable?this.panning?(h.addClass(t,e),h.removeClass(t,n)):(h.removeClass(t,e),h.addClass(t,n)):(h.removeClass(t,e),h.removeClass(t,n))}onRightMouseDown(t){2===t.button&&this.allowPanning(t,!0)&&this.startPanning(t)}allowMouseWheel(t){return this.pannable&&!t.ctrlKey}onMouseWheel(t,e,n){t.ctrlKey||this.graph.translateBy(-e,-n)}autoPanning(t,e){const n=10,i=this.graph.getGraphArea();let r=0,s=0;t<=i.left+n&&(r=-n),e<=i.top+n&&(s=-n),t>=i.right-n&&(r=n),e>=i.bottom-n&&(s=n),0===r&&0===s||this.graph.translateBy(-r,-s)}enablePanning(){this.pannable||(this.widgetOptions.enabled=!0,this.updateClassName())}disablePanning(){this.pannable&&(this.widgetOptions.enabled=!1,this.updateClassName())}dispose(){this.stopListening()}}$k([wP.dispose()],Gk.prototype,"dispose",null);var _k=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class Hk extends wP{hasScroller(){return null!=this.graph.scroller.widget}getContainer(){return this.hasScroller()?this.graph.scroller.widget.container:this.graph.container}init(){const t=this.options.autoResize;if(t){const e="boolean"===typeof t?this.getContainer():t;Vw.bind(e,()=>{const t=this.getContainer(),e=t.offsetWidth,n=t.offsetHeight;this.resize(e,n)})}}resize(t,e){this.hasScroller()?this.resizeScroller(t,e):this.resizeGraph(t,e)}resizeGraph(t,e){this.graph.transform.resize(t,e)}resizeScroller(t,e){this.graph.scroller.resize(t,e)}resizePage(t,e){const n=this.graph.scroller.widget;n&&n.updatePageSize(t,e)}dispose(){Vw.clear(this.getContainer())}}_k([wP.dispose()],Hk.prototype,"dispose",null);var Uk,Wk=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Xk=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};(function(t){function e(t,e){return(n,i,r)=>{const s=r.value,o=e||i;r.value=function(...e){const n=this.options[o];if(null!=n){this.getNativeValue=s.bind(this,...e);const i=a.call(n,this.graph,...e);if(this.getNativeValue=null,null!=i||!0===t&&null===i)return i}return s.call(this,...e)}}}function n(t){return(e,n,i)=>{const r=i.value,s=t||n;i.value=function(...t){let e=r.call(this,...t);const n=this.options[s];return null!=n&&(e=a.call(n,this.graph,...t)&&e),e}}}t.hook=e,t.after=n})(Uk||(Uk={}));class qk extends wP{createModel(){if(this.options.model)return this.options.model;const t=new HO;return t.graph=this.graph,t}createView(){return new EP(this.graph)}createRenderer(){return new HP(this.graph)}createDefsManager(){return new ok(this.graph)}createGridManager(){return new hk(this.graph)}createCoordManager(){return new ck(this.graph)}createKnobManager(){return new Vk(this.graph)}createTransform(t,e){const n=this.getTransformOptions(t);return n.resizable||n.rotatable?new nk(Object.assign(Object.assign({node:t,graph:this.graph},n),e)):(n.clearAll&&nk.removeInstances(this.graph),null)}createKnob(t,e){const n=ik.parseOptionGroup(this.graph,t,this.options.knob),i=Object.assign(Object.assign({},n),e);i.clearAll&&FP.removeInstances(this.graph),i.clearAll=!1;const r=t.prop("knob"),s=[],o=Array.isArray(r)?r:[r];return o.forEach((e,r)=>{e&&!1!==e.enabled&&("function"===typeof e.enabled&&!1===e.enabled.call(this.graph,t)||n.enabled&&s.push(new FP(Object.assign({node:t,index:r,graph:this.graph},i))))}),s}getTransformOptions(t){const e=ik.parseOptionGroup(this.graph,t,this.options.resizing),n=ik.parseOptionGroup(this.graph,t,this.options.rotating),i=ik.parseOptionGroup(this.graph,t,this.options.transforming),r=Object.assign(Object.assign({},i),{resizable:e.enabled,minWidth:e.minWidth,maxWidth:e.maxWidth,minHeight:e.minHeight,maxHeight:e.maxHeight,orthogonalResizing:e.orthogonal,restrictedResizing:null!=e.restrict?e.restrict:e.restricted,autoScrollOnResizing:e.autoScroll,preserveAspectRatio:e.preserveAspectRatio,allowReverse:e.allowReverse,rotatable:n.enabled,rotateGrid:n.grid});return r}createTransformManager(){return new xk(this.graph)}createHighlightManager(){return new vk(this.graph)}createBackgroundManager(){return new WP(this.graph)}createClipboard(){return new Qk}createClipboardManager(){return new yk(this.graph)}createSnapline(){return new GP(Object.assign({graph:this.graph},this.options.snapline))}createSnaplineManager(){return new gk(this.graph)}createSelection(){return new ek(Object.assign({graph:this.graph},this.options.selecting))}createSelectionManager(){return new Ek(this.graph)}allowRubberband(t){return!0}createHistoryManager(){return new Pk(Object.assign({graph:this.graph},this.options.history))}createScroller(){return this.options.scroller.enabled?new JP(Object.assign({graph:this.graph},this.options.scroller)):null}createScrollerManager(){return new fk(this.graph)}allowPanning(t){return!0}createMiniMap(){const t=this.options.minimap,{enabled:e}=t,n=Xk(t,["enabled"]);return e?new IP(Object.assign({graph:this.graph},n)):null}createMiniMapManager(){return new Dk(this.graph)}createKeyboard(){return new Lk(Object.assign({graph:this.graph},this.options.keyboard))}createMouseWheel(){return new zk(Object.assign({graph:this.graph},this.options.mousewheel))}createPrintManager(){return new Rk(this.graph)}createFormatManager(){return new Ik(this.graph)}createPanningManager(){return new Gk(this.graph)}createSizeManager(){return new Hk(this.graph)}allowConnectToBlank(t){const e=this.options.connecting,n=null!=e.allowBlank?e.allowBlank:e.dangling;if("function"!==typeof n)return!!n;const i=this.graph.findViewByCell(t),r=t.getSourceCell(),s=t.getTargetCell(),o=this.graph.findViewByCell(r),l=this.graph.findViewByCell(s);return a.call(n,this.graph,{edge:t,edgeView:i,sourceCell:r,targetCell:s,sourceView:o,targetView:l,sourcePort:t.getSourcePortId(),targetPort:t.getTargetPortId(),sourceMagnet:i.sourceMagnet,targetMagnet:i.targetMagnet})}validateEdge(t,e,n){if(!this.allowConnectToBlank(t)){const e=t.getSourceCellId(),n=t.getTargetCellId();if(!e||!n)return!1}const i=this.options.connecting.validateEdge;return!i||a.call(i,this.graph,{edge:t,type:e,previous:n})}validateMagnet(t,e,n){if("passive"!==e.getAttribute("magnet")){const i=this.options.connecting.validateMagnet;return!i||a.call(i,this.graph,{e:n,magnet:e,view:t,cell:t.cell})}return!1}getDefaultEdge(t,e){let n;const i=this.options.connecting.createEdge;return i&&(n=a.call(i,this.graph,{sourceMagnet:e,sourceView:t,sourceCell:t.cell})),null==n&&(n=new fP),n}validateConnection(t,e,n,i,r,s,o){const l=this.options.connecting,h=l.allowLoop,c=l.allowNode,u=l.allowEdge,d=l.allowPort,g=null!=l.allowMulti?l.allowMulti:l.multi,p=l.validateConnection,f=s?s.cell:null,m="target"===r?n:t,b="target"===r?i:e;let y=!0;const C=l=>{const h="source"===r?o?o.port:null:f?f.getSourcePortId():null,c="target"===r?o?o.port:null:f?f.getTargetPortId():null;return a.call(l,this.graph,{edge:f,edgeView:s,sourceView:t,targetView:n,sourcePort:h,targetPort:c,sourceMagnet:e,targetMagnet:i,sourceCell:t?t.cell:null,targetCell:n?n.cell:null,type:r})};if(null!=h&&("boolean"===typeof h?h||t!==n||(y=!1):y=C(h)),y&&null!=d&&("boolean"===typeof d?!d&&b&&(y=!1):y=C(d)),y&&null!=u&&("boolean"===typeof u?!u&&IO.isEdgeView(m)&&(y=!1):y=C(u)),y&&null!=c&&null==b&&("boolean"===typeof c?!c&&VO.isNodeView(m)&&(y=!1):y=C(c)),y&&null!=g&&s){const t=s.cell,e="source"===r?o:t.getSource(),n="target"===r?o:t.getTarget(),i=o?this.graph.getCellById(o.cell):null;if(e&&n&&e.cell&&n.cell&&i)if("function"===typeof g)y=C(g);else{const t=this.model.getConnectedEdges(i,{outgoing:"source"===r,incoming:"target"===r});if(t.length)if("withPort"===g){const i=t.some(t=>{const i=t.getSource(),r=t.getTarget();return i&&r&&i.cell===e.cell&&r.cell===n.cell&&null!=i.port&&i.port===e.port&&null!=r.port&&r.port===n.port});i&&(y=!1)}else if(!g){const i=t.some(t=>{const i=t.getSource(),r=t.getTarget();return i&&r&&i.cell===e.cell&&r.cell===n.cell});i&&(y=!1)}}}return y&&null!=p&&(y=C(p)),y}getRestrictArea(t){const e=this.options.translating.restrict,n="function"===typeof e?a.call(e,this.graph,t):e;return"number"===typeof n?this.graph.transform.getGraphArea().inflate(n):!0===n?this.graph.transform.getGraphArea():n||null}onViewUpdated(t,e,n){e&HP.FLAG_INSERT||n.mounting||this.graph.renderer.requestConnectedEdgesUpdate(t,n)}onViewPostponed(t,e,n){return this.graph.renderer.forcePostponedViewUpdate(t,e)}getCellView(t){return null}createCellView(t){const e={graph:this.graph},n=this.getCellView(t);if(n)return new n(t,e);const i=t.view;if(null!=i&&"string"===typeof i){const n=lA.registry.get(i);return n?new n(t,e):lA.registry.onNotFound(i)}return t.isNode()?new VO(t,e):t.isEdge()?new IO(t,e):null}getHTMLComponent(t){let e=t.getHTML();return"string"===typeof e&&(e=yP.componentRegistry.get(e)||e),r.isPlainObject(e)&&(e=e.render),"function"===typeof e?a.call(e,this.graph,t):e}shouldUpdateHTMLComponent(t){let e=t.getHTML();if("string"===typeof e&&(e=yP.componentRegistry.get(e)||e),r.isPlainObject(e)){const n=e.shouldComponentUpdate;return"function"===typeof n?a.call(n,this.graph,t):!!n}return!1}onEdgeLabelRendered(t){}onPortRendered(t){}onToolItemCreated(t){}}Wk([Uk.hook()],qk.prototype,"createModel",null),Wk([Uk.hook()],qk.prototype,"createView",null),Wk([Uk.hook()],qk.prototype,"createRenderer",null),Wk([Uk.hook()],qk.prototype,"createDefsManager",null),Wk([Uk.hook()],qk.prototype,"createGridManager",null),Wk([Uk.hook()],qk.prototype,"createCoordManager",null),Wk([Uk.hook()],qk.prototype,"createKnobManager",null),Wk([Uk.hook()],qk.prototype,"createTransform",null),Wk([Uk.hook()],qk.prototype,"createKnob",null),Wk([Uk.hook()],qk.prototype,"createTransformManager",null),Wk([Uk.hook()],qk.prototype,"createHighlightManager",null),Wk([Uk.hook()],qk.prototype,"createBackgroundManager",null),Wk([Uk.hook()],qk.prototype,"createClipboard",null),Wk([Uk.hook()],qk.prototype,"createClipboardManager",null),Wk([Uk.hook()],qk.prototype,"createSnapline",null),Wk([Uk.hook()],qk.prototype,"createSnaplineManager",null),Wk([Uk.hook()],qk.prototype,"createSelection",null),Wk([Uk.hook()],qk.prototype,"createSelectionManager",null),Wk([Uk.hook()],qk.prototype,"allowRubberband",null),Wk([Uk.hook()],qk.prototype,"createHistoryManager",null),Wk([Uk.hook()],qk.prototype,"createScroller",null),Wk([Uk.hook()],qk.prototype,"createScrollerManager",null),Wk([Uk.hook()],qk.prototype,"allowPanning",null),Wk([Uk.hook()],qk.prototype,"createMiniMap",null),Wk([Uk.hook()],qk.prototype,"createMiniMapManager",null),Wk([Uk.hook()],qk.prototype,"createKeyboard",null),Wk([Uk.hook()],qk.prototype,"createMouseWheel",null),Wk([Uk.hook()],qk.prototype,"createPrintManager",null),Wk([Uk.hook()],qk.prototype,"createFormatManager",null),Wk([Uk.hook()],qk.prototype,"createPanningManager",null),Wk([Uk.hook()],qk.prototype,"createSizeManager",null),Wk([Uk.after()],qk.prototype,"onViewUpdated",null),Wk([Uk.after()],qk.prototype,"onViewPostponed",null),Wk([Uk.hook()],qk.prototype,"getCellView",null),Wk([Uk.hook(!0)],qk.prototype,"createCellView",null),Wk([Uk.hook()],qk.prototype,"getHTMLComponent",null),Wk([Uk.hook()],qk.prototype,"shouldUpdateHTMLComponent",null),Wk([Uk.hook()],qk.prototype,"onEdgeLabelRendered",null),Wk([Uk.hook()],qk.prototype,"onPortRendered",null),Wk([Uk.hook()],qk.prototype,"onToolItemCreated",null);var Yk,Jk,Zk=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class Kk extends RE{constructor(t){super(),this.options=ik.get(t),this.css=new OP(this),this.hook=new qk(this),this.view=this.hook.createView(),this.defs=this.hook.createDefsManager(),this.coord=this.hook.createCoordManager(),this.transform=this.hook.createTransformManager(),this.knob=this.hook.createKnobManager(),this.highlight=this.hook.createHighlightManager(),this.grid=this.hook.createGridManager(),this.background=this.hook.createBackgroundManager(),this.model=this.hook.createModel(),this.renderer=this.hook.createRenderer(),this.clipboard=this.hook.createClipboardManager(),this.snapline=this.hook.createSnaplineManager(),this.selection=this.hook.createSelectionManager(),this.history=this.hook.createHistoryManager(),this.scroller=this.hook.createScrollerManager(),this.minimap=this.hook.createMiniMapManager(),this.keyboard=this.hook.createKeyboard(),this.mousewheel=this.hook.createMouseWheel(),this.print=this.hook.createPrintManager(),this.format=this.hook.createFormatManager(),this.panning=this.hook.createPanningManager(),this.size=this.hook.createSizeManager()}get container(){return this.view.container}get[Symbol.toStringTag](){return Kk.toStringTag}isNode(t){return t.isNode()}isEdge(t){return t.isEdge()}resetCells(t,e={}){return this.model.resetCells(t,e),this}clearCells(t={}){return this.model.clear(t),this}toJSON(t={}){return this.model.toJSON(t)}parseJSON(t){return this.model.parseJSON(t)}fromJSON(t,e={}){return this.model.fromJSON(t,e),this}getCellById(t){return this.model.getCell(t)}addNode(t,e={}){return this.model.addNode(t,e)}addNodes(t,e={}){return this.addCell(t.map(t=>SO.isNode(t)?t:this.createNode(t)),e)}createNode(t){return this.model.createNode(t)}removeNode(t,e={}){return this.model.removeCell(t,e)}addEdge(t,e={}){return this.model.addEdge(t,e)}addEdges(t,e={}){return this.addCell(t.map(t=>BO.isEdge(t)?t:this.createEdge(t)),e)}removeEdge(t,e={}){return this.model.removeCell(t,e)}createEdge(t){return this.model.createEdge(t)}addCell(t,e={}){return this.model.addCell(t,e),this}removeCell(t,e={}){return this.model.removeCell(t,e)}removeCells(t,e={}){return this.model.removeCells(t,e)}removeConnectedEdges(t,e={}){return this.model.removeConnectedEdges(t,e)}disconnectConnectedEdges(t,e={}){return this.model.disconnectConnectedEdges(t,e),this}hasCell(t){return this.model.has(t)}getCell(t){return this.model.getCell(t)}getCells(){return this.model.getCells()}getCellCount(){return this.model.total()}getNodes(){return this.model.getNodes()}getEdges(){return this.model.getEdges()}getOutgoingEdges(t){return this.model.getOutgoingEdges(t)}getIncomingEdges(t){return this.model.getIncomingEdges(t)}getConnectedEdges(t,e={}){return this.model.getConnectedEdges(t,e)}getRootNodes(){return this.model.getRoots()}getLeafNodes(){return this.model.getLeafs()}isRootNode(t){return this.model.isRoot(t)}isLeafNode(t){return this.model.isLeaf(t)}getNeighbors(t,e={}){return this.model.getNeighbors(t,e)}isNeighbor(t,e,n={}){return this.model.isNeighbor(t,e,n)}getSuccessors(t,e={}){return this.model.getSuccessors(t,e)}isSuccessor(t,e,n={}){return this.model.isSuccessor(t,e,n)}getPredecessors(t,e={}){return this.model.getPredecessors(t,e)}isPredecessor(t,e,n={}){return this.model.isPredecessor(t,e,n)}getCommonAncestor(...t){return this.model.getCommonAncestor(...t)}getSubGraph(t,e={}){return this.model.getSubGraph(t,e)}cloneSubGraph(t,e={}){return this.model.cloneSubGraph(t,e)}cloneCells(t){return this.model.cloneCells(t)}getNodesFromPoint(t,e){return this.model.getNodesFromPoint(t,e)}getNodesInArea(t,e,n,i,r){return this.model.getNodesInArea(t,e,n,i,r)}getNodesUnderNode(t,e={}){return this.model.getNodesUnderNode(t,e)}searchCell(t,e,n={}){return this.model.search(t,e,n),this}getShortestPath(t,e,n={}){return this.model.getShortestPath(t,e,n)}getAllCellsBBox(){return this.model.getAllCellsBBox()}getCellsBBox(t,e={}){return this.model.getCellsBBox(t,e)}startBatch(t,e={}){this.model.startBatch(t,e)}stopBatch(t,e={}){this.model.stopBatch(t,e)}batchUpdate(t,e,n){const i="string"===typeof t?t:"update",r="string"===typeof t?e:t,s="function"===typeof e?n:e;this.startBatch(i,s);const o=r();return this.stopBatch(i,s),o}updateCellId(t,e){return this.model.updateCellId(t,e)}isFrozen(){return this.renderer.isFrozen()}freeze(t={}){return this.renderer.freeze(t),this}unfreeze(t={}){return this.renderer.unfreeze(t),this}isAsync(){return this.renderer.isAsync()}setAsync(t){return this.renderer.setAsync(t),this}findView(t){return MO.isCell(t)?this.findViewByCell(t):this.findViewByElem(t)}findViews(t){return KC.isRectangleLike(t)?this.findViewsInArea(t):ZC.isPointLike(t)?this.findViewsFromPoint(t):[]}findViewByCell(t){return this.renderer.findViewByCell(t)}findViewByElem(t){return this.renderer.findViewByElem(t)}findViewsFromPoint(t,e){const n="number"===typeof t?{x:t,y:e}:t;return this.renderer.findViewsFromPoint(n)}findViewsInArea(t,e,n,i,r){const s="number"===typeof t?{x:t,y:e,width:n,height:i}:t,o="number"===typeof t?r:e;return this.renderer.findViewsInArea(s,o)}isViewMounted(t){return this.renderer.isViewMounted(t)}getMountedViews(){return this.renderer.getMountedViews()}getUnmountedViews(){return this.renderer.getUnmountedViews()}matrix(t){return"undefined"===typeof t?this.transform.getMatrix():(this.transform.setMatrix(t),this)}resize(t,e){return this.size.resize(t,e),this}resizeGraph(t,e){return this.size.resizeGraph(t,e),this}resizeScroller(t,e){return this.size.resizeScroller(t,e),this}resizePage(t,e){return this.size.resizePage(t,e),this}scale(t,e=t,n=0,i=0){return"undefined"===typeof t?this.transform.getScale():(this.transform.scale(t,e,n,i),this)}zoom(t,e){const n=this.scroller.widget;if(n){if("undefined"===typeof t)return n.zoom();n.zoom(t,e)}else{if("undefined"===typeof t)return this.transform.getZoom();this.transform.zoom(t,e)}return this}zoomTo(t,e={}){const n=this.scroller.widget;return n?n.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})):this.transform.zoom(t,Object.assign(Object.assign({},e),{absolute:!0})),this}zoomToRect(t,e={}){const n=this.scroller.widget;return n?n.zoomToRect(t,e):this.transform.zoomToRect(t,e),this}zoomToFit(t={}){const e=this.scroller.widget;return e?e.zoomToFit(t):this.transform.zoomToFit(t),this}rotate(t,e,n){return"undefined"===typeof t?this.transform.getRotation():(this.transform.rotate(t,e,n),this)}translate(t,e){return"undefined"===typeof t?this.transform.getTranslation():(this.transform.translate(t,e),this)}translateBy(t,e){const n=this.translate(),i=n.tx+t,r=n.ty+e;return this.translate(i,r)}getArea(){return this.transform.getGraphArea()}getGraphArea(){return this.transform.getGraphArea()}getContentArea(t={}){return this.transform.getContentArea(t)}getContentBBox(t={}){return this.transform.getContentBBox(t)}fitToContent(t,e,n,i){return this.transform.fitToContent(t,e,n,i)}scaleContentToFit(t={}){return this.transform.scaleContentToFit(t),this}center(t){return this.centerPoint(t)}centerPoint(t,e,n){const i=this.scroller.widget;return i?i.centerPoint(t,e,n):this.transform.centerPoint(t,e),this}centerContent(t){const e=this.scroller.widget;return e?e.centerContent(t):this.transform.centerContent(t),this}centerCell(t,e){const n=this.scroller.widget;return n?n.centerCell(t,e):this.transform.centerCell(t),this}positionPoint(t,e,n,i={}){const r=this.scroller.widget;return r?r.positionPoint(t,e,n,i):this.transform.positionPoint(t,e,n),this}positionRect(t,e,n){const i=this.scroller.widget;return i?i.positionRect(t,e,n):this.transform.positionRect(t,e),this}positionCell(t,e,n){const i=this.scroller.widget;return i?i.positionCell(t,e,n):this.transform.positionCell(t,e),this}positionContent(t,e){const n=this.scroller.widget;return n?n.positionContent(t,e):this.transform.positionContent(t,e),this}getClientMatrix(){return this.coord.getClientMatrix()}getClientOffset(){return this.coord.getClientOffset()}getPageOffset(){return this.coord.getPageOffset()}snapToGrid(t,e){return this.coord.snapToGrid(t,e)}pageToLocal(t,e,n,i){return KC.isRectangleLike(t)?this.coord.pageToLocalRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof i?this.coord.pageToLocalRect(t,e,n,i):this.coord.pageToLocalPoint(t,e)}localToPage(t,e,n,i){return KC.isRectangleLike(t)?this.coord.localToPageRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof i?this.coord.localToPageRect(t,e,n,i):this.coord.localToPagePoint(t,e)}clientToLocal(t,e,n,i){return KC.isRectangleLike(t)?this.coord.clientToLocalRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof i?this.coord.clientToLocalRect(t,e,n,i):this.coord.clientToLocalPoint(t,e)}localToClient(t,e,n,i){return KC.isRectangleLike(t)?this.coord.localToClientRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof i?this.coord.localToClientRect(t,e,n,i):this.coord.localToClientPoint(t,e)}localToGraph(t,e,n,i){return KC.isRectangleLike(t)?this.coord.localToGraphRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof i?this.coord.localToGraphRect(t,e,n,i):this.coord.localToGraphPoint(t,e)}graphToLocal(t,e,n,i){return KC.isRectangleLike(t)?this.coord.graphToLocalRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof i?this.coord.graphToLocalRect(t,e,n,i):this.coord.graphToLocalPoint(t,e)}clientToGraph(t,e,n,i){return KC.isRectangleLike(t)?this.coord.clientToGraphRect(t):"number"===typeof t&&"number"===typeof e&&"number"===typeof n&&"number"===typeof i?this.coord.clientToGraphRect(t,e,n,i):this.coord.clientToGraphPoint(t,e)}defineFilter(t){return this.defs.filter(t)}defineGradient(t){return this.defs.gradient(t)}defineMarker(t){return this.defs.marker(t)}getGridSize(){return this.grid.getGridSize()}setGridSize(t){return this.grid.setGridSize(t),this}showGrid(){return this.grid.show(),this}hideGrid(){return this.grid.hide(),this}clearGrid(){return this.grid.clear(),this}drawGrid(t){return this.grid.draw(t),this}updateBackground(){return this.background.update(),this}drawBackground(t,e){const n=this.scroller.widget;return null==n||null!=this.options.background&&e?this.background.draw(t):n.backgroundManager.draw(t),this}clearBackground(t){const e=this.scroller.widget;return null==e||null!=this.options.background&&t?this.background.clear():e.backgroundManager.clear(),this}isClipboardEnabled(){return!this.clipboard.disabled}enableClipboard(){return this.clipboard.enable(),this}disableClipboard(){return this.clipboard.disable(),this}toggleClipboard(t){return null!=t?t!==this.isClipboardEnabled()&&(t?this.enableClipboard():this.disableClipboard()):this.isClipboardEnabled()?this.disableClipboard():this.enableClipboard(),this}isClipboardEmpty(){return this.clipboard.isEmpty()}getCellsInClipboard(){return this.clipboard.cells}cleanClipboard(){return this.clipboard.clean(),this}copy(t,e={}){return this.clipboard.copy(t,e),this}cut(t,e={}){return this.clipboard.cut(t,e),this}paste(t={},e=this){return this.clipboard.paste(t,e)}isHistoryEnabled(){return!this.history.disabled}enableHistory(){return this.history.enable(),this}disableHistory(){return this.history.disable(),this}toggleHistory(t){return null!=t?t!==this.isHistoryEnabled()&&(t?this.enableHistory():this.disableHistory()):this.isHistoryEnabled()?this.disableHistory():this.enableHistory(),this}undo(t={}){return this.history.undo(t),this}undoAndCancel(t={}){return this.history.cancel(t),this}redo(t={}){return this.history.redo(t),this}canUndo(){return this.history.canUndo()}canRedo(){return this.history.canRedo()}cleanHistory(t={}){this.history.clean(t)}isKeyboardEnabled(){return!this.keyboard.disabled}enableKeyboard(){return this.keyboard.enable(),this}disableKeyboard(){return this.keyboard.disable(),this}toggleKeyboard(t){return null!=t?t!==this.isKeyboardEnabled()&&(t?this.enableKeyboard():this.disableKeyboard()):this.isKeyboardEnabled()?this.disableKeyboard():this.enableKeyboard(),this}bindKey(t,e,n){return this.keyboard.on(t,e,n),this}unbindKey(t,e){return this.keyboard.off(t,e),this}isMouseWheelEnabled(){return!this.mousewheel.disabled}enableMouseWheel(){return this.mousewheel.enable(),this}disableMouseWheel(){return this.mousewheel.disable(),this}toggleMouseWheel(t){return null==t?this.isMouseWheelEnabled()?this.disableMouseWheel():this.enableMouseWheel():t?this.enableMouseWheel():this.disableMouseWheel(),this}isPannable(){const t=this.scroller.widget;return t?this.scroller.pannable:this.panning.pannable}enablePanning(){const t=this.scroller.widget;return t?this.scroller.enablePanning():this.panning.enablePanning(),this}disablePanning(){const t=this.scroller.widget;return t?this.scroller.disablePanning():this.panning.disablePanning(),this}togglePanning(t){return null==t?this.isPannable()?this.disablePanning():this.enablePanning():t!==this.isPannable()&&(t?this.enablePanning():this.disablePanning()),this}lockScroller(){var t;null===(t=this.scroller.widget)||void 0===t||t.lock()}unlockScroller(){var t;null===(t=this.scroller.widget)||void 0===t||t.unlock()}updateScroller(){var t;null===(t=this.scroller.widget)||void 0===t||t.update()}getScrollbarPosition(){const t=this.scroller.widget;return t.scrollbarPosition()}setScrollbarPosition(t,e,n){const i=this.scroller.widget;return i.scrollbarPosition(t,e,n),this}scrollToPoint(t,e,n){const i=this.scroller.widget;return i.scrollToPoint(t,e,n),this}scrollToContent(t){const e=this.scroller.widget;return e.scrollToContent(t),this}scrollToCell(t,e){const n=this.scroller.widget;return n.scrollToCell(t,e),this}transitionToPoint(t,e,n){const i=this.scroller.widget;return i.transitionToPoint(t,e,n),this}transitionToRect(t,e={}){const n=this.scroller.widget;return n.transitionToRect(t,e),this}isSelectionEnabled(){return!this.selection.disabled}enableSelection(){return this.selection.enable(),this}disableSelection(){return this.selection.disable(),this}toggleSelection(t){return null!=t?t!==this.isSelectionEnabled()&&(t?this.enableSelection():this.disableSelection()):this.isSelectionEnabled()?this.disableSelection():this.enableSelection(),this}isMultipleSelection(){return this.selection.isMultiple()}enableMultipleSelection(){return this.selection.enableMultiple(),this}disableMultipleSelection(){return this.selection.disableMultiple(),this}toggleMultipleSelection(t){return null!=t?t!==this.isMultipleSelection()&&(t?this.enableMultipleSelection():this.disableMultipleSelection()):this.isMultipleSelection()?this.disableMultipleSelection():this.enableMultipleSelection(),this}isSelectionMovable(){return!1!==this.selection.widget.options.movable}enableSelectionMovable(){return this.selection.widget.options.movable=!0,this}disableSelectionMovable(){return this.selection.widget.options.movable=!1,this}toggleSelectionMovable(t){return null!=t?t!==this.isSelectionMovable()&&(t?this.enableSelectionMovable():this.disableSelectionMovable()):this.isSelectionMovable()?this.disableSelectionMovable():this.enableSelectionMovable(),this}isRubberbandEnabled(){return!this.selection.rubberbandDisabled}enableRubberband(){return this.selection.enableRubberband(),this}disableRubberband(){return this.selection.disableRubberband(),this}toggleRubberband(t){return null!=t?t!==this.isRubberbandEnabled()&&(t?this.enableRubberband():this.disableRubberband()):this.isRubberbandEnabled()?this.disableRubberband():this.enableRubberband(),this}isStrictRubberband(){return!0===this.selection.widget.options.strict}enableStrictRubberband(){return this.selection.widget.options.strict=!0,this}disableStrictRubberband(){return this.selection.widget.options.strict=!1,this}toggleStrictRubberband(t){return null!=t?t!==this.isStrictRubberband()&&(t?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this}setRubberbandModifiers(t){this.selection.setModifiers(t)}setSelectionFilter(t){return this.selection.setFilter(t),this}setSelectionDisplayContent(t){return this.selection.setContent(t),this}isSelectionEmpty(){return this.selection.isEmpty()}cleanSelection(t){return this.selection.clean(t),this}resetSelection(t,e){return this.selection.reset(t,e),this}getSelectedCells(){return this.selection.cells}getSelectedCellCount(){return this.selection.length}isSelected(t){return this.selection.isSelected(t)}select(t,e){return this.selection.select(t,e),this}unselect(t,e){return this.selection.unselect(t,e),this}isSnaplineEnabled(){return!this.snapline.widget.disabled}enableSnapline(){return this.snapline.widget.enable(),this}disableSnapline(){return this.snapline.widget.disable(),this}toggleSnapline(t){if(null==t)return this.isSnaplineEnabled()?this.disableSnapline():this.enableSnapline(),this;t!==this.isSnaplineEnabled()&&(t?this.enableSnapline():this.disableSnapline())}hideSnapline(){return this.snapline.widget.hide(),this}setSnaplineFilter(t){return this.snapline.widget.setFilter(t),this}isSnaplineOnResizingEnabled(){return!0===this.snapline.widget.options.resizing}enableSnaplineOnResizing(){return this.snapline.widget.options.resizing=!0,this}disableSnaplineOnResizing(){return this.snapline.widget.options.resizing=!1,this}toggleSnaplineOnResizing(t){return null!=t?t!==this.isSnaplineOnResizingEnabled()&&(t?this.enableSnaplineOnResizing():this.disableSnaplineOnResizing()):this.isSnaplineOnResizingEnabled()?this.disableSnaplineOnResizing():this.enableSnaplineOnResizing(),this}isSharpSnapline(){return!0===this.snapline.widget.options.sharp}enableSharpSnapline(){return this.snapline.widget.options.sharp=!0,this}disableSharpSnapline(){return this.snapline.widget.options.sharp=!1,this}toggleSharpSnapline(t){return null!=t?t!==this.isSharpSnapline()&&(t?this.enableSharpSnapline():this.disableSharpSnapline()):this.isSharpSnapline()?this.disableSharpSnapline():this.enableSharpSnapline(),this}getSnaplineTolerance(){return this.snapline.widget.options.tolerance}setSnaplineTolerance(t){return this.snapline.widget.options.tolerance=t,this}removeTools(){return this.emit("tools:remove"),this}hideTools(){return this.emit("tools:hide"),this}showTools(){return this.emit("tools:show"),this}toSVG(t,e={}){this.format.toSVG(t,e)}toDataURL(t,e){this.format.toDataURL(t,e)}toPNG(t,e={}){this.format.toPNG(t,e)}toJPEG(t,e={}){this.format.toJPEG(t,e)}printPreview(t){this.print.show(t)}dispose(){this.clearCells(),this.off(),this.css.dispose(),this.hook.dispose(),this.defs.dispose(),this.grid.dispose(),this.coord.dispose(),this.transform.dispose(),this.knob.dispose(),this.highlight.dispose(),this.background.dispose(),this.clipboard.dispose(),this.snapline.dispose(),this.selection.dispose(),this.history.dispose(),this.keyboard.dispose(),this.mousewheel.dispose(),this.print.dispose(),this.format.dispose(),this.minimap.dispose(),this.panning.dispose(),this.scroller.dispose(),this.view.dispose(),this.renderer.dispose(),this.size.dispose()}}Zk([xP.checkScroller()],Kk.prototype,"lockScroller",null),Zk([xP.checkScroller()],Kk.prototype,"unlockScroller",null),Zk([xP.checkScroller()],Kk.prototype,"updateScroller",null),Zk([xP.checkScroller()],Kk.prototype,"getScrollbarPosition",null),Zk([xP.checkScroller()],Kk.prototype,"setScrollbarPosition",null),Zk([xP.checkScroller()],Kk.prototype,"scrollToPoint",null),Zk([xP.checkScroller()],Kk.prototype,"scrollToContent",null),Zk([xP.checkScroller()],Kk.prototype,"scrollToCell",null),Zk([xP.checkScroller()],Kk.prototype,"transitionToPoint",null),Zk([xP.checkScroller()],Kk.prototype,"transitionToRect",null),Zk([RE.dispose()],Kk.prototype,"dispose",null),function(t){t.View=EP,t.Hook=qk,t.Renderer=HP,t.Keyboard=Lk,t.MouseWheel=zk,t.BaseManager=wP,t.DefsManager=ok,t.GridManager=hk,t.CoordManager=ck,t.PrintManager=Rk,t.FormatManager=Ik,t.MiniMapManager=Dk,t.HistoryManager=Pk,t.SnaplineManager=gk,t.ScrollerManager=fk,t.ClipboardManager=yk,t.TransformManager=xk,t.HighlightManager=vk,t.BackgroundManager=WP,t.SelectionManager=Ek}(Kk||(Kk={})),function(t){function e(e){if(null==e)return!1;if(e instanceof t)return!0;const n=e[Symbol.toStringTag],i=e;return(null==n||n===t.toStringTag)&&null!=i.hook&&null!=i.view&&null!=i.model}t.toStringTag="X6."+t.name,t.isGraph=e}(Kk||(Kk={})),function(t){function e(e,n){const i=e instanceof HTMLElement?new t({container:e}):new t(e);return null!=n&&i.fromJSON(n),i}t.render=e}(Kk||(Kk={})),function(t){t.registerNode=SO.registry.register,t.registerEdge=BO.registry.register,t.registerView=lA.registry.register,t.registerAttr=vM.registry.register,t.registerGrid=AM.registry.register,t.registerFilter=IM.registry.register,t.registerNodeTool=AA.registry.register,t.registerEdgeTool=SA.registry.register,t.registerBackground=HM.registry.register,t.registerHighlighter=tE.registry.register,t.registerPortLayout=pE.registry.register,t.registerPortLabelLayout=NE.registry.register,t.registerMarker=iM.registry.register,t.registerRouter=ZS.registry.register,t.registerConnector=fO.registry.register,t.registerAnchor=UA.registry.register,t.registerEdgeAnchor=KA.registry.register,t.registerConnectionPoint=aS.registry.register,t.registerConnectionStrategy=nA.registry.register,t.registerHTMLComponent=yP.componentRegistry.register}(Kk||(Kk={})),function(t){t.unregisterNode=SO.registry.unregister,t.unregisterEdge=BO.registry.unregister,t.unregisterView=lA.registry.unregister,t.unregisterAttr=vM.registry.unregister,t.unregisterGrid=AM.registry.unregister,t.unregisterFilter=IM.registry.unregister,t.unregisterNodeTool=AA.registry.unregister,t.unregisterEdgeTool=SA.registry.unregister,t.unregisterBackground=HM.registry.unregister,t.unregisterHighlighter=tE.registry.unregister,t.unregisterPortLayout=pE.registry.unregister,t.unregisterPortLabelLayout=NE.registry.unregister,t.unregisterMarker=iM.registry.unregister,t.unregisterRouter=ZS.registry.unregister,t.unregisterConnector=fO.registry.unregister,t.unregisterAnchor=UA.registry.unregister,t.unregisterEdgeAnchor=KA.registry.unregister,t.unregisterConnectionPoint=aS.registry.unregister,t.unregisterConnectionStrategy=nA.registry.unregister,t.unregisterHTMLComponent=yP.componentRegistry.unregister}(Kk||(Kk={}));class Qk{constructor(){this.cells=[]}copy(t,e,n={}){this.options=Object.assign({},n);const r=HO.isModel(e)?e:e.model,s=r.cloneSubGraph(t,n);this.cells=i.sortBy(Object.keys(s).map(t=>s[t]),t=>t.isEdge()?2:1),this.serialize(n)}cut(t,e,n={}){this.copy(t,e,n);const i=Kk.isGraph(e)?e.model:e;i.batchUpdate("cut",()=>{t.forEach(t=>t.remove())})}paste(t,e={}){const n=Object.assign(Object.assign({},this.options),e),{offset:i,edgeProps:r,nodeProps:s}=n;let o=20,a=20;i&&(o="number"===typeof i?i:i.dx,a="number"===typeof i?i:i.dy),this.deserialize(n);const l=this.cells;l.forEach(t=>{t.model=null,t.removeProp("zIndex"),(o||a)&&t.translate(o,a),s&&t.isNode()&&t.prop(s),r&&t.isEdge()&&t.prop(r)});const h=Kk.isGraph(t)?t.model:t;return h.batchUpdate("paste",()=>{h.addCells(this.cells)}),this.copy(l,t,e),l}serialize(t){!1!==t.useLocalStorage&&Yk.save(this.cells)}deserialize(t){if(t.useLocalStorage){const t=Yk.fetch();t&&(this.cells=t)}}isEmpty(){return this.cells.length<=0}clean(){this.options={},this.cells=[],Yk.clean()}}(function(t){const e=UM.prefixCls+".clipboard.cells";function n(t){if(window.localStorage){const n=t.map(t=>t.toJSON());localStorage.setItem(e,JSON.stringify(n))}}function i(){if(window.localStorage){const t=localStorage.getItem(e),n=t?JSON.parse(t):[];if(n)return HO.fromJSON(n)}}function r(){window.localStorage&&localStorage.removeItem(e)}t.save=n,t.fetch=i,t.clean=r})(Yk||(Yk={}));class tD{constructor(t){this.halo=t}get options(){return this.halo.options}get graph(){return this.halo.graph}get model(){return this.halo.model}get view(){return this.halo.view}get cell(){return this.halo.cell}get node(){return this.cell}getPresets(){return{className:"type-node",handles:[{name:"remove",position:"nw",events:{mousedown:this.removeCell.bind(this)},icon:null},{name:"resize",position:"se",events:{mousedown:this.startResize.bind(this),mousemove:this.doResize.bind(this),mouseup:this.stopResize.bind(this)},icon:null},{name:"clone",position:"n",events:{mousedown:this.startClone.bind(this),mousemove:this.doClone.bind(this),mouseup:this.stopClone.bind(this)},icon:null},{name:"link",position:"e",events:{mousedown:this.startLink.bind(this),mousemove:this.doLink.bind(this),mouseup:this.stopLink.bind(this)},icon:null},{name:"fork",position:"ne",events:{mousedown:this.startFork.bind(this),mousemove:this.doFork.bind(this),mouseup:this.stopFork.bind(this)},icon:null},{name:"unlink",position:"w",events:{mousedown:this.unlink.bind(this)},icon:null},{name:"rotate",position:"sw",events:{mousedown:this.startRotate.bind(this),mousemove:this.doRotate.bind(this),mouseup:this.stopRotate.bind(this)},icon:null}],bbox(t){if(this.options.useCellGeometry){const e=t.cell;return e.getBBox()}return t.getBBox()},content(t){const e=s.template("x: <%= x %>, y: <%= y %>, width: <%= width %>, height: <%= height %>, angle: <%= angle %>"),n=t.cell,i=n.getBBox();return e({x:Math.floor(i.x),y:Math.floor(i.y),width:Math.floor(i.width),height:Math.floor(i.height),angle:Math.floor(n.getAngle())})},magnet(t){return t.container},tinyThreshold:40,smallThreshold:80,loopEdgePreferredSide:"top",loopEdgeWidth:40,rotateGrid:15,rotateEmbeds:!1}}removeCell(){this.model.removeConnectedEdges(this.cell),this.cell.remove()}startLink({x:t,y:e}){this.halo.startBatch();const n=this.graph,i=this.createEdgeConnectedToSource();i.setTarget({x:t,y:e}),this.model.addEdge(i,{validation:!1,halo:this.halo.cid,async:!1}),n.view.undelegateEvents(),this.edgeView=n.renderer.findViewByCell(i),this.edgeView.prepareArrowheadDragging("target",{x:t,y:e,fallbackAction:"remove"})}createEdgeConnectedToSource(){const t=this.getMagnet(this.view,"source"),e=this.getEdgeTerminal(this.view,t),n=this.graph.hook.getDefaultEdge(this.view,t);return n.setSource(e),n}getMagnet(t,e){const n=this.options.magnet;if("function"===typeof n){const i=a.call(n,this.halo,t,e);if(i instanceof SVGElement)return i}throw new Error("`magnet()` has to return an SVGElement")}getEdgeTerminal(t,e){const n={cell:t.cell.id};if(e!==t.container){const i=e.getAttribute("port");i?n.port=i:n.selector=t.getSelector(e)}return n}doLink({e:t,x:e,y:n}){this.edgeView&&this.edgeView.onMouseMove(t,e,n)}stopLink({e:t,x:e,y:n}){const i=this.edgeView;if(i){i.onMouseUp(t,e,n);const r=i.cell;r.hasLoop()&&this.makeLoopEdge(r),this.halo.stopBatch(),this.halo.trigger("action:edge:addde",{edge:r}),this.edgeView=null}this.graph.view.delegateEvents()}makeLoopEdge(t){let e=null,n=null;const i=this.options.loopEdgeWidth,r=this.graph.options,s=new KC(0,0,r.width,r.height),o=this.graph.graphToLocal(this.view.getBBox()),a=[this.options.loopEdgePreferredSide,"top","bottom","left","right"].some(t=>{let r=null,a=0,l=0;switch(t){case"top":r=new ZC(o.x+o.width/2,o.y-i),a=i/2;break;case"bottom":r=new ZC(o.x+o.width/2,o.y+o.height+i),a=i/2;break;case"left":r=new ZC(o.x-i,o.y+o.height/2),l=i/2;break;case"right":r=new ZC(o.x+o.width+i,o.y+o.height/2),l=i/2;break;default:break}return!!r&&(e=r.translate(-a,-l),n=r.translate(a,l),s.containsPoint(e)&&s.containsPoint(n))});a&&e&&n&&t.setVertices([e,n])}startResize({e:t}){this.halo.startBatch(),this.flip=[1,0,0,1,1,0,0,1][Math.floor(_C.normalize(this.node.getAngle())/45)],this.view.addClass("node-resizing"),ZP("node:resize",t,this.view)}doResize({e:t,dx:e,dy:n}){const i=this.node.getSize(),r=Math.max(i.width+(this.flip?e:n),1),s=Math.max(i.height+(this.flip?n:e),1);this.node.resize(r,s,{absolute:!0}),ZP("node:resizing",t,this.view)}stopResize({e:t}){this.view.removeClass("node-resizing"),ZP("node:resized",t,this.view),this.halo.stopBatch()}startClone({e:t,x:e,y:n}){this.halo.startBatch();const i=this.options,r=i.clone(this.cell,{clone:!0});if(!MO.isCell(r))throw new Error("option 'clone()' has to return a cell");this.centerNodeAtCursor(r,e,n),this.model.addCell(r,{halo:this.halo.cid,async:!1});const s=this.graph.renderer.findViewByCell(r);s.onMouseDown(t,e,n),this.halo.setEventData(t,{cloneView:s})}centerNodeAtCursor(t,e,n){const i=t.getBBox().getCenter(),r=e-i.x,s=n-i.y;t.translate(r,s)}doClone({e:t,x:e,y:n}){const i=this.halo.getEventData(t).cloneView;i&&i.onMouseMove(t,e,n)}stopClone({e:t,x:e,y:n}){const i=this.halo.getEventData(t).cloneView;i&&i.onMouseUp(t,e,n),this.halo.stopBatch()}startFork({e:t,x:e,y:n}){this.halo.startBatch();const i=this.options.clone(this.cell,{fork:!0});if(!MO.isCell(i))throw new Error("option 'clone()' has to return a cell");this.centerNodeAtCursor(i,e,n),this.model.addCell(i,{halo:this.halo.cid,async:!1});const r=this.createEdgeConnectedToSource(),s=this.graph.renderer.findViewByCell(i),o=this.getMagnet(s,"target"),a=this.getEdgeTerminal(s,o);r.setTarget(a),this.model.addEdge(r,{halo:this.halo.cid,async:!1}),s.onMouseDown(t,e,n),this.halo.setEventData(t,{cloneView:s})}doFork({e:t,x:e,y:n}){const i=this.halo.getEventData(t).cloneView;i&&i.onMouseMove(t,e,n)}stopFork({e:t,x:e,y:n}){const i=this.halo.getEventData(t).cloneView;i&&i.onMouseUp(t,e,n),this.halo.stopBatch()}startRotate({e:t,x:e,y:n}){this.halo.startBatch();const i=this.node.getBBox().getCenter(),r=[this.node];this.options.rotateEmbeds&&this.node.getDescendants({deep:!0}).reduce((t,e)=>(e.isNode()&&t.push(e),t),r),this.halo.setEventData(t,{center:i,nodes:r,rotateStartAngles:r.map(t=>t.getAngle()),clientStartAngle:new ZC(e,n).theta(i)}),r.forEach(e=>{const n=this.graph.findViewByCell(e);n&&(n.addClass("node-rotating"),ZP("node:rotate",t,n))})}doRotate({e:t,x:e,y:n}){const i=this.halo.getEventData(t),r=i.clientStartAngle-new ZC(e,n).theta(i.center);i.nodes.forEach((e,n)=>{const s=i.rotateStartAngles[n],o=WM.snapToGrid(s+r,this.options.rotateGrid);e.rotate(o,{absolute:!0,center:i.center,halo:this.halo.cid}),ZP("node:rotating",t,this.graph.findViewByCell(e))})}stopRotate({e:t}){const e=this.halo.getEventData(t);e.nodes.forEach(e=>{const n=this.graph.findViewByCell(e);n.removeClass("node-rotating"),ZP("node:rotated",t,n)}),this.halo.stopBatch()}unlink(){this.halo.startBatch(),this.model.removeConnectedEdges(this.cell),this.halo.stopBatch()}}class eD{constructor(t){this.halo=t}get options(){return this.halo.options}get graph(){return this.halo.graph}get model(){return this.halo.model}get view(){return this.halo.view}get cell(){return this.halo.cell}get edge(){return this.cell}getPresets(){return{className:"type-edge",handles:[{name:"remove",position:"nw",icon:null,events:{mousedown:this.removeEdge.bind(this)}},{name:"direction",position:"se",icon:null,events:{mousedown:this.directionSwap.bind(this)}}],content:!1,bbox(t){return t.graph.localToGraph(t.getPointAtRatio(.5))},tinyThreshold:-1,smallThreshold:-1}}removeEdge(){this.cell.remove()}directionSwap(){const t=this.edge.getSource(),e=this.edge.getTarget();this.edge.prop({source:e,target:t})}}class nD extends LP{get type(){return this.options.type||"surround"}get handleOptions(){return this.options}init(t){this.options=r.merge(nD.defaultOptions,this.cell.isNode()?new tD(this).getPresets():this.cell.isEdge()?new eD(this).getPresets():null,t),this.render(),this.initHandles(),this.update(),this.startListening()}startListening(){const t=this.model,e=this.graph,n=this.view.cell;n.on("removed",this.remove,this),t.on("reseted",this.remove,this),e.on("halo:destroy",this.remove,this),t.on("*",this.update,this),e.on("scale",this.update,this),e.on("translate",this.update,this),super.startListening()}stopListening(){const t=this.model,e=this.graph,n=this.view.cell;this.undelegateEvents(),n.off("removed",this.remove,this),t.off("reseted",this.remove,this),e.off("halo:destroy",this.remove,this),t.off("*",this.update,this),e.off("scale",this.update,this),e.off("translate",this.update,this),super.stopListening()}render(){const t=this.options,e=this.prefixClassName("widget-halo");return this.view.addClass(Jk.NODE_CLS),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(e).attr("data-shape",this.view.cell.shape),t.className&&this.$container.addClass(t.className),this.$handleContainer=this.$("<div/>").addClass(e+"-handles").appendTo(this.container),this.$content=this.$("<div/>").addClass(e+"-content").appendTo(this.container),this.$container.appendTo(this.graph.container),this}remove(){return this.stopBatch(),this.view.removeClass(Jk.NODE_CLS),super.remove()}update(){if(this.isRendered()){this.updateContent();const t=this.getBBox(),e=this.options.tinyThreshold||0,n=this.options.smallThreshold||0;this.$handleContainer.toggleClass(this.handleClassName+"-tiny",t.width<e&&t.height<e);const i=this.handleClassName+"-small";this.$handleContainer.toggleClass(i,!this.$handleContainer.hasClass(i)&&t.width<n&&t.height<n),this.$container.css({width:t.width,height:t.height,left:t.x,top:t.y}),this.hasHandle("unlink")&&this.toggleUnlink(),"surround"!==this.type&&"toolbar"!==this.type||this.hasHandle("fork")&&this.toggleFork()}}updateContent(){const t=this.options.content;if("function"===typeof t){const e=a.call(t,this,this.view,this.$content[0]);e&&this.$content.html(e)}else t?this.$content.html(t):this.$content.remove()}getBBox(){const t=this.view,e=this.options.bbox,n="function"===typeof e?a.call(e,this,t):e;return KC.create(Object.assign({x:0,y:0,width:1,height:1},n))}removeCell(){this.cell.remove()}toggleFork(){const t=this.view.cell.clone(),e=this.graph.hook.createCellView(t),n=this.graph.hook.validateConnection(this.view,null,e,null,"target");this.$handleContainer.children(".fork").toggleClass("hidden",!n),e.remove()}toggleUnlink(){const t=this.model.getConnectedEdges(this.view.cell).length>0;this.$handleContainer.children(".unlink").toggleClass("hidden",!t)}startBatch(){this.model.startBatch("halo",{halo:this.cid})}stopBatch(){this.model.hasActiveBatch("halo")&&this.model.stopBatch("halo",{halo:this.cid})}}(function(t){t.defaultOptions={type:"surround",clearAll:!0,clearOnBlankMouseDown:!0,useCellGeometry:!1,clone:t=>t.clone().removeZIndex()}})(nD||(nD={})),Object.getOwnPropertyNames(DP.prototype).forEach(t=>{"constructor"!==t&&Object.defineProperty(nD.prototype,t,Object.getOwnPropertyDescriptor(DP.prototype,t))}),function(t){t.NODE_CLS="has-widget-halo"}(Jk||(Jk={}));var iD,rD,sD,oD=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};class aD extends qE{constructor(t){super(),this.options=Object.assign(Object.assign({},aD.defaults),t),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(this.prefixClassName("widget-dnd")),this.draggingGraph=new Kk(Object.assign(Object.assign({},this.options.delegateGraphOptions),{container:document.createElement("div"),width:1,height:1})),this.$container.append(this.draggingGraph.container)}get targetScroller(){const t=this.options.target;return Kk.isGraph(t)?t.scroller.widget:t}get targetGraph(){const t=this.options.target;return Kk.isGraph(t)?t:t.graph}get targetModel(){return this.targetGraph.model}get snapline(){return this.targetGraph.snapline.widget}start(t,e){const n=e;n.preventDefault(),this.targetModel.startBatch("dnd"),this.$container.addClass("dragging").appendTo(this.options.draggingContainer||document.body),this.sourceNode=t,this.prepareDragging(t,n.clientX,n.clientY);const i=this.updateNodePosition(n.clientX,n.clientY);this.isSnaplineEnabled()&&(this.snapline.captureCursorOffset({e:n,node:t,cell:t,view:this.draggingView,x:i.x,y:i.y}),this.draggingNode.on("change:position",this.snap,this)),this.delegateDocumentEvents(aD.documentEvents,n.data)}isSnaplineEnabled(){return this.snapline&&!this.snapline.disabled}prepareDragging(t,e,n){const i=this.draggingGraph,r=i.model,s=this.options.getDragNode(t,{sourceNode:t,draggingGraph:i,targetGraph:this.targetGraph});s.position(0,0);let o=5;if(this.isSnaplineEnabled()&&(o+=this.snapline.options.tolerance||0),this.isSnaplineEnabled()||this.options.scaled){const t=this.targetGraph.transform.getScale();i.scale(t.sx,t.sy),o*=Math.max(t.sx,t.sy)}else i.scale(1,1);this.clearDragging(),this.options.animation&&this.$container.stop(!0,!0),r.resetCells([s]);const a=i.findViewByCell(s);a.undelegateEvents(),a.cell.off("changed"),i.fitToContent({padding:o,allowNewOrigin:"any"});const l=a.getBBox();this.geometryBBox=a.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(l.getTopLeft()),this.draggingNode=s,this.draggingView=a,this.draggingBBox=s.getBBox(),this.padding=o,this.originOffset=this.updateGraphPosition(e,n)}updateGraphPosition(t,e){const n=document.body.scrollTop||document.documentElement.scrollTop,i=this.delta,r=this.geometryBBox,s=this.padding||5,o={left:t-i.x-r.width/2-s,top:e-i.y-r.height/2-s+n};return this.draggingGraph&&this.$container.offset(o),o}updateNodePosition(t,e){const n=this.targetGraph.clientToLocal(t,e),i=this.draggingBBox;return n.x-=i.width/2,n.y-=i.height/2,this.draggingNode.position(n.x,n.y),n}snap({cell:t,current:e,options:n}){const i=t;if(n.snapped){const t=this.draggingBBox;i.position(t.x+n.tx,t.y+n.ty,{silent:!0}),this.draggingView.translate(),i.position(e.x,e.y,{silent:!0}),this.snapOffset={x:n.tx,y:n.ty}}else this.snapOffset=null}onDragging(t){const e=this.draggingView;if(e){t.preventDefault();const n=this.normalizeEvent(t),i=n.clientX,r=n.clientY;this.updateGraphPosition(i,r);const s=this.updateNodePosition(i,r),o=this.targetGraph.options.embedding.enabled,a=(o||this.isSnaplineEnabled())&&this.isInsideValidArea({x:i,y:r});if(o){e.setEventData(n,{graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView});const t=e.getEventData(n);a?e.processEmbedding(n,t):e.clearEmbedding(t),this.candidateEmbedView=t.candidateEmbedView}this.isSnaplineEnabled()&&(a?this.snapline.snapOnMoving({e:n,view:e,x:s.x,y:s.y}):this.snapline.hide())}}onDragEnd(t){const e=this.draggingNode;if(e){const n=this.normalizeEvent(t),i=this.draggingView,r=this.draggingBBox,s=this.snapOffset;let o=r.x,l=r.y;s&&(o+=s.x,l+=s.y),e.position(o,l,{silent:!0});const h=this.drop(e,{x:n.clientX,y:n.clientY}),c=t=>{t?(this.onDropped(e),this.targetGraph.options.embedding.enabled&&i&&(i.setEventData(n,{cell:t,graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView}),i.finalizeEmbedding(n,i.getEventData(n)))):this.onDropInvalid(),this.candidateEmbedView=null,this.targetModel.stopBatch("dnd")};a.isAsync(h)?(this.undelegateDocumentEvents(),h.then(c)):c(h)}}clearDragging(){this.draggingNode&&(this.sourceNode=null,this.draggingNode.remove(),this.draggingNode=null,this.draggingView=null,this.delta=null,this.padding=null,this.snapOffset=null,this.originOffset=null,this.undelegateDocumentEvents())}onDropped(t){this.draggingNode===t&&(this.clearDragging(),this.$container.removeClass("dragging").remove())}onDropInvalid(){const t=this.draggingNode;if(t){const e=this.options.animation;if(e){const n="object"===typeof e&&e.duration||150,i="object"===typeof e&&e.easing||"swing";this.draggingView=null,this.$container.animate(this.originOffset,n,i,()=>this.onDropped(t))}else this.onDropped(t)}}isInsideValidArea(t){let e,n=null;const i=this.targetGraph,r=this.targetScroller;this.options.dndContainer&&(n=this.getDropArea(this.options.dndContainer));const s=n&&n.containsPoint(t);if(r)if(r.options.autoResize)e=this.getDropArea(r.container);else{const t=this.getDropArea(r.container);e=this.getDropArea(i.container).intersectsWithRect(t)}else e=this.getDropArea(i.container);return!s&&e&&e.containsPoint(t)}getDropArea(t){const e=this.$(t),n=e.offset(),i=document.body.scrollTop||document.documentElement.scrollTop,r=document.body.scrollLeft||document.documentElement.scrollLeft;return KC.create({x:n.left+parseInt(e.css("border-left-width"),10)-r,y:n.top+parseInt(e.css("border-top-width"),10)-i,width:e.innerWidth(),height:e.innerHeight()})}drop(t,e){if(this.isInsideValidArea(e)){const n=this.targetGraph,i=n.model,r=n.clientToLocal(e),s=this.sourceNode,o=this.options.getDropNode(t,{sourceNode:s,draggingNode:t,targetGraph:this.targetGraph,draggingGraph:this.draggingGraph}),l=o.getBBox();r.x+=l.x-l.width/2,r.y+=l.y-l.height/2;const h=this.snapOffset?1:n.getGridSize();o.position(WM.snapToGrid(r.x,h),WM.snapToGrid(r.y,h)),o.removeZIndex();const c=this.options.validateNode,u=!c||c(o,{sourceNode:s,draggingNode:t,droppingNode:o,targetGraph:n,draggingGraph:this.draggingGraph});return"boolean"===typeof u?u?(i.addCell(o,{stencil:this.cid}),o):null:a.toDeferredBoolean(u).then(t=>t?(i.addCell(o,{stencil:this.cid}),o):null)}return null}onRemove(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())}dispose(){this.remove()}}function lD(t,e={}){const n=HO.isModel(t)?t:(new HO).resetCells(t,{sort:!1,dryrun:!0}),i=n.getNodes(),r=e.columns||1,s=Math.ceil(i.length/r),o=e.dx||0,a=e.dy||0,l=!1!==e.center,h=!0===e.resizeToFit,c=e.marginX||0,u=e.marginY||0,d=[];let g=e.columnWidth;if("compact"===g)for(let y=0;y<r;y+=1){const t=iD.getNodesInColumn(i,y,r);d.push(iD.getMaxDim(t,"width")+o)}else{null!=g&&"auto"!==g||(g=iD.getMaxDim(i,"width")+o);for(let t=0;t<r;t+=1)d.push(g)}const p=iD.accumulate(d,c),f=[];let m=e.rowHeight;if("compact"===m)for(let y=0;y<s;y+=1){const t=iD.getNodesInRow(i,y,r);f.push(iD.getMaxDim(t,"height")+a)}else{null!=m&&"auto"!==m||(m=iD.getMaxDim(i,"height")+a);for(let t=0;t<s;t+=1)f.push(m)}const b=iD.accumulate(f,u);n.startBatch("layout"),i.forEach((t,n)=>{const i=n%r,s=Math.floor(n/r),c=d[i],u=f[s];let g=0,m=0,y=t.getSize();if(h){let n=c-2*o,i=u-2*a;const r=y.height*(y.width?n/y.width:1),s=y.width*(y.height?i/y.height:1);u<r?n=s:i=r,y={width:n,height:i},t.setSize(y,e)}l&&(g=(c-y.width)/2,m=(u-y.height)/2),t.position(p[i]+o+g,b[s]+a+m,e)}),n.stopBatch("layout")}oD([qE.dispose()],aD.prototype,"dispose",null),function(t){t.defaults={animation:!1,getDragNode:t=>t.clone(),getDropNode:t=>t.clone()},t.documentEvents={mousemove:"onDragging",touchmove:"onDragging",mouseup:"onDragEnd",touchend:"onDragEnd",touchcancel:"onDragEnd"}}(aD||(aD={})),function(t){function e(t,e){return t.reduce((t,n)=>Math.max(n.getSize()[e],t),0)}function n(t,e,n){const i=[];for(let r=n*e,s=r+n;r<s;r+=1)i.push(t[r]);return i}function i(t,e,n){const i=[];for(let r=e,s=t.length;r<s;r+=n)i.push(t[r]);return i}function r(t,e){return t.reduce((t,e,n)=>(t.push(t[n]+e),t),[e||0])}t.getMaxDim=e,t.getNodesInRow=n,t.getNodesInColumn=i,t.accumulate=r}(iD||(iD={}));class hD extends qE{constructor(t){if(super(),this.graphs={},this.$groups={},this.options=Object.assign(Object.assign({},hD.defaultOptions),t),this.dnd=new aD(this.options),this.onSearch=a.debounce(this.onSearch,200),this.container=document.createElement("div"),this.$container=this.$(this.container).addClass(this.prefixClassName(rD.base)).attr("data-not-found-text",this.options.notFoundText||"No matches found"),this.options.collapsable=t.collapsable&&t.groups&&t.groups.some(t=>!1!==t.collapsable),this.options.collapsable){this.$container.addClass("collapsable");const e=t.groups&&t.groups.every(t=>t.collapsed||!1===t.collapsable);e&&this.$container.addClass("collapsed")}this.$("<div/>").addClass(this.prefixClassName(rD.title)).html(this.options.title).appendTo(this.$container),t.search&&this.$container.addClass("searchable").append(this.renderSearch()),this.$content=this.$("<div/>").addClass(this.prefixClassName(rD.content)).appendTo(this.$container);const e=t.stencilGraphOptions||{};if(t.groups&&t.groups.length)t.groups.forEach(n=>{const i=this.$("<div/>").addClass(this.prefixClassName(rD.group)).attr("data-name",n.name);(null==n.collapsable&&t.collapsable||!1!==n.collapsable)&&i.addClass("collapsable"),i.toggleClass("collapsed",!0===n.collapsed);const r=this.$("<h3/>").addClass(this.prefixClassName(rD.groupTitle)).html(n.title||n.name),s=this.$("<div/>").addClass(this.prefixClassName(rD.groupContent)),o=n.graphOptions,a=new Kk(Object.assign(Object.assign(Object.assign({},e),o),{container:document.createElement("div"),model:e.model||new HO,width:n.graphWidth||t.stencilGraphWidth,height:n.graphHeight||t.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));s.append(a.container),i.append(r,s).appendTo(this.$content),this.$groups[n.name]=i,this.graphs[n.name]=a});else{const n=new Kk(Object.assign(Object.assign({},e),{container:document.createElement("div"),model:e.model||new HO,width:t.stencilGraphWidth,height:t.stencilGraphHeight,interacting:!1,preventDefaultBlankAction:!1}));this.$content.append(n.container),this.graphs[sD.defaultGroupName]=n}return this.startListening(),this}get targetScroller(){const t=this.options.target;return Kk.isGraph(t)?t.scroller.widget:t}get targetGraph(){const t=this.options.target;return Kk.isGraph(t)?t:t.graph}get targetModel(){return this.targetGraph.model}renderSearch(){return this.$("<div/>").addClass(this.prefixClassName(rD.search)).append(this.$("<input/>").attr({type:"search",placeholder:this.options.placeholder||"Search"}).addClass(this.prefixClassName(rD.searchText)))}startListening(){const t=this.prefixClassName(rD.title),e=this.prefixClassName(rD.searchText),n=this.prefixClassName(rD.groupTitle);this.delegateEvents({["click ."+t]:"onTitleClick",["touchstart ."+t]:"onTitleClick",["click ."+n]:"onGroupTitleClick",["touchstart ."+n]:"onGroupTitleClick",["input ."+e]:"onSearch",["focusin ."+e]:"onSearchFocusIn",["focusout ."+e]:"onSearchFocusOut"}),Object.keys(this.graphs).forEach(t=>{const e=this.graphs[t];e.on("cell:mousedown",this.onDragStart,this)})}stopListening(){this.undelegateEvents(),Object.keys(this.graphs).forEach(t=>{const e=this.graphs[t];e.off("cell:mousedown",this.onDragStart,this)})}load(t,e){return Array.isArray(t)?this.loadGroup(t,e):this.options.groups&&Object.keys(this.options.groups).forEach(e=>{t[e]&&this.loadGroup(t[e],e)}),this}loadGroup(t,e){const n=this.getModel(e);if(n){const e=t.map(t=>SO.isNode(t)?t:SO.create(t));n.resetCells(e)}const i=this.getGroup(e);let r=this.options.stencilGraphHeight;i&&null!=i.graphHeight&&(r=i.graphHeight);const s=i&&i.layout||this.options.layout;if(s&&n&&a.call(s,this,n,i),!r){const t=this.getGraph(e);t.fitToContent({minWidth:t.options.width,gridHeight:1,padding:i&&i.graphPadding||this.options.stencilGraphPadding||10})}return this}onDragStart(t){const{e:e,node:n}=t;this.dnd.start(n,e)}filter(t,e){const n=Object.keys(this.graphs).reduce((n,i)=>{const r=this.graphs[i],s=i===sD.defaultGroupName?null:i,o=r.model.getNodes().filter(n=>{let i=!1;i="function"===typeof e?a.call(e,this,n,t,s,this):"boolean"===typeof e?e:this.isCellMatched(n,t,e,t.toLowerCase()!==t);const o=r.renderer.findViewByCell(n);return o&&o.$(o.container).toggleClass("unmatched",!i),i}),l=o.length>0,h=this.options,c=new HO;return c.resetCells(o),h.layout&&a.call(h.layout,this,c,this.getGroup(i)),this.$groups[i]&&this.$groups[i].toggleClass("unmatched",!l),r.fitToContent({gridWidth:1,gridHeight:1,padding:h.stencilGraphPadding||10}),n||l},!1);this.$container.toggleClass("not-found",!n)}isCellMatched(t,e,n,i){return!e||!n||Object.keys(n).some(r=>{if("*"===r||t.shape===r){const s=n[r];if("boolean"===typeof s)return s;const o=Array.isArray(s)?s:[s];return o.some(n=>{let r=t.getPropByPath(n);return null!=r&&(r=""+r,i||(r=r.toLowerCase()),r.indexOf(e)>=0)})}return!1})}onSearch(t){this.filter(t.target.value,this.options.search)}onSearchFocusIn(){this.$container.addClass("is-focused")}onSearchFocusOut(){this.$container.removeClass("is-focused")}onTitleClick(){this.options.collapsable&&(this.$container.toggleClass("collapsed"),this.$container.hasClass("collapsed")?this.collapseGroups():this.expandGroups())}onGroupTitleClick(t){const e=this.$(t.target).closest("."+this.prefixClassName(rD.group));this.toggleGroup(e.attr("data-name")||"");const n=Object.keys(this.$groups).every(t=>{const e=this.getGroup(t),n=this.$groups[t];return e&&!1===e.collapsable||n.hasClass("collapsed")});this.$container.toggleClass("collapsed",n)}getModel(t){const e=this.getGraph(t);return e?e.model:null}getGraph(t){return this.graphs[t||sD.defaultGroupName]}getGroup(t){const e=this.options.groups;return null!=t&&e&&e.length?e.find(e=>e.name===t):null}toggleGroup(t){return this.isGroupCollapsed(t)?this.expandGroup(t):this.collapseGroup(t),this}collapseGroup(t){if(this.isGroupCollapsable(t)){const e=this.$groups[t];e&&!this.isGroupCollapsed(t)&&(this.trigger("group:collapse",{name:t}),e.addClass("collapsed"))}return this}expandGroup(t){if(this.isGroupCollapsable(t)){const e=this.$groups[t];e&&this.isGroupCollapsed(t)&&(this.trigger("group:expand",{name:t}),e.removeClass("collapsed"))}return this}isGroupCollapsable(t){const e=this.$groups[t];return e.hasClass("collapsable")}isGroupCollapsed(t){const e=this.$groups[t];return e&&e.hasClass("collapsed")}collapseGroups(){return Object.keys(this.$groups).forEach(t=>this.collapseGroup(t)),this}expandGroups(){return Object.keys(this.$groups).forEach(t=>this.expandGroup(t)),this}resizeGroup(t,e){const n=this.graphs[t];return n&&n.resize(e.width,e.height),this}onRemove(){Object.keys(this.graphs).forEach(t=>{const e=this.graphs[t];e.view.remove(),delete this.graphs[t]}),this.dnd.remove(),this.stopListening(),this.undelegateDocumentEvents()}}(function(t){t.defaultOptions=Object.assign({stencilGraphWidth:200,stencilGraphHeight:800,title:"Stencil",collapsable:!1,placeholder:"Search",notFoundText:"No matches found",layout(t,e){const n={columnWidth:this.options.stencilGraphWidth/2-10,columns:2,rowHeight:80,resizeToFit:!1,dx:10,dy:10};lD(t,Object.assign(Object.assign(Object.assign({},n),this.options.layoutOptions),e?e.layoutOptions:{}))}},aD.defaults)})(hD||(hD={})),function(t){t.base="widget-stencil",t.title=t.base+"-title",t.search=t.base+"-search",t.searchText=t.search+"-text",t.content=t.base+"-content",t.group=t.base+"-group",t.groupTitle=t.group+"-title",t.groupContent=t.group+"-content"}(rD||(rD={})),function(t){t.defaultGroupName="__default__"}(sD||(sD={}))},3848:function(t,e,n){"use strict";var i=n("29e9"),r="object"==typeof self&&self&&self.Object===Object&&self,s=i["a"]||r||Function("return this")();e["a"]=s},"7b61":function(t,e,n){"use strict";function i(){return!1}e["a"]=i},9514:function(t,e,n){"use strict";var i=n("3522");const r=i["i"].create({type:"vue componnet"});i["d"].registerVueComponent=r.register,i["d"].unregisterVueComponent=r.unregister,i["d"].Hook.prototype.getVueComponent=function(t){const e=this.options.getVueComponent;if("function"===typeof e){const n=i["c"].call(e,this.graph,t);if(null!=n)return n}let n=t.getComponent();if("string"===typeof n){const t=r.get(n);if(null==t)return r.onNotFound(n);n=t}return n};class s extends i["f"]{get component(){return this.getComponent()}set component(t){this.setComponent(t)}getComponent(){return this.store.get("component")}setComponent(t,e={}){return null==t?this.removeComponent(e):this.store.set("component",t,e),this}removeComponent(t={}){return this.store.remove("component",t),this}}(function(t){function e(t,e="rect"){const n=[{tagName:e,selector:"body"}];return t?n.push(i["e"].getForeignObjectMarkup()):n.push({tagName:"g",selector:"content"}),n.push({tagName:"text",selector:"label"}),n}t.config({view:"vue-shape-view",markup:e(!0),attrs:{body:{fill:"none",stroke:"none",refWidth:"100%",refHeight:"100%"},fo:{refWidth:"100%",refHeight:"100%"},label:{fontSize:14,fill:"#333",refX:"50%",refY:"50%",textAnchor:"middle",textVerticalAnchor:"middle"}},propHooks(t){if(null==t.markup){const n=t.primer,r=t.useForeignObject;if((null!=n||null!=r)&&(t.markup=e(!1!==r,n),n)){null==t.attrs&&(t.attrs={});let e={};"circle"===n?e={refCx:"50%",refCy:"50%",refR:"50%"}:"ellipse"===n&&(e={refCx:"50%",refCy:"50%",refRx:"50%",refRy:"50%"}),"rect"!==n&&(t.attrs=i["h"].merge({},t.attrs,{body:Object.assign({refWidth:null,refHeight:null},e)}))}}return t}}),i["f"].registry.register("vue-shape",t,!0)})(s||(s={}));var o=n("084a"),a=function(t,e){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},a(t,e)};function l(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var h,c=function(){return c=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},c.apply(this,arguments)};function u(t){var e="function"===typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"===typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function d(t,e){var n="function"===typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,s=n.call(t),o=[];try{while((void 0===e||e-- >0)&&!(i=s.next()).done)o.push(i.value)}catch(a){r={error:a}}finally{try{i&&!i.done&&(n=s["return"])&&n.call(s)}finally{if(r)throw r.error}}return o}function g(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var p=[],f=function(){function t(t){this.active=!0,this.effects=[],this.cleanups=[],this.vm=t}return t.prototype.run=function(t){if(this.active)try{return this.on(),t()}finally{this.off()}else 0},t.prototype.on=function(){this.active&&(p.push(this),h=this)},t.prototype.off=function(){this.active&&(p.pop(),h=p[p.length-1])},t.prototype.stop=function(){this.active&&(this.vm.$destroy(),this.effects.forEach((function(t){return t.stop()})),this.cleanups.forEach((function(t){return t()})),this.active=!1)},t}();(function(t){function e(e){void 0===e&&(e=!1);var n=this,i=void 0;return k((function(){i=q(S())})),n=t.call(this,i)||this,e||m(n),n}l(e,t)})(f);function m(t,e){var n;if(e=e||h,e&&e.active)e.effects.push(t);else{var i=null===(n=T())||void 0===n?void 0:n.proxy;i&&i.$on("hook:destroyed",(function(){return t.stop()}))}}function b(t){if(!t.scope){var e=new f(t.proxy);t.scope=e,t.proxy.$on("hook:destroyed",(function(){return e.stop()}))}return t.scope}var y=void 0;try{var C=require("vue");C&&E(C)?y=C:C&&"default"in C&&E(C.default)&&(y=C.default)}catch(Ht){}var v=null,w=null,x=!0,M="__composition_api_installed__";function E(t){return t&&W(t)&&"Vue"===t.name}function A(t){return v&&V(t,M)}function S(){return v}function O(){var t=v||y;return t}function P(t){v=t,Object.defineProperty(t,M,{configurable:!0,writable:!0,value:!0})}function k(t){var e=x;x=!1;try{t()}finally{x=e}}function D(t){if(x){var e=w;null===e||void 0===e||e.scope.off(),w=t,null===w||void 0===w||w.scope.on()}}function T(){return w}var N=new WeakMap;function j(t){if(N.has(t))return N.get(t);var e={proxy:t,update:t.$forceUpdate,type:t.$options,uid:t._uid,emit:t.$emit.bind(t),parent:null,root:null};b(e);var n=["data","props","attrs","refs","vnode","slots"];return n.forEach((function(n){R(e,n,{get:function(){return t["$".concat(n)]}})})),R(e,"isMounted",{get:function(){return t._isMounted}}),R(e,"isUnmounted",{get:function(){return t._isDestroyed}}),R(e,"isDeactivated",{get:function(){return t._inactive}}),R(e,"emitted",{get:function(){return t._events}}),N.set(t,e),t.$parent&&(e.parent=j(t.$parent)),t.$root&&(e.root=j(t.$root)),e}var L=function(t){return Object.prototype.toString.call(t)};function F(t){return"function"===typeof t&&/native code/.test(t.toString())}var z="undefined"!==typeof Symbol&&F(Symbol)&&"undefined"!==typeof Reflect&&F(Reflect.ownKeys),B=function(t){return t};function R(t,e,n){var i=n.get,r=n.set;Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:i||B,set:r||B})}function I(t,e,n,i){Object.defineProperty(t,e,{value:n,enumerable:!!i,writable:!0,configurable:!0})}function V(t,e){return Object.hasOwnProperty.call(t,e)}function $(t){return Array.isArray(t)}Object.prototype.toString;var G=4294967295;function _(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)&&e<=G}function H(t){return null!==t&&"object"===typeof t}function U(t){return"[object Object]"===L(t)}function W(t){return"function"===typeof t}function X(t,e){return e=e||T(),e}function q(t,e){void 0===e&&(e={});var n=t.config.silent;t.config.silent=!0;var i=new t(e);return t.config.silent=n,i}function Y(t){var e=S();return e&&t instanceof e}function J(t,e){return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(t.$scopedSlots[e])return t.$scopedSlots[e].apply(t,n)}}function Z(t,e){var n;if(t){if(t._normalized)return t._normalized;for(var i in n={},t)t[i]&&"$"!==i[0]&&(n[i]=!0)}else n={};for(var i in e)i in n||(n[i]=!0);return n}function K(t){return z?Symbol.for(t):t}K("composition-api.preFlushQueue"),K("composition-api.postFlushQueue");var Q="composition-api.refKey",tt=new WeakMap,et=(new WeakMap,new WeakMap);function nt(t,e,n){var i=S(),r=i.util,s=(r.warn,r.defineReactive);var o=t.__ob__;function a(){o&&H(n)&&!V(n,"__ob__")&&ft(n)}if($(t)){if(_(e))return t.length=Math.max(t.length,e),t.splice(e,1,n),a(),n;if("length"===e&&n!==t.length)return t.length=n,null===o||void 0===o||o.dep.notify(),n}return e in t&&!(e in Object.prototype)?(t[e]=n,a(),n):t._isVue||o&&o.vmCount?n:o?(s(o.value,e,n),gt(t,e,n),a(),o.dep.notify(),n):(t[e]=n,n)}var it=function(){function t(t){var e=t.get,n=t.set;R(this,"value",{get:e,set:n})}return t}();function rt(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var i=new it(t);n&&(i.effect=!0);var r=Object.seal(i);return e&&et.set(r,!0),r}function st(t){var e;if(ot(t))return t;var n=yt((e={},e[Q]=t,e));return rt({get:function(){return n[Q]},set:function(t){return n[Q]=t}})}function ot(t){return t instanceof it}function at(t){if(!U(t))return t;var e={};for(var n in t)e[n]=lt(t,n);return e}function lt(t,e){e in t||nt(t,e,void 0);var n=t[e];return ot(n)?n:rt({get:function(){return t[e]},set:function(n){return t[e]=n}})}var ht="__v_skip";function ct(t){var e;return Boolean(t&&V(t,"__ob__")&&"object"===typeof t.__ob__&&(null===(e=t.__ob__)||void 0===e?void 0:e[ht]))}function ut(t){var e;return Boolean(t&&V(t,"__ob__")&&"object"===typeof t.__ob__&&!(null===(e=t.__ob__)||void 0===e?void 0:e[ht]))}function dt(t){if(!(!U(t)||ct(t)||$(t)||ot(t)||Y(t)||tt.has(t))){tt.set(t,!0);for(var e=Object.keys(t),n=0;n<e.length;n++)gt(t,e[n])}}function gt(t,e,n){if("__ob__"!==e&&!ct(t[e])){var i,r,s=Object.getOwnPropertyDescriptor(t,e);if(s){if(!1===s.configurable)return;i=s.get,r=s.set,i&&!r||2!==arguments.length||(n=t[e])}dt(n),R(t,e,{get:function(){var r=i?i.call(t):n;return e!==Q&&ot(r)?r.value:r},set:function(s){i&&!r||(e!==Q&&ot(n)&&!ot(s)?n.value=s:r?(r.call(t,s),n=s):n=s,dt(s))}})}}function pt(t){var e,n=O();if(n.observable)e=n.observable(t);else{var i=q(n,{data:{$$state:t}});e=i._data.$$state}return V(e,"__ob__")||ft(e),e}function ft(t,e){var n,i;if(void 0===e&&(e=new Set),!e.has(t)&&!V(t,"__ob__")&&Object.isExtensible(t)){I(t,"__ob__",mt(t)),e.add(t);try{for(var r=u(Object.keys(t)),s=r.next();!s.done;s=r.next()){var o=s.value,a=t[o];(U(a)||$(a))&&!ct(a)&&Object.isExtensible(a)&&ft(a,e)}}catch(l){n={error:l}}finally{try{s&&!s.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}}}function mt(t){return void 0===t&&(t={}),{value:t,dep:{notify:B,depend:B,addSub:B,removeSub:B}}}function bt(){return pt({}).__ob__}function yt(t){if(!H(t))return t;if(!U(t)&&!$(t)||ct(t)||!Object.isExtensible(t))return t;var e=pt(t);return dt(e),e}var Ct=function(t){return"on".concat(t[0].toUpperCase()+t.slice(1))};function vt(t){return function(e,n){var i=X(Ct(t),n);return i&&wt(S(),i,t,e)}}function wt(t,e,n,i){var r=e.proxy.$options,s=t.config.optionMergeStrategies[n],o=xt(e,i);return r[n]=s(r[n],o),o}function xt(t,e){return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var r=T();D(t);try{return e.apply(void 0,g([],d(n),!1))}finally{D(r)}}}vt("beforeMount"),vt("mounted"),vt("beforeUpdate"),vt("updated"),vt("beforeDestroy"),vt("destroyed"),vt("errorCaptured"),vt("activated"),vt("deactivated"),vt("serverPrefetch");function Mt(t,e){void 0===e&&(e=void 0);var n=S(),i=void 0,r={},s={config:n.config,use:n.use.bind(n),mixin:n.mixin.bind(n),component:n.component.bind(n),provide:function(t,e){return r[t]=e,this},directive:function(t,e){return e?(n.directive(t,e),s):n.directive(t)},mount:function(s,o){return i||(i=new n(c(c({propsData:e},t),{provide:c(c({},r),t.provide)})),i.$mount(s,o),i)},unmount:function(){i&&(i.$destroy(),i=void 0)}};return s}var Et,At=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var i=(null===this||void 0===this?void 0:this.proxy)||(null===(t=T())||void 0===t?void 0:t.proxy);return i?i.$createElement.apply(i,e):(Et||(Et=q(S()).$createElement),Et.apply(Et,e))};function St(t,e,n){var i=t.__composition_api_state__=t.__composition_api_state__||{};i[e]=n}function Ot(t,e){return(t.__composition_api_state__||{})[e]}var Pt={set:St,get:Ot};function kt(t,e,n){var i=t.$options.props;e in t||i&&V(i,e)||(ot(n)?R(t,e,{get:function(){return n.value},set:function(t){n.value=t}}):R(t,e,{get:function(){return ut(n)&&n.__ob__.dep.depend(),n},set:function(t){n=t}}))}function Dt(t){var e=Pt.get(t,"rawBindings")||{};if(e&&Object.keys(e).length){for(var n=t.$refs,i=Pt.get(t,"refs")||[],r=0;r<i.length;r++){var s=i[r],o=e[s];!n[s]&&o&&ot(o)&&(o.value=null)}var a=Object.keys(n),l=[];for(r=0;r<a.length;r++){s=a[r],o=e[s];n[s]&&o&&ot(o)&&(o.value=n[s],l.push(s))}Pt.set(t,"refs",l)}}function Tt(t){var e=[t._vnode];while(e.length){var n=e.pop();if(n&&(n.context&&Dt(n.context),n.children))for(var i=0;i<n.children.length;++i)e.push(n.children[i])}}function Nt(t,e){var n,i;if(t){var r=Pt.get(t,"attrBindings");if(r||e){if(!r){var s=yt({});r={ctx:e,data:s},Pt.set(t,"attrBindings",r),R(e,"attrs",{get:function(){return null===r||void 0===r?void 0:r.data},set:function(){}})}var o=t.$attrs,a=function(e){V(r.data,e)||R(r.data,e,{get:function(){return t.$attrs[e]}})};try{for(var l=u(Object.keys(o)),h=l.next();!h.done;h=l.next()){var c=h.value;a(c)}}catch(d){n={error:d}}finally{try{h&&!h.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}}}}function jt(t,e){var n=t.$options._parentVnode;if(n){for(var i=Pt.get(t,"slots")||[],r=Z(n.data.scopedSlots,t.$slots),s=0;s<i.length;s++){var o=i[s];r[o]||delete e[o]}var a=Object.keys(r);for(s=0;s<a.length;s++){o=a[s];e[o]||(e[o]=J(t,o))}Pt.set(t,"slots",a)}}function Lt(t,e,n){var i=T();D(t);try{return e(t)}catch(r){if(!n)throw r;n(r)}finally{D(i)}}function Ft(t){function e(){var t=this,e=t.$options,i=e.setup,r=e.render;if(r&&(e.render=function(){for(var e=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return Lt(j(t),(function(){return r.apply(e,n)}))}),i&&W(i)){var s=e.data;e.data=function(){return n(t,t.$props),W(s)?s.call(t,t):s||{}}}}function n(t,e){void 0===e&&(e={});var n,o=t.$options.setup,a=s(t),l=j(t);if(l.setupContext=a,I(e,"__ob__",bt()),jt(t,a.slots),Lt(l,(function(){n=o(e,a)})),n)if(W(n)){var h=n;t.$options.render=function(){return jt(t,a.slots),Lt(l,(function(){return h()}))}}else if(H(n)){ut(n)&&(n=at(n)),Pt.set(t,"rawBindings",n);var c=n;Object.keys(c).forEach((function(e){var n=c[e];if(!ot(n))if(ut(n))$(n)&&(n=st(n));else if(W(n)){var s=n;n=n.bind(t),Object.keys(s).forEach((function(t){n[t]=s[t]}))}else H(n)?r(n)&&i(n):n=st(n);kt(t,e,n)}))}else 0}function i(t,e){if(void 0===e&&(e=new Set),!e.has(t)&&U(t)&&!ot(t)&&!ut(t)&&!ct(t)){var n=S(),r=n.util.defineReactive;Object.keys(t).forEach((function(n){var s=t[n];r(t,n,s),s&&(e.add(s),i(s,e))}))}}function r(t,e){return void 0===e&&(e=new Map),e.has(t)?e.get(t):(e.set(t,!1),$(t)&&ut(t)?(e.set(t,!0),!0):!(!U(t)||ct(t)||ot(t))&&Object.keys(t).some((function(n){return r(t[n],e)})))}function s(t){var e={slots:{}},n=["root","parent","refs","listeners","isServer","ssrContext"],i=["emit"];return n.forEach((function(n){var i="$".concat(n);R(e,n,{get:function(){return t[i]},set:function(){}})})),Nt(t,e),i.forEach((function(n){var i="$".concat(n);R(e,n,{get:function(){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t[i];r.apply(t,e)}}})})),e}t.mixin({beforeCreate:e,mounted:function(){Tt(this)},beforeUpdate:function(){Nt(this)},updated:function(){Tt(this)}})}function zt(t,e){if(!t)return e;if(!e)return t;for(var n,i,r,s=z?Reflect.ownKeys(t):Object.keys(t),o=0;o<s.length;o++)n=s[o],"__ob__"!==n&&(i=e[n],r=t[n],V(e,n)?i!==r&&U(i)&&!ot(i)&&U(r)&&!ot(r)&&zt(r,i):e[n]=r);return e}function Bt(t){A(t)||(t.config.optionMergeStrategies.setup=function(t,e){return function(n,i){return zt(W(t)?t(n,i)||{}:void 0,W(e)?e(n,i)||{}:void 0)}},P(t),Ft(t))}var Rt={install:function(t){return Bt(t)}};function It(t){t=t||o["default"],t&&!t["__composition_api_installed__"]&&t.use(Rt)}"undefined"!==typeof window&&window.Vue&&window.Vue.use(Rt),It(o["default"]);var Vt=!0,$t=!1,Gt=o["default"];o["default"].version;class _t extends i["g"]{init(){super.init()}getComponentContainer(){return this.selectors.foContent}confirmUpdate(t){const e=super.confirmUpdate(t);return this.handleAction(e,_t.action,()=>{i["j"].scheduleTask(()=>{this.renderVueComponent()})})}renderVueComponent(){this.unmountVueComponent();const t=this.getComponentContainer(),e=this.cell,n=this.graph;if(t){const i=this.graph.hook.getVueComponent(e);if(Vt){const r=Gt;this.vm=new r("string"===typeof i?{template:i}:{render(){return At(i,{graph:n,node:e})},provide(){return{getGraph:()=>n,getNode:()=>e}}}),this.vm.$mount(t)}else $t&&(this.vm=Mt({render(){return At(i,{graph:n,node:e})},provide(){return{getGraph:()=>n,getNode:()=>e}}}),this.vm.mount(t))}}unmountVueComponent(){const t=this.getComponentContainer();return this.vm&&(Vt&&this.vm.$destroy(),$t&&this.vm.unmount(),this.vm=null),t.innerHTML="",t}unmount(){return this.unmountVueComponent(),super.unmount(),this}}(function(t){t.action="vue",t.config({bootstrap:[t.action],actions:{component:t.action}}),i["g"].registry.register("vue-shape-view",t,!0)})(_t||(_t={}))},b0ff:function(t,e,n){var i;(function(r,s,o){if(r){for(var a,l={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"},h={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},c={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},u={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},d=1;d<20;++d)l[111+d]="f"+d;for(d=0;d<=9;++d)l[d+96]=d.toString();A.prototype.bind=function(t,e,n){var i=this;return t=t instanceof Array?t:[t],i._bindMultiple.call(i,t,e,n),i},A.prototype.unbind=function(t,e){var n=this;return n.bind.call(n,t,(function(){}),e)},A.prototype.trigger=function(t,e){var n=this;return n._directMap[t+":"+e]&&n._directMap[t+":"+e]({},t),n},A.prototype.reset=function(){var t=this;return t._callbacks={},t._directMap={},t},A.prototype.stopCallback=function(t,e){var n=this;if((" "+e.className+" ").indexOf(" mousetrap ")>-1)return!1;if(E(e,n.target))return!1;if("composedPath"in t&&"function"===typeof t.composedPath){var i=t.composedPath()[0];i!==t.target&&(e=i)}return"INPUT"==e.tagName||"SELECT"==e.tagName||"TEXTAREA"==e.tagName||e.isContentEditable},A.prototype.handleKey=function(){var t=this;return t._handleKey.apply(t,arguments)},A.addKeycodes=function(t){for(var e in t)t.hasOwnProperty(e)&&(l[e]=t[e]);a=null},A.init=function(){var t=A(s);for(var e in t)"_"!==e.charAt(0)&&(A[e]=function(e){return function(){return t[e].apply(t,arguments)}}(e))},A.init(),r.Mousetrap=A,t.exports&&(t.exports=A),i=function(){return A}.call(e,n,e,t),i===o||(t.exports=i)}function g(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function p(t){if("keypress"==t.type){var e=String.fromCharCode(t.which);return t.shiftKey||(e=e.toLowerCase()),e}return l[t.which]?l[t.which]:h[t.which]?h[t.which]:String.fromCharCode(t.which).toLowerCase()}function f(t,e){return t.sort().join(",")===e.sort().join(",")}function m(t){var e=[];return t.shiftKey&&e.push("shift"),t.altKey&&e.push("alt"),t.ctrlKey&&e.push("ctrl"),t.metaKey&&e.push("meta"),e}function b(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function y(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function C(t){return"shift"==t||"ctrl"==t||"alt"==t||"meta"==t}function v(){if(!a)for(var t in a={},l)t>95&&t<112||l.hasOwnProperty(t)&&(a[l[t]]=t);return a}function w(t,e,n){return n||(n=v()[t]?"keydown":"keypress"),"keypress"==n&&e.length&&(n="keydown"),n}function x(t){return"+"===t?["+"]:(t=t.replace(/\+{2}/g,"+plus"),t.split("+"))}function M(t,e){var n,i,r,s=[];for(n=x(t),r=0;r<n.length;++r)i=n[r],u[i]&&(i=u[i]),e&&"keypress"!=e&&c[i]&&(i=c[i],s.push("shift")),C(i)&&s.push(i);return e=w(i,s,e),{key:i,modifiers:s,action:e}}function E(t,e){return null!==t&&t!==s&&(t===e||E(t.parentNode,e))}function A(t){var e=this;if(t=t||s,!(e instanceof A))return new A(t);e.target=t,e._callbacks={},e._directMap={};var n,i={},r=!1,o=!1,a=!1;function l(t){t=t||{};var e,n=!1;for(e in i)t[e]?n=!0:i[e]=0;n||(a=!1)}function h(t,n,r,s,o,a){var l,h,c=[],u=r.type;if(!e._callbacks[t])return[];for("keyup"==u&&C(t)&&(n=[t]),l=0;l<e._callbacks[t].length;++l)if(h=e._callbacks[t][l],(s||!h.seq||i[h.seq]==h.level)&&u==h.action&&("keypress"==u&&!r.metaKey&&!r.ctrlKey||f(n,h.modifiers))){var d=!s&&h.combo==o,g=s&&h.seq==s&&h.level==a;(d||g)&&e._callbacks[t].splice(l,1),c.push(h)}return c}function c(t,n,i,r){e.stopCallback(n,n.target||n.srcElement,i,r)||!1===t(n,i)&&(b(n),y(n))}function u(t){"number"!==typeof t.which&&(t.which=t.keyCode);var n=p(t);n&&("keyup"!=t.type||r!==n?e.handleKey(n,m(t),t):r=!1)}function d(){clearTimeout(n),n=setTimeout(l,1e3)}function v(t,e,n,s){function o(e){return function(){a=e,++i[t],d()}}function h(e){c(n,e,t),"keyup"!==s&&(r=p(e)),setTimeout(l,10)}i[t]=0;for(var u=0;u<e.length;++u){var g=u+1===e.length,f=g?h:o(s||M(e[u+1]).action);w(e[u],f,s,t,u)}}function w(t,n,i,r,s){e._directMap[t+":"+i]=n,t=t.replace(/\s+/g," ");var o,a=t.split(" ");a.length>1?v(t,a,n,i):(o=M(t,i),e._callbacks[o.key]=e._callbacks[o.key]||[],h(o.key,o.modifiers,{type:o.action},r,t,s),e._callbacks[o.key][r?"unshift":"push"]({callback:n,modifiers:o.modifiers,action:o.action,seq:r,level:s,combo:t}))}e._handleKey=function(t,e,n){var i,r=h(t,e,n),s={},u=0,d=!1;for(i=0;i<r.length;++i)r[i].seq&&(u=Math.max(u,r[i].level));for(i=0;i<r.length;++i)if(r[i].seq){if(r[i].level!=u)continue;d=!0,s[r[i].seq]=1,c(r[i].callback,n,r[i].combo,r[i].seq)}else d||c(r[i].callback,n,r[i].combo);var g="keypress"==n.type&&o;n.type!=a||C(t)||g||l(s),o=d&&"keydown"==n.type},e._bindMultiple=function(t,e,n){for(var i=0;i<t.length;++i)w(t[i],e,n)},g(t,"keypress",u),g(t,"keydown",u),g(t,"keyup",u)}})("undefined"!==typeof window?window:null,"undefined"!==typeof window?document:null)},b885:function(t,e,n){"use strict";(function(t){var i=n("29e9"),r="object"==typeof exports&&exports&&!exports.nodeType&&exports,s=r&&"object"==typeof t&&t&&!t.nodeType&&t,o=s&&s.exports===r,a=o&&i["a"].process,l=function(){try{var t=s&&s.require&&s.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(e){}}();e["a"]=l}).call(this,n("c8f3")(t))},c8f3:function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},f73c:function(t,e,n){"use strict";(function(t){var i=n("3848"),r=n("7b61"),s="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=s&&"object"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===s,l=a?i["a"].Buffer:void 0,h=l?l.isBuffer:void 0,c=h||r["a"];e["a"]=c}).call(this,n("c8f3")(t))}}]);
|