You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__Paperlibrary__Random__Pr...

1176 lines
2.1 MiB

(self.webpackChunk=self.webpackChunk||[]).push([[337],{88540:function(){"use strict"},42271:function(){"use strict"},15547:function(Dn,Gn){"use strict";Gn.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},64745:function(Dn,Gn){"use strict";Gn.Z={wrap:"wrap___ilWvf",deleteIcon:"deleteIcon___JBDG8",keywordTag:"keywordTag___iieCb",questionTitleEditorWrap:"questionTitleEditorWrap___MHB5s",choiceListWrap:"choiceListWrap___jB8b1",choiceWrap:"choiceWrap___QFkTc",choiceIndex:"choiceIndex___Mr2YO",judgementIndex:"judgementIndex___fUVWK",setAnswerBtn:"setAnswerBtn___Whox5",activeAnswer:"activeAnswer___fGU6Y",activeJudgementAnswer:"activeJudgementAnswer___wJv8P",actionWrapper:"actionWrapper___ERQ7k",addIcon:"addIcon___L9TE0",inputBorder:"inputBorder___Q5tRE",placeholder:"placeholder___p9sFY",blankInputNumberWrapper:"blankInputNumberWrapper___uEHb0",addBtn:"addBtn___WR5ZI",blankIndex:"blankIndex___x9Pny",baseInputWrapper:"baseInputWrapper___eVsG7",collapseWrapper:"collapseWrapper___ZTysU",panelHeader:"panelHeader___QSN9g",open:"open___B6FU9",close:"close___QX19r",hide:"hide___mn25n"}},93092:function(Dn,Gn,kt){"use strict";var pt=kt(59301),Ut=Object.defineProperty,le=Object.getOwnPropertySymbols,Me=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,It=(ne,Rt,Ae)=>Rt in ne?Ut(ne,Rt,{enumerable:!0,configurable:!0,writable:!0,value:Ae}):ne[Rt]=Ae,qt=(ne,Rt)=>{for(var Ae in Rt||(Rt={}))Me.call(Rt,Ae)&&It(ne,Ae,Rt[Ae]);if(le)for(var Ae of le(Rt))ue.call(Rt,Ae)&&It(ne,Ae,Rt[Ae]);return ne};const ge=ne=>React.createElement("svg",qt({width:14,height:14,xmlns:"http://www.w3.org/2000/svg"},ne),React.createElement("title",null,"\u7F16\u7EC4 18"),React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("circle",{fill:"#FCB041",cx:7,cy:7,r:7}),React.createElement("path",{d:"M7.531 9.638a.616.616 0 1 1-1.231 0v-.02a.616.616 0 1 1 1.231 0v.02Zm0-2.25a.616.616 0 1 1-1.231 0V4.117a.616.616 0 1 1 1.231 0v3.273Z",fill:"#FFF",fillRule:"nonzero"})));Gn.Z="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiNGQ0IwNDEiIGN4PSI3IiBjeT0iNyIgcj0iNyIvPjxwYXRoIGQ9Ik03LjUzMSA5LjYzOGEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwdi0uMDJhLjYxNi42MTYgMCAxIDEgMS4yMzEgMHYuMDJabTAtMi4yNWEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwVjQuMTE3YS42MTYuNjE2IDAgMSAxIDEuMjMxIDB2My4yNzNaIiBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+"},71584:function(){"use strict";function Dn(Bt,nt,et,ht){et===void 0&&(et=0),ht===void 0&&(ht=1/0),this._name=Bt,this._defaultValue=nt,this._minimum=et,this._maximum=ht}Object.defineProperty(Dn.prototype,"name",{get:function(){return this._name},set:function(Bt){if(typeof Bt!="string"||Bt==="")throw new Error("Shape name must be a valid string.");this._name=Bt}}),Object.defineProperty(Dn.prototype,"defaultValue",{get:function(){return this._defaultValue},set:function(Bt){if(typeof Bt!="number"||isNaN(Bt))throw new Error("The default value must be a real number, not: "+Bt);this._defaultValue=Bt}}),Object.defineProperty(Dn.prototype,"minimum",{get:function(){return this._minimum},set:function(Bt){if(typeof Bt!="number"||isNaN(Bt))throw new Error("Minimum must be a real number, not: "+Bt);this._minimum=Bt}}),Object.defineProperty(Dn.prototype,"maximum",{get:function(){return this._maximum},set:function(Bt){if(typeof Bt!="number"||isNaN(Bt))throw new Error("Maximum must be a real number, not: "+Bt);this._maximum=Bt}}),go.Shape._FigureParameters={},go.Shape.getFigureParameter=function(Bt,nt){var et=go.Shape._FigureParameters[Bt];return et?et[nt]:null},go.Shape.setFigureParameter=function(Bt,nt,et){if(!(et instanceof Dn))throw new Error("Third argument to Shape.setFigureParameter is not FigureParameter: "+et);if(et.defaultValue<et.minimum||et.defaultValue>et.maximum)throw new Error("defaultValue must be between minimum and maximum, not: "+et.defaultValue);var ht=go.Shape._FigureParameters[Bt];ht||(ht=[],go.Shape._FigureParameters[Bt]=ht),ht[nt]=et};var Gn=[];function kt(Bt,nt){var et=Gn.pop();return et===void 0?new go.Point(Bt,nt):(et.x=Bt,et.y=nt,et)}function pt(){var Bt=Gn.pop();return Bt===void 0?new go.Point:Bt}function Ut(Bt){Gn.push(Bt)}function le(Bt,nt,et,ht,st,gt,vt,St,Et){Et||(Et=new go.Point);var Tt=Bt-et,Dt=st-vt,Jt=NaN,Yt=NaN;if(Tt===0)if(Dt===0)Bt===et&&(Jt=Bt,Yt=nt);else{var Gt=(gt-St)/Dt,me=gt-Gt*st;Jt=Bt,Yt=Gt*Jt+me}else if(Dt===0){var ae=(nt-ht)/Tt,Ne=nt-ae*Bt;Jt=st,Yt=ae*Jt+Ne}else{var ae=(nt-ht)/Tt,Gt=(gt-St)/Dt,Ne=nt-ae*Bt,me=gt-Gt*st;Jt=(me-Ne)/(ae-Gt),Yt=ae*Jt+Ne}return Et.x=Jt,Et.y=Yt,Et}function Me(Bt,nt,et,ht,st,gt,vt,St,Et,Tt,Dt,Jt,Yt,Gt){var me=1-Et,ae=Et,Ne=Bt*me+et*ae,Ce=nt*me+ht*ae,we=et*me+st*ae,tn=ht*me+gt*ae,_e=st*me+vt*ae,an=gt*me+St*ae,Ke=Ne*me+we*ae,oe=Ce*me+tn*ae,Xt=we*me+_e*ae,qe=tn*me+an*ae,_n=Ke*me+Xt*ae,Pn=oe*me+qe*ae;Tt.x=Ne,Tt.y=Ce,Dt.x=Ke,Dt.y=oe,Jt.x=_n,Jt.y=Pn,Yt.x=Xt,Yt.y=qe,Gt.x=_e,Gt.y=an}var ue=new go.Spot(.156,.156),It=new go.Spot(.844,.844),qt=4*((Math.sqrt(2)-1)/3);go.Shape.setFigureParameter("RoundedRectangle",0,new Dn("CornerRounding",5)),go.Shape.defineFigureGenerator("RoundedRectangle",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=5),ht=Math.min(ht,nt/3),ht=Math.min(ht,et/3);var st=ht*qt,gt=new go.Geometry().add(new go.PathFigure(ht,0,!0).add(new go.PathSegment(go.PathSegment.Line,nt-ht,0)).add(new go.PathSegment(go.PathSegment.Bezier,nt,ht,nt-st,0,nt,st)).add(new go.PathSegment(go.PathSegment.Line,nt,et-ht)).add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,et,nt,et-st,nt-st,et)).add(new go.PathSegment(go.PathSegment.Line,ht,et)).add(new go.PathSegment(go.PathSegment.Bezier,0,et-ht,st,et,0,et-st)).add(new go.PathSegment(go.PathSegment.Line,0,ht)).add(new go.PathSegment(go.PathSegment.Bezier,ht,0,0,st,st,0).close()));return st>1&&(gt.spot1=new go.Spot(0,0,st,st),gt.spot2=new go.Spot(1,1,-st,-st)),gt}),go.Shape.defineFigureGenerator("Border","RoundedRectangle"),go.Shape.defineFigureGenerator("TriangleRight",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())).setSpots(0,.25,.5,.75)}),go.Shape.defineFigureGenerator("TriangleDown",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,.5*nt,et).close())).setSpots(.25,0,.75,.5)}),go.Shape.defineFigureGenerator("TriangleLeft",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(nt,et).add(new go.PathSegment(go.PathSegment.Line,0,.5*et)).add(new go.PathSegment(go.PathSegment.Line,nt,0).close())).setSpots(.5,.25,1,.75)}),go.Shape.defineFigureGenerator("TriangleUp",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(nt,et).add(new go.PathSegment(go.PathSegment.Line,0,et)).add(new go.PathSegment(go.PathSegment.Line,.5*nt,0).close())).setSpots(.25,.5,.75,1)}),go.Shape.defineFigureGenerator("Triangle","TriangleUp"),go.Shape.defineFigureGenerator("Diamond",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(.5*nt,0).add(new go.PathSegment(go.PathSegment.Line,0,.5*et)).add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et).close())).setSpots(.25,.25,.75,.75)}),go.Shape.defineFigureGenerator("LineH",function(Bt,nt,et){var ht=new go.Geometry(go.Geometry.Line);return ht.startX=0,ht.startY=et/2,ht.endX=nt,ht.endY=et/2,ht}),go.Shape.defineFigureGenerator("LineV",function(Bt,nt,et){var ht=new go.Geometry(go.Geometry.Line);return ht.startX=nt/2,ht.startY=0,ht.endX=nt/2,ht.endY=et,ht}),go.Shape.defineFigureGenerator("BarH","Rectangle"),go.Shape.defineFigureGenerator("BarV","Rectangle"),go.Shape.defineFigureGenerator("MinusLine","LineH"),go.Shape.defineFigureGenerator("PlusLine",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,et/2,!1).add(new go.PathSegment(go.PathSegment.Line,nt,et/2)).add(new go.PathSegment(go.PathSegment.Move,nt/2,0)).add(new go.PathSegment(go.PathSegment.Line,nt/2,et)))}),go.Shape.defineFigureGenerator("XLine",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,et,!1).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Move,0,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)))}),go.Shape.defineFigureGenerator("LineRight",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(.25*nt,0,!1).add(new go.PathSegment(go.PathSegment.Line,.75*nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,.25*nt,et)))}),go.Shape.defineFigureGenerator("LineDown",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,.25*et,!1).add(new go.PathSegment(go.PathSegment.Line,.5*nt,.75*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)))}),go.Shape.defineFigureGenerator("LineLeft",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(.75*nt,0,!1).add(new go.PathSegment(go.PathSegment.Line,.25*nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,.75*nt,et)))}),go.Shape.defineFigureGenerator("LineUp",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,.75*et,!1).add(new go.PathSegment(go.PathSegment.Line,.5*nt,.25*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.75*et)))}),go.Shape.defineFigureGenerator("AsteriskLine",function(Bt,nt,et){var ht=.2/Math.SQRT2;return new go.Geometry().add(new go.PathFigure(ht*nt,(1-ht)*et,!1).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,ht*et)).add(new go.PathSegment(go.PathSegment.Move,ht*nt,ht*et)).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,(1-ht)*et)).add(new go.PathSegment(go.PathSegment.Move,0,et/2)).add(new go.PathSegment(go.PathSegment.Line,nt,et/2)).add(new go.PathSegment(go.PathSegment.Move,nt/2,0)).add(new go.PathSegment(go.PathSegment.Line,nt/2,et)))}),go.Shape.defineFigureGenerator("CircleLine",function(Bt,nt,et){var ht=nt/2,st=new go.Geometry().add(new go.PathFigure(nt,nt/2,!1).add(new go.PathSegment(go.PathSegment.Arc,0,360,ht,ht,ht,ht).close()));return st.spot1=ue,st.spot2=It,st.defaultStretch=go.GraphObject.Uniform,st}),go.Shape.defineFigureGenerator("Line1",function(Bt,nt,et){var ht=new go.Geometry(go.Geometry.Line);return ht.startX=0,ht.startY=0,ht.endX=nt,ht.endY=et,ht}),go.Shape.defineFigureGenerator("Line2",function(Bt,nt,et){var ht=new go.Geometry(go.Geometry.Line);return ht.startX=nt,ht.startY=0,ht.endX=0,ht.endY=et,ht}),go.Shape.defineFigureGenerator("Curve1",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,nt,et,qt*nt,0,nt,(1-qt)*et)))}),go.Shape.defineFigureGenerator("Curve2",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,nt,et,0,qt*et,(1-qt)*nt,et)))}),go.Shape.defineFigureGenerator("Curve3",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(nt,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,0,et,nt,qt*et,qt*nt,et)))}),go.Shape.defineFigureGenerator("Curve4",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(nt,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,0,et,(1-qt)*nt,0,0,(1-qt)*et)))}),go.Shape.defineFigureGenerator("TriangleDownLeft",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())).setSpots(0,.5,.5,1)}),go.Shape.defineFigureGenerator("TriangleDownRight",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(nt,0,!0).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())).setSpots(.5,.5,1,1)}),go.Shape.defineFigureGenerator("TriangleUpLeft",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())).setSpots(0,0,.5,.5)}),go.Shape.defineFigureGenerator("TriangleUpRight",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et).close())).setSpots(.5,0,1,.5)}),go.Shape.defineFigureGenerator("RightTriangle","TriangleDownLeft"),go.Shape.setFigureParameter("Parallelogram1",0,new Dn("Indent",.1,-.99,.99)),go.Shape.defineFigureGenerator("Parallelogram1",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)?ht=.1:ht<-1?ht=-1:ht>1&&(ht=1);var st=Math.abs(ht)*nt;if(ht===0){var gt=new go.Geometry(go.Geometry.Rectangle);return gt.startX=0,gt.startY=0,gt.endX=nt,gt.endY=et,gt}else{var gt=new go.Geometry;return ht>0?gt.add(new go.PathFigure(st,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt-st,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())):gt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt-st,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,st,et).close())),st<nt/2&&gt.setSpots(st/nt,0,(nt-st)/nt,1),gt}}),go.Shape.defineFigureGenerator("Parallelogram","Parallelogram1"),go.Shape.setFigureParameter("Parallelogram2",0,new Dn("Indent",10,-1/0,1/0)),go.Shape.defineFigureGenerator("Parallelogram2",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)?ht=10:ht<-nt?ht=-nt:ht>nt&&(ht=nt);var st=Math.abs(ht);if(ht===0){var gt=new go.Geometry(go.Geometry.Rectangle);return gt.startX=0,gt.startY=0,gt.endX=nt,gt.endY=et,gt}else{var gt=new go.Geometry;return ht>0?gt.add(new go.PathFigure(st,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt-st,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())):gt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt-st,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,st,et).close())),st<nt/2&&gt.setSpots(st/nt,0,(nt-st)/nt,1),gt}}),go.Shape.setFigureParameter("Trapezoid1",0,new Dn("Indent",.2,-.99,.99)),go.Shape.defineFigureGenerator("Trapezoid1",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)?ht=.2:ht<.5?ht=-.5:ht>.5&&(ht=.5);var st=Math.abs(ht)*nt;if(ht===0){var gt=new go.Geometry(go.Geometry.Rectangle);return gt.startX=0,gt.startY=0,gt.endX=nt,gt.endY=et,gt}else{var gt=new go.Geometry;return ht>0?gt.add(new go.PathFigure(st,0).add(new go.PathSegment(go.PathSegment.Line,nt-st,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())):gt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt-st,et)).add(new go.PathSegment(go.PathSegment.Line,st,et).close())),st<nt/2&&gt.setSpots(st/nt,0,(nt-st)/nt,1),gt}}),go.Shape.defineFigureGenerator("Trapezoid","Trapezoid1"),go.Shape.setFigureParameter("Trapezoid2",0,new Dn("Indent",20,-1/0,1/0)),go.Shape.defineFigureGenerator("Trapezoid2",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)?ht=20:ht<-nt?ht=-nt/2:ht>nt&&(ht=nt/2);var st=Math.abs(ht);if(ht===0){var gt=new go.Geometry(go.Geometry.Rectangle);return gt.startX=0,gt.startY=0,gt.endX=nt,gt.endY=et,gt}else{var gt=new go.Geometry;return ht>0?gt.add(new go.PathFigure(st,0).add(new go.PathSegment(go.PathSegment.Line,nt-st,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())):gt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt-st,et)).add(new go.PathSegment(go.PathSegment.Line,st,et).close())),st<nt/2&&gt.setSpots(st/nt,0,(nt-st)/nt,1),gt}}),go.Shape.setFigureParameter("ManualOperation",0,new Dn("Indent",10,-1/0,1/0)),go.Shape.defineFigureGenerator("ManualOperation",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)?ht=10:ht<-nt?ht=-nt/2:ht>nt&&(ht=nt/2);var st=Math.abs(ht);if(ht===0){var gt=new go.Geometry(go.Geometry.Rectangle);return gt.startX=0,gt.startY=0,gt.endX=nt,gt.endY=et,gt}else{var gt=new go.Geometry;return ht>0?gt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt-st,et)).add(new go.PathSegment(go.PathSegment.Line,st,et).close())):gt.add(new go.PathFigure(st,0).add(new go.PathSegment(go.PathSegment.Line,nt-st,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())),st<nt/2&&gt.setSpots(st/nt,0,(nt-st)/nt,1),gt}});var ge=[];function ne(){var Bt=ge.pop();return Bt===void 0?[]:Bt}function Rt(Bt){Bt.length=0,ge.push(Bt)}function Ae(Bt){for(var nt=ne(),et=.5,ht=.5,st=Math.PI*1.5,gt=0,vt=0;vt<Bt;vt++)gt=2*Math.PI/Bt*vt+st,nt[vt]=new go.Point(ht+et*Math.cos(gt),ht+et*Math.sin(gt));return nt.push(nt[0]),nt}function ie(Bt){var nt=Ee(Bt),et=ne();et[0]=nt[0];for(var ht=1,st=1;ht<nt.length;ht+=2,st+=3)et[st]=nt[ht],et[st+1]=nt[ht],et[st+2]=nt[ht+1];return Rt(nt),et}function Ee(Bt){for(var nt=Ae(Bt),et=ne(),ht=Math.floor(nt.length/2),st=nt.length-1,gt=Bt%2===0?2:1,vt=0;vt<st;vt++){var St=nt[vt],Et=nt[vt+1],Tt=nt[(ht+vt-1)%st],Dt=nt[(ht+vt+gt)%st];et[vt*2]=St,et[vt*2+1]=le(St.x,St.y,Tt.x,Tt.y,Et.x,Et.y,Dt.x,Dt.y,new go.Point)}return et[et.length]=et[0],Rt(nt),et}go.Shape.defineFigureGenerator("Pentagon",function(Bt,nt,et){var ht=Ae(5),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<5;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Rt(ht),st.spot1=new go.Spot(.2,.22),st.spot2=new go.Spot(.8,.9),st}),go.Shape.defineFigureGenerator("Hexagon",function(Bt,nt,et){var ht=Ae(6),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<6;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Rt(ht),st.spot1=new go.Spot(.07,.25),st.spot2=new go.Spot(.93,.75),st}),go.Shape.defineFigureGenerator("Heptagon",function(Bt,nt,et){var ht=Ae(7),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<7;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Rt(ht),st.spot1=new go.Spot(.2,.15),st.spot2=new go.Spot(.8,.85),st}),go.Shape.defineFigureGenerator("Octagon",function(Bt,nt,et){var ht=Ae(8),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<8;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Rt(ht),st.spot1=new go.Spot(.15,.15),st.spot2=new go.Spot(.85,.85),st}),go.Shape.defineFigureGenerator("Nonagon",function(Bt,nt,et){var ht=Ae(9),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<9;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Rt(ht),st.spot1=new go.Spot(.17,.13),st.spot2=new go.Spot(.82,.82),st}),go.Shape.defineFigureGenerator("Decagon",function(Bt,nt,et){var ht=Ae(10),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<10;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Rt(ht),st.spot1=new go.Spot(.16,.16),st.spot2=new go.Spot(.84,.84),st}),go.Shape.defineFigureGenerator("Dodecagon",function(Bt,nt,et){var ht=Ae(12),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<12;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Rt(ht),st.spot1=new go.Spot(.16,.16),st.spot2=new go.Spot(.84,.84),st}),go.Shape.defineFigureGenerator("FivePointedStar",function(Bt,nt,et){var ht=Ee(5),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<10;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Rt(ht),st.spot1=new go.Spot(.266,.333),st.spot2=new go.Spot(.733,.733),st}),go.Shape.defineFigureGenerator("SixPointedStar",function(Bt,nt,et){var ht=Ee(6),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<12;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Rt(ht),st.spot1=new go.Spot(.17,.25),st.spot2=new go.Spot(.83,.75),st}),go.Shape.defineFigureGenerator("SevenPointedStar",function(Bt,nt,et){var ht=Ee(7),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<14;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Rt(ht),st.spot1=new go.Spot(.222,.277),st.spot2=new go.Spot(.777,.666),st}),go.Shape.defineFigureGenerator("EightPointedStar",function(Bt,nt,et){var ht=Ee(8),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<16;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Rt(ht),st.spot1=new go.Spot(.25,.25),st.spot2=new go.Spot(.75,.75),st}),go.Shape.defineFigureGenerator("NinePointedStar",function(Bt,nt,et){var ht=Ee(9),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<18;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Rt(ht),st.spot1=new go.Spot(.222,.277),st.spot2=new go.Spot(.777,.666),st}),go.Shape.defineFigureGenerator("TenPointedStar",function(Bt,nt,et){var ht=Ee(10),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<20;vt++)gt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return gt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Rt(ht),st.spot1=new go.Spot(.281,.261),st.spot2=new go.Spot(.723,.748),st}),go.Shape.defineFigureGenerator("FivePointedBurst",function(Bt,nt,et){var ht=ie(5),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<ht.length;vt+=3)gt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return gt.segments.last().close(),Rt(ht),st.spot1=new go.Spot(.222,.277),st.spot2=new go.Spot(.777,.777),st}),go.Shape.defineFigureGenerator("SixPointedBurst",function(Bt,nt,et){var ht=ie(6),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<ht.length;vt+=3)gt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return gt.segments.last().close(),Rt(ht),st.spot1=new go.Spot(.17,.222),st.spot2=new go.Spot(.833,.777),st}),go.Shape.defineFigureGenerator("SevenPointedBurst",function(Bt,nt,et){var ht=ie(7),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<ht.length;vt+=3)gt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return gt.segments.last().close(),Rt(ht),st.spot1=new go.Spot(.222,.222),st.spot2=new go.Spot(.777,.777),st}),go.Shape.defineFigureGenerator("EightPointedBurst",function(Bt,nt,et){var ht=ie(8),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<ht.length;vt+=3)gt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return gt.segments.last().close(),Rt(ht),st.spot1=new go.Spot(.222,.222),st.spot2=new go.Spot(.777,.777),st}),go.Shape.defineFigureGenerator("NinePointedBurst",function(Bt,nt,et){var ht=ie(9),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<ht.length;vt+=3)gt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return gt.segments.last().close(),Rt(ht),st.spot1=new go.Spot(.222,.222),st.spot2=new go.Spot(.777,.777),st}),go.Shape.defineFigureGenerator("TenPointedBurst",function(Bt,nt,et){var ht=ie(10),st=new go.Geometry,gt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);st.add(gt);for(var vt=1;vt<ht.length;vt+=3)gt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return gt.segments.last().close(),Rt(ht),st.spot1=new go.Spot(.222,.222),st.spot2=new go.Spot(.777,.777),st}),go.Shape.setFigureParameter("FramedRectangle",0,new Dn("ThicknessX",8)),go.Shape.setFigureParameter("FramedRectangle",1,new Dn("ThicknessY",8)),go.Shape.defineFigureGenerator("FramedRectangle",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN,st=Bt?Bt.parameter2:NaN;isNaN(ht)&&(ht=8),isNaN(st)&&(st=8);var gt=new go.Geometry,vt=new go.PathFigure(0,0,!0);return gt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht<nt/2&&st<et/2&&(vt.add(new go.PathSegment(go.PathSegment.Move,ht,st)),vt.add(new go.PathSegment(go.PathSegment.Line,ht,et-st)),vt.add(new go.PathSegment(go.PathSegment.Line,nt-ht,et-st)),vt.add(new go.PathSegment(go.PathSegment.Line,nt-ht,st).close())),gt.setSpots(0,0,1,1,ht,st,-ht,-st),gt}),go.Shape.setFigureParameter("Ring",0,new Dn("Thickness",8)),go.Shape.defineFigureGenerator("Ring",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=8);var st=nt/2,gt=new go.Geometry,vt=new go.PathFigure(nt,nt/2,!0);gt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Arc,0,360,st,st,st,st).close());var St=Math.max(st-ht,0);return St>0&&(vt.add(new go.PathSegment(go.PathSegment.Move,nt/2+St,nt/2)),vt.add(new go.PathSegment(go.PathSegment.Arc,0,-360,st,st,St,St).close())),gt.spot1=ue,gt.spot2=It,gt.defaultStretch=go.GraphObject.Uniform,gt}),go.Shape.defineFigureGenerator("Cloud",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(.08034461*nt,.1944299*et,!0).add(new go.PathSegment(go.PathSegment.Bezier,.2008615*nt,.05349299*et,-.09239631*nt,.07836421*et,.1406031*nt,-.0542823*et)).add(new go.PathSegment(go.PathSegment.Bezier,.4338609*nt,.074219*et,.2450511*nt,-.00697547*et,.3776197*nt,-.01112067*et)).add(new go.PathSegment(go.PathSegment.Bezier,.6558228*nt,.07004196*et,.4539471*nt,0,.6066018*nt,-.02526587*et)).add(new go.PathSegment(go.PathSegment.Bezier,.8921095*nt,.08370865*et,.6914277*nt,-.01904177*et,.8921095*nt,-.01220843*et)).add(new go.PathSegment(go.PathSegment.Bezier,.9147671*nt,.3194596*et,1.036446*nt,.04105738*et,1.020377*nt,.3022052*et)).add(new go.PathSegment(go.PathSegment.Bezier,.9082935*nt,.562044*et,1.04448*nt,.360238*et,.992256*nt,.5219009*et)).add(new go.PathSegment(go.PathSegment.Bezier,.9212406*nt,.8217117*et,1.032337*nt,.5771781*et,1.018411*nt,.8120651*et)).add(new go.PathSegment(go.PathSegment.Bezier,.7592566*nt,.9156953*et,1.028411*nt,.9571472*et,.8556702*nt,1.052487*et)).add(new go.PathSegment(go.PathSegment.Bezier,.5101666*nt,.9310455*et,.7431877*nt,1.009325*et,.5624123*nt,1.021761*et)).add(new go.PathSegment(go.PathSegment.Bezier,.2609328*nt,.9344623*et,.4820677*nt,1.031761*et,.3030112*nt,1.002796*et)).add(new go.PathSegment(go.PathSegment.Bezier,.08034461*nt,.870098*et,.2329994*nt,1.01518*et,.03213784*nt,1.01518*et)).add(new go.PathSegment(go.PathSegment.Bezier,.06829292*nt,.6545475*et,-.02812061*nt,.9032597*et,-.01205169*nt,.6835638*et)).add(new go.PathSegment(go.PathSegment.Bezier,.06427569*nt,.4265613*et,-.01812061*nt,.6089503*et,-.00606892*nt,.4555777*et)).add(new go.PathSegment(go.PathSegment.Bezier,.08034461*nt,.1944299*et,-.01606892*nt,.3892545*et,-.01205169*nt,.1944299*et))).setSpots(.1,.1,.9,.9)}),go.Shape.defineFigureGenerator("StopSign",function(Bt,nt,et){var ht=1/(Math.SQRT2+2);return new go.Geometry().add(new go.PathFigure(ht*nt,0,!0).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,ht*et)).add(new go.PathSegment(go.PathSegment.Line,nt,(1-ht)*et)).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,et)).add(new go.PathSegment(go.PathSegment.Line,ht*nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,(1-ht)*et)).add(new go.PathSegment(go.PathSegment.Line,0,ht*et).close())).setSpots(ht/2,ht/2,1-ht/2,1-ht/2)}),go.Shape.setFigureParameter("Pie",0,new Dn("Start",0,-360,360)),go.Shape.setFigureParameter("Pie",1,new Dn("Sweep",315,-360,360)),go.Shape.defineFigureGenerator("Pie",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN,st=Bt?Bt.parameter2:NaN;isNaN(ht)&&(ht=0),isNaN(st)&&(st=315);var gt=ht%360;gt<0&&(gt+=360);var vt=st%360,St=Math.min(nt,et)/2;return new go.Geometry().add(new go.PathFigure(St,St).add(new go.PathSegment(go.PathSegment.Arc,gt,vt,St,St,St,St).close()))}),go.Shape.defineFigureGenerator("PiePiece",function(Bt,nt,et){var ht=qt/Math.SQRT2*.5,st=Math.SQRT2/2,gt=1-Math.SQRT2/2;return new go.Geometry().add(new go.PathFigure(nt,et,!0).add(new go.PathSegment(go.PathSegment.Bezier,st*nt,gt*et,nt,(1-ht)*et,(st+ht)*nt,(gt+ht)*et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close()))}),go.Shape.setFigureParameter("ThickCross",0,new Dn("Thickness",30)),go.Shape.defineFigureGenerator("ThickCross",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=30);var st=Math.min(ht,nt)/2,gt=nt/2,vt=et/2;return new go.Geometry().add(new go.PathFigure(gt-st,0,!0).add(new go.PathSegment(go.PathSegment.Line,gt+st,0)).add(new go.PathSegment(go.PathSegment.Line,gt+st,vt-st)).add(new go.PathSegment(go.PathSegment.Line,nt,vt-st)).add(new go.PathSegment(go.PathSegment.Line,nt,vt+st)).add(new go.PathSegment(go.PathSegment.Line,gt+st,vt+st)).add(new go.PathSegment(go.PathSegment.Line,gt+st,et)).add(new go.PathSegment(go.PathSegment.Line,gt-st,et)).add(new go.PathSegment(go.PathSegment.Line,gt-st,vt+st)).add(new go.PathSegment(go.PathSegment.Line,0,vt+st)).add(new go.PathSegment(go.PathSegment.Line,0,vt-st)).add(new go.PathSegment(go.PathSegment.Line,gt-st,vt-st).close()))}),go.Shape.setFigureParameter("ThinCross",0,new Dn("Thickness",10)),go.Shape.defineFigureGenerator("ThinCross",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=10);var st=Math.min(ht,nt)/2,gt=nt/2,vt=et/2;return new go.Geometry().add(new go.PathFigure(gt-st,0,!0).add(new go.PathSegment(go.PathSegment.Line,gt+st,0)).add(new go.PathSegment(go.PathSegment.Line,gt+st,vt-st)).add(new go.PathSegment(go.PathSegment.Line,nt,vt-st)).add(new go.PathSegment(go.PathSegment.Line,nt,vt+st)).add(new go.PathSegment(go.PathSegment.Line,gt+st,vt+st)).add(new go.PathSegment(go.PathSegment.Line,gt+st,et)).add(new go.PathSegment(go.PathSegment.Line,gt-st,et)).add(new go.PathSegment(go.PathSegment.Line,gt-st,vt+st)).add(new go.PathSegment(go.PathSegment.Line,0,vt+st)).add(new go.PathSegment(go.PathSegment.Line,0,vt-st)).add(new go.PathSegment(go.PathSegment.Line,gt-st,vt-st).close()))}),go.Shape.setFigureParameter("ThickX",0,new Dn("Thickness",30)),go.Shape.defineFigureGenerator("ThickX",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;if((isNaN(ht)||ht<0)&&(ht=30),nt===0||et===0){var st=new go.Geometry(go.Geometry.Rectangle);return st.startX=0,st.startY=0,st.endX=nt,st.endY=et,st}else{var gt=nt/2,vt=et/2,St=Math.atan2(et,nt),Et=ht-Math.min(Math.cos(St)*ht/2,gt),Tt=ht-Math.min(Math.sin(St)*ht/2,vt),st=new go.Geometry,Dt=new go.PathFigure(Et,0,!0);return st.add(Dt),Dt.add(new go.PathSegment(go.PathSegment.Line,gt,.2*et)),Dt.add(new go.PathSegment(go.PathSegment.Line,nt-Et,0)),Dt.add(new go.PathSegment(go.PathSegment.Line,nt,Tt)),Dt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,vt)),Dt.add(new go.PathSegment(go.PathSegment.Line,nt,et-Tt)),Dt.add(new go.PathSegment(go.PathSegment.Line,nt-Et,et)),Dt.add(new go.PathSegment(go.PathSegment.Line,gt,.8*et)),Dt.add(new go.PathSegment(go.PathSegment.Line,Et,et)),Dt.add(new go.PathSegment(go.PathSegment.Line,0,et-Tt)),Dt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,vt)),Dt.add(new go.PathSegment(go.PathSegment.Line,0,Tt).close()),st}}),go.Shape.setFigureParameter("ThinX",0,new Dn("Thickness",10)),go.Shape.defineFigureGenerator("ThinX",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=10);var st=new go.Geometry,gt=new go.PathFigure(.1*nt,0,!0);return st.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.4*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,.1*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,.9*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,.1*et).close()),st}),go.Shape.setFigureParameter("SquareIBeam",0,new Dn("BeamWidth",.2,.1,.9)),go.Shape.defineFigureGenerator("SquareIBeam",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.2);var st=new go.Geometry,gt=new go.PathFigure(0,0,!0);return st.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,ht*et)),gt.add(new go.PathSegment(go.PathSegment.Line,(.5+ht/2)*nt,ht*et)),gt.add(new go.PathSegment(go.PathSegment.Line,(.5+ht/2)*nt,(1-ht)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,(1-ht)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,(1-ht)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,(.5-ht/2)*nt,(1-ht)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,(.5-ht/2)*nt,ht*et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,ht*et).close()),st}),go.Shape.setFigureParameter("RoundedIBeam",0,new Dn("Curviness",.5,.05,.65)),go.Shape.defineFigureGenerator("RoundedIBeam",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.5);var st=new go.Geometry,gt=new go.PathFigure(0,0,!0);return st.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Bezier,nt,et,Math.abs(1-ht)*nt,.25*et,Math.abs(1-ht)*nt,.75*et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,0,0,ht*nt,.75*et,ht*nt,.25*et).close()),st}),go.Shape.defineFigureGenerator("HalfEllipse",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,qt*nt,0,nt,(.5-qt/2)*et)).add(new go.PathSegment(go.PathSegment.Bezier,0,et,nt,(.5+qt/2)*et,qt*nt,et).close())).setSpots(0,.156,.844,.844)}),go.Shape.defineFigureGenerator("Crescent",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Bezier,0,et,nt,0,nt,et)).add(new go.PathSegment(go.PathSegment.Bezier,0,0,.5*nt,.75*et,.5*nt,.25*et).close())).setSpots(.311,.266,.744,.744)}),go.Shape.defineFigureGenerator("Heart",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(.5*nt,et,!0).add(new go.PathSegment(go.PathSegment.Bezier,0,.3*et,.1*nt,.8*et,0,.5*et)).add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.3*et,0,0,.45*nt,0)).add(new go.PathSegment(go.PathSegment.Bezier,nt,.3*et,.55*nt,0,nt,0)).add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,.5*et,.9*nt,.8*et).close())).setSpots(.14,.29,.86,.78)}),go.Shape.defineFigureGenerator("Spade",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(.5*nt,0,!0).add(new go.PathSegment(go.PathSegment.Line,.51*nt,.01*et)).add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,.6*nt,.2*et,nt,.25*et)).add(new go.PathSegment(go.PathSegment.Bezier,.55*nt,.7*et,nt,.8*et,.6*nt,.8*et)).add(new go.PathSegment(go.PathSegment.Bezier,.75*nt,et,.5*nt,.75*et,.55*nt,.95*et)).add(new go.PathSegment(go.PathSegment.Line,.25*nt,et)).add(new go.PathSegment(go.PathSegment.Bezier,.45*nt,.7*et,.45*nt,.95*et,.5*nt,.75*et)).add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,.4*nt,.8*et,0,.8*et)).add(new go.PathSegment(go.PathSegment.Bezier,.49*nt,.01*et,0,.25*et,.4*nt,.2*et).close())).setSpots(.14,.26,.86,.78)}),go.Shape.defineFigureGenerator("Club",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.4*nt,.6*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,.15*nt,et,.5*nt,.75*et,.45*nt,.95*et)),st.add(new go.PathSegment(go.PathSegment.Line,.85*nt,et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.6*nt,.6*et,.55*nt,.95*et,.5*nt,.75*et));var gt=.2,vt=.3,St=0,Et=gt*qt;return st.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5+gt+St)*et,(.5-gt+vt)*nt,(.5+Et+St)*et,(.5-Et+vt)*nt,(.5+gt+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+gt+vt)*nt,(.5+St)*et,(.5+Et+vt)*nt,(.5+gt+St)*et,(.5+gt+vt)*nt,(.5+Et+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5-gt+St)*et,(1-.5+gt+vt)*nt,(.5-Et+St)*et,(.5+Et+vt)*nt,(.5-gt+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.65*nt,.36771243*et,(.5-Et+vt)*nt,(.5-gt+St)*et,(.5-gt+vt+.05)*nt,(.5-Et+St-.02)*et)),gt=.2,vt=0,St=-.3,Et=gt*qt,st.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+gt+vt)*nt,(.5+St)*et,(.5+Et+vt)*nt,(.5+gt+St)*et,(.5+gt+vt)*nt,(.5+Et+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5-gt+St)*et,(1-.5+gt+vt)*nt,(.5-Et+St)*et,(.5+Et+vt)*nt,(.5-gt+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5-gt+vt)*nt,(.5+St)*et,(.5-Et+vt)*nt,(.5-gt+St)*et,(.5-gt+vt)*nt,(.5-Et+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5-Et+vt)*nt,(.5+gt+St)*et,(.5-gt+vt)*nt,(.5+Et+St)*et,(.5-Et+vt)*nt,(.5+gt+St)*et)),gt=.2,vt=-.3,St=0,Et=gt*qt,st.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5-gt+St)*et,(1-.5+gt+vt-.05)*nt,(.5-Et+St-.02)*et,(.5+Et+vt)*nt,(.5-gt+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5-gt+vt)*nt,(.5+St)*et,(.5-Et+vt)*nt,(.5-gt+St)*et,(.5-gt+vt)*nt,(.5-Et+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5+gt+St)*et,(.5-gt+vt)*nt,(.5+Et+St)*et,(.5-Et+vt)*nt,(.5+gt+St)*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.4*nt,.6*et,(.5+Et+vt)*nt,(.5+gt+St)*et,(.5+gt+vt)*nt,(.5+Et+St)*et).close()),ht.setSpots(.06,.33,.93,.68),ht}),go.Shape.defineFigureGenerator("YinYang",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*.5,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Arc,270,180,nt*.5,nt*.5,nt*.5,nt*.5)),st.add(new go.PathSegment(go.PathSegment.Arc,90,-180,nt*.5,nt*.75,nt*.25,nt*.25)),st.add(new go.PathSegment(go.PathSegment.Arc,90,180,nt*.5,nt*.25,nt*.25,nt*.25));var gt=.1,vt=.5,St=.25;return st.add(new go.PathSegment(go.PathSegment.Move,(vt+gt)*nt,St*et)),st.add(new go.PathSegment(go.PathSegment.Arc,0,-360,nt*vt,et*St,gt*nt,gt*nt).close()),st=new go.PathFigure(nt*.5,0,!1),ht.add(st),st.add(new go.PathSegment(go.PathSegment.Arc,270,-180,nt*.5,nt*.5,nt*.5,nt*.5)),St=.75,st=new go.PathFigure((vt+gt)*nt,St*et,!0),ht.add(st),st.add(new go.PathSegment(go.PathSegment.Arc,0,360,nt*vt,et*St,gt*nt,gt*nt).close()),ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("Peace",function(Bt,nt,et){var ht=.8535533905932737,st=.5*nt,gt=.5*et;return new go.Geometry().add(new go.PathFigure(st,0,!1).add(new go.PathSegment(go.PathSegment.Arc,270,360,st,gt,st,gt)).add(new go.PathSegment(go.PathSegment.Line,st,et)).add(new go.PathSegment(go.PathSegment.Move,st,gt)).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,ht*et)).add(new go.PathSegment(go.PathSegment.Move,st,gt)).add(new go.PathSegment(go.PathSegment.Line,ht*nt,ht*et)))}),go.Shape.defineFigureGenerator("NotAllowed",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.5,gt=.5,vt=.5,St=.5,Et=new go.PathFigure(vt*nt,(St-gt)*et);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-gt)*nt,St*et,(vt-st)*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+gt)*et,(vt-gt)*nt,(St+st)*et,(vt-st)*nt,(St+gt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,St*et,(vt+st)*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-gt)*et,(vt+gt)*nt,(St-st)*et,(vt+st)*nt,(St-gt)*et)),gt=.4,st=qt*.4;var Tt=pt(),Dt=pt(),Jt=pt(),Yt=pt();Me(vt,St-gt,vt+st,St-gt,vt+gt,St-st,vt+gt,St,.42,Tt,Dt,Jt,Yt,Yt);var Gt=pt(),me=pt(),ae=pt();Me(vt,St-gt,vt+st,St-gt,vt+gt,St-st,vt+gt,St,.58,Yt,Yt,ae,Gt,me);var Ne=pt(),Ce=pt(),we=pt();Me(vt,St+gt,vt-st,St+gt,vt-gt,St+st,vt-gt,St,.42,Ne,Ce,we,Yt,Yt);var tn=pt(),_e=pt(),an=pt();return Me(vt,St+gt,vt-st,St+gt,vt-gt,St+st,vt-gt,St,.58,Yt,Yt,an,tn,_e),Et.add(new go.PathSegment(go.PathSegment.Move,an.x*nt,an.y*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-gt)*nt,St*et,tn.x*nt,tn.y*et,_e.x*nt,_e.y*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et,(vt-st)*nt,(St-gt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,Jt.x*nt,Jt.y*et,Tt.x*nt,Tt.y*et,Dt.x*nt,Dt.y*et)),Et.add(new go.PathSegment(go.PathSegment.Line,an.x*nt,an.y*et).close()),Et.add(new go.PathSegment(go.PathSegment.Move,we.x*nt,we.y*et)),Et.add(new go.PathSegment(go.PathSegment.Line,ae.x*nt,ae.y*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,St*et,Gt.x*nt,Gt.y*et,me.x*nt,me.y*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et,(vt+st)*nt,(St+gt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,we.x*nt,we.y*et,Ne.x*nt,Ne.y*et,Ce.x*nt,Ce.y*et).close()),Ut(Tt),Ut(Dt),Ut(Jt),Ut(Yt),Ut(Gt),Ut(me),Ut(ae),Ut(Ne),Ut(Ce),Ut(we),Ut(tn),Ut(_e),Ut(an),ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("Fragile",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,.25*nt,0)).add(new go.PathSegment(go.PathSegment.Line,.2*nt,.15*et)).add(new go.PathSegment(go.PathSegment.Line,.3*nt,.25*et)).add(new go.PathSegment(go.PathSegment.Line,.29*nt,.33*et)).add(new go.PathSegment(go.PathSegment.Line,.35*nt,.25*et)).add(new go.PathSegment(go.PathSegment.Line,.3*nt,.15*et)).add(new go.PathSegment(go.PathSegment.Line,.4*nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Bezier,.55*nt,.5*et,nt,.25*et,.75*nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,.55*nt,.9*et)).add(new go.PathSegment(go.PathSegment.Line,.7*nt,.9*et)).add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)).add(new go.PathSegment(go.PathSegment.Line,.3*nt,et)).add(new go.PathSegment(go.PathSegment.Line,.3*nt,.9*et)).add(new go.PathSegment(go.PathSegment.Line,.45*nt,.9*et)).add(new go.PathSegment(go.PathSegment.Line,.45*nt,.5*et)).add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*nt,.5*et,0,.25*et).close()))}),go.Shape.setFigureParameter("HourGlass",0,new Dn("Thickness",30)),go.Shape.defineFigureGenerator("HourGlass",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=30),ht>nt&&(ht=nt);var st=(nt-ht)/2,gt=st+ht;return new go.Geometry().add(new go.PathFigure(gt,.5*et).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et)).add(new go.PathSegment(go.PathSegment.Line,st,.5*et)).add(new go.PathSegment(go.PathSegment.Line,0,0)).add(new go.PathSegment(go.PathSegment.Line,nt,0).close()))}),go.Shape.defineFigureGenerator("Lightning",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,.55*et).add(new go.PathSegment(go.PathSegment.Line,.6*nt,0)).add(new go.PathSegment(go.PathSegment.Line,.3*nt,.45*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.45*et)).add(new go.PathSegment(go.PathSegment.Line,.4*nt,et)).add(new go.PathSegment(go.PathSegment.Line,.7*nt,.55*et).close()))}),go.Shape.defineFigureGenerator("GenderMale",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.4,gt=.4,vt=.5,St=.5,Et=pt(),Tt=pt(),Dt=pt(),Jt=pt(),Yt=new go.PathFigure((vt-gt)*nt,St*et,!1);ht.add(Yt),Yt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et,(vt-st)*nt,(St-gt)*et)),Me(vt,St-gt,vt+st,St-gt,vt+gt,St-st,vt+gt,St,.44,Dt,Jt,Tt,Et,Et),Yt.add(new go.PathSegment(go.PathSegment.Bezier,Tt.x*nt,Tt.y*et,Dt.x*nt,Dt.y*et,Jt.x*nt,Jt.y*et));var Gt=kt(Tt.x,Tt.y);Me(vt,St-gt,vt+st,St-gt,vt+gt,St-st,vt+gt,St,.56,Et,Et,Tt,Dt,Jt);var me=kt(Tt.x,Tt.y);Yt.add(new go.PathSegment(go.PathSegment.Line,(Gt.x*.1+.95*.9)*nt,Gt.y*.1*et)),Yt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,Gt.y*.1*et)),Yt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,0)),Yt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),Yt.add(new go.PathSegment(go.PathSegment.Line,nt,.15*et)),Yt.add(new go.PathSegment(go.PathSegment.Line,(me.x*.1+.9)*nt,.15*et)),Yt.add(new go.PathSegment(go.PathSegment.Line,(me.x*.1+.9)*nt,(me.y*.1+.05*.9)*et)),Yt.add(new go.PathSegment(go.PathSegment.Line,me.x*nt,me.y*et)),Yt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,St*et,Dt.x*nt,Dt.y*et,Jt.x*nt,Jt.y*et)),Yt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et,(vt+st)*nt,(St+gt)*et)),Yt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-gt)*nt,St*et,(vt-st)*nt,(St+gt)*et,(vt-gt)*nt,(St+st)*et)),gt=.35,st=qt*.35;var ae=new go.PathFigure(vt*nt,(St-gt)*et,!1);ht.add(ae),ae.add(new go.PathSegment(go.PathSegment.Bezier,(vt-gt)*nt,St*et,(vt-st)*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et)),ae.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+gt)*et,(vt-gt)*nt,(St+st)*et,(vt-st)*nt,(St+gt)*et)),ae.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,St*et,(vt+st)*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),ae.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-gt)*et,(vt+gt)*nt,(St-st)*et,(vt+st)*nt,(St-gt)*et));var Ne=new go.PathFigure((vt-gt)*nt,St*et,!1);return ht.add(Ne),Ut(Et),Ut(Tt),Ut(Dt),Ut(Jt),Ut(Gt),Ut(me),ht.spot1=new go.Spot(.202,.257),ht.spot2=new go.Spot(.792,.739),ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("GenderFemale",function(Bt,nt,et){var ht=new go.Geometry,st=.375,gt=0,vt=-.125,St=st*qt,Et=new go.PathFigure((.525+gt)*nt,(.5+st+vt)*et,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+st+gt)*nt,(.5+vt)*et,(.5+St+gt)*nt,(.5+st+vt)*et,(.5+st+gt)*nt,(.5+St+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5+gt)*nt,(.5-st+vt)*et,(1-.5+st+gt)*nt,(.5-St+vt)*et,(.5+St+gt)*nt,(.5-st+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5-st+gt)*nt,(.5+vt)*et,(.5-St+gt)*nt,(.5-st+vt)*et,(.5-st+gt)*nt,(.5-St+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.475+gt)*nt,(.5+st+vt)*et,(.5-st+gt)*nt,(.5+St+vt)*et,(.5-St+gt)*nt,(.5+st+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.475*nt,.85*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.425*nt,.85*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.425*nt,.9*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.475*nt,.9*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.475*nt,et)),Et.add(new go.PathSegment(go.PathSegment.Line,.525*nt,et)),Et.add(new go.PathSegment(go.PathSegment.Line,.525*nt,.9*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.575*nt,.9*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.575*nt,.85*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.525*nt,.85*et).close()),st=.325,gt=0,vt=-.125,St=st*qt;var Et=new go.PathFigure((1-.5+st+gt)*nt,(.5+vt)*et,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5+gt)*nt,(.5+st+vt)*et,(.5+st+gt)*nt,(.5+St+vt)*et,(.5+St+gt)*nt,(.5+st+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5-st+gt)*nt,(.5+vt)*et,(.5-St+gt)*nt,(.5+st+vt)*et,(.5-st+gt)*nt,(.5+St+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(.5+gt)*nt,(.5-st+vt)*et,(.5-st+gt)*nt,(.5-St+vt)*et,(.5-St+gt)*nt,(.5-st+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+st+gt)*nt,(.5+vt)*et,(.5+St+gt)*nt,(.5-st+vt)*et,(1-.5+st+gt)*nt,(.5-St+vt)*et));var Et=new go.PathFigure((.525+gt)*nt,(.5+st+vt)*et,!1);return ht.add(Et),ht.spot1=new go.Spot(.232,.136),ht.spot2=new go.Spot(.682,.611),ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("LogicImplies",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;return isNaN(ht)&&(ht=.2),new go.Geometry().add(new go.PathFigure((1-ht)*nt,0,!1).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,et)).add(new go.PathSegment(go.PathSegment.Move,0,.5*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et))).setSpots(0,0,.8,.5)}),go.Shape.defineFigureGenerator("LogicIff",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;return isNaN(ht)&&(ht=.2),new go.Geometry().add(new go.PathFigure((1-ht)*nt,0,!1).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,et)).add(new go.PathSegment(go.PathSegment.Move,0,.5*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Move,ht*nt,0)).add(new go.PathSegment(go.PathSegment.Line,0,.5*et)).add(new go.PathSegment(go.PathSegment.Line,ht*nt,et))).setSpots(.2,0,.8,.5)}),go.Shape.defineFigureGenerator("LogicNot",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)))}),go.Shape.defineFigureGenerator("LogicAnd",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,et,!1).add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et))).setSpots(.25,.5,.75,1)}),go.Shape.defineFigureGenerator("LogicOr",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)).add(new go.PathSegment(go.PathSegment.Line,nt,0))).setSpots(.219,0,.78,.409)}),go.Shape.defineFigureGenerator("LogicXor",function(Bt,nt,et){var ht=new go.Geometry().add(new go.PathFigure(.5*nt,0,!1).add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)).add(new go.PathSegment(go.PathSegment.Move,0,.5*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Arc,0,360,.5*nt,.5*et,.5*nt,.5*et)));return ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("LogicTruth",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Move,.5*nt,0)).add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)))}),go.Shape.defineFigureGenerator("LogicFalsity",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,et,!1).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Move,.5*nt,et)).add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)))}),go.Shape.defineFigureGenerator("LogicThereExists",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,0,.5*et)).add(new go.PathSegment(go.PathSegment.Move,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et)))}),go.Shape.defineFigureGenerator("LogicForAll",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Move,.25*nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,.75*nt,.5*et))).setSpots(.25,0,.75,.5)}),go.Shape.defineFigureGenerator("LogicIsDefinedAs",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Move,0,.5*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Move,0,et)).add(new go.PathSegment(go.PathSegment.Line,nt,et))).setSpots(.01,.01,.99,.49)}),go.Shape.defineFigureGenerator("LogicIntersect",function(Bt,nt,et){var ht=.5;return new go.Geometry().add(new go.PathFigure(0,et,!1).add(new go.PathSegment(go.PathSegment.Line,0,ht*et)).add(new go.PathSegment(go.PathSegment.Arc,180,180,ht*nt,ht*et,ht*nt,ht*et)).add(new go.PathSegment(go.PathSegment.Line,nt,et))).setSpots(0,.5,1,1)}),go.Shape.defineFigureGenerator("LogicUnion",function(Bt,nt,et){var ht=.5;return new go.Geometry().add(new go.PathFigure(nt,0,!1).add(new go.PathSegment(go.PathSegment.Line,nt,ht*et)).add(new go.PathSegment(go.PathSegment.Arc,0,180,ht*nt,ht*et,ht*nt,ht*et)).add(new go.PathSegment(go.PathSegment.Line,0,0))).setSpots(0,0,1,.5)}),go.Shape.setFigureParameter("Arrow",0,new Dn("ArrowheadWidth",.3,.01,.99)),go.Shape.setFigureParameter("Arrow",1,new Dn("TailHeight",.3,.01,.99)),go.Shape.defineFigureGenerator("Arrow",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.3);var st=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=.3);var gt=(1-ht)*nt,vt=(.5-st/2)*et,St=(.5+st/2)*et,Et=new go.Geometry,Tt=new go.PathFigure(0,vt,!0);Et.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Line,gt,vt)),Tt.add(new go.PathSegment(go.PathSegment.Line,gt,0)),Tt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),Tt.add(new go.PathSegment(go.PathSegment.Line,gt,et)),Tt.add(new go.PathSegment(go.PathSegment.Line,gt,St)),Tt.add(new go.PathSegment(go.PathSegment.Line,0,St).close()),Et.spot1=new go.Spot(0,vt/et);var Dt=le(0,St/et,1,St/et,gt/nt,1,1,.5,pt());return Et.spot2=new go.Spot(Dt.x,Dt.y),Ut(Dt),Et}),go.Shape.setFigureParameter("Arrow2",0,new Dn("ArrowheadWidth",30)),go.Shape.setFigureParameter("Arrow2",0,new Dn("TailHeight",30)),go.Shape.defineFigureGenerator("Arrow2",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=30),ht>nt&&(ht=nt);var st=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=30),st=Math.min(st,et/2);var gt=nt-ht,vt=(et-st)/2,St=vt+st,Et=new go.Geometry,Tt=new go.PathFigure(0,vt,!0);Et.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Line,gt,vt)),Tt.add(new go.PathSegment(go.PathSegment.Line,gt,0)),Tt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),Tt.add(new go.PathSegment(go.PathSegment.Line,gt,et)),Tt.add(new go.PathSegment(go.PathSegment.Line,gt,St)),Tt.add(new go.PathSegment(go.PathSegment.Line,0,St).close()),Et.spot1=new go.Spot(0,vt/et);var Dt=le(0,St/et,1,St/et,gt/nt,1,1,.5,pt());return Et.spot2=new go.Spot(Dt.x,Dt.y),Ut(Dt),Et}),go.Shape.defineFigureGenerator("Chevron",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et).close()),ht}),go.Shape.defineFigureGenerator("DoubleArrow",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,.214*et)),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,1*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,1*et)),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,.786*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,1*et).close()),ht}),go.Shape.setFigureParameter("DoubleEndArrow",0,new Dn("ConnecterHeight",.3,.01,.99)),go.Shape.defineFigureGenerator("DoubleEndArrow",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.3);var st=(.5-ht/2)*et,gt=(.5+ht/2)*et,vt=new go.Geometry,St=new go.PathFigure(nt,.5*et,!0);vt.add(St),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,gt)),St.add(new go.PathSegment(go.PathSegment.Line,.3*nt,gt)),St.add(new go.PathSegment(go.PathSegment.Line,.3*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,0,.5*et)),St.add(new go.PathSegment(go.PathSegment.Line,.3*nt,0)),St.add(new go.PathSegment(go.PathSegment.Line,.3*nt,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,0).close());var Et=le(0,.5,.3,0,0,st/et,.1,st/et,pt());return vt.spot1=new go.Spot(Et.x,Et.y),Et=le(.7,1,1,.5,0,gt/et,1,gt/et,Et),vt.spot2=new go.Spot(Et.x,Et.y),Ut(Et),vt}),go.Shape.setFigureParameter("DoubleEndArrow2",0,new Dn("ConnecterHeight",40)),go.Shape.setFigureParameter("DoubleEndArrow2",1,new Dn("ArrowHeight",100)),go.Shape.defineFigureGenerator("DoubleEndArrow2",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=40);var st=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=100);var gt=(et-ht)/2,vt=gt+ht,St=(et-st)/2,Et=St+st;(ht>et||st>et)&&(st>ht?(ht=ht*et/st,gt=(et-ht)/2,vt=gt+ht,St=0,Et=et):(gt=0,vt=et,St=0,Et=et));var Tt=new go.Geometry,Dt=new go.PathFigure(nt,.5*et,!0);Tt.add(Dt),Dt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,Et)),Dt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,vt)),Dt.add(new go.PathSegment(go.PathSegment.Line,.3*nt,vt)),Dt.add(new go.PathSegment(go.PathSegment.Line,.3*nt,Et)),Dt.add(new go.PathSegment(go.PathSegment.Line,0,.5*et)),Dt.add(new go.PathSegment(go.PathSegment.Line,.3*nt,St)),Dt.add(new go.PathSegment(go.PathSegment.Line,.3*nt,gt)),Dt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,gt)),Dt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,St).close());var Jt=le(0,.5,.3,St/et,0,gt/et,1,gt/et,pt());return Tt.spot1=new go.Spot(Jt.x,Jt.y),Jt=le(.7,Et/et,1,.5,0,vt/et,1,vt/et,Jt),Tt.spot2=new go.Spot(Jt.x,Jt.y),Ut(Jt),Tt}),go.Shape.setFigureParameter("IBeamArrow",0,new Dn("ConnectorHeight",.7,.51,.97)),go.Shape.defineFigureGenerator("IBeamArrow",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.3);var st=(.5-ht/2)*et,gt=(.5+ht/2)*et,vt=new go.Geometry,St=new go.PathFigure(nt,.5*et,!0);vt.add(St),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,gt)),St.add(new go.PathSegment(go.PathSegment.Line,.2*nt,gt)),St.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,0,et)),St.add(new go.PathSegment(go.PathSegment.Line,0,0)),St.add(new go.PathSegment(go.PathSegment.Line,.2*nt,0)),St.add(new go.PathSegment(go.PathSegment.Line,.2*nt,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,0).close()),vt.spot1=new go.Spot(0,st/et);var Et=le(.7,1,1,.5,0,gt/et,1,gt/et,pt());return vt.spot2=new go.Spot(Et.x,Et.y),Ut(Et),vt}),go.Shape.setFigureParameter("IBeamArrow2",0,new Dn("ConnectorHeight",40)),go.Shape.setFigureParameter("IBeamArrow2",1,new Dn("BeamArrowHeight",100)),go.Shape.defineFigureGenerator("IBeamArrow2",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=40);var st=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=100);var gt=(et-ht)/2,vt=gt+ht,St=(et-st)/2,Et=St+st;(ht>et||st>et)&&(st>ht?(ht=ht*et/st,gt=(et-ht)/2,vt=gt+ht,St=0,Et=et):(gt=0,vt=et,St=0,Et=et));var Tt=new go.Geometry,Dt=new go.PathFigure(nt,.5*et,!0);Tt.add(Dt),Dt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,Et)),Dt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,vt)),Dt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,vt)),Dt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,Et)),Dt.add(new go.PathSegment(go.PathSegment.Line,0,Et)),Dt.add(new go.PathSegment(go.PathSegment.Line,0,St)),Dt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,St)),Dt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,gt)),Dt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,gt)),Dt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,St).close()),Tt.spot1=new go.Spot(0,gt/et);var Jt=le(.7,Et/et,1,.5,0,vt/et,1,vt/et,pt());return Tt.spot2=new go.Spot(Jt.x,Jt.y),Ut(Jt),Tt}),go.Shape.setFigureParameter("Pointer",0,new Dn("BackPoint",.1,0,.2)),go.Shape.defineFigureGenerator("Pointer",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.1);var st=new go.Geometry,gt=new go.PathFigure(nt,.5*et,!0);st.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,0,et)),gt.add(new go.PathSegment(go.PathSegment.Line,ht*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,0).close()),st.spot1=new go.Spot(ht,.35);var vt=le(.2,.65,1,.65,0,1,1,.5,pt());return st.spot2=new go.Spot(vt.x,vt.y),Ut(vt),st}),go.Shape.setFigureParameter("RoundedPointer",0,new Dn("RoundedEdge",.3,0,.5)),go.Shape.defineFigureGenerator("RoundedPointer",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.3);var st=new go.Geometry,gt=new go.PathFigure(nt,.5*et,!0);st.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,0,et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,0,0,ht*nt,.75*et,ht*nt,.25*et).close()),st.spot1=new go.Spot(ht,.35);var vt=le(0,.65,1,.65,0,1,1,.5,pt());return st.spot2=new go.Spot(vt.x,vt.y),Ut(vt),st}),go.Shape.setFigureParameter("SplitEndArrow",0,new Dn("TailHeight",.4,.01,.99)),go.Shape.defineFigureGenerator("SplitEndArrow",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.4);var st=(.5-ht/2)*et,gt=(.5+ht/2)*et,vt=new go.Geometry,St=new go.PathFigure(nt,.5*et,!0);vt.add(St),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,gt)),St.add(new go.PathSegment(go.PathSegment.Line,0,gt)),St.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.5*et)),St.add(new go.PathSegment(go.PathSegment.Line,0,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,0).close()),vt.spot1=new go.Spot(.2,.3);var Et=le(.7,1,1,.5,0,gt/et,1,gt/et,pt());return vt.spot2=new go.Spot(Et.x,Et.y),Ut(Et),vt}),go.Shape.setFigureParameter("SplitEndArrow2",0,new Dn("TailThickness",50)),go.Shape.defineFigureGenerator("SplitEndArrow2",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=50);var st=(et-ht)/2,gt=st+ht;ht>et&&(st=0,gt=et);var vt=new go.Geometry,St=new go.PathFigure(nt,.5*et,!0);vt.add(St),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,gt)),St.add(new go.PathSegment(go.PathSegment.Line,0,gt)),St.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.5*et)),St.add(new go.PathSegment(go.PathSegment.Line,0,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,st)),St.add(new go.PathSegment(go.PathSegment.Line,.7*nt,0).close()),vt.spot1=new go.Spot(.2,st/et);var Et=le(.7,1,1,.5,0,gt/et,1,gt/et,pt());return vt.spot2=new go.Spot(Et.x,Et.y),Ut(Et),vt}),go.Shape.setFigureParameter("SquareArrow",0,new Dn("ArrowPoint",.7,.2,.9)),go.Shape.defineFigureGenerator("SquareArrow",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.7);var st=new go.Geometry,gt=new go.PathFigure(nt,.5*et,!0);return st.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,ht*nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,0)),gt.add(new go.PathSegment(go.PathSegment.Line,ht*nt,0).close()),st.spot1=go.Spot.TopLeft,st.spot2=new go.Spot(ht,1),st}),go.Shape.defineFigureGenerator("Cone1",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.5,gt=qt*.1,vt=new go.PathFigure(0,.9*et,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,(.9+gt)*et,(.5+st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*et,(.5-st)*nt,et,0,(.9+gt)*et).close()),ht.spot1=new go.Spot(.25,.5),ht.spot2=new go.Spot(.75,.97),ht}),go.Shape.defineFigureGenerator("Cone2",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.9*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,nt,.9*et,(1-.85/.9)*nt,et,.85/.9*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,0,.9*et).close());var gt=new go.PathFigure(0,.9*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.9*et,(1-.85/.9)*nt,.8*et,.85/.9*nt,.8*et)),ht.spot1=new go.Spot(.25,.5),ht.spot2=new go.Spot(.75,.82),ht}),go.Shape.defineFigureGenerator("Cube1",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.85*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.15*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,0,.15*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.85*et).close());var gt=new go.PathFigure(.5*nt,et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.3*et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,.15*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.3*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,.15*et)),ht.spot1=new go.Spot(0,.3),ht.spot2=new go.Spot(.5,.85),ht}),go.Shape.defineFigureGenerator("Cube2",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.3*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,0).close());var gt=new go.PathFigure(0,.3*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.3*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Move,.7*nt,.3*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),ht.spot1=new go.Spot(0,.3),ht.spot2=new go.Spot(.7,1),ht}),go.Shape.defineFigureGenerator("Cylinder1",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=5),ht=Math.min(ht,et/3);var st=new go.Geometry,gt=qt*.5,vt=new go.PathFigure(0,ht,!0);st.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,0,qt*ht,(.5-gt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,1*nt,ht,(.5+gt)*nt,0,1*nt,qt*ht)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et-ht)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,1*et,1*nt,et-qt*ht,(.5+gt)*nt,1*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,et-ht,(.5-gt)*nt,1*et,0,et-qt*ht)),vt.add(new go.PathSegment(go.PathSegment.Line,0,ht));var St=new go.PathFigure(nt,ht,!1);return st.add(St),St.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,2*ht,1*nt,2*ht-qt*ht,(.5+gt)*nt,2*ht)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,ht,(.5-gt)*nt,2*ht,0,2*ht-qt*ht)),st.spot1=new go.Spot(0,0,0,2*ht),st.spot2=new go.Spot(1,1),st}),go.Shape.defineFigureGenerator("Cylinder2",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=5),ht=Math.min(ht,et/3);var st=new go.Geometry,gt=qt*.5,vt=new go.PathFigure(0,et-ht,!0);st.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,0,ht)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,0,qt*ht,(.5-gt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,ht,(.5+gt)*nt,0,nt,qt*ht)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et-ht)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,et-qt*ht,(.5+gt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,et-ht,(.5-gt)*nt,et,0,et-qt*ht));var St=new go.PathFigure(0,et-ht,!1);return st.add(St),St.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et-2*ht,0,et-ht-qt*ht,(.5-gt)*nt,et-2*ht)),St.add(new go.PathSegment(go.PathSegment.Bezier,nt,et-ht,(.5+gt)*nt,et-2*ht,nt,et-ht-qt*ht)),st.spot1=new go.Spot(0,0),st.spot2=new go.Spot(1,1,0,-2*ht),st}),go.Shape.defineFigureGenerator("Cylinder3",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=5),ht=Math.min(ht,nt/3);var st=new go.Geometry,gt=qt*.5,vt=new go.PathFigure(ht,0,!0);st.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt-ht,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,nt-qt*ht,0,nt,(.5-gt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,et,nt,(.5+gt)*et,nt-qt*ht,et)),vt.add(new go.PathSegment(go.PathSegment.Line,ht,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,qt*ht,et,0,(.5+gt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,ht,0,0,(.5-gt)*et,qt*ht,0));var St=new go.PathFigure(ht,0,!1);return st.add(St),St.add(new go.PathSegment(go.PathSegment.Bezier,2*ht,.5*et,ht+qt*ht,0,2*ht,(.5-gt)*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,ht,et,2*ht,(.5+gt)*et,ht+qt*ht,et)),st.spot1=new go.Spot(0,0,2*ht,0),st.spot2=new go.Spot(1,1),st}),go.Shape.defineFigureGenerator("Cylinder4",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=5),ht=Math.min(ht,nt/3);var st=new go.Geometry,gt=qt*.5,vt=new go.PathFigure(nt-ht,0,!0);st.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,nt-qt*ht,0,nt,(.5-gt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,et,nt,(.5+gt)*et,nt-qt*ht,et)),vt.add(new go.PathSegment(go.PathSegment.Line,ht,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,qt*ht,et,0,(.5+gt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,ht,0,0,(.5-gt)*et,qt*ht,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt-ht,0));var St=new go.PathFigure(nt-ht,0,!1);return st.add(St),St.add(new go.PathSegment(go.PathSegment.Bezier,nt-2*ht,.5*et,nt-ht-qt*ht,0,nt-2*ht,(.5-gt)*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,et,nt-2*ht,(.5+gt)*et,nt-ht-qt*ht,et)),st.spot1=new go.Spot(0,0),st.spot2=new go.Spot(1,1,-2*ht,0),st}),go.Shape.defineFigureGenerator("Prism1",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.25*nt,.25*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var gt=new go.PathFigure(.25*nt,.25*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),ht.spot1=new go.Spot(.408,.172),ht.spot2=new go.Spot(.833,.662),ht}),go.Shape.defineFigureGenerator("Prism2",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.25*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var gt=new go.PathFigure(0,et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.25*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),gt.add(new go.PathSegment(go.PathSegment.Move,0,.25*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.25*nt,.5*et)),ht.spot1=new go.Spot(.25,.5),ht.spot2=new go.Spot(.75,.75),ht}),go.Shape.defineFigureGenerator("Pyramid1",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.75*et).close());var gt=new go.PathFigure(.5*nt,0,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),ht.spot1=new go.Spot(.25,.367),ht.spot2=new go.Spot(.75,.875),ht}),go.Shape.defineFigureGenerator("Pyramid2",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.85*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.85*et).close());var gt=new go.PathFigure(.5*nt,0,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.7*et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,.85*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.7*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,.85*et)),ht.spot1=new go.Spot(.25,.367),ht.spot2=new go.Spot(.75,.875),ht}),go.Shape.defineFigureGenerator("Actor",function(Bt,nt,et){var ht=new go.Geometry,st=.2,gt=.1,vt=qt*st,St=qt*gt,Et=.5,Tt=.1,Dt=new go.PathFigure(Et*nt,(Tt+gt)*et,!0);ht.add(Dt),Dt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-st)*nt,Tt*et,(Et-vt)*nt,(Tt+gt)*et,(Et-st)*nt,(Tt+St)*et)),Dt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-gt)*et,(Et-st)*nt,(Tt-St)*et,(Et-vt)*nt,(Tt-gt)*et)),Dt.add(new go.PathSegment(go.PathSegment.Bezier,(Et+st)*nt,Tt*et,(Et+vt)*nt,(Tt-gt)*et,(Et+st)*nt,(Tt-St)*et)),Dt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt+gt)*et,(Et+st)*nt,(Tt+St)*et,(Et+vt)*nt,(Tt+gt)*et));var Jt=.05,Yt=qt*Jt;Et=.05,Tt=.25;var Gt=new go.PathFigure(.5*nt,.2*et,!0);return ht.add(Gt),Gt.add(new go.PathSegment(go.PathSegment.Line,.95*nt,.2*et)),Et=.95,Tt=.25,Gt.add(new go.PathSegment(go.PathSegment.Bezier,(Et+Jt)*nt,Tt*et,(Et+Yt)*nt,(Tt-Jt)*et,(Et+Jt)*nt,(Tt-Yt)*et)),Gt.add(new go.PathSegment(go.PathSegment.Line,nt,.6*et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.6*et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.35*et)),Jt=.025,Yt=qt*Jt,Et=.825,Tt=.35,Gt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-Jt)*et,(Et+Jt)*nt,(Tt-Yt)*et,(Et+Yt)*nt,(Tt-Jt)*et)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-Jt)*nt,Tt*et,(Et-Yt)*nt,(Tt-Jt)*et,(Et-Jt)*nt,(Tt-Yt)*et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.7*et)),Jt=.05,Yt=qt*Jt,Et=.5,Tt=.7,Gt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-Jt)*et,(Et+Jt)*nt,(Tt-Yt)*et,(Et+Yt)*nt,(Tt-Jt)*et)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-Jt)*nt,Tt*et,(Et-Yt)*nt,(Tt-Jt)*et,(Et-Jt)*nt,(Tt-Yt)*et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.35*et)),Jt=.025,Yt=qt*Jt,Et=.175,Tt=.35,Gt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-Jt)*et,(Et+Jt)*nt,(Tt-Yt)*et,(Et+Yt)*nt,(Tt-Jt)*et)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-Jt)*nt,Tt*et,(Et-Yt)*nt,(Tt-Jt)*et,(Et-Jt)*nt,(Tt-Yt)*et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.15*nt,.6*et)),Gt.add(new go.PathSegment(go.PathSegment.Line,0,.6*et)),Gt.add(new go.PathSegment(go.PathSegment.Line,0,.25*et)),Jt=.05,Yt=qt*Jt,Et=.05,Tt=.25,Gt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-Jt)*et,(Et-Jt)*nt,(Tt-Yt)*et,(Et-Yt)*nt,(Tt-Jt)*et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.2*et)),ht.spot1=new go.Spot(.2,.2),ht.spot2=new go.Spot(.8,.65),ht}),go.Shape.setFigureParameter("Card",0,new Dn("CornerCutoutSize",.2,.1,.9)),go.Shape.defineFigureGenerator("Card",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;isNaN(ht)&&(ht=.2);var st=new go.Geometry,gt=new go.PathFigure(nt,0,!0);return st.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,ht*et)),gt.add(new go.PathSegment(go.PathSegment.Line,ht*nt,0).close()),st.spot1=new go.Spot(0,ht),st.spot2=go.Spot.BottomRight,st}),go.Shape.defineFigureGenerator("Collate",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,.5*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et));var gt=new go.PathFigure(.5*nt,.5*et,!0);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et)),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),ht.spot1=new go.Spot(.25,0),ht.spot2=new go.Spot(.75,.25),ht}),go.Shape.defineFigureGenerator("CreateRequest",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.1);var gt=new go.PathFigure(0,0,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure(0,st*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,st*et)),vt.add(new go.PathSegment(go.PathSegment.Move,0,(1-st)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,(1-st)*et)),ht}),go.Shape.defineFigureGenerator("Database",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.5,gt=qt*.1,vt=new go.PathFigure(nt,.1*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,(.9+gt)*et,(.5+st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*et,(.5-st)*nt,et,0,(.9+gt)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.1*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,0,(.1-gt)*et,(.5-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.1*et,(.5+st)*nt,0,nt,(.1-gt)*et));var St=new go.PathFigure(nt,.1*et,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.2*et,nt,(.1+gt)*et,(.5+st)*nt,.2*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,.1*et,(.5-st)*nt,.2*et,0,(.1+gt)*et)),St.add(new go.PathSegment(go.PathSegment.Move,nt,.2*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.3*et,nt,(.2+gt)*et,(.5+st)*nt,.3*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,.2*et,(.5-st)*nt,.3*et,0,(.2+gt)*et)),St.add(new go.PathSegment(go.PathSegment.Move,nt,.3*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.4*et,nt,(.3+gt)*et,(.5+st)*nt,.4*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,.3*et,(.5-st)*nt,.4*et,0,(.3+gt)*et)),ht.spot1=new go.Spot(0,.4),ht.spot2=new go.Spot(1,.9),ht}),go.Shape.defineFigureGenerator("DataStorage",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,.75*nt,et,nt,0,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*nt,.9*et,.25*nt,.1*et).close()),ht.spot1=new go.Spot(.226,0),ht.spot2=new go.Spot(.81,1),ht}),go.Shape.defineFigureGenerator("DiskStorage",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.5,gt=qt*.1,vt=new go.PathFigure(nt,.1*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,(.9+gt)*et,(.5+st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*et,(.5-st)*nt,et,0,(.9+gt)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.1*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,0,(.1-gt)*et,(.5-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.1*et,(.5+st)*nt,0,nt,(.1-gt)*et));var St=new go.PathFigure(nt,.1*et,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.2*et,nt,(.1+gt)*et,(.5+st)*nt,.2*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,.1*et,(.5-st)*nt,.2*et,0,(.1+gt)*et)),St.add(new go.PathSegment(go.PathSegment.Move,nt,.2*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.3*et,nt,(.2+gt)*et,(.5+st)*nt,.3*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,.2*et,(.5-st)*nt,.3*et,0,(.2+gt)*et)),ht.spot1=new go.Spot(0,.3),ht.spot2=new go.Spot(1,.9),ht}),go.Shape.defineFigureGenerator("Display",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.25*nt,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,.75*nt,et,nt,0,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.25*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.5*et).close()),ht.spot1=new go.Spot(.25,0),ht.spot2=new go.Spot(.75,1),ht}),go.Shape.defineFigureGenerator("DividedEvent",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)?st=.2:st<.15&&(st=.15);var gt=qt*.2,vt=new go.PathFigure(0,.2*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,.2*nt,0,0,(.2-gt)*et,(.2-gt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.2*et,(.8+gt)*nt,0,nt,(.2-gt)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,et,nt,(.8+gt)*et,(.8+gt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.8*et,(.2-gt)*nt,et,0,(.8+gt)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.2*et));var St=new go.PathFigure(0,st*et,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt,st*et)),ht}),go.Shape.defineFigureGenerator("DividedProcess",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;(isNaN(st)||st<.1)&&(st=.1);var gt=new go.PathFigure(0,0,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure(0,st*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,st*et)),ht}),go.Shape.defineFigureGenerator("Document",function(Bt,nt,et){var ht=new go.Geometry;et=et/.8;var st=new go.PathFigure(0,.7*et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*et,.5*nt,.4*et,.5*nt,et).close()),ht.spot1=go.Spot.TopLeft,ht.spot2=new go.Spot(1,.6),ht}),go.Shape.defineFigureGenerator("ExternalOrganization",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;(isNaN(st)||st<.2)&&(st=.2);var gt=new go.PathFigure(0,0,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure(st*nt,0,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,0,st*et)),vt.add(new go.PathSegment(go.PathSegment.Move,nt,st*et)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Move,0,(1-st)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,st*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Move,(1-st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,(1-st)*et)),ht}),go.Shape.defineFigureGenerator("ExternalProcess",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.5*et).close());var gt=new go.PathFigure(.1*nt,.4*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.6*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.9*nt,.6*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.4*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.6*nt,.1*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.1*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.4*nt,.9*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.9*et)),ht.spot1=new go.Spot(.25,.25),ht.spot2=new go.Spot(.75,.75),ht}),go.Shape.defineFigureGenerator("File",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var gt=new go.PathFigure(.75*nt,0,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.25*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),ht.spot1=new go.Spot(0,.25),ht.spot2=go.Spot.BottomRight,ht}),go.Shape.defineFigureGenerator("Interrupt",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt,.5*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et));var gt=new go.PathFigure(nt,.5*et,!1);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et));var vt=new go.PathFigure(nt,.5*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.5,.75),ht}),go.Shape.defineFigureGenerator("InternalStorage",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN,gt=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=.1),isNaN(gt)&&(gt=.1);var vt=new go.PathFigure(0,0,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var St=new go.PathFigure(st*nt,0,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,st*nt,et)),St.add(new go.PathSegment(go.PathSegment.Move,0,gt*et)),St.add(new go.PathSegment(go.PathSegment.Line,nt,gt*et)),ht}),go.Shape.defineFigureGenerator("Junction",function(Bt,nt,et){var ht=new go.Geometry,st=1/Math.SQRT2,gt=(1-1/Math.SQRT2)/2,vt=qt*.5,St=.5,Et=new go.PathFigure(nt,St*et,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,St*nt,et,nt,(St+vt)*et,(St+vt)*nt,et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,0,St*et,(St-vt)*nt,et,0,(St+vt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,St*nt,0,0,(St-vt)*et,(St-vt)*nt,0)),Et.add(new go.PathSegment(go.PathSegment.Bezier,nt,St*et,(St+vt)*nt,0,nt,(St-vt)*et));var Tt=new go.PathFigure((gt+st)*nt,(gt+st)*et,!1);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Line,gt*nt,gt*et)),Tt.add(new go.PathSegment(go.PathSegment.Move,gt*nt,(gt+st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Line,(gt+st)*nt,gt*et)),ht}),go.Shape.defineFigureGenerator("LinedDocument",function(Bt,nt,et){var ht=new go.Geometry;et=et/.8;var st=new go.PathFigure(0,.7*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*et,.5*nt,.4*et,.5*nt,et).close());var gt=new go.PathFigure(.1*nt,0,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.75*et)),ht.spot1=new go.Spot(.1,0),ht.spot2=new go.Spot(1,.6),ht}),go.Shape.defineFigureGenerator("LoopLimit",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,.25*et)),st.add(new go.PathSegment(go.PathSegment.Line,.25*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et).close()),ht.spot1=new go.Spot(0,.25),ht.spot2=go.Spot.BottomRight,ht}),go.Shape.defineFigureGenerator("MagneticTape",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.5,gt=.5,vt=new go.PathFigure(.5*nt,et,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,gt*et,(gt-st)*nt,et,0,(gt+st)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,gt*nt,0,0,(gt-st)*et,(gt-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,gt*et,(gt+st)*nt,0,nt,(gt-st)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,(gt+.1)*nt,.9*et,nt,(gt+st)*et,(gt+st)*nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),ht.spot1=new go.Spot(.15,.15),ht.spot2=new go.Spot(.85,.8),ht}),go.Shape.defineFigureGenerator("ManualInput",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.25*et).close()),ht.spot1=new go.Spot(0,.25),ht.spot2=go.Spot.BottomRight,ht}),go.Shape.defineFigureGenerator("MessageFromUser",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.7);var gt=new go.PathFigure(0,0,!0);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,st*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht.spot1=go.Spot.TopLeft,ht}),go.Shape.defineFigureGenerator("MicroformProcessing",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.25);var gt=new go.PathFigure(0,0,!0);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,st*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,(1-st)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht}),go.Shape.defineFigureGenerator("MicroformRecording",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.25*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.15*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.85*et)),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(1,.75),ht}),go.Shape.defineFigureGenerator("MultiDocument",function(Bt,nt,et){var ht=new go.Geometry;et=et/.8;var st=new go.PathFigure(nt,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.9*nt,.44*et,.96*nt,.47*et,.93*nt,.45*et)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.54*et,.86*nt,.57*et,.83*nt,.55*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*et,.4*nt,.4*et,.4*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.1*et)),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.1*et)),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,0).close());var gt=new go.PathFigure(.1*nt,.2*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.54*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.1*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.1*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.44*et)),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.8,.77),ht}),go.Shape.defineFigureGenerator("MultiProcess",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.1*nt,.1*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.1*et)),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.9*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.9*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.2*et).close());var gt=new go.PathFigure(.2*nt,.1*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.1*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.8*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.1*nt,.2*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.9*et)),ht.spot1=new go.Spot(0,.2),ht.spot2=new go.Spot(.8,1),ht}),go.Shape.defineFigureGenerator("OfflineStorage",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.1);var gt=1-st,vt=new go.PathFigure(0,0,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et).close());var St=new go.PathFigure(.5*st*nt,st*et,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,(1-.5*st)*nt,st*et)),ht}),go.Shape.defineFigureGenerator("OffPageConnector",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht.spot1=go.Spot.TopLeft,ht.spot2=new go.Spot(.75,1),ht}),go.Shape.defineFigureGenerator("Or",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.5,gt=.5,vt=new go.PathFigure(nt,gt*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,gt*nt,et,nt,(gt+st)*et,(gt+st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,gt*et,(gt-st)*nt,et,0,(gt+st)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,gt*nt,0,0,(gt-st)*et,(gt-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,gt*et,(gt+st)*nt,0,nt,(gt-st)*et));var St=new go.PathFigure(nt,.5*et,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,0,.5*et)),St.add(new go.PathSegment(go.PathSegment.Move,.5*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),ht}),go.Shape.defineFigureGenerator("PaperTape",function(Bt,nt,et){var ht=new go.Geometry;et=et/.8;var st=new go.PathFigure(0,.7*et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,.3*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,nt,.3*et,.5*nt,.6*et,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*et,.5*nt,.4*et,.5*nt,et).close()),ht.spot1=new go.Spot(0,.49),ht.spot2=new go.Spot(1,.75),ht}),go.Shape.defineFigureGenerator("PrimitiveFromCall",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN,gt=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=.1),isNaN(gt)&&(gt=.3);var vt=new go.PathFigure(0,0,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-gt)*nt,.5*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht}),go.Shape.defineFigureGenerator("PrimitiveToCall",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN,gt=Bt?Bt.parameter2:NaN;isNaN(st)&&(st=.1),isNaN(gt)&&(gt=.3);var vt=new go.PathFigure(0,0,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,(1-gt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-gt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht}),go.Shape.defineFigureGenerator("Procedure",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.1);var gt=new go.PathFigure(0,0,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure((1-st)*nt,0,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,(1-st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Move,st*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,st*nt,et)),ht}),go.Shape.defineFigureGenerator("Process",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.1);var gt=new go.PathFigure(0,0,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure(st*nt,0,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,st*nt,et)),ht.spot2=go.Spot.BottomRight,ht}),go.Shape.defineFigureGenerator("Sort",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.5*et).close());var gt=new go.PathFigure(0,.5*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),ht.spot1=new go.Spot(.25,.25),ht.spot2=new go.Spot(.75,.5),ht}),go.Shape.defineFigureGenerator("Start",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.25);var gt=new go.PathFigure(st*nt,0,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Arc,270,180,.75*nt,.5*et,.25*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Arc,90,180,.25*nt,.5*et,.25*nt,.5*et));var vt=new go.PathFigure(st*nt,0,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,st*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Move,(1-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-st)*nt,et)),ht.spot1=new go.Spot(st,0),ht.spot2=new go.Spot(1-st,1),ht}),go.Shape.defineFigureGenerator("Terminator",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.25*nt,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Arc,270,180,.75*nt,.5*et,.25*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Arc,90,180,.25*nt,.5*et,.25*nt,.5*et)),ht.spot1=new go.Spot(.23,0),ht.spot2=new go.Spot(.77,1),ht}),go.Shape.defineFigureGenerator("TransmittalTape",function(Bt,nt,et){var ht=new go.Geometry,st=Bt?Bt.parameter1:NaN;isNaN(st)&&(st=.1);var gt=new go.PathFigure(0,0,!0);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,(1-st)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,(1-st)*et).close()),ht.spot1=go.Spot.TopLeft,ht}),go.Shape.defineFigureGenerator("AndGate",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.5,gt=new go.PathFigure(0,0,!0);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),gt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,(.5+st)*nt,0,nt,(.5-st)*et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,(.5+st)*et,(.5+st)*nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht.spot1=go.Spot.TopLeft,ht.spot2=new go.Spot(.55,1),ht}),go.Shape.defineFigureGenerator("Buffer",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.5,.75),ht}),go.Shape.defineFigureGenerator("Clock",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.5,gt=.5,vt=new go.PathFigure(nt,gt*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,gt*nt,et,nt,(gt+st)*et,(gt+st)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,gt*et,(gt-st)*nt,et,0,(gt+st)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,gt*nt,0,0,(gt-st)*et,(gt-st)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,gt*et,(gt+st)*nt,0,nt,(gt-st)*et));var St=new go.PathFigure(nt,gt*et,!1);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt,gt*et));var Et=new go.PathFigure(.8*nt,.75*et,!1);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.25*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.25*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.75*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.75*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.25*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.25*et)),Et.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.75*et)),ht}),go.Shape.defineFigureGenerator("Ground",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Move,.3*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Move,.4*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,et)),ht}),go.Shape.defineFigureGenerator("Inverter",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.1,gt=.1,vt=.9,St=.5,Et=new go.PathFigure(.8*nt,.5*et,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,0,et)),Et.add(new go.PathSegment(go.PathSegment.Line,0,0)),Et.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.5*et));var Tt=new go.PathFigure((vt+gt)*nt,St*et,!0);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et,(vt+st)*nt,(St+gt)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-gt)*nt,St*et,(vt-st)*nt,(St+gt)*et,(vt-gt)*nt,(St+st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et,(vt-st)*nt,(St-gt)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,St*et,(vt+st)*nt,(St-gt)*et,(vt+gt)*nt,(St-st)*et)),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.4,.75),ht}),go.Shape.defineFigureGenerator("NandGate",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.5,gt=qt*.4,vt=qt*.1,St=.1,Et=.9,Tt=.5,Dt=new go.PathFigure(.8*nt,.5*et,!0);ht.add(Dt),Dt.add(new go.PathSegment(go.PathSegment.Bezier,.4*nt,et,.8*nt,(.5+gt)*et,(.4+st)*nt,et)),Dt.add(new go.PathSegment(go.PathSegment.Line,0,et)),Dt.add(new go.PathSegment(go.PathSegment.Line,0,0)),Dt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,0)),Dt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.5*et,(.4+st)*nt,0,.8*nt,(.5-gt)*et));var Jt=new go.PathFigure((Et+St)*nt,Tt*et,!0);return ht.add(Jt),Jt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt+St)*et,(Et+St)*nt,(Tt+vt)*et,(Et+vt)*nt,(Tt+St)*et)),Jt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St)*nt,Tt*et,(Et-vt)*nt,(Tt+St)*et,(Et-St)*nt,(Tt+vt)*et)),Jt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-St)*et,(Et-St)*nt,(Tt-vt)*et,(Et-vt)*nt,(Tt-St)*et)),Jt.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St)*nt,Tt*et,(Et+vt)*nt,(Tt-St)*et,(Et+St)*nt,(Tt-vt)*et)),ht.spot1=new go.Spot(0,.05),ht.spot2=new go.Spot(.55,.95),ht}),go.Shape.defineFigureGenerator("NorGate",function(Bt,nt,et){var ht=new go.Geometry,st=.5,gt=qt*st,vt=0,St=.5,Et=new go.PathFigure(.8*nt,.5*et,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,0,et,.7*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*nt,.75*et,.25*nt,.25*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.5*et,(vt+gt)*nt,(St-st)*et,.7*nt,(St-gt)*et)),st=.1,gt=qt*.1,vt=.9,St=.5;var Tt=new go.PathFigure((vt-st)*nt,St*et,!0);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-st)*et,(vt-st)*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+gt)*nt,(St-st)*et,(vt+st)*nt,(St-gt)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-gt)*nt,(St+st)*et,(vt-st)*nt,(St+gt)*et)),ht.spot1=new go.Spot(.2,.25),ht.spot2=new go.Spot(.6,.75),ht}),go.Shape.defineFigureGenerator("OrGate",function(Bt,nt,et){var ht=new go.Geometry,st=.5,gt=qt*st,vt=0,St=.5,Et=new go.PathFigure(0,0,!0);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,(vt+gt+gt)*nt,(St-st)*et,.8*nt,(St-gt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,0,et,.8*nt,(St+gt)*et,(vt+gt+gt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*nt,.75*et,.25*nt,.25*et).close()),ht.spot1=new go.Spot(.2,.25),ht.spot2=new go.Spot(.75,.75),ht}),go.Shape.defineFigureGenerator("XnorGate",function(Bt,nt,et){var ht=new go.Geometry,st=.5,gt=qt*st,vt=.2,St=.5,Et=new go.PathFigure(.1*nt,0,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,.1*nt,et,.35*nt,.25*et,.35*nt,.75*et));var Tt=new go.PathFigure(.8*nt,.5*et,!0);ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Bezier,.2*nt,et,.7*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,.2*nt,0,.45*nt,.75*et,.45*nt,.25*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.5*et,(vt+gt)*nt,(St-st)*et,.7*nt,(St-gt)*et)),st=.1,gt=qt*.1,vt=.9,St=.5;var Dt=new go.PathFigure((vt-st)*nt,St*et,!0);return ht.add(Dt),Dt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-st)*et,(vt-st)*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et)),Dt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+gt)*nt,(St-st)*et,(vt+st)*nt,(St-gt)*et)),Dt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),Dt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-gt)*nt,(St+st)*et,(vt-st)*nt,(St+gt)*et)),ht.spot1=new go.Spot(.4,.25),ht.spot2=new go.Spot(.65,.75),ht}),go.Shape.defineFigureGenerator("XorGate",function(Bt,nt,et){var ht=new go.Geometry,st=.5,gt=qt*st,vt=.2,St=.5,Et=new go.PathFigure(.1*nt,0,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,.1*nt,et,.35*nt,.25*et,.35*nt,.75*et));var Tt=new go.PathFigure(.2*nt,0,!0);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,(vt+gt)*nt,(St-st)*et,.9*nt,(St-gt)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,.2*nt,et,.9*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,.2*nt,0,.45*nt,.75*et,.45*nt,.25*et).close()),ht.spot1=new go.Spot(.4,.25),ht.spot2=new go.Spot(.8,.75),ht}),go.Shape.defineFigureGenerator("Capacitor",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Move,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),ht}),go.Shape.defineFigureGenerator("Resistor",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.5*et,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.5*et)),ht}),go.Shape.defineFigureGenerator("Inductor",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.1,gt=.1,vt=.1,St=.5,Et=new go.PathFigure((vt-st*.5)*nt,et,!1);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,0,(vt-st)*nt,et,(vt-gt)*nt,0)),vt=.3,Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,et,(vt+gt)*nt,0,(vt+st)*nt,et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,0,(vt-st)*nt,et,(vt-gt)*nt,0)),vt=.5,Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,et,(vt+gt)*nt,0,(vt+st)*nt,et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,0,(vt-st)*nt,et,(vt-gt)*nt,0)),vt=.7,Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,et,(vt+gt)*nt,0,(vt+st)*nt,et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,0,(vt-st)*nt,et,(vt-gt)*nt,0)),vt=.9,Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st*.5)*nt,et,(vt+gt)*nt,0,(vt+st)*nt,et)),ht}),go.Shape.defineFigureGenerator("ACvoltageSource",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.5,gt=.5,vt=.5,St=.5,Et=new go.PathFigure((vt-gt)*nt,St*et,!1);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et,(vt-st)*nt,(St-gt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,St*et,(vt+st)*nt,(St-gt)*et,(vt+gt)*nt,(St-st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et,(vt+st)*nt,(St+gt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-gt)*nt,St*et,(vt-st)*nt,(St+gt)*et,(vt-gt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Move,(vt-gt+.1)*nt,St*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt-.1)*nt,St*et,vt*nt,(St-gt)*et,vt*nt,(St+gt)*et)),ht}),go.Shape.defineFigureGenerator("DCvoltageSource",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.75*et,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,.25*et)),st.add(new go.PathSegment(go.PathSegment.Move,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),ht}),go.Shape.defineFigureGenerator("Diode",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.5,.75),ht}),go.Shape.defineFigureGenerator("Wifi",function(Bt,nt,et){var ht=new go.Geometry,st=nt,gt=et;nt=nt*.38,et=et*.6;var vt=qt*.8,St=.8,Et=0,Tt=.5,Dt=(st-nt)/2,Jt=(gt-et)/2,Yt=new go.PathFigure(Et*nt+Dt,(Tt+St)*et+Jt,!0);ht.add(Yt),Yt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St)*nt+Dt,Tt*et+Jt,(Et-vt)*nt+Dt,(Tt+St)*et+Jt,(Et-St)*nt+Dt,(Tt+vt)*et+Jt)),Yt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+Dt,(Tt-St)*et+Jt,(Et-St)*nt+Dt,(Tt-vt)*et+Jt,(Et-vt)*nt+Dt,(Tt-St)*et+Jt)),Yt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St+vt*.5)*nt+Dt,Tt*et+Jt,Et*nt+Dt,(Tt-St)*et+Jt,(Et-St+vt*.5)*nt+Dt,(Tt-vt)*et+Jt)),Yt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+Dt,(Tt+St)*et+Jt,(Et-St+vt*.5)*nt+Dt,(Tt+vt)*et+Jt,Et*nt+Dt,(Tt+St)*et+Jt).close()),vt=qt*.4,St=.4,Et=.2,Tt=.5;var Gt=new go.PathFigure(Et*nt+Dt,(Tt+St)*et+Jt,!0);ht.add(Gt),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St)*nt+Dt,Tt*et+Jt,(Et-vt)*nt+Dt,(Tt+St)*et+Jt,(Et-St)*nt+Dt,(Tt+vt)*et+Jt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+Dt,(Tt-St)*et+Jt,(Et-St)*nt+Dt,(Tt-vt)*et+Jt,(Et-vt)*nt+Dt,(Tt-St)*et+Jt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St+vt*.5)*nt+Dt,Tt*et+Jt,Et*nt+Dt,(Tt-St)*et+Jt,(Et-St+vt*.5)*nt+Dt,(Tt-vt)*et+Jt)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+Dt,(Tt+St)*et+Jt,(Et-St+vt*.5)*nt+Dt,(Tt+vt)*et+Jt,Et*nt+Dt,(Tt+St)*et+Jt).close()),vt=qt*.2,St=.2,Et=.5,Tt=.5;var me=new go.PathFigure((Et-St)*nt+Dt,Tt*et+Jt,!0);ht.add(me),me.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+Dt,(Tt-St)*et+Jt,(Et-St)*nt+Dt,(Tt-vt)*et+Jt,(Et-vt)*nt+Dt,(Tt-St)*et+Jt)),me.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St)*nt+Dt,Tt*et+Jt,(Et+vt)*nt+Dt,(Tt-St)*et+Jt,(Et+St)*nt+Dt,(Tt-vt)*et+Jt)),me.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+Dt,(Tt+St)*et+Jt,(Et+St)*nt+Dt,(Tt+vt)*et+Jt,(Et+vt)*nt+Dt,(Tt+St)*et+Jt)),me.add(new go.PathSegment(go.PathSegment.Bezier,(Et-St)*nt+Dt,Tt*et+Jt,(Et-vt)*nt+Dt,(Tt+St)*et+Jt,(Et-St)*nt+Dt,(Tt+vt)*et+Jt)),vt=qt*.4,St=.4,Et=.8,Tt=.5;var ae=new go.PathFigure(Et*nt+Dt,(Tt-St)*et+Jt,!0);ht.add(ae),ae.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St)*nt+Dt,Tt*et+Jt,(Et+vt)*nt+Dt,(Tt-St)*et+Jt,(Et+St)*nt+Dt,(Tt-vt)*et+Jt)),ae.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+Dt,(Tt+St)*et+Jt,(Et+St)*nt+Dt,(Tt+vt)*et+Jt,(Et+vt)*nt+Dt,(Tt+St)*et+Jt)),ae.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St-vt*.5)*nt+Dt,Tt*et+Jt,Et*nt+Dt,(Tt+St)*et+Jt,(Et+St-vt*.5)*nt+Dt,(Tt+vt)*et+Jt)),ae.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+Dt,(Tt-St)*et+Jt,(Et+St-vt*.5)*nt+Dt,(Tt-vt)*et+Jt,Et*nt+Dt,(Tt-St)*et+Jt).close()),vt=qt*.8,St=.8,Et=1,Tt=.5;var Ne=new go.PathFigure(Et*nt+Dt,(Tt-St)*et+Jt,!0);return ht.add(Ne),Ne.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St)*nt+Dt,Tt*et+Jt,(Et+vt)*nt+Dt,(Tt-St)*et+Jt,(Et+St)*nt+Dt,(Tt-vt)*et+Jt)),Ne.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+Dt,(Tt+St)*et+Jt,(Et+St)*nt+Dt,(Tt+vt)*et+Jt,(Et+vt)*nt+Dt,(Tt+St)*et+Jt)),Ne.add(new go.PathSegment(go.PathSegment.Bezier,(Et+St-vt*.5)*nt+Dt,Tt*et+Jt,Et*nt+Dt,(Tt+St)*et+Jt,(Et+St-vt*.5)*nt+Dt,(Tt+vt)*et+Jt)),Ne.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt+Dt,(Tt-St)*et+Jt,(Et+St-vt*.5)*nt+Dt,(Tt-vt)*et+Jt,Et*nt+Dt,(Tt-St)*et+Jt).close()),ht}),go.Shape.defineFigureGenerator("Email",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var gt=new go.PathFigure(0,0,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),gt.add(new go.PathSegment(go.PathSegment.Move,0,et)),gt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.54*et)),gt.add(new go.PathSegment(go.PathSegment.Move,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.54*et)),ht}),go.Shape.defineFigureGenerator("Ethernet",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.35*nt,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.65*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,.35*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,.35*nt,0).close());var gt=new go.PathFigure(.1*nt,et,!0,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.6*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.6*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,et).close());var vt=new go.PathFigure(.6*nt,et,!0,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.6*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.6*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,et).close());var St=new go.PathFigure(0,.5*et,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),St.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.5*et)),St.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.4*et)),St.add(new go.PathSegment(go.PathSegment.Move,.75*nt,.5*et)),St.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.6*et)),St.add(new go.PathSegment(go.PathSegment.Move,.25*nt,.5*et)),St.add(new go.PathSegment(go.PathSegment.Line,.25*nt,.6*et)),ht}),go.Shape.defineFigureGenerator("Power",function(Bt,nt,et){var ht=new go.Geometry,st=qt*.4,gt=.4,vt=.5,St=.5,Et=pt(),Tt=pt(),Dt=pt(),Jt=pt();Me(vt,St-gt,vt+st,St-gt,vt+gt,St-st,vt+gt,St,.5,Et,Et,Tt,Dt,Jt);var Yt=kt(Tt.x,Tt.y),Gt=new go.PathFigure(Tt.x*nt,Tt.y*et,!0);ht.add(Gt),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,St*et,Dt.x*nt,Dt.y*et,Jt.x*nt,Jt.y*et)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et,(vt+st)*nt,(St+gt)*et)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-gt)*nt,St*et,(vt-st)*nt,(St+gt)*et,(vt-gt)*nt,(St+st)*et)),Me(vt-gt,St,vt-gt,St-st,vt-st,St-gt,vt,St-gt,.5,Dt,Jt,Tt,Et,Et),Gt.add(new go.PathSegment(go.PathSegment.Bezier,Tt.x*nt,Tt.y*et,Dt.x*nt,Dt.y*et,Jt.x*nt,Jt.y*et)),st=qt*.3,gt=.3,Me(vt-gt,St,vt-gt,St-st,vt-st,St-gt,vt,St-gt,.5,Dt,Jt,Tt,Et,Et),Gt.add(new go.PathSegment(go.PathSegment.Line,Tt.x*nt,Tt.y*et)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-gt)*nt,St*et,Jt.x*nt,Jt.y*et,Dt.x*nt,Dt.y*et)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+gt)*et,(vt-gt)*nt,(St+st)*et,(vt-st)*nt,(St+gt)*et)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+gt)*nt,St*et,(vt+st)*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),Me(vt,St-gt,vt+st,St-gt,vt+gt,St-st,vt+gt,St,.5,Et,Et,Tt,Dt,Jt),Gt.add(new go.PathSegment(go.PathSegment.Bezier,Tt.x*nt,Tt.y*et,Jt.x*nt,Jt.y*et,Dt.x*nt,Dt.y*et).close());var Gt=new go.PathFigure(.45*nt,0,!0);return ht.add(Gt),Gt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.5*et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.5*et)),Gt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,0).close()),Ut(Et),Ut(Tt),Ut(Dt),Ut(Jt),Ut(Yt),ht.spot1=new go.Spot(.25,.45),ht.spot2=new go.Spot(.75,.8),ht}),go.Shape.defineFigureGenerator("Fallout",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et/2,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Arc,180,360,nt/2,et/2,nt/2,et/2));function gt(vt,St,Et){vt.add(new go.PathSegment(go.PathSegment.Move,(.3+St)*nt,(.8+Et)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,(.5+St)*nt,(.5+Et)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,(.1+St)*nt,(.5+Et)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,(.3+St)*nt,(.8+Et)*et).close())}return gt(st,0,0),gt(st,.4,0),gt(st,.2,-.3),ht}),go.Shape.defineFigureGenerator("IrritationHazard",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.2*nt,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.3*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.2*et).close()),ht.spot1=new go.Spot(.3,.3),ht.spot2=new go.Spot(.7,.7),ht}),go.Shape.defineFigureGenerator("ElectricalHazard",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.37*nt,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.11*et)),st.add(new go.PathSegment(go.PathSegment.Line,.77*nt,.04*et)),st.add(new go.PathSegment(go.PathSegment.Line,.33*nt,.49*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.37*et)),st.add(new go.PathSegment(go.PathSegment.Line,.63*nt,.86*et)),st.add(new go.PathSegment(go.PathSegment.Line,.77*nt,.91*et)),st.add(new go.PathSegment(go.PathSegment.Line,.34*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.34*nt,.78*et)),st.add(new go.PathSegment(go.PathSegment.Line,.44*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.56*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.68*et).close()),ht}),go.Shape.defineFigureGenerator("FireHazard",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.1*nt,et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,.29*nt,0,-.25*nt,.63*et,.45*nt,.44*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.51*nt,.42*et,.48*nt,.17*et,.54*nt,.35*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.59*nt,.18*et,.59*nt,.29*et,.58*nt,.28*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.75*nt,.6*et,.8*nt,.34*et,.88*nt,.43*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.88*nt,.31*et,.87*nt,.48*et,.88*nt,.43*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.9*nt,et,1.17*nt,.76*et,.82*nt,.8*et).close()),ht.spot1=new go.Spot(.07,.445),ht.spot2=new go.Spot(.884,.958),ht}),go.Shape.defineFigureGenerator("BpmnActivityLoop",function(Bt,nt,et){var ht=new go.Geometry,st=.5,gt=0,vt=0,St=st*qt,Et=.4*Math.SQRT2/2+.5,Tt=.5-.5*Math.SQRT2/2,Dt=1,Jt=.5,Yt=.5,Gt=0,me=new go.PathFigure(Et*nt,(1-Tt)*et,!1);return ht.add(me),me.add(new go.PathSegment(go.PathSegment.Bezier,Dt*nt,Jt*et,Dt*nt,.7*et,Dt*nt,Jt*et)),me.add(new go.PathSegment(go.PathSegment.Bezier,(Yt+gt)*nt,(Gt+gt)*et,(.5+st+gt)*nt,(.5-St+gt)*et,(.5+St+gt)*nt,(.5-st+gt)*et)),me.add(new go.PathSegment(go.PathSegment.Bezier,(.5-st+gt)*nt,(.5+vt)*et,(.5-St+gt)*nt,(.5-st+vt)*et,(.5-st+gt)*nt,(.5-St+vt)*et)),me.add(new go.PathSegment(go.PathSegment.Bezier,(.35+gt)*nt,.9*et,(.5-st+gt)*nt,(.5+St+vt)*et,(.5-St+gt)*nt,.9*et)),me.add(new go.PathSegment(go.PathSegment.Move,(.25+gt)*nt,.8*et)),me.add(new go.PathSegment(go.PathSegment.Line,(.35+gt)*nt,.9*et)),me.add(new go.PathSegment(go.PathSegment.Line,(.2+gt)*nt,.95*et)),ht}),go.Shape.defineFigureGenerator("BpmnActivityParallel",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Move,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),ht}),go.Shape.defineFigureGenerator("BpmnActivitySequential",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Move,0,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Move,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),ht}),go.Shape.defineFigureGenerator("BpmnActivityAdHoc",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);ht.add(st);var gt=new go.PathFigure(nt,et,!1);ht.add(gt);var vt=new go.PathFigure(0,.5*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.5*et,.2*nt,.35*et,.3*nt,.35*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,.7*nt,.65*et,.8*nt,.65*et)),ht}),go.Shape.defineFigureGenerator("BpmnActivityCompensation",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.5*et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et).close()),ht}),go.Shape.defineFigureGenerator("BpmnTaskMessage",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.2*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.8*et).close());var st=new go.PathFigure(0,.2*et,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et)),ht}),go.Shape.defineFigureGenerator("BpmnTaskScript",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.7*nt,et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.3*nt,0,.6*nt,.5*et,0,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.7*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,.7*nt,et,.4*nt,.5*et,nt,.5*et).close());var gt=new go.PathFigure(.45*nt,.73*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.73*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.38*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.63*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.31*nt,.27*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.56*nt,.27*et)),ht}),go.Shape.defineFigureGenerator("BpmnTaskUser",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);ht.add(st);var gt=new go.PathFigure(.335*nt,(1-.555)*et,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.335*nt,(1-.405)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*nt,(1-.405)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*nt,(1-.555)*et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.68*et,(1-.12)*nt,.46*et,(1-.02)*nt,.54*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,.68*et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,.335*nt,(1-.555)*et,.02*nt,.54*et,.12*nt,.46*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.365*nt,(1-.595)*et));var vt=.5-.285,St=.5,Et=vt,Tt=Math.PI/4,Dt=4*(1-Math.cos(Tt))/(3*Math.sin(Tt)),Jt=Dt*.5,Yt=vt,Gt=vt,me=Dt*Yt,ae=Dt*Gt;gt.add(new go.PathSegment(go.PathSegment.Bezier,(St-Yt)*nt,Et*et,(St-(me+Yt)/2)*nt,(Et+(Gt+ae)/2)*et,(St-Yt)*nt,(Et+ae)*et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,St*nt,(Et-Gt)*et,(St-Yt)*nt,(Et-ae)*et,(St-me)*nt,(Et-Gt)*et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,(St+Yt)*nt,Et*et,(St+me)*nt,(Et-Gt)*et,(St+Yt)*nt,(Et-ae)*et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,(1-.365)*nt,(1-.595)*et,(St+Yt)*nt,(Et+ae)*et,(St+(me+Yt)/2)*nt,(Et+(Gt+ae)/2)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,(1-.365)*nt,(1-.595)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*nt,(1-.555)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*nt,(1-.405)*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.335*nt,(1-.405)*et));var Ne=new go.PathFigure(.2*nt,et,!1);ht.add(Ne),Ne.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.8*et));var Ce=new go.PathFigure(.8*nt,et,!1);return ht.add(Ce),Ce.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.8*et)),ht}),go.Shape.defineFigureGenerator("BpmnEventConditional",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.1*nt,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,et).close());var gt=new go.PathFigure(.2*nt,.2*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.4*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.4*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.6*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.6*et)),gt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.8*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.8*et)),ht}),go.Shape.defineFigureGenerator("BpmnEventError",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.33*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.66*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.66*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.33*nt,.5*et).close()),ht}),go.Shape.defineFigureGenerator("BpmnEventEscalation",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);ht.add(st);var gt=new go.PathFigure(nt,et,!1);ht.add(gt);var vt=new go.PathFigure(.1*nt,et,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et).close()),ht}),go.Shape.defineFigureGenerator("Caution",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.05*nt,et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,.1*nt,.8*et,0,et,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.1*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.55*nt,.1*et,.5*nt,0,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.95*nt,.9*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.9*nt,et,nt,et,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.05*nt,et));var gt=.05;return st.add(new go.PathSegment(go.PathSegment.Move,(.5-gt)*nt,.875*et)),st.add(new go.PathSegment(go.PathSegment.Arc,180,-360,.5*nt,.875*et,gt*nt,gt*et)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.325*et,.575*nt,.725*et,.625*nt,.375*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.75*et,.375*nt,.375*et,.425*nt,.725*et)),ht}),go.Shape.defineFigureGenerator("Recycle",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.45*nt,.95*et,!1);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.95*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.185*nt,.85*et,.17*nt,.95*et,.15*nt,.9*et)),st.add(new go.PathSegment(go.PathSegment.Line,.235*nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Line,.3*nt,.625*et)),st.add(new go.PathSegment(go.PathSegment.Line,.35*nt,.65*et)),st.add(new go.PathSegment(go.PathSegment.Line,.275*nt,.45*et)),st.add(new go.PathSegment(go.PathSegment.Line,.05*nt,.45*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.05*nt,.575*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.1875*nt,.95*et,0,.675*et,0,.7*et)),st.add(new go.PathSegment(go.PathSegment.Move,.45*nt,.95*et)),st.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.775*et)),st.add(new go.PathSegment(go.PathSegment.Line,.22*nt,.775*et));var gt=new go.PathFigure(.475*nt,.2*et,!1);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.4*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.225*nt,.3*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.275*nt,.175*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.325*nt,.05*et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,.4*nt,.05*et,.35*nt,0,.375*nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,.575*nt,.375*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.525*nt,.4*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.475*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.315*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.32*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.05*et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,.575*nt,0,.65*nt,.05*et,.625*nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,.38*nt,.0105*et));var vt=new go.PathFigure(.675*nt,.575*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.875*nt,.525*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.775*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.85*nt,.95*et,nt,.8*et,nt,.85*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.95*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.85*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.725*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.775*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.775*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.775*et)),vt.add(new go.PathSegment(go.PathSegment.Move,.675*nt,.575*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.775*nt,.775*et)),ht}),go.Shape.defineFigureGenerator("BpmnEventTimer",function(Bt,nt,et){var ht=new go.Geometry,st=.5,gt=qt*.5,vt=new go.PathFigure(nt,st*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,st*nt,et,nt,(st+gt)*et,(st+gt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,st*et,(st-gt)*nt,et,0,(st+gt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,st*nt,0,0,(st-gt)*et,(st-gt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,st*et,(st+gt)*nt,0,nt,(st-gt)*et));var St=new go.PathFigure(st*nt,0,!1);return ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,st*nt,.15*et)),St.add(new go.PathSegment(go.PathSegment.Move,st*nt,et)),St.add(new go.PathSegment(go.PathSegment.Line,st*nt,.85*et)),St.add(new go.PathSegment(go.PathSegment.Move,0,st*et)),St.add(new go.PathSegment(go.PathSegment.Line,.15*nt,st*et)),St.add(new go.PathSegment(go.PathSegment.Move,nt,st*et)),St.add(new go.PathSegment(go.PathSegment.Line,.85*nt,st*et)),St.add(new go.PathSegment(go.PathSegment.Move,st*nt,st*et)),St.add(new go.PathSegment(go.PathSegment.Line,.58*nt,.1*et)),St.add(new go.PathSegment(go.PathSegment.Move,st*nt,st*et)),St.add(new go.PathSegment(go.PathSegment.Line,.78*nt,.54*et)),ht}),go.Shape.defineFigureGenerator("Package",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.15*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,.15*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var gt=new go.PathFigure(0,.15*et,!0);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,0,0)),gt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.15*et).close()),ht.spot1=new go.Spot(0,.1),ht.spot2=new go.Spot(1,1),ht}),go.Shape.defineFigureGenerator("Class",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var gt=new go.PathFigure(0,.2*et,!1);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et).close());var vt=new go.PathFigure(0,.5*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et).close()),ht}),go.Shape.defineFigureGenerator("Component",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt,et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.15*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.15*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et).close());var gt=new go.PathFigure(0,.2*et,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.2*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.4*et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,.4*et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,.2*et).close());var vt=new go.PathFigure(0,.6*et,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.6*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.8*et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.6*et).close()),ht}),go.Shape.defineFigureGenerator("Boat Shipment",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.15*nt,.6*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.15*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,.15*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.85*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.15*nt,.6*et));var gt=new go.PathFigure(.15*nt,.6*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.6*et)),ht}),go.Shape.defineFigureGenerator("Customer/Supplier",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt,et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.66*nt,.33*et)),st.add(new go.PathSegment(go.PathSegment.Line,.66*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.33*nt,.33*et)),st.add(new go.PathSegment(go.PathSegment.Line,.33*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,0,.33*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et).close()),ht}),go.Shape.defineFigureGenerator("Workcell",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.65*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,.35*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,.35*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht}),go.Shape.defineFigureGenerator("Supermarket",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.33*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.33*et)),st.add(new go.PathSegment(go.PathSegment.Move,nt,.33*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.66*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.66*et)),st.add(new go.PathSegment(go.PathSegment.Move,nt,.66*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),ht}),go.Shape.defineFigureGenerator("TruckShipment",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var gt=new go.PathFigure(nt,.8*et,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,.4*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.4*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.8*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et).close());var vt=.1,St=qt*.1,Et=.2,Tt=.9,Dt=new go.PathFigure((Et-vt)*nt,Tt*et,!0);ht.add(Dt),Dt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-vt)*et,(Et-vt)*nt,(Tt-St)*et,(Et-St)*nt,(Tt-vt)*et)),Dt.add(new go.PathSegment(go.PathSegment.Bezier,(Et+vt)*nt,Tt*et,(Et+St)*nt,(Tt-vt)*et,(Et+vt)*nt,(Tt-St)*et)),Dt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt+vt)*et,(Et+vt)*nt,(Tt+St)*et,(Et+St)*nt,(Tt+vt)*et)),Dt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-vt)*nt,Tt*et,(Et-St)*nt,(Tt+vt)*et,(Et-vt)*nt,(Tt+St)*et).close()),vt=.1,St=qt*.1,Et=.8,Tt=.9;var Jt=new go.PathFigure((Et-vt)*nt,Tt*et,!0);return ht.add(Jt),Jt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt-vt)*et,(Et-vt)*nt,(Tt-St)*et,(Et-St)*nt,(Tt-vt)*et)),Jt.add(new go.PathSegment(go.PathSegment.Bezier,(Et+vt)*nt,Tt*et,(Et+St)*nt,(Tt-vt)*et,(Et+vt)*nt,(Tt-St)*et)),Jt.add(new go.PathSegment(go.PathSegment.Bezier,Et*nt,(Tt+vt)*et,(Et+vt)*nt,(Tt+St)*et,(Et+St)*nt,(Tt+vt)*et)),Jt.add(new go.PathSegment(go.PathSegment.Bezier,(Et-vt)*nt,Tt*et,(Et-St)*nt,(Tt+vt)*et,(Et-vt)*nt,(Tt+St)*et).close()),ht}),go.Shape.defineFigureGenerator("KanbanPost",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.2*nt,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,0)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,et)),ht}),go.Shape.defineFigureGenerator("Forklift",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,0,0));var gt=new go.PathFigure(0,.5*et,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.8*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Line,0,.5*et));var vt=new go.PathFigure(.5*nt,.8*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.1*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.1*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.8*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.8*et));var St=new go.PathFigure(.5*nt,.7*et,!1);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt,.7*et));var Et=.1,Tt=qt*.1,Dt=.1,Jt=.9,Yt=new go.PathFigure((Dt-Et)*nt,Jt*et,!0);ht.add(Yt),Yt.add(new go.PathSegment(go.PathSegment.Bezier,Dt*nt,(Jt-Et)*et,(Dt-Et)*nt,(Jt-Tt)*et,(Dt-Tt)*nt,(Jt-Et)*et)),Yt.add(new go.PathSegment(go.PathSegment.Bezier,(Dt+Et)*nt,Jt*et,(Dt+Tt)*nt,(Jt-Et)*et,(Dt+Et)*nt,(Jt-Tt)*et)),Yt.add(new go.PathSegment(go.PathSegment.Bezier,Dt*nt,(Jt+Et)*et,(Dt+Et)*nt,(Jt+Tt)*et,(Dt+Tt)*nt,(Jt+Et)*et)),Yt.add(new go.PathSegment(go.PathSegment.Bezier,(Dt-Et)*nt,Jt*et,(Dt-Tt)*nt,(Jt+Et)*et,(Dt-Et)*nt,(Jt+Tt)*et)),Et=.1,Tt=qt*.1,Dt=.4,Jt=.9;var Gt=new go.PathFigure((Dt-Et)*nt,Jt*et,!0);return ht.add(Gt),Gt.add(new go.PathSegment(go.PathSegment.Bezier,Dt*nt,(Jt-Et)*et,(Dt-Et)*nt,(Jt-Tt)*et,(Dt-Tt)*nt,(Jt-Et)*et)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(Dt+Et)*nt,Jt*et,(Dt+Tt)*nt,(Jt-Et)*et,(Dt+Et)*nt,(Jt-Tt)*et)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,Dt*nt,(Jt+Et)*et,(Dt+Et)*nt,(Jt+Tt)*et,(Dt+Tt)*nt,(Jt+Et)*et)),Gt.add(new go.PathSegment(go.PathSegment.Bezier,(Dt-Et)*nt,Jt*et,(Dt-Tt)*nt,(Jt+Et)*et,(Dt-Et)*nt,(Jt+Tt)*et)),ht}),go.Shape.defineFigureGenerator("RailShipment",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.1*nt,.4*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.9*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.9*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.4*et).close());var gt=new go.PathFigure(.45*nt,.7*et,!1);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.7*et));var vt=new go.PathFigure(.55*nt,.4*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.4*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.4*et).close());var Dt=.05,Jt=qt*.05,Yt=.175,Gt=.95,St=new go.PathFigure((Yt-Dt)*nt,Gt*et,!0);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Bezier,Yt*nt,(Gt-Dt)*et,(Yt-Dt)*nt,(Gt-Jt)*et,(Yt-Jt)*nt,(Gt-Dt)*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,(Yt+Dt)*nt,Gt*et,(Yt+Jt)*nt,(Gt-Dt)*et,(Yt+Dt)*nt,(Gt-Jt)*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,Yt*nt,(Gt+Dt)*et,(Yt+Dt)*nt,(Gt+Jt)*et,(Yt+Jt)*nt,(Gt+Dt)*et)),St.add(new go.PathSegment(go.PathSegment.Bezier,(Yt-Dt)*nt,Gt*et,(Yt-Jt)*nt,(Gt+Dt)*et,(Yt-Dt)*nt,(Gt+Jt)*et));var Dt=.05,Jt=qt*.05,Yt=.375,Gt=.95,Et=new go.PathFigure((Yt-Dt)*nt,Gt*et,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,Yt*nt,(Gt-Dt)*et,(Yt-Dt)*nt,(Gt-Jt)*et,(Yt-Jt)*nt,(Gt-Dt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(Yt+Dt)*nt,Gt*et,(Yt+Jt)*nt,(Gt-Dt)*et,(Yt+Dt)*nt,(Gt-Jt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,Yt*nt,(Gt+Dt)*et,(Yt+Dt)*nt,(Gt+Jt)*et,(Yt+Jt)*nt,(Gt+Dt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(Yt-Dt)*nt,Gt*et,(Yt-Jt)*nt,(Gt+Dt)*et,(Yt-Dt)*nt,(Gt+Jt)*et));var Dt=.05,Jt=qt*.05,Yt=.625,Gt=.95,Tt=new go.PathFigure((Yt-Dt)*nt,Gt*et,!0);ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Bezier,Yt*nt,(Gt-Dt)*et,(Yt-Dt)*nt,(Gt-Jt)*et,(Yt-Jt)*nt,(Gt-Dt)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(Yt+Dt)*nt,Gt*et,(Yt+Jt)*nt,(Gt-Dt)*et,(Yt+Dt)*nt,(Gt-Jt)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,Yt*nt,(Gt+Dt)*et,(Yt+Dt)*nt,(Gt+Jt)*et,(Yt+Jt)*nt,(Gt+Dt)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(Yt-Dt)*nt,Gt*et,(Yt-Jt)*nt,(Gt+Dt)*et,(Yt-Dt)*nt,(Gt+Jt)*et));var Dt=.05,Jt=qt*.05,Yt=.825,Gt=.95,me=new go.PathFigure((Yt-Dt)*nt,Gt*et,!0);ht.add(me),me.add(new go.PathSegment(go.PathSegment.Bezier,Yt*nt,(Gt-Dt)*et,(Yt-Dt)*nt,(Gt-Jt)*et,(Yt-Jt)*nt,(Gt-Dt)*et)),me.add(new go.PathSegment(go.PathSegment.Bezier,(Yt+Dt)*nt,Gt*et,(Yt+Jt)*nt,(Gt-Dt)*et,(Yt+Dt)*nt,(Gt-Jt)*et)),me.add(new go.PathSegment(go.PathSegment.Bezier,Yt*nt,(Gt+Dt)*et,(Yt+Dt)*nt,(Gt+Jt)*et,(Yt+Jt)*nt,(Gt+Dt)*et)),me.add(new go.PathSegment(go.PathSegment.Bezier,(Yt-Dt)*nt,Gt*et,(Yt-Jt)*nt,(Gt+Dt)*et,(Yt-Dt)*nt,(Gt+Jt)*et).close());var ae=new go.PathFigure(0,et,!1);return ht.add(ae),ae.add(new go.PathSegment(go.PathSegment.Line,nt,et).close()),ht}),go.Shape.defineFigureGenerator("Warehouse",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var gt=new go.PathFigure(0,.2*et,!1);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et).close());var vt=new go.PathFigure(.15*nt,et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.15*nt,.5*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.5*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.15*nt,et).close());var St=.05,Et=qt*.05,Tt=.35,Dt=.775,Jt=new go.PathFigure((Tt-St)*nt,Dt*et,!0);return ht.add(Jt),Jt.add(new go.PathSegment(go.PathSegment.Bezier,Tt*nt,(Dt-St)*et,(Tt-St)*nt,(Dt-Et)*et,(Tt-Et)*nt,(Dt-St)*et)),Jt.add(new go.PathSegment(go.PathSegment.Bezier,(Tt+St)*nt,Dt*et,(Tt+Et)*nt,(Dt-St)*et,(Tt+St)*nt,(Dt-Et)*et)),Jt.add(new go.PathSegment(go.PathSegment.Bezier,Tt*nt,(Dt+St)*et,(Tt+St)*nt,(Dt+Et)*et,(Tt+Et)*nt,(Dt+St)*et)),Jt.add(new go.PathSegment(go.PathSegment.Bezier,(Tt-St)*nt,Dt*et,(Tt-Et)*nt,(Dt+St)*et,(Tt-St)*nt,(Dt+Et)*et).close()),ht}),go.Shape.defineFigureGenerator("ControlCenter",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Move,.1*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.8*et).close()),ht}),go.Shape.defineFigureGenerator("Bluetooth",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.75*et,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,.75*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.25*et)),ht}),go.Shape.defineFigureGenerator("Bookmark",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.4*et)),ht}),go.Shape.defineFigureGenerator("Bookmark",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,0,0)),st.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.4*et)),ht}),go.Shape.defineFigureGenerator("Globe",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Move,0,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,.75*nt,0,nt,.25*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,.75*et,.75*nt,et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,.25*nt,et,0,.75*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,0,.25*et,.25*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,.15*nt,.25*et,.15*nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,.85*nt,.75*et,.85*nt,.25*et)),st.add(new go.PathSegment(go.PathSegment.Move,.1675*nt,.15*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.8325*nt,.15*et,.35*nt,.3*et,.65*nt,.3*et)),st.add(new go.PathSegment(go.PathSegment.Move,.1675*nt,.85*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.8325*nt,.85*et,.35*nt,.7*et,.65*nt,.7*et)),ht}),go.Shape.defineFigureGenerator("Wave",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.25*et,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,.3*nt,.25*et,.1*nt,0,.2*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,.7*nt,.25*et,.425*nt,.5*et,.575*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,nt,.25*et,.8*nt,0,.9*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.75*et)),st.add(new go.PathSegment(go.PathSegment.Move,0,.25*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.75*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.3*nt,.75*et,.1*nt,.5*et,.2*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.7*nt,.75*et,.425*nt,et,.575*nt,et)),st.add(new go.PathSegment(go.PathSegment.Bezier,nt,.75*et,.8*nt,.5*et,.9*nt,.5*et)),ht}),go.Shape.defineFigureGenerator("Operator",function(Bt,nt,et){var ht=new go.Geometry,st=.3,gt=qt*.3,vt=.5,St=.7,Et=new go.PathFigure((vt-st)*nt,St*et,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-st)*et,(vt-st)*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+gt)*nt,(St-st)*et,(vt+st)*nt,(St-gt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-gt)*nt,(St+st)*et,(vt-st)*nt,(St+gt)*et));var Tt=new go.PathFigure(0,.7*et,!1);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.7*et,0,0,nt,0)),ht}),go.Shape.defineFigureGenerator("TripleFanBlades",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.5*nt,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.65*et,.65*nt,.3*et,.65*nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,.35*nt,.5*et,.35*nt,.3*et)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.65*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,et,.3*nt,.6*et,.1*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.65*et,.2*nt,et,.35*nt,.95*et)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.65*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,nt,et,.7*nt,.6*et,.9*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.65*et,.8*nt,et,.65*nt,.95*et)),ht}),go.Shape.defineFigureGenerator("CentrifugalPump",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt,0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,0,.075*et,0,.5*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.4*nt,et,0,et,.4*nt,et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.4*et,.8*nt,et,.85*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,0)),ht}),go.Shape.defineFigureGenerator("Battery",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,.1*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.1*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Move,.4*nt,.1*et)),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.1*et));var gt=new go.PathFigure(0,.6*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Move,0,.4*et)),gt.add(new go.PathSegment(go.PathSegment.Line,nt,.4*et)),ht}),go.Shape.defineFigureGenerator("Delete",function(Bt,nt,et){var ht=new go.Geometry,st=.5,gt=qt*.5,vt=.5,St=.5,Et=new go.PathFigure((vt-st)*nt,St*et,!0);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-st)*et,(vt-st)*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+gt)*nt,(St-st)*et,(vt+st)*nt,(St-gt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-gt)*nt,(St+st)*et,(vt-st)*nt,(St+gt)*et));var Tt=new go.PathFigure(.15*nt,.5*et,!1);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.5*et)),ht}),go.Shape.defineFigureGenerator("Flag",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.1*et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Move,0,.1*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.1*et,.15*nt,0,.35*nt,0)),st.add(new go.PathSegment(go.PathSegment.Bezier,nt,.1*et,.65*nt,.2*et,.85*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.5*et,.85*nt,.6*et,.65*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,.35*nt,.4*et,.15*nt,.4*et).close()),ht}),go.Shape.defineFigureGenerator("Help",function(Bt,nt,et){var ht=new go.Geometry,st=.5,gt=qt*.5,vt=.5,St=.5,Et=new go.PathFigure((vt-st)*nt,St*et,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-st)*et,(vt-st)*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+gt)*nt,(St-st)*et,(vt+st)*nt,(St-gt)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),Et.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-gt)*nt,(St+st)*et,(vt-st)*nt,(St+gt)*et).close()),st=.05,gt=qt*.05,vt=.5,St=.8;var Tt=new go.PathFigure((vt-st)*nt,St*et,!1);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St-st)*et,(vt-st)*nt,(St-gt)*et,(vt-gt)*nt,(St-st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+st)*nt,St*et,(vt+gt)*nt,(St-st)*et,(vt+st)*nt,(St-gt)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(St+st)*et,(vt+st)*nt,(St+gt)*et,(vt+gt)*nt,(St+st)*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-st)*nt,St*et,(vt-gt)*nt,(St+st)*et,(vt-st)*nt,(St+gt)*et).close()),Tt.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.7*et)),Tt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.2*et,.75*nt,.475*et,.75*nt,.225*et)),Tt.add(new go.PathSegment(go.PathSegment.Bezier,.3*nt,.35*et,.4*nt,.2*et,.3*nt,.25*et)),ht}),go.Shape.defineFigureGenerator("Location",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(.5*nt,et,!0).add(new go.PathSegment(go.PathSegment.Line,.75*nt,.5*et)).add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,.975*nt,.025*et,.5*nt,0)).add(new go.PathSegment(go.PathSegment.Bezier,.25*nt,.5*et,.5*nt,0,.025*nt,.025*et).close()).add(new go.PathSegment(go.PathSegment.Move,.5*nt,.2*et)).add(new go.PathSegment(go.PathSegment.Arc,270,360,.5*nt,.3*et,.1*nt,.1*et).close()))}),go.Shape.defineFigureGenerator("Lock",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.5*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.5*et));var gt=new go.PathFigure(.2*nt,.5*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.3*et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.3*et,.25*nt,0,.75*nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.3*et)),ht}),go.Shape.defineFigureGenerator("Unlocked",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.5*et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.5*et));var gt=new go.PathFigure(.2*nt,.5*et,!1);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.5*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.3*et)),gt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.3*et,.25*nt,0,.75*nt,0)),gt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.35*et)),ht}),go.Shape.defineFigureGenerator("Gear",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(.9375*nt,.56246875*et,!0).add(new go.PathSegment(go.PathSegment.Line,.9375*nt,.4375*et)).add(new go.PathSegment(go.PathSegment.Line,.80621875*nt,.4375*et)).add(new go.PathSegment(go.PathSegment.Bezier,.763*nt,.3316875*et,.79840625*nt,.39915625*et,.7834375*nt,.3635*et)).add(new go.PathSegment(go.PathSegment.Line,.8566875*nt,.23796875*et)).add(new go.PathSegment(go.PathSegment.Line,.76825*nt,.14959375*et)).add(new go.PathSegment(go.PathSegment.Line,.67596875*nt,.24184375*et)).add(new go.PathSegment(go.PathSegment.Bezier,.5625*nt,.19378125*et,.64228125*nt,.2188125*et,.603875*nt,.2021875*et)).add(new go.PathSegment(go.PathSegment.Line,.5625*nt,.0625*et)).add(new go.PathSegment(go.PathSegment.Line,.4375*nt,.0625*et)).add(new go.PathSegment(go.PathSegment.Line,.4375*nt,.19378125*et)).add(new go.PathSegment(go.PathSegment.Bezier,.32775*nt,.239375*et,.39759375*nt,.20190625*et,.36053125*nt,.2176875*et)).add(new go.PathSegment(go.PathSegment.Line,.2379375*nt,.14959375*et)).add(new go.PathSegment(go.PathSegment.Line,.14953125*nt,.2379375*et)).add(new go.PathSegment(go.PathSegment.Line,.23934375*nt,.3278125*et)).add(new go.PathSegment(go.PathSegment.Bezier,.19378125*nt,.4375*et,.21765625*nt,.36059375*et,.201875*nt,.397625*et)).add(new go.PathSegment(go.PathSegment.Line,.0625*nt,.4375*et)).add(new go.PathSegment(go.PathSegment.Line,.0625*nt,.5625*et)).add(new go.PathSegment(go.PathSegment.Line,.1938125*nt,.5625*et)).add(new go.PathSegment(go.PathSegment.Bezier,.241875*nt,.67596875*et,.20221875*nt,.603875*et,.21884375*nt,.64228125*et)).add(new go.PathSegment(go.PathSegment.Line,.1495625*nt,.76825*et)).add(new go.PathSegment(go.PathSegment.Line,.238*nt,.8566875*et)).add(new go.PathSegment(go.PathSegment.Line,.3316875*nt,.76296875*et)).add(new go.PathSegment(go.PathSegment.Bezier,.43753125*nt,.80621875*et,.36353125*nt,.78340625*et,.3991875*nt,.79840625*et)).add(new go.PathSegment(go.PathSegment.Line,.43753125*nt,.9375*et)).add(new go.PathSegment(go.PathSegment.Line,.5625*nt,.9375*et)).add(new go.PathSegment(go.PathSegment.Line,.5625*nt,.80621875*et)).add(new go.PathSegment(go.PathSegment.Bezier,.67225*nt,.760625*et,.602375*nt,.79809375*et,.63946875*nt,.78234375*et)).add(new go.PathSegment(go.PathSegment.Line,.76828125*nt,.8566875*et)).add(new go.PathSegment(go.PathSegment.Line,.85671875*nt,.76825*et)).add(new go.PathSegment(go.PathSegment.Line,.76065625*nt,.67221875*et)).add(new go.PathSegment(go.PathSegment.Bezier,.80621875*nt,.56246875*et,.78234375*nt,.63940625*et,.798125*nt,.602375*et)).add(new go.PathSegment(go.PathSegment.Line,.9375*nt,.56246875*et).close()).add(new go.PathSegment(go.PathSegment.Move,.5*nt,.6*et)).add(new go.PathSegment(go.PathSegment.Arc,90,360,.5*nt,.5*et,.1*nt,.1*et).close()))}),go.Shape.defineFigureGenerator("Hand",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.5*et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Bezier,.1*nt,.3*et,0,.375*et,.05*nt,.325*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.45*nt,.075*et,.3*nt,.225*et,.4*nt,.175*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.525*nt,.075*et,.46*nt,.05*et,.525*nt,.05*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.3*nt,.4*et,.525*nt,.275*et,.475*nt,.325*et)),st.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.4*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.9*nt,.55*et,nt,.4*et,nt,.55*et)),st.add(new go.PathSegment(go.PathSegment.Line,.425*nt,.55*et)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.55*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.6*nt,.7*et,.675*nt,.55*et,.675*nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Line,.575*nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.575*nt,.85*et,.65*nt,.7*et,.65*nt,.85*et)),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.85*et)),st.add(new go.PathSegment(go.PathSegment.Line,.525*nt,.85*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.535*nt,et,.61*nt,.85*et,.61*nt,et)),st.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*et,.435*nt,et,0,et).close()),ht}),go.Shape.defineFigureGenerator("Map",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,.2*et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.25*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,.25*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),st.add(new go.PathSegment(go.PathSegment.Move,.25*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.25*nt,.8*et)),st.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),st.add(new go.PathSegment(go.PathSegment.Move,.75*nt,0)),st.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.8*et)),ht}),go.Shape.defineFigureGenerator("Eject",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt,et)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et*.7)),st.add(new go.PathSegment(go.PathSegment.Line,0,et*.7).close());var gt=new go.PathFigure(0,et*.6,!0);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt,.6*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0).close()),ht}),go.Shape.defineFigureGenerator("Pencil",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,.2*nt,.1*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)).add(new go.PathSegment(go.PathSegment.Line,.9*nt,et)).add(new go.PathSegment(go.PathSegment.Line,.1*nt,.2*et).close()))}),go.Shape.defineFigureGenerator("Building",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*1,et*1,!1);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,0,et*.85)),st.add(new go.PathSegment(go.PathSegment.Line,.046*nt,et*.85)),st.add(new go.PathSegment(go.PathSegment.Line,.046*nt,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,0,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,0,et*.3)),st.add(new go.PathSegment(go.PathSegment.Line,.046*nt,et*.3)),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*nt,et*.3)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et*.3)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*nt,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*nt,et*.85)),st.add(new go.PathSegment(go.PathSegment.Line,nt,et*.85).close());var gt=new go.PathFigure(.126*nt,.85*et,!1);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,.126*nt,.45*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.322*nt,.45*et)),gt.add(new go.PathSegment(go.PathSegment.Line,.322*nt,.85*et).close());var vt=new go.PathFigure(.402*nt,.85*et,!1);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.402*nt,.45*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.598*nt,.45*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.598*nt,.85*et).close());var St=new go.PathFigure(.678*nt,.85*et,!1);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,.678*nt,.45*et)),St.add(new go.PathSegment(go.PathSegment.Line,.874*nt,.45*et)),St.add(new go.PathSegment(go.PathSegment.Line,.874*nt,.85*et).close());var Et=new go.PathFigure(.5*nt,.1*et,!1);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,(.046+.15)*nt,.3*et)),Et.add(new go.PathSegment(go.PathSegment.Line,(1-(.046+.15))*nt,.3*et).close()),ht}),go.Shape.defineFigureGenerator("Staircase",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et*1,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*.2,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.2,et*.8)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.8)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.6)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.6)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.4)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*.4)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*.2)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.2)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.15)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.15)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.35)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.35)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.55)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.35,et*.55)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.35,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.15,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.15,et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,0,et*.95).close()),ht}),go.Shape.defineFigureGenerator("5Bars",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,et*1,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*.184,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.184,et*(1-.184)).close());var gt=new go.PathFigure(nt*.204,et,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.204,et*(1-.184))),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.388,et*(1-.184*2))),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.388,et*1).close());var vt=new go.PathFigure(nt*.408,et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.408,et*(1-.184*2))),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.592,et*(1-.184*3))),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.592,et*1).close());var St=new go.PathFigure(nt*.612,et,!0);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt*.612,et*(1-.184*3))),St.add(new go.PathSegment(go.PathSegment.Line,nt*.796,et*(1-.184*4))),St.add(new go.PathSegment(go.PathSegment.Line,nt*.796,et*1).close());var Et=new go.PathFigure(nt*.816,et,!0);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,nt*.816,et*(1-.184*4))),Et.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*(1-.184*5))),Et.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1).close()),ht}),go.Shape.defineFigureGenerator("PC",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,0,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,0).close());var gt=new go.PathFigure(nt*.055,.07*et,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.07)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.1)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.055,et*.1).close());var vt=new go.PathFigure(nt*.055,.13*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.13)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.16)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.055,et*.16).close());var St=new go.PathFigure(nt*.055,.18*et,!0);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.18)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.21)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.055,et*.21).close());var Et=new go.PathFigure(nt*1,0,!0);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,nt*.4,0)),Et.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.65)),Et.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.65).close()),ht}),go.Shape.defineFigureGenerator("Plane",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(.55*nt,et,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.7*et)),st.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.475*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.35*nt,.525*et,0,.4*et,.225*nt,.45*et)),st.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.475*et)),st.add(new go.PathSegment(go.PathSegment.Line,.15*nt,.35*et)),st.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.325*et)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.325*et)),st.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.1*et)),st.add(new go.PathSegment(go.PathSegment.Bezier,.9*nt,.2*et,.975*nt,0,nt,.08*et)),st.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.45*et)),st.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.95*et)),st.add(new go.PathSegment(go.PathSegment.Line,.55*nt,et).close()),ht}),go.Shape.defineFigureGenerator("Key",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*1,et*.5,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*.9,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,.4*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,.35*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.45,.35*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.15,.2*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.35*et)),st.add(new go.PathSegment(go.PathSegment.Line,0,.65*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.15,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,.8*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.45,.65*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,.65*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.6,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.65,.55*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.7,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.75,.55*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.8,.6*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.85,.575*et)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.9,.6*et).close()),st.add(new go.PathSegment(go.PathSegment.Move,.17*nt,.425*et)),st.add(new go.PathSegment(go.PathSegment.Arc,270,360,.17*nt,.5*et,.075*nt,.075*et).close()),ht}),go.Shape.defineFigureGenerator("FilmTape",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(0,0,!1);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Arc,270,180,nt*0,nt*.3,nt*.055)),st.add(new go.PathSegment(go.PathSegment.Line,0,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.08,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.08,et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*1),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*1),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*2),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*2),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*3),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*3),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*4),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*4),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*5),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*5),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*6),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*6),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*7),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*7),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*8),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*8),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*9),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*9),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*10),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*10),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*11),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*11),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*12),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*12),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*13),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*13),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*14),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*14),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*15),et*.95)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*15),et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1));var gt=new go.PathFigure(0,0,!1);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*0)),gt.add(new go.PathSegment(go.PathSegment.Arc,270,-180,nt*1,nt*.3,nt*.055)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1));var vt=new go.PathFigure(nt*.11,et*.1,!1);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*1+.028*0),et*.1)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*1+.028*0),et*.8)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.11,et*.8).close());var St=new go.PathFigure(nt*(.11+.24133333*1+.028*1),et*.1,!1);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*2+.028*1),et*.1)),St.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*2+.028*1),et*.8)),St.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*1+.028*1),et*.8).close());var Et=new go.PathFigure(nt*(.11+.24133333*2+.028*2),et*.1,!1);return ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*3+.028*2),et*.1)),Et.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*3+.028*2),et*.8)),Et.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*2+.028*2),et*.8).close()),ht}),go.Shape.defineFigureGenerator("FloppyDisk",function(Bt,nt,et){var ht=new go.Geometry,st=8,gt=st*qt,vt=new go.PathFigure(st,0,!1);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.86,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.14)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et-st)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt-st,et,nt,et-gt,nt-gt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,st,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,et-st,gt,et,0,et-gt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,st)),vt.add(new go.PathSegment(go.PathSegment.Bezier,st,0,0,gt,gt,0).close());var St=new go.PathFigure(nt*.83,0,!1);ht.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt*.83,et*.3)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.17,et*.3)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.17,et*0).close());var Et=new go.PathFigure(nt*.83,et*1,!1);ht.add(Et),Et.add(new go.PathSegment(go.PathSegment.Line,nt*.83,et*.5)),Et.add(new go.PathSegment(go.PathSegment.Line,nt*.17,et*.5)),Et.add(new go.PathSegment(go.PathSegment.Line,nt*.17,et*1).close());var Tt=new go.PathFigure(nt*.78,et*.05,!1);return ht.add(Tt),Tt.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*.05)),Tt.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*.25)),Tt.add(new go.PathSegment(go.PathSegment.Line,nt*.78,et*.25).close()),ht}),go.Shape.defineFigureGenerator("SpeechBubble",function(Bt,nt,et){var ht=Bt?Bt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=15),ht=Math.min(ht,nt/3),ht=Math.min(ht,et/3);var st=ht*qt,gt=et*.8,vt=new go.Geometry,St=new go.PathFigure(ht,0,!0);return vt.add(St),St.add(new go.PathSegment(go.PathSegment.Line,nt-ht,0)),St.add(new go.PathSegment(go.PathSegment.Bezier,nt,ht,nt-st,0,nt,st)),St.add(new go.PathSegment(go.PathSegment.Line,nt,gt-ht)),St.add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,gt,nt,gt-st,nt-st,gt)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.7,gt)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et)),St.add(new go.PathSegment(go.PathSegment.Line,nt*.55,gt)),St.add(new go.PathSegment(go.PathSegment.Line,ht,gt)),St.add(new go.PathSegment(go.PathSegment.Bezier,0,gt-ht,st,gt,0,gt-st)),St.add(new go.PathSegment(go.PathSegment.Line,0,ht)),St.add(new go.PathSegment(go.PathSegment.Bezier,ht,0,0,st,st,0).close()),st>1?(vt.spot1=new go.Spot(0,0,st,st),vt.spot2=new go.Spot(1,.8,-st,-st)):(vt.spot1=go.Spot.TopLeft,vt.spot2=new go.Spot(1,.8)),vt}),go.Shape.defineFigureGenerator("Repeat",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*0,et*.45,!0);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*.25,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,et*.9)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.9)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.65,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.2,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.2,et*.45).close());var gt=new go.PathFigure(nt*1,et*.55,!0);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*1)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.55)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et*.55)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et*.1)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.1)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.35,et*0)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*0)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*.55).close()),ht}),go.Shape.defineFigureGenerator("Windows",function(Bt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close()).add(new go.PathSegment(go.PathSegment.Move,.4*nt,.4*et)).add(new go.PathSegment(go.PathSegment.Line,.4*nt,.8*et)).add(new go.PathSegment(go.PathSegment.Line,.9*nt,.8*et)).add(new go.PathSegment(go.PathSegment.Line,.9*nt,.4*et).close()).add(new go.PathSegment(go.PathSegment.Move,.2*nt,.1*et)).add(new go.PathSegment(go.PathSegment.Line,.2*nt,.6*et)).add(new go.PathSegment(go.PathSegment.Line,.7*nt,.6*et)).add(new go.PathSegment(go.PathSegment.Line,.7*nt,.1*et).close()).add(new go.PathSegment(go.PathSegment.Move,.1*nt,.6*et)).add(new go.PathSegment(go.PathSegment.Line,.1*nt,.9*et)).add(new go.PathSegment(go.PathSegment.Line,.5*nt,.9*et)).add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et).close()))}),go.Shape.defineFigureGenerator("Terminal",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*0,et*.1,!1);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.9)),st.add(new go.PathSegment(go.PathSegment.Line,nt*0,et*.9).close());var gt=new go.PathFigure(nt*.1,et*.2,!0);ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.1,et*.25)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.22,et*.285)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.1,et*.32)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.1,et*.37)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.275,et*.32)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.275,et*.25).close());var vt=new go.PathFigure(nt*.28,et*.37,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.37)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.41)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.28,et*.41).close()),ht}),go.Shape.defineFigureGenerator("Beaker",function(Bt,nt,et){var ht=new go.Geometry,st=15,gt=st*qt,vt=new go.PathFigure(nt*.62,et*.475,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et-st)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt-st,et,nt,et-gt,nt-gt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,st,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,et-st,gt,et,0,et-gt)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.38,et*.475)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.38,et*.03)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.36,et*0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.64,et*0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.62,et*.03).close()),gt>1?(ht.spot1=new go.Spot(0,0,gt,gt),ht.spot2=new go.Spot(1,1,-gt,-gt)):(ht.spot1=go.Spot.TopLeft,ht.spot2=go.Spot.BottomRight),ht}),go.Shape.defineFigureGenerator("Download",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*0,et*1,!0);ht.add(st);var gt=.1/.3;st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.755,et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.93,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.64,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.61,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.39,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.36,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.07,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.755),et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.8),et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*0,et*(1-gt)).close());var vt=new go.PathFigure(nt*.4,et*0,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.26,et*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.66)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.26),et*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*0).close()),ht}),go.Shape.defineFigureGenerator("Bin",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*0,et*1,!0);ht.add(st);var gt=.1/.3;return st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.755,et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.93,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.64,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.61,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.39,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.36,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.07,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.755),et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.8),et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*0,et*(1-gt)).close()),ht}),go.Shape.defineFigureGenerator("Upload",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*0,et*1,!0);ht.add(st);var gt=.1/.3;st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.755,et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.93,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.64,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.61,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.39,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.36,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*.07,et*(1-gt))),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.755),et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*.055)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.8),et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*0,et*(1-gt)).close());var vt=new go.PathFigure(nt*.5,et*0,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.26,et*.25)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.25)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.63)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.63)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.25)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.74,et*.25).close()),ht}),go.Shape.defineFigureGenerator("EmptyDrink",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*.15,et*0,!1);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*.85,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,et*1).close()),ht}),go.Shape.defineFigureGenerator("Drink",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*.15,et*0,!1);ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*.85,et*0)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.3,et*1).close());var gt=new go.PathFigure(nt*.235,et*.28,!0);return ht.add(gt),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.765,et*.28)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.655,et*.97)),gt.add(new go.PathSegment(go.PathSegment.Line,nt*.345,et*.97).close()),ht}),go.Shape.defineFigureGenerator("4Arrows",function(Bt,nt,et){var ht=new go.Geometry,st=new go.PathFigure(nt*.5,et*0,!0);return ht.add(st),st.add(new go.PathSegment(go.PathSegment.Line,nt*.65,et*.25)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.25)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.35)),st.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.5)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.65)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.55)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.55)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.65,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*1)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.35,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.75)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.55)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.25,et*.55)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.25,et*.65)),st.add(new go.PathSegment(go.PathSegment.Line,nt*0,et*.5)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.25,et*.35)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.25,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.45)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.25)),st.add(new go.PathSegment(go.PathSegment.Line,nt*.35,et*.25).close()),ht}),go.Shape.defineFigureGenerator("Connector","Ellipse"),go.Shape.defineFigureGenerator("Alternative","TriangleUp"),go.Shape.defineFigureGenerator("Merge","TriangleUp"),go.Shape.defineFigureGenerator("Decision","Diamond"),go.Shape.defineFigureGenerator("DataTransmissions","Hexagon"),go.Shape.defineFigureGenerator("Gate","Crescent"),go.Shape.defineFigureGenerator("Delay","HalfEllipse"),go.Shape.defineFigureGenerator("Input","Parallelogram1"),go.Shape.defineFigureGenerator("ManualLoop","ManualOperation"),go.Shape.defineFigureGenerator("ISOProcess","Chevron"),go.Shape.defineFigureGenerator("MessageToUser","SquareArrow"),go.Shape.defineFigureGenerator("MagneticData","Cylinder1"),go.Shape.defineFigureGenerator("DirectData","Cylinder4"),go.Shape.defineFigureGenerator("StoredData","DataStorage"),go.Shape.defineFigureGenerator("SequentialData","MagneticTape"),go.Shape.defineFigureGenerator("Subroutine","Procedure")},91e3:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(){if(typeof window.GGBApplet=="function"){console.warn("deployggb.js was loaded twice");return}var isRenderGGBElementEnabled=!1,scriptLoadStarted=!1,html5AppletsToProcess=null,ggbHTML5LoadedCodebaseIsWebSimple=!1,ggbHTML5LoadedCodebaseVersion=null,ggbHTML5LoadedScript=null,GGBApplet=function(){"use strict";for(var Dn={},Gn="5.0",kt={},pt=null,Ut=!1,le=!1,Me=null,ue=!1,It=null,qt=null,ge=0;ge<arguments.length;ge++){var ne=arguments[ge];if(ne!==null)switch(typeof ne){case"number":Gn=ne.toFixed(1);break;case"string":ne.match(new RegExp("^[0-9]\\.[0-9]+$"))?Gn=ne:Me=ne;break;case"object":typeof ne.is3D!="undefined"?pt=ne:kt=ne;break;case"boolean":Ut=ne,le=!0;break}}pt===null&&(pt={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},kt.material_id!==void 0&&!le&&(Ut=!0)),Me!==null&&kt.id===void 0&&(kt.id=Me);var Rt="",Ae="",ie=!1,Ee=null,Bt=null,nt=null,et=!1,ht=null,st=null,gt=null,vt=null,St=null;kt.height!==void 0&&(kt.height=Math.round(kt.height)),kt.width!==void 0&&(kt.width=Math.round(kt.width));var Et=function(De){return parseFloat(De)>4?parseFloat(De):5};Dn.setHTML5Codebase=function(De,dn){qt=De,qe(De,dn)},Dn.setJavaCodebase=Dn.setJavaCodebaseVersion=Dn.isCompiledInstalled=Dn.setPreCompiledScriptPath=Dn.setPreCompiledResourcePath=function(){},Dn.setHTML5CodebaseVersion=function(De,dn){var sn=parseFloat(De);if(sn!==NaN&&sn<5){console.log("The GeoGebra HTML5 codebase version "+sn+" is deprecated. Using version latest instead.");return}It=De,Xt(De,dn)},Dn.getHTML5CodebaseVersion=function(){return Bt},Dn.getParameters=function(){return kt},Dn.setFontsCSSURL=function(De){vt=De},Dn.setGiacJSURL=function(De){},Dn.setJNLPFile=function(De){Rt=De},Dn.setJNLPBaseDir=function(De){},Dn.inject=function(){function De(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var dn="auto",sn=kt.id,jn,Te=!1,Sn=0;Sn<arguments.length;Sn++){var ee=arguments[Sn];typeof ee=="string"?(ee=ee.toLowerCase(),ee.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?dn=ee:sn=arguments[Sn]):typeof ee=="boolean"?Te=ee:ee instanceof HTMLElement&&(jn=ee)}Mn();function Mn(){if(!ue){setTimeout(Mn,200);return}dn=Ke(dn);var ui=jn||document.getElementById(sn);if(!ui){console.log("possibly bug on ajax loading? ");return}if(Dn.removeExistingApplet(ui,!1),kt.width===void 0&&ui.clientWidth&&(kt.width=ui.clientWidth),kt.height===void 0&&ui.clientHeight&&(kt.height=ui.clientHeight),!(kt.width&&kt.height)&&dn==="html5"&&(delete kt.width,delete kt.height),Ee=dn,dn==="screenshot")Ce(ui,kt);else{var _t=!1;kt.hasOwnProperty("playButton")&&kt.playButton||kt.hasOwnProperty("clickToLoad")&&kt.clickToLoad?_t=!0:kt.hasOwnProperty("playButtonAutoDecide")&&kt.playButtonAutoDecide&&(_t=(!Tt()||De())&&Dt()),_t?(Ee="screenshot",tn(ui,kt,Te,dn)):Ne(ui,kt,Te)}}};function Tt(){try{return window.self!==window.top}catch(De){return!0}}function Dt(){return kt.hasOwnProperty("screenshotGenerator")&&kt.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}Dn.getViews=function(){return pt},Dn.isJavaInstalled=function(){return!1};var Jt=function(De){var dn=function(Sn){var ee=JSON.parse(Sn),Mn=function(Lt){return Lt.type=="G"||Lt.type=="E"},ui=ee.elements?ee.elements.filter(Mn)[0]:ee;if(!ui||!ui.url){sn();return}kt.fileName=ui.url,Yt(ui.settings||{}),pt.is3D=!0;var _t="https://www.geogebra.org/images/";Dn.setPreviewImage(ht||ui.previewUrl,_t+"GeoGebra_loading.png",_t+"applet_play.png"),De()},sn=function(){kt.onError&&kt.onError(),_n("Error: Fetching material (id "+kt.material_id+") failed.",kt)},jn=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",Te="/materials/"+kt.material_id+"?scope=basic";Gt("https://"+jn+"/api/proxy.php?path="+encodeURIComponent(Te),dn,sn)};function Yt(De){var dn=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(sn){De[sn]=!!De[sn]}),dn.forEach(function(sn){kt[sn]===void 0&&De[sn]!==void 0&&(kt[sn]=De[sn])}),kt.showToolBarHelp===void 0&&(kt.showToolBarHelp=kt.showToolBar)}function Gt(De,dn,sn){var jn=new XMLHttpRequest;jn.open("GET",De),jn.onload=function(){dn(jn.responseText)},jn.onerror=sn,jn.send()}Dn.isHTML5Installed=function(){return!0},Dn.getLoadedAppletType=function(){return Ee},Dn.setPreviewImage=function(De,dn,sn){ht=De,st=dn,gt=sn},Dn.removeExistingApplet=function(De,dn){var sn;typeof De=="string"&&(De=document.getElementById(De)),Ee=null;var jn=null;for(sn=0;sn<De.childNodes.length;sn++){var Te=De.childNodes[sn],Sn=Te.className;Sn==="applet_screenshot"?dn?(Te.style.display="block",Ee="screenshot"):Te.style.display="none":Sn!=="applet_scaler prerender"&&(De.removeChild(Te),jn=Sn&&Sn.indexOf("appletParameters")!=-1?Te.id:null,sn--)}var ee=kt.id!==void 0?kt.id:jn,Mn=window[ee];Mn&&typeof Mn.getBase64=="function"&&(Mn.remove(),window[ee]=null)},Dn.refreshHitPoints=function(){if(Et(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var De=Dn.getAppletObject();return De&&typeof De.recalculateEnvironments=="function"?(De.recalculateEnvironments(),!0):!1},Dn.startAnimation=function(){var De=Dn.getAppletObject();return De&&typeof De.startAnimation=="function"?(De.startAnimation(),!0):!1},Dn.stopAnimation=function(){var De=Dn.getAppletObject();return De&&typeof De.stopAnimation=="function"?(De.stopAnimation(),!0):!1},Dn.getAppletObject=function(){var De=kt.id!==void 0?kt.id:"ggbApplet";return window[De]},Dn.resize=function(){};var me=function(De,dn,sn){var jn=document.createElement("param");jn.setAttribute("name",dn),jn.setAttribute("value",sn),De.appendChild(jn)},ae=function(De){return De&&De!=="false"},Ne=function(De,dn,sn){Et(Bt)<=4.2&&(sn=!0);var jn=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==Bt||ggbHTML5LoadedCodebaseIsWebSimple&&!et)&&(jn=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var Te=document.createElement("div");Te.classList.add("appletParameters","notranslate");var Sn=dn.width,ee=dn.height;if(dn.disableAutoScale=dn.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():dn.disableAutoScale,dn.width!==void 0)if(Et(Bt)<=4.4)ae(dn.showToolBar)&&(dn.height-=7),ae(dn.showAlgebraInput)&&(dn.height-=37),dn.width<605&&ae(dn.showToolBar)&&(dn.width=605,Sn=605);else{var Mn=100;(ae(dn.showToolBar)||ae(dn.showMenuBar))&&(dn.hasOwnProperty("customToolBar")&&(dn.customToolbar=dn.customToolBar),Mn=ae(dn.showMenuBar)?245:155),Sn<Mn&&(dn.width=Mn,Sn=Mn)}Te.style.border="none",Te.style.display="inline-block";for(var ui in dn)dn.hasOwnProperty(ui)&&ui!=="appletOnLoad"&&Te.setAttribute("data-param-"+ui,dn[ui]);vt&&Te.setAttribute("data-param-fontscssurl",vt),Dn.resize=function(){GGBAppletUtils.responsiveResize(De,dn)},window.addEventListener("resize",function(Le){Dn.resize()});var _t=typeof dn.appletOnLoad=="function"?dn.appletOnLoad:function(){};if(!sn&&dn.width!==void 0){dn.hasOwnProperty("showSplash")||Te.setAttribute("data-param-showSplash","false");var Lt=De.querySelector(".applet_scaler.prerender"),Pt=Lt!==null;if(Pt)var Nt=Lt.querySelector(".ggb_preview");else{var Nt=an(Sn,ee,dn.borderColor,!1);Lt=document.createElement("div"),Lt.className="applet_scaler",Lt.style.position="relative",Lt.style.display="block",Lt.style.width=Sn+"px",Lt.style.height=ee+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Lt,"66%"),Et(Bt)>=5?(dn.appletOnLoad=function(Le){var Xe=De.querySelector(".ggb_preview");Xe&&Xe.parentNode.removeChild(Xe),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(Lt),window.GGBT_wsf_view&&$(window).trigger("resize"),_t(Le)},Pt||Lt.appendChild(Nt)):Te.appendChild(Nt),Lt.appendChild(Te),Pt||De.appendChild(Lt),setTimeout(function(){Dn.resize()},1)}else{var zt=document.createElement("div");zt.className="applet_scaler",zt.style.position="relative",zt.style.display="block",zt.appendChild(Te),De.appendChild(zt),dn.appletOnLoad=function(Le){Dn.resize(),_t(Le)}}function Mt(Le,Xe){Xe&&typeof Xe.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(Le,Xe.appletOnLoad):renderGGBElement(Le),_n("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",Xe)}function Kt(Le,Xe){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:Le,params:Xe}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(vn){Mt(vn.article,vn.params)}),html5AppletsToProcess=null)},Et(Bt)<5&&(Le.className+=" geogebraweb")):Mt(Le,Xe)}if(jn){scriptLoadStarted=!0;for(var ye=0;ye<Te.childNodes.length;ye++){var Ue=Te.childNodes[ye].tagName;Ue==="TABLE"&&(Te.removeChild(Te.childNodes[ye]),ye--)}if(ggbHTML5LoadedScript!==null){var Qe=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');Qe!=null&&Qe.parentNode.removeChild(Qe)}var ce=document.createElement("script"),Oe=function(){Kt(Te,dn)};ce.src=Ae+nt,ggbHTML5LoadedCodebaseIsWebSimple=et,ggbHTML5LoadedCodebaseVersion=Bt,ggbHTML5LoadedScript=ce.src,_n("GeoGebra HTML5 codebase loaded: '"+Ae+"'.",dn),!qt&&(!It||It=="5.0")?(et?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),Oe()):Ae.requirejs?__webpack_require__.e(245).then(function(){var Le=[__webpack_require__(40245)];Oe.apply(null,Le)}.bind(this)).catch(__webpack_require__.oe):(ce.onload=Oe,De.appendChild(ce))}else Kt(Te,dn);dn.height=ee,dn.width=Sn},Ce=function(De,dn,sn){var jn=an(dn.width,dn.height,dn.borderColor,sn),Te=document.createElement("div");Te.style.position="relative",Te.style.display="block",Te.style.width=dn.width+"px",Te.style.height=dn.height+"px",Te.className="applet_screenshot applet_scaler"+(sn?" applet_screenshot_play":""),Te.appendChild(jn);var Sn=GGBAppletUtils.getScale(dn,De,sn);sn?(De.appendChild(_e()),window.GGBT_wsf_view||(De.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Te,"66%"),De.appendChild(Te),Sn!==1&&!isNaN(Sn)&&(GGBAppletUtils.scaleElement(Te,Sn),Te.style.width=dn.width+"px",Te.style.height=dn.height+"px",Te.parentNode.style.width=dn.width*Sn+"px",Te.parentNode.style.height=dn.height*Sn+"px"),Dn.resize=function(){we(De,jn,Te,sn)},window.addEventListener("resize",function(ee){Dn.resize()}),Dn.resize()};function we(De,dn,sn,jn){if(De.contains(dn)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(De.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(De)}var Te=GGBAppletUtils.getScale(kt,De,jn);sn.parentNode!==null&&(!isNaN(Te)&&Te!==1?(GGBAppletUtils.scaleElement(sn,Te),sn.parentNode.style.width=kt.width*Te+"px",sn.parentNode.style.height=kt.height*Te+"px"):(GGBAppletUtils.scaleElement(sn,1),sn.parentNode.style.width=kt.width+"px",sn.parentNode.style.height=kt.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(De),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}Dn.onExitFullscreen=function(De,dn){dn.appendChild(De)};var tn=function(De,dn,sn,jn){Ce(De,dn,!0);for(var Te=function(){var Mn=[];for(ee=0;ee<De.childNodes.length;ee++)Mn.push(De.childNodes[ee]);if(window.GGBT_wsf_view){var ui=window.GGBT_wsf_view.renderFullScreen(De,dn.id),_t=document.getElementById("fullscreencontainer"),Lt=jQuery(De).find(".fullscreencontent");Lt.length>0?(ui.remove(),Lt.attr("id","fullscreencontent").show(),jQuery(_t).append(Lt),window.dispatchEvent(new Event("resize"))):Ne(ui,dn,!1),window.GGBT_wsf_view.launchFullScreen(_t)}else Ee=jn,Ne(De,dn,!1);if(!window.GGBT_wsf_view)for(ee=0;ee<Mn.length;ee++)De.removeChild(Mn[ee])},Sn=De.getElementsByClassName("ggb_preview_play"),ee=0;ee<Sn.length;ee++)Sn[ee].addEventListener("click",Te,!1),Sn[ee].addEventListener("ontouchstart",Te,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(De),Dt()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},_e=function(){var De=document.createElement("div");if(De.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var dn='.icon-applet-play { width: 100%; height: 100%;box-sizing: border-box;position: absolute;z-index: 1001;cursor: pointer;border-width: 0px; background-color: transparent;background-repeat: no-repeat;left: 0;top: 0;background-position: center center; background-image: url("https://www.geogebra.org/images/worksheet/icon-start-applet.png");}.icon-applet-play:hover {background-image: url("https://www.geogebra.org/images/worksheet/icon-start-applet-hover.png");}',sn=document.createElement("style");sn.styleSheet?sn.styleSheet.cssText=dn:sn.appendChild(document.createTextNode(dn)),document.getElementsByTagName("head")[0].appendChild(sn)}return De},an=function(De,dn,sn,jn){var Te=document.createElement("div");Te.className="ggb_preview",Te.style.position="absolute",Te.style.zIndex="90",Te.style.width=De-2+"px",Te.style.height=dn-2+"px",Te.style.top="0px",Te.style.left="0px",Te.style.overflow="hidden",Te.style.backgroundColor="white";var Sn="lightgrey";sn!==void 0&&(sn==="none"?Sn="transparent":Sn=sn),Te.style.border="1px solid "+Sn;var ee=document.createElement("img");if(ee.style.position="relative",ee.style.zIndex="1000",ee.style.top="-1px",ee.style.left="-1px",ht!==null&&ee.setAttribute("src",ht),ee.style.opacity=.7,st!==null){var Mn,ui,_t;if(!jn){Mn=document.createElement("img"),Mn.style.position="absolute",Mn.style.zIndex="1001",Mn.style.opacity=1,ee.style.opacity=.3,ui=360,ui>De/4*3&&(ui=De/4*3),_t=ui/5.8,Mn.setAttribute("src",st),Mn.setAttribute("width",ui),Mn.setAttribute("height",_t);var Lt=(De-ui)/2,Pt=(dn-_t)/2;Mn.style.left=Lt+"px",Mn.style.top=Pt+"px",Te.appendChild(Mn)}}return Te.appendChild(ee),Te},Ke=function(De){return De=De.toLowerCase(),De==="html5"||De==="screenshot"?De:"html5"},oe=["web","webSimple","web3d","tablet","tablet3d","phone"],Xt=function(De,dn){if(Bt=De,dn){qe(Bt,!0);return}var sn=!Ut;if(sn){var jn=Et(Bt);!isNaN(jn)&&jn<4.4&&(sn=!1)}var Te,Sn;window.location.protocol.substr(0,4)==="http"?Te=window.location.protocol:Te="http:";var ee=Bt.indexOf("//");ee>0?Sn=Bt:ee===0?Sn=Te+Bt:Sn="https://www.geogebra.org/apps/5.2.814.0/";for(var Mn in oe)if(Bt.slice(oe[Mn].length*-1)===oe[Mn]||Bt.slice((oe[Mn].length+1)*-1)===oe[Mn]+"/"){qe(Sn,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&sn&&!pt.is3D&&!pt.AV&&!pt.SV&&!pt.CV&&!pt.EV2&&!pt.CP&&!pt.PC&&!pt.DA&&!pt.FI&&!pt.PV&&!ae(kt.showToolBar)&&!ae(kt.showMenuBar)&&!ae(kt.showAlgebraInput)&&!ae(kt.enableRightClick)&&(!kt.appName||kt.appName=="classic")?Sn+="webSimple/":Sn+="web3d/",qe(Sn,!1)},qe=function(De,dn){if(De.requirejs){Ae=De;return}De.slice(-1)!=="/"&&(De+="/"),Ae=De,dn===null&&(dn=De.indexOf("http")===-1),ie=dn,nt="web.nocache.js",et=!1;var sn=Ae.split("/");sn.length>1&&(!dn&&sn[sn.length-2]==="webSimple"?(nt="webSimple.nocache.js",et=!0):oe.indexOf(sn[sn.length-2])>=0&&(nt=sn[sn.length-2]+".nocache.js")),sn=De.split("/"),Bt=sn[sn.length-3],Bt.substr(0,4)==="test"?Bt=Bt.substr(4,1)+"."+Bt.substr(5,1):(Bt.substr(0,3)==="war"||Bt.substr(0,4)==="beta")&&(Bt="5.0");var jn=parseFloat(Bt);jn!==NaN&&jn<5&&De.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+jn+" is deprecated. Using version latest instead."),Xt("5.0",dn))},_n=function(De,dn){window.console&&window.console.log&&(!dn||typeof dn.showLogging=="undefined"||dn.showLogging&&dn.showLogging!=="false")&&console.log(De)};kt.material_id!==void 0?Jt(Pn):Pn();function Pn(){var De=Gn;It!==null?De=It:parseFloat(De)<5&&(De="5.0"),Xt(De,!1),qt!==null&&qe(qt,ie),ue=!0}return Dn},GGBAppletUtils=function(){"use strict";function Dn(){return window.GGBT_wsf_edit!==void 0}function Gn(ue,It){It!=1?(ue.style.transformOrigin="0% 0% 0px",ue.style.webkitTransformOrigin="0% 0% 0px",ue.style.transform="scale("+It+","+It+")",ue.style.webkitTransform="scale("+It+","+It+")",ue.style.maxWidth="initial",ue.querySelector(".ggb_preview")!==null&&(ue.querySelector(".ggb_preview").style.maxWidth="initial"),ue.querySelectorAll(".ggb_preview img")[0]!==void 0&&(ue.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),ue.querySelectorAll(".ggb_preview img")[1]!==void 0&&(ue.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(ue.style.transform="none",ue.style.webkitTransform="none")}function kt(ue,It,qt,ge,ne,Rt){var Ae=null;if(Rt!=null&&Rt!="")for(var ie=ue.parentNode;ie!=null;)if((" "+ie.className+" ").indexOf(" "+Rt+" ")>-1){Ae=ie;break}else ie=ie.parentNode;var Ee=0,Bt=0,nt=0,et=0,ht=0,st=0,gt=0;if(Ae)Ee=Ae.offsetWidth,Bt=Math.max(ge?Ae.offsetWidth:0,Ae.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(Ee=Math.min(window.innerWidth,document.documentElement.clientWidth),Bt=Math.min(window.innerHeight,document.documentElement.clientHeight),nt=Ee):(Ee=window.innerWidth,Bt=window.innerHeight,nt=window.innerWidth),ue){var vt=ue.getBoundingClientRect();vt.left>0&&vt.left<=Ee&&(ne===void 0||!ne)&&(document.dir==="rtl"?(ht=Ee-vt.width-vt.left,st=nt<=480?10:30):(st=vt.left,ht=nt<=480?10:30),et=st+ht)}if(ue&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var St=ue.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(et=40,gt=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(et=0,gt=40)}}return ue&&((qt===void 0||!qt)&&It>0&&It+et<Ee?Ee=It:Ee-=et,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(qt===void 0||!qt)&&(Bt-=gt)),{width:Ee,height:Bt}}function pt(ue,It,qt,ge,ne){if(ue.isScreenshoGenerator)return 1;var Rt=ge!==void 0&&ge,Ae=ue.noScaleMargin!=null&&ue.noScaleMargin,ie=function(St){return St&&St!=="false"},Ee=ie(ue.autoHeight),Bt=kt(It,ue.width,qt,Ee,Rt&&window.GGBT_wsf_view||Ae,ne),nt=parseInt(Bt.width),et=ue.width,ht=ue.height;if(et===void 0){var st=It.querySelector(".appletParameters");st&&(et=st.offsetWidth,ht=st.offsetHeight)}var gt=nt/et,vt=Rt?1:Bt.height/ht;return qt!==void 0&&!qt&&(gt=Math.min(1,gt),vt=Math.min(1,vt)),Math.min(gt,vt)}function Ut(ue,It,qt){var ge=1,ne,Rt=!1;if(ue.hasOwnProperty("allowUpscale")&&(Rt=ue.allowUpscale),ue.hasOwnProperty("scale")&&(ge=parseFloat(ue.scale),(isNaN(ge)||ge===null||ge===0)&&(ge=1),ge>1&&(Rt=!0)),It&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Rt=!0),!(ue.hasOwnProperty("disableAutoScale")&&ue.disableAutoScale))ne=pt(ue,It,Rt,qt,ue.scaleContainerClass);else return ge;return Rt&&(!ue.hasOwnProperty("scale")||ge===1)?ne:Math.min(ge,ne)}function le(ue){var It=Math.min(window.innerWidth,document.documentElement.clientWidth),qt=Math.min(window.innerHeight,document.documentElement.clientHeight),ge=ue.getBoundingClientRect(),ne=(It-ge.width)/2,Rt=(qt-ge.height)/2;Rt<0&&(Rt=0),ue.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(ne<40?ue.style.left="40px":ue.style.left=ne+"px",ue.style.top=Rt+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(Rt<40?ue.style.top="40px":ue.style.top=Rt+"px",ue.style.left=ne+"px")}function Me(ue,It){var qt=ue.querySelector(".appletParameters");if(qt){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(It.id!==qt.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(ue)}if(qt.parentElement&&/fullscreen/.test(qt.parentElement.className))return;var ge=Ut(It,ue);Dn()&&qt.setAttribute("data-param-scale",ge);for(var ne=null,Rt=0;Rt<ue.childNodes.length;Rt++)if(ue.childNodes[Rt].className!==void 0&&ue.childNodes[Rt].className.match(/^applet_scaler/)){ne=ue.childNodes[Rt];break}if(ne!==null&&ne.querySelector(".noscale")!==null)return;var Ae=It.id!==void 0?It.id:"ggbApplet",ie=window[Ae];(ie==null||!ie.recalculateEnvironments)&&ne!==null&&!ne.className.match(/fullscreen/)&&(ne.parentNode.style.transform="",!isNaN(ge)&&ge!==1?(ne.parentNode.style.width=It.width*ge+"px",ne.parentNode.style.height=It.height*ge+"px",Gn(ne,ge)):(Gn(ne,1),ne.parentNode.style.width=It.width+"px",ne.parentNode.style.height=It.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&le(ue),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(qt).parents(".content-added-content"))}}return{responsiveResize:Me,isFlexibleWorksheetEditor:Dn,positionCenter:le,getScale:Ut,scaleElement:Gn}}();__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return GGBApplet}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),__WEBPACK_AMD_DEFINE_RESULT__!==void 0&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__),GGBAppletUtils.makeModule=function(name,permutation){function webModule(){var H="bootstrap",I="begin",J="gwt.codesvr."+name+"=",K="gwt.codesvr=",L=name,M="startup",N="DUMMY",O=0,P=1,Q="iframe",R="position:absolute; width:0; height:0; border:none; left: -1000px;",S=" top: -1000px;",T="Chrome",U="CSS1Compat",V="<!doctype html>",W="",X="<html><head></head><body></body></html>",Y="undefined",Z="readystatechange",$=10,_="script",ab="javascript",bb="Failed to load ",cb="moduleStartup",db="scriptTagAdded",eb="moduleRequested",fb="meta",gb="name",hb=name+"::",ib="::",jb="gwt:property",kb="content",lb="=",mb="gwt:onPropertyErrorFn",nb='Bad handler "',ob='" for "gwt:onPropertyErrorFn"',pb="gwt:onLoadErrorFn",qb='" for "gwt:onLoadErrorFn"',rb="#",sb="?",tb="/",ub="img",vb="clear.cache.gif",wb="baseUrl",xb=name+".nocache.js",yb="base",zb="//",Ab="selectingPermutation",Bb=name+".devmode.js",Cb=permutation,Db=":",Eb=".cache.js",Fb="loadExternalRefs",Gb="end",n=window,o=document;function p(){var Dn=n.location.search;return Dn.indexOf(J)!=-1||Dn.indexOf(K)!=-1}function q(Dn,Gn){}webModule.__sendStats=q,webModule.__moduleName=L,webModule.__errFn=null,webModule.__moduleBase=N,webModule.__softPermutationId=O,webModule.__computePropValue=null,webModule.__getPropMap=null,webModule.__installRunAsyncCode=function(){},webModule.__gwtStartLoadingFragment=function(){return null},webModule.__gwt_isKnownPropertyValue=function(){return!1},webModule.__gwt_getMetaProperty=function(){return null};var r=null,s=n.__gwt_activeModules=n.__gwt_activeModules||{};s[L]={moduleName:L},webModule.__moduleStartupDone=function(Dn){var Gn=s[L].bindings;s[L].bindings=function(){for(var kt=Gn?Gn():{},pt=Dn[webModule.__softPermutationId],Ut=O;Ut<pt.length;Ut++){var le=pt[Ut];kt[le[O]]=le[P]}return kt}};var t;function u(){return v(),t}function v(){if(!t){var Dn=o.createElement(Q);if(Dn.id=L,Dn.style.cssText=R+S,Dn.tabIndex=-1,o.body.appendChild(Dn),t=Dn.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var Gn=document.compatMode==U?V:W;t.write(Gn+X),t.close()}}}function w(Dn){function Gn(pt){function Ut(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var le=Ut();if(le){pt();return}function Me(){if(!le){if(!Ut())return;le=!0,pt(),o.removeEventListener&&o.removeEventListener(Z,Me,!1),ue&&clearInterval(ue)}}o.addEventListener&&o.addEventListener(Z,Me,!1);var ue=setInterval(function(){Me()},$)}function kt(pt){var Ut=u(),le=Ut.body,Me=Ut.createElement(_);Me.language=ab,Me.crossOrigin=W,Me.src=pt,webModule.__errFn&&(Me.onerror=function(){webModule.__errFn(L,new Error(bb+pt))}),le.appendChild(Me)}Gn(function(){kt(Dn)})}webModule.__startLoadingFragment=function(Dn){return C(Dn)},webModule.__installRunAsyncCode=function(Dn){var Gn=u(),kt=Gn.body,pt=Gn.createElement(_);pt.language=ab,pt.text=Dn,kt.appendChild(pt),kt.removeChild(pt)};function A(){for(var c={},d,e,f=o.getElementsByTagName(fb),g=O,h=f.length;g<h;++g){var i=f[g],j=i.getAttribute(gb),k;if(j){if(j=j.replace(hb,W),j.indexOf(ib)>=O)continue;if(j==jb){if(k=i.getAttribute(kb),k){var l,m=k.indexOf(lb);m>=O?(j=k.substring(O,m),l=k.substring(m+P)):(j=k,l=W),c[j]=l}}else if(j==mb){if(k=i.getAttribute(kb),k)try{d=eval(k)}catch(Dn){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(Dn){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(Dn){var Gn=c[Dn];return Gn==null?null:Gn},r=d,webModule.__errFn=e}function B(){function Dn(ue){var It=ue.lastIndexOf(rb);It==-1&&(It=ue.length);var qt=ue.indexOf(sb);qt==-1&&(qt=ue.length);var ge=ue.lastIndexOf(tb,Math.min(qt,It));return ge>=O?ue.substring(O,ge+P):W}function Gn(ue){if(!ue.match(/^\w+:\/\//)){var It=o.createElement(ub);It.src=ue+vb,ue=Dn(It.src)}return ue}function kt(){var ue=__gwt_getMetaProperty(wb);return ue!=null?ue:W}function pt(){for(var ue=o.getElementsByTagName(_),It=O;It<ue.length;++It)if(ue[It].src.indexOf(xb)!=-1)return Dn(ue[It].src);return W}function Ut(){var ue=o.getElementsByTagName(yb);return ue.length>O?ue[ue.length-P].href:W}function le(){var ue=o.location;return ue.href==ue.protocol+zb+ue.host+ue.pathname+ue.search+ue.hash}var Me=kt();return Me==W&&(Me=pt()),Me==W&&(Me=Ut()),Me==W&&le()&&(Me=Dn(o.location.href)),Me=Gn(Me),Me}function C(Dn){return Dn.match(/^\//)||Dn.match(/^[a-zA-Z]+:\/\//)?Dn:webModule.__moduleBase+Dn}function D(){var Dn=[],Gn=O,kt=[],pt=[];function Ut(ue){var It=pt[ue](),qt=kt[ue];if(It in qt)return It;var ge=[];for(var ne in qt)ge[qt[ne]]=ne;throw r&&r(ue,ge,It),null}if(__gwt_isKnownPropertyValue=function(ue,It){return It in kt[ue]},webModule.__getPropMap=function(){var ue={};for(var It in kt)kt.hasOwnProperty(It)&&(ue[It]=Ut(It));return ue},webModule.__computePropValue=Ut,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var le;try{le=Cb;var Me=le.indexOf(Db);Me!=-1&&(Gn=parseInt(le.substring(Me+P),$),le=le.substring(O,Me))}catch(ue){}return webModule.__softPermutationId=Gn,C(le+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}A(),webModule.__moduleBase="/js/mathematicalGraphics/"+name+"/",s[L].moduleBase=webModule.__moduleBase;var G=D();return F(),w(G),!0}return webModule},typeof window.web3d!="function"&&(window.web3d=GGBAppletUtils.makeModule("web3d","A18F540516513B1292CA7CEF2F6AFC7E")),typeof window.webSimple!="function"&&(window.webSimple=GGBAppletUtils.makeModule("webSimple","96B09BF1B436BF53F0DF54116700F16A")),window.GGBApplet=GGBApplet})()},55322:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Ax:function(){return Me},Ds:function(){return ue},KI:function(){return qt},SI:function(){return le},f1:function(){return Ut}});var pt=kt(12242);function Ut(ge){let ne=!0;if(ge.length>0){for(let Rt=0;Rt<ge.length;Rt++)if(ge[Rt].compile_success==0||!ge[Rt].compile_success){ne=!1;break}}else ne=!1;return ne}function le(ge,ne=""){let Rt=[];for(let Ae=0;Ae<ge.length;Ae++){let ie=ge[Ae],Ee=ne?`${ne}/${ie.name}`:`${ie.name}`;Rt.push({title:ie.name,type:ie.type,isLeaf:ie.type!=="tree",key:Ee})}return Rt}function Me(ge,ne,Rt){for(let Ae=0;Ae<ge.length;Ae++){let ie=ge[Ae];if(ie.key===ne){ie.children=Rt;break}ie.children&&Me(ie.children,ne,Rt)}return ge}function ue(ge,ne,Rt){let Ae;return function(){let ie=this,Ee=arguments,Bt=function(){Ae=null,Rt||ge.apply(ie,Ee)},nt=Rt&&!Ae;clearTimeout(Ae),Ae=setTimeout(Bt,ne),nt&&ge.apply(ie,Ee)}}const It=!0,qt=pt.Z.API_SERVER},44399:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Z:function(){return Bt}});var pt=kt(99571),Ut=kt(59301),le=Object.defineProperty,Me=Object.defineProperties,ue=Object.getOwnPropertyDescriptors,It=Object.getOwnPropertySymbols,qt=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable,ne=(nt,et,ht)=>et in nt?le(nt,et,{enumerable:!0,configurable:!0,writable:!0,value:ht}):nt[et]=ht,Rt=(nt,et)=>{for(var ht in et||(et={}))qt.call(et,ht)&&ne(nt,ht,et[ht]);if(It)for(var ht of It(et))ge.call(et,ht)&&ne(nt,ht,et[ht]);return nt},Ae=(nt,et)=>Me(nt,ue(et)),ie=(nt,et)=>{var ht={};for(var st in nt)qt.call(nt,st)&&et.indexOf(st)<0&&(ht[st]=nt[st]);if(nt!=null&&It)for(var st of It(nt))et.indexOf(st)<0&&ge.call(nt,st)&&(ht[st]=nt[st]);return ht},Ee=(nt,et,ht)=>new Promise((st,gt)=>{var vt=Tt=>{try{Et(ht.next(Tt))}catch(Dt){gt(Dt)}},St=Tt=>{try{Et(ht.throw(Tt))}catch(Dt){gt(Dt)}},Et=Tt=>Tt.done?st(Tt.value):Promise.resolve(Tt.value).then(vt,St);Et((ht=ht.apply(nt,et)).next())});const Bt=nt=>{var et=nt,{children:ht}=et,st=ie(et,["children"]);const[gt,vt]=(0,Ut.useState)(!1);return Ut.createElement(pt.ZP,Ae(Rt({},st),{loading:gt,onClick:St=>Ee(void 0,null,function*(){try{vt(!0),yield st.onClick(St),vt(!1)}catch(Et){console.error(Et),vt(!1)}})}),ht)}},39062:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Z:function(){return Ee}});var pt=kt(59301),Ut=kt(6767),le=kt(37568),Me={codeBox:"codeBox___WpkVl"},ue=kt(92310),It=kt.n(ue),qt=Object.defineProperty,ge=(Bt,nt,et)=>nt in Bt?qt(Bt,nt,{enumerable:!0,configurable:!0,writable:!0,value:et}):Bt[nt]=et,ne=(Bt,nt,et)=>ge(Bt,typeof nt!="symbol"?nt+"":nt,et),Rt=(Bt,nt,et)=>new Promise((ht,st)=>{var gt=Et=>{try{St(et.next(Et))}catch(Tt){st(Tt)}},vt=Et=>{try{St(et.throw(Et))}catch(Tt){st(Tt)}},St=Et=>Et.done?ht(Et.value):Promise.resolve(Et.value).then(gt,vt);St((et=et.apply(Bt,nt)).next())});class Ae extends pt.Component{constructor(nt){super(nt),ne(this,"canvas"),ne(this,"randomNum",(et,ht)=>Math.floor(Math.random()*(ht-et)+et)),ne(this,"drawPic",()=>{this.randomCode()}),ne(this,"reloadPic",()=>{this.drawPic()}),ne(this,"changeCode",et=>{console.log(et.target.value,222),this.setState({value:et.target.value,showError:!1})}),ne(this,"onVerify",()=>{let et;return this.state.value.toLowerCase()!==""&&this.state.value.toLowerCase()!==this.state.code.toLowerCase()?(et=!0,Ut.ZP.error("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u9A8C\u8BC1\u7801"),this.reloadPic()):this.state.value.toLowerCase()===""?(et=!0,Ut.ZP.error("\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801")):this.state.value.toLowerCase()===this.state.code.toLowerCase()&&(et=!1),this.setState({showError:et}),et}),this.canvas=pt.createRef(),this.state={value:"",code:"",codeLength:4,fontSizeMin:20,fontSizeMax:22,backgroundColorMin:240,backgroundColorMax:250,colorMin:10,colorMax:20,lineColorMin:40,lineColorMax:180,contentWidth:96,contentHeight:38,showError:!1}}componentDidMount(){this.drawPic()}randomColor(nt,et){const ht=this.randomNum(nt,et),st=this.randomNum(nt,et),gt=this.randomNum(nt,et);return`rgb(${ht}, ${st}, ${gt})`}drawText(nt,et,ht){nt.fillStyle=this.randomColor(this.state.colorMin,this.state.colorMax);const st=this.randomNum(this.state.fontSizeMin,this.state.fontSizeMax);nt.font=st+"px SimHei";const gt=10,vt=(this.state.contentWidth-40)/(this.state.code.length-1);let St=gt;ht>0&&(St=gt+ht*vt);let Et=this.randomNum(this.state.fontSizeMax,this.state.contentHeight-5);st>40&&(Et=40);const Tt=this.randomNum(-10,10);nt.translate(St,Et),nt.rotate(Tt*Math.PI/180),nt.fillText(et,0,0),nt.rotate(-Tt*Math.PI/180),nt.translate(-St,-Et)}drawLine(nt){for(let et=0;et<1;et++)nt.strokeStyle=this.randomColor(this.state.lineColorMin,this.state.lineColorMax),nt.beginPath(),nt.moveTo(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight)),nt.lineTo(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight)),nt.stroke()}drawDot(nt){for(let et=0;et<100;et++)nt.fillStyle=this.randomColor(0,255),nt.beginPath(),nt.arc(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight),1,0,2*Math.PI),nt.fill()}randomCode(){let nt="";const et="QWERTYUPLKJHGFDSAZXCVBNMqwertyupkjhgfdsazxcvbnm1234567890";for(let ht=0;ht<this.state.codeLength;ht++){const st=Math.floor(Math.random()*57);nt+=et[st]}this.setState({code:nt},()=>{const st=this.canvas.current.getContext("2d");st.textBaseline="bottom",st.fillStyle=this.randomColor(this.state.backgroundColorMin,this.state.backgroundColorMax),st.fillRect(0,0,this.state.contentWidth,this.state.contentHeight);for(let gt=0;gt<this.state.code.length;gt++)this.drawText(st,this.state.code[gt],gt);this.drawLine(st),this.drawDot(st)})}render(){const{className:nt,width:et=300}=this.props;return pt.createElement("div",{className:It()(Me.codeBox,nt),style:{width:et}},pt.createElement("aside",null,pt.createElement(le.default,{value:this.state.value,onChange:this.changeCode,placeholder:"\u8BF7\u8F93\u5165\u56FE\u7247\u4E2D\u7684\u9A8C\u8BC1\u7801"})),pt.createElement("div",null,pt.createElement("canvas",{onClick:this.reloadPic,ref:this.canvas,width:"100",height:"30"}),pt.createElement("div",{className:"current",onClick:this.reloadPic},"\u770B\u4E0D\u6E05\uFF1F\u6362\u4E00\u5F20")))}}const ie=(Bt,nt)=>{let et;Modal.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:React.createElement("div",null,React.createElement("p",null,nt),React.createElement(Ae,{ref:ht=>et=ht})),onOk:()=>Rt(void 0,null,function*(){if(et.onVerify())return Promise.reject();Bt()})})};var Ee=Ae},39928:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Z:function(){return ne}});var pt=kt(59301),Ut=kt(37568),le=kt(96599),Me=kt(6767),ue={flex:"flex___eLcnP",flex1:"flex1___yUTT7",color666:"color666___TiUhG",error:"error___gTTtv",deleteIcon:"deleteIcon___mnZW1",addIcon:"addIcon___JC5NS"},It=kt(62772);const{TextArea:qt}=Ut.default;class ge extends pt.Component{constructor(Ae){super(Ae),this.state={inputVisible:!1,EditInputIndex:-1}}render(){let{index:Ae,onAnswerChange:ie,addChildAnswer:Ee,exerciseIsPublish:Bt,answers:nt,activeOptionErrorIndex:et,flex:ht="0 0 1000px"}=this.props;console.log("----",nt);let{inputVisible:st,EditInputIndex:gt}=this.state;return pt.createElement("div",{className:ue.flex},pt.createElement("div",{className:`${ue.color666} mb5 mt6`,style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",Ae+1,"):"),pt.createElement("div",{style:{border:"1px solid #f6f6f6",flex:1,padding:10}},nt==null?void 0:nt.map((vt,St)=>pt.createElement(pt.Fragment,null,gt!==St?(vt==null?void 0:vt.length)>0?pt.createElement(le.default,{className:"edit-tag",key:vt,closable:!((nt==null?void 0:nt.length)===1&&St===0),onClose:Et=>{Et.preventDefault(),(nt==null?void 0:nt.length)===1&&St===0?this.props.deleteChildAnswermain(Ae,St):this.props.deleteChildAnswer(Ae,St)}},pt.createElement("span",{onDoubleClick:Et=>{this.setState({EditInputIndex:St}),Et.preventDefault()}},vt)):pt.createElement(Ut.default,{defaultValue:vt,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:Et=>{if(Et.target.value.replaceAll(" ","").length<=0){Me.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}ie(Ae,St,Et.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}):pt.createElement(Ut.default,{defaultValue:vt,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:Et=>{if(Et.target.value.replaceAll(" ","").length<=0){Me.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}ie(Ae,St,Et.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}))),!st&&pt.createElement(le.default,{className:"site-tag-plus",onClick:()=>{Ee(Ae),this.setState({inputVisible:!0})}},pt.createElement(It.Z,null)," \u65B0\u589E\u7B54\u6848")))}}var ne=ge},43749:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Z:function(){return Bt}});var pt=kt(59301),Ut=kt(19565),le=Object.defineProperty,Me=Object.defineProperties,ue=Object.getOwnPropertyDescriptors,It=Object.getOwnPropertySymbols,qt=Object.prototype.hasOwnProperty,ge=Object.prototype.propertyIsEnumerable,ne=(nt,et,ht)=>et in nt?le(nt,et,{enumerable:!0,configurable:!0,writable:!0,value:ht}):nt[et]=ht,Rt=(nt,et)=>{for(var ht in et||(et={}))qt.call(et,ht)&&ne(nt,ht,et[ht]);if(It)for(var ht of It(et))ge.call(et,ht)&&ne(nt,ht,et[ht]);return nt},Ae=(nt,et)=>Me(nt,ue(et)),ie=(nt,et,ht)=>ne(nt,typeof et!="symbol"?et+"":et,ht);const Ee="\u2581";class Bt extends pt.Component{constructor(){super(...arguments),ie(this,"getChCountBeforeCursor",(et,ht)=>{const st=ht.line;let gt=0;for(let St=0;St<st;St++)gt+=et.getLine(St).split(Ee).length-1;const vt=et.getLine(st).substring(0,ht.ch);return gt+=vt.split(Ee).length-1,gt}),ie(this,"onCMBeforeChange",(et,ht)=>{const st=et.getRange(ht.from,ht.to);let gt=0;if(ht.text.forEach(vt=>{gt+=vt.split(Ee).length-1}),st&&st.indexOf(Ee)!=-1){const vt=st.split(Ee).length-1,St=this.getChCountBeforeCursor(et,ht.from);console.log(`\u5220\u9664${vt}\u4E2A\uFF0C \u4E4B\u524D\u6709${St}\u4E2A\uFF0C\u65B0\u589E${gt}\u4E2A`),this.props.deleteEmptyDisabled?ht.cancel():this.props.onPlaceholderChange&&this.props.onPlaceholderChange(St,vt,gt)}else if(gt){const vt=this.getChCountBeforeCursor(et,ht.from);console.log(`\u65B0\u589E${gt}\u4E2A\uFF0C\u4E4B\u524D\u6709${vt}\u4E2A`),this.props.onPlaceholderChange&&this.props.onPlaceholderChange(vt,0,gt)}})}render(){return pt.createElement(Ut.Z,Ae(Rt({},this.props),{onCMBeforeChange:this.onCMBeforeChange}))}}},37208:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Z:function(){return It}});var pt=kt(37639),Ut={text:"text___FxbAX",wrap:"wrap___UlBQ1",contact:"contact____pUDq",img:"img___BapAv"},le=kt(32637),Me=kt(59301),It=({type:qt,style:ge})=>{const ne=Me.createElement("div",{className:Ut.wrap,onClick:Rt=>{Rt.preventDefault(),Rt.stopPropagation()}},Me.createElement("p",null,qt==="shixun"||qt==="paths"?"\u5F53\u524D\u5B9E\u8DF5\u9879\u76EE\u662F\u9AD8\u6D88\u8017\u7C7B\u578B\u7684\u5B9E\u9A8C\u3002":"\u5F53\u524D\u8BD5\u5377\u5305\u542B\u9AD8\u6D88\u8017\u7C7B\u578B\u7684\u5B9E\u9A8C\u3002",Me.createElement("br",null),"\u6839\u636E\u5E73\u53F0\u4F7F\u7528\u89C4\u5219\uFF0C\u9700\u8981\u6388\u6743\u624D\u80FD\u4F7F\u7528\u3002",qt==="paths"?"\u53D1\u9001\u5230\u8BFE\u5802":"\u53D1\u5E03","\u4F7F\u7528\u4E4B\u524D\uFF0C\u8BF7\u5148\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u83B7\u53D6\u6388\u6743\u7801\u3002"),Me.createElement("div",{className:Ut.contact},Me.createElement("div",{className:Ut.img},Me.createElement("img",{src:le,width:"124px",height:"124px"})),Me.createElement("div",{className:"tc font14 mt10",style:{color:"#777A93"}},"\u626B\u4E00\u626B\uFF0C\u83B7\u53D6\u6388\u6743\u7801")));return Me.createElement(pt.Z,{content:ne},Me.createElement("span",{className:Ut.text,style:ge},"\u9AD8\u6D88\u8017"))}},25138:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Z:function(){return Ae}});var pt=kt(59301),Ut={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},le=kt(92310),Me=kt.n(le),ue=kt(29787),It=kt(2859),qt=kt(24092),ge=kt(59895),ne=(ie,Ee,Bt)=>new Promise((nt,et)=>{var ht=vt=>{try{gt(Bt.next(vt))}catch(St){et(St)}},st=vt=>{try{gt(Bt.throw(vt))}catch(St){et(St)}},gt=vt=>vt.done?nt(vt.value):Promise.resolve(vt.value).then(ht,st);gt((Bt=Bt.apply(ie,Ee)).next())}),Ae=({data:ie,className:Ee,fullWidth:Bt,style:nt={},onClose:et,onOk:ht,showFullTools:st,noAssociationId:gt})=>{const vt=(0,pt.useRef)(null),St=(0,pt.useRef)(null),Et=(0,pt.useRef)(null),Tt=(0,pt.useRef)(null),[Dt,Jt]=(0,pt.useState)(!1),[Yt,Gt]=(0,pt.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,pt.useEffect)(()=>(Et.current||(Et.current=document.createElement("style"),document.head.appendChild(Et.current)),ie!=null&&ie.visible?(document.body.setAttribute("data-custom","y-hidden"),Et.current.innerHTML=" html { overflow-y: hidden; }",ie!=null&&ie.src&&me()):(document.body.removeAttribute("data-custom"),Et.current&&(document.head.removeChild(Et.current),Et.current=null)),()=>{document.body.removeAttribute("data-custom"),Et.current&&(document.head.removeChild(Et.current),Et.current=null)}),[ie==null?void 0:ie.visible]);const me=()=>ne(void 0,null,function*(){Jt(!0),Gt("\u6B63\u5728\u52A0\u8F7D\u4E2D");const we=yield(0,ge.ZJ)(ie==null?void 0:ie.src);vt.current.src="",vt.current.src=we,vt.current.onload=function(){Ce()},Jt(!1),Gt("")}),ae=we=>ne(void 0,null,function*(){Jt(!0),Gt("\u6B63\u5728\u4FDD\u5B58\u4E2D");const tn=yield(0,qt.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:ie.title,file:we.dataUrl}});tn!=null&&tn.id&&!gt?(yield(0,qt.ZP)(`/api/attachments/${ie.id}/add_subitem.json`,{method:"post",body:{subitem_id:tn==null?void 0:tn.id,settings:JSON.stringify(we.state)}})).status===0&&ht():tn!=null&&tn.id&&ht(tn),Jt(!1),Gt("")}),Ne=()=>{const we=document.querySelector('a[href="https://markerjs.com/"]');we&&we.parentNode&&(we.parentNode.style.display="none"),[{name:'[data-action="select"]',title:"\u9009\u62E9"},{name:'[data-action="delete"]',title:"\u5220\u9664\u5143\u7D20"},{name:'[data-action="undo"]',title:"\u64A4\u9500"},{name:'[data-type-name="FrameMarker"]',title:"\u77E9\u5F62"},{name:'[data-type-name="FreehandMarker"]',title:"\u753B\u7EBF"},{name:'[data-type-name="ArrowMarker"]',title:"\u7BAD\u5934"},{name:'[data-type-name="TextMarker"]',title:"\u6587\u672C"},{name:'[data-type-name="EllipseMarker"]',title:"\u692D\u5706"},{name:'[data-type-name="HighlightMarker"]',title:"\u65B9\u5757"},{name:'[data-type-name="CalloutMarker"]',title:"\u6CE8\u91CA"},{name:'[data-action="render"]',title:"\u4FDD\u5B58"},{name:'[data-action="close"]',title:"\u9000\u51FA"}].forEach(_e=>{const an=document.querySelector(_e.name);an&&an.setAttribute("title",_e.title)})},Ce=()=>{St.current=new It.hP(vt.current),St.current.targetRoot=Tt.current,St.current.addEventListener("render",ae),St.current.addEventListener("beforeclose",et),st&&(St.current.availableMarkerTypes=St.current.ALL_MARKER_TYPES,St.current.uiStyleSettings.redoButtonVisible=!0,St.current.uiStyleSettings.notesButtonVisible=!0,St.current.uiStyleSettings.zoomButtonVisible=!0,St.current.uiStyleSettings.zoomOutButtonVisible=!0,St.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=St.current.uiStyleSettings,St.current.show(),ie!=null&&ie.snapshotData&&St.current.restoreState(ie.snapshotData),setTimeout(()=>{window.scrollTo(0,0),Ne()},300)};return pt.createElement(pt.Fragment,null,(ie==null?void 0:ie.visible)&&pt.createElement(ue.Z,{spinning:Dt,tip:Yt,style:{position:"absolute",width:"100vw"}},pt.createElement("div",{ref:Tt,className:Me()(Ut.imageDimensions,Ee,Bt?Ut.fullWidth:""),style:nt},pt.createElement("img",{className:Ut.img,ref:vt}))))}},29105:function(Dn,Gn,kt){"use strict";var pt=kt(59301),Ut=kt(15547),le=kt(48136),Me=kt(88831),ue=kt(62957),It=kt(59301);const qt=(0,pt.forwardRef)(({callback:ge,width:ne,onChange:Rt,disabled:Ae,readOnly:ie,type:Ee="",value:Bt="",style:nt={}},et)=>{const ht=(0,pt.useRef)(),st=(0,pt.useRef)(),[gt,vt]=(0,pt.useState)(0),[St,Et]=(0,pt.useState)(0),[Tt,Dt]=(0,pt.useState)(!1),Jt=()=>{var ae=document.createElement("div");ae.innerHTML=ht.current.getValue();var Ne=ae.innerText;return ge&&ge(Ne),Ne};(0,pt.useImperativeHandle)(et,()=>({getData:Jt}));const Yt=ae=>{ae.preventDefault();const Ne=ae.clientX-gt,Ce=ae.clientY-St;document.body.onmousemove=we=>{let tn=we.clientX-Ne,_e=we.clientY-Ce;const an=document.getElementsByClassName("markdown-popup-form")[0],Ke=window.innerWidth-an.offsetWidth,oe=window.innerHeight-an.offsetHeight;tn=Math.max(0,Math.min(tn,Ke)),_e=Math.max(0,Math.min(_e,oe)),Gt(we.clientX,we.clientY,Ne,Ce)&&(vt(tn),Et(_e))},document.body.onmouseup=function(){document.body.onmousemove=null}},Gt=(ae,Ne,Ce,we)=>{const tn=document.body.clientHeight,_e=document.body.clientWidth;return ae<20&&Ce>ae||ae>_e-20&&Ce<ae||Ne<20&&we>Ne||Ne>tn-20&&we<Ne?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};(0,pt.useEffect)(()=>{Tt&&setTimeout(()=>{const ae=document.getElementsByClassName("markdown-popup-form")[0],Ne=window.innerWidth/2-ae.offsetWidth/2,Ce=window.innerHeight/2-ae.offsetHeight/2;vt(Ne),Et(Ce)},0)},[Tt]);const me=()=>{Ae||ie||Dt(!0)};return It.createElement("div",{style:nt},It.createElement("div",{style:{width:ne||"100%",position:"relative"},className:`${Ut.Z.mathFillWrap} ${Ae||ie?"cursorDefault":""}`,onClick:()=>me()},It.createElement("math-field",{disabled:Ae,locale:"zh_cn",class:`${Ut.Z.mathField} ${Ee}`,readOnly:ie,placeholder:"\u8BF7\u8F93\u5165\u516C\u5F0F",ref:ht,style:{width:"100%",fontSize:Bt?18:14},value:Bt||""})),It.createElement(ue.default,{maskClosable:!1,centered:!0,width:860,style:{position:"absolute",left:gt,top:St},title:It.createElement("div",{style:{cursor:"move"},onMouseDown:Yt},"\u8F93\u5165\u516C\u5F0F"),open:Tt,onOk:()=>{const ae=st.current.getData();ht.current.setValue(ae),Rt(ae),Dt(!1)},onCancel:()=>{Dt(!1)},destroyOnClose:!0,className:"markdown-popup-form"},It.createElement(Me.Z,{value:Bt,ref:st,onChange:Rt,showSaveButton:!1})))});Gn.Z=qt},88831:function(Dn,Gn,kt){"use strict";var pt=kt(59301),Ut=kt(77019),le=kt(5269),Me=kt(20554),ue=kt(99571),It=kt(79074),qt=kt(15547),ge=kt(48136),ne=kt(59301);const Rt=(0,pt.forwardRef)(({callback:Ae,showSaveButton:ie,value:Ee=""},Bt)=>{const nt=(0,pt.useRef)(),et=[{name:"\u5206\u6570\u5F97\u5206",value:"\\frac{x}{y}",children:[{name:"\u5206\u6570 Fractions",data:[{value:"\\frac{a}{b}"},{value:"x\\tfrac{x}{a} "},{value:"\\mathrm{d}t"},{value:"\\partial t"},{value:"\\frac{\\partial y}{\\partial x}"},{value:"\\nabla\\psi"},{value:"\\frac{\\partial^2}{\\partial x_1\\partial x_2}y"},{value:"\\cfrac{1}{a + \\cfrac{7}{b + \\cfrac{2}{9}}} = c"}]},{name:"\u5BFC\u6570 Derivative",data:[{value:"\\dot{a} "},{value:"\\ddot{a}"},{value:"{f}^{\\prime}"},{value:"{f}^{\\prime\\prime}"},{value:"{f}^{(n)}"}]},{name:"\u6A21\u7B97\u672F Modular arithmetic",data:[{value:"a \\bmod b"},{value:"a \\equiv b \\pmod{m} "},{value:"\\gcd(m, n) "},{value:"\\operatorname{lcm}(m, n) "}]}]},{name:"\u6839\u5F0F\u89D2\u6807",value:"\\sqrt{x}",children:[{name:"\u6839\u5F0F Radicals",data:[{value:"\\sqrt{x}"},{value:"\\sqrt[y]{x}"}]},{name:"\u4E0A\u4E0B\u6807 Sub&Super",data:[{value:"x^{a}"},{value:"x_{a}"},{value:"x_{a}^{b} "},{value:"_{a}^{b} x"},{value:"x_{a}^{b} "}]},{name:"\u91CD\u97F3\u7B26\u53CA\u5176\u4ED6 Accents and Others",data:[{value:"\\hat{a} "},{value:"\\sqrt[y]{x}"},{value:"\\check{} "},{value:"\\grave{a} "},{value:"\\acute{a}"},{value:"\\tilde{a}"},{value:"\\breve{a}"},{value:"\\bar{a}"},{value:"\\vec{a}"},{value:"\\not{a}"},{value:"\\widetilde{abc}"},{value:"\\widehat{abc}"},{value:"\\overleftarrow{abc} "},{value:"\\overrightarrow{abc}"},{value:"\\overline{abc}"},{value:"\\underline{abc}"},{value:"\\overbrace{abc}"},{value:"\\underbrace{abc}"},{value:"\\overset{a}{abc}"},{value:"\\underset{a}{abc} \\stackrel\\frown{ab}"},{value:"\\overline{ab} "},{value:"\\overleftrightarrow{ab}"},{value:"\\overset{a}{\\leftarrow}"},{value:"\\overset{a}{\\rightarrow}"},{value:"\\xleftarrow[abc]{a}"},{value:"\\xrightarrow[abc]{a} "}]}]},{name:"\u6781\u9650\u5BF9\u6570",value:"\\lim_{x \\to 0}",children:[{name:"\u6781\u9650 Limits",data:[{value:"\\lim a"},{value:"\\lim_{x \\to 0}"},{value:"\\lim_{x \\to \\infty}"},{value:"\\max_b{a}"},{value:"\\min_a{b}"}]},{name:"\u5BF9\u6570\u6307\u6570 Logarithms and exponentials",data:[{value:"\\log_{a}{b}"},{value:"\\lg_{a}{b}"},{value:"\\ln_{a}{b}"},{value:"\\exp a"}]},{name:"\u754C\u9650 Bounds",data:[{value:"\\min x"},{value:"\\sup t"},{value:"\\inf s"},{value:"\\lim u"},{value:"\\limsup w"},{value:"\\dim p"},{value:"\\ker\\phi "}]}]},{name:"\u4E09\u89D2\u51FD\u6570",value:"\\sin a",children:[{name:"\u4E09\u89D2\u51FD\u6570 Trigonometric functions",data:[{value:"\\sin a"},{value:"\\cos a"},{value:"\\tan a"},{value:"\\cot a "},{value:"\\sec a "},{value:"\\csc a "}]},{name:"\u53CD\u4E09\u89D2\u51FD\u6570 Inverse trigonometric functions",data:[{value:"\\sin^{-1}"},{value:"\\cos^{-1}"},{value:"\\tan^{-1}"},{value:"\\cot^{-1}"},{value:"\\sec^{-1}"},{value:"\\csc^{-1}"},{value:"\\arcsin a"},{value:"\\arccos a"},{value:"\\arctan a"},{value:"\\operatorname{arccot} a"},{value:"\\operatorname{arcsec} a"},{value:"\\operatorname{arccsc} a"}]},{name:"\u53CC\u66F2\u51FD\u6570 Hyperblic functions",data:[{value:"\\sinh a"},{value:"\\cosh a"},{value:"\\tanh a"},{value:"\\coth a"},{value:"\\operatorname{sech} a"},{value:"\\operatorname{csch} a"}]},{name:"\u53CD\u53CC\u66F2\u51FD\u6570 Inverse hyperbolic functions",data:[{value:"\\sinh^{-1}"},{value:"a\\cosh^{-1} a"},{value:"\\tanh^{-1} a"},{value:"\\coth^{-1} a"},{value:"\\operatorname{sech}^{-1} a"},{value:"\\operatorname{csch}^{-1} a"}]}]},{name:"\u79EF\u5206\u8FD0\u7B97",value:"\\int_{a}^{b}",children:[{name:"\u79EF\u5206 Integral",data:[{value:"\\int"},{value:"\\int_{a}^{b}"},{value:"\\int\\limits_{a}^{b}"}]},{name:"\u53CC\u91CD\u79EF\u5206 Double integral",data:[{value:"\\iint"},{value:"\\iint_{a}^{b} "},{value:"\\iint\\limits_{a}^{b} "}]},{name:"\u4E09\u91CD\u79EF\u5206 Triple integral",data:[{value:"\\iiint"},{value:"\\iiint_{a}^{b}"},{value:"\\iiint\\limits_{a}^{b} "}]},{name:"\u66F2\u7EBF\u79EF\u5206 Closed line or path integral",data:[{value:"\\oint"},{value:"\\oint_{a}^{b} "}]}]},{name:"\u5927\u578B\u8FD0\u7B97",value:"\\sum_{a}^{b}",children:[{name:"\u6C42\u548C Summation",data:[{value:"\\sum"},{value:"\\sum_{a}^{b}"},{value:"{\\textstyle \\sum_{a}^{b}} "}]},{name:"\u4E58\u79EF\u4F59\u79EF Product and coproduct",data:[{value:"\\prod"},{value:"\\prod_{a}^{b}"},{value:"{\\textstyle \\prod_{a}^{b}}"},{value:"\\coprod"},{value:"\\coprod_{a}^{b}"},{value:"{\\textstyle \\coprod_{a}^{b}} "}]},{name:"\u5E76\u96C6\u4EA4\u96C6 Union and intersection",data:[{value:"\\bigcup"},{value:"\\bigcup_{a}^{b}"},{value:"{\\textstyle \\bigcup_{a}^{b}}"},{value:"\\bigcap"},{value:"\\bigcap_{a}^{b}"}]},{name:"\u6790\u53D6\u5408\u53D6 Disjunction and conjunction",data:[{value:"\\bigvee"},{value:"\\bigvee_{a}^{b}"},{value:"\\bigwedge"},{value:"\\bigwedge_{a}^{b}"}]}]},{name:"\u62EC\u53F7\u53D6\u6574",value:"\\left [ \\left ( \\right ) \\right ] ",children:[{name:"\u62EC\u53F7 Brackets",data:[{value:"\\left ( \\right )"},{value:"\\left [ \\right ]"},{value:"\\left \\langle \\right \\rangle "},{value:"\\left | \\right | "},{value:"\\left \\lfloor \\right \\rfloor "},{value:"\\left \\lceil \\right \\rceil "}]}]}],ht=[{name:"\u4EE3\u6570",value:"\\sqrt{a^2+b^2}",children:[{data:[{value:"\\left(x-1\\right)\\left(x+3\\right) "},{value:"\\sqrt{a^2+b^2}"},{value:"\\left ( \\frac{a}{b}\\right )^{n}= \\frac{a^{n}}{b^{n}}"},{value:"\\frac{a}{b}\\pm \\frac{c}{d}= \\frac{ad \\pm bc}{bd} "},{value:"\\frac{x^{2}}{a^{2}}-\\frac{y^{2}}{b^{2}}=1 "},{value:"\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0 "},{value:"\\sqrt[n]{a^{n}}=\\left ( \\sqrt[n]{a}\\right )^{n} "},{value:"x ={-b \\pm \\sqrt{b^2-4ac}\\over 2a} "},{value:"y-y_{1}=k \\left( x-x_{1}\\right) "},{value:`\\left\\{\\begin{matrix} \r
x=a + r\\text{cos}\\theta \\ \r
y=b + r\\text{sin}\\theta \r
\\end{matrix}\\right. `},{value:`\\begin{array}{l} \r
\\text{\u5BF9\u4E8E\u65B9\u7A0B\u5F62\u5982\uFF1A}x^{3}-1=0 \\ \r
\\text{\u8BBE}\\text{:}\\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r
x_{1}=1,x_{2}= \\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r
x_{3}= \\omega ^{2}=\\frac{-1-\\sqrt{3}i}{2} \r
\\end{array} `},{value:`\\begin{array}{l} \r
a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r
\\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r
\\left\\{\\begin{matrix} \r
\\Delta \\gt 0\\text{\u65B9\u7A0B\u6709\u4E24\u4E2A\u4E0D\u76F8\u7B49\u7684\u5B9E\u6839} \\ \r
\\Delta = 0\\text{\u65B9\u7A0B\u6709\u4E24\u4E2A\u76F8\u7B49\u7684\u5B9E\u6839} \\ \r
\\Delta \\lt 0\\text{\u65B9\u7A0B\u65E0\u5B9E\u6839} \r
\\end{matrix}\\right. \r
\\end{array} `},{value:`\\begin{array}{l} \r
a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r
\\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r
\\mathop{{x}}\\nolimits_{{1,2}}=\\frac{{-b \\pm \r
\\sqrt{{\\mathop{{b}}\\nolimits^{{2}}-4ac}}}}{{2a}} \\ \r
\\mathop{{x}}\\nolimits_{{1}}+\\mathop{{x}}\\nolimits_{{2}}=-\\frac{{b}}{{a}} \\ \r
\\mathop{{x}}\\nolimits_{{1}}\\mathop{{x}}\\nolimits_{{2}}=\\frac{{c}}{{a}} \r
\\end{array} `}]}]},{name:"\u51E0\u4F55",value:"\\Delta A B C ",children:[{data:[{value:"\\Delta A B C "},{value:"a \\parallel c,b \\parallel c \\Rightarrow a \\parallel b "},{value:"l \\perp \\beta ,l \\subset \\alpha \\Rightarrow \\alpha \\perp \\beta"},{value:`\\left.\\begin{matrix} \r
a \\perp \\alpha \\ \r
b \\perp \\alpha \r
\\end{matrix}\\right\\}\\Rightarrow a \\parallel b`},{value:"P \\in \\alpha ,P \\in \\beta , \\alpha \\cap \\beta =l \\Rightarrow P \\in l "},{value:`\\alpha \\perp \\beta , \\alpha \\cap \\beta =l,a \\subset \\alpha ,a \\perp l \r
\\Rightarrow a \\perp \\beta `},{value:`\\left.\\begin{matrix} \r
a \\subset \\beta ,b \\subset \\beta ,a \\cap b=P \\ \r
a \\parallel \\partial ,b \\parallel \\partial \r
\\end{matrix}\\right\\}\\Rightarrow \\beta \\parallel \\alpha `},{value:"\\alpha \\parallel \\beta , \\gamma \\cap \\alpha =a, \\gamma \\cap \\beta =b \\Rightarrow a \\parallel b "},{value:"A \\in l,B \\in l,A \\in \\alpha ,B \\in \\alpha \\Rightarrow l \\subset \\alpha "},{value:`\\left.\\begin{matrix} \r
m \\subset \\alpha ,n \\subset \\alpha ,m \\cap n=P \\ \r
a \\perp m,a \\perp n \r
\\end{matrix}\\right\\}\\Rightarrow a \\perp \\alpha `},{value:`\\begin{array}{c} \r
\\text{\u76F4\u89D2\u4E09\u89D2\u5F62\u4E2D,\u76F4\u89D2\u8FB9\u957Fa,b,\u659C\u8FB9\u8FB9\u957Fc} \\ \r
a^{2}+b^{2}=c^{2} \r
\\end{array}`}]}]},{name:"\u4E0D\u7B49\u5F0F",value:"a > b",children:[{data:[{value:"a > b,b > c \\Rightarrow a > c "},{value:"a > b,c > d \\Rightarrow a+c > b+d "},{value:"a > b > 0,c > d > 0 \\Rightarrow ac bd "},{value:`\\begin{array}{c} \r
a \\gt b,c \\gt 0 \\Rightarrow ac \\gt bc \\ \r
a \\gt b,c \\lt 0 \\Rightarrow ac \\lt bc \r
\\end{array}`},{value:"\\left | a-b \\right | \\geqslant \\left | a \\right | -\\left | b \\right | "},{value:"-\\left | a \\right |\\leq a\\leqslant \\left | a \\right | "},{value:"\\left | a \\right |\\leqslant b \\Rightarrow -b \\leqslant a \\leqslant \\left | b \\right | "},{value:"\\left | a+b \\right | \\leqslant \\left | a \\right | + \\left | b \\right | "},{value:`\\begin{array}{c} \r
a \\gt b \\gt 0,n \\in N^{\\ast},n \\gt 1 \\ \r
\\Rightarrow a^{n}\\gt b^{n}, \\sqrt[n]{a}\\gt \\sqrt[n]{b} \r
\\end{array}`},{value:`\\left( \\sum_{k=1}^n a_k b_k \\right)^{\\!\\!2}\\leq \r
\\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right) `},{value:`\\begin{array}{c} \r
a,b \\in R^{+} \\ \r
\\Rightarrow \\frac{a+b}{{2}}\\ge \\sqrt{ab} \\ \r
\\left( \\text{\u5F53\u4E14\u4EC5\u5F53}a=b\\text{\u65F6\u53D6\u201C}=\\text{\u201D\u53F7}\\right) \r
\\end{array}`},{value:`\\begin{array}{c} \r
a,b \\in R \\ \r
\\Rightarrow a^{2}+b^{2}\\gt 2ab \\ \r
\\left( \\text{\u5F53\u4E14\u4EC5\u5F53}a=b\\text{\u65F6\u53D6\u201C}=\\text{\u201D\u53F7}\\right) \r
\\end{array}`},{value:`\\begin{array}{c} \r
H_{n}=\\frac{n}{\\sum \\limits_{i=1}^{n}\\frac{1}{x_{i}}}= \\frac{n}{\\frac{1}{x_{1}}+ \\frac{1}{x_{2}}+ \\cdots + \\frac{1}{x_{n}}} \\ G_{n}=\\sqrt[n]{\\prod \\limits_{i=1}^{n}x_{i}}= \\sqrt[n]{x_{1}x_{2}\\cdots x_{n}} \\ A_{n}=\\frac{1}{n}\\sum \\limits_{i=1}^{n}x_{i}=\\frac{x_{1}+ x_{2}+ \\cdots + x_{n}}{n} \\ Q_{n}=\\sqrt{\\sum \\limits_{i=1}^{n}x_{i}^{2}}= \\sqrt{\\frac{x_{1}^{2}+ x_{2}^{2}+ \\cdots + x_{n}^{2}}{n}} \\ H_{n}\\leq G_{n}\\leq A_{n}\\leq Q_{n} \r
\\end{array}`}]}]},{name:"\u79EF\u5206",value:"\\frac{\\mathrm{d}\\partial}{\\partial x}",children:[{data:[{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}x^n=nx^{n-1} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}e^{ax}=a\\,e^{ax} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\ln(x)=\\frac{1}{x} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\sin x=\\cos x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cos x=-\\sin x "},{value:"\\int k\\mathrm{d}x = kx+C "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\tan x=\\sec^2 x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cot x=-\\csc^2 x "},{value:"\\int \\frac{1}{x}\\mathrm{d}x= \\ln \\left| x \\right| +C "},{value:"\\int \\frac{1}{\\sqrt{1-x^{2}}}\\mathrm{d}x= \\arcsin x +C "},{value:"\\int \\frac{1}{1+x^{2}}\\mathrm{d}x= \\arctan x +C "},{value:"\\int u \\frac{\\mathrm{d}v}{\\mathrm{d}x}\\,\\mathrm{d}x=uv-\\int \\frac{\\mathrm{d}u}{\\mathrm{d}x}v\\,\\mathrm{d}x "},{value:"f(x) = \\int_{-\\infty}^\\infty \\hat f(x)\\xi\\,e^{2 \\pi i \\xi x} \\,\\mathrm{d}\\xi "},{value:"\\int x^{\\mu}\\mathrm{d}x=\\frac{x^{\\mu +1}}{\\mu +1}+C, \\left({\\mu \\neq -1}\\right) "}]}]},{name:"\u4E09\u89D2",value:"e^{i \\theta}",children:[{name:"\u6C42\u548C Summation",data:[{value:"e^{i \\theta} "},{value:"\\left(\\frac{\\pi}{2}-\\theta \\right ) "},{value:"\\text{sin}^{2}\\frac{\\alpha}{2}=\\frac{1- \\text{cos}\\alpha}{2} "},{value:"\\text{cos}^{2}\\frac{\\alpha}{2}=\\frac{1+ \\text{cos}\\alpha}{2} "},{value:"\\text{tan}\\frac{\\alpha}{2}=\\frac{\\text{sin}\\alpha}{1+ \\text{cos}\\alpha} "},{value:"\\sin \\alpha + \\sin \\beta =2 \\sin \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\sin \\alpha - \\sin \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha + \\cos \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha - \\cos \\beta =-2\\sin \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"a^{2}=b^{2}+c^{2}-2bc\\cos A "},{value:"\\frac{\\sin A}{a}=\\frac{\\sin B}{b}=\\frac{\\sin C}{c}=\\frac{1}{2R} "},{value:"\\sin \\left ( \\frac{\\pi}{2}-\\alpha \\right ) = \\cos \\alpha "},{value:"\\sin \\left ( \\frac{\\pi}{2}+\\alpha \\right ) = \\cos \\alpha "}]}]},{name:"\u7EDF\u8BA1",value:"C_{r}^{n}",children:[{data:[{value:"C_{r}^{n} "},{value:"\\frac{n!}{r!(n-r)!} "},{value:"\\sum_{i=1}^{n}{X_i} "},{value:"\\sum_{i=1}^{n}{X_i^2} "},{value:"X_1, \\cdots,X_n "},{value:"\\frac{x-\\mu}{\\sigma} "},{value:"\\sum_{i=1}^{n}{(X_i - \\overline{X})^2} "},{value:`\\begin{array}{c} \r
\\text{\u82E5}P \\left( AB \\right) =P \\left( A \\right) P \\left( B \\right) \\\\ \r
\\text{\u5219}P \\left( A \\left| B\\right. \\right) =P \\left({B}\\right) \r
\\end{array}`},{value:"P(E) ={n \\choose k}p^k (1-p)^{n-k} "},{value:"P \\left( A \\right) = \\lim \\limits_{n \\to \\infty}f_{n}\\left ( A \\right ) "},{value:"P \\left( \\bigcup \\limits_{i=1}^{+ \\infty}A_{i}\\right) = \\prod \\limits_{i=1}^{+ \\infty}P{\\left( A_{i}\\right)} "},{value:`\\begin{array}{c} \r
P \\left( \\emptyset \\right) =0 \\\\ \r
P \\left( S \\right) =1 \r
\\end{array}`},{value:`\\begin{array}{c} \r
\\forall A \\in S \\\\ \r
P \\left( A \\right) \\ge 0 \r
\\end{array}`},{value:"P \\left( \\bigcup \\limits_{i=1}^{n}A_{i}\\right) = \\prod \\limits_{i=1}^{n}P \\left( A_{i}\\right) "},{value:`\\begin{array}{c} \r
S= \\binom{N}{n},A_{k}=\\binom{M}{k}\\cdot \\binom{N-M}{n-k} \\\\ \r
P\\left ( A_{k}\\right ) = \\frac{\\binom{M}{k}\\cdot \\binom{N-M}{n-k}}{\\binom{N}{n}} \r
\\end{array}`},{value:`\\begin{array}{c} \r
P_{n}=n! \\\\ \r
A_{n}^{k}=\\frac{n!}{\\left( n-k \\left) !\\right. \\right.} \r
\\end{array}`}]}]}],st=St=>{nt.current.setValue(nt.current.getValue()+" "+St.value+" ")},gt=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:ne.createElement(Ut.Z,{className:qt.Z.lists,gutter:[10,10]},et.map((St,Et)=>ne.createElement(le.Z,{flex:"110px",className:qt.Z.item},ne.createElement("div",null,ne.createElement(It.Z,{value:`$$${St.value}$$`}),St.name),ne.createElement("div",{className:qt.Z.children},St.children.map((Tt,Dt)=>ne.createElement("div",{key:Dt},ne.createElement("h1",null,Tt.name),ne.createElement(Ut.Z,{gutter:[10,10]},Tt.data.map((Jt,Yt)=>ne.createElement(le.Z,{key:Yt,onClick:()=>st(Jt),className:qt.Z.diamond},ne.createElement(It.Z,{value:"`$$"+Jt.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:ne.createElement(Ut.Z,{className:qt.Z.lists,gutter:[10,10]},ht.map((St,Et)=>ne.createElement(le.Z,{flex:"110px",className:qt.Z.item},ne.createElement("div",null,ne.createElement(It.Z,{value:"`$$"+St.value+"$$`"}),St.name),ne.createElement("div",{className:qt.Z.children},St.children.map((Tt,Dt)=>ne.createElement("div",{key:Dt},Tt.name&&ne.createElement("h1",null,Tt.name),ne.createElement(Ut.Z,{gutter:[10,10]},Tt.data.map((Jt,Yt)=>ne.createElement(le.Z,{key:Yt,onClick:()=>st(Jt),className:qt.Z.diamond},ne.createElement(It.Z,{value:"`$$"+Jt.value+"$$`"}))))))))))}],vt=()=>{var St=document.createElement("div");St.innerHTML=nt.current.getValue();var Et=St.innerText;return Ae&&Ae(Et),Et};return(0,pt.useImperativeHandle)(Bt,()=>({getData:vt})),ne.createElement("div",{className:qt.Z.mathWrap},ne.createElement(Me.default,{defaultActiveKey:"1",items:gt}),ne.createElement("math-field",{locale:"zh_cn",className:qt.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:nt,style:{width:800,marginTop:30,fontSize:18}},Ee||""),ie&&ne.createElement("div",{className:qt.Z.button},ne.createElement(ue.ZP,{size:"large",onClick:vt,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});Gn.Z=Rt},12635:function(Dn,Gn,kt){"use strict";var pt=kt(59301),Ut=kt(93314),le=kt(99571),Me=Object.defineProperty,ue=Object.defineProperties,It=Object.getOwnPropertyDescriptors,qt=Object.getOwnPropertySymbols,ge=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable,Rt=(Bt,nt,et)=>nt in Bt?Me(Bt,nt,{enumerable:!0,configurable:!0,writable:!0,value:et}):Bt[nt]=et,Ae=(Bt,nt)=>{for(var et in nt||(nt={}))ge.call(nt,et)&&Rt(Bt,et,nt[et]);if(qt)for(var et of qt(nt))ne.call(nt,et)&&Rt(Bt,et,nt[et]);return Bt},ie=(Bt,nt)=>ue(Bt,It(nt));const Ee=({img:Bt,buttonProps:nt={},styles:et={},customText:ht,ButtonText:st,ButtonClick:gt,Buttonclass:vt,ButtonTwo:St,imgStyles:Et,loading:Tt=!1,className:Dt=""})=>pt.createElement("section",{className:`tc animated fadeIn ${Dt}`,style:Ae({color:"#999",margin:"100px auto",visibility:Tt?"hidden":"visible"},et)},pt.createElement("img",{src:Bt||Ut,style:ie(Ae({},Et),{pointerEvents:"none",userSelect:"none"})}),pt.createElement("p",{className:"mt20 font14"},ht||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),st&&pt.createElement(le.ZP,Ae({className:vt,onClick:gt},nt),st),St&&St);Gn.Z=Ee},6311:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Z:function(){return vt}});var pt=kt(59301),Ut={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},le=kt(99571),Me=kt(70557),ue=kt(89081),It=kt(25399),qt=kt(59895),ge=kt(76011),ne=kt(12635),Rt=kt(12242),Ae=kt(65789),ie=kt(59301),Ee=Object.defineProperty,Bt=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,ht=(St,Et,Tt)=>Et in St?Ee(St,Et,{enumerable:!0,configurable:!0,writable:!0,value:Tt}):St[Et]=Tt,st=(St,Et)=>{for(var Tt in Et||(Et={}))nt.call(Et,Tt)&&ht(St,Tt,Et[Tt]);if(Bt)for(var Tt of Bt(Et))et.call(Et,Tt)&&ht(St,Tt,Et[Tt]);return St},gt=(St,Et,Tt)=>new Promise((Dt,Jt)=>{var Yt=ae=>{try{me(Tt.next(ae))}catch(Ne){Jt(Ne)}},Gt=ae=>{try{me(Tt.throw(ae))}catch(Ne){Jt(Ne)}},me=ae=>ae.done?Dt(ae.value):Promise.resolve(ae.value).then(Yt,Gt);me((Tt=Tt.apply(St,Et)).next())}),vt=({editOffice:St="view",data:Et,theme:Tt,type:Dt,filename:Jt,monacoEditor:Yt,className:Gt,style:me,close:ae,onClose:Ne,hasMask:Ce,disabledDownload:we,onImgDimensions:tn,showNodata:_e,recordInfo:an})=>{const[Ke,oe]=(0,pt.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[Xt,qe]=(0,pt.useState)(""),[_n,Pn]=(0,pt.useState)(),De=window.ENV==="build"?"/react/build":"",dn=location.host.startsWith("localhost")?Rt.Z.PROXY_SERVER:Rt.Z.API_SERVER,jn=10*(1024*1024),Te=(0,pt.useRef)();Et!=null&&Et.startsWith("/api")&&Dt!=="txt"&&(Et=Rt.Z.API_SERVER+Et);const Sn=_t=>_t.substring(_t.lastIndexOf("/")+1).split(".").pop();Jt&&Yt&&(Yt.filename=Jt),(0,pt.useEffect)(()=>{var _t,Lt;const Pt=(Lt=(_t=document.cookie)==null?void 0:_t.replace(/\s/g,""))==null?void 0:Lt.split(";");Pt==null||Pt.map(Nt=>{let zt=Nt.split("=");zt[0]==="_educoder_session"&&qe(zt[1])})},[]),(0,pt.useEffect)(()=>{Dt==="office"&&(Et.indexOf("bigfilescdn.")>-1||Et.indexOf("bigfiles1")>-1?Pn({url:Et,fileType:Sn(Et),model:Et.indexOf("model=edit")?"edit":"view"}):ee())},[Dt,Et]);const ee=()=>gt(void 0,null,function*(){console.log("data:",Et);let _t=Et;Et.startsWith("http")||(_t=location.origin+_t);let Lt=new URL(_t).pathname.split("/").pop();const Pt=yield(0,ge.gJ)({attachment_id:Lt});Pt.url=dn+Pt.url,Pn(Pt)}),Mn=()=>{if(Et.startsWith("http")||Et.startsWith("blob:")){ui();return}(0,qt.Sv)(Jt||"educoder",Et,Jt)},ui=()=>{an&&(0,Ae.fc)({id:an==null?void 0:an.id,watch_type:1,course_id:an==null?void 0:an.course_id}),(0,qt.Nd)(Jt||"educoder",decodeURIComponent(Et))};return ie.createElement("div",{style:st({},me||{}),className:`${Ce&&Ut.bgBlack} ${Dt?Ut.wrp:"hide"}`},ae&&ie.createElement("div",{className:Ut.close,ref:Te},!!tn&&ie.createElement(It.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>Te.current},ie.createElement("span",{onClick:()=>{Ne(),tn()}},ie.createElement("i",{className:"icon-yulanpizhu"}))),!we&&ie.createElement(It.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>Te.current},ie.createElement("span",{onClick:ui},ie.createElement("i",{className:"icon-quxiaozhiding"}))),ie.createElement(It.Z,{title:"\u5173\u95ED",getPopupContainer:()=>Te.current},ie.createElement("span",{className:"",onClick:Ne},ie.createElement("i",{className:"icon-guanbi1"})))),ie.createElement("div",{className:`${Ut[Gt]} ${Gt} ${Ut.monaco} ${Dt==="txt"?"show":"hide"}`},Dt==="txt"&&ie.createElement(ie.Fragment,null,ie.createElement(ue.ZP,st({},Yt)))),Dt==="audio"&&ie.createElement("audio",{src:`${(Et==null?void 0:Et.indexOf("http://"))>-1||(Et==null?void 0:Et.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${Et}`,autoPlay:!0}),Dt==="video"&&ie.createElement(ie.Fragment,null,(Et==null?void 0:Et.indexOf("http"))>-1?ie.createElement("video",{controls:!0,src:`${Et}`,autoPlay:!0}):ie.createElement("video",{controls:!0,src:`data:video/mp4;base64,${Et}`,autoPlay:!0})),Dt==="office"&&_n&&ie.createElement("iframe",{src:`${De}/office.html?key=${_n.key}&url=${btoa(_n.url)}&callbackUrl=${dn+(_n.callbackUrl||"")}&fileType=${_n.fileType}&title=${_n.title||""}&model=${St}&officeServer=${Rt.Z.ONLYOFFICE}&disabledDownload=${!!we}`}),Dt==="html"&&ie.createElement("iframe",{src:Et+"&disposition=inline"}),Dt==="pdf"&&ie.createElement("iframe",{src:`${De}/js/pdfview/index.html?filename=${Jt||"educoder.pdf"}&url=${encodeURIComponent(Et)}&disabledDownload=${!!we}`}),Dt==="image"&&ie.createElement("img",{src:`${(Et==null?void 0:Et.indexOf("http://"))>-1||(Et==null?void 0:Et.indexOf("https://"))>-1?"":"data:image/png;base64,"}${Et}`}),(Dt==="other"||Dt==="download")&&ie.createElement(ie.Fragment,null,_e?ie.createElement(ne.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:ie.createElement(le.ZP,{icon:ie.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:Mn,disabled:we},"\u4E0B\u8F7D")}):ie.createElement(le.ZP,{type:"primary",size:"middle",onClick:Mn,disabled:we},ie.createElement(Me.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},74057:function(Dn,Gn,kt){"use strict";kt.d(Gn,{t:function(){return Pt}});var pt=kt(59301),Ut=kt(37568),le=kt(28284),Me=kt(62957),ue=kt(77019),It=kt(5269),qt=kt(71051),ge=kt(82326),ne=kt(47889),Rt=kt(13878),Ae=kt(71570),ie=kt(64745),Ee=kt(6767),Bt=kt(99571),nt=kt(29787),et=kt(24334),ht={flex_box_center:"flex_box_center___kOQ8P",flex_space_between:"flex_space_between___fY6jt",flex_box_vertical_center:"flex_box_vertical_center___bDSSI",flex_box_center_end:"flex_box_center_end___mQ6mU",flex_box_column:"flex_box_column___F15G0",result:"result___UYRo8",left:"left___TRaH5",right:"right___twp9s",box:"box___vwndt",li:"li___hRe2d"},st=kt(24092),gt=kt(8846),vt=kt(19565),St=kt(56102),Et=kt(45688),Tt=kt(59301),Dt=Object.defineProperty,Jt=Object.defineProperties,Yt=Object.getOwnPropertyDescriptors,Gt=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,ae=Object.prototype.propertyIsEnumerable,Ne=(Nt,zt,Mt)=>zt in Nt?Dt(Nt,zt,{enumerable:!0,configurable:!0,writable:!0,value:Mt}):Nt[zt]=Mt,Ce=(Nt,zt)=>{for(var Mt in zt||(zt={}))me.call(zt,Mt)&&Ne(Nt,Mt,zt[Mt]);if(Gt)for(var Mt of Gt(zt))ae.call(zt,Mt)&&Ne(Nt,Mt,zt[Mt]);return Nt},we=(Nt,zt)=>Jt(Nt,Yt(zt)),tn=(Nt,zt,Mt)=>new Promise((Kt,ye)=>{var Ue=Oe=>{try{ce(Mt.next(Oe))}catch(Le){ye(Le)}},Qe=Oe=>{try{ce(Mt.throw(Oe))}catch(Le){ye(Le)}},ce=Oe=>Oe.done?Kt(Oe.value):Promise.resolve(Oe.value).then(Ue,Qe);ce((Mt=Mt.apply(Nt,zt)).next())}),an=({buttonProps:Nt,buttonText:zt,form:Mt,hackIdentifier:Kt="",answerKey:ye,data:Ue})=>{const[Qe,ce]=(0,pt.useState)(!1),[Oe,Le]=(0,pt.useState)(!1),[Xe,vn]=(0,pt.useState)(!1),[cn,hn]=(0,pt.useState)({}),[Ti,Ge]=(0,pt.useState)(""),[Je,rn]=(0,pt.useState)(""),Xn=(0,pt.useRef)(Kt),Ln=(0,pt.useRef)(""),nn=(0,pt.useRef)(!1);(0,pt.useEffect)(()=>{Xe&&Si()},[Xe]),(0,pt.useEffect)(()=>()=>{sessionStorage.removeItem("projectFill")},[]);const Kn=()=>new Date().getTime(),mi=Ue==null?void 0:Ue.code,ei=()=>{var gn,Rn;let si=mi?Ue==null?void 0:Ue.code:(gn=Mt.getFieldValue("hack_codes"))==null?void 0:gn.code,xi=mi?Ue==null?void 0:Ue.answer_content:Mt.getFieldValue(ye),di=mi?Ue==null?void 0:Ue.input:(Rn=Mt.getFieldValue("hack_sets"))==null?void 0:Rn.input;xi==null||xi.forEach(Oi=>{const wt=Oi.value||Oi.answer_text||"";si=si.replace(/(@▁@|@▁▁@)/,wt)}),rn(di),Ge(si),hn({}),vn(!0)},Si=()=>tn(void 0,null,function*(){var gn,Rn,si,xi;const di=Kn(),Oi=mi?Ue==null?void 0:Ue.time_limit:(gn=Mt.getFieldsValue())==null?void 0:gn.hack.time_limit,wt=mi?(Rn=Ue==null?void 0:Ue.answer_content)==null?void 0:Rn.length:(xi=(si=Mt.getFieldsValue())==null?void 0:si.standard_answers)==null?void 0:xi.length;ce(!0),yield(0,gt.bM)(Ln.current,{test_hack_code:Ti,test_input:Je});function yn(){return tn(this,null,function*(){const{status:Wn,data:ki}=yield(0,gt.rX)(Ln.current,"submit"),ur=Kn()-di>(Oi+3)*1e3*wt;if(nn.current){if(ur){Ee.ZP.error("\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"),ce(!1);return}if(Wn===0){ce(!1),hn(we(Ce({},ki),{showText:!0}));return}setTimeout(yn,1e3)}})}yn()}),Wi=()=>tn(void 0,null,function*(){var gn,Rn,si,xi,di,Oi,wt;if(!Ue){try{yield Mt.validateFields()}catch(Ui){(si=(Rn=(gn=Ui==null?void 0:Ui.errorFields)==null?void 0:gn[0])==null?void 0:Rn.name)!=null&&si.includes("standard_answers")?Ee.ZP.error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"):Ee.ZP.error(Ui.errorFields[0].errors[0]),Mt.scrollToField(Ui.errorFields[0].name,{behavior:"smooth",block:"center"});return}Le(!0);let Wn="";const ki=Mt.getFieldsValue();Xn.current?Wn=yield(0,st.ZP)(`/api/problems/${Xn.current}.json`,{method:"put",body:we(Ce({},ki),{hack:we(Ce({},ki==null?void 0:ki.hack),{sub_discipline_id:(wt=(Oi=ki==null?void 0:ki.hack)==null?void 0:Oi.sub_discipline_id)==null?void 0:wt[1],difficult:ki.difficulty,item_banks_group_id:ki.item_banks_group_id}),hack_codes:we(Ce({},ki.hack_codes),{code:et.Base64.encode(ki.hack_codes.code)}),update_hack_sets:[Ce({},ki.hack_sets)],is_blank:!0,item_type:"BPROGRAM"})}):(Wn=yield(0,st.ZP)("/api/problems.json",{method:"post",body:we(Ce({},ki),{hack:we(Ce({},ki==null?void 0:ki.hack),{sub_discipline_id:(di=(xi=ki==null?void 0:ki.hack)==null?void 0:xi.sub_discipline_id)==null?void 0:di[1],difficult:ki.difficulty,item_banks_group_id:ki.item_banks_group_id}),hack_codes:we(Ce({},ki.hack_codes),{code:et.Base64.encode(ki.hack_codes.code)}),hack_sets:[Ce({},ki.hack_sets)],is_blank:!0,item_type:"BPROGRAM"})}),Xn.current=Wn==null?void 0:Wn.identifier,sessionStorage.projectFill=Wn==null?void 0:Wn.identifier)}const yn=yield(0,st.ZP)(`/api/problems/${Xn.current}/start.json`,{method:"get"});if((yn==null?void 0:yn.status)===0){Ln.current=yn==null?void 0:yn.identifier,nn.current=!0,Le(!1),ei();return}Le(!1)}),An=gn=>{const{status:Rn,error_msg:si,execute_time:xi,output:di,input:Oi,expected_output:wt}=gn;let yn=null;switch(Rn){case Et.h.OK:yn=Tt.createElement(Tt.Fragment,null,Tt.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",xi/1e3,"\u79D2"),Tt.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A\u8C03\u8BD5\u901A\u8FC7"));break;case Et.h.NOMATCH:yn=Tt.createElement(Tt.Fragment,null,Tt.createElement("div",null,"\u8F93\u5165\uFF1A"),Tt.createElement("pre",{style:{fontFamily:"initial"}},Oi),Tt.createElement("div",null,"\u8F93\u51FA\uFF1A"),Tt.createElement("pre",{style:{fontFamily:"initial"}},di&&et.Base64.decode(di)),Tt.createElement("div",null,"\u9884\u671F\u8F93\u51FA\uFF1A"),Tt.createElement("pre",{style:{fontFamily:"initial"}},wt&&et.Base64.decode(wt)));break;case Et.h.EXECUTEFAILURE:yn=Tt.createElement(Tt.Fragment,null,Tt.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",Tt.createElement("pre",null,Oi)),Tt.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),Tt.createElement("pre",{className:"error"},et.Base64.decode(si)));break;case Et.h.COMPILEFAILURE:yn=Tt.createElement(Tt.Fragment,null,Tt.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",Tt.createElement("pre",null,Oi)),Tt.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),Tt.createElement("pre",{className:"error"},et.Base64.decode(si)));break;case Et.h.PODFAILURE:yn=Tt.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case Et.h.TIMEOUT:yn=Tt.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return Tt.createElement(Tt.Fragment,null," ",yn," ")};return Tt.createElement("div",null,Tt.createElement(Bt.ZP,we(Ce({loading:Oe},Nt),{onClick:Wi}),zt),Tt.createElement(Me.default,{open:Xe,title:"\u8C03\u8BD5\u4EE3\u7801",destroyOnClose:!0,width:1200,okText:"\u8FD0\u884C\u6D4B\u8BD5",confirmLoading:Qe,cancelButtonProps:{style:{display:"none"}},onOk:()=>Si(),onCancel:()=>{nn.current=!1,vn(!1)}},Tt.createElement("div",{className:ht.result},Tt.createElement("div",{className:ht.left},Tt.createElement("div",{className:"mb20"},Tt.createElement("span",{className:"c-black"},"\u6267\u884C\u4EE3\u7801"),!Ue&&Tt.createElement(St.CopyToClipboard,{text:Ti,onCopy:()=>Ee.ZP.success("\u590D\u5236\u6210\u529F")},Tt.createElement("span",{style:{float:"right"},className:"current c-light-primary"},Tt.createElement("i",{className:"iconfont icon-fuzhi8 mr5"}),"\u590D\u5236"))),Tt.createElement(vt.Z,{height:510,className:"mb0",hidetoolBar:!0,defaultValue:Ti,onChange:gn=>Ge(gn)})),Tt.createElement("div",{className:ht.right},Tt.createElement("div",{className:"c-black mb20"},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B"),Tt.createElement("div",{className:ht.box},Tt.createElement("div",{className:ht.li},Tt.createElement(Ut.default.TextArea,{placeholder:"\u8BF7\u8F93\u5165",value:Je,onChange:gn=>rn(gn.target.value),bordered:!1,style:{height:180}}))),Tt.createElement("div",{className:"c-black mb20 mt30"},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"),Tt.createElement("div",{className:ht.box},Tt.createElement(nt.Z,{spinning:Qe,tip:"\u4EE3\u7801\u6267\u884C\u4E2D"},Tt.createElement("div",{className:ht.li,style:{height:196,overflow:"auto",padding:10}},An(cn))))))))},Ke=kt(87169),oe=kt(59301),Xt=Object.defineProperty,qe=Object.defineProperties,_n=Object.getOwnPropertyDescriptors,Pn=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,dn=Object.prototype.propertyIsEnumerable,sn=(Nt,zt,Mt)=>zt in Nt?Xt(Nt,zt,{enumerable:!0,configurable:!0,writable:!0,value:Mt}):Nt[zt]=Mt,jn=(Nt,zt)=>{for(var Mt in zt||(zt={}))De.call(zt,Mt)&&sn(Nt,Mt,zt[Mt]);if(Pn)for(var Mt of Pn(zt))dn.call(zt,Mt)&&sn(Nt,Mt,zt[Mt]);return Nt},Te=(Nt,zt)=>qe(Nt,_n(zt)),Sn=(Nt,zt)=>{var Mt={};for(var Kt in Nt)De.call(Nt,Kt)&&zt.indexOf(Kt)<0&&(Mt[Kt]=Nt[Kt]);if(Nt!=null&&Pn)for(var Kt of Pn(Nt))zt.indexOf(Kt)<0&&dn.call(Nt,Kt)&&(Mt[Kt]=Nt[Kt]);return Mt};const{TextArea:ee}=Ut.default,Mn=[{title:"C",key:"C"},{title:"C++",key:"C++"},{title:"Python",key:"Python"},{title:"Java",key:"Java"}],ui=({value:Nt,onChange:zt})=>oe.createElement(Switch,{checked:Nt,onChange:Mt=>{zt(Mt)}}),_t="@\u2581@",Lt="@\u2581\u2581@",Pt=({questionTitlePlaceholder:Nt,form:zt,scoreByBlank:Mt=!1,hackidentifier:Kt,answerKey:ye})=>{const[Ue,Qe]=(0,pt.useState)(!1),[ce,Oe]=(0,pt.useState)(!1),Xe=(0,Ae.useParams)().type==="edit",vn=(Ln,nn)=>{const Kn=nn.line;let mi=0;for(let Si=0;Si<Kn;Si++)mi+=Ln.getLine(Si).split(_t).length-1;for(let Si=0;Si<Kn;Si++)mi+=Ln.getLine(Si).split(Lt).length-1;const ei=Ln.getLine(Kn).substring(0,nn.ch);return mi+=ei.split(_t).length-1,mi+=ei.split(Lt).length-1,mi},cn=(Ln,nn,Kn,mi)=>{const ei=Ln.getRange(nn.from,nn.to);let Si=0;if(nn.text.forEach(Wi=>{Si+=Wi.split(_t).length-1}),nn.text.forEach(Wi=>{Si+=Wi.split(Lt).length-1}),nn.origin!=="setValue"){if(ei&&(ei.indexOf(_t)!==-1||ei.indexOf(Lt)!==-1)){const Wi=ei.split(_t).length-1+ei.split(Lt).length-1,An=vn(Ln,nn.from);if(console.log(`\u5220\u9664${Wi}\u4E2A\uFF0C \u524D\u9762\u6709${An}\u4E2A\uFF0C\u65B0\u589E${Si}\u4E2A`),Wi>1){const gn=Array.from({length:Wi},(Rn,si)=>An+si);mi(gn)}else mi(An)}else if(Si>0){const Wi=vn(Ln,nn.from);console.log(`\u65B0\u589E${Si}\u4E2A\uFF0C\u4E4B\u524D\u6709${Wi}\u4E2A`),Kn(Si,Wi)}}},hn=()=>{const Ln=zt.getFieldValue(ye);zt.setFieldsValue({[ye]:Ln==null?void 0:Ln.map((nn,Kn)=>Te(jn({},nn),{position:Kn+1}))})},Ti=(0,pt.useRef)(),Ge=(Ln,nn)=>{for(let Kn=0;Kn<Ln;Kn++)Ti.current({position:null,answer_text:""},nn+Kn);hn()},Je=(0,pt.useRef)(),rn=Ln=>{Je.current(Ln),hn()},Xn=le.default.useWatch(ye,zt);return oe.createElement("div",{className:ie.Z.wrap},oe.createElement(le.default.Item,{label:"\u8BD5\u9898\u63CF\u8FF0",name:["hack","description"],style:{display:"table"},className:"w100",labelCol:{span:24},rules:[{required:!0}]},oe.createElement(Rt.h,{scrollId:"name",watch:!0,height:140})),oe.createElement("div",{className:ie.Z.questionTitleEditorWrap},oe.createElement(le.default.Item,{label:"\u7A0B\u5E8F\u4EE3\u7801",name:["hack_codes","code"],labelCol:{span:24},rules:[{required:!0}]},oe.createElement(Rt.h,{scrollId:"name",watch:!0,height:400,showNullProgramButton:!0,onChange:(Ln,nn)=>{const Kn=zt.getFieldValue(ye);console.log("--preAnswerData",Kn,nn),zt.setFieldsValue({[ye]:Kn==null?void 0:Kn.map((mi,ei)=>{var Si;return Te(jn({},mi),{position:ei+1,multi_line:(Si=nn==null?void 0:nn[ei])==null?void 0:Si.multiLine})})})},placeholder:Nt,onCMBeforeChange:(Ln,nn)=>{cn(Ln,nn,Ge,rn)}}))),oe.createElement(le.default.List,{name:ye,rules:[{validator(Ln,nn){if(!(nn!=null&&nn.length))return Promise.reject(new Error("\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"));for(const Kn of nn){const{answer_text:mi}=Kn||{};if((mi==null?void 0:mi.length)===0)return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(Ln,{add:nn,remove:Kn},{errors:mi})=>(Ti.current=nn,Je.current=Kn,oe.createElement(oe.Fragment,null,oe.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},oe.createElement(le.default.Item,{label:"\u586B\u7A7A\u9879\u7B54\u6848",required:!0,labelCol:{span:24}}),oe.createElement("div",{onClick:()=>{Me.default.warning({title:"\u7ED9\u5206\u8BF4\u660E",icon:null,width:700,centered:!0,content:oe.createElement("div",null,oe.createElement("div",null,"1.\u5B66\u751F\u586B\u5199\u7B54\u6848\u4E4B\u540E\uFF0C\u5FC5\u987B\u63D0\u4EA4\u4EE3\u7801",oe.createElement("span",{style:{color:"#e30000"}},"\u8FDB\u884C\u8BC4\u6D4B"),"\u624D\u80FD\u5F97\u5206\u3002"),oe.createElement("div",{style:{marginTop:10}},"2.\u8BD5\u9898\u7B97\u5206\u65F6\uFF0C\u7CFB\u7EDF\u4F1A\u5C06\u7A0B\u5E8F\u91CC\u9762\u7684\u6240\u6709\u7A7A\u66FF\u6362\u6210\u5B66\u751F\u7684\u7B54\u6848\u8FDB\u884C\u8BC4\u6D4B\u3002\u8F93\u51FA\u7684\u7ED3\u679C\u4E0E\u6D4B\u8BD5\u96C6\u6BD4\u5BF9\uFF0C\u5B8C\u5168\u6B63\u786E\u5219\u5F97\u6EE1\u5206\uFF1B\u82E5\u4E0D\u5B8C\u5168\u6B63\u786E\uFF0C\u5219\u4F9D\u6B21\u5C06\u6BCF\u4E2A\u7A7A\u6362\u6210\u5B66\u751F\u63D0\u4EA4\u7684\u7B54\u6848\uFF0C\u540C\u65F6\u5C06\u5176\u4ED6\u7A7A\u66FF\u6362\u6210\u6807\u51C6\u7B54\u6848\uFF0C\u8FD0\u884C\u7A0B\u5E8F\u3002\u5982\u679C\u8FD9\u4E2A\u7A7A\u7684\u5B66\u751F\u7B54\u6848\u4E0E\u6807\u51C6\u7B54\u6848\u7ED3\u5408\u80FD\u5F97\u5230\u6B63\u786E\u8F93\u51FA\uFF0C\u5219\u8FD9\u4E2A\u7A7A\u5F97\u5230\u8BE5\u7A7A\u7684\u6EE1\u5206\uFF0C\u5426\u5219\u8BE5\u7A7A\u5F970\u5206\u3002"))})},style:{minHeight:32,color:"#3061D0",cursor:"pointer"}},oe.createElement(Ke.Z,{style:{marginRight:3,color:"#3061D0"}}),oe.createElement("span",null," \u7ED9\u5206\u8BF4\u660E"))),Ln.map((ei,Si)=>{var Wi=ei,{key:An,name:gn}=Wi,Rn=Sn(Wi,["key","name"]),si,xi;return oe.createElement(ue.Z,{className:"mb20",key:An,align:"middle",wrap:!1},oe.createElement(It.Z,{flex:"0 0 auto",className:`${ie.Z.blankIndex}`},"\u586B\u7A7A\u9879",Si+1),oe.createElement(It.Z,{flex:1},oe.createElement(ue.Z,{align:"top",justify:"space-between",wrap:!1},oe.createElement(It.Z,null,oe.createElement(le.default.Item,Te(jn({},Rn),{name:[gn,"answer_text"],noStyle:!0}),(si=Xn==null?void 0:Xn[gn])!=null&&si.multi_line||(xi=Xn==null?void 0:Xn[gn])!=null&&xi.multiLine?oe.createElement(ee,{spellCheck:!1,style:{marginLeft:10,width:550}}):oe.createElement(Ut.default,{style:{marginLeft:10,width:550},className:ie.Z.blankInput,size:"large",maxLength:1e3,onBlur:di=>{}}))),Mt&&oe.createElement(It.Z,{flex:"224px"},oe.createElement(le.default.Item,Te(jn({},Rn),{name:[gn,"score"],label:"\u5206\u503C",rules:[{required:!0}]}),oe.createElement(qt.Z,{size:"large",className:ie.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5206\u503C"}))))))})))),oe.createElement("div",{onClick:()=>Qe(!0)},oe.createElement(le.default.Item,{name:["hack","analysis"],label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},oe.createElement(Rt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Ue}))),oe.createElement(le.default.Item,{label:"\u7F16\u7A0B\u8BED\u8A00",style:{marginTop:30},name:["hack_codes","language"],labelCol:{span:24},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u7F16\u7A0B\u8BED\u8A00"}]},oe.createElement(ge.default,{size:"large"},Mn.map(Ln=>oe.createElement(ge.default.Option,{key:Ln.title,value:Ln.key}," ",Ln.title)))),oe.createElement(le.default.Item,{label:"\u6700\u5927\u8BC4\u6D4B\u65F6\u957F\uFF08\u79D2\uFF09",style:{marginTop:30},labelCol:{span:24},required:!0},oe.createElement(le.default.Item,{name:["hack","time_limit"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5355\u4E2A\u6D4B\u8BD5\u96C6\u8BC4\u6D4B\u65F6\u957F\u9650\u5236"},{type:"number",min:3,message:"\u6700\u5C0F\u9650\u5236\u65F6\u95F4\u662F3\u79D2"}],noStyle:!0},oe.createElement(qt.Z,{precision:0,max:10,min:3,size:"large",style:{width:"97%"}})),oe.createElement("span",{className:"ml10 font14"},"\u79D2")),oe.createElement(le.default.Item,{label:"\u8BC4\u6D4B\u65F6\u7A7A\u683C\u5904\u7406",style:{marginTop:30},name:["hack","submit_rule"],labelCol:{span:24},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BC4\u6D4B\u65F6\u7A7A\u683C\u5904\u7406"}]},oe.createElement(ne.ZP.Group,{style:{marginTop:-10}},oe.createElement(ne.ZP,{value:0},"\u4E0D\u5FFD\u7565\u7A7A\u683C"),oe.createElement(ne.ZP,{value:1},"\u5FFD\u7565\u9996\u5C3E\u7A7A\u683C"),oe.createElement(ne.ZP,{value:2},"\u5FFD\u7565\u6240\u6709\u7A7A\u683C"))),oe.createElement(le.default.Item,{label:"\u6D4B\u8BD5\u7528\u4F8B",required:!0,style:{marginTop:30}}),oe.createElement("div",{style:{background:"#F6F7F9",padding:15}},oe.createElement(le.default.Item,{label:"\u8F93\u5165",labelCol:{span:24},name:["hack_sets","input"]},oe.createElement(ee,{rows:4})),oe.createElement(le.default.Item,{label:"\u8F93\u51FA",labelCol:{span:24},name:["hack_sets","output"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8F93\u51FA\u5185\u5BB9"}]},oe.createElement(ee,{rows:4}))),oe.createElement(an,{form:zt,answerKey:ye,hackIdentifier:Kt,buttonText:"\u8FD0\u884C\u8C03\u8BD5",buttonProps:{ghost:!0,icon:oe.createElement("i",{className:"iconfont icon-ceshi"}),style:{background:"rgba(55,173,131,0.05)",borderRadius:19,border:"1px solid #37AD83",width:116,height:38,display:"inline-flex",fontSize:14,alignItems:"center",justifyContent:"center",marginTop:20,cursor:"pointer",color:"#37AD83"}}}))}},44831:function(Dn,Gn,kt){"use strict";kt.d(Gn,{u:function(){return Tt}});var pt=kt(59301),Ut=kt(77019),le=kt(5269),Me=kt(25399),ue=kt(28284),It=kt(64745),qt=kt(32134),ge=kt(12893),ne=kt(13878),Rt=kt(59301),Ae=Object.defineProperty,ie=Object.defineProperties,Ee=Object.getOwnPropertyDescriptors,Bt=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,ht=(Dt,Jt,Yt)=>Jt in Dt?Ae(Dt,Jt,{enumerable:!0,configurable:!0,writable:!0,value:Yt}):Dt[Jt]=Yt,st=(Dt,Jt)=>{for(var Yt in Jt||(Jt={}))nt.call(Jt,Yt)&&ht(Dt,Yt,Jt[Yt]);if(Bt)for(var Yt of Bt(Jt))et.call(Jt,Yt)&&ht(Dt,Yt,Jt[Yt]);return Dt},gt=(Dt,Jt)=>ie(Dt,Ee(Jt)),vt=(Dt,Jt)=>{var Yt={};for(var Gt in Dt)nt.call(Dt,Gt)&&Jt.indexOf(Gt)<0&&(Yt[Gt]=Dt[Gt]);if(Dt!=null&&Bt)for(var Gt of Bt(Dt))Jt.indexOf(Gt)<0&&et.call(Dt,Gt)&&(Yt[Gt]=Dt[Gt]);return Yt};const St=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Et=({value:Dt,onChange:Jt,choiceTextKey:Yt,answerKey:Gt,index:me,isEdit:ae,setInputActive:Ne,form:Ce,choiceOptionsPath:we,allowChangeMode:tn,showAddIcon:_e,addItem:an,deleteItem:Ke})=>{console.log(Dt,"value");const oe=(Dt==null?void 0:Dt[Gt])===1,Xt=()=>{const _n=Ce.getFieldValue(we);Ce.setFieldValue(we,_n.map(Pn=>gt(st({},Pn),{[Gt]:0})))},qe=()=>{oe?Jt(gt(st({},Dt),{[Gt]:0})):(tn||Xt(),Jt(gt(st({},Dt),{[Gt]:1})))};return Rt.createElement(Ut.Z,{className:It.Z.choiceWrap,align:"middle",wrap:!1},Rt.createElement(le.Z,{onClick:qe,className:`${It.Z.choiceIndex} ${oe?It.Z.activeAnswer:""}`},St[me]),Rt.createElement(le.Z,{flex:1,className:`${It.Z.editorWrap} ml15`,onClick:Ne},Rt.createElement(ne.x,{height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",isEdit:ae,value:Dt==null?void 0:Dt[Yt],onChange:_n=>{Jt(gt(st({},Dt),{[Yt]:_n}))}})),Rt.createElement(le.Z,{flex:"0 0 auto",className:"ml15"},Rt.createElement("div",{onClick:qe,className:`${It.Z.setAnswerBtn} ${oe?It.Z.activeAnswer:""}`},oe?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")),Rt.createElement(le.Z,{className:It.Z.actionWrapper},Rt.createElement(Me.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},Rt.createElement(qt.Z,{className:It.Z.addIcon,onClick:an,style:{visibility:_e?"visible":"hidden"}})),Rt.createElement(Me.Z,{title:"\u5220\u9664"},Rt.createElement(ge.Z,{className:It.Z.deleteIcon,onClick:Ke,style:{visibility:me>1?"visible":"hidden"}}))))},Tt=({questionTitlePlaceholder:Dt,titleKey:Jt,choiceKey:Yt,analysisKey:Gt,choiceTextKey:me,answerKey:ae,choiceOptionsPath:Ne,allowChangeMode:Ce=!0,form:we,showAnalysis:tn=!0})=>{const[_e,an]=(0,pt.useState)(),[Ke,oe]=(0,pt.useState)(!1);return Rt.createElement("div",{className:It.Z.wrap},Rt.createElement("div",{className:It.Z.questionTitleEditorWrap},Rt.createElement(ue.default.Item,{label:"\u9898\u5E72",name:Jt,labelCol:{span:24},rules:[{required:!0}]},Rt.createElement(ne.h,{scrollId:Array.isArray(Jt)?Jt.join("_"):`${Jt}`,watch:!0,height:140,placeholder:Dt}))),Rt.createElement(ue.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),Rt.createElement(ue.default.List,{name:Yt,rules:[{validator(Xt,qe){const _n=qe.some(De=>De[ae]===1),Pn=qe.findIndex(De=>{var dn;return((dn=De[me])==null?void 0:dn.length)<=0});return Pn!==-1?Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${St[Pn]}\u9009\u9879\u7684\u5185\u5BB9`)):_n?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},(Xt,{add:qe,remove:_n})=>Rt.createElement("div",{id:Array.isArray(Ne)?Ne.join("_"):`${Ne}`},Xt.map((Pn,De)=>{var dn=Pn,{key:sn,name:jn}=dn,Te=vt(dn,["key","name"]);const Sn=_e===sn,ee=()=>{an(sn)},Mn=De<7&&De===Xt.length-1,ui=()=>qe({[me]:"",[ae]:0}),_t=()=>_n(jn);return Rt.createElement(ue.default.Item,gt(st({},Te),{key:sn,name:jn,className:It.Z.choiceListWrap,rules:[{validator(Lt,Pt){return Pt!=null&&Pt.choice_text?Promise.resolve():Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${St[De]}\u9009\u9879\u7684\u5185\u5BB9`))}}]}),Rt.createElement(Et,{choiceTextKey:me,answerKey:ae,index:De,isEdit:Sn,setInputActive:ee,form:we,choiceOptionsPath:Ne,allowChangeMode:Ce,showAddIcon:Mn,addItem:ui,deleteItem:_t}))}),Xt.length<8&&Rt.createElement("div",{className:`${It.Z.addBtn} mb30`,onClick:()=>qe({[me]:"",[ae]:0})},"\u6DFB\u52A0\u9009\u9879"))),tn&&Rt.createElement("div",{onClick:()=>oe(!0)},Rt.createElement(ue.default.Item,{name:Gt,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},Rt.createElement(ne.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Ke}))))}},61382:function(Dn,Gn,kt){"use strict";kt.d(Gn,{u:function(){return Ce}});var pt=kt(59301),Ut=kt(62957),le=kt(77019),Me=kt(5269),ue=kt(37568),It=kt(25399),qt=kt(71411),ge=kt(28284),ne=kt(47889),Rt=kt(71051),Ae=kt(13878),ie=kt(12893),Ee=kt(61485),Bt=kt(64745),nt=kt(29105),et=kt(59301),ht=Object.defineProperty,st=Object.defineProperties,gt=Object.getOwnPropertyDescriptors,vt=Object.getOwnPropertySymbols,St=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable,Tt=(we,tn,_e)=>tn in we?ht(we,tn,{enumerable:!0,configurable:!0,writable:!0,value:_e}):we[tn]=_e,Dt=(we,tn)=>{for(var _e in tn||(tn={}))St.call(tn,_e)&&Tt(we,_e,tn[_e]);if(vt)for(var _e of vt(tn))Et.call(tn,_e)&&Tt(we,_e,tn[_e]);return we},Jt=(we,tn)=>st(we,gt(tn)),Yt=(we,tn)=>{var _e={};for(var an in we)St.call(we,an)&&tn.indexOf(an)<0&&(_e[an]=we[an]);if(we!=null&&vt)for(var an of vt(we))tn.indexOf(an)<0&&Et.call(we,an)&&(_e[an]=we[an]);return _e};const Gt=({value:we,onChange:tn})=>{const _e=Ke=>{Ut.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:Bt.Z.modal,onOk:()=>{const oe=[...we];oe.splice(Ke,1),tn(oe)}})},an=()=>{const Ke=[...we];Ke.push(""),tn(Ke)};return et.createElement(le.Z,{className:"ml20"},et.createElement(Me.Z,{flex:1},we==null?void 0:we.map((Ke,oe)=>et.createElement(le.Z,{key:`${Ke}_${oe}`,className:"mb20"},et.createElement(ue.default.TextArea,{style:{flex:1,minHeight:44},defaultValue:Ke,autoSize:{maxRows:3},maxLength:1e3,onBlur:Xt=>{const qe=[...we],_n=Xt.target.value.trim();qe[oe]=_n,tn(qe)}}),et.createElement(It.Z,{title:"\u5220\u9664"},et.createElement(ie.Z,{className:Bt.Z.deleteIcon,style:{marginLeft:15,visibility:oe>0?"visible":"hidden"},onClick:()=>_e(oe)}))))),et.createElement(Me.Z,null,et.createElement("div",{className:`${Bt.Z.addBtn}`,onClick:()=>{an()}},"\u65B0\u589E\u7B54\u6848")))},me=({value:we,onChange:tn})=>{const _e=Ke=>{Ut.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:Bt.Z.modal,onOk:()=>{const oe=[...we];oe.splice(Ke,1),tn(oe)}})},an=()=>{const Ke=[...we];Ke.push(""),tn(Ke)};return et.createElement(le.Z,{className:"ml20"},et.createElement(Me.Z,{flex:1},we==null?void 0:we.map((Ke,oe)=>et.createElement(le.Z,{key:`${Ke}_${oe}`,align:"middle",className:"mb20"},et.createElement(nt.Z,{value:Ke,style:{flex:1},onChange:Xt=>{const qe=[...we];qe[oe]=Xt,tn(qe)}}),et.createElement(It.Z,{title:"\u5220\u9664"},et.createElement(ie.Z,{className:Bt.Z.deleteIcon,style:{marginLeft:15,visibility:oe>0?"visible":"hidden"},onClick:()=>_e(oe)}))))),et.createElement(Me.Z,null,et.createElement("div",{className:`${Bt.Z.addBtn}`,onClick:()=>{an()}},"\u65B0\u589E\u7B54\u6848")))},ae=({value:we=!0,onChange:tn})=>et.createElement(qt.Z,{checked:!we,onChange:_e=>{tn(!_e)}}),Ne="\u2581",Ce=({questionTitlePlaceholder:we,form:tn,scoreByBlank:_e=!1,answerKey:an})=>{const[Ke,oe]=(0,pt.useState)(!1),Xt=(Te,Sn)=>{const ee=Sn.line;let Mn=0;for(let _t=0;_t<ee;_t++)Mn+=Te.getLine(_t).split(Ne).length-1;const ui=Te.getLine(ee).substring(0,Sn.ch);return Mn+=ui.split(Ne).length-1,Mn},qe=(Te,Sn,ee,Mn)=>{const ui=Te.getRange(Sn.from,Sn.to);let _t=0;if(Sn.text.forEach(Lt=>{_t+=Lt.split(Ne).length-1}),Sn.origin!=="setValue"){if(ui&&ui.indexOf(Ne)!==-1){const Lt=ui.split(Ne).length-1,Pt=Xt(Te,Sn.from);if(console.log(`\u5220\u9664${Lt}\u4E2A\uFF0C \u524D\u9762\u6709${Pt}\u4E2A\uFF0C\u65B0\u589E${_t}\u4E2A`),Lt>1){const Nt=Array.from({length:Lt},(zt,Mt)=>Pt+Mt);Mn(Nt)}else Mn(Pt)}else if(_t>0){const Lt=Xt(Te,Sn.from);console.log(`\u65B0\u589E${_t}\u4E2A\uFF0C\u4E4B\u524D\u6709${Lt}\u4E2A`),ee(_t,Lt)}}},_n=()=>{const Te=tn.getFieldValue(an);tn.setFieldsValue({[an]:Te.map((Sn,ee)=>Jt(Dt({},Sn),{position:ee+1}))})},Pn=(0,pt.useRef)(),De=(Te,Sn)=>{for(let ee=0;ee<Te;ee++)Pn.current({position:null,answer_text:[""],model:1},Sn+ee);_n()},dn=(0,pt.useRef)(),sn=Te=>{dn.current(Te),_n()},jn=ge.default.useWatch(an,tn);return et.createElement("div",{className:Bt.Z.wrap},et.createElement("div",{className:Bt.Z.questionTitleEditorWrap},et.createElement(ge.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},et.createElement(Ae.h,{scrollId:"name",watch:!0,height:140,placeholder:we,showNullButton:!0,onCMBeforeChange:(Te,Sn)=>{qe(Te,Sn,De,sn)}}))),et.createElement(ge.default.List,{name:an,rules:[{validator(Te,Sn){if(!(Sn!=null&&Sn.length))return Promise.reject(new Error("\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879"));for(const ee of Sn){const{answer_text:Mn}=ee||{};if(Mn!=null&&Mn.some(ui=>(ui==null?void 0:ui.length)===0))return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(Te,{add:Sn,remove:ee},{errors:Mn})=>(Pn.current=Sn,dn.current=ee,et.createElement(et.Fragment,null,et.createElement(ge.default.Item,{label:et.createElement("span",null,"\u586B\u7A7A\u9879\u7B54\u6848",!(Te!=null&&Te.length)&&et.createElement("span",{style:{color:"#E99237"}},"\uFF08\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879\uFF09")),required:!0,labelCol:{span:24}}),Te.map((ui,_t)=>{var Lt=ui,{key:Pt,name:Nt}=Lt,zt=Yt(Lt,["key","name"]),Mt,Kt;return et.createElement("div",{style:{marginBottom:10},key:Pt},et.createElement(le.Z,{className:"mb20",align:"middle",wrap:!1},et.createElement(Me.Z,{style:{marginRight:10},flex:"0 0 auto",className:`${Bt.Z.blankIndex}`},"\u586B\u7A7A\u9879",_t+1),et.createElement(ge.default.Item,Jt(Dt({},zt),{name:[Nt,"model"],noStyle:!0}),et.createElement(ne.ZP.Group,{onChange:()=>{const ye=tn.getFieldValue(an);tn.setFieldsValue({[an]:ye.map((Ue,Qe)=>Jt(Dt({},Ue),{answer_text:Nt===Qe?[""]:Ue.answer_text}))})}},et.createElement(ne.ZP,{value:1},"\u6587\u672C\u6A21\u5F0F ",et.createElement(It.Z,{title:"\u5B66\u751F\u7B54\u9898\u65F6\uFF0C\u9700\u8981\u5728\u6587\u672C\u6846\u4E2D\u586B\u5199\u6587\u672C\u7B54\u6848"},et.createElement(Ee.Z,null))),et.createElement(ne.ZP,{value:2},"\u6570\u5B66\u516C\u5F0F\u6A21\u5F0F ",et.createElement(It.Z,{title:"\u5B66\u751F\u7B54\u9898\u65F6\uFF0C\u9700\u8981\u7F16\u5199\u6570\u5B66\u516C\u5F0F\u4F5C\u4E3A\u7B54\u6848"},et.createElement(Ee.Z,null)))))),et.createElement(le.Z,{style:{marginLeft:20},align:"middle",wrap:!1},et.createElement(Me.Z,{flex:1},et.createElement(le.Z,{align:"top",justify:"space-between",wrap:!1},et.createElement(Me.Z,{flex:1},et.createElement(ge.default.Item,Jt(Dt({},zt),{name:[Nt,"answer_text"],noStyle:!0}),((Kt=(Mt=tn.getFieldValue(an))==null?void 0:Mt[Nt])==null?void 0:Kt.model)===1?et.createElement(Gt,null):et.createElement(me,null))),_e&&et.createElement(Me.Z,{flex:"224px",style:{margin:"-7px 0 0 20px"}},et.createElement(ge.default.Item,Jt(Dt({},zt),{name:[Nt,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:Bt.Z.blankInputNumberWrapper}),et.createElement(Rt.Z,{min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5206\u503C"})))),et.createElement(ge.default.Item,Jt(Dt({},zt),{name:[Nt,"position"],noStyle:!0}),et.createElement(ue.default,{type:"hidden"})))))})))),et.createElement(le.Z,{align:"middle"},et.createElement(ge.default.Item,{name:"downcase",valuePropName:"checked"},et.createElement(qt.Z,null)),et.createElement(Me.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),et.createElement(le.Z,{align:"middle"},et.createElement(ge.default.Item,{name:"no_space",valuePropName:"checked"},et.createElement(qt.Z,null)),et.createElement(Me.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(jn==null?void 0:jn.length)>1&&et.createElement(le.Z,{align:"middle",className:(jn==null?void 0:jn.length)>1?"mb30":`${Bt.Z.hide}`},et.createElement(ge.default.Item,{name:"is_ordered"},et.createElement(ae,null)),et.createElement(Me.Z,{className:"ml10"},"\u5141\u8BB8\u5B66\u751F\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u4E0E\u6807\u51C6\u7B54\u6848\u7684\u987A\u5E8F\u4E0D\u4E00\u81F4")),et.createElement("div",{onClick:()=>oe(!0)},et.createElement(ge.default.Item,{name:"analysis",label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},et.createElement(Ae.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Ke}))))}},69734:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Z:function(){return vt}});var pt=kt(59301),Ut=kt(77019),le=kt(5269),Me=kt(28284),ue=kt(64745),It=kt(13878),qt=kt(59301),ge=Object.defineProperty,ne=Object.defineProperties,Rt=Object.getOwnPropertyDescriptors,Ae=Object.getOwnPropertySymbols,ie=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable,Bt=(St,Et,Tt)=>Et in St?ge(St,Et,{enumerable:!0,configurable:!0,writable:!0,value:Tt}):St[Et]=Tt,nt=(St,Et)=>{for(var Tt in Et||(Et={}))ie.call(Et,Tt)&&Bt(St,Tt,Et[Tt]);if(Ae)for(var Tt of Ae(Et))Ee.call(Et,Tt)&&Bt(St,Tt,Et[Tt]);return St},et=(St,Et)=>ne(St,Rt(Et)),ht=(St,Et)=>{var Tt={};for(var Dt in St)ie.call(St,Dt)&&Et.indexOf(Dt)<0&&(Tt[Dt]=St[Dt]);if(St!=null&&Ae)for(var Dt of Ae(St))Et.indexOf(Dt)<0&&Ee.call(St,Dt)&&(Tt[Dt]=St[Dt]);return Tt};const st={\u6B63\u786E:"T",\u9519\u8BEF:"F"},gt=({value:St,onChange:Et,form:Tt})=>{const Dt=(St==null?void 0:St.is_answer)===1,Jt=St==null?void 0:St.choice_text,Yt=()=>{const Gt=Tt.getFieldsValue().choices.map(me=>({choice_text:me.choice_text,is_answer:0}));Tt.setFieldsValue({choices:Gt}),Et(et(nt({},St),{is_answer:1}))};return qt.createElement(Ut.Z,{className:ue.Z.choiceWrap,align:"middle",wrap:!1,style:{marginBottom:"20px"}},qt.createElement(le.Z,{onClick:Yt,className:`${ue.Z.choiceIndex} ${ue.Z.judgementIndex} ${Dt?ue.Z.activeAnswer:""}`},st[Jt]),qt.createElement(le.Z,{flex:1,className:`${ue.Z.editorWrap} ml15`},qt.createElement("div",{className:`${ue.Z.inputBorder} ${ue.Z.placeholder} ${Dt?ue.Z.activeJudgementAnswer:""}`},Jt)),qt.createElement(le.Z,{flex:"0 0 auto",className:"ml15"},qt.createElement("div",{onClick:Yt,className:`${ue.Z.setAnswerBtn} ${Dt?ue.Z.activeAnswer:""}`},Dt?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},vt=({questionTitlePlaceholder:St,choiceKey:Et,form:Tt})=>{const[Dt,Jt]=(0,pt.useState)(!1);return qt.createElement("div",{className:ue.Z.wrap},qt.createElement("div",{className:ue.Z.questionTitleEditorWrap},qt.createElement(Me.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},qt.createElement(It.h,{scrollId:"name",watch:!0,height:140,placeholder:St}))),qt.createElement(Me.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},qt.createElement(Me.default.List,{name:"choices",rules:[{validator(Yt,Gt){return Gt.some(ae=>(ae==null?void 0:ae.is_answer)===1)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},Yt=>qt.createElement("div",{id:"choices"},Yt.map(Gt=>{var me=Gt,{key:ae,name:Ne}=me,Ce=ht(me,["key","name"]);return qt.createElement(Me.default.Item,et(nt({},Ce),{key:ae,name:Ne,noStyle:!0}),qt.createElement(gt,{form:Tt}))})))),qt.createElement("div",{onClick:()=>Jt(!0)},qt.createElement(Me.default.Item,{name:"analysis",label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},qt.createElement(It.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Dt}))))}},13878:function(Dn,Gn,kt){"use strict";kt.d(Gn,{h:function(){return nt},x:function(){return et}});var pt=kt(19565),Ut=kt(64745),le=kt(79074),Me=kt(59301),ue=Object.defineProperty,It=Object.defineProperties,qt=Object.getOwnPropertyDescriptors,ge=Object.getOwnPropertySymbols,ne=Object.prototype.hasOwnProperty,Rt=Object.prototype.propertyIsEnumerable,Ae=(ht,st,gt)=>st in ht?ue(ht,st,{enumerable:!0,configurable:!0,writable:!0,value:gt}):ht[st]=gt,ie=(ht,st)=>{for(var gt in st||(st={}))ne.call(st,gt)&&Ae(ht,gt,st[gt]);if(ge)for(var gt of ge(st))Rt.call(st,gt)&&Ae(ht,gt,st[gt]);return ht},Ee=(ht,st)=>It(ht,qt(st)),Bt=(ht,st)=>{var gt={};for(var vt in ht)ne.call(ht,vt)&&st.indexOf(vt)<0&&(gt[vt]=ht[vt]);if(ht!=null&&ge)for(var vt of ge(ht))st.indexOf(vt)<0&&Rt.call(ht,vt)&&(gt[vt]=ht[vt]);return gt};const nt=ht=>{var st=ht,{value:gt,onChange:vt,scrollId:St}=st,Et=Bt(st,["value","onChange","scrollId"]);return Me.createElement("div",{id:St||""},Me.createElement(pt.Z,Ee(ie({},Et),{defaultValue:gt,onChange:(Tt,Dt)=>{Dt!=null&&Dt.length?vt(Tt,Dt):vt(Tt)}})))},et=({value:ht,onChange:st,placeholder:gt,height:vt=140,isEdit:St,miniToolbar:Et,watch:Tt=!0})=>St?Me.createElement(pt.Z,{watch:Tt,isFocus:!0,height:vt||void 0,placeholder:gt,defaultValue:ht,onChange:st,miniToolbar:Et}):Me.createElement("div",{style:{cursor:"pointer"}},ht?Me.createElement(le.Z,{className:Ut.Z.inputBorder,value:ht}):Me.createElement("div",{className:`${Ut.Z.inputBorder} ${Ut.Z.placeholder} inputBorderError`},gt))},92778:function(Dn,Gn,kt){"use strict";kt.d(Gn,{W:function(){return me}});var pt=kt(59301),Ut=kt(6767),le=kt(96599),Me=kt(28284),ue=kt(71411),It=kt(77019),qt=kt(5269),ge=kt(25399),ne=kt(37568),Rt=kt(71051),Ae=kt(64745),ie=kt(13878),Ee=kt(19565),Bt=kt(61485),nt=Object.defineProperty,et=Object.defineProperties,ht=Object.getOwnPropertyDescriptors,st=Object.getOwnPropertySymbols,gt=Object.prototype.hasOwnProperty,vt=Object.prototype.propertyIsEnumerable,St=(ae,Ne,Ce)=>Ne in ae?nt(ae,Ne,{enumerable:!0,configurable:!0,writable:!0,value:Ce}):ae[Ne]=Ce,Et=(ae,Ne)=>{for(var Ce in Ne||(Ne={}))gt.call(Ne,Ce)&&St(ae,Ce,Ne[Ce]);if(st)for(var Ce of st(Ne))vt.call(Ne,Ce)&&St(ae,Ce,Ne[Ce]);return ae},Tt=(ae,Ne)=>et(ae,ht(Ne)),Dt=(ae,Ne)=>{var Ce={};for(var we in ae)gt.call(ae,we)&&Ne.indexOf(we)<0&&(Ce[we]=ae[we]);if(ae!=null&&st)for(var we of st(ae))Ne.indexOf(we)<0&&vt.call(ae,we)&&(Ce[we]=ae[we]);return Ce};const Jt=ae=>{var Ne=ae,{value:Ce,onChange:we}=Ne,tn=Dt(Ne,["value","onChange"]);const _e=an=>{we([an])};return pt.createElement(Ee.Z,Tt(Et({},tn),{defaultValue:Ce==null?void 0:Ce[0],onChange:_e}))},Yt=ae=>{if(!ae)return!1;if(/^s*$/.test(ae)||ae.trim()===""){Ut.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C");return}let Ne=new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]");return ae==="|"?(Ut.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},Gt=({value:ae=[],onClose:Ne})=>pt.createElement(le.default,{closable:!0,onClose:Ne,className:Ae.Z.keywordTag},pt.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},ae.join(" \u6216 "))),me=({questionTitlePlaceholder:ae,form:Ne,showKeywords:Ce,isMustKeyWords:we=Ce})=>{const[tn,_e]=(0,pt.useState)(!1),[an,Ke]=(0,pt.useState)(""),oe=Me.default.useWatch("use_keywords",Ne),Xt=Me.default.useWatch("question_score",Ne);return pt.createElement("div",{className:Ae.Z.wrap},pt.createElement("div",{className:Ae.Z.questionTitleEditorWrap},pt.createElement(Me.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},pt.createElement(ie.h,{scrollId:"name",watch:!0,height:140,placeholder:ae}))),pt.createElement(Me.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:"answer_texts",labelCol:{span:24}},pt.createElement(Jt,{watch:!0,height:140,placeholder:"\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"})),Ce&&!we&&pt.createElement(Me.default.Item,{hidden:!0,name:"use_keywords",valuePropName:"checked"},pt.createElement(ue.Z,{defaultChecked:!0})),Ce&&we&&pt.createElement(It.Z,{align:"middle",className:"mb30"},pt.createElement(Me.default.Item,{name:"use_keywords",valuePropName:"checked"},pt.createElement(ue.Z,null)),pt.createElement(qt.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),pt.createElement(qt.Z,null,pt.createElement(ge.Z,{placement:"right",title:"\u9009\u4E2D\u540E\uFF0C\u9700\u8981\u8BBE\u7F6E\u6BCF\u4E2A\u5173\u952E\u8BCD\u7684\u5206\u503C\uFF0C\u7CFB\u7EDF\u4F1A\u6839\u636E\u8BBE\u7F6E\u7684\u5173\u952E\u8BCD\u8FDB\u884C\u81EA\u52A8\u5224\u5206\uFF1B \u6240\u6709\u5173\u952E\u8BCD\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u5C0F\u9898\u5206\u503C\u3002"},pt.createElement(Bt.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),(oe||!we)&&pt.createElement(Me.default.List,{name:"keywords",rules:[{validator(qe,_n){return we?_n!=null&&_n.length?(_n==null?void 0:_n.reduce((De,dn)=>De+dn.score,0))>parseFloat(Xt)?Promise.reject(new Error("\u6240\u6709\u5173\u952E\u8BCD\u7684\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u8BE5\u5C0F\u9898\u7684\u5206\u503C")):Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u5224\u5206\u5173\u952E\u8BCD")):Promise.resolve()}}]},(qe,{add:_n,remove:Pn})=>pt.createElement(pt.Fragment,null,pt.createElement("div",{className:`${Ae.Z.title} mb10`},we?"\u5173\u952E\u8BCD":pt.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),pt.createElement(It.Z,{align:"middle",className:"font14 mb30"},pt.createElement(qt.Z,{flex:1},pt.createElement(ne.default,{value:an,onChange:De=>{Ke(De.target.value)},maxLength:50,allowClear:!0,onPressEnter:De=>{var dn,sn,jn,Te;const Sn=`${(dn=De.target)==null?void 0:dn.value}`,ee=(jn=(sn=Sn==null?void 0:Sn.split("|"))==null?void 0:sn.filter(_t=>!!_t))==null?void 0:jn.map(_t=>_t==null?void 0:_t.trim()),Mn=Ne.getFieldValue("keywords"),ui=((Te=Mn==null?void 0:Mn.map(_t=>_t==null?void 0:_t.keyword))==null?void 0:Te.flat())||[];for(const _t of ee)if(ui.includes(_t)){Ut.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}Yt(Sn)&&(_n({keyword:ee,score:1}),Ke(""))},className:Ae.Z.inputBorder,placeholder:"\u652F\u6301\u8BBE\u7F6E\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u8BF7\u7528\u201C|\u201D\u5206\u9694\u5F00"})),pt.createElement(qt.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),qe.map(De=>{var dn=De,{key:sn,name:jn}=dn,Te=Dt(dn,["key","name"]);return pt.createElement(It.Z,{key:sn,className:"mb20",style:{marginRight:148}},pt.createElement(qt.Z,{flex:1},pt.createElement(It.Z,{align:"middle",justify:"space-between"},pt.createElement(Me.default.Item,Tt(Et({},Te),{name:[jn,"keyword"]}),pt.createElement(Gt,{onClose:()=>Pn(jn)})),we&&pt.createElement(Me.default.Item,Tt(Et({},Te),{name:[jn,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:Ae.Z.blankInputNumberWrapper}),pt.createElement(Rt.Z,{className:Ae.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),pt.createElement("div",{onClick:()=>_e(!0)},pt.createElement(Me.default.Item,{name:"analysis",label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},pt.createElement(ie.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:tn}))))}},41912:function(Dn,Gn,kt){"use strict";kt.d(Gn,{tc:function(){return Wi.t},uh:function(){return pt.u},rL:function(){return Si},u8:function(){return le.u},ZZ:function(){return Ut.Z},Wk:function(){return Me.W}});var pt=kt(44831),Ut=kt(69734),le=kt(61382),Me=kt(92778),ue=kt(59301),It=kt(8848),qt=kt(28284),ge=kt(77019),ne=kt(5269),Rt=kt(71051),Ae=kt(25399),ie=kt(75727),Ee=kt(64745),Bt=kt(12893),nt=kt(13878),et=kt(62957),ht=kt(37568),st=kt(71411),gt=kt(59301),vt=Object.defineProperty,St=Object.defineProperties,Et=Object.getOwnPropertyDescriptors,Tt=Object.getOwnPropertySymbols,Dt=Object.prototype.hasOwnProperty,Jt=Object.prototype.propertyIsEnumerable,Yt=(An,gn,Rn)=>gn in An?vt(An,gn,{enumerable:!0,configurable:!0,writable:!0,value:Rn}):An[gn]=Rn,Gt=(An,gn)=>{for(var Rn in gn||(gn={}))Dt.call(gn,Rn)&&Yt(An,Rn,gn[Rn]);if(Tt)for(var Rn of Tt(gn))Jt.call(gn,Rn)&&Yt(An,Rn,gn[Rn]);return An},me=(An,gn)=>St(An,Et(gn)),ae=(An,gn)=>{var Rn={};for(var si in An)Dt.call(An,si)&&gn.indexOf(si)<0&&(Rn[si]=An[si]);if(An!=null&&Tt)for(var si of Tt(An))gn.indexOf(si)<0&&Jt.call(An,si)&&(Rn[si]=An[si]);return Rn};const Ne=({value:An,onChange:gn})=>{const Rn=xi=>{et.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:Ee.Z.modal,onOk:()=>{const di=[...An];di.splice(xi,1),gn(di)}})},si=()=>{const xi=[...An];xi.push(""),gn(xi)};return gt.createElement(ge.Z,{className:"ml20"},gt.createElement(ne.Z,{flex:1},An==null?void 0:An.map((xi,di)=>gt.createElement(ge.Z,{key:`${xi}_${di}`,align:"middle",className:"mb20"},gt.createElement(ht.default.TextArea,{style:{flex:1,minHeight:44},defaultValue:xi,autoSize:{maxRows:3},maxLength:1e3,onBlur:Oi=>{const wt=[...An],yn=Oi.target.value.trim();wt[di]=yn,gn(wt)}}),gt.createElement(Ae.Z,{title:"\u5220\u9664"},gt.createElement(Bt.Z,{className:Ee.Z.deleteIcon,style:{marginLeft:15,visibility:di>0?"visible":"hidden"},onClick:()=>Rn(di)}))))),gt.createElement(ne.Z,null,gt.createElement("div",{className:`${Ee.Z.addBtn}`,onClick:()=>{si()}},"\u65B0\u589E\u7B54\u6848")))},Ce=({value:An=!0,onChange:gn})=>gt.createElement(st.Z,{checked:!An,onChange:Rn=>{gn(!Rn)}}),we="\u2581",tn=({questionTitlePlaceholder:An,form:gn,name:Rn,scoreByBlank:si=!1,answerKey:xi,titleKey:di="name",analysisKey:Oi="analysis",isOrdered:wt="is_ordered"})=>{var yn,Wn;const[ki,Ui]=(0,ue.useState)(!1),ur=(kn,Qn)=>{const $e=Qn.line;let On=0;for(let Pe=0;Pe<$e;Pe++)On+=kn.getLine(Pe).split(we).length-1;const Fe=kn.getLine($e).substring(0,Qn.ch);return On+=Fe.split(we).length-1,On},Mr=(kn,Qn,$e,On)=>{const Fe=kn.getRange(Qn.from,Qn.to);let Pe=0;if(Qn.text.forEach(Zn=>{Pe+=Zn.split(we).length-1}),Qn.origin!=="setValue"){if(Fe&&Fe.indexOf(we)!==-1){const Zn=Fe.split(we).length-1,$t=ur(kn,Qn.from);if(console.log(`\u5220\u9664${Zn}\u4E2A\uFF0C \u524D\u9762\u6709${$t}\u4E2A\uFF0C\u65B0\u589E${Pe}\u4E2A`),Zn>1){const Ze=Array.from({length:Zn},(wn,ri)=>$t+ri);On(Ze)}else On($t)}else if(Pe>0){const Zn=ur(kn,Qn.from);console.log(`\u65B0\u589E${Pe}\u4E2A\uFF0C\u4E4B\u524D\u6709${Zn}\u4E2A`),$e(Pe,Zn)}}},gi=()=>{const kn=gn.getFieldValue(["sub_item_banks",...xi]);gn.setFieldValue(["sub_item_banks",...xi],kn==null?void 0:kn.map((Qn,$e)=>me(Gt({},Qn),{position:$e+1})))},bn=(0,ue.useRef)(),pe=(kn,Qn)=>{for(let $e=0;$e<kn;$e++)bn.current({position:null,answer_text:[""]},Qn+$e);gi()},Se=(0,ue.useRef)(),ve=kn=>{Se.current(kn),gi()},zn=(Wn=(yn=gn.getFieldValue("sub_item_banks"))==null?void 0:yn[xi==null?void 0:xi[0]])==null?void 0:Wn[xi==null?void 0:xi[1]];return(0,ue.useEffect)(()=>{console.log("========",gn.getFieldsValue())},[gn]),gt.createElement("div",{className:Ee.Z.wrap},gt.createElement("div",{className:Ee.Z.questionTitleEditorWrap},gt.createElement(qt.default.Item,{label:"\u9898\u5E72",name:di,labelCol:{span:24},rules:[{required:!0}]},gt.createElement(nt.h,{scrollId:"name",watch:!0,height:140,placeholder:An,showNullButton:!0,onCMBeforeChange:(kn,Qn)=>{Mr(kn,Qn,pe,ve)}}))),gt.createElement(qt.default.List,{name:xi,rules:[{validator(kn,Qn){if((Qn==null?void 0:Qn.length)===0)return Promise.reject(new Error("\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879"));for(const $e of Qn){const{answer_text:On}=$e||{};if(On!=null&&On.some(Fe=>(Fe==null?void 0:Fe.length)===0))return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(kn,{add:Qn,remove:$e},{errors:On})=>(bn.current=Qn,Se.current=$e,gt.createElement(gt.Fragment,null,gt.createElement(qt.default.Item,{label:gt.createElement("span",null,"\u586B\u7A7A\u9879\u7B54\u6848",!(kn!=null&&kn.length)&&gt.createElement("span",{style:{color:"#E99237"}},"\uFF08\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879\uFF09")),required:!0,labelCol:{span:24}}),kn.map((Fe,Pe)=>{var Zn=Fe,{key:$t,name:Ze}=Zn,wn=ae(Zn,["key","name"]);return gt.createElement(ge.Z,{align:"top",key:$t},gt.createElement(ne.Z,{className:`${Ee.Z.blankIndex} pt5`},"\u586B\u7A7A\u9879",Pe+1),gt.createElement(ne.Z,{flex:1},gt.createElement(ge.Z,{align:"top",justify:"space-between"},gt.createElement(ne.Z,{flex:1},gt.createElement(qt.default.Item,me(Gt({},wn),{name:[Ze,"answer_text"],noStyle:!0}),gt.createElement(Ne,null))),si&&gt.createElement(ne.Z,{flex:"224px"},gt.createElement(qt.default.Item,me(Gt({},wn),{name:[Ze,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:Ee.Z.blankInputNumberWrapper}),gt.createElement(Rt.Z,{className:Ee.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u6309\u7A7A\u7ED9\u5206\u8BF7\u8F93\u5165\u5206\u503C"})))),gt.createElement(qt.default.Item,me(Gt({},wn),{name:[Ze,"position"],noStyle:!0}),gt.createElement(ht.default,{type:"hidden"}))))})))),gt.createElement(ge.Z,{align:"middle"},gt.createElement(qt.default.Item,{name:[Rn,"downcase"],valuePropName:"checked"},gt.createElement(st.Z,null)),gt.createElement(ne.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),gt.createElement(ge.Z,{align:"middle"},gt.createElement(qt.default.Item,{name:[Rn,"no_space"],valuePropName:"checked"},gt.createElement(st.Z,null)),gt.createElement(ne.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(zn==null?void 0:zn.length)>1&&gt.createElement(ge.Z,{align:"middle",className:(zn==null?void 0:zn.length)>1?"mb30":`${Ee.Z.hide}`},gt.createElement(qt.default.Item,{name:wt},gt.createElement(Ce,null)),gt.createElement(ne.Z,{className:"ml10"},"\u5141\u8BB8\u5B66\u751F\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u4E0E\u6807\u51C6\u7B54\u6848\u7684\u987A\u5E8F\u4E0D\u4E00\u81F4")),gt.createElement("div",{className:"mt30",onClick:()=>Ui(!0)},gt.createElement(qt.default.Item,{name:Oi,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},gt.createElement(nt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:ki}))))};var _e=kt(59301),an=Object.defineProperty,Ke=Object.defineProperties,oe=Object.getOwnPropertyDescriptors,Xt=Object.getOwnPropertySymbols,qe=Object.prototype.hasOwnProperty,_n=Object.prototype.propertyIsEnumerable,Pn=(An,gn,Rn)=>gn in An?an(An,gn,{enumerable:!0,configurable:!0,writable:!0,value:Rn}):An[gn]=Rn,De=(An,gn)=>{for(var Rn in gn||(gn={}))qe.call(gn,Rn)&&Pn(An,Rn,gn[Rn]);if(Xt)for(var Rn of Xt(gn))_n.call(gn,Rn)&&Pn(An,Rn,gn[Rn]);return An},dn=(An,gn)=>Ke(An,oe(gn)),sn=(An,gn)=>{var Rn={};for(var si in An)qe.call(An,si)&&gn.indexOf(si)<0&&(Rn[si]=An[si]);if(An!=null&&Xt)for(var si of Xt(An))gn.indexOf(si)<0&&_n.call(An,si)&&(Rn[si]=An[si]);return Rn};const jn={\u6B63\u786E:"T",\u9519\u8BEF:"F"},Te=({value:An,onChange:gn,form:Rn,choiceKey:si})=>{const xi=(An==null?void 0:An.is_answer)===1,di=An==null?void 0:An.choice_text,Oi=()=>{var wt;const yn=(wt=Rn==null?void 0:Rn.getFieldValue(["sub_item_banks",...si]))==null?void 0:wt.map(Wn=>({choice_text:Wn.choice_text,is_answer:0}));Rn==null||Rn.setFieldValue(["sub_item_banks",...si],yn),gn(dn(De({},An),{is_answer:1}))};return _e.createElement(ge.Z,{className:Ee.Z.choiceWrap,align:"middle",wrap:!1},_e.createElement(ne.Z,{onClick:Oi,className:`${Ee.Z.choiceIndex} ${Ee.Z.judgementIndex} ${xi?Ee.Z.activeAnswer:""}`},jn[di]),_e.createElement(ne.Z,{flex:1,className:`${Ee.Z.editorWrap} ml15`},_e.createElement("div",{className:`${Ee.Z.inputBorder} ${Ee.Z.placeholder} ${xi?Ee.Z.activeJudgementAnswer:""}`},di)),_e.createElement(ne.Z,{flex:"0 0 auto",className:"ml15"},_e.createElement("div",{onClick:Oi,className:`${Ee.Z.setAnswerBtn} ${xi?Ee.Z.activeAnswer:""}`},xi?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},Sn=({questionTitlePlaceholder:An,choiceKey:gn="choices",form:Rn,titleKey:si="name",analysisKey:xi="analysis"})=>{const[di,Oi]=(0,ue.useState)(!1);return _e.createElement("div",{className:Ee.Z.wrap},_e.createElement("div",{className:Ee.Z.questionTitleEditorWrap},_e.createElement(qt.default.Item,{label:"\u9898\u5E72",name:si,labelCol:{span:24},rules:[{required:!0}]},_e.createElement(nt.h,{scrollId:"name",watch:!0,height:140,placeholder:An}))),_e.createElement(qt.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},_e.createElement(qt.default.List,{name:gn,rules:[{validator(wt,yn){return yn.some(ki=>(ki==null?void 0:ki.is_answer)===1)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},wt=>_e.createElement("div",{id:"choices",style:{display:"flex",flexDirection:"column",gap:"20px"}},wt.map(yn=>{var Wn=yn,{key:ki,name:Ui}=Wn,ur=sn(Wn,["key","name"]);return _e.createElement(qt.default.Item,dn(De({},ur),{key:ki,name:Ui,noStyle:!0}),_e.createElement(Te,{form:Rn,choiceKey:gn}))})))),_e.createElement("div",{className:"mt30",onClick:()=>Oi(!0)},_e.createElement(qt.default.Item,{name:xi,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},_e.createElement(nt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:di}))))};var ee=kt(6767),Mn=kt(96599),ui=kt(19565),_t=kt(61485),Lt=Object.defineProperty,Pt=Object.defineProperties,Nt=Object.getOwnPropertyDescriptors,zt=Object.getOwnPropertySymbols,Mt=Object.prototype.hasOwnProperty,Kt=Object.prototype.propertyIsEnumerable,ye=(An,gn,Rn)=>gn in An?Lt(An,gn,{enumerable:!0,configurable:!0,writable:!0,value:Rn}):An[gn]=Rn,Ue=(An,gn)=>{for(var Rn in gn||(gn={}))Mt.call(gn,Rn)&&ye(An,Rn,gn[Rn]);if(zt)for(var Rn of zt(gn))Kt.call(gn,Rn)&&ye(An,Rn,gn[Rn]);return An},Qe=(An,gn)=>Pt(An,Nt(gn)),ce=(An,gn)=>{var Rn={};for(var si in An)Mt.call(An,si)&&gn.indexOf(si)<0&&(Rn[si]=An[si]);if(An!=null&&zt)for(var si of zt(An))gn.indexOf(si)<0&&Kt.call(An,si)&&(Rn[si]=An[si]);return Rn};const Oe=An=>{var gn=An,{value:Rn,onChange:si}=gn,xi=ce(gn,["value","onChange"]);const di=Oi=>{si([Oi])};return ue.createElement(ui.Z,Qe(Ue({},xi),{defaultValue:Rn==null?void 0:Rn[0],onChange:di}))},Le=An=>{if(!An)return!1;let gn=new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]");return An==="|"?(ee.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},Xe=({value:An=[],onClose:gn})=>ue.createElement(Mn.default,{closable:!0,onClose:gn,className:Ee.Z.keywordTag},ue.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},An.join(" \u6216 "))),vn=({questionTitlePlaceholder:An,form:gn,showKeywords:Rn,isMustKeyWords:si=Rn,titleKey:xi="name",analysisKey:di="analysis",answerTexts:Oi="answer_texts",keywords:wt="keywords",useKeywords:yn="use_keywords",indexs:Wn})=>{const[ki,Ui]=(0,ue.useState)(!1),[ur,Mr]=(0,ue.useState)(""),[gi,bn]=(0,ue.useState)(!1),pe=qt.default.useWatch("question_score",gn);return ue.createElement("div",{className:Ee.Z.wrap},ue.createElement("div",{className:Ee.Z.questionTitleEditorWrap},ue.createElement(qt.default.Item,{label:"\u9898\u5E72",name:xi,labelCol:{span:24},rules:[{required:!0}]},ue.createElement(nt.h,{scrollId:"name",watch:!0,height:140,placeholder:An}))),ue.createElement(qt.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:Oi,labelCol:{span:24}},ue.createElement(Oe,{watch:!0,height:140,placeholder:"\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"})),Rn&&!si&&ue.createElement(qt.default.Item,{hidden:!0,name:yn,valuePropName:"checked"},ue.createElement(st.Z,{defaultChecked:!0})),Rn&&si&&ue.createElement(ge.Z,{align:"middle",className:"mb30"},ue.createElement(qt.default.Item,{name:yn,valuePropName:"checked"},ue.createElement(st.Z,{onChange:()=>{var Se,ve,zn,kn,Qn,$e;console.log(gn.getFieldsValue()),bn((zn=(ve=(Se=gn.getFieldsValue())==null?void 0:Se.sub_item_banks)==null?void 0:ve[Wn])==null?void 0:zn.use_keywords),console.log(($e=(Qn=(kn=gn.getFieldsValue())==null?void 0:kn.sub_item_banks)==null?void 0:Qn[Wn])==null?void 0:$e.use_keywords),console.log(gi)}})),ue.createElement(ne.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),ue.createElement(ne.Z,null,ue.createElement(Ae.Z,{placement:"right",title:"\u9009\u4E2D\u540E\uFF0C\u9700\u8981\u8BBE\u7F6E\u6BCF\u4E2A\u5173\u952E\u8BCD\u7684\u5206\u503C\uFF0C\u7CFB\u7EDF\u4F1A\u6839\u636E\u8BBE\u7F6E\u7684\u5173\u952E\u8BCD\u8FDB\u884C\u81EA\u52A8\u5224\u5206\uFF1B \u6240\u6709\u5173\u952E\u8BCD\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u5C0F\u9898\u5206\u503C\u3002"},ue.createElement(_t.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),(gi||!si)&&ue.createElement(qt.default.List,{name:wt,rules:[{validator(Se,ve){return si?ve!=null&&ve.length?(ve==null?void 0:ve.reduce((kn,Qn)=>kn+Qn.score,0))>parseFloat(pe)?Promise.reject(new Error("\u6240\u6709\u5173\u952E\u8BCD\u7684\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u8BE5\u5C0F\u9898\u7684\u5206\u503C")):Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u5224\u5206\u5173\u952E\u8BCD")):Promise.resolve()}}]},(Se,{add:ve,remove:zn})=>ue.createElement(ue.Fragment,null,ue.createElement("div",{className:`${Ee.Z.title} mb10`},si?"\u5173\u952E\u8BCD":ue.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),ue.createElement(ge.Z,{align:"middle",className:"font14 mb30"},ue.createElement(ne.Z,{flex:1},ue.createElement(ht.default,{value:ur,onChange:kn=>{Mr(kn.target.value)},maxLength:50,allowClear:!0,onPressEnter:kn=>{var Qn,$e,On,Fe;const Pe=`${(Qn=kn.target)==null?void 0:Qn.value}`,Zn=(On=($e=Pe==null?void 0:Pe.split("|"))==null?void 0:$e.filter(wn=>!!wn))==null?void 0:On.map(wn=>wn==null?void 0:wn.trim()),$t=gn.getFieldValue(["sub_item_banks",...wt]),Ze=((Fe=$t==null?void 0:$t.map(wn=>wn==null?void 0:wn.keyword))==null?void 0:Fe.flat())||[];for(const wn of Zn)if(Ze.includes(wn)){ee.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}Le(Pe)&&(ve({keyword:Zn,score:1}),Mr(""))},className:Ee.Z.inputBorder,placeholder:"\u652F\u6301\u8BBE\u7F6E\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u8BF7\u7528\u201C|\u201D\u5206\u9694\u5F00"})),ue.createElement(ne.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),Se.map(kn=>{var Qn=kn,{key:$e,name:On}=Qn,Fe=ce(Qn,["key","name"]);return ue.createElement(ge.Z,{key:$e,className:"mb20",style:{marginRight:148}},ue.createElement(ne.Z,{flex:1},ue.createElement(ge.Z,{align:"middle",justify:"space-between"},ue.createElement(qt.default.Item,Qe(Ue({},Fe),{name:[On,"keyword"]}),ue.createElement(Xe,{onClose:()=>zn(On)})),si&&ue.createElement(qt.default.Item,Qe(Ue({},Fe),{name:[On,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:Ee.Z.blankInputNumberWrapper}),ue.createElement(Rt.Z,{className:Ee.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),ue.createElement("div",{onClick:()=>Ui(!0)},ue.createElement(qt.default.Item,{name:di,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},ue.createElement(nt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:ki}))))};var cn=kt(59301),hn=Object.defineProperty,Ti=Object.defineProperties,Ge=Object.getOwnPropertyDescriptors,Je=Object.getOwnPropertySymbols,rn=Object.prototype.hasOwnProperty,Xn=Object.prototype.propertyIsEnumerable,Ln=(An,gn,Rn)=>gn in An?hn(An,gn,{enumerable:!0,configurable:!0,writable:!0,value:Rn}):An[gn]=Rn,nn=(An,gn)=>{for(var Rn in gn||(gn={}))rn.call(gn,Rn)&&Ln(An,Rn,gn[Rn]);if(Je)for(var Rn of Je(gn))Xn.call(gn,Rn)&&Ln(An,Rn,gn[Rn]);return An},Kn=(An,gn)=>Ti(An,Ge(gn)),mi=(An,gn)=>{var Rn={};for(var si in An)rn.call(An,si)&&gn.indexOf(si)<0&&(Rn[si]=An[si]);if(An!=null&&Je)for(var si of Je(An))gn.indexOf(si)<0&&Xn.call(An,si)&&(Rn[si]=An[si]);return Rn};const{Panel:ei}=It.default,Si=({questionTitlePlaceholder:An,choiceKey:gn,form:Rn,withScore:si})=>{const[xi,di]=(0,ue.useState)([]),Oi=wt=>{di(wt)};return cn.createElement("div",{className:Ee.Z.wrap},cn.createElement("div",{className:Ee.Z.questionTitleEditorWrap},cn.createElement(qt.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},cn.createElement(nt.h,{scrollId:"name",watch:!0,height:140,placeholder:An}))),cn.createElement(qt.default.Item,{label:"\u5C0F\u9898",required:!0,labelCol:{span:24}}),cn.createElement(qt.default.List,{name:"sub_item_banks",rules:[{validator(wt,yn){return yn?Promise.resolve():Promise.reject(new Error("\u8BF7\u6DFB\u52A0\u5C0F\u9898"))}}]},(wt,{add:yn,remove:Wn,move:ki})=>{const Ui=Rn.getFieldValue("sub_item_banks");return cn.createElement(cn.Fragment,null,cn.createElement(It.default,{className:wt.length>0?Ee.Z.collapseWrapper:"",bordered:!1,activeKey:xi,onChange:Oi,expandIcon:({isActive:ur})=>cn.createElement("i",{className:`iconfont icon-weizhankai ${ur?Ee.Z.open:Ee.Z.close}`,style:{fontSize:14,transition:"all .2s"}})},wt.map((ur,Mr)=>{var gi=ur,{key:bn,name:pe}=gi,Se=mi(gi,["key","name"]),ve,zn,kn,Qn,$e,On,Fe,Pe,Zn,$t;return cn.createElement(ei,{className:Ee.Z.panel,forceRender:!0,header:cn.createElement("div",{className:Ee.Z.panelHeader},"\u7B2C",Mr+1,"\u5C0F\u9898",cn.createElement("span",null,"\uFF08",((ve=Ui==null?void 0:Ui[pe])==null?void 0:ve.item_type)=="SINGLE"?"\u5355\u9009\u9898":((zn=Ui==null?void 0:Ui[pe])==null?void 0:zn.item_type)=="MULTIPLE"?"\u591A\u9009\u9898":((kn=Ui==null?void 0:Ui[pe])==null?void 0:kn.item_type)=="COMPLETION"?"\u586B\u7A7A\u9898":((Qn=Ui==null?void 0:Ui[pe])==null?void 0:Qn.item_type)=="JUDGMENT"?"\u5224\u65AD\u9898":"\u7B80\u7B54\u9898","\uFF09")),key:pe,extra:cn.createElement(ge.Z,{align:"middle",onClick:Ze=>Ze.stopPropagation()},si&&cn.createElement(ne.Z,null,cn.createElement(qt.default.Item,Kn(nn({},Se),{rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5C0F\u9898\u5206\u503C"}],label:"\u5206\u503C",name:[pe,"question_score"],className:Ee.Z.blankInputNumberWrapper}),cn.createElement(Rt.Z,{className:Ee.Z.blankInput,placeholder:"\u8BF7\u8F93\u5165\u5F53\u524D\u5C0F\u9898\u5206\u6570",min:.1,precision:1,max:100,style:{width:150}}))),cn.createElement(ne.Z,null,cn.createElement(ge.Z,{align:"middle",className:"pl40",justify:"end"},Mr!==0&&cn.createElement("div",{onClick:()=>{var Ze;ki(Mr,Mr-1);const wn=(Ze=Rn.getFieldValue("sub_item_banks"))==null?void 0:Ze.map((ri,We)=>(wt.map((je,Vn)=>{We===Vn&&(ri.q_position=Number(je.name)+1)}),ri));Rn.setFieldValue("sub_item_banks",wn)}},cn.createElement(Ae.Z,{title:"\u4E0A\u79FB"},cn.createElement("i",{className:"iconfont icon-shangyi3 c-grey-999 primary-hover"}))),Mr<wt.length-1&&cn.createElement("div",{onClick:()=>{var Ze;ki(Mr,Mr+1);const wn=(Ze=Rn.getFieldValue("sub_item_banks"))==null?void 0:Ze.map((ri,We)=>(wt.map((je,Vn)=>{We===Vn&&(ri.q_position=Number(je.name)+1)}),ri));Rn.setFieldValue("sub_item_banks",wn)},className:Mr===0?"":"ml15"},cn.createElement(Ae.Z,{title:"\u4E0B\u79FB"},cn.createElement("i",{className:"iconfont icon-xiayi3 c-grey-999 primary-hover"}))))),cn.createElement(ne.Z,null,cn.createElement(Ae.Z,{title:"\u5220\u9664"},cn.createElement(Bt.Z,{className:`${Ee.Z.deleteIcon} ml15`,onClick:()=>Wn(pe)}))))},cn.createElement(qt.default.Item,Kn(nn({},Se),{name:pe}),((($e=Ui==null?void 0:Ui[pe])==null?void 0:$e.item_type)=="SINGLE"||((On=Ui==null?void 0:Ui[pe])==null?void 0:On.item_type)=="MULTIPLE")&&cn.createElement(pt.u,{questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9",allowChangeMode:((Fe=Ui==null?void 0:Ui[pe])==null?void 0:Fe.item_type)=="MULTIPLE",form:Rn,choiceKey:[pe,"choices"],titleKey:[pe,"name"],analysisKey:[pe,"analysis"],choiceOptionsPath:["sub_item_banks",pe,"choices"],choiceTextKey:"choice_text",answerKey:"is_answer"}),((Pe=Ui==null?void 0:Ui[pe])==null?void 0:Pe.item_type)=="COMPLETION"&&cn.createElement(tn,{form:Rn,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",scoreByBlank:!1,name:pe,titleKey:[pe,"name"],analysisKey:[pe,"analysis"],isOrdered:[pe,"is_ordered"],answerKey:[pe,"standard_answers"]}),((Zn=Ui==null?void 0:Ui[pe])==null?void 0:Zn.item_type)=="JUDGMENT"&&cn.createElement(Sn,{form:Rn,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",titleKey:[pe,"name"],analysisKey:[pe,"analysis"],choiceKey:[pe,"choices"]}),(($t=Ui==null?void 0:Ui[pe])==null?void 0:$t.item_type)=="SUBJECTIVE"&&cn.createElement(vn,{showKeywords:!0,isMustKeyWords:!1,form:Rn,titleKey:[pe,"name"],analysisKey:[pe,"analysis"],answerTexts:[pe,"answer_texts"],useKeywords:[pe,"use_keywords"],keywords:[pe,"keywords"],indexs:pe,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u7B80\u7B54\u9898\u9898\u5E72\u5185\u5BB9"})))})),wt.length<20&&cn.createElement(ie.Z,{menu:{items:[{label:cn.createElement("div",{onClick:()=>{yn({name:"",choices:Array.from({length:4},()=>({choice_text:"",is_answer:0})),analysis:"",item_type:"SINGLE"}),di([wt==null?void 0:wt.length,...xi])}},"\u5355\u9009\u9898"),key:"1",show:!0},{label:cn.createElement("div",{onClick:()=>{yn({name:"",choices:Array.from({length:4},()=>({choice_text:"",is_answer:0})),analysis:"",item_type:"MULTIPLE"}),di([wt==null?void 0:wt.length,...xi])}},"\u591A\u9009\u9898"),key:"2",show:!0},{label:cn.createElement("div",{onClick:()=>{yn({name:"",choices:[{choice_text:"\u6B63\u786E",is_answer:0},{choice_text:"\u9519\u8BEF",is_answer:0}],analysis:"",item_type:"JUDGMENT"}),di([wt==null?void 0:wt.length,...xi])}},"\u5224\u65AD\u9898"),key:"3",show:!0},{label:cn.createElement("div",{onClick:()=>{yn({name:"",analysis:"",is_ordered:!0,standard_answers:[],item_type:"COMPLETION",downcase:!0,no_space:!0}),di([wt==null?void 0:wt.length,...xi])}},"\u586B\u7A7A\u9898"),key:"4",show:!0},{label:cn.createElement("div",{onClick:()=>{yn({name:"",answer_texts:[],keywords:[],use_keywords:!0,analysis:"",item_type:"SUBJECTIVE"}),di([wt==null?void 0:wt.length,...xi])}},"\u7B80\u7B54\u9898"),key:"5",show:!0}].filter(ur=>ur.show).map(ur=>({label:ur.label,key:ur.key}))}},cn.createElement("div",{className:`${Ee.Z.addBtn}`},"\u6DFB\u52A0\u5C0F\u9898")))}))};var Wi=kt(74057)},79074:function(Dn,Gn,kt){"use strict";kt.d(Gn,{z:function(){return Dt},Z:function(){return Jt}});var pt=kt(59301),Ut=kt(53122),le=kt(49405),Me=kt(64018),ue=kt(79710),It=kt(12242),qt=kt(59895),ge=kt(15342),ne=kt(1012),Rt=kt(6311),Ae=kt(59301),Ee=({html:Yt})=>{const Gt=(0,pt.useRef)(null),me=(0,pt.useRef)(null),ae=`.markdown-body p {
margin: 0 0 16px 0 !important;
line-height: 28px;
white-space: pre-wrap;
}
ol,
ul,
li {
list-style-type: none
}
ol,
ul,
dl {
margin-bottom: 0px;
}
.markdown-body {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
color: #333;
overflow: hidden;
font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "\u534E\u6587\u7EC6\u9ED1", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "\u5B8B\u4F53", Heiti, "\u9ED1\u4F53", sans-serif;
word-break: break-word;
font-size: 16px;
line-height: 1.6;
white-space: normal;
word-wrap: break-word;
position: relative;
}
.markdown-body ul>li {
list-style-type: disc;
}
.markdown-body ol>li {
list-style-type: decimal;
}
.markdown-body a {
background: transparent;
}
.markdown-body a:active,
.markdown-body a:hover {
outline: 0;
}
.markdown-body strong {
font-weight: bold;
}
.markdown-body h1 {
font-size: 2em;
margin: 0.67em 0;
}
.markdown-body img {
border: 0;
}
.markdown-body hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
.markdown-body pre {
overflow: auto;
}
.markdown-body code,
.markdown-body kbd,
.markdown-body pre {
font-family: "Meiryo UI", "YaHei Consolas Hybrid", Consolas, "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace;
font-size: 1em;
}
.markdown-body input {
color: inherit;
font: inherit;
margin: 0;
}
.markdown-body html input[disabled] {
cursor: default;
}
.markdown-body input {
line-height: normal;
}
.markdown-body input[type="checkbox"] {
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 0;
}
.markdown-body table {
border-collapse: collapse;
border-spacing: 0;
}
.markdown-body td,
.markdown-body th {
padding: 0;
}
.markdown-body * {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.markdown-body input {
font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
}
.markdown-body a {
color: #4183c4;
text-decoration: none;
}
.markdown-body a:hover,
.markdown-body a:active {
text-decoration: underline;
}
.markdown-body hr {
height: 0;
margin: 15px 0;
overflow: hidden;
background: transparent;
border: 0;
border-bottom: 1px solid #ddd;
}
.markdown-body hr:before {
display: table;
content: "";
}
.markdown-body hr:after {
display: table;
clear: both;
content: "";
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
margin-top: 15px;
margin-bottom: 15px;
line-height: 1.1;
}
.markdown-body h1 {
font-size: 30px;
}
.markdown-body h2 {
font-size: 21px;
}
.markdown-body h3 {
font-size: 16px;
}
.markdown-body h4 {
font-size: 14px;
}
.markdown-body h5 {
font-size: 12px;
}
.markdown-body h6 {
font-size: 11px;
}
.markdown-body blockquote {
margin: 0;
}
.markdown-body ul,
.markdown-body ol {
padding: 0;
margin-top: 0;
margin-bottom: 0;
}
ul.linenums,
ol.linenums {
padding: 16px 0 0 36px !important;
}
.markdown-body ul,
.markdown-body ol {
padding-left: 2em;
}
.markdown-body ol ol,
.markdown-body ul ol {
list-style-type: lower-roman;
}
.markdown-body ul ul ol,
.markdown-body ul ol ol,
.markdown-body ol ul ol,
.markdown-body ol ol ol {
list-style-type: lower-alpha;
}
.markdown-body dd {
margin-left: 0;
}
.markdown-body code {
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-size: 12px;
}
.markdown-body pre {
margin-top: 0;
margin-bottom: 0;
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
.markdown-body .octicon {
font: normal normal 16px octicons-anchor;
line-height: 1;
display: inline-block;
text-decoration: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.markdown-body .octicon-link:before {
content: '\f05c';
}
.markdown-body>*:first-child {
margin-top: 0 !important;
}
.markdown-body>*:last-child {
margin-bottom: 0 !important;
}
.markdown-body .anchor {
position: absolute;
top: 0;
left: 0;
display: block;
padding-right: 6px;
padding-left: 30px;
margin-left: -30px;
}
.markdown-body .anchor:focus {
outline: none;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
position: relative;
margin-top: 1em;
margin-bottom: 16px;
font-weight: bold;
line-height: 1.4;
}
.markdown-body h1 .octicon-link,
.markdown-body h2 .octicon-link,
.markdown-body h3 .octicon-link,
.markdown-body h4 .octicon-link,
.markdown-body h5 .octicon-link,
.markdown-body h6 .octicon-link {
display: none;
color: #000;
vertical-align: middle;
}
.markdown-body h1:hover .anchor,
.markdown-body h2:hover .anchor,
.markdown-body h3:hover .anchor,
.markdown-body h4:hover .anchor,
.markdown-body h5:hover .anchor,
.markdown-body h6:hover .anchor {
padding-left: 8px;
margin-left: -30px;
text-decoration: none;
}
.markdown-body h1:hover .anchor .octicon-link,
.markdown-body h2:hover .anchor .octicon-link,
.markdown-body h3:hover .anchor .octicon-link,
.markdown-body h4:hover .anchor .octicon-link,
.markdown-body h5:hover .anchor .octicon-link,
.markdown-body h6:hover .anchor .octicon-link {
display: inline-block;
}
.markdown-body h1 {
padding-bottom: 0.3em;
font-size: 2.25em;
line-height: 1.2;
border-bottom: 1px solid #eee;
}
.markdown-body h1 .anchor {
line-height: 1;
}
.markdown-body h2 {
padding-bottom: 0.3em;
font-size: 1.75em;
line-height: 1.225;
border-bottom: 1px solid #eee;
}
.markdown-body h2 .anchor {
line-height: 1;
}
.markdown-body h3 {
font-size: 1.5em;
line-height: 1.43;
}
.markdown-body h3 .anchor {
line-height: 1.2;
}
.markdown-body h4 {
font-size: 1.25em;
}
.markdown-body h4 .anchor {
line-height: 1.2;
}
.markdown-body h5 {
font-size: 1em;
}
.markdown-body h5 .anchor {
line-height: 1.1;
}
.markdown-body h6 {
font-size: 1em;
color: #777;
}
.markdown-body h6 .anchor {
line-height: 1.1;
}
.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol,
.markdown-body dl,
.markdown-body table,
.markdown-body pre {
margin-top: 0;
margin-bottom: 16px;
}
.markdown-body ul ul,
.markdown-body ul ol,
.markdown-body ol ol,
.markdown-body ol ul {
margin-top: 0;
margin-bottom: 0;
}
.markdown-body li>p {
margin-top: 16px;
}
.markdown-body dl {
padding: 0;
}
.markdown-body dl dt {
padding: 0;
margin-top: 16px;
font-size: 1em;
font-style: italic;
font-weight: bold;
}
.markdown-body dl dd {
padding: 0 16px;
margin-bottom: 16px;
}
.markdown-body blockquote {
padding: 0 15px;
color: #777;
border-left: 4px solid #ddd;
}
.markdown-body blockquote> :first-child {
margin-top: 0;
}
.markdown-body blockquote> :last-child {
margin-bottom: 0;
}
.markdown-body table {
display: block;
width: 100%;
overflow: auto;
word-break: normal;
word-break: keep-all;
}
.markdown-body table th {
font-weight: bold;
text-align: revert;
}
.markdown-body table th,
.markdown-body table td {
padding: 6px 13px;
border: 1px solid #ddd;
}
.markdown-body table tr {
background-color: #fff;
border-top: 1px solid #ccc;
}
.markdown-body table tr:nth-child(2n) {
background-color: #f8f8f8;
}
.markdown-body img {
max-width: 100%;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.markdown-body code {
padding: 0;
padding-top: 0.2em;
padding-bottom: 0.2em;
margin: 0;
font-size: 85%;
background-color: rgba(0, 0, 0, 0.04);
border-radius: 3px;
}
.markdown-body code:has(.katex) {
background-color: transparent;
}
.markdown-body code:before,
.markdown-body code:after {
letter-spacing: -0.2em;
content: "\\00a0";
}
.markdown-body pre>code {
padding: 0;
margin: 0;
font-size: 100%;
word-break: normal;
white-space: pre;
background: transparent;
border: 0;
}
.markdown-body .highlight {
margin-bottom: 16px;
}
.markdown-body .highlight pre,
.markdown-body pre {
padding: 16px;
overflow: auto;
font-size: 85%;
line-height: 1.45;
background-color: #f7f7f7;
border-radius: 3px;
}
.markdown-body .highlight pre {
margin-bottom: 0;
word-break: normal;
}
.markdown-body pre {
word-wrap: normal;
}
.markdown-body pre code {
display: inline;
max-width: initial;
padding: 0;
margin: 0;
overflow: initial;
line-height: inherit;
word-wrap: normal;
background-color: transparent;
border: 0;
}
.markdown-body pre code:before,
.markdown-body pre code:after {
content: normal;
}
.markdown-body kbd {
display: inline-block;
padding: 3px 5px;
font-size: 11px;
line-height: 10px;
color: #555;
vertical-align: middle;
background-color: #fcfcfc;
border: solid 1px #ccc;
border-bottom-color: #bbb;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
}
.markdown-body .pl-c {
color: #969896;
}
.markdown-body .pl-c1,
.markdown-body .pl-mdh,
.markdown-body .pl-mm,
.markdown-body .pl-mp,
.markdown-body .pl-mr,
.markdown-body .pl-s1 .pl-v,
.markdown-body .pl-s3,
.markdown-body .pl-sc,
.markdown-body .pl-sv {
color: #0086b3;
}
.markdown-body .pl-e,
.markdown-body .pl-en {
color: #795da3;
}
.markdown-body .pl-s1 .pl-s2,
.markdown-body .pl-smi,
.markdown-body .pl-smp,
.markdown-body .pl-stj,
.markdown-body .pl-vo,
.markdown-body .pl-vpf {
color: #333;
}
.markdown-body .pl-ent {
color: #63a35c;
}
.markdown-body .pl-k,
.markdown-body .pl-s,
.markdown-body .pl-st {
color: #a71d5d;
}
.markdown-body .pl-pds,
.markdown-body .pl-s1,
.markdown-body .pl-s1 .pl-pse .pl-s2,
.markdown-body .pl-sr,
.markdown-body .pl-sr .pl-cce,
.markdown-body .pl-sr .pl-sra,
.markdown-body .pl-sr .pl-sre,
.markdown-body .pl-src {
color: #df5000;
}
.markdown-body .pl-mo,
.markdown-body .pl-v {
color: #1d3e81;
}
.markdown-body .pl-id {
color: #b52a1d;
}
.markdown-body .pl-ii {
background-color: #b52a1d;
color: #f8f8f8;
}
.markdown-body .pl-sr .pl-cce {
color: #63a35c;
font-weight: bold;
}
.markdown-body .pl-ml {
color: #693a17;
}
.markdown-body .pl-mh,
.markdown-body .pl-mh .pl-en,
.markdown-body .pl-ms {
color: #1d3e81;
font-weight: bold;
}
.markdown-body .pl-mq {
color: #008080;
}
.markdown-body .pl-mi {
color: #333;
font-style: italic;
}
.markdown-body .pl-mb {
color: #333;
font-weight: bold;
}
.markdown-body .pl-md,
.markdown-body .pl-mdhf {
background-color: #ffecec;
color: #bd2c00;
}
.markdown-body .pl-mdht,
.markdown-body .pl-mi1 {
background-color: #eaffea;
color: #55a532;
}
.markdown-body .pl-mdr {
color: #795da3;
font-weight: bold;
}
.markdown-body kbd {
display: inline-block;
padding: 3px 5px;
font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
line-height: 10px;
color: #555;
vertical-align: middle;
background-color: #fcfcfc;
border: solid 1px #ccc;
border-bottom-color: #bbb;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
}
.markdown-body .task-list-item {
list-style-type: none;
}
.markdown-body .task-list-item+.task-list-item {
margin-top: 3px;
}
.markdown-body .task-list-item input {
float: left;
margin: 0.3em 0 0.25em -1.6em;
vertical-align: middle;
}
.markdown-body :checked+.radio-label {
z-index: 1;
position: relative;
border-color: #4183c4;
}
/*! Pretty printing styles. Used with prettify.js. */
/* SPAN elements with the classes below are added by prettyprint. */
.pln {
color: #000
}
/* plain text */
@media screen {
.str {
color: #080
}
/* string content */
.kwd {
color: #008
}
/* a keyword */
.com {
color: #800
}
/* a comment */
.typ {
color: #606
}
/* a type name */
.lit {
color: #066
}
/* a literal value */
/* punctuation, lisp open bracket, lisp close bracket */
.pun,
.opn,
.clo {
color: #660
}
.tag {
color: #008
}
/* a markup tag name */
.atn {
color: #606
}
/* a markup attribute name */
.atv {
color: #080
}
/* a markup attribute value */
.dec,
.var {
color: #606
}
/* a declaration; a variable name */
.fun {
color: red
}
/* a function name */
}
/* Use higher contrast and text-weight for printable form. */
@media print,
projection {
.str {
color: #060
}
.kwd {
color: #006;
font-weight: bold
}
.com {
color: #600;
font-style: italic
}
.typ {
color: #404;
font-weight: bold
}
.lit {
color: #044
}
.pun,
.opn,
.clo {
color: #440
}
.tag {
color: #006;
font-weight: bold
}
.atn {
color: #404
}
.atv {
color: #060
}
}
/* Put a border around prettyprinted code snippets. */
pre.prettyprint {
padding: 2px;
/* border: 1px solid #888 */
}
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
margin-top: 0;
margin-bottom: 0
}
/* IE indents via margin-left */
li.L0,
li.L1,
li.L2,
li.L3,
li.L5,
li.L6,
li.L7,
li.L8 {
list-style-type: none
}
/* Alternate shading for lines */
li.L1,
li.L3,
li.L5,
li.L7,
li.L9 {
background: #eee
}
.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol,
.markdown-body dl,
.markdown-body table,
.markdown-body pre {
margin-top: 0;
margin-bottom: 16px;
}`;return(0,pt.useEffect)(()=>{const Ne=Gt.current.attachShadow({mode:"open"});me.current=document.createElement("div"),me.current.className="markdown-body",me.current.innerHTML=Yt,Ne.appendChild(me.current);const Ce=document.createElement("style");return Ce.textContent=ae,Ne.appendChild(Ce),()=>{Ne.innerHTML=""}},[]),(0,pt.useEffect)(()=>{me.current&&(me.current.innerHTML=Yt)},[Yt]),Ae.createElement("div",{ref:Gt})},Bt=Object.defineProperty,nt=Object.getOwnPropertySymbols,et=Object.prototype.hasOwnProperty,ht=Object.prototype.propertyIsEnumerable,st=(Yt,Gt,me)=>Gt in Yt?Bt(Yt,Gt,{enumerable:!0,configurable:!0,writable:!0,value:me}):Yt[Gt]=me,gt=(Yt,Gt)=>{for(var me in Gt||(Gt={}))et.call(Gt,me)&&st(Yt,me,Gt[me]);if(nt)for(var me of nt(Gt))ht.call(Gt,me)&&st(Yt,me,Gt[me]);return Yt};const vt="@\u2581\u2581@",St="@\u2581@",Et=/<pre[^>]*>/g;function Tt(Yt){let Gt=document.createElement("div");return Gt.innerHTML=Yt,Gt.childNodes.length===0?"":Gt.childNodes[0].nodeValue}const Dt=(Yt,Gt)=>{Yt=Yt||"";const me=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,ae=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Ne=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Ce=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return Gt?Yt.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(me,(we,tn,_e,an,Ke,oe,Xt)=>{const qe=tn||an||oe,_n=_e||Ke||Xt||"?";return It.Z.API_SERVER+"/api/attachments/"+qe+_n+"&t="+(0,qt.Jn)(qe,Date.now())+(we.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(Yt=Yt.replace(Ce,(we,tn,_e,an,Ke,oe,Xt)=>{const qe=tn||an||oe,_n=_e||Ke||Xt||"?";return It.Z.API_SERVER+"/attachments/download/"+qe+_n+"&t="+(0,qt.Jn)(qe,Date.now())+(we.indexOf(")")>-1?")":"&")}).replace(me,(we,tn,_e,an,Ke,oe,Xt)=>{const qe=tn||an||oe,_n=_e||Ke||Xt||"?";return It.Z.API_SERVER+"/api/attachments/"+qe+_n+"&t="+(0,qt.Jn)(qe,Date.now())+(we.indexOf(")")>-1?")":"&")}).replace(ae,(we,tn,_e,an,Ke)=>{const oe=tn||an,Xt=_e||Ke||"";return'"'+It.Z.API_SERVER+"/api/attachments/"+oe+Xt+oe+Xt+"&t="+(0,qt.Jn)(oe,Date.now())}).replace(Ne,(we,tn,_e,an,Ke)=>{const oe=tn||an,Xt=_e||Ke||"";return"("+It.Z.API_SERVER+"/files/uploads/"+oe+Xt+oe+Xt+"&t="+(0,qt.Jn)(oe,Date.now())}).replaceAll('src="(','src="').replaceAll("src='(",'src="').replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`),Yt)};var Jt=({value:Yt="",className:Gt,showTextOnly:me,showLines:ae,style:Ne={},stylesPrev:Ce={},highlightKeywords:we,showProgramFill:tn,isProgramFill:_e,disabledFill:an=!1,programFillValue:Ke,onFillChange:oe=_n=>{},onFillBlur:Xt=()=>{},onFillFocus:qe=()=>{}})=>{let _n=String(Yt);const[Pn,De]=(0,pt.useState)(""),[dn,sn]=(0,pt.useState)("office"),[jn,Te]=(0,pt.useState)([]),Sn=(0,pt.useRef)("a"+(0,ne.Z)()),ee={},Mn=(ce,Oe,Le)=>{const Xe=document.createElement(ce===St?"input":"textarea");Xe.style.width="100%",Xe.style.height=ce===St?"40px":"151px",Xe.rows=5,Xe.spellcheck=!1,Xe.name="edu-program-fill",Xe.placeholder="\u8BF7\u8F93\u5165",Xe.dataset.id=Oe;const vn=Object.keys(ee).length;return ee[vn]=Xe,`<span class="edu-program-fill-wrap ${ce===St?"":"show"}" style="width:${ce===St?"400px":"100%"}" title=${Le||""}><span>${Xe.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function ui(ce){return ce=ce.replace(/!\[.*?\]\(.*?\)/g,""),ce=ce.replace(/\[.*?\]\(.*?\)/g,""),ce=ce.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),ce=ce.replace(/<embed.*?>/g,""),ce=ce.replace(/<img.*?>/g,""),ce=ce.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),ce=ce.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),ce=ce.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),ce=ce.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),ce}const _t=ce=>ce.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(Oe,Le){let Xe=Le.replace(/(\n|\r)/g,"").split("}"),vn=[];return Xe.map(cn=>{cn!=""&&vn.push(`.${Sn.current} ${cn}`)}),`<style>${vn.join("}")}</style>`}),Lt=(0,pt.useMemo)(()=>{try{const Xe=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,vn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,cn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,hn=/\(\/attachments\/download\//g;_n=_n.replace(hn,"("+It.Z.API_SERVER+"/attachments/download/").replace(Xe,"("+It.Z.API_SERVER+"/api/attachments/").replace(vn,'"'+It.Z.API_SERVER+"/api/attachments/").replace(cn,'"'+It.Z.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(Xe){}if(tn){let Xe=-1;return _n=_n.replaceAll("<","&lt;").replaceAll(">","&gt;").replace(/(@▁▁@|@▁@)/g,function(vn,cn,hn){var Ti;return++Xe,Mn(vn,Xe,(Ti=Ke==null?void 0:Ke[Xe])==null?void 0:Ti.value.replaceAll("<","&lt;").replaceAll(">","&gt;"))}),`<pre style="background:#fff;padding:4px">${_t(_n||"")}</pre>`}let ce=_t(_n);ce=(0,le.ZP)(ce);const Oe=(0,le.ez)();_n.match(/\[TOC\]/)&&(ce=ce.replace("<p>[TOC]</p>",(0,le.Qv)()),(0,le.Iy)()),ce=ce.replace(/(__special_katext_id_\d+__)/g,(Xe,vn)=>{const{type:cn,expression:hn}=Oe[vn];return(0,ge.renderToString)(Tt(hn)||"",{displayMode:cn==="block",throwOnError:!1,output:"html"})}),ce=ce.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,le.AL)();const Le=document.createElement("div");if(Le.innerHTML=ce,me)return Le.innerText;if(we){const Xe=we.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return Mt(Le,Xe),Le.innerHTML}return setTimeout(()=>Ue(),500),Le.innerHTML},[_n,we]);(0,pt.useEffect)(()=>{Kt.current&&Kt.current.querySelectorAll(["input","textarea"]).forEach(Oe=>{Oe.oninput=Pt,Oe.onblur=Nt,Oe.onfocus=zt})},[jn]),(0,pt.useEffect)(()=>{var ce,Oe,Le,Xe,vn;if(Ke!=null&&Ke.length)try{const cn=Kt.current.querySelectorAll(".edu-program-fill-score"),hn=Kt.current.querySelectorAll('[name="edu-program-fill"]');for(const[Ti,Ge]of hn.entries())Ge.value=((ce=Ke==null?void 0:Ke[Ti])==null?void 0:ce.value)||"",((Oe=Ke==null?void 0:Ke[Ti])==null?void 0:Oe.type)==="warning"?Ge.className="program-fill-warning":((Le=Ke==null?void 0:Ke[Ti])==null?void 0:Le.type)==="success"?Ge.className="program-fill-success":Ge.className="";for(const[Ti,Ge]of cn.entries())Ge.innerHTML=(Xe=Ke==null?void 0:Ke[Ti])!=null&&Xe.score?`${(vn=Ke==null?void 0:Ke[Ti])==null?void 0:vn.score}\u5206`:"";Te(Ke)}catch(cn){console.log(cn,"error")}},[Ke]);const Pt=ce=>{jn[ce.target.dataset.id]=jn[ce.target.dataset.id]||{},jn[ce.target.dataset.id].value=ce.target.value,Te([...jn]),oe(jn,ce.target.dataset.id)},Nt=ce=>{jn[ce.target.dataset.id]=jn[ce.target.dataset.id]||{},jn[ce.target.dataset.id].value=ce.target.value,Te([...jn]),Xt(jn,ce.target.dataset.id)},zt=ce=>{jn[ce.target.dataset.id]=jn[ce.target.dataset.id]||{},jn[ce.target.dataset.id].value=ce.target.value,Te([...jn]),qe(jn,ce.target.dataset.id)};function Mt(ce,Oe){return ce.childNodes.forEach(Le=>{var Xe;if(Le.childNodes.length>0)Mt(Le,Oe);else if(Le.nodeName!=="IMG")if(Le.innerHTML)Le.innerHTML=(Xe=Le.innerHTML)==null?void 0:Xe.replace(new RegExp(Oe,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const vn=document.createElement("span");vn.innerHTML=Le.textContent.replace(new RegExp(Oe,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),Le.replaceWith(vn)}})}const Kt=(0,pt.useRef)();le.jb.WebkitLineClamp=ae,ae&&(Ne=gt(gt({},Ne),le.jb));function ye(ce){let Oe=ce.target;if(Oe.tagName.toUpperCase()==="A"){let Le=Oe.getAttribute("href");if(Le.indexOf("office")>-1)ce.preventDefault(),De(Le),sn("office");else if(Le.indexOf("application/pdf")>-1)ce.preventDefault(),De(Le),sn("pdf");else if(Le.indexOf("text/html")>-1)ce.preventDefault(),De(Le),sn("html");else if(Le.startsWith("#")){ce.preventDefault();let Xe=document.getElementById(Le.replace("#",""));Xe&&Xe.scrollIntoView(!0)}}}const Ue=()=>{var ce;const Oe=(ce=Kt.current)==null?void 0:ce.querySelectorAll("video");Oe==null||Oe.forEach(Le=>{if(Le.oncontextmenu=()=>!1,Le.src.indexOf(".m3u8")>-1&&!Le.canPlayType("application/vnd.apple.mpegurl")){if(ue.ZP.isSupported()){var Xe=new ue.ZP;Xe.loadSource(Le.src),Xe.attachMedia(Le)}}})};(0,pt.useEffect)(()=>{if(Kt.current&&Lt&&Lt.match(Et)&&window.PR.prettyPrint(),Kt.current)return Kt.current.addEventListener("click",ye),()=>{var ce;(ce=Kt.current)==null||ce.removeEventListener("click",ye),(0,le.AL)(),(0,le.Iy)()}},[Lt,Kt.current,ye]),(0,pt.useEffect)(()=>{var ce;const Oe=Le=>{Le.preventDefault(),Le.clipboardData.setData("text",window.getSelection().toString())};return(ce=Kt.current)==null||ce.addEventListener("copy",Oe),()=>{var Le;(Le=Kt.current)==null||Le.removeEventListener("copy",Oe)}},[Kt.current]);const Qe=ce=>/<style[\s\S]*?>/i.test(ce||"");return pt.createElement(pt.Fragment,null,me&&pt.createElement("div",{ref:Kt},Lt),!me&&!Qe(Lt)&&pt.createElement("div",{ref:Kt,style:gt({},Ne),className:`${Gt||""} ${an?"disabled-fill":""} markdown-body ${Sn.current}`,dangerouslySetInnerHTML:{__html:Lt}}),!me&&Qe(Lt)&&pt.createElement(Ee,{html:Lt}),pt.createElement(Rt.Z,{close:!0,data:Pn,type:Pn!=null&&Pn.length?dn:"",style:gt({},Ce),onClose:()=>De("")}))}},1464:function(Dn,Gn,kt){"use strict";kt.d(Gn,{C:function(){return tn}});var pt=kt(59301),Ut={recalculation:"recalculation____i9AE",tips:"tips___GoMu8",filter:"filter___Vx7VO",input:"input___OEMMv",operating:"operating___TS9iA",operatingItem:"operatingItem___AT84q"},le=kt(92310),Me=kt.n(le),ue=kt(62673),It=kt(77019),qt=kt(6767),ge=kt(25399),ne=kt(99571),Rt=kt(62957),Ae=kt(54172),ie=kt(71051),Ee=kt(28284),Bt=kt(29787),nt=kt(59895),et=kt(24092),ht=kt(69669),st=kt(39062),gt=kt(46133),vt=Object.defineProperty,St=Object.defineProperties,Et=Object.getOwnPropertyDescriptors,Tt=Object.getOwnPropertySymbols,Dt=Object.prototype.hasOwnProperty,Jt=Object.prototype.propertyIsEnumerable,Yt=(_e,an,Ke)=>an in _e?vt(_e,an,{enumerable:!0,configurable:!0,writable:!0,value:Ke}):_e[an]=Ke,Gt=(_e,an)=>{for(var Ke in an||(an={}))Dt.call(an,Ke)&&Yt(_e,Ke,an[Ke]);if(Tt)for(var Ke of Tt(an))Jt.call(an,Ke)&&Yt(_e,Ke,an[Ke]);return _e},me=(_e,an)=>St(_e,Et(an)),ae=(_e,an,Ke)=>new Promise((oe,Xt)=>{var qe=De=>{try{Pn(Ke.next(De))}catch(dn){Xt(dn)}},_n=De=>{try{Pn(Ke.throw(De))}catch(dn){Xt(dn)}},Pn=De=>De.done?oe(De.value):Promise.resolve(De.value).then(qe,_n);Pn((Ke=Ke.apply(_e,an)).next())});const Ne=ue.default.Group,Ce=({className:_e,title:an,items:Ke=[],value:oe,onChange:Xt})=>{const qe=(Ke==null?void 0:Ke.length)===(oe==null?void 0:oe.length),_n=(oe==null?void 0:oe.length)>0&&(oe==null?void 0:oe.length)<(Ke==null?void 0:Ke.length),Pn=De=>{const dn=Ke.map(sn=>sn.id);Xt(De.target.checked?dn:[])};return pt.createElement(It.Z,{align:"middle",className:_e},!!an&&pt.createElement("div",{className:"mr20",style:{color:"#5F6368"}},an),pt.createElement(ue.default,{indeterminate:_n,onChange:Pn,checked:qe},"\u5168\u90E8"),pt.createElement(Ne,{value:oe,onChange:Xt},Ke.map(De=>pt.createElement(ue.default,{className:"ml30 c-black",key:De.id,value:De.id},De.name,pt.createElement("span",null,`(${De.count})`)))))};var tn=({className:_e,style:an,dataSource:Ke})=>{var oe,Xt,qe,_n,Pn,De,dn;const[sn,jn]=(0,pt.useState)({}),[Te,Sn]=(0,pt.useState)(!0),[ee,Mn]=(0,pt.useState)(!1),[ui,_t]=(0,pt.useState)(!1),[Lt,Pt]=(0,pt.useState)(null),[Nt,zt]=(0,pt.useState)(0),[Mt,Kt]=(0,pt.useState)({}),[ye,Ue]=(0,pt.useState)(!0),[Qe,ce]=(0,pt.useState)(0),[Oe,Le]=(0,pt.useState)(0),[Xe,vn]=(0,pt.useState)(!1),cn=(0,pt.useRef)(null),[hn,Ti]=(0,pt.useState)(!1),[Ge,Je]=(0,pt.useState)(!0),[rn,Xn]=(0,pt.useState)([]),Ln={page:1,per_page:5,keyword:"",review:[],question_status:[],success_status:[],sort_by:null,direction:null},[nn,Kn]=(0,pt.useState)(Gt({},Ln));(0,pt.useEffect)(()=>{Ke!=null&&Ke.question_id&&jn(Ke)},[Ke==null?void 0:Ke.question_id]),(0,pt.useEffect)(()=>{var yn;if(((yn=sn==null?void 0:sn.exercise_question_resubmit)==null?void 0:yn.status)==="running"){const Wn=setInterval(()=>{Si()},3e3);return()=>clearInterval(Wn)}},[(oe=sn==null?void 0:sn.exercise_question_resubmit)==null?void 0:oe.status]),(0,pt.useEffect)(()=>{var yn;ui&&(ui===1&&(nn.question_status=Wi.map(Wn=>Wn.value),nn.review=An.map(Wn=>Wn.value)),ui===2&&(nn.exercise_question_resubmit_id=(yn=sn==null?void 0:sn.exercise_question_resubmit)==null?void 0:yn.id,Lt===1&&(nn.success_status=[1]),Lt===2&&(nn.success_status=[0])),Kn(Gt({},nn)),mi(nn),Le(sn!=null&&sn.is_mirror?3:10),ce(sn!=null&&sn.is_mirror?1:5))},[ui]),(0,pt.useEffect)(()=>{hn&&ei()},[hn]);const mi=yn=>ae(void 0,null,function*(){Sn(!0);const Wn=yield(0,et.ZP)(`/api/exercise_questions/${sn==null?void 0:sn.question_id}/resubmit_student_list.json`,{method:"get",params:yn});(Wn==null?void 0:Wn.status)==0&&(Kt(Wn||[]),zt(Wn==null?void 0:Wn.count)),Sn(!1)}),ei=()=>ae(void 0,null,function*(){Je(!0);const yn=yield(0,et.ZP)(`/api/exercise_questions/${sn==null?void 0:sn.question_id}/resubmit_history.json`,{method:"get"});(yn==null?void 0:yn.status)==0&&Xn((yn==null?void 0:yn.data)||[]),Je(!1)}),Si=()=>ae(void 0,null,function*(){const yn=yield(0,et.ZP)(`/api/exercise_questions/${sn==null?void 0:sn.question_id}/resubmit_status.json`,{method:"get"});(yn==null?void 0:yn.status)==0&&jn(me(Gt({},sn),{show_resubmit_history:!0,exercise_question_resubmit:(yn==null?void 0:yn.data)||{}}))}),Wi=[{label:"\u672A\u8BC4\u6D4B",value:2,color:"#9096A3"},{label:"\u672A\u901A\u5173",value:0,color:"#E30000"},{label:"\u5DF2\u901A\u5173",value:1,color:"#00B187"}],An=[{label:"\u672A\u8BC4\u9605",value:0,color:"#9096A3"},{label:"\u8BC4\u9605\u4E2D",value:2,color:"#FF9D18"},{label:"\u5DF2\u8BC4\u9605",value:1,color:"#3061D0"}],gn=[{label:"\u6210\u529F",value:1,color:"#00B187"},{label:"\u5931\u8D25",value:0,color:"#E30000"}],Rn=[{title:"\u5E8F\u53F7",dataIndex:"key",render:(yn,Wn,ki)=>pt.createElement("span",{className:"c-black"},ki+1+(nn.page-1)*nn.per_page)},{title:"\u59D3\u540D",dataIndex:"user_name",render:yn=>pt.createElement("span",{className:"c-black"},yn)},{title:"\u5B66\u53F7",dataIndex:"student_id",sorter:!0,render:yn=>pt.createElement("span",{className:"c-grey-666"},yn||"--")},{title:"\u5206\u73ED",dataIndex:"group_name",render:yn=>pt.createElement("span",{className:"c-black"},yn)},{title:"\u9898\u76EE\u72B6\u6001",dataIndex:"question_status",render:yn=>{const{label:Wn,color:ki}=Wi.find(Ui=>Ui.value===yn)||{};return pt.createElement("span",{style:{color:ki}},Wn)}},{title:"\u9898\u76EE\u5F97\u5206",dataIndex:"question_score",sorter:!0,render:yn=>pt.createElement("span",{className:"c-black"},yn)},{title:"\u6700\u7EC8\u6210\u7EE9",dataIndex:"score",sorter:!0,render:yn=>pt.createElement("span",{className:"c-black"},yn)},{title:"\u8BC4\u9605\u72B6\u6001",dataIndex:"review",render:yn=>{const{label:Wn,color:ki}=An.find(Ui=>Ui.value===yn)||{};return pt.createElement("span",{style:{color:ki}},Wn)}},ui===2&&{title:"\u91CD\u65B0\u8BC4\u6D4B\u7ED3\u679C",dataIndex:"success_status",render:yn=>{const{label:Wn,color:ki}=gn.find(Ui=>Ui.value===yn)||{};return pt.createElement("span",{style:{color:ki}},Wn)}}].filter(Boolean),si=(yn,Wn,ki)=>{nn.page=yn==null?void 0:yn.current,nn.per_page=yn==null?void 0:yn.pageSize,ki!=null&&ki.order?(nn.sort_by=ki==null?void 0:ki.field,nn.direction=(ki==null?void 0:ki.order)==="ascend"?"asc":"desc"):(nn.sort_by=null,nn.direction=null),Kn(Gt({},nn)),mi(nn)},xi=()=>{if(!Qe){qt.ZP.warning("\u8BF7\u8F93\u5165\u91CD\u65B0\u8BC4\u6D4B\u4EFB\u52A1\u5E76\u53D1\u4EBA\u6570");return}vn(!0)},di=()=>ae(void 0,null,function*(){var yn,Wn;if((yn=cn.current)!=null&&yn.onVerify())return;Mn(!0);const ki=yield(0,et.ZP)(`/api/exercise_questions/${sn==null?void 0:sn.question_id}/resubmit.json`,{method:"post",body:{keyword:nn.keyword,question_status:nn.question_status,review:nn.review_status,success_status:nn.success_status,use_max_score:ye,permits:Qe,exercise_question_resubmit_id:ui===1?null:(Wn=sn==null?void 0:sn.exercise_question_resubmit)==null?void 0:Wn.id}});(ki==null?void 0:ki.status)==0&&(yield Si(),qt.ZP.success("\u64CD\u4F5C\u6210\u529F"),vn(!1),_t(!1)),Mn(!1)}),Oi=(yn,Wn)=>{nn.page=1,nn[Wn]=yn,Kn(Gt({},nn)),mi(nn)},wt=["","\u5F53\u524D\u9898\u76EE\u7684\u5B9E\u9A8C\u8D44\u6E90\u4E3A\u4E13\u6709\u4E91\uFF0C\u4E0D\u652F\u6301\u91CD\u65B0\u8BC4\u6D4B~","\u8BE5\u529F\u80FD\u4EC5\u8BFE\u5802\u7BA1\u7406\u5458\u548C\u8003\u8BD5\u7684\u521B\u5EFA\u8005\u53EF\u4EE5\u64CD\u4F5C~"];return pt.createElement(pt.Fragment,null,pt.createElement("div",{className:Me()(Ut.recalculation,_e),style:an},pt.createElement(ge.Z,{title:wt[(sn==null?void 0:sn.disable_resubmit_reason)||0]},pt.createElement(ne.ZP,{disabled:(sn==null?void 0:sn.disable_resubmit)||((Xt=sn==null?void 0:sn.exercise_question_resubmit)==null?void 0:Xt.status)==="running",onClick:()=>_t(1),icon:pt.createElement("i",{className:"iconfont icon-zhongxinpingce font14"}),type:"primary",ghost:!0},"\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206")),(sn==null?void 0:sn.show_resubmit_history)&&pt.createElement(pt.Fragment,null,((qe=sn==null?void 0:sn.exercise_question_resubmit)==null?void 0:qe.status)==="running"?pt.createElement("div",{className:"c-grey-666"},"\u91CD\u65B0\u8BC4\u6D4B\u4E2D\uFF0C\u5F53\u524D\u8FDB\u5EA6",pt.createElement("span",{className:"c-light-primary ml3"},(_n=sn==null?void 0:sn.exercise_question_resubmit)==null?void 0:_n.rate)):pt.createElement("div",{className:"c-grey-666"},"\u91CD\u65B0\u8BC4\u6D4B\u6210\u529F",pt.createElement("span",{onClick:()=>{_t(2),Pt(1)},className:"current",style:{color:"#3061D0",textDecoration:"underline",margin:"0 3px"}},(Pn=sn==null?void 0:sn.exercise_question_resubmit)==null?void 0:Pn.success_student_count),"\u4EBA\uFF0C\u5931\u8D25",pt.createElement("span",{onClick:()=>{_t(2),Pt(2)},className:"current",style:{color:"#E30000",textDecoration:"underline",margin:"0 3px"}},(De=sn==null?void 0:sn.exercise_question_resubmit)==null?void 0:De.fail_count),"\u4EBA"),pt.createElement(ge.Z,{title:"\u64CD\u4F5C\u8BB0\u5F55"},pt.createElement("i",{onClick:()=>Ti(!0),className:"iconfont icon-chakanshenqingjilu c-light-primary current font14"})))),pt.createElement(Rt.default,{centered:!0,open:!!ui,title:`\u91CD\u65B0\u8BC4\u6D4B${ui===1?"\u7B97\u5206":"\u7ED3\u679C"}`,width:870,okText:"\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206",onCancel:()=>_t(!1),onOk:xi,afterClose:()=>{Ue(!0),Pt(null),Kn(Gt({},Ln))}},pt.createElement("div",{className:Ut.filter},ui===1&&pt.createElement(pt.Fragment,null,pt.createElement("div",{className:Ut.tips},pt.createElement("div",{className:"mb5",style:{color:"#FF9D18"}},pt.createElement("i",{className:"iconfont icon-tishi9 mr10 font14"}),"\u6E29\u99A8\u63D0\u793A"),pt.createElement("div",null,"1.\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206\u6D41\u7A0B\uFF1A \u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6\u5B66\u751F\u5728\u8003\u8BD5\u9875\u9762\u4FDD\u5B58\u7684\u6700\u65B0\u4EE3\u7801\uFF0C\u5E76\u8FDB\u884C\u91CD\u65B0\u8BC4\u6D4B\uFF0C\u4ECE\u800C\u7CBE\u51C6\u8BA1\u7B97\u51FA\u5B66\u751F\u7684\u6700\u7EC8\u5F97\u5206\uFF1B"),pt.createElement("div",{style:{margin:"2px 0"}},"2.\u91CD\u65B0\u8BC4\u6D4B\u6761\u4EF6\uFF1A \u8003\u8BD5\u7ED3\u675F\u540E\uFF0C\u4EC5\u5BF9\u5DF2\u63D0\u4EA4\u8BD5\u5377\u4E14\u5DF2\u4F5C\u7B54\u8BE5\u9898\u76EE\u7684\u5B66\u751F\u8FDB\u884C\u91CD\u65B0\u8BC4\u6D4B\u4E0E\u7B97\u5206\uFF1B"),pt.createElement("div",null,"3.\u91CD\u65B0\u8BC4\u6D4B\u65F6\uFF0C\u8BF7\u786E\u4FDD\u5B9E\u9A8C\u73AF\u5883\u80FD\u6B63\u5E38\u542F\u52A8\u5E76\u53EF\u8FD0\u884C\u8BC4\u6D4B\u3002")),pt.createElement(Ce,{className:"mt10",title:"\u9898\u76EE\u72B6\u6001",items:(Mt==null?void 0:Mt.question_status)||[],value:nn.question_status,onChange:yn=>Oi(yn,"question_status")}),pt.createElement(Ce,{className:"mt10",title:"\u8BC4\u9605\u72B6\u6001",items:(Mt==null?void 0:Mt.review_status)||[],value:nn.review,onChange:yn=>Oi(yn,"review")})),ui===2&&pt.createElement(pt.Fragment,null,pt.createElement(Ce,{className:"mt10",title:"\u91CD\u65B0\u8BC4\u6D4B\u7ED3\u679C",items:(Mt==null?void 0:Mt.success_status)||[],value:nn.success_status,onChange:yn=>Oi(yn,"success_status")})),pt.createElement(gt.t7,{className:Ut.input,style:{bottom:ui===1?10:-5},value:nn.keyword,onChange:yn=>Oi(yn,"keyword"),placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22"})),pt.createElement(Ae.default,{className:"mt20",columns:Rn,scroll:((dn=Mt==null?void 0:Mt.data)==null?void 0:dn.length)>7?{y:300}:{},dataSource:(Mt==null?void 0:Mt.data)||[],loading:Te,onChange:si,pagination:{total:Nt,pageSize:nn.per_page,current:nn.page,hideOnSinglePage:!Nt,showSizeChanger:!0,pageSizeOptions:["5","10","20","50","100"],showQuickJumper:!0,size:"default",showTotal:nt.rU}}),pt.createElement(It.Z,{justify:"space-between",align:"middle",className:"mt10"},pt.createElement(ue.default,{className:"c-black",checked:ye,onChange:yn=>Ue(yn.target.checked)},"\u91CD\u65B0\u8BC4\u6D4B\u540E\u7684\u5206\u6570\u5927\u4E8E\u539F\u6765\u7684\u5206\u6570\u624D\u66F4\u65B0\u6210\u7EE9"),(0,ht.Ny)()&&pt.createElement("div",{className:"c-black"},"\u91CD\u65B0\u8BC4\u6D4B\u4EFB\u52A1\u5E76\u53D1\u4EBA\u6570",pt.createElement(ie.Z,{className:"ml10 mr10",value:Qe,max:Oe,min:1,precision:0,onChange:yn=>ce(yn)}),"\u4EBA",pt.createElement(ge.Z,{overlayStyle:{maxWidth:450},title:"\u91CD\u65B0\u8BC4\u6D4B\u4EFB\u52A1\u7684\u6700\u5927\u5E76\u53D1\u4EBA\u6570\u4E3A20\u4EBA\uFF08\u81EA\u5B9A\u4E49\u955C\u50CF\u7684\u6700\u5927\u5E76\u53D1\u4EBA\u6570\u4E3A3\u4EBA\uFF09\u3002"},pt.createElement("i",{style:{color:"#9096A3"},className:"iconfont icon-tishi5 font13 ml10"}))))),pt.createElement(Rt.default,{centered:!0,title:"\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206",open:Xe,width:494,zIndex:1001,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:ee,destroyOnClose:!0,onOk:di,onCancel:()=>vn(!1)},pt.createElement(Ee.default.Item,{className:"mb0",colon:!1,label:"\u9A8C\u8BC1\u7801",name:"code",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801"}]},pt.createElement(st.Z,{ref:yn=>cn.current=yn}))),pt.createElement(Rt.default,{centered:!0,title:"\u64CD\u4F5C\u8BB0\u5F55",open:hn,width:710,onCancel:()=>Ti(!1),footer:null},pt.createElement(Bt.Z,{spinning:Ge},pt.createElement("div",{className:Ut.operating},rn.map((yn,Wn)=>pt.createElement("div",{key:Wn,className:Ut.operatingItem},pt.createElement("div",{style:{flex:"0 0 180px"},className:"c-grey-666"},yn==null?void 0:yn.created_at),pt.createElement("div",{className:"c-black"},yn==null?void 0:yn.user_name,"\u64CD\u4F5C\u4E86\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206"),(yn==null?void 0:yn.status)==="running"?pt.createElement("div",{className:"c-black"},"\u91CD\u65B0\u8BC4\u6D4B\u4E2D\uFF0C\u5F53\u524D\u8FDB\u5EA6",pt.createElement("span",{className:"c-light-primary ml3"},yn==null?void 0:yn.rate)):pt.createElement("div",{className:"c-black"},"\u91CD\u65B0\u8BC4\u6D4B\u6210\u529F",pt.createElement("span",{style:{color:"#3061D0",margin:"0 3px"}},yn==null?void 0:yn.success_student_count),"\u4EBA\uFF0C\u5931\u8D25",pt.createElement("span",{style:{color:"#E30000",margin:"0 3px"}},yn==null?void 0:yn.fail_count),"\u4EBA")))),pt.createElement("div",{style:{height:20}}))))}},91652:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Z:function(){return ge}});var pt=kt(59301),Ut={flex_box_center:"flex_box_center___rQJfc",flex_space_between:"flex_space_between___MDW24",flex_box_vertical_center:"flex_box_vertical_center___RZbAv",flex_box_center_end:"flex_box_center_end___ILhJA",flex_box_column:"flex_box_column___Fmij7",orangeColor:"orangeColor___U5vU6",redColor:"redColor___qYa6X",statustitle:"statustitle___pTBLm",statusbody:"statusbody___qUPQx",flex:"flex___VtL45"},le=kt(62957),Me="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAPCAYAAADUFP50AAAAAXNSR0IArs4c6QAAAUFJREFUOE+V0ktKw1AUxvH/rVqIxT4wkgwEUSmK4APRBfiYCKU7cOZEBOkadAMZiwhuwJETBQciFRTtwJkPBLW2BRGrRanU9kpN2sSYiGaWc/PjuznnCN2Qh8AkPo+AzXxKLLiPhW7ICtDqB4GzQkqM/huGFZgZcDCBBDaaicsTMKbZH2xfwdY5/ICAEGSasC0AwRYblj+gKkENwfy4WS9V4LHsgsk49EZteJKHdBa6w7AybdZzr3D64ILxGKjtNrx9gfsSRBSYtf6xZh1/u+qQClrIhtdFuHmGvhisJcz65RPsZl2Jc/3QE7FhpgDHuT80x2+O9cR1K/GiCDt3rkQ/+Ns43gDFD0YVmHIuQGOOmiGTARhxwkGd1cZ7Vwd0OppWr3911StpcV++Iwn67q/kyBMuHchErcqwFxT1XZXsfQJqo2zI6kdI4QAAAABJRU5ErkJggg==",ue="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAW1JREFUOE+dkj1IQmEUht9z/blp4VQEjS39eW+oSCFCpFCI4BiKFGWWQUSrCjVVg+lQNJZQDZGNTm1B4NTibS3n2lo0wuqEN8i/a0HfeN7v+d73nO+QJEcKAJzQPAwCnSpKNtoqkyRHqgDrtUFAb6Rnedx43KgT6O5P0GQijFiNLe/Sy3/B8g+YTIRRrb5jP32JYNADr8eOldU0RJEqVlm8r1kyuA/AIEB10OWy4vBgA4ryCIdjCJlMDmfn1zAY6EmyGY/UrAwrgGATWKsn4mGEQl4Uiw+YX9hT73aZiEcl8eMbZAGA0AT6/ZPY3Ykiny/A55tA7uoGqdQFBD2VbDbDugoSTTEj3gTGYgG8Vt7UeG63hNkZJ7a2s+gw1XqPnf5REKhkt4kxNakO08ycbOtRC/7FcakCwNTJ0WwmDI+1LUCZZDkSYGa5Eewf0G0KAnprNYtFQHdPbZhNS1cmLafF5bUTJsyBSVMHPm+/ADTrfrtCH68WAAAAAElFTkSuQmCC",It=(ne,Rt,Ae)=>new Promise((ie,Ee)=>{var Bt=ht=>{try{et(Ae.next(ht))}catch(st){Ee(st)}},nt=ht=>{try{et(Ae.throw(ht))}catch(st){Ee(st)}},et=ht=>ht.done?ie(ht.value):Promise.resolve(ht.value).then(Bt,nt);et((Ae=Ae.apply(ne,Rt)).next())}),ge=({type:ne,resdata:Rt,onok:Ae,oktext:ie,okloading:Ee})=>{const[Bt,nt]=(0,pt.useState)(!1),{can_copy_list:et,can_copy_num:ht,challenge_type:st,course_data_list:gt,no_copy_list:vt,no_copy_num:St,no_use_list:Et,no_use_num:Tt,repeat_shixun_num:Dt,student_count:Jt,total_num:Yt,use_num:Gt}=Rt;let me=ht>0||ne==="exercise";(0,pt.useEffect)(()=>{(Rt==null?void 0:Rt.student_count)>0&&nt(!0)},[Rt]),console.log("---11",Ee),(0,pt.useEffect)(()=>{Ee||nt(!1)},[Ee]);const ae=()=>{if(ne==="exercise"&&st===1)return pt.createElement(pt.Fragment,null,"\u8BFE\u5802\u5185\u6709",pt.createElement("span",{className:Ut.orangeColor},Jt),"\u540D\u5B66\u751F\u5DF2\u5728\u5176\u4ED6\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",pt.createElement("span",{className:Ut.orangeColor},Gt),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C",pt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u4F5C\u7B54\u5DF2\u6311\u6218\u8FC7\u7684\u5B9E\u8BAD\u9898\u3002"));if(ne==="exercise"&&st===2)return pt.createElement(pt.Fragment,null,"\u8BFE\u5802\u5185\u6709",pt.createElement("span",{className:Ut.orangeColor},Jt),"\u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",pt.createElement("span",{className:Ut.orangeColor},Gt),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C\u4E14\u4F5C\u4E1A\u5DF2\u5F00\u542F\u201C\u4F5C\u4E1A\u622A\u6B62\u540E\u4E0D\u5141\u8BB8\u5B66\u751F\u7F16\u8F91\u4EE3\u7801\u201D\u8BBE\u7F6E\u9879\uFF0C",pt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ne==="shixun"&&st===1)return pt.createElement(pt.Fragment,null,"\u8BFE\u5802\u5185\u6709",pt.createElement("span",{className:Ut.orangeColor},Jt),"\u540D\u5B66\u751F\u5DF2\u5728\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u8BE5\u5B9E\u8DF5\u9879\u76EE\uFF0C",pt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ne==="shixun"&&st===2)return pt.createElement(pt.Fragment,null,"\u8BFE\u5802\u5185\u6709",pt.createElement("span",{className:Ut.orangeColor},Jt),"\u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u4E2D\u6311\u6218\u8FC7\u8BE5\u5B9E\u8DF5\u9879\u76EE\uFF0C\u4E14\u4F5C\u4E1A\u5DF2\u5F00\u542F\u201C\u4F5C\u4E1A\u622A\u6B62\u540E\u4E0D\u5141\u8BB8\u5B66\u751F\u7F16\u8F91\u4EE3\u7801\u201D\u8BBE\u7F6E\u9879\uFF0C",pt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ne==="subject"&&st===1)return pt.createElement(pt.Fragment,null,"\u8BFE\u5802\u5185\u6709",pt.createElement("span",{className:Ut.orangeColor},Jt),"\u540D\u5B66\u751F\u5DF2\u5728\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",pt.createElement("span",{className:Ut.orangeColor},Gt),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C",pt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ne==="subject"&&st===2)return pt.createElement(pt.Fragment,null,"\u8BFE\u5802\u5185\u6709 ",pt.createElement("span",{className:Ut.orangeColor},Jt)," \u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u6311\u6218\u8FC7\u5176\u4E2D\u7684 ",pt.createElement("span",{className:Ut.orangeColor},Gt)," \u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C\u4E14\u4F5C\u4E1A\u5DF2\u5F00\u542F\u201C\u4F5C\u4E1A\u622A\u6B62\u540E\u4E0D\u5141\u8BB8\u5B66\u751F\u7F16\u8F91\u4EE3\u7801\u201D\u8BBE\u7F6E\u9879\uFF0C",pt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ne==="exercisepush")return pt.createElement(pt.Fragment,null,"\u8BFE\u5802\u5185\u6709",pt.createElement("span",{className:Ut.orangeColor},Jt),"\u540D\u5B66\u751F\u5DF2\u5728\u5176\u4ED6\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u8BD5\u5377\u4E2D\u7684",pt.createElement("span",{className:Ut.orangeColor},Gt),"\u4E2A\u5B9E\u8DF5\u9879\u76EE \uFF0C",pt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u5728\u5F53\u524D\u8003\u8BD5\u4E2D\u8FDB\u884C\u4F5C\u7B54\u3002"));if(ne==="shixunpush"&&st===1)return pt.createElement(pt.Fragment,null,"\u8BFE\u5802\u5185\u6709",pt.createElement("span",{className:Ut.orangeColor},Jt),"\u540D\u5B66\u751F\u5DF2\u5728\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",pt.createElement("span",{className:Ut.orangeColor},Gt),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C",pt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(ne==="shixunpush"&&st===2)return pt.createElement(pt.Fragment,null,"\u8BFE\u5802\u5185\u6709",pt.createElement("span",{className:Ut.orangeColor},Jt),"\u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u4E2D\u6311\u6218\u8FC7",pt.createElement("span",{className:Ut.orangeColor},Gt),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C\u4E14\u4F5C\u4E1A\u5DF2\u5F00\u542F\u201C\u4F5C\u4E1A\u622A\u6B62\u540E\u4E0D\u5141\u8BB8\u5B66\u751F\u7F16\u8F91\u4EE3\u7801\u201D\u8BBE\u7F6E\u9879\uFF0C",pt.createElement("span",{className:Ut.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"))},Ne=()=>{if(ne==="exercise"||ne==="subject"||ne==="exercisepush"||ne==="shixunpush")return pt.createElement("div",{style:{marginTop:20}},St>0&&pt.createElement("div",null,pt.createElement("span",{className:Ut.flex},pt.createElement("img",{src:ue,style:{width:14}}),pt.createElement("span",{className:Ut.statustitle},"\u4E0D\u652F\u6301\u590D\u5236\u7684\u5B9E\u8DF5\u9879\u76EE")),pt.createElement("div",{className:Ut.statusbody},ne==="exercise"&&pt.createElement("div",{style:{marginBottom:15}},"\u6CA1\u6709\u590D\u5236\u6743\u9650\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C",pt.createElement("span",{className:Ut.redColor},"\u4EE5\u4E0B\u8BD5\u9898\u5C06\u4E0D\u4F1A\u88AB\u53D1\u9001\u81F3\u8BFE\u5802\u4E2D\u3002"),"\u60A8\u4E5F\u53EF\u4EE5\u8054\u7CFB\u9879\u76EE\u521B\u5EFA\u8005\u5F00\u542F\u590D\u5236\u6743\u9650\u6216\u8005\u8054\u7CFB\u5E73\u53F0\u6559\u7814\u52A9\u7406\u8FDB\u884C\u534F\u52A9\u3002"),(ne==="subject"||ne==="exercisepush")&&pt.createElement("div",{style:{marginBottom:15}},"\u6CA1\u6709\u590D\u5236\u6743\u9650\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C",me&&pt.createElement("span",{className:Ut.redColor},"\u4E00\u952E\u590D\u5236\u4E0D\u4F1A\u590D\u5236\u6B64\u90E8\u5206\u9879\u76EE\u3002"),"\u60A8\u53EF\u4EE5\u8054\u7CFB\u9879\u76EE\u521B\u5EFA\u8005\u5F00\u542F\u590D\u5236\u6743\u9650\u6216\u8005\u8054\u7CFB\u5E73\u53F0\u6559\u7814\u52A9\u7406\u8FDB\u884C\u534F\u52A9\u3002"),ne==="shixunpush"&&pt.createElement("div",{style:{marginBottom:15}},"\u6CA1\u6709\u590D\u5236\u6743\u9650\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C",me&&pt.createElement("span",{className:Ut.redColor},"\u4E00\u952E\u590D\u5236\u4E0D\u4F1A\u590D\u5236\u6B64\u90E8\u5206\u9879\u76EE\u3002"),"\u5EFA\u8BAE\u60A8\u91CD\u65B0\u9009\u62E9\u5B9E\u8DF5\u9879\u76EE\u518D\u53D1\u5E03\u4F5C\u4E1A\uFF0C\u4E5F\u53EF\u8054\u7CFB\u9879\u76EE\u521B\u5EFA\u8005\u5F00\u542F\u590D\u5236\u6743\u9650\u6216\u8054\u7CFB\u5E73\u53F0\u6559\u7814\u52A9\u7406\u8FDB\u884C\u534F\u52A9\u3002"),pt.createElement("div",null,vt==null?void 0:vt.map((Ce,we)=>pt.createElement("a",{href:`/shixuns/${Ce.identifier}/challenges`,target:"_blank"},"\u300A",Ce==null?void 0:Ce.name,"\u300B",we+1!==St&&"\u3001"))))),ht>0&&pt.createElement("div",{style:{marginTop:20}},pt.createElement("span",{className:Ut.flex},pt.createElement("img",{src:Me,style:{width:14}}),pt.createElement("span",{className:Ut.statustitle},"\u652F\u6301\u590D\u5236\u7684\u5B9E\u8DF5\u9879\u76EE")),pt.createElement("div",{className:Ut.statusbody},ne==="exercise"&&pt.createElement("div",{style:{marginBottom:15}},"\u5EFA\u8BAE\u60A8\u4E00\u952E\u590D\u5236\u5E76\u66FF\u6362\u8BD5\u9898\uFF08\u5C06\u590D\u5236\u5E76\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\u66FF\u6362\u8BD5\u5377\u4E2D\u7684\u539F\u8BD5\u9898\uFF0C\u4E0D\u4F1A\u590D\u5236\u5B66\u751F\u7684\u6311\u6218\u8BB0\u5F55\uFF0C\u65B0\u7684\u9879\u76EE\u652F\u6301\u8FDB\u884C\u7F16\u8F91\u5E76\u4E0E\u539F\u9879\u76EE\u4FE1\u606F\u4E92\u4E0D\u5F71\u54CD\uFF09\u3002"),(ne==="subject"||ne==="exercisepush")&&pt.createElement("div",{style:{marginBottom:15}},"\u5EFA\u8BAE\u60A8\u4E00\u952E\u590D\u5236\u5E76\u53D1\u9001\uFF08\u5C06\u590D\u5236\u5E76\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\uFF0C\u4E0D\u4F1A\u590D\u5236\u5B66\u751F\u7684\u6311\u6218\u8BB0\u5F55\uFF0C\u65B0\u7684\u9879\u76EE\u652F\u6301\u8FDB\u884C\u7F16\u8F91\u5E76\u4E0E\u539F\u9879\u76EE\u4FE1\u606F\u4E92\u4E0D\u5F71\u54CD\uFF09\u3002"),ne==="shixunpush"&&pt.createElement("div",{style:{marginBottom:15}},"\u5EFA\u8BAE\u60A8\u4E00\u952E\u590D\u5236\u5E76\u66FF\u6362\u8BD5\u9898\uFF08\u5C06\u590D\u5236\u5E76\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\u66FF\u6362\u5F53\u524D\u4F5C\u4E1A\u4E2D\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C\u4E0D\u4F1A\u590D\u5236\u5B66\u751F\u7684\u6311\u6218\u8BB0\u5F55\uFF0C\u65B0\u7684\u9879\u76EE\u652F\u6301\u8FDB\u884C\u7F16\u8F91\u5E76\u4E0E\u539F\u9879\u76EE\u4FE1\u606F\u4E92\u4E0D\u5F71\u54CD\uFF09\u3002"),pt.createElement("div",null,et==null?void 0:et.map((Ce,we)=>pt.createElement("a",{href:`/shixuns/${Ce.identifier}/challenges`,target:"_blank"},"\u300A",Ce==null?void 0:Ce.name,"\u300B",we+1!==ht&&"\u3001"))))));if(ne==="shixun")return pt.createElement("div",{style:{marginTop:20}},ht>0?"\u8BE5\u9879\u76EE\u652F\u6301\u590D\u5236\uFF0C\u5EFA\u8BAE\u60A8\u4E00\u952E\u590D\u5236\u5E76\u53D1\u9001\uFF08\u5C06\u590D\u5236\u5E76\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u9879\u76EE\uFF0C\u4E0D\u4F1A\u590D\u5236\u5B66\u751F\u7684\u6311\u6218\u8BB0\u5F55\uFF0C\u65B0\u7684\u9879\u76EE\u652F\u6301\u8FDB\u884C\u7F16\u8F91\u5E76\u4E0E\u539F\u9879\u76EE\u4FE1\u606F\u4E92\u4E0D\u5F71\u54CD\uFF09\u3002":"\u8BE5\u9879\u76EE\u4E0D\u652F\u6301\u590D\u5236\uFF0C\u60A8\u53EF\u4EE5\u8054\u7CFB\u9879\u76EE\u521B\u5EFA\u8005\u5F00\u542F\u590D\u5236\u6743\u9650\u6216\u8005\u8054\u7CFB\u5E73\u53F0\u6559\u7814\u52A9\u7406\u8FDB\u884C\u534F\u52A9\u3002")};return pt.createElement(le.default,{open:Bt,onCancel:()=>{nt(!1)},cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",width:700,centered:!0,cancelButtonProps:{style:{display:!me&&"none"}},zIndex:1003,confirmLoading:Ee,okText:me?ie:"\u6211\u77E5\u9053\u4E86",onOk:()=>It(void 0,null,function*(){me?yield Ae([...et,...Et]):nt(!1)})},pt.createElement("div",{style:{maxHeight:600,overflow:"auto"}},ae(),Ne()))}},68462:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Z:function(){return It}});var pt=kt(59301),Ut={btn:"btn___kReTL",redBtn:"redBtn___UFEL0"},le=kt(92310),Me=kt.n(le),It=({className:qt,style:ge,state:ne,onClick:Rt})=>{var Ae,ie;return pt.createElement("div",{onClick:Rt,className:Me()(ne?(Ae=Ut)==null?void 0:Ae.redBtn:(ie=Ut)==null?void 0:ie.btn,qt),style:ge},ne?pt.createElement(pt.Fragment,null,pt.createElement("i",{className:"iconfont icon-biaoji1"}),pt.createElement("span",null,"\u53D6\u6D88\u6807\u8BB0\u9519\u9898")):pt.createElement(pt.Fragment,null,pt.createElement("i",{className:"iconfont icon-biaojigaiti"}),pt.createElement("span",null,"\u6807\u8BB0\u9519\u9898")))}},77531:function(Dn,Gn,kt){"use strict";kt.d(Gn,{h:function(){return St}});var pt=kt(59301),Ut=kt(82326),le=kt(28284),Me=kt(99571),ue=kt(89780),It=kt.n(ue),qt=kt(88540),ge=kt(42271),ne=Object.defineProperty,Rt=Object.defineProperties,Ae=Object.getOwnPropertyDescriptors,ie=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Bt=Object.prototype.propertyIsEnumerable,nt=(Et,Tt,Dt)=>Tt in Et?ne(Et,Tt,{enumerable:!0,configurable:!0,writable:!0,value:Dt}):Et[Tt]=Dt,et=(Et,Tt)=>{for(var Dt in Tt||(Tt={}))Ee.call(Tt,Dt)&&nt(Et,Dt,Tt[Dt]);if(ie)for(var Dt of ie(Tt))Bt.call(Tt,Dt)&&nt(Et,Dt,Tt[Dt]);return Et},ht=(Et,Tt)=>Rt(Et,Ae(Tt));const st=Ut.default.Option,gt={labelCol:{span:4},wrapperCol:{span:20}},vt={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Gn.Z=({callback:Et,onCancel:Tt})=>{const[Dt,Jt]=(0,pt.useState)("python");function Yt(me){Jt(vt[me][1])}function Gt(me){Et(me)}return pt.createElement(le.default,ht(et({},gt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Gt,style:{width:500}}),pt.createElement(le.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},pt.createElement(Ut.default,{getPopupContainer:me=>me.parentNode,onChange:Yt},Object.keys(vt).map(me=>pt.createElement(st,{key:me,value:me},vt[me][0])))),pt.createElement(le.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},pt.createElement(St,{mode:Dt})),pt.createElement("div",{className:"flex-container flex-end"},pt.createElement(Me.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),pt.createElement(Me.ZP,{type:"ghost",onClick:Tt},"\u53D6\u6D88")))};function St({value:Et,onChange:Tt,mode:Dt,options:Jt={}}){const Yt=(0,pt.useRef)(),[Gt,me]=(0,pt.useState)();return(0,pt.useEffect)(()=>{if(Gt){let ae=function(Ne){const Ce=Ne.getValue();Tt&&Tt(Ce)};return Gt.on("change",ae),()=>{Gt.off("change",ae)}}},[Gt,Tt]),(0,pt.useEffect)(()=>{Gt&&Gt.setOption("mode",Dt)},[Gt,Dt]),(0,pt.useEffect)(()=>{Gt&&(Et!==Gt.getValue()||Et==="")&&setTimeout(()=>{Gt.setValue(Et||"")},300)},[Gt,Et]),(0,pt.useEffect)(()=>{if(Yt.current&&!Gt){const ae=It().fromTextArea(Yt.current,et({mode:Dt,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},Jt));me(ae)}},[Yt.current,Gt]),pt.createElement("div",{className:"my-codemirror-container"},pt.createElement("textarea",{ref:Yt}))}},19565:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Z:function(){return bn}});var pt=kt(59301),Ut=kt(89780),le=kt.n(Ut),Me=kt(76374),ue=kt(88540),It=kt(6313),qt=kt(25717),ge=kt(99498),ne=kt(25419),Rt=kt(67549),Ae=kt(79074),ie=({value:pe="",className:Se,showTextOnly:ve,showLines:zn,style:kn={}})=>{const Qn=(0,pt.useMemo)(()=>"",[pe]);return pt.createElement(pt.Fragment,null,pt.createElement("div",{dangerouslySetInnerHTML:{__html:Qn}}))},Ee=kt(59301),Bt=Object.defineProperty,nt=Object.defineProperties,et=Object.getOwnPropertyDescriptors,ht=Object.getOwnPropertySymbols,st=Object.prototype.hasOwnProperty,gt=Object.prototype.propertyIsEnumerable,vt=(pe,Se,ve)=>Se in pe?Bt(pe,Se,{enumerable:!0,configurable:!0,writable:!0,value:ve}):pe[Se]=ve,St=(pe,Se)=>{for(var ve in Se||(Se={}))st.call(Se,ve)&&vt(pe,ve,Se[ve]);if(ht)for(var ve of ht(Se))gt.call(Se,ve)&&vt(pe,ve,Se[ve]);return pe},Et=(pe,Se)=>nt(pe,et(Se));let Tt=[{title:"\u7C97\u4F53",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"md-iconfont icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"\u6570\u5B66\u56FE\u50CF",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"iconfont icon-jisuan1",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"\u63D2\u5165\u753B\u56FE",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"\u63D2\u5165\u6D41\u7A0B\u56FE",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"\u8868\u683C",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function Dt({onActionCallback:pe,title:Se,icon:ve,actionName:zn,className:kn="",children:Qn}){function $e(){pe(zn)}return Ee.createElement("a",{title:Se,className:kn,onClick:$e},Ee.createElement("i",{className:`${ve}`}),Qn)}var Jt=({watch:pe,showNullButton:Se,showNullProgramButton:ve,onActionCallback:zn,fullScreen:kn,insertTemp:Qn,hidetoolBar:$e,extraUse:On})=>{const Fe=[...Tt,{title:`${pe?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${pe?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return Ee.createElement("ul",{className:"markdown-toolbar-container"},!$e&&Fe.map((Pe,Zn)=>Ee.createElement("li",{key:Zn},Pe.actionName?Ee.createElement(Dt,Et(St({},Pe),{onActionCallback:zn})):Ee.createElement("span",{className:"v-line"}))),Se?Ee.createElement("li",null,Ee.createElement(Dt,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:zn},Ee.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ve?Ee.createElement(Ee.Fragment,null,Ee.createElement("li",null,Ee.createElement(Dt,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:zn},Ee.createElement("span",{className:"fill-tip"},"+\u5355\u884C\u586B\u7A7A\u9879"))),Ee.createElement("li",null,Ee.createElement(Dt,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:zn},Ee.createElement("span",{className:"fill-tip"},"+\u591A\u884C\u586B\u7A7A\u9879")))):null,Qn&&Ee.createElement("li",null,Ee.createElement(Dt,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${Qn}`,onActionCallback:zn},Ee.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),On&&Ee.createElement("li",null,On),Ee.createElement("li",{className:"btn-full-screen"},Ee.createElement(Dt,{icon:`${kn?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:kn?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:zn})))},Yt=kt(52272),Gt=kt(28284),me=kt(37568),ae=kt(99571),Ne=Object.defineProperty,Ce=Object.defineProperties,we=Object.getOwnPropertyDescriptors,tn=Object.getOwnPropertySymbols,_e=Object.prototype.hasOwnProperty,an=Object.prototype.propertyIsEnumerable,Ke=(pe,Se,ve)=>Se in pe?Ne(pe,Se,{enumerable:!0,configurable:!0,writable:!0,value:ve}):pe[Se]=ve,oe=(pe,Se)=>{for(var ve in Se||(Se={}))_e.call(Se,ve)&&Ke(pe,ve,Se[ve]);if(tn)for(var ve of tn(Se))an.call(Se,ve)&&Ke(pe,ve,Se[ve]);return pe},Xt=(pe,Se)=>Ce(pe,we(Se));const qe={labelCol:{span:4},wrapperCol:{span:20}};var _n=({callback:pe,onCancel:Se})=>{function ve(zn){pe(zn)}return pt.createElement(Gt.default,Xt(oe({},qe),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:ve,style:{width:500}}),pt.createElement(Gt.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},pt.createElement(me.default,null)),pt.createElement(Gt.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},pt.createElement(me.default,null)),pt.createElement("div",{className:"flex-container flex-end"},pt.createElement(ae.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),pt.createElement(ae.ZP,{type:"ghost",onClick:Se},"\u53D6\u6D88")))},Pn=kt(77531),De=kt(24141),dn=kt(62957),sn=kt(77019),jn=kt(25138),Te=kt(59301),Sn=({callback:pe,onCancel:Se})=>{const ve=document.createElement("canvas"),zn=ve.getContext("2d");ve.width=1e3,ve.height=800,zn.fillStyle="#ffffff",zn.fillRect(0,0,ve.width,ve.height);const kn=ve.toDataURL("image/png");return Te.createElement(dn.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},Te.createElement(sn.Z,{style:{height:"100vh"}},Te.createElement(jn.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:kn,visible:!0,title:String(Date.now())},onOk:Qn=>{pe({src:Qn.url})},onClose:Se})))},ee=kt(12378);function Mn(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(Mn,go.CommandHandler),Mn.prototype.canAlignSelection=function(){var pe=this.diagram;return!(pe===null||pe.isReadOnly||pe.isModelReadOnly||pe.selection.count<2)},Mn.prototype.alignLeft=function(){var pe=this.diagram;pe.startTransaction("aligning left");var Se=1/0;pe.selection.each(function(ve){ve instanceof go.Link||(Se=Math.min(ve.position.x,Se))}),pe.selection.each(function(ve){ve instanceof go.Link||ve.move(new go.Point(Se,ve.position.y))}),pe.commitTransaction("aligning left")},Mn.prototype.alignRight=function(){var pe=this.diagram;pe.startTransaction("aligning right");var Se=-1/0;pe.selection.each(function(ve){if(!(ve instanceof go.Link)){var zn=ve.actualBounds.x+ve.actualBounds.width;Se=Math.max(zn,Se)}}),pe.selection.each(function(ve){ve instanceof go.Link||ve.move(new go.Point(Se-ve.actualBounds.width,ve.position.y))}),pe.commitTransaction("aligning right")},Mn.prototype.alignTop=function(){var pe=this.diagram;pe.startTransaction("alignTop");var Se=1/0;pe.selection.each(function(ve){ve instanceof go.Link||(Se=Math.min(ve.position.y,Se))}),pe.selection.each(function(ve){ve instanceof go.Link||ve.move(new go.Point(ve.position.x,Se))}),pe.commitTransaction("alignTop")},Mn.prototype.alignBottom=function(){var pe=this.diagram;pe.startTransaction("aligning bottom");var Se=-1/0;pe.selection.each(function(ve){if(!(ve instanceof go.Link)){var zn=ve.actualBounds.y+ve.actualBounds.height;Se=Math.max(zn,Se)}}),pe.selection.each(function(ve){ve instanceof go.Link||ve.move(new go.Point(ve.actualBounds.x,Se-ve.actualBounds.height))}),pe.commitTransaction("aligning bottom")},Mn.prototype.alignCenterX=function(){var pe=this.diagram,Se=pe.selection.first();if(Se){pe.startTransaction("aligning Center X");var ve=Se.actualBounds.x+Se.actualBounds.width/2;pe.selection.each(function(zn){zn instanceof go.Link||zn.move(new go.Point(ve-zn.actualBounds.width/2,zn.actualBounds.y))}),pe.commitTransaction("aligning Center X")}},Mn.prototype.alignCenterY=function(){var pe=this.diagram,Se=pe.selection.first();if(Se){pe.startTransaction("aligning Center Y");var ve=Se.actualBounds.y+Se.actualBounds.height/2;pe.selection.each(function(zn){zn instanceof go.Link||zn.move(new go.Point(zn.actualBounds.x,ve-zn.actualBounds.height/2))}),pe.commitTransaction("aligning Center Y")}},Mn.prototype.alignColumn=function(pe){var Se=this.diagram;Se.startTransaction("align Column"),pe===void 0&&(pe=0),pe=parseFloat(pe);var ve=new Array;Se.selection.each(function(On){On instanceof go.Link||ve.push(On)});for(var zn=0;zn<ve.length-1;zn++){var kn=ve[zn],Qn=kn.actualBounds.y+kn.actualBounds.height+pe,$e=ve[zn+1];$e.move(new go.Point(kn.actualBounds.x,Qn))}Se.commitTransaction("align Column")},Mn.prototype.alignRow=function(pe){pe===void 0&&(pe=0),pe=parseFloat(pe);var Se=this.diagram;Se.startTransaction("align Row");var ve=new Array;Se.selection.each(function(On){On instanceof go.Link||ve.push(On)});for(var zn=0;zn<ve.length-1;zn++){var kn=ve[zn],Qn=kn.actualBounds.x+kn.actualBounds.width+pe,$e=ve[zn+1];$e.move(new go.Point(Qn,kn.actualBounds.y))}Se.commitTransaction("align Row")},Mn.prototype.canRotate=function(pe){var Se=this.diagram;return!(Se===null||Se.isReadOnly||Se.isModelReadOnly||Se.selection.count<1)},Mn.prototype.rotate=function(pe){pe===void 0&&(pe=90);var Se=this.diagram;Se.startTransaction("rotate "+pe.toString());var Se=this.diagram;Se.selection.each(function(ve){ve instanceof go.Link||ve instanceof go.Group||(ve.angle+=pe)}),Se.commitTransaction("rotate "+pe.toString())},Mn.prototype.pullToFront=function(){var pe=this.diagram;pe.startTransaction("pullToFront");var Se=new go.Map;pe.selection.each(function(ve){Se.set(ve.layer,0)}),Se.iteratorKeys.each(function(ve){var zn=0;ve.parts.each(function(kn){if(!kn.isSelected){var Qn=kn.zOrder;isNaN(Qn)?kn.zOrder=0:zn=Math.max(zn,Qn)}}),Se.set(ve,zn)}),pe.selection.each(function(ve){Mn._assignZOrder(ve,Se.get(ve.layer)+1)}),pe.commitTransaction("pullToFront")},Mn.prototype.pushToBack=function(){var pe=this.diagram;pe.startTransaction("pushToBack");var Se=new go.Map;pe.selection.each(function(ve){Se.set(ve.layer,0)}),Se.iteratorKeys.each(function(ve){var zn=0;ve.parts.each(function(kn){if(!kn.isSelected){var Qn=kn.zOrder;isNaN(Qn)?kn.zOrder=0:zn=Math.min(zn,Qn)}}),Se.set(ve,zn)}),pe.selection.each(function(ve){Mn._assignZOrder(ve,Se.get(ve.layer)-1-Mn._findGroupDepth(ve))}),pe.commitTransaction("pushToBack")},Mn._assignZOrder=function(pe,Se,ve){ve===void 0&&(ve=pe),pe.layer===ve.layer&&(pe.zOrder=Se),pe instanceof go.Group&&pe.memberParts.each(function(zn){Mn._assignZOrder(zn,Se+1,ve)})},Mn._findGroupDepth=function(pe){if(pe instanceof go.Group){var Se=0;return pe.memberParts.each(function(ve){Se=Math.max(Se,Mn._findGroupDepth(ve))}),Se+1}else return 0},Mn.prototype.doKeyDown=function(){var pe=this.diagram;if(pe!==null){var Se=pe.lastInput;if(Se.key==="Up"||Se.key==="Down"||Se.key==="Left"||Se.key==="Right"){var ve=this.arrowKeyBehavior;if(ve==="none")return;if(ve==="select"){this._arrowKeySelect();return}else if(ve==="move"){this._arrowKeyMove();return}else if(ve==="tree"){this._arrowKeyTree();return}}go.CommandHandler.prototype.doKeyDown.call(this)}},Mn.prototype._getAllParts=function(){var pe=new Array;return this.diagram.nodes.each(function(Se){pe.push(Se)}),this.diagram.parts.each(function(Se){pe.push(Se)}),pe},Mn.prototype._arrowKeyMove=function(){var pe=this.diagram,Se=pe.lastInput,ve=0,zn=0;if(Se.control||Se.meta)ve=1,zn=1;else if(pe.grid!==null){var kn=pe.grid.gridCellSize;zn=kn.width,ve=kn.height}pe.startTransaction("arrowKeyMove"),pe.selection.each(function(Qn){Se.key==="Up"?Qn.move(new go.Point(Qn.actualBounds.x,Qn.actualBounds.y-ve)):Se.key==="Down"?Qn.move(new go.Point(Qn.actualBounds.x,Qn.actualBounds.y+ve)):Se.key==="Left"?Qn.move(new go.Point(Qn.actualBounds.x-zn,Qn.actualBounds.y)):Se.key==="Right"&&Qn.move(new go.Point(Qn.actualBounds.x+zn,Qn.actualBounds.y))}),pe.commitTransaction("arrowKeyMove")},Mn.prototype._arrowKeySelect=function(){var pe=this.diagram,Se=pe.lastInput,ve=null;Se.key==="Up"?ve=this._findNearestPartTowards(270):Se.key==="Down"?ve=this._findNearestPartTowards(90):Se.key==="Left"?ve=this._findNearestPartTowards(180):Se.key==="Right"&&(ve=this._findNearestPartTowards(0)),ve!==null&&(Se.shift?ve.isSelected=!0:Se.control||Se.meta?ve.isSelected=!ve.isSelected:pe.select(ve))},Mn.prototype._findNearestPartTowards=function(pe){var Se=this.diagram.selection.first();if(Se===null)return null;for(var ve=Se.actualBounds.center,zn=this._getAllParts(),kn=1/0,Qn=Se,$e=0;$e<zn.length;$e++){var On=zn[$e];if(On!==Se&&On.canSelect()){var Fe=On.actualBounds.center,Pe=ve.directionPoint(Fe),Zn=this._angleCloseness(Pe,pe);if(Zn<=45){var $t=ve.distanceSquaredPoint(Fe);$t*=1+Math.sin(Zn*Math.PI/180),$t<kn&&(kn=$t,Qn=On)}}}return Qn},Mn.prototype._angleCloseness=function(pe,Se){return Math.min(Math.abs(Se-pe),Math.min(Math.abs(Se+360-pe),Math.abs(Se-360-pe)))},Mn.prototype._arrowKeyTree=function(){var pe=this.diagram,Se=pe.selection.first();if(Se instanceof go.Node){var ve=pe.lastInput;if(ve.key==="Right"){if(!Se.isTreeLeaf)if(!Se.isTreeExpanded)pe.commandHandler.canExpandTree(Se)&&pe.commandHandler.expandTree(Se);else{var zn=this._sortTreeChildrenByY(Se).first();zn!==null&&pe.select(zn)}}else if(ve.key==="Left")if(!Se.isTreeLeaf&&Se.isTreeExpanded)pe.commandHandler.canCollapseTree(Se)&&pe.commandHandler.collapseTree(Se);else{var kn=Se.findTreeParentNode();kn!==null&&pe.select(kn)}else if(ve.key==="Up"){var kn=Se.findTreeParentNode();if(kn!==null){var Qn=this._sortTreeChildrenByY(kn),$e=Qn.indexOf(Se);if($e>0){for(var On=Qn.elt($e-1);On!==null&&On.isTreeExpanded&&!On.isTreeLeaf;){var Fe=this._sortTreeChildrenByY(On);On=Fe.last()}On!==null&&pe.select(On)}else pe.select(kn)}}else if(ve.key==="Down")if(Se.isTreeExpanded&&!Se.isTreeLeaf){var zn=this._sortTreeChildrenByY(Se).first();zn!==null&&pe.select(zn)}else for(;Se!==null;){var kn=Se.findTreeParentNode();if(kn===null)break;var Qn=this._sortTreeChildrenByY(kn),$e=Qn.indexOf(Se);if($e<Qn.length-1){pe.select(Qn.elt($e+1));break}else Se=kn}var Pe=pe.selection.first();Pe!==null&&pe.scrollToRect(Pe.actualBounds)}},Mn.prototype._sortTreeChildrenByY=function(pe){var Se=new go.List().addAll(pe.findTreeChildrenNodes());return Se.sort(function(ve,zn){var kn=ve.location,Qn=zn.location;return kn.y<Qn.y?-1:kn.y>Qn.y?1:kn.x<Qn.x?-1:kn.x>Qn.x?1:0}),Se},Mn.prototype.copyToClipboard=function(pe){go.CommandHandler.prototype.copyToClipboard.call(this,pe),this._lastPasteOffset.set(this.pasteOffset)},Mn.prototype.pasteFromClipboard=function(){var pe=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(pe,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),pe},Object.defineProperty(Mn.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(pe){if(pe!=="move"&&pe!=="select"&&pe!=="scroll"&&pe!=="tree"&&pe!=="none")throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+pe);this._arrowKeyBehavior=pe}}),Object.defineProperty(Mn.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(pe){if(!(pe instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+pe);this._pasteOffset.set(pe)}});var ui=Mn,_t=kt(71584),Lt=kt(5269),Pt=kt(24092),Nt={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},zt=kt(69669),Mt=kt(59301),Kt=(pe,Se,ve)=>new Promise((zn,kn)=>{var Qn=Fe=>{try{On(ve.next(Fe))}catch(Pe){kn(Pe)}},$e=Fe=>{try{On(ve.throw(Fe))}catch(Pe){kn(Pe)}},On=Fe=>Fe.done?zn(Fe.value):Promise.resolve(Fe.value).then(Qn,$e);On((ve=ve.apply(pe,Se)).next())});function ye({onCancel:pe,callback:Se}){let ve=(0,pt.useRef)(),zn=(0,pt.useRef)(),kn=(0,pt.useRef)(),Qn=(0,pt.useRef)(!1);const $e=(0,pt.useRef)(!1),[On,Fe]=(0,pt.useState)(0);function Pe(){const $t=ee.bx.make,Ze={red:"#ff3333",blue:"#3358ff",green:"#25ad23",magenta:"#d533ff",purple:"#7d33ff",orange:"#ff6233",brown:"#8e571e",white:"#ffffff",black:"#000000",beige:"#fffcd5",extralightblue:"#d5ebff",extralightred:"#f2dfe0",lightblue:"#a5d2fa",lightgray:"#cccccc",lightgreen:"#b3e6b3",lightred:"#fcbbbd"};ve.current=new ee.S0(zn.current,{padding:20,grid:$t(ee.s_,"Grid",$t(ee.bn,"LineH",{stroke:"lightgray",strokeWidth:.5}),$t(ee.bn,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:Hn=>{var Fi=Hn.diagram.commandHandler.addTopLevelParts(Hn.diagram.selection,!0);Fi||Hn.diagram.currentTool.doCancel()},commandHandler:$t(ui),"clickCreatingTool.archetypeNodeData":{text:"\u672A\u547D\u540D",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:Hn=>{var Fi=Hn.subject;Fi.location=Fi.location.copy().snapToGridPoint(Hn.diagram.grid.gridOrigin,Hn.diagram.grid.gridCellSize),setTimeout(()=>{Hn.diagram.commandHandler.editTextBlock()},20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:Hn=>{var Fi=Hn.subject;setTimeout(()=>{Hn.diagram.commandHandler.editTextBlock()})},LinkRelinked:Hn=>{var Fi=Hn.parameter.part;Fi.invalidateConnectedLinks();var Hi=Hn.subject;Hn.diagram.toolManager.linkingTool.isForwards?Hi.toNode.invalidateConnectedLinks():Hi.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),ve.current.nodeTemplate=$t(ee.NB,"Auto",{locationSpot:ee.z6.Center,locationObjectName:"SHAPE",desiredSize:new ee.$u(120,60),minSize:new ee.$u(40,40),resizable:!0,resizeCellSize:new ee.$u(10,10),rotatable:!0},new ee.KX("location","loc",ee.E9.parse).makeTwoWay(ee.E9.stringify),new ee.KX("desiredSize","size",ee.$u.parse).makeTwoWay(ee.$u.stringify),$t(ee.bn,{name:"SHAPE",fill:Ze.white,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:ee.z6.AllSides,toSpot:ee.z6.AllSides},new ee.KX("figure"),new ee.KX("fill"),new ee.KX("stroke","borderColor"),new ee.KX("strokeWidth","thickness"),new ee.KX("strokeDashArray","dash")),$t(ee.bn,{width:100,height:20,strokeWidth:0,fill:"transparent"}),$t(ee.al,{margin:1,textAlign:"center",overflow:ee.al.OverflowEllipsis,editable:!0},new ee.KX("text").makeTwoWay(),new ee.KX("stroke","color"))),ve.current.nodeTemplate.toolTip=$t("ToolTip",$t(ee.s_,"Vertical",{maxSize:new ee.$u(200,NaN)},$t(ee.al,{font:"bold 10pt sans-serif",textAlign:"center"},new ee.KX("text")),$t(ee.al,{font:"10pt sans-serif",textAlign:"center"},new ee.KX("text","details"))));function wn(Hn,Fi){var Hi=(Ii,Yi)=>{Ii.handled=!0,Ii.diagram.model.commit(Ar=>{var Pr=Yi.part.adornedPart,Br=new ee.E9().setRectSpot(Pr.actualBounds,Hn);Br.subtract(Pr.location),Br.scale(2,2),Br.x+=Math.sign(Br.x)*130,Br.y+=Math.sign(Br.y)*130,Br.add(Pr.location),Br.snapToGridPoint(Ii.diagram.grid.gridOrigin,Ii.diagram.grid.gridCellSize);var Fr=Ar.copyNodeData(Pr.data);Ar.setGroupKeyForNodeData(Fr,Ar.getGroupKeyForNodeData(Pr.data)),Ar.addNodeData(Fr);var fn={from:Pr.key,to:Ar.getKeyForNodeData(Fr)};Ar.addLinkData(fn);var io=Ii.diagram.findNodeForData(Fr);io.location=Br,Ii.diagram.select(io),setTimeout(()=>{Ii.diagram.commandHandler.editTextBlock()},20)})};return $t(ee.bn,{figure:Fi,alignment:Hn,alignmentFocus:Hn.opposite(),width:Hn.equals(ee.z6.Top)||Hn.equals(ee.z6.Bottom)?25:18,height:Hn.equals(ee.z6.Top)||Hn.equals(ee.z6.Bottom)?18:25,fill:"orange",stroke:Ze.white,strokeWidth:4,mouseEnter:(Ii,Yi)=>Yi.fill="dodgerblue",mouseLeave:(Ii,Yi)=>Yi.fill="orange",isActionable:!0,click:Hi,contextClick:Hi})}function ri(Hn){return $t(ee.bn,{fill:"orange",stroke:"rgba(0, 0, 0, 0)",strokeWidth:15,background:"transparent",geometryString:"F1 M0 0 b 0 360 -4 0 4 z M10 0 b 0 360 -4 0 4 z M20 0 b 0 360 -4 0 4",isActionable:!0,cursor:"context-menu",mouseEnter:(Fi,Hi)=>Hi.fill="dodgerblue",mouseLeave:(Fi,Hi)=>Hi.fill="orange",click:(Fi,Hi)=>{Fi.diagram.commandHandler.showContextMenu(Hi.part.adornedPart)}},Hn||{})}ve.current.nodeTemplate.selectionAdornmentTemplate=$t(ee.uz,"Spot",$t(ee.Vm,{padding:10}),wn(ee.z6.Top,"TriangleUp"),wn(ee.z6.Left,"TriangleLeft"),wn(ee.z6.Right,"TriangleRight"),wn(ee.z6.Bottom,"TriangleDown"),ri({alignment:new ee.z6(.75,0)}));function We(Hn,Fi){return(Hi,Ii)=>{Hi.handled=!0,Hi.diagram.model.commit(Yi=>{Yi.set(Ii.part.adornedPart.data,Hn,Fi)})}}function je(Hn,Fi){return Fi||(Fi="color"),$t(ee.bn,{width:16,height:16,stroke:"lightgray",fill:Hn,margin:1,background:"transparent",mouseEnter:(Hi,Ii)=>Ii.stroke="dodgerblue",mouseLeave:(Hi,Ii)=>Ii.stroke="lightgray",click:We(Fi,Hn),contextClick:We(Fi,Hn)})}function Vn(){return[$t("ContextMenuButton",$t(ee.s_,"Horizontal",je(Ze.white,"fill"),je(Ze.beige,"fill"),je(Ze.extralightblue,"fill"),je(Ze.extralightred,"fill"))),$t("ContextMenuButton",$t(ee.s_,"Horizontal",je(Ze.lightgray,"fill"),je(Ze.lightgreen,"fill"),je(Ze.lightblue,"fill"),je(Ze.lightred,"fill")))]}function ci(){return[$t("ContextMenuButton",$t(ee.s_,"Horizontal",je(Ze.black),je(Ze.green),je(Ze.blue),je(Ze.red))),$t("ContextMenuButton",$t(ee.s_,"Horizontal",je(Ze.white),je(Ze.magenta),je(Ze.purple),je(Ze.orange)))]}function Mi(Hn,Fi){return Fi||(Fi="thickness"),$t(ee.bn,"LineH",{width:16,height:16,strokeWidth:Hn,margin:1,background:"transparent",mouseEnter:(Hi,Ii)=>Ii.background="dodgerblue",mouseLeave:(Hi,Ii)=>Ii.background="transparent",click:We(Fi,Hn),contextClick:We(Fi,Hn)})}function pi(Hn,Fi){return Fi||(Fi="dash"),$t(ee.bn,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:Hn,margin:1,background:"transparent",mouseEnter:(Hi,Ii)=>Ii.background="dodgerblue",mouseLeave:(Hi,Ii)=>Ii.background="transparent",click:We(Fi,Hn),contextClick:We(Fi,Hn)})}function oi(){return[$t("ContextMenuButton",$t(ee.s_,"Horizontal",Mi(1),Mi(2),Mi(3),Mi(4))),$t("ContextMenuButton",$t(ee.s_,"Horizontal",pi(null),pi([2,4]),pi([4,4])))]}function hi(Hn,Fi){return Fi||(Fi="figure"),$t(ee.bn,{width:32,height:32,scale:.5,fill:"lightgray",figure:Hn,margin:1,background:"transparent",mouseEnter:(Hi,Ii)=>Ii.fill="dodgerblue",mouseLeave:(Hi,Ii)=>Ii.fill="lightgray",click:We(Fi,Hn),contextClick:We(Fi,Hn)})}ve.current.nodeTemplate.contextMenu=$t("ContextMenu",$t("ContextMenuButton",$t(ee.s_,"Horizontal",hi("Rectangle"),hi("RoundedRectangle"),hi("Ellipse"),hi("Diamond"))),$t("ContextMenuButton",$t(ee.s_,"Horizontal",hi("Parallelogram2"),hi("ManualOperation"),hi("Procedure"),hi("Cylinder1"))),$t("ContextMenuButton",$t(ee.s_,"Horizontal",hi("Terminator"),hi("CreateRequest"),hi("Document"),hi("TriangleDown"))),Vn(),ci(),oi()),ve.current.groupTemplate=$t(ee.ZA,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:ee.z6.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:(Hn,Fi)=>{var Hi=Fi.addMembers(Fi.diagram.selection,!0);Hi||Fi.diagram.currentTool.doCancel()},avoidable:!1},new ee.KX("location","loc",ee.E9.parse).makeTwoWay(ee.E9.stringify),$t(ee.s_,"Auto",{name:"BODY"},$t(ee.bn,{parameter1:10,fill:Ze.white,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:ee.z6.AllSides,toSpot:ee.z6.AllSides},new ee.KX("fill"),new ee.KX("stroke","color"),new ee.KX("strokeWidth","thickness"),new ee.KX("strokeDashArray","dash")),$t(ee.Vm,{background:"transparent",margin:20})),$t(ee.al,{alignment:ee.z6.Top,alignmentFocus:ee.z6.Bottom,font:"bold 12pt sans-serif",editable:!0},new ee.KX("text"),new ee.KX("stroke","color"))),ve.current.groupTemplate.selectionAdornmentTemplate=$t(ee.uz,"Spot",$t(ee.s_,"Auto",$t(ee.bn,{fill:null,stroke:"dodgerblue",strokeWidth:3}),$t(ee.Vm,{margin:1.5})),ri({alignment:ee.z6.TopRight,alignmentFocus:ee.z6.BottomRight})),ve.current.groupTemplate.contextMenu=$t("ContextMenu",Vn(),ci(),oi()),ve.current.linkTemplate=$t(ee.rU,{layerName:"Foreground",routing:ee.rU.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new ee.KX("fromSpot","fromSpot",ee.z6.parse),new ee.KX("toSpot","toSpot",ee.z6.parse),new ee.KX("fromShortLength","dir",Hn=>Hn>=1?10:0),new ee.KX("toShortLength","dir",Hn=>Hn>=1?10:0),new ee.KX("points").makeTwoWay(),$t(ee.bn,{strokeWidth:2},new ee.KX("stroke","color"),new ee.KX("strokeWidth","thickness"),new ee.KX("strokeDashArray","dash")),$t(ee.bn,{segmentIndex:0,segmentOffset:new ee.E9(15,0),segmentOrientation:ee.rU.OrientAlong,alignmentFocus:ee.z6.Right,figure:"circle",width:10,strokeWidth:0},new ee.KX("fill","color"),new ee.KX("visible","dir",Hn=>Hn===1)),$t(ee.bn,{segmentIndex:-1,segmentOffset:new ee.E9(-10,6),segmentOrientation:ee.rU.OrientPlus90,alignmentFocus:ee.z6.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new ee.KX("fill","color"),new ee.KX("visible","dir",Hn=>Hn>=1),new ee.KX("width","thickness",Hn=>7+3*Hn),new ee.KX("height","thickness",Hn=>7+3*Hn),new ee.KX("segmentOffset","thickness",Hn=>new ee.E9(-15,4+1.5*Hn))),$t(ee.bn,{segmentIndex:0,segmentOffset:new ee.E9(15,-6),segmentOrientation:ee.rU.OrientMinus90,alignmentFocus:ee.z6.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new ee.KX("fill","color"),new ee.KX("visible","dir",Hn=>Hn===2),new ee.KX("width","thickness",Hn=>7+3*Hn),new ee.KX("height","thickness",Hn=>7+3*Hn),new ee.KX("segmentOffset","thickness",Hn=>new ee.E9(-15,4+1.5*Hn))),$t(ee.al,{alignmentFocus:new ee.z6(0,1,-4,0),editable:!0},new ee.KX("text").makeTwoWay(),new ee.KX("stroke","color"))),ve.current.linkTemplate.selectionAdornmentTemplate=$t(ee.uz,$t(ee.bn,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:Bi(2)},new ee.KX("pathPattern","thickness",Bi)),ri({alignmentFocus:new ee.z6(0,0,-6,-4)}));function Bi(Hn){return $t(ee.bn,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(Hn+4).toString()+" H3"})}function _i(Hn){var Fi="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return Hn===0?Fi="M0 0 M16 16 M0 8 L16 8":Hn===2&&(Fi="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),$t(ee.bn,{geometryString:Fi,margin:2,background:"transparent",mouseEnter:(Hi,Ii)=>Ii.background="dodgerblue",mouseLeave:(Hi,Ii)=>Ii.background="transparent",click:We("dir",Hn),contextClick:We("dir",Hn)})}function Ki(Hn){var Fi=(Hi,Ii)=>{Hi.handled=!0,Hi.diagram.model.commit(Yi=>{var Ar=Ii.part.adornedPart;Yi.set(Ar.data,Hn?"toSpot":"fromSpot",ee.z6.stringify(ee.z6.AllSides)),(Hn?Ar.toNode:Ar.fromNode).invalidateConnectedLinks()})};return $t(ee.bn,{width:12,height:12,fill:"transparent",mouseEnter:(Hi,Ii)=>Ii.background="dodgerblue",mouseLeave:(Hi,Ii)=>Ii.background="transparent",click:Fi,contextClick:Fi})}function en(Hn,Fi){var Hi=0,Ii=ee.z6.RightSide;Hn.equals(ee.z6.Top)?(Hi=270,Ii=ee.z6.TopSide):Hn.equals(ee.z6.Left)?(Hi=180,Ii=ee.z6.LeftSide):Hn.equals(ee.z6.Bottom)&&(Hi=90,Ii=ee.z6.BottomSide),Fi||(Hi-=180);var Yi=(Ar,Pr)=>{Ar.handled=!0,Ar.diagram.model.commit(Br=>{var Fr=Pr.part.adornedPart;Br.set(Fr.data,Fi?"toSpot":"fromSpot",ee.z6.stringify(Ii)),(Fi?Fr.toNode:Fr.fromNode).invalidateConnectedLinks()})};return $t(ee.bn,{alignment:Hn,alignmentFocus:Hn.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:Hi,background:"transparent",mouseEnter:(Ar,Pr)=>Pr.background="dodgerblue",mouseLeave:(Ar,Pr)=>Pr.background="transparent",click:Yi,contextClick:Yi})}ve.current.linkTemplate.contextMenu=$t("ContextMenu",ci(),oi(),$t("ContextMenuButton",$t(ee.s_,"Horizontal",_i(0),_i(1),_i(2))),$t("ContextMenuButton",$t(ee.s_,"Horizontal",$t(ee.s_,"Spot",Ki(!1),en(ee.z6.Top,!1),en(ee.z6.Left,!1),en(ee.z6.Right,!1),en(ee.z6.Bottom,!1)),$t(ee.s_,"Spot",{margin:new ee.Zt(0,0,0,2)},Ki(!0),en(ee.z6.Top,!0),en(ee.z6.Left,!0),en(ee.z6.Right,!0),en(ee.z6.Bottom,!0)))));const no=`{ "class": "GraphLinksModel",
"nodeDataArray": [
{"text":"Find Problem","key":-9,"loc":"-20 -140","color":"#3358ff","fill":"white","figure":"Procedure","thickness":3},
{"text":"What do we want?","key":-10,"loc":"-65 -324.305","group":-16,"figure":"Ellipse","fill":"white"},
{"text":"What do our users want?","key":-11,"loc":"105 -334.305","group":-20,"figure":"Ellipse","fill":"#ffffff","color":"black"},
{"text":"Meetings","key":-12,"loc":"-65 -444.305","group":-16,"figure":"TriangleDown","fill":"#ffffff"},
{"text":"Reviews","key":-13,"loc":"105 -454.305","group":-20,"figure":"TriangleDown","fill":"#ffffff","color":"black"},
{"text":"Can we solve it?","key":-14,"loc":"190 -140","color":"#7d33ff","fill":"#ffffff","figure":"Diamond","size":"140 80","thickness":3},
{"isGroup":true,"text":"Internal","key":-16,"loc":"-65 -384.305","fill":"#d5ebff","dash":null,"thickness":1,"group":-22},
{"isGroup":true,"text":"External","key":-20,"loc":"105 -394.305","fill":"#d5ebff","dash":null,"thickness":1,"group":-22},
{"isGroup":true,"text":"Sources","key":-22,"loc":"20 -400","fill":"#a5d2fa","dash":[4,4],"color":"#3358ff"}
],
"linkDataArray": [
{"from":-12,"to":-10,"points":[-65,-414.305,-65,-404.305,-65,-384.305,-65,-384.305,-65,-364.305,-65,-354.305],"dash":null,"dir":1},
{"from":-13,"to":-11,"points":[105,-424.305,105,-414.305,105,-394.305,105,-394.305,105,-374.305,105,-364.305],"dash":null,"color":"#000000","dir":1},
{"from":-10,"to":-9,"points":[-65,-294.305,-65,-284.305,-65,-232.1525,-40,-232.1525,-40,-180,-40,-170],"dir":2,"dash":[4,4]},
{"from":-11,"to":-9,"points":[105,-304.305,105,-294.305,105,-237.1525,0,-237.1525,0,-180,0,-170],"dash":[4,4],"dir":2},
{"from":-9,"to":-14,"points":[40,-150,58,-150,80,-150,80,-153.33333333333331,102,-153.33333333333331,120,-153.33333333333331],"dir":1,"color":"#3358ff"},
{"from":-14,"to":-9,"points":[190,-100,190,-90,-20,-90,-20,-95,-20,-100,-20,-110],"fromSpot":"BottomSide","toSpot":"BottomSide","text":"No","color":"#ff3333","thickness":2,"dir":1},
{"from":-9,"to":-14,"points":[40,-130,58,-130,80,-130,80,-126.66666666666666,102,-126.66666666666666,120,-126.66666666666666]}
]}`;var vr=["Rectangle","Square","RoundedRectangle","Border","Ellipse","Circle","TriangleRight","TriangleDown","TriangleLeft","TriangleUp","Triangle","Diamond","LineH","LineV","None","BarH","BarV","MinusLine","PlusLine","XLine","LineRight","LineDown","LineLeft","LineUp"];function Xr(Hn){return console.log("shapeName:",Hn),vr.indexOf(Hn)>=0}var He=new ee.YI(kn.current,{maxSelectionCount:1,linkTemplate:$t(ee.rU,{locationSpot:ee.z6.Center,selectionAdornmentTemplate:$t(ee.uz,"Link",{locationSpot:ee.z6.Center},$t(ee.bn,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),$t(ee.bn,{toArrow:"Standard",stroke:null}))},{routing:ee.rU.AvoidsNodes,curve:ee.rU.JumpOver,corner:5,toShortLength:4},new ee.KX("points"),$t(ee.bn,{isPanelMain:!0,strokeWidth:2}),$t(ee.bn,{toArrow:"Standard",stroke:null})),model:new ee.FJ([{text:"\u672A\u547D\u540D",size:"100 100",fill:null,stroke:"#000"},...ee.bn.getFigureGenerators().toArray().map(Hn=>({text:"\u672A\u547D\u540D",size:"100 100",figure:Hn.key,fill:"white",stroke:"#666",borderColor:"#000"}))])});return ve.current.addDiagramListener("TextEdited",function(Hn){var Fi;const Hi=Hn.subject.part;var Ii=(Fi=document.activeElement)==null?void 0:Fi.value;typeof Ii=="string"&&Ii.trim()===""&&ve.current.model.commit(function(Yi){Yi.set(Hi.data,"text","\u672A\u547D\u540D"),ve.current.commandHandler.stopCommand()},"increment")}),He.nodeTemplate=$t(ee.NB,"Auto",{locationSpot:ee.z6.Center},new ee.KX("location","location",ee.E9.parse).makeTwoWay(ee.E9.stringify),$t(ee.bn,"Circle",{fill:"white",stroke:"gray",strokeWidth:2,width:20,height:20,portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromLinkableSelfNode:!0,toLinkableSelfNode:!0},new ee.KX("stroke").makeTwoWay(),new ee.KX("fill").makeTwoWay(),new ee.KX("figure")),$t(ee.al,{margin:new ee.Zt(5,5,3,5),font:"10pt sans-serif",minSize:new ee.$u(16,16),maxSize:new ee.$u(10,NaN),textAlign:"center",editable:!0},new ee.KX("key").makeTwoWay())),setTimeout(()=>{ve.current.grid=$t(ee.s_,"Grid",$t(ee.bn,"LineH",{stroke:"lightgray",strokeWidth:.5}),$t(ee.bn,"LineV",{stroke:"lightgray",strokeWidth:.5})),ve.current.grid.visible=!0,ve.current.grid.gridCellStroke="darkgray",ve.current.grid.gridCellStrokeWidth=1},300),window.myDiagrams=ve.current,ve.current}const Zn=()=>Kt(this,null,function*(){var $t,Ze=ve.current.makeImage();const wn=yield(0,Pt.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:Ze.src,file_data:JSON.stringify({login:($t=(0,zt.eY)())==null?void 0:$t.login,data:JSON.parse(ve.current.model.toJson())})}});Se({src:wn.url})});return(0,pt.useEffect)(()=>(setTimeout(()=>{Pe()},500),Fe(On+1),()=>{ve.current=null}),[]),Mt.createElement("div",{ref:$e,className:"body-overflow-initial"},Mt.createElement(dn.default,{width:1200,icon:null,footer:null,closable:!0,visible:!!On,destroyOnClose:!0,maskClosable:!1,rootClassName:"zIndex-9999",title:Mt.createElement(sn.Z,null,Mt.createElement(Lt.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),Mt.createElement(Lt.Z,{onClick:()=>{var $t,Ze,wn=ve.current.selection.first();if(Qn.current=!Qn.current,document.activeElement&&wn){let ri=(Ze=($t=document.activeElement)==null?void 0:$t.value)==null?void 0:Ze.trim();typeof ri=="string"&&ve.current.model.commit(function(We){We.set(wn.data,"text",ri||"\u672A\u547D\u540D"),ve.current.commandHandler.stopCommand()},"increment")}Fe(On+1)}},Mt.createElement("span",{className:"current c-blue mr30",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77"))),onCancel:pe},Mt.createElement("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative",display:Qn.current?"none":"block"},className:Nt.flowChartWrp},Mt.createElement("div",{style:{display:"flex",height:"100%"}},Mt.createElement("div",{style:{width:"300px",height:"100%"}},Mt.createElement("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"}},"\u56FE\u5F62\u5E93"),Mt.createElement("div",{style:{height:"calc(100% - 50px)"},className:Nt.myPaletteDiv,ref:kn})),Mt.createElement("div",{style:{flex:1,position:"relative"}},Mt.createElement("div",{ref:zn,style:{height:"80vh"}}))),Mt.createElement("div",{className:"tr"},Mt.createElement(ae.ZP,{size:"large",onClick:Zn,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))))}var Ue=ye,Qe=kt(47889),ce=kt(71051);const Oe=Qe.ZP.Group,Le={margin:"0 8px"};var Xe=({callback:pe,onCancel:Se})=>{function ve(zn){pe(zn)}return pt.createElement(Gt.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:ve},pt.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},pt.createElement("span",{style:Le},"\u5355\u5143\u683C\u6570\uFF1A"),pt.createElement("span",{style:Le},"\u884C\u6570"),pt.createElement(Gt.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},pt.createElement(ce.Z,null)),pt.createElement("span",{style:Le},"\u5217\u6570"),pt.createElement(Gt.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},pt.createElement(ce.Z,null))),pt.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},pt.createElement("span",{style:Le},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),pt.createElement(Gt.default.Item,{name:"align"},pt.createElement(Oe,null,pt.createElement(Qe.ZP,{value:"default"},pt.createElement("i",{className:"fa fa-align-justify"})),pt.createElement(Qe.ZP,{value:"left"},pt.createElement("i",{className:"fa fa-align-left"})),pt.createElement(Qe.ZP,{value:"center"},pt.createElement("i",{className:"fa fa-align-center"})),pt.createElement(Qe.ZP,{value:"right"},pt.createElement("i",{className:"fa fa-align-right"}))))),pt.createElement("div",{className:"flex-container flex-end"},pt.createElement(ae.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),pt.createElement(ae.ZP,{type:"ghost",onClick:Se},"\u53D6\u6D88")))},vn=kt(71411),cn=kt(91e3),hn=kt.n(cn),Ge=(0,pt.forwardRef)(({use3d:pe,width:Se,height:ve,callback:zn,showSaveButton:kn},Qn)=>{const $e=(0,pt.useRef)(),On=(0,pt.useRef)(),[Fe,Pe]=(0,pt.useState)(!1),Zn=(0,pt.useRef)({id:$e,appName:"graphing",width:Se||1e3,height:ve||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,pt.useEffect)(()=>{On.current=new(hn())(Zn.current,!0),window.onload=function(){On.current.inject("applet_container")}},[]);const $t=()=>{var Ze=window.ggbApplet.getPNGBase64(1,!0,72);return zn&&zn(Ze),Ze};return(0,pt.useEffect)(()=>{Zn.current.appName=Fe?"3D":"graphing",On.current.inject("applet_container")},[Fe]),(0,pt.useEffect)(()=>{Pe(pe)},[pe]),(0,pt.useImperativeHandle)(Qn,()=>({getImgData:$t})),pt.createElement(pt.Fragment,null,pt.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:$e}),pt.createElement(sn.Z,{align:"middle"},pt.createElement(Lt.Z,{flex:1},pt.createElement(vn.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:Fe,onChange:Ze=>Pe(Ze)})),pt.createElement(Lt.Z,null,pt.createElement(ae.ZP,{size:"large",onClick:$t,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),Je=kt(88831),rn=kt(6767);const Xn="link",Ln="upload-image",nn="add-flowchart",Kn="draw-image",mi="add-flowchart",ei="code-block",Si="add-table",Wi="------------",An={default:Wi,left:`:${Wi}`,center:`:${Wi}:`,right:`${Wi}:`};var gn=kt(23206);function Rn(){}let si=0;const xi=1e4,di="\u2581",Oi="@\u2581\u2581@",wt="@\u2581@",yn=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`,Wn=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"];function ki(pe){return/^\d+$/.test(pe)?`${pe}px`:pe}const ur=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",Mr={[ur+"-B"]:"bold",[ur+"-I"]:"italic"},gi={[Xn]:"\u6DFB\u52A0\u94FE\u63A5",[ei]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[Ln]:"\u6DFB\u52A0\u56FE\u7247",[Kn]:"\u6DFB\u52A0\u753B\u56FE",[nn]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[Si]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var bn=({defaultValue:pe="",onChange:Se,width:ve="100%",height:zn=400,miniToolbar:kn=!1,isFocus:Qn=!1,watch:$e,insertTemp:On,mode:Fe="markdown",id:Pe="markdown-editor-id",showResizeBar:Zn=!1,noStorage:$t=!1,showNullButton:Ze=!1,showNullProgramButton:wn=!1,hidetoolBar:ri=!1,fullScreen:We=!1,onBlur:je,onCMBeforeChange:Vn,onFullScreen:ci,className:Mi="",disablePaste:pi=!1,disabled:oi=!1,disabledFill:hi=!1,placeholder:Bi="",values:_i="",extraUse:Ki})=>{const[en,no]=(0,pt.useState)(null),[vr,Xr]=(0,pt.useState)(pe),[He,Hn]=(0,pt.useState)($e),[Fi,Hi]=(0,pt.useState)(We),[Ii,Yi]=(0,pt.useState)(""),[Ar,Pr]=(0,pt.useState)(0),[Br,Fr]=(0,pt.useState)(zn),[fn,io]=(0,pt.useState)(!1),[pn,Di]=(0,pt.useState)(0),[$i,Ai]=(0,pt.useState)(0),bo=(0,pt.useRef)(),Fo=(0,pt.useRef)(),ao=(0,pt.useRef)(),co=(0,pt.useRef)();(0,pt.useEffect)(()=>{const Ei=window.scrollY||window.pageYOffset;Xr(_i),en==null||en.setValue(_i),window.scrollTo(0,Ei)},[_i]),(0,pt.useEffect)(()=>{ci==null||ci(Fi)},[Fi]),(0,pt.useEffect)(()=>{if(bo.current){let Ei=function(ln,Pi){var qi;if(pi){Pi.preventDefault();return}const Tr=Pi.clipboardData;if(Tr){const Lr=Tr.types.toString(),Rr=Tr.items;if(Lr==="Files"||Tr.types.indexOf("Files")>-1){if(Pi.preventDefault(),Fe=="stex")return;try{let Zr=Rr[1];((qi=Rr[0])==null?void 0:qi.kind)==="file"&&(Zr=Rr[0]);const jr=Zr.getAsFile(),Co=jr.name.split(".").pop();(0,De.I)(jr,vo=>{var Uo,Be,Wr;vo.id?((Uo=jr==null?void 0:jr.type)==null?void 0:Uo.indexOf("image"))>-1?yi.replaceSelection(`<img width="100%" src="/api/attachments/${vo.id}?type=${vo.content_type})" alt="" />`):((Be=jr==null?void 0:jr.type)==null?void 0:Be.indexOf("video"))>-1?yi.replaceSelection(`<video width="100%" controls src="/api/attachments/${vo.id}"></video>`):((Wr=jr==null?void 0:jr.type)==null?void 0:Wr.indexOf("pdf"))>-1?yi.replaceSelection(`<a href="/api/attachments/${vo.id}?type=${jr.type}&disposition=inline" target="_blank">${jr.name}</a>`):Wn.includes(Co)?yi.replaceSelection(`<a href="/api/attachments/${vo.id}?type=office&disposition=inline" target="_blank">${jr.name}</a>`):yi.replaceSelection(`[${jr.name}](/api/attachments/${vo.id}?type=${vo.content_type})`):(vo==null?void 0:vo.status)===401&&(document.location.href="/user/login")})}catch(Zr){rn.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const yi=le().fromTextArea(bo.current,{mode:Fe,lineNumbers:!kn,lineWrapping:!0,value:pe,autoCloseTags:!0,autoCloseBrackets:!0});return yi.on("keyup",function(ln,Pi){Pi.keyCode===8&&(ln.getValue()==""?yi.setOption("placeholder",Bi):yi.setOption("placeholder",null))}),yi.on("keydown",function(ln,Pi){if(Pi.keyCode===8){var qi=mn(ln);qi&&Pi.preventDefault()}}),Qn&&yi.focus(),yi.on("paste",Ei),oi&&yi.on("beforeChange",function(ln,Pi){(Pi.origin==="paste"||Pi.origin==="+input")&&Pi.cancel()}),no(yi),()=>{yi.off("paste",Ei)}}},[]);const Re=(0,pt.useCallback)(()=>{if(Fo.current)try{}catch(Ei){console.log(Ei,"---- to set md editor body height")}},[Br,Fo,Fi]);(0,pt.useEffect)(()=>{function Ei(){let yi=new Me.Z(ln=>{for(let Pi of ln)(Pi.target.offsetHeight>0||Pi.target.offsetWidth>0)&&(Re(),en.setSize("100%","100%"),en.refresh())});return yi.observe(bo.current.parentElement),yi}if(en){const yi=Ei();return()=>{var ln,Pi;(ln=bo.current)!=null&&ln.parentElement&&yi.unobserve((Pi=bo.current)==null?void 0:Pi.parentElement)}}},[en,Re]),(0,pt.useEffect)(()=>{if(en){let Ei=[];for(const[yi,ln]of Object.entries(Mr)){let Pi={[yi]:()=>{Ie(ln)}};Ei.push(Pi),en.addKeyMap(Pi)}return()=>{for(let yi of Ei)en.removeKeyMap(yi)}}},[en]),(0,pt.useEffect)(()=>{We!==Fi&&Hi(We)},[We]),(0,gn.Z)(()=>{if(!$t&&Ar>0){let Ei=new Date().getTime(),yi=window.sessionStorage.getItem(Pe);Ei>=Ar+xi&&(!yi||yi!==vr)&&(window.sessionStorage.setItem(Pe,vr),io(!0))}},xi),(0,pt.useEffect)(()=>{Hn($e)},[en,$e]),(0,pt.useEffect)(()=>{en&&Qn&&en.focus()},[en,Qn]),(0,pt.useEffect)(()=>{if(He&&en){let Ei=function(ln){let Pi=ln.target;if(co.current){let qi=Pi.scrollTop/Pi.scrollHeight;co.current.scrollTop=co.current.scrollHeight*qi}};const yi=en.getScrollerElement();return yi.addEventListener("scroll",Ei),()=>{yi.removeEventListener("scroll",Ei)}}},[en,He]),(0,pt.useEffect)(()=>{if(en&&Vn){let Ei=function(yi,ln){Vn(yi,ln)};return en.on("beforeChange",Ei),()=>{en.off("beforeChange",Ei)}}},[en,Vn]),(0,pt.useEffect)(()=>{if(en&&je){let Ei=function(){je(en.getValue())};return en.on("blur",Ei),()=>{en.off("blur",Ei)}}},[en,je]);function mn(Ei,yi){var ln=Ei.getDoc(),Pi=ln.getCursor(),qi=ln.getLine(Pi.line),Tr=qi.charAt(Pi.ch-1),Lr=qi.lastIndexOf("@\u2581@",Pi.ch),Rr=qi.lastIndexOf("@\u2581\u2581@",Pi.ch),Zr=Lr>Rr?Lr:Rr,jr=Lr>Rr?3:4;if(Oi.indexOf(Tr)===-1)return null;if(console.log("change1:",yi,Ei,qi,Pi,Zr,Lr,Rr,Tr),Zr>=0&&Pi.ch-Zr<5){var Co=Zr+jr;return ln.replaceRange("",{line:Pi.line,ch:Zr},{line:Pi.line,ch:Co}),{line:Pi.line,ch:Co}}return null}(0,pt.useEffect)(()=>{if(en){let Ei=function(yi,ln){const Pi=yi.getValue();Xr(Pi),Pr(new Date().getTime()),yi.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Se&&(wn?Se(Pi,$n(Pi)):Se(Pi))};return en.on("change",Ei),()=>{en.off("change",Ei)}}},[en,Se]),(0,pt.useEffect)(()=>{if(en)if(pe==null)en.setValue(""),Xr("");else{const Ei=window.scrollY||window.pageYOffset;pe!==en.getValue()&&(en.setValue(pe),Xr(pe),en.setCursor(oi?1:en.lineCount(),0),window.scrollTo(0,Ei))}},[en,pe]);const Ie=(0,pt.useCallback)(Ei=>{const yi=en.getCursor(),ln=en.getSelection();let Pi=ln.split(`
`);switch(Ei){case"bold":return en.replaceSelection("**"+ln+"**"),ln===""&&en.setCursor(yi.line,yi.ch+2),en.focus();case"italic":return en.replaceSelection("*"+ln+"*"),ln===""&&en.setCursor(yi.line,yi.ch+1),en.focus();case"code":return en.replaceSelection("`"+ln+"`"),ln===""&&en.setCursor(yi.line,yi.ch+1),en.focus();case"inline-latex":return Yi("inline-latex"),en.focus();case"latex":return en.replaceSelection("```latex\n"+ln+"\n```"),en.setCursor(yi.line+1,ln.length+1),en.focus();case"line-break":return en.replaceSelection(`<br/>
`),en.focus();case"list-ul":return ln===""?en.replaceSelection("- "+ln):en.replaceSelection(Pi.map(qi=>qi===""?"":`- ${qi}`).join(`
`)),en.focus();case"list-ol":return ln===""?en.replaceSelection("1. "+ln):en.replaceSelection(Pi.map((qi,Tr)=>qi===""?"":`${Tr+1}. ${qi}`).join(`
`)),en.focus();case"add-null-ch":return ln===""&&en.setCursor(yi.line,yi.ch),en.replaceSelection(di),en.focus();case"add-signal":return ln===""&&en.setCursor(yi.line,yi.ch),en.replaceSelection(wt),en.focus();case"add-multiple":return ln===""&&en.setCursor(yi.line,yi.ch),en.replaceSelection(Oi),en.focus();case"inster-template-1":return ln===""&&en.setCursor(yi.line,yi.ch),en.replaceSelection(yn),en.focus();case"eraser":return en.setValue(""),en.focus();case"trigger-watch":return Hn(!He),en.focus();case"trigger-full-screen":return Hi(!Fi),en.focus();case Xn:Yi(Xn);return;case ei:Yi(ei);return;case Ln:Yi(Ln);return;case Kn:Yi(Kn);return;case"maths-latex":Yi("maths-latex");return;case nn:Yi(nn);return;case Si:Yi(Si);return;default:throw new Error}},[en,He,Fi]),At=(0,pt.useCallback)((Ei,yi)=>{var ln,Pi,qi,Tr,Lr,Rr;switch(Yi(""),Ii){case Xn:const{title:Uo,link:Be}=Ei;return en.replaceSelection(`[${Uo}](${Be})`),en.focus();case ei:const{language:Wr,content:qr}=Ei;return en.replaceSelection(["```"+Wr,qr,"```"].join(`
`)),en.focus();case"maths-latex":for(var Zr=atob(Ei),jr=new Uint8Array(Zr.length),Co=0;Co<Zr.length;Co++)jr[Co]=Zr.charCodeAt(Co);var vo=new Blob([jr],{type:"image/png"});(0,De.I)(vo,aa=>{aa.id?en.replaceSelection(`![,](/api/attachments/${aa.id}?type=${aa.content_type})`):(aa==null?void 0:aa.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":en.replaceSelection("`$$"+Ei+"$$`");break;case Ln:case Kn:case mi:const{src:fr,alt:Qr}=Ei,hr=yi,zo=(qi=(Pi=(ln=hr==null?void 0:hr.name)==null?void 0:ln.split("."))==null?void 0:Pi.pop)==null?void 0:qi.call(Pi);return((Tr=hr==null?void 0:hr.type)==null?void 0:Tr.indexOf("image"))>-1||!(hr!=null&&hr.type)?hr!=null&&hr.align||hr!=null&&hr.width?en.replaceSelection(`<p style="text-align:${hr.align||"initial"}"><img width="${hr.width?hr.width+"%":"initial"}" src="${fr}" alt="${Qr||""}" /></p>`):en.replaceSelection(`<img width="100%" src="${fr}" alt="${Qr||""}" />`):((Lr=hr==null?void 0:hr.type)==null?void 0:Lr.indexOf("video"))>-1?en.replaceSelection(`<video width="100%" controls src="${fr}"></video>`):((Rr=hr==null?void 0:hr.type)==null?void 0:Rr.indexOf("pdf"))>-1?en.replaceSelection(`<a href="${fr}?type=${hr.type}&disposition=inline" target="_blank">${hr.name}</a>`):Wn.includes(zo)?en.replaceSelection(`<a href="${fr}?type=office&disposition=inline" target="_blank">${hr.name}</a>`):en.replaceSelection(`[${hr.name}](${fr})`),en.focus();case Si:const{row:Eo,col:Jr,align:Dr}=Ei;let za=`
`;for(let aa=0;aa<Eo;aa++){let es=[],La=[];for(let ir=0;ir<Jr;ir++)aa===1&&La.push(An[Dr]),es.push(" ");aa===1&&(za+=`| ${La.join(" | ")} |
`),za+=`| ${es.join(Jr===1?"":" | ")} |
`}return en.replaceSelection(za+`
`),en.focus();default:throw new Error}},[en,Ii]),Un=(0,pt.useMemo)(()=>{switch(Ii){case Xn:return pt.createElement(_n,{callback:At,onCancel:Nn});case ei:return pt.createElement(Pn.Z,{callback:At,onCancel:Nn});case Ln:return pt.createElement(De.Z,{callback:At,onCancel:Nn});case nn:return pt.createElement(Ue,{callback:At,onCancel:Nn});case Si:return pt.createElement(Xe,{callback:At,onCancel:Nn});case"maths-latex":return pt.createElement(Ge,{showSaveButton:!0,callback:At});case"inline-latex":return pt.createElement(Je.Z,{showSaveButton:!0,callback:At});default:return null}},[Ii]);function Nn(){Yi("")}(0,pt.useEffect)(()=>{if(ao.current){let Ei=function(Lr){qi=!0,Tr=Lr.pageY},yi=function(){qi=!1},ln=function(Lr){if(qi){let Rr=Lr.pageY-Tr;Rr<0&&(Rr=0),Rr>300&&(Rr=300);let Zr=zn+Rr+"px";Fr(Zr)}},Pi=ao.current,qi=!1,Tr=0;return Pi.addEventListener("mousedown",Ei),document.addEventListener("mousemove",ln),document.addEventListener("mouseup",yi),()=>{Pi.removeEventListener("mousedown",Ei),document.removeEventListener("mousemove",ln),document.removeEventListener("mouseup",yi)}}},[en,ao]),(0,pt.useEffect)(()=>{Fr(zn)},[zn]);const Yn=ki(ve),ai=ki(Br),vi={width:Yn,height:ai},Cn=(0,pt.useMemo)(()=>{if(Ar){let Ei=new Date(Ar),yi=Ei.getHours(),ln=Ei.getMinutes(),Pi=Ei.getSeconds();return yi=yi<10?"0"+yi:yi,ln=ln<10?"0"+ln:ln,Pi=Pi<10?"0"+Pi:Pi,`${yi}:${ln}:${Pi}`}return 0},[Ar]),$n=Ei=>{const yi=[];if(wn){let ln=-1;Ei=Ei.replace(/(@▁▁@|@▁@)/g,function(Pi,qi,Tr){yi.push({multiLine:Pi!==wt})})}return yi};function ti(){window.sessionStorage.removeItem(Pe),io(!1),Pr(0)}function ii(){io(!1),Pr(0),en.setValue(window.sessionStorage.getItem(Pe))}(0,pt.useEffect)(()=>{gi[Ii]&&Ii!==Kn&&Ii!==nn&&setTimeout(()=>{const Ei=document.getElementsByClassName("markdown-popup-form")[0],yi=window.innerWidth/2-Ei.offsetWidth/2,ln=window.innerHeight/2-Ei.offsetHeight/2;Di(yi),Ai(ln)},0)},[Ii]);const ni=Ei=>{Ei.preventDefault();const yi=Ei.clientX-pn,ln=Ei.clientY-$i;document.body.onmousemove=Pi=>{let qi=Pi.clientX-yi,Tr=Pi.clientY-ln;const Lr=document.getElementsByClassName("markdown-popup-form")[0],Rr=window.innerWidth-Lr.offsetWidth,Zr=window.innerHeight-Lr.offsetHeight;qi=Math.max(0,Math.min(qi,Rr)),Tr=Math.max(0,Math.min(Tr,Zr)),Vi(Pi.clientX,Pi.clientY,yi,ln)&&(Di(qi),Ai(Tr))},document.body.onmouseup=function(){document.body.onmousemove=null}},Vi=(Ei,yi,ln,Pi)=>{const qi=document.body.clientHeight,Tr=document.body.clientWidth;return Ei<20&&ln>Ei||Ei>Tr-20&&ln<Ei||yi<20&&Pi>yi||yi>qi-20&&Pi<yi?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return pt.createElement(pt.Fragment,null,pt.createElement("div",{className:"markdown-editor-wrapper",ref:Fo},pt.createElement("div",{className:`markdown-editor-container ${Mi} ${He?"on-preview":""} ${kn?"mini":""} ${Fi?"full-screen":""}`,style:vi},pt.createElement(Jt,{insertTemp:On,watch:He,fullScreen:Fi,showNullButton:Ze,showNullProgramButton:wn,onActionCallback:Ie,hidetoolBar:ri,extraUse:Ki}),pt.createElement("div",{className:"markdown-editor-body"},pt.createElement("div",{className:"codemirror-container"},pt.createElement("textarea",{ref:bo,placeholder:Bi})),He?pt.createElement("div",{ref:co,className:"preview-container"},Fe==="stex"&&pt.createElement(ie,{value:vr}),Fe!=="stex"&&pt.createElement(Ae.Z,{disabledFill:hi,showProgramFill:wn,value:vr})):null))),Zn?pt.createElement("a",{ref:ao,className:"editor-resize"}):null,Ii===Kn&&pt.createElement(Sn,{callback:At,onCancel:Nn}),Ii===nn&&pt.createElement(Ue,{callback:At,onCancel:Nn}),pt.createElement(Yt.Z,null,gi[Ii]&&Ii!==Kn&&Ii!==nn?pt.createElement(dn.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:pn,top:$i},title:pt.createElement("div",{style:{cursor:"move"},onMouseDown:ni},gi[Ii]),open:!0,onCancel:Nn,footer:null,destroyOnClose:!0,width:Ii===nn?"1200px":null,height:Ii===nn?"80vh":null,className:"markdown-popup-form"},Un):null))}},24141:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Z:function(){return Tt},I:function(){return Jt}});var pt=kt(28284),Ut=kt(6767),le=kt(37568),Me=kt(77736),ue=kt(71051),It=kt(47889),qt=kt(99571),ge=kt(55322),ne=kt(59301),Rt=kt(59301),Ae=Object.defineProperty,ie=Object.defineProperties,Ee=Object.getOwnPropertyDescriptors,Bt=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,ht=(Yt,Gt,me)=>Gt in Yt?Ae(Yt,Gt,{enumerable:!0,configurable:!0,writable:!0,value:me}):Yt[Gt]=me,st=(Yt,Gt)=>{for(var me in Gt||(Gt={}))nt.call(Gt,me)&&ht(Yt,me,Gt[me]);if(Bt)for(var me of Bt(Gt))et.call(Gt,me)&&ht(Yt,me,Gt[me]);return Yt},gt=(Yt,Gt)=>ie(Yt,Ee(Gt));const{useForm:vt}=pt.default,St={width:280,marginRight:10},Et={labelCol:{span:5},wrapperCol:{span:19}};var Tt=({callback:Yt,onCancel:Gt})=>{const[me]=vt();let ae=(0,ne.useRef)();function Ne(tn){ae.current.width=me.getFieldValue("width"),ae.current.align=me.getFieldValue("align"),Yt(tn,ae.current)}function Ce(tn,_e){if(tn.status===-1){Ut.ZP.error(tn.message);return}me.setFieldsValue({src:`/api/attachments/${tn.id}`,type:_e.type})}function we(tn){let _e=tn.target.files[0];ae.current=_e,Jt(_e,Ce)}return Rt.createElement(pt.default,gt(st({form:me},Et),{className:"upload-image-panel",onFinish:Ne,style:{width:470,overflow:"hidden"}}),Rt.createElement(pt.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},Rt.createElement("div",{className:"flex-container"},Rt.createElement(pt.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},Rt.createElement(le.default,{style:St})),Rt.createElement(Dt,{onFileChange:we}))),Rt.createElement(pt.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},Rt.createElement(le.default,{style:{width:264}})),Rt.createElement(pt.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},Rt.createElement(Me.Z,null,Rt.createElement(pt.default.Item,{name:"width",style:{margin:0}},Rt.createElement(ue.Z,{style:{width:264}})),Rt.createElement("span",{className:"ml8"},"%"))),Rt.createElement(pt.default.Item,{label:"\u5BF9\u9F50\u65B9\u5F0F",name:"align"},Rt.createElement(It.ZP.Group,{name:"align",defaultValue:1,options:[{value:"left",label:"\u5DE6\u5BF9\u9F50"},{value:"center",label:"\u5C45\u4E2D\u5BF9\u9F50"},{value:"right",label:"\u53F3\u5BF9\u9F50"}]})),Rt.createElement("aside",null,Rt.createElement(pt.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},Rt.createElement(qt.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),Rt.createElement(qt.ZP,{type:"default",onClick:Gt},"\u53D6\u6D88"))))};function Dt({onFileChange:Yt}){return Rt.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",Rt.createElement("input",{type:"file",onChange:Yt}))}function Jt(Yt,Gt){if(!Yt)throw new String("\u6CA1\u6709\u6587\u4EF6");let me=new FormData;me.append("editormd-image-file",Yt),me.append("file_param_name","editormd-image-file"),me.append("byxhr","true");var ae=new window.XMLHttpRequest;ae.withCredentials=!0,ae.addEventListener("load",function(Ne){Gt(JSON.parse(Ne.target.responseText),Yt)},!1),ae.addEventListener("error",function(Ne){console.error(Ne)},!1),ae.open("POST",`${ge.KI}/api/attachments.json`),ae.send(me)}},52272:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Z:function(){return le}});var pt=kt(59301),Ut=kt(4676);class le extends pt.Component{constructor(ue){super(ue);const It=window.document;this.node=It.createElement("div"),It.body.appendChild(this.node)}render(){const{children:ue}=this.props;return(0,Ut.createPortal)(ue,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},89081:function(Dn,Gn,kt){"use strict";kt.d(Gn,{SV:function(){return Kt},ZP:function(){return Mt}});var pt=kt(59301),Ut=kt(76374);const le={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},Me={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},ue={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},It={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
`)}]},qt={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],quickKey:[{label:"println",content:["println($0)"].join(`
`)}]};var ge=kt(53184),ne=kt.n(ge),Rt=Object.defineProperty,Ae=Object.defineProperties,ie=Object.getOwnPropertyDescriptors,Ee=Object.getOwnPropertySymbols,Bt=Object.prototype.hasOwnProperty,nt=Object.prototype.propertyIsEnumerable,et=(ye,Ue,Qe)=>Ue in ye?Rt(ye,Ue,{enumerable:!0,configurable:!0,writable:!0,value:Qe}):ye[Ue]=Qe,ht=(ye,Ue)=>{for(var Qe in Ue||(Ue={}))Bt.call(Ue,Qe)&&et(ye,Qe,Ue[Qe]);if(Ee)for(var Qe of Ee(Ue))nt.call(Ue,Qe)&&et(ye,Qe,Ue[Qe]);return ye},st=(ye,Ue)=>Ae(ye,ie(Ue)),gt=(ye,Ue,Qe)=>new Promise((ce,Oe)=>{var Le=cn=>{try{vn(Qe.next(cn))}catch(hn){Oe(hn)}},Xe=cn=>{try{vn(Qe.throw(cn))}catch(hn){Oe(hn)}},vn=cn=>cn.done?ce(cn.value):Promise.resolve(cn.value).then(Le,Xe);vn((Qe=Qe.apply(ye,Ue)).next())});const vt={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},St=(ye,Ue)=>Ue.map(Qe=>({label:Qe,kind:ye.languages.CompletionItemKind.Keyword,insertText:Qe})),Et=ye=>Object.keys(vt.tables).map(Ue=>({label:Ue,kind:ye.languages.CompletionItemKind.Variable,insertText:Ue})),Tt=(ye,Ue)=>{const Qe=vt.tables[ye];return Qe?Qe.map(ce=>({label:ce,kind:Ue.languages.CompletionItemKind.Field,insertText:ce})):[]};function Dt(ye,Ue,Qe,ce,Oe){let Le=Ue.getWordUntilPosition(Qe),Xe={startLineNumber:Qe.lineNumber,endLineNumber:Qe.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn},vn=ce.map(cn=>({label:cn,kind:ye.languages.CompletionItemKind.Keyword,insertText:cn,insertTextRules:ye.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Xe}));return Oe.map(cn=>{vn.push(st(ht({},cn),{range:Xe}))}),vn}var Jt=ye=>{vt.languages.map(Oe=>(ye.languages.registerDocumentFormattingEditProvider(Oe,{provideDocumentFormattingEdits(Le,Xe,vn){return gt(this,null,function*(){const cn=ne()(Le.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1});return[{range:Le.getFullModelRange(),text:cn}]})}}),Oe));const Ue=ue.quickKey.map(Oe=>({label:Oe.label,kind:ye.languages.CompletionItemKind.Method,insertText:Oe.content,insertTextRules:ye.languages.CompletionItemInsertTextRule.InsertAsSnippet})),Qe=It.quickKey.map(Oe=>({label:Oe.label,kind:ye.languages.CompletionItemKind.Method,insertText:Oe.content,insertTextRules:ye.languages.CompletionItemInsertTextRule.InsertAsSnippet})),ce=Me.quickKey.map(Oe=>({label:Oe.label,kind:ye.languages.CompletionItemKind.Method,insertText:Oe.content,insertTextRules:ye.languages.CompletionItemInsertTextRule.InsertAsSnippet}));ye.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Oe,Le){var Xe=Oe.getWordUntilPosition(Le),vn={startLineNumber:Le.lineNumber,endLineNumber:Le.lineNumber,startColumn:Xe.startColumn,endColumn:Xe.endColumn},cn=Oe.getLineContent(Le.lineNumber).substring(Xe.startColumn-2,Xe.endColumn);return{suggestions:[...ue.keywords.map(hn=>({label:hn,kind:ye.languages.CompletionItemKind.Function,documentation:hn,insertText:hn,insertTextRules:ye.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:vn})),...ue.quickKey.map(hn=>({label:hn.label,kind:ye.languages.CompletionItemKind.Function,documentation:hn.content,insertText:cn.startsWith("#")?hn.content.replace(/#/,""):hn.content,insertTextRules:ye.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:vn}))]}}}),ye.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Oe,Le){var Xe=Oe.getWordUntilPosition(Le),vn={startLineNumber:Le.lineNumber,endLineNumber:Le.lineNumber,startColumn:Xe.startColumn,endColumn:Xe.endColumn};return{suggestions:[...le.keywords.map(cn=>({label:cn,kind:ye.languages.CompletionItemKind.Function,documentation:cn,insertText:cn,insertTextRules:ye.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:vn}))]}}}),ye.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Oe,Le){var Xe=Oe.getWordUntilPosition(Le),vn={startLineNumber:Le.lineNumber,endLineNumber:Le.lineNumber,startColumn:Xe.startColumn,endColumn:Xe.endColumn},cn=Oe.getLineContent(Le.lineNumber).substring(Xe.startColumn-2,Xe.endColumn);return{suggestions:[...Me.keywords.map(hn=>({label:hn,kind:ye.languages.CompletionItemKind.Function,documentation:hn,insertText:hn,insertTextRules:ye.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:vn})),...Me.quickKey.map(hn=>({label:hn.label,kind:ye.languages.CompletionItemKind.Function,documentation:hn.content,insertText:cn.startsWith("#")?hn.content.replace(/#/,""):hn.content,insertTextRules:ye.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:vn}))]}}}),ye.languages.registerCompletionItemProvider("scala",{provideCompletionItems:function(Oe,Le){var Xe=Oe.getWordUntilPosition(Le),vn={startLineNumber:Le.lineNumber,endLineNumber:Le.lineNumber,startColumn:Xe.startColumn,endColumn:Xe.endColumn},cn=Oe.getLineContent(Le.lineNumber).substring(Xe.startColumn-2,Xe.endColumn);return{suggestions:[...qt.keywords.map(hn=>({label:hn,kind:ye.languages.CompletionItemKind.Function,documentation:hn,insertText:hn,insertTextRules:ye.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:vn})),...qt.quickKey.map(hn=>({label:hn.label,kind:ye.languages.CompletionItemKind.Function,documentation:hn.content,insertText:cn.startsWith("#")?hn.content.replace(/#/,""):hn.content,insertTextRules:ye.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:vn}))]}}}),ye.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Oe,Le){var Xe=Oe.getWordUntilPosition(Le),vn={startLineNumber:Le.lineNumber,endLineNumber:Le.lineNumber,startColumn:Xe.startColumn,endColumn:Xe.endColumn},cn=Oe.getLineContent(Le.lineNumber).substring(Xe.startColumn-2,Xe.endColumn);return{suggestions:[...It.keywords.map(hn=>({label:hn,kind:ye.languages.CompletionItemKind.Function,documentation:hn,insertText:hn,insertTextRules:ye.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:vn})),...It.quickKey.map(hn=>({label:hn.label,kind:ye.languages.CompletionItemKind.Function,documentation:hn.content,insertText:cn.startsWith("#")?hn.content.replace(/#/,""):hn.content,insertTextRules:ye.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:vn}))]}}})};const Yt="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var Gt=Object.defineProperty,me=(ye,Ue,Qe)=>Ue in ye?Gt(ye,Ue,{enumerable:!0,configurable:!0,writable:!0,value:Qe}):ye[Ue]=Qe,ae=(ye,Ue,Qe)=>me(ye,typeof Ue!="symbol"?Ue+"":Ue,Qe);const Ne=class px{constructor(Ue,Qe,ce){this.placeholder=Ue,this.editor=Qe,this.monaco=ce,Qe.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return px.ID}getDomNode(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.style.width="max-content",this.domNode.textContent=this.placeholder,this.domNode.style.fontStyle="initial",this.domNode.style.color="#D7D7D7",this.domNode.style.pointerEvents="none",this.editor.applyFontInfo(this.domNode)),this.domNode}getPosition(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}dispose(){this.editor.removeContentWidget(this)}};ae(Ne,"ID","editor.widget.placeholderHint");var we=Ne,tn=kt(96236),_e=kt(6767),an=kt(25399),Ke=kt(89392),oe=kt(16448),Xt=kt(56102),qe=Object.defineProperty,_n=Object.defineProperties,Pn=Object.getOwnPropertyDescriptors,De=Object.getOwnPropertySymbols,dn=Object.prototype.hasOwnProperty,sn=Object.prototype.propertyIsEnumerable,jn=(ye,Ue,Qe)=>Ue in ye?qe(ye,Ue,{enumerable:!0,configurable:!0,writable:!0,value:Qe}):ye[Ue]=Qe,Te=(ye,Ue)=>{for(var Qe in Ue||(Ue={}))dn.call(Ue,Qe)&&jn(ye,Qe,Ue[Qe]);if(De)for(var Qe of De(Ue))sn.call(Ue,Qe)&&jn(ye,Qe,Ue[Qe]);return ye},Sn=(ye,Ue)=>_n(ye,Pn(Ue)),ee=(ye,Ue)=>{var Qe={};for(var ce in ye)dn.call(ye,ce)&&Ue.indexOf(ce)<0&&(Qe[ce]=ye[ce]);if(ye!=null&&De)for(var ce of De(ye))Ue.indexOf(ce)<0&&sn.call(ye,ce)&&(Qe[ce]=ye[ce]);return Qe},Mn=(ye,Ue,Qe)=>new Promise((ce,Oe)=>{var Le=cn=>{try{vn(Qe.next(cn))}catch(hn){Oe(hn)}},Xe=cn=>{try{vn(Qe.throw(cn))}catch(hn){Oe(hn)}},vn=cn=>cn.done?ce(cn.value):Promise.resolve(cn.value).then(Le,Xe);vn((Qe=Qe.apply(ye,Ue)).next())});function ui(ye){return/^\d+$/.test(ye)?`${ye}px`:ye}function _t(){}let Lt=!1;const Pt={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python",Scala:"scale",solidity:"sol"};function Nt(ye=[]){let Ue=ye;if(Array.isArray(ye)){for(let Qe=0;Qe<ye.length;Qe++){let ce=Pt[ye[Qe]];if(ce)return ce}return Ue[0]}return Pt[Ue]||Ue}let zt=null;var Mt=ye=>{var Ue=ye,{width:Qe="100%",height:ce="100%",value:Oe,language:Le="javascript",style:Xe={},options:vn={},overrideServices:cn={},theme:hn="vs-dark",onEditBlur:Ti,isCopy:Ge=!1,onSave:Je,autoHeight:rn=!1,forbidCopy:Xn=!1,onChange:Ln=_t,editorDidMount:nn=_t,onFocus:Kn=_t,onBreakPoint:mi=_t,breakPointValue:ei=[],filename:Si="educoder.txt",errorLine:Wi,errorContent:An="",highlightLine:gn,openBreakPoint:Rn=!1,placeholder:si="",showMiniMap:xi=!0}=Ue,di=ee(Ue,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder","showMiniMap"]);const Oi=(0,pt.useRef)(),wt=(0,pt.useRef)({}),yn=(0,pt.useRef)(),Wn=(0,pt.useRef)(),ki=(0,pt.useRef)([]),Ui=(0,pt.useRef)(!1),ur=(0,pt.useRef)(),Mr=(0,pt.useRef)(),gi=(0,pt.useRef)(!1),[bn,pe]=(0,pt.useState)(!1);function Se(){let je;return Oi.current&&(je=new Ut.Z(Vn=>{for(let ci of Vn)(ci.target.offsetHeight>0||ci.target.offsetWidth>0)&&wt.current.instance.layout()}),je.observe(Oi.current)),je}function ve(){_e.ZP.warning({content:decodeURIComponent(Yt),key:"monaco-editor-tip"})}const zn=()=>{let je=wt.current.instance;if(Oe!=null&&je&&bn){const Vn=je.getModel();Vn&&Oe!==Vn.getValue()&&(Lt=!0,Vn.setValue(Oe),je.layout(),Lt=!1)}};(0,pt.useEffect)(()=>{const je=oe.Z.subscribe("formatDocument",Vn=>{var ci;let Mi=wt.current.instance;(ci=Mi==null?void 0:Mi.getAction)==null||ci.call(Mi,"editor.action.formatDocument").run()});return window.updateMonacoValue=Vn=>{Ln(Vn)},je},[]),(0,pt.useEffect)(()=>{var je;let Vn=wt.current.instance;Wn.current&&clearTimeout(Wn.current),Wn.current=setTimeout(()=>{zn()},500),Oe&&(Oe!=null&&Oe.length)&&((je=Vn==null?void 0:Vn.updateOptions)==null||je.call(Vn,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(Oe.split(/\r\n|\r|\n/g).length))+3,5)}))},[Oe,bn,wt.current]),(0,pt.useEffect)(()=>{if(Wi&&wt.current&&wt.current.instance){let Vn=wt.current.instance;Vn.changeViewZones(function(ci){var Mi=document.createElement("div");Mi.style.padding="10px 20px",Mi.style.width="calc(100% - 20px)",Mi.className="my-error-line-wrp",Mi.innerHTML=An,ci.addZone({afterLineNumber:Wi||11,heightInLines:3,domNode:Mi})});var je={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};Vn.addOverlayWidget(je),Vn.revealPositionInCenter({lineNumber:20,column:1})}},[Wi,wt.current,bn]);const kn=(je="",Vn)=>{if(!je||je.trim()==="")return!0;const Mi=wt.current.instance.getModel().getLineTokens(Vn);let pi=!1;for(let oi=0;oi<2;oi++)Mi.getStandardTokenType(oi)===1&&(pi=!0);return pi};(0,pt.useEffect)(()=>{var je;const Vn=(je=wt.current)==null?void 0:je.instance;if(Vn&&bn&&Xn){const ci=Vn.onDidBlurEditorWidget(()=>{gi.current=!1}),Mi=Vn.onDidFocusEditorText(()=>{gi.current=!0});return()=>{ci.dispose(),Mi.dispose()}}},[wt.current,bn,Xn]),(0,pt.useEffect)(()=>{var je;if((je=wt.current)!=null&&je.instance&&bn&&Rn){let Vn=wt.current.instance,ci=Vn.getModel();if(!ci)return;(()=>{var He;let Hn=[],Fi=[];const Hi=ci.getAllDecorations();for(let Yi of Hi)Yi.options.className==="highlighted-line"&&(Hn.push((He=Yi==null?void 0:Yi.range)==null?void 0:He.startLineNumber),Fi.push(Yi==null?void 0:Yi.id));if(gn===Hn[0])return;ci.deltaDecorations(Fi,[]);const Ii=ci.getLineCount();gn&&gn<=Ii&&(Vn.deltaDecorations([],[{range:new zt.Range(gn,1,gn,ci.getLineMaxColumn(gn)),options:{isWholeLine:!0,className:"highlighted-line"}}]),Vn.revealLineInCenter(gn))})();const pi=(He=!1)=>{var Hn;let Fi=[],Hi=[];const Ii=ci.getAllDecorations();for(let Yi of Ii)Yi.options.linesDecorationsClassName==="breakpoints-select"&&(Fi.push((Hn=Yi==null?void 0:Yi.range)==null?void 0:Hn.startLineNumber),Hi.push(Yi==null?void 0:Yi.id));if(He)return{lines:Fi,ids:Hi};mi(Fi)},oi=He=>Mn(void 0,null,function*(){let Hn={range:new zt.Range(He,1,He,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield ci.deltaDecorations([],[Hn]),pi()}),hi=He=>Mn(void 0,null,function*(){let Hn=[];const Fi=Vn.getLineDecorations(He);for(let Hi of Fi)Hi.options.linesDecorationsClassName==="breakpoints-select"&&Hn.push(Hi.id);yield ci.deltaDecorations(Hn,[]),pi()}),Bi=He=>{let Hn=Vn.getLineDecorations(He);for(let Fi of Hn)if(Fi.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,Ke.isEqual)(ei,pi(!0).lines)){ci.deltaDecorations(pi(!0).ids,[]);const He=ei.map(Hn=>({range:new zt.Range(Hn,1,Hn,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));ci.deltaDecorations([],He)}const _i=Vn.onDidChangeModelContent(He=>{let Hn=Vn.getPosition();if(Hn){let Fi=Hn.lineNumber;clearTimeout(Mr.current),Mr.current=setTimeout(()=>{kn(ci.getLineContent(Fi),Fi)?hi(Fi):Bi(Fi)?(hi(Fi),oi(Fi)):pi()},100)}}),Ki=Vn.onMouseDown(He=>{var Hn,Fi,Hi;if(He.target.detail&&((Hi=(Fi=(Hn=He.target)==null?void 0:Hn.element)==null?void 0:Fi.className)!=null&&Hi.includes("line-numbers"))){let Ii=He.target.position.lineNumber;if(kn(ci.getLineContent(Ii),Ii))return;Bi(Ii)?hi(Ii):oi(Ii)}}),en=He=>{let Hn={range:new zt.Range(He,1,He,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};ki.current=Vn.deltaDecorations(ki.current,[Hn])},no=()=>{ki.current=Vn.deltaDecorations(ki.current,[])},vr=Vn.onMouseMove(He=>{var Hn,Fi,Hi;if(no(),He.target.detail&&((Hi=(Fi=(Hn=He.target)==null?void 0:Hn.element)==null?void 0:Fi.className)!=null&&Hi.includes("line-numbers"))){let Ii=He.target.position.lineNumber;if(kn(ci.getLineContent(Ii),Ii))return;en(Ii)}}),Xr=Vn.onMouseLeave(()=>{no()});return()=>{_i.dispose(),Ki.dispose(),vr.dispose(),Xr.dispose()}}},[wt.current,bn,ei,gn,Rn,Le]),(0,pt.useEffect)(()=>{var je;(je=wt.current)!=null&&je.instance&&Rn&&wt.current.instance.setPosition({lineNumber:0,column:0})},[gn]);function Qn(){let je=wt.current.instance;if(je){const Vn=je.getSelection(),ci=wt.current.pastePos||{},Mi=new zt.Range(ci.startLineNumber||Vn.endLineNumber,ci.startColumn||Vn.endColumn,ci.endLineNumber||Vn.endLineNumber,ci.endColumn||Vn.endColumn);setTimeout(()=>{je.executeEdits("",[{range:Mi,text:""}])},300)}}function $e(je){(window.navigator.platform.match("Mac")?je.metaKey:je.ctrlKey)&&je.keyCode==83&&(je.preventDefault(),Je())}const On=()=>{if(rn&&wt.current.instance){const je=wt.current.instance.getContentHeight();ri(je<ce?ce:je)}else ri(ce)};function Fe(je){var Vn=document.createEvent("MouseEvents");Vn.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),je.dispatchEvent(Vn)}const Pe=je=>{if(!gi.current)return;const{keyCode:Vn,ctrlKey:ci,metaKey:Mi,target:pi,type:oi}=je;return(oi==="paste"||(Vn===67||Vn===86)&&(Mi||ci))&&pi.nodeName==="TEXTAREA"&&(ve(),je.preventDefault()),!1};function Zn(je,Vn){var ci=window.URL||window.webkitURL||window,Mi=new Blob([Vn]),pi=document.createElementNS("http://www.w3.org/1999/xhtml","a");pi.href=ci.createObjectURL(Mi),pi.download=je,Fe(pi)}(0,pt.useEffect)(()=>{On()},[On]),(0,pt.useEffect)(()=>{Oi.current&&!bn&&Promise.all([kt.e(8909),kt.e(7960)]).then(kt.bind(kt,71448)).then(je=>{try{zt=je,wt.current.instance=zt.editor.create(Oi.current,{value:Oe,language:Nt(Le),theme:hn,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:xi||!1}},cn);const Vn=wt.current.instance;let pi=[...tn.BH._menuItems].find(_i=>_i[0]._debugName=="EditorContext")[1],oi=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],hi=(_i,Ki)=>{var en,no;let vr=_i._first;do Ki.includes((no=(en=vr.element)==null?void 0:en.command)==null?void 0:no.id)&&_i._remove(vr);while(vr=vr.next)};if(nn(Vn,zt),setTimeout(()=>{On(),wt.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{Zn(Si||"educoder.txt",Vn.getValue())}})},500),wt.current.subscription=Vn.onDidChangeModelContent(_i=>{Ui.current?clearTimeout(ur.current):(On(),Ln(Vn.getValue(),_i)),ur.current=setTimeout(()=>{Ui.current=!1},500)}),window.Monaco||Jt(zt,Nt(Le)),Xn&&(hi(pi,oi),Oi.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Pe),window.removeEventListener("paste",Pe),window.addEventListener("keydown",Pe),window.addEventListener("paste",Pe)),window.Monaco=zt,Ti&&Vn.onDidBlurEditorWidget(()=>{Ti(Vn.getValue())}),Kn&&Vn.onDidFocusEditorText(()=>{Kn(Vn.getValue())}),Xn)try{Vn.onDidPaste(_i=>{const Ki=Vn.getSelection(),en=wt.current.pastePos||{},no=new zt.Range(en.startLineNumber||Ki.endLineNumber,en.startColumn||Ki.endColumn,en.endLineNumber||Ki.endLineNumber,en.endColumn||Ki.endColumn);Vn.executeEdits("",[{range:_i.range,text:""}])})}catch(_i){}let Bi=Se();return si&&typeof si=="string"&&new we(si,Vn,zt),pe(!0),()=>{const _i=wt.current.instance;_i.dispose();const Ki=_i.getModel();Ki&&Ki.dispose(),wt.current.subscription&&wt.current.subscription.dispose(),Bi.unobserve(Oi.current)}}catch(Vn){}})},[]),(0,pt.useEffect)(()=>{if(wt.current.instance&&bn)return document.addEventListener("keydown",$e,!1),()=>{document.removeEventListener("keydown",$e)}},[Je,bn]),(0,pt.useEffect)(()=>{let je=wt.current.instance;if(je&&bn){let Vn=Nt(Le);zt.editor.setModelLanguage(je.getModel(),Vn)}},[Le,bn]),(0,pt.useEffect)(()=>{wt.current.instance&&bn&&zt.editor.setTheme(hn)},[hn,bn]),(0,pt.useEffect)(()=>{let je=wt.current.instance;yn.current=vn,je&&bn&&(je.updateOptions(Te({},vn)),setTimeout(()=>{je.getModel().updateOptions(Te({},vn))},200))},[JSON.stringify(vn),bn]),(0,pt.useEffect)(()=>{let je=wt.current.instance;je&&bn&&je.layout()},[Qe,ce,bn]);const[$t,Ze]=(0,pt.useState)(ui(Qe)),[wn,ri]=(0,pt.useState)(ui(ce)),We=Sn(Te({},Xe),{width:$t,height:wn,position:"relative"});return pt.createElement("div",{className:"my-monaco-editor",ref:Oi,style:We},Ge&&pt.createElement(Xt.CopyToClipboard,{text:Oe,onCopy:()=>_e.ZP.success("\u590D\u5236\u6210\u529F")},pt.createElement(an.Z,{title:"\u590D\u5236\u4EE3\u7801"},pt.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},pt.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function Kt({width:ye="100%",height:Ue="100%",original:Qe,modified:ce,language:Oe,options:Le={}}){const Xe=(0,pt.useRef)(),[vn,cn]=(0,pt.useState)(null);function hn(rn){let Xn;return Xe.current&&(Xn=new Ut.Z(Ln=>{for(let nn of Ln)(nn.target.offsetHeight>0||nn.target.offsetWidth>0)&&rn.layout()}),Xn.observe(Xe.current)),Xn}(0,pt.useEffect)(()=>(Xe.current&&Promise.all([kt.e(8909),kt.e(9404)]).then(kt.bind(kt,2550)).then(rn=>{zt=rn;const Xn=zt.editor.createDiffEditor(Xe.current,Sn(Te({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Le),{wordWrap:!0}));cn(Xn);let Ln=hn(Xn);return()=>{Xn.dispose();const nn=Xn.getModel();nn&&nn.dispose(),Ln.unobserve(Xe.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,pt.useEffect)(()=>{vn&&vn.setModel({original:zt.editor.createModel(Qe,Oe),modified:zt.editor.createModel(ce,Oe)})},[Qe,ce,Oe,vn]);const Ti=ui(ye),Ge=ui(Ue),Je={width:Ti,height:Ge};return pt.createElement("div",{className:"my-diff-editor",ref:Xe,style:Je})}},46133:function(Dn,Gn,kt){"use strict";kt.d(Gn,{jL:function(){return ue},w9:function(){return dn},QD:function(){return Ln},cQ:function(){return Xt},op:function(){return hn},O5:function(){return Mr},_b:function(){return Wi},t7:function(){return st},Gi:function(){return Mn},YG:function(){return Sn},qp:function(){return Ae},vr:function(){return mi},qE:function(){return Je},Je:function(){return St},wb:function(){return tn},cq:function(){return zt},tp:function(){return Bt}});var pt=kt(59301),Ut={flex_box_center:"flex_box_center___NeSU8",flex_space_between:"flex_space_between___ImTGl",flex_box_vertical_center:"flex_box_vertical_center___BtRd9",flex_box_center_end:"flex_box_center_end___qcLe3",flex_box_column:"flex_box_column___Ze_3q",banner:"banner___PoUBO",content:"content___XoDjy",btns:"btns___Pb35j"},le="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE4AAAA0CAYAAAAkEw66AAAAAXNSR0IArs4c6QAAGNVJREFUeF7VmwmwHVWdxr9zuvvu9+3ZXsxCiNkIQZOwEzMgyADjggsWgzPqOAJaMiCjYiGKqDBQAo4iWGAxA+ooMm7gBhSyhBBRIIBSAQlrHuTt7913t97PmfpOd4cXlLAFGO6rW9237719+/z6+6/nPIHX+XHttddaex38nlW2lLO1svq1wJ4aeFMM9CqFnNKoaYVapDAOicfjGEMKqKk2nrx59Lbt5xx6aPR6DEG8Hj/K3xwY0YtjSx2vYnlspLEsX0BRKUBrINtyX+PZp0r3fR+IIgzFSo9EsahFUfSHWIj7Pa919zvf2vlo+rFXdWivObjHJvR8S6vTJORHckV0+4GBAF4InwQlBCAIkEMXgCLA9Mn9WCef4ft8HWkgVIDn6ckwUA/HQfCzoFX71TsP6n/41aL3moHTWotnJnGysPEFx8ZcAtMqGTjh2NmVTL+iDB6BZurjsRSe2SogjhNwMZIngbZbqgXom8N26/KjV3femB7ebRxfE3DbRnW/k8c3LQvv5yCjOFVVqhgCyNnJmAhoxyOFasz1OeCM2lLTJryI4BQQUn1RAhI24Lc1dBjc2K6Nnv2edfP+sLvIvergxqb0vpHA1fk8lre9xBZpZsYKU9sMYiDvAHKaqU4HuANcZrIpcILiezRdo7z0aUw3BoJYI4gELAeI/bjZmBq9+PGNd5x/+unHua8U4KsKbriujxUSV9gW+rwg9WPTfpHgpEgUQgAFJwU6LSDwjSxA8F2jslSBBJaZKwVGJRv1pSAJLyQ8qlwLOA4Q1us31Z58+OTj3rX/E68E3qsGbmhK/6Nt40oIFMJwZ5URFh/cZoGgHQKODeSsaUEiA5iSy6IqYRnfmPq66YojPILbYbqpGXuhRhRrFPMSUaP+6OTAtuPff8ze97xceK8KuJGG/oBl4XsaKMTTsiwDKVXZjm1qsgRBU84TXi5VXqo24/syP5ce2xEg0gBDeAZWFijo79JnpLQxXSo7iICiIyD8qUfdxuQRRx24x5MvB95uBzfW1G+XFn4GoMMojQNOYWUK45b+jG9mW+PvFNAKEkqVYgI583VZcOB7WRrCqGwiaQovU1lAlaXKM/BMQNIGbN0FLGh0lySCVv0OP3aPOnKf2a2XCm+3ghuc1AvzOdwmLSwIwkQlBoxMtgZYCkvwQLafBYo0l2v6gBcCxRxQyifwM9PckRCniXIGbjo8wiI4bgnRRFul0XAZMABbaggVoytvo12vff7Qt/Rc8LqBm5jQndrBr3MFHOwyemaJbGaaAKzMp00zV2O+6VVnSTCPcYCNdrItEGAOcKxpVUQKLjPZ6VHVgEuf3Kf/rLk0Y4ViTpiAEUYKJaEgVDg2OTq1+j3r5w68FHi7TXFDU/El1Yr8VLudDM4IjUpLVWW2Mg0GgubybATNfN/0C5+eqjQ9oO0ngAmR0ZF5X2bKjLRZBUFgNE03AKhcPqk62wJsm+qjvyM4Aa0idFN1zcmvHraq90uvObihqej4YsH6nzCEyHwRB0WFZeZJ05xupsZSp6sty+2mXX2a/5rP0fT8MAHRZpmWph48J38zi6xUF1Vqft9KAg2BES6PmyChGGFTBVJ1kb/dq7XeeuTBs0deLLxXrLhHn2nP6+4s3Gk7Yl6Q5mpZMMjAGWjT0o+dgkR6BVnUzJSW2PpzhpHVqIygdPiEET3rzwiHP2QCSlrjUm1epE0el+R1/E6SmjDa2nGEat5Bu9089bC9O7/1moDT0GJkMv5eR6f1oVY7MRfjp2SiNgOO5pkFBpnkadmD/qflRrAtiUrBhJFdPnauJhI6SU6noXSyb2BmUZUqzYKEqSSSZ6SUSU34WagYVUsg9N27R7DtkONWrmRcf8HHK1Lc4EjrqHJn6ZdxBIsXkXU2MqVZqU/ja5ZU/MyWR5/Bps1/wfD2p+G7TUy1QziWRHfZgVXsREd3H1YtnoW+vl709nSjv7f0V4MwPnRaRUGlxSm8rG7N0pAMlim/CE4Jk+tRbTxmAoYK4Qit/Mhb9/a9eze9ILW/YQwv5jvmM/fcs720YMnMDeWStabtJrmVUVaqtsy3sRqgAm+96yH85qbb4DZqWNjfi57uHlRKJViWjSCM0Wr5aDRaqDebqDeaqLkRLFugp7OIQudMrFn+JvT3z8Ee8+dgVldxp+tkpUB42ZZgqLrEnyUq89MkODkunjVVoREFMao5G367een6lZ2fejEQXrbiBgbbn+qZUbyETcWs2KZ/Ynsoi6aMgEPjLVz6Xz/B1OjT2P8tyzB7Zm/i6IMQYRghDGk2ielkLaKIPiiM4PshGk0XzWYDU40a6m6Ickmi3N2Lt+y1B5a+eQ+sXLIQM7rLxi1QiR47I2l3xPizFFyitsQnmqhq8juNks1go2BrDRG4WwMv3veItT1TLwTvZYH7w0NP9y7sn3NPqSgXMiCYRuNz1MbE9eEnRnDhpVdh1fxu7L1iCYIwghcECKMYUfaMY4Rh8jogxJgQNQjP+CECpUK4H8bwPR8tgmzW0Ao8lEsW+vrn4sA1S7Fs2VKsXDIP1UrO3BymMD7PEwvj6wJjnjTTJFAEsUJOJj4y8iMUWIfE8bp1Kzs2virgtg23PtHTV7os9JI0wASFNPWg4vI54LGBMZz/je/i71YvQv/sWXA9D2EYIooiAzCOYoRxDM/z4Xo+PC+Az2MR31NpkU4fpKGUQKRkoiSCjCSiSCAKVPLddgON9hQsK0TXjA7su3YVDjt0Hdbu82ZzbQYgVZb6OJOW0GQjZW54XtACInTkHXjt5kXr9+r4zG4Hd/bZZ8uTTz1rY7liHxiHiR9h+sFAQHNxJMulCGed/x2jtHlv6ofruogILaZpEl6MIAiML2u1XQRhaIDxeKZGqoEAObgoTkBGkUp7bvRRfC0QRpZRkYqk6SjHcYDQryNXVNj/oLX4yIc/iMULZyVVSFr0GxVmlQWDg0xSFG5j372rV1fXr1wpdhldX7Kpbn2mtbqrs7jRkqLIC6VDzgIBwZUKwGXfuwFjA49g331WoO26CSwDh/BieK6HyakaPM9LTZbv0WQJL0r2o9ioMkhN2gDka0JkDhYpExW1FtCQEMKGlg6gbWhTxjPFaKBvZgUfP/njOHz9WrRS5QXG9AkvzeXoHxXrVw0n9puxEm8+dGVlaFeqe8ngBifiT1Y65aUha7+0+M7Sj0IeeOixYXznO1fiHQfvY1REs4wiBoIAcRQZkBOTk/B9P1GSCRBBoraQn/dTmDxOiATGLV+nioxjA49wINjAY4YtIaQFwX1hQYtkn/AtW+Okfzsdf/+OA9H2Uj+XdoiZltBebaGh2a9DrONYvfdtK8q/2L3gaurXxaI4WqUJJH2ETTPltVsaX73wvzG7IjGrrwce4RhoieKCMMDY+LiBZ2AwGJjAQKg0Sx6jCrWBmQAlTJo3vx+ZvIvOXLBEEAJCMPFNQrkBBwnNfcuGMFAFlIqRyxdw+he/gv1WL0PDTftzSicd41jBYaURa/SUHLTrjc+vX9mxy47JS1LcpoGB4qKOuZvzebFMpyUPT0BoTD023P0wfvWL67DfPsvhut4O80z8Woip+hQma41UWVQRDMwEXIQ43Se4OApSYEAYeAijwADSmp1RghPGt3Kb5MMJxEx9VJ2QNu8mYNlQUYj+hUtx9nnnolIpw83KrrSSMOCURmfOQejWr37bis6P7DbFba/ptZal77SlyPFy6WC5ZedBKYWLLrkKs6oOCvl8AoR+zWwjeL6L4dFRuJ5CEGpTsEeBQBD4iFWMWEWIwjpU6Ca+kNswNll+zCgECSkcKM02CQtS/nK0oxPDFDzRIYFSfYRIcFRfzgDktRz7z5/E8Scci7ar0g4xc0aePen0VaSAiLxHutVTe6/cRfn1khQ3OBEdU6xYv4oZbzjJopJISrX96aFtuOaH12D5ogXw/QABVZQFhCDC5NQ4xienEIQCbijh+RKTvXPhVYrIPTGAXLOOOJ4AwhAxzTKomTTEdHy1l/guc5voWTmXSPWFSVAwf7FRH83YuD5jxgQooS3HqE9Bomf2fJx9wcXo7KjAp3swLSZApjPeJUvDioLBkttYvHZtf/v5VPeSwD09Fp9Z7pDnEhzvD1MEqo2d2ut+swEPbr4fM3p7jIqYbhjlBKHxdcMjQ0ZtXmjDbSsMLFqJx048AWDWv/kvWPjNy2DXB5hXAHEIpZqwZNVct1INSFkyoJRyE1g6hjaFnp2IDyrxezqFaMClHQdjsjljsrzuk8/4Cg46ZF9zPQYc05k0qpYswFH+uCW9VYcsm7F994CbiL5fKlkf4lyC1nSswnRlWcBfftVP0RgZRqGQR2jKKd/4JZrpxOQExicmEIQWvDCHhu9gyz99FN76VQCt0AZmnnUxSg/cAUuGEKoJaBdSZjVpBCk7EnDahxRlKHCfjbccNPMis29mWSGMH6TqNKQxWStJVayccQvrjv4ATj7lRLTcpL1k2kym0GUJJlASvuvo6JADV3RtfsngbtXa3gsoBA3k3Rakb8GtiuiaUtk+xveUqRjoU9gmKuYFLr/yGkwMjSBH5xrQ4dNPBaYiGBwehOu24QUCXuhgSnTjsTPOQDxvRjqjrNB31tdRfvwB5O0cEI9BaA9SVhCpGqA56+NAa/oIC5AER2XlmfdDhT60FLBoxlYAof0UnjLukAo1arPyxhev2vcAnHbWOSaJNmWe6elRCAm4TukrS0XvOGivrt+9aHDba8GaQt56r4A8XADztYIVKgimXH6M7iDUebackzJLIm8LlIsSP/jRz/HU1ieQcywDLnHwAWq1BsbGR5M6lYrzJEZmLsHw5z8LlOm0AWwfQ885X0Ol/oypHRFPwpZF2FYXwngEgoBEHpEaNwpTyJsqROsCgupMtFeshLt8Oap/ug8d998CKQgvgICfRFppm/QEBAdg1oIlOOMrF6BcLsAPlCnHIjPvClQcgW4nhFThPxy8ovPXLwjugaGh8uxyzwXlvPOxsoPC9PUaZpYoLZobHtAMtAEhoVDKSXSUHdy+YSN+d9MGFKm4NK0gwKHhUTSaNZPL+ZEFzwXGVrwNk6edlkDjHMLmrei78DzkLR8W18qoEUiRgxR5xKoJ2+ox4EJVh5B9UDqPel8vWgccAW/Naug5Myk84OkJzDn3FOTbIwacFASXJMSC/XOZhxISHTP6ceZ5F6GzuxNekEb5IKlIOvISvU7AhPiog5ZVbtgluE0DurigHPx4RnfunXQXbNJm8wEZQAYCphDs99c9YMqDKbALtjJNyNGRQVx++dWwtDA5GHMyz/ewfXAYntdE4AfwjFkINHsXY+JzXwPmdptGXunKH6D79uuRzxVhqwBKDSFnzTTRNIrHIQXz+RAxTVF1obFqPcY/ehLQVU2CLG+AApwNGzHjR99GTk0Bqg0pvCQ9sRxIY6o5aGmjWOnCmed/A70zZ8INmCpxbGwoAF0Fgd5cEBVkfNj+Szvu2CW4rUPumTN6C+faCijwxqTTeNmXssV+bM1w9oiqm2wToELgt1AtSHQULVxzzU/w5/u2mKUMcRCg3W7hmeFhBF4rKaPY6WDGJDrQnrcUrdX7wRkcQuXe22HHU7CFgDT+zE/AKR9au7CsPkSqAWWiaieG3nkCvPe9G+DSGQrqwUdRuHUjylvvQS4ahaObELoBAVqFSCsJzto4Jkg4OQdn/sd/ord/Plw/MtAIj5Y1oywxq+DXrThae8CKzq3PC+6ux4dndRZ67uut2nM68sn6jWxtx/QvZebKiWKCq7WAmtm2IZSPGR0FjI9uxxVXfB+tqTokYgNu++AQVOSZ1EErunSWRBXTyYASkLIAbdGnMBhI6Lhu5COlA61Ck39JUTHRVAtO73ej0TMbEyeeBj1vjlGauP8RVL7/A+SDQdiowVF1SN02UVaa2fAkl2NU5TNnC5z+5QswY/5iuG4EN1KmhtWxwNwuBws7w+G85S1ftaBr8nnB3f1Y8/hqtfzDzhzQU0qm0v4WOLam6ecIjl2GWhuYaFF5IcamJtFZtNDX4WDzvZvxv9dej9BzoaIIo+Oj0FEAzSxfhyYSa50W5iAU20RNafIuwmol/k0yGPAGJJ0OZSJqHkqWEcU22vPegua/nAR0dxvVWZv+iI6fXomcrsNRDWhNU9UmAWZoVVYOgsFBOCjlLXzqjC+ia+6eaHsRmp5GMScxu8NCf4eF7qKIRBQ8mnfkz4PQ/83SuX/d2BSbHmne3Fktv72vDHQUEsWxGnjuIwPH3hf93FQbGKnTXDUeGhiCFDFmVHPoKlu49dYN+O1vb4alYozXpqBjggvNBHDyYIHDhJVQ+IiSYolFuXHqBQhGT+VCWiUTGaOYQIuIhYWQ34tLcBeugH/ch4DuXmBkEJXvXoB8ewwWXGiT77GWSBoA9G9cKBcLB92dFZx02umI8r0m9Vszv4QVsx10FYUZu7GuNHeuN1XkB9FN7Xbwmb0XVh/KuIhNWwOvs2Tn+6rCZAecITezU9PWc5i0Ml0JZKbfwsTHDU0Bky6wYcs20w7qrThGeaW8xJ0bN+HW2+5Eo9k0lQT9jWkEMVHl2dnhoNp4VLBc4uI4JrKRAcgEO7HDXFLQE64oGNz0k0pUkvUhCxZDrz4A4tEHkXvwLtgihNSJa0gEQNfAXp0NZTnGVSxeuADHHHcCpJXD+9f0YcUc2zRgn6sXnr9O3yeBlqeGJyfDE1cvKlxvkuvfP6512QF6y8kCFwYHllHZsgSezAwh7ZhyPIRHH/fMJDDWAn72x8dQb7XRVbZNoKgWLBRyAvfe/wBuuf0u1CYnIWVaQ9K5pRMrdNw8v5khM2rjZ2iYVGJWfxJunJbwBGjm0kx6ohj/zQpryyS82lKQpopgI0AnLodmaop9C4rVAwTWH3wgluy9Fh/cbxbWLSqa6idbJfpcS3PNupNkQnuioVrDk976I1eV7xW3b2lvL5eKczoLQKWQrIqk6rIeWwYuWw1kymwFTLaAgQlgsK5xxa1bUGu66ChYqOSpXMss4Ms5EtsGnsatGzahMTaWhutsLWsaug2s7F5nix7S/CKZ/08L+7RlZMqpDJ4hk62JShWbLj805Ve2II9zlCbJQqW7C/sftA4HrZiPUw/vRweD7S7A0a/XXW1SsLYSeGpIbxiZeOpIccufG8dVOys/5r2o5JNVQaw9WUrxhDRbk46k62/5moobbySKu397gK/9ZgsKFlDNSZQJzhHI2xKOJVDISTRbbfzpwS0YePxxxL73rJzNwNJZ62yG2dzydNlOUqVnK4PTdpKRWLqfLe/JPpO9nuZnTFRNyFj5Apbtswr5rpn4wpELcPiyqhHKrhTHsTJ4TLnCWNdgA3Dr/lHiuo2j1XJf7x2VvNiHTbZyBs9OA8U02zcTMjKJrsNTwEgT+NE9ow9864Ytt/dVZVDNW6LsSBT5XUsgZ7P7L5BzbDPX+qeHH8HAlr+YZQeJjSWpwk4P2pdhk05mcHfHa3YyzXKa9GD6mez9hOiOhHjHwjzzOzZ65s3B/D2XolSt7nnh+5a9a0mfZcZLkTz3MrJronVxoQ+ziPEWsL3GXDZ60NjIr/6sjynk8EsHEPRxDBK8E1ztw+k+njhHFTqJCTMl4Qm21eDd/KR7+NePLt35fPnO/8fj592ljz5sPn49rwBUC4mF0bqmp2HZMguKhOC4kpPpF8fNgLEjkPzyz/qzjo3zcwKSyqOfy2avePKuNHgwUjEB3j4FbB1R973/3zfsh9ten/+nerk35RM36MPfswdu2qMDoqOY9BO59jhb6zJdbVneyhSMixPpnphR7BSBr3tAf9i2cH45j9k0Dy58Zreitwr0dSRK5J0YbwJDLfo39eWTDrTOebkDeL2+13e5nnPZfrh/UTdmVvOJb6fq6OsIzziK9H8lCI6RldtMcX46ZbDT9V//oJ6fAz4iBI7VMfYp5SBmEFw1uTNcezFcB56YQPv329qHfPXo8n2vF4BX8rsXbdS/WD0L72ZThfA4NrqiLIdlMGSfjtBYn1Nx9HH1wDQ7Nj9v6/zGB3S5HWCvUlFfvWiGWMYFQpQzzXSoAfxlWD1w0X1y33tPEkyy33CPk6/TBx8yF7f05pDjuIrOzuaaVUoExxKT43a5akFCtVys3+Wcwweu1dbHV+LxN3VhPsEx8jANGfOAh4eiL5x0iHPeG47YtAv+9I3xp9f0yIvLDAw6ySIY/ExSnpkqVcels/x/syLgtXHpx9bhlF2CO/tanVuzHHfPqmJVOf0nNdr5SFP7D02Eb/3iEfkdtdsbFeCXbtYfXlDGueU85iKZsjXZklnpyZdpGmgWFcS4pGsQnzvuOBG/4CzXFX/Qp+zZi28pPzkZHeNIS337X2+Qp+IckWajb1RsyXWffqOeN8tRH+rKyWOhsSBnYyYziiCAa0k8EQKb2kF01acPc3akXS8IbsW1Onf6AnVib16ewqWz21vq9qu2yNPeqL7thW7xZ65391jcV1jE/1qKFcaeCfDwOYeK9D83nv32/wHzrWgvjJ8Q7AAAAABJRU5ErkJggg==",ue=({dataSource:gi=[],img:bn,imgWidth:pe=346,title:Se,sunTitle:ve,bannerExtraContent:zn})=>pt.createElement("div",{className:Ut.banner},pt.createElement("div",{className:Ut.content},pt.createElement("aside",null,pt.createElement("p",null,pt.createElement("b",null,Se),pt.createElement("span",null,ve)),gi.length>0&&pt.createElement("div",{className:Ut.btns},gi.map((kn,Qn)=>pt.createElement("div",{key:Qn,onClick:kn.click},kn.name,kn.sign?pt.createElement("img",{src:le,width:39}):null))),zn),bn&&pt.createElement("img",{style:{marginTop:33,marginRight:38},src:bn,width:pe}))),It={flex_box_center:"flex_box_center___hG6RI",flex_space_between:"flex_space_between___ss3Fh",flex_box_vertical_center:"flex_box_vertical_center___K80p9",flex_box_center_end:"flex_box_center_end___qmXX3",flex_box_column:"flex_box_column___GFV8F",row:"row___aXJjm",title:"title___HUKL0",tagsWrap:"tagsWrap___XB2W3",action:"action___VdHb1",bar:"bar___t1kKC",tag:"tag___V7Eft",name:"name___Hk1Ip",num:"num___xQpcH",active:"active___XryTX",tagsBorderWrap:"tagsBorderWrap___OMxjs"},qt=kt(92310),ge=kt.n(qt),ne=kt(89392),Ae=({dataSource:gi=[],value:bn,onChange:pe,onTitleChange:Se,className:ve,title:zn,titleWidth:kn=41,style:Qn={},fontColor:$e="#6A7283",showCount:On})=>{const[Fe,Pe]=(0,pt.useState)(0),[Zn,$t]=(0,pt.useState)(!1),Ze=(0,pt.useRef)(null),wn=(0,pt.useRef)(null);return(0,pt.useEffect)(()=>{var ri;gi.length!==0&&(((ri=Ze==null?void 0:Ze.current)==null?void 0:ri.clientHeight)>97?Pe(1):Pe(0)),gi.length===0&&Pe(0),$t(!1)},[gi]),pt.createElement("div",{className:ge()(It.row,ve),style:Qn},pt.createElement("div",{onClick:(0,ne.throttle)(()=>Se==null?void 0:Se(),2e3),style:{width:kn,marginTop:Zn?12:4},className:`${It.title} ${Se?"current":""}`},zn),pt.createElement("div",{className:Zn?`${It.tagsWrap} ${It.tagsBorderWrap}`:It.tagsWrap},pt.createElement("div",{className:It.bar,ref:wn,style:Fe>0?{height:Fe===1?97:"auto",overflow:Fe===1?"hidden":"auto",paddingRight:55}:{paddingRight:0}},pt.createElement("div",{className:It.tag,ref:Ze},gi==null?void 0:gi.map(ri=>pt.createElement("span",{onClick:()=>pe(ri.id),key:ri.id,style:{color:$e},className:bn===ri.id?It.active:""},pt.createElement("span",{title:ri.name,className:It.name},ri.name),!!On&&pt.createElement("span",{className:It.num},ri.count))))),!!Fe&&pt.createElement(pt.Fragment,null,Fe===1?pt.createElement("div",{onClick:()=>{var ri;Pe(2),((ri=Ze==null?void 0:Ze.current)==null?void 0:ri.clientHeight)>245?$t(!0):$t(!1)},className:It.action},"\u5C55\u5F00",pt.createElement("i",{style:{transform:"translateY(1px) scale(0.6)"},className:"iconfont icon-zhankai4"})):pt.createElement("div",{onClick:()=>{wn.current.scrollTop=0,Pe(1),$t(!1)},className:It.action},"\u6536\u8D77",pt.createElement("i",{style:{transform:"translateY(0px) scale(0.6)"},className:"iconfont icon-shouqi3"})))))},ie={flex_box_center:"flex_box_center___aK2n3",flex_space_between:"flex_space_between___HX0Oh",flex_box_vertical_center:"flex_box_vertical_center___LJOJr",flex_box_center_end:"flex_box_center_end___SCakF",flex_box_column:"flex_box_column___AYv4m",tabs:"tabs___GTqPV",active:"active___F26E8"},Bt=({dataSource:gi=[],value:bn,onChange:pe,className:Se,style:ve={}})=>pt.createElement("div",{style:ve,className:ge()(ie.tabs,Se)},gi.map(zn=>pt.createElement("span",{onClick:()=>pe(zn.id),className:bn===zn.id?ie.active:"",key:zn.id},zn.name))),nt={flex_box_center:"flex_box_center___yX6Oa",flex_space_between:"flex_space_between___t7oqF",flex_box_vertical_center:"flex_box_vertical_center___dEIHy",flex_box_center_end:"flex_box_center_end___taQDF",flex_box_column:"flex_box_column___xY_Lr",input:"input___PW2zI",dropdown:"dropdown___vSy8B",menu:"menu___NiyBu",text:"text___Grueu",b1:"b1___ZKryM",b2:"b2___aKyGa"},et=kt(37568),st=({dataSource:gi=[],value:bn="",onChange:pe,onInputChange:Se=()=>{},className:ve,style:zn={},placeholder:kn,allowClear:Qn=!1})=>{var $e;const[On,Fe]=(0,pt.useState)(""),[Pe,Zn]=(0,pt.useState)("");(0,pt.useEffect)(()=>{var wn;let ri=bn;(wn=JSON.stringify(bn))!=null&&wn.includes("{")&&(Fe(bn.id),ri=bn.value||"");try{Zn(decodeURIComponent(ri||""))}catch(We){Zn(decodeURIComponent(ri||""))}},[bn]);const $t=()=>{pe(encodeURIComponent(Pe),On||null)},Ze=wn=>{wn!==On&&(Fe(wn),pe(encodeURIComponent(Pe),wn))};return pt.createElement("div",{className:ge()(nt.input,ve),style:zn},!!gi.length&&pt.createElement("div",{className:nt.dropdown},pt.createElement("div",{className:nt.text},($e=gi.find(wn=>wn.id===On))==null?void 0:$e.name,pt.createElement("i",{className:"iconfont icon-zhankai4"}),pt.createElement("b",{className:nt.b1}),pt.createElement("b",{className:nt.b2})),pt.createElement("div",{className:nt.menu},gi.map((wn,ri)=>pt.createElement("div",{key:ri,onClick:()=>Ze(wn.id)},wn.name)))),pt.createElement(et.default,{onPressEnter:$t,value:Pe,onChange:wn=>{Zn(wn.target.value),Se(encodeURIComponent(wn.target.value),On||null)},bordered:!1,placeholder:kn}),pt.createElement("i",{onClick:$t,className:"iconfont icon-sousuo9 font14 pl10 current"}))},gt={flex_box_center:"flex_box_center___tol8o",flex_space_between:"flex_space_between___Z235C",flex_box_vertical_center:"flex_box_vertical_center___Wq1sZ",flex_box_center_end:"flex_box_center_end___LLxom",flex_box_column:"flex_box_column___DbMSN",quickPager:"quickPager___GM30J",disabled:"disabled___Ozc8I"},St=({value:gi,onChange:bn,className:pe,total:Se,pageSize:ve,style:zn={}})=>{const kn=gi<2,Qn=gi>=Math.ceil(Se/ve);return Se<=ve?pt.createElement(pt.Fragment,null):pt.createElement("div",{className:ge()(gt.quickPager,pe),style:zn},pt.createElement("div",{onClick:()=>{kn||bn(gi-1,"prev")},className:kn?gt.disabled:""},"\u4E0A\u4E00\u9875"),pt.createElement("div",{onClick:()=>{Qn||bn(gi+1,"next")},className:Qn?gt.disabled:""},"\u4E0B\u4E00\u9875"))},Et={flex_box_center:"flex_box_center___FO7TP",flex_space_between:"flex_space_between___LotYx",flex_box_vertical_center:"flex_box_vertical_center___bWdaw",flex_box_center_end:"flex_box_center_end___mVJ1o",flex_box_column:"flex_box_column___M83Mm",list:"list___oOsiS",wrap:"wrap___G6T7F",lockWrap:"lockWrap___Rl79E",li:"li___oZZ7l",cover:"cover___b2bYW",img:"img___IQX7w",sign:"sign___HkT6C",name:"name___SsJx8",e:"e___TMqq0",tags:"tags___bcjyo",rate:"rate___YACg7"},Tt=kt(29787),Dt=kt(25399),Jt=kt(58018),Yt=kt(12242),Gt=kt(59895),me=kt(96908),ae=kt(57177),Ne=kt(81378),Ce=kt(12635),tn=({className:gi,dataSource:bn=[],col:pe=4,right:Se,bottom:ve=23,precision:zn=0,wrapWidth:kn=1200,trackEventItems:Qn,loading:$e})=>{const On=Math.floor((kn-(pe-1)*Se)/pe);return pt.createElement(Tt.Z,{spinning:$e},pt.createElement("div",{className:ge()(Et.list,gi)},!!bn.length&&bn.map((Fe,Pe)=>{const{name:Zn,id:$t,identifier:Ze,power:wn,cover_image_id:ri,pic:We}=Fe;return pt.createElement("div",{className:Et.wrap,key:$t,style:{width:On,marginRight:(1+Pe)%pe===0?0:Se+zn,marginBottom:ve}},pt.createElement("a",{target:"_blank",href:`/shixuns/${Ze}/challenges`,className:Et.li,onClick:je=>{je.preventDefault(),Qn&&(0,Gt.L9)([Qn]),wn&&(0,Gt.xg)(`/shixuns/${Ze}/challenges`)}},pt.createElement("div",{className:Et.img},pt.createElement("img",{className:Et.cover,src:`${We}`}),Fe.is_jupyter&&pt.createElement("img",{className:Et.sign,src:me}),Fe.is_jupyter_lab&&pt.createElement("img",{className:Et.sign,src:ae}),Fe.is_unity_3d&&pt.createElement("img",{className:Et.sign,src:Ne})),pt.createElement("div",{className:Et.name},pt.createElement(Dt.Z,{title:Zn||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"},pt.createElement("span",{className:Et.e},Zn||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"))),pt.createElement("div",{className:Et.tags},pt.createElement(Dt.Z,{placement:"bottom",title:"\u5173\u5361\u6570"},pt.createElement("span",null,pt.createElement("i",{className:"iconfont icon-shixunguanqia font14 mr2"}),pt.createElement("span",null,Fe.challenges_count))),!!Fe.myshixuns_count&&pt.createElement(Dt.Z,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},pt.createElement("span",null,pt.createElement("i",{className:"iconfont icon-chengyuan font14 mr2"}),pt.createElement("span",null,Fe.myshixuns_count))),pt.createElement(Dt.Z,{placement:"bottom",title:"\u96BE\u5EA6\u7B49\u7EA7"},pt.createElement("span",null,pt.createElement("span",null,Fe.level))),pt.createElement("div",{className:Et.rate},pt.createElement(Jt.Z,{allowHalf:!0,disabled:!0,defaultValue:Fe.score_info}),pt.createElement("span",null,"\xA0",Fe.score_info?`${Fe.score_info}\u5206`:"5\u5206")))),!wn&&pt.createElement("div",{className:Et.lockWrap},pt.createElement("img",{src:`${Yt.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),pt.createElement("span",{className:"mt15 font16 c-white"},"\u5B9A\u5411\u5F00\u653E\u5185\u5BB9\uFF0C\u9700\u8981\u6388\u6743")))}),!bn.length&&pt.createElement(Ce.Z,null)))},_e={flex_box_center:"flex_box_center___AQ53o",flex_space_between:"flex_space_between___i2aIa",flex_box_vertical_center:"flex_box_vertical_center___sPEKB",flex_box_center_end:"flex_box_center_end___GhSSH",flex_box_column:"flex_box_column___R9_Hb",list:"list___jb2Ay",wrap:"wrap___VsQDr",lockWrap:"lockWrap___g1k1T",li:"li___IxCLC",cover:"cover___Mu8wr",img:"img___IpFLA",movebq:"movebq___mF7wt",bq:"bq___Bil0T",sign:"sign___DXJ4d",name:"name___l7FoJ",e:"e___pXQUG",unit:"unit___wCIFR",tags:"tags___w_Mil",tag1:"tag1___dxm7r",tag2:"tag2___llZkf"},an=kt(69669),Ke=kt(59301),Xt=({className:gi,dataSource:bn=[],col:pe=4,right:Se,bottom:ve=23,precision:zn=0,wrapWidth:kn=1200,trackEventItems:Qn,loading:$e,onRemove:On=()=>{},isCurrent:Fe=!0,showAlias:Pe=!1})=>{const Zn=Math.floor((kn-(pe-1)*Se)/pe),$t=[{name:"\u63A8\u8350\u81EA\u5B66",ptimg:"/images/tjzx.png",swimg:"/images/sw_tjzx.png"},{name:"101\u8BA1\u5212",ptimg:"/images/jh.png",swimg:"/images/sw_jh.png"},{name:"\u56FD\u5BB6\u4E00\u6D41",ptimg:"/images/gjyl.png",swimg:"/images/sw_gjyl.png"},{name:"\u7701\u7EA7\u4E00\u6D41",ptimg:"/images/sjyl.png",swimg:"/images/sw_sjyl.png"},{name:"\u7CBE\u54C1\u8BFE\u7A0B",ptimg:"/images/jpkc.png",swimg:"/images/sw_jpkc.png"},{name:"\u519B\u961F\u4E00\u6D41",ptimg:"/images/jdyl.png",swimg:"/images/sw_jdyl.png"},{name:"\u65B0\u578B\u6559\u6750",ptimg:"/images/xxjc.png",swimg:"/images/sw_xxjc.png"}];return Ke.createElement(Tt.Z,{spinning:$e},Ke.createElement("div",{className:ge()(_e.list,gi)},!!(bn!=null&&bn.length)&&(bn==null?void 0:bn.map((Ze,wn)=>{var ri;const{name:We,id:je,identifier:Vn,featured:ci,school_name:Mi,image_url:pi,excellent:oi,is_plan:hi}=Ze;return Ke.createElement("div",{key:je,className:_e.wrap,style:{width:Zn,marginRight:(1+wn)%pe===0?0:Se+zn,marginBottom:ve}},Ke.createElement("a",{className:_e.li,onClick:Bi=>{Bi.preventDefault(),Bi.stopPropagation(),Qn&&(0,Gt.L9)([Qn]),(0,Gt.xg)(`/paths/${Vn}`)}},Ke.createElement("div",{className:_e.img},Ke.createElement("img",{className:_e.cover,src:`${pi}`}),Fe&&(0,an.bg)()&&(Ze==null?void 0:Ze.studying)&&Ke.createElement("div",{className:`${_e.movebq} user-path-items`,onClick:Bi=>{Bi.stopPropagation(),On(Ze)}},Ke.createElement("i",{className:"iconfont icon-yichu1 mr5 c-red"}),Ke.createElement("span",{className:"c-red"},"\u79FB\u9664")),(ri=Ze==null?void 0:Ze.subject_tags)==null?void 0:ri.map((Bi,_i)=>{var Ki,en;if(_i===0){const vr=(Ki=$t.find(Xr=>Xr.name==Bi))==null?void 0:Ki.swimg;return Ke.createElement("img",{className:_e.sign,src:vr,style:{left:"-4px"}})}const no=(en=$t.find(vr=>vr.name==Bi))==null?void 0:en.ptimg;return Ke.createElement("img",{className:_e.sign,src:no,style:{left:`${48+52*(_i-1)+2*_i}px`}})}),Ke.createElement("div",{style:{position:"absolute",top:"150px",left:"4px"}},(Ze==null?void 0:Ze.excellent)&&Ke.createElement("div",{className:_e.bq},"\u5F00\u653E\u8BFE\u7A0B"))),Ke.createElement("div",{className:_e.name},Ke.createElement(Dt.Z,{title:Pe&&(Ze!=null&&Ze.excellent_alias_name)?Ke.createElement("span",null,`\u8BFE\u7A0B\u539F\u540D\uFF1A${We}`,Ke.createElement("br",null),Ke.createElement("span",null,`\u8BFE\u7A0B\u522B\u540D\uFF1A${Ze==null?void 0:Ze.excellent_alias_name}`)):We},Ke.createElement("span",{className:_e.e},Pe&&(Ze==null?void 0:Ze.excellent_alias_name)||We))),Ke.createElement(Dt.Z,{title:`\u53D1\u5E03\u5355\u4F4D\uFF1A${Mi}`},Ke.createElement("div",{className:_e.unit},Ke.createElement("i",{className:"iconfont icon-danwei1 font14 mr3"}),Mi)),Ke.createElement("div",{className:_e.tags},Ke.createElement("div",null,Ke.createElement(Dt.Z,{placement:"bottom",title:"\u7AE0\u8282\u6570"},Ke.createElement("span",null,Ke.createElement("i",{className:"iconfont icon-zhangjie1 font14 mr3"}),Ke.createElement("span",null,Ze.stages_count))),Ke.createElement(Dt.Z,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},Ke.createElement("span",null,Ke.createElement("i",{className:"iconfont icon-chengyuan font14 mr3"}),Ke.createElement("span",null,Ze.members_count)))))))})),!bn.length&&Ke.createElement(Ce.Z,null)))},qe={flex_box_center:"flex_box_center___eMcr7",flex_space_between:"flex_space_between___HcNca",flex_box_vertical_center:"flex_box_vertical_center___ZnvVN",flex_box_center_end:"flex_box_center_end___fdgDf",flex_box_column:"flex_box_column___SEKvd",list:"list___L1hmU",wrap:"wrap___pKgcW",lockWrap:"lockWrap___SMhkK",top:"top___udHSB",sign:"sign___uwRpq",name:"name___Fpf90",img:"img___AMLhL",text:"text___KiTb7",btns:"btns___i6IuZ",bottom:"bottom____k2sh"},_n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXWmQXFd1/s59r3t6nX00o93GluV9AQNxiAkIB0OMISFsFQqSAhOohFR+JKmEQPILClJZfpEfIUAChFQSHIJxnGDiDYwsb8KRLUuWZcmSxqN9pJF6nV7eSZ373u1509Mzvd2eGVt6VV2z9Ht3+9459+yX8Bq4mDmWK2GLqla3MvFWZt4KpjVMSBNzGoQ0M6WJkJbpMiNDxBkwMkyUIUYGxCeJaB8x7fMcZ18yiv1EVHy1Lw+9GicwO8tXlSrlbSB6O4HfANAmZlY250JEHsBHGLQTzA9H3chDfX2012Yfy9HWqwJgZh7NF6vvY/a2gWkbgyeWY3Hq+yDQcRA/RKQeSsSce4jo9EqMo50+Vy3AzNxXKFTv9MAfB/AuZo60M7Fe30tEZQA/UqBvx+POvUQ02+s+O2l/1QGcy5Xe6Cn1SXj8YYAHO5nU8j9DM1D0b8rzvpFMRp9a/v4X73HVAJwplN9GHj7P4NtW0wK1OxYCPcAKX0rHI4+0+2wv7l9xgHPFyrs9j78A5l/sxQRXrE2ix5SiLyZj7v+s2BgArBjA+XzpzR7oq8x880ouQK/7JqKnFfiziUT0iV731aj9ZQeYmYez+fJXiOguZl72/ldkkYmYmb+eSkT+lIjOLOcYlm2BBcx8sfoJz+O/BHhkOSe5evqiaaXoTxIx55tExMsxrmUBOJ/njVVUvgvmW5djUqu+D6JHHbgfTSRostdj7TnAuWLlDq/K37pwqXYxCGlaOfRbyZh7Xy9B7hnAzOzmCpUvA/jDC2WvbReogE3/TTLufo6IKu0+38r9PQE4n+f1VVS+B+ZbWhnEBX8P0Q4H7gcTCZqyvRbWARZHQLlavp8ZG20P9rXcHhEmI07kdtsODasA5/OlX6gy/dfF/bbTV5GmHeL3JBLRxzttof45awCLRYo9vpuZE7YGdyG2Q0R5UvQBWxYwKwBn8pWPEPg7IlhdiKDYnrMIXAz6WDrh/mu3bXcNcEC5P7wIbrdQzH9eQCZF7+2WkrsCWPZcD/TgRbZsF1zTmrBrBX5HN3tyxwD7YTOVRy8KVL0Bd65Vmo667q2dStcdASx6rofyjouqUK/B9dsXFUohcksnenLbAMtemy1UfnrRiLE84NZ6IdqRirtvbdfi1TbA2Xz5r5j5j5Z5ehe705RMf51KRP64ncVoC2BxHLDH9/batlz2gJPnFc7PArNVgvjViABH6Zhm/ZErQoxkH7AmxYhHlsX71s7aWr9XbNek6M52HBQtA6xdflx5pldCVaEMHDuvcK5A8AjI5oB8EShXgEoZKFeBSgVQCohEgKjr/4z3AUP9gCIg7jLWpBn9fa9lsMXa5d7UqquxJYCFYrOFyk964c8V4F44oVCsEs5lgfNZIJcHPMFIk27wU0sbof/V0UcyBgz2AyMDQDQCbBzwXrtAEz2airu/3ErQQEsA5wqVT3qe93WbPKfqAS+eUsiWCWdmgJPTQLVaB2gjw6oB3U9B0azbsGz5XV6KsWFg01pAzGqXjniIua89ilZK3ZWMu99ohklTgP0YqsqLNlnz+SJh7ymF8xkf2JKEkFu+BOx1Y8CGNcBAH2P9gGe5h5VujqZTCfeKZjFeTQHO5EpfA/ApW9N5ZYYweU5h6jhwPlfHcpux5Ha/BxCLAldfBqSijMtHX2sg4x/SyejvLIXNkgAHoa07bEnNe48rnCkQDr8CFBokehh2q1ntIizYsOVG3y/g6AH7dl3gykuAvj4gAkahSihUCCVP9nryJfNgj1dguIrQ5wKJCCMZZaSjjOGEh6jV9LbuSUb2YAW+ZamQ3CUBzubLT9mKW95zTOFkhnDoqC8NL8clL0oqSYgnCSoCVIM92580axAjji+BuyqQ4RgQOq8wUKrK/0jv83Ilo8BQzMO6VBUDseWYQfM+JO46lYi8cbE7FwVYZxxUvf9u3kXzOyZnCIfPKuw/FAhSgcxTz3GbyFQLpOh6Ics877qE9AAQiZEGSyJUI6JGOT5VxlxocEWvdgTcAGQBUtQwWRTDTQTkYhXIlQnZElD2fMBjDmMizdjYX0VkhSlbOepXF/M6LQpwJl/ebiOd5FyR8PxxhQNHgGKP8+9EL04PKU2tAr5LjIQLJB0DJmswDbACpuP41KuBFYDlEwBsKFdz72ClZqvA2SJpI4yALc+PJ6rYPCDSevOXvSd3EG1PJyK/1KjthgBLIhg8frjbwYgq9MRhB5PHgXOZha01k5nq9d4FalEgowk4/UMKTp/fR59iJBX0nqkBo8ASpsGVPdYHVD7yuwY8uLcGcrAyNZCljbopZErAqQKhWPGB3pD2cEl/RUyK3S5d+88renujhLeGI8nmyv9rI8vv+aMKh6cJk8eC8Tbjye1Oi4BEkpDo91lxVDFSjghS/lVjuQZgMXc6DDdgxRrYEAWbl0GDHwC6FMBmuLkycKJAKFUJMQe4YriCwdjy6t6S1ZhKRn6l0TY37386Pxd4st21rr9fWNnTkw72HeyNnit7Z/+YAsn+CUbaBWJ68wzADbFZQ8GaJSuex6INy9ZCVmDvNkBLW2Y/DrPpxdbmTBGYLhCYCBvSVWzury4rNSvgTfX5yQsoOJMr/T2AJXWrVsDfeUThldOEoydbubu9e9wIYWBUFtJnxwPOHPuct28KyHWs1yHWVCsgCgULwAZkDXBA3ealaAdgmYWoXlNZ0vtzfx9wzUhZ97NM19fSyeinw33NA1jKJmTzlePdZtaL40Cod8+BQGq2OLtIFBgcVVrlSTiMtDPXeHgy+ndDgYFkrPfZEBUb9cgA7H8X7M/B3m0o17QXNLvkjGRsx/OkJW+R2q8erWjW3fuLZlIJdyJcTmIewPl85QNV9r7X7UD2nVTYd4wweXTplpoZNuqf7osB6WEFD4xBw5IbdFG/b8rfMlENoKZQn01rISvYg42qNPcSzLFneRH0FWL/razR6QLh7KxvNLl2tLwsUrZD6oOJhHu3Gd88gLP5skRH3tnK4Je6Z/tBBwenGkvOnbYtHqL+Nb5DeFgMFK2wPSNBB9gYdu2zaNZg14QsvZfPl6r1ixH+NFCfms3nfBk4lSdEXcK1Y2X0tTLuZo0u8T0R3ZtKRN67AGApVZQrVI52W81GDANPHnGw64XA5RcaTODsWbSswGJCthguhsYJHjNGWwXXEJ0BSChYfjdsGKzB05Qb/M/swWGVSb8MwbMycNNGeG9uhse5EnC6qLShRUAWga5Xl1T/ScbddabEU42CbbkEX55W2DtFONAg87WZltToBZAFHV4rbBkYiDASLSzOPLYUAtgA6APFvkFD2HQAvBikjSQt1C036BdAKDt4EbSEbQwjIQNIM8BEXz5fJu3Zunqkt7basCuxthbZfOm7zPjNZgNt9v3OSYWXpgjHpxf655sB3Kjt0XEhLyDpMvrrBZVGqmadXlDbPo3QFLJUacOJYuhce+NXDu4z0nRY0hbDiTgu6oWxZmsi30sXIniJk0NUKDGK9Ooiwr+kEtGPhsQGCZEpH7NRQc7sv9PnlgzA0HNrZslKpgnxftKq0FCHZkAjYEl/AkxNWBKngo4aYWxdR7h8Qr5f3AJVKDF2H/FNnZHASSHgmz26FbCkv6kcoQrCVaMVpHsUiCAV+VLJyNoawEHtxz2tDLLZPT894OClI37oTTeXcoHRCaUdBbLvLrH2S3YzT481+CrA84CKJ2oc49feRHA1T176+vlBT8eGxSJ+PJgxc7ZjmRQ9+WiOEHMJ142WemYIibqRqyVYXs8qkyv9HoCvNptgK98/+rKD3S8CxVIrdy9+z8ioguoDBiOMePO1X9hQ6JkwFcuNQkns+UaJSpnx4V8iOC28QY+/6KFSBeIxaJVHuxoDo0k7sz1bIpwrETalq5hI9oxVfzadjP6dD3C+/B9gfn87g1zs3u2HHDz9/CIGjmY8OWhUjBlD4wpR8lWijq6wcyD4XW/ZQTBfqeJHbM5WGB9/W2sA/2yvp6k+0Qckoj6rNlaxdsYoe/8reV/6u3GsBKcdFtBqR0T/kU5EPqABzuZLLzPjklafXeq+n73s4JkXgFIXFDw2IdIMMBbh1vTdRgOqM0roNQwiN8TLpcEtC6dhfPK25gCLivbALtZUm4wDcQFYjCQdbh/ioDg1q3TwwIaUfSomwqFUInqpVOiK5QqVnK16yz854OCFg/LSLBSi6nFopBaJnXlkgtBHjCEb9WVDDgPDmiVao6zBBUR4+sztPsAvHmU89KwvOMn+KuDJfhuLsLZ7y/8kPFc+ArDEZndCwWYdROAShnLjmjKUZSqWetfJuJuk7Cxfx5XyszaoV9rQQtYkMD3TWYsjYwQ3ThgV6u1k7w11G1aRTJy1sEfJnBAOU5DPLOOzd/gA//wA49+3+/ZoAU8C9hIxRqoPSCeAlAG3zwc+2uEebIaYKQPTswqbByoYj9t3L5IbuZ5s2Z/NoB9/WWH/FOHY6QZ6cIM45nAQnbQxsVHpSIzRaGcvSPgpAViANTZvEazEEWDYswB8+QTjnTdKGA7hbJbx7YeBM1mgT8CNCqjsAxuHTpOR/Ve+kxfA2LE7JT6zF8vLcs2wfeOH2KUpVyh/3vP4i90vp9/CnuMKe15pbMlqxqJF700PkdYPJSKjkyvs9dEB8SEjhuy9IgUbAeuWrcC1m+aziVKF8cOngJdPCKA8n3KjQFxYdjRwMYZiuToZqzxzukjIVwnXj5T1S2PzUoq+QNl86dvM+JithjNFwtOTCk8+17zFeqF6fK2CijLWRHyvTzeX5gwBBUs7QrkSzSl6rLDW224A1gws3snOA4xnXvapt541a0NHKOynm3FKQN+JosLGlIeJpKR22LuI8B3K5sr3M/id9pr19+Fn9/sJZK3mFkn/Gy5ROjpj1IJwpfdcAVhin4U1e6ISARMDwLbrhAqbv0FHzzCeeInR5wCpuL/v9sneKy9gyG/czdrJMEVlSrmErcN2UzwI9GPK5MuP2U7mfmZS4YVX/Bjo8LWUGizS85p1hGSdE7+txTP6bqAOCRVrlajqS83XbwbecJnOs2252fwsQ6hZ2pFMRtl/ayG3gamy5cYWufFkUYLwCTeNWbZsEe2gbK70LAPXdTvI8PPTeYKA/OTu4L9GQFzCXzgwAKSGFIYc7spnKtgZdUgAFvelsOZrNwE3X946sOH5VD3Gjn2sbdkxAdmCgBVuX9yJ58oKVw1XkLSY50zAc7IHWzNyhAf96AEH+yehpelWrjVjhGiSMBZlcR51fIUBFoFKqFcMGrddD1w63hnAMpgn93uQUCRRmbQU3aWKFJ5gvgKcLilc2l/FSMye0UOMHZTJlU/bzBw0Az+dIzx3TGHHLn8PbHZt2KSgHMZ4N+qRsVYFrFnSUWXfFYPGO28ELptYCHClyrjnCeCJF32Hxi1XAnfcLFLy/Hu37w0ADqxYhoprHqpmE1zie9HLjxUUxpNVLWzZu2iasvnyLDN3s6yLjuexgw4OHAUOmbjoJUa++RKlY5bFc9TxFQZY2HPZ/+RngXe/Hrh87UKAv79DTJDzA99Fwn7PG+ff+8huD/kS0C/6cNwXtsRUaSNiUnawyRxhKAZcNmBPHyaiUk8Bzs4SnplSePw5P5uwfgsOC12XvE7BdRgjXfDnmr3ZWKvEHBkAfMfrgS3rFgL8Z//M+gUQsIxrUSTmP//Q/Hsf2OXp+/qTvtokurCoSyaeuuOXMnjwlRwhFSVcMWRPktYA94pFmwnvO6EgyWdPPOdLtDUvf92KXHKZ7z3qxLEvL4oSyVli8uTEQckOrPgClrxYuSLjzpsJV6xfCPBf/AvrPVrAMi+gWKw+5/thatf9z3g4XwAGk0DaOBsCn7D2NNZnQrSJ+NG8H30pgpa9S7Po3ghZ4UE+dUjh+DnCzr3zSy6E77lsi9KpJ+0ArM2QoRIe2lsURGr4rkDfW5QtAu97E+HKBgDf97RIyHMAS5ti4br9pvkA3/e0h5k8MBAALGZM0Yd1THUQ01XLoOhAljteJN3ONRbjtbSQ1Qs1qf4NFIqS/fjISWDfoSDZuq6myqVbFGLi/zXSQJ3tPaxpSfvakCFxVAFXEEuV1nsFYDFJGndghZErAO+/hXDVhsZC1oPPAruP+C/LdZuBt1+3UMj6wROM0xnGQMKn4Hk26SDHycRxmQS2dijxaIEQUaQzIWxdWk2ylSbabFCirkim4akZ4NmXfBDCe/DlW5SOvdJOBpNxv0ijJiPfUKuxVA0lgY0jvgAkL4BsCcb+fOm4sNcOSCsYw6GTrL1P2gccfKTfmTxr27b8XwcAhCxcbdhTMCUsOgJcPWSRRRM9JqbKHzH49mYA2fheFuSpIw7OFYCn9wRhPQHKW7YqXdhsIsicr0VfBB2HKdgYMgyI8vKsHwLeek17Viobc2Jm7J1iZIq+AaRmp24zlMcXsoArLAJMoPutOxtaWbTnjymcLRB27YcOr5Vr6xWkY5Q3JedaMKCaMknyjfEQyXeyzwqFFivAnW/ojkJbGfdi92SLjJ0HWbsXta06FAjQChXLnCbzhOE+xusG7TkctLPBtruw1YU6lSHsP62QLQC7DwJrxhWqirFloI5FByjXtuTQPlsTpMrAb79t+anXzFWo+Me7WEd6yN4sTgmTEtMKwBL8d7ygsDZZxXqLhg7tLrTt8G8VYHPfoWmF4znC0TMKmSrwun5PmwH9sjfBj9CebGpVihnSWKlyReBTv9KhA7ndAS9y/z1PeugPoj5MOE+rEZe5ih/ZIUaOIYuJ49rhbztkp5P1kr10+wEXB2cIG/s9DPbNVa+rUYnZi4N4ZpGShTVLPctMAfjM7Z0BfOgE4+cHgfN5YP0ocOtVrbkS6+f5b9s9DKUCCTtg1SbdpdmazJT8tJZrR+xmIOqQHdtBd80ms9j3UtTkP3dHMBpnbOpnQ8C1MoXmOSMxi+QqUq2w+Ewe+My72gf4wV2Me570JV/tpPB8gH7/DmDNYHsS93d/4gNcs3QFOnIrtmrRgUWWuGmNPQm6FnQnC7ccxo5WgL/72QgqHuPGCV4ArBG05Kdmz2UgN+sDfDYL/O672wN4aprxt/fMpaEIECacdt0w8Ad3tgfwPz3kYbQfWk/WwQFBWG0zgEWNFwl6oA/YMmgT4CBsVhY+ky/fDebfaAWEXt7zyAEHR2YUbpjwEHfnDCI1cg4iNLQLMGDPYj48m2kfYKHeR3b7QpGoNgZg8TzJnv4XH5bvWgf5Hx/0MNLvmzLDADdzRuSrUqlH6XoeaxIWPUnhwHebqSvdvABTM8CDByLYMMDYPNA4jNQYLjQQs5J240dBtsuif/A4Y9+UgMFatRGAhTMUSqT39N/eBmwYaR3gbz7oYTQNDKR8Z4REf7TibZJojlmPcMOo9bzhudQVm8ln3QAsz37vWVez5zdvDAEc+tUALM53EbBmAoA//c72WPR9TzFePsma2kR/FR1cABbqPZ8nfPhWYP1wewCPpIHBNgAWs6qwZynWstWigUPWcV7ymd6HLaWPdgvwzikHe04oXD/uYbjBIXnzKLgInAsAvqtNNen+ZxiTp1mrNkJtYkcWwU24grT5628mrG0DYM2iDcChPXgpFi2hOjNlhcstq0cL0kcDQctKAni3AIv/9vu7I7rK683rF7LpBQAXgDMZ4BPvaI+CJc/o2FnW3iHRW8UTJHu7ULAIbe+5mTAx1DoFf+thD8MCcEjIMtV7Gq2JCXqX6gLXj5XbCgRstsYNE8BtlXBo1nkr3+84pPDSGQc3rfMwUkfFJq9XVCRh0YaCP/QWQryFUFjTv0RonJzxU1I0BSs/+kMoeCbruwvHW1SVJL/p7sdYAyxStE5Oa6ImCfWeLYlwVcF4wm7aSsMSDraKsLQCYLN7ciXgnr0RXQfrzZt4XtEWDXCdFC37sGQoXLe5dYr72R4PJ87DZ9GBkGUo+FweeMd1tGRgfHgOzx1mPH+E9f4rAGtX4hIAy94r3iOXCNePlawmni1ahMVn03bKKDUDsJXv/++4g+eOKlw55mHT4NwT2oMU6MEiaIkeLFQsku8Nl0jUhqScNAf68X0eTmXmwm8MixbOIJXof/kawmj/0u3kZhn7p4Bdh31hTbPn4IURgBfLPJR0lUyZsGWwiuG4RdXIP1upcRklWcKVtkuHgfc8xg/3RFGsspaoE0G2gzZ0BA59baoUVSnvmxoF5GyBtIVL9nJxRsglViqxb+uEMskUjPvClXwkPEe8P1pNEs9UYB0TKpb2MtKelA4O0l5M6SVxKMjeLWqWBOJJW8LujbNBUk8bxWsVKuJYIKTlqAGL0Rtm7ZYshGarlGErFNrKPScyhAdecrXA9cYNfhlgk60gYMii66C6or93SuSGRD4KSKUKaVYuFK9LFjoCJOv9Viq362zBIM9Xx2OJqTJg/aYt+SltSx+Vqm9OlMu0pdNLg7YkXlpKOwi7X6x+R1lYc9Yv43PDSFn7j+1eTUoZSme2ipHaGviuowq7TzgYTTJuWucLI8Yebfbi2QBUne8rlBscpCXgGoAFZDE8SByVpj5x64XSQOV7aVf2YT8x3P+ISVTUJ+nLpLqatvTBXAElS1smrSVc+9Ksg6mwU2afNY9YZs26H6X+Ph13PxNe+wWbjK1ywrYAFl/rAy9FcSoHbB5kbBllDZpJKtPpoKGUUJGEBSShNh35EQiopui3T30+0Pr0tKDAmc4hDgQ4kw1hgJW/dX9BrrGpVGteGOEAus0glMcUSgvXddHFSSukzZGXWXTqh9e5pXLCWtiyVBDcFsiywD960UVmlnDNuIe16YCKg2o5RjfWe7MAEQBsYrfmFSM1Vd5DZYRN8W8twAVCnGlT/5T4MX34g++gNtXwxN+rSz0EFfG0V6pW8HRu9lKUVFyCUuXuqhH75Rq0nNFqQXDNpi2V9LcFsLQjqtOPX3Qhhca3jjHWpX1nhA7eC1ixYd36b3koFCigIx39lai5B8Phrvr2IGHcsHbNBYLgwHDYkC6FGDows1Yhvu5QD2nTgCv7vtTFsl2Lo7bG7ZT01yBbOpTDJsiZWeDhgxEtSIlDQth1GBQTqFeLugx1HsSm+1uVsOPQWQ4B7r7TKngpwjU9arFhcxWF5yrBm1LFQQeGLcvzx/KEfIV0wtq1wz0sDE70WDoReUujtV5U0bN5rI5NkCUT75EDEQjYw3HGNeNz0nWAT8jP2KDnYMZm4o1ipswLop9eysgUqsUVbsdUs9NV36OMa0Z7w5bN7Do6VkfvxRYPxrIJsuzJ2w9HcCLrn4N07bicUGazh87bkvpXx3JySAhhPCkCVaV3bNk3bHR2MJZM0fbRdp0vW+Mnxeu055QDqTa1cRDYNMAd17TsdmyyX5+UksEl2eMJW4aqGLPpwG/EjLo92k7vxZYPp+x2Ieufl1NOdr7i4lxRLEuMSwcYo6mFZxzZ7te0J3vtzKwvTMk5iAMxxpXDlR4YMRrOoLvDKX3J0v7xsrYXW3Rl8T7tOen4xUIjrIWwsYSd/N1G4xXVSYA9UyRUPKkeC1w+WMVo74qL1g3D0vGy0upqciUu9XJIwN6+0w4OTit9rI2rWLsb1yQZ6b7OSxKbPkVHlvMLZ2ZJq23i55LDpzcNVrE26fV0r62ft7UDogMq7tkR77apWdqrMuPwjMLhGQdydqI2TijW8dZyVKzYjyWoT2zBi1URFtYrOrcOrq+I98ePwxbmLwYNOdlsfdrDaHx5D7/S62X7iHdf4OKNVa4804t6Hr0A2bQpOvPRjIOTOYWzRd/VOFel3a9ma8yYNcNJrQSir0zJ/RHJXY5D25BFOhYz5cpcNO2Qe1MiQQ1OxVg4ouaO09AzuWLlDvb4XlsHRi/3AklJ4POzCjkpyD0rjgmlvUQV5uBsYXHC+6BHHKF01npsqo+RtFCcrdv5yoHQpOjOZMy9r9W22gJYGs3my3/FzH/UagcX77O3AkT016lE5I/babFtgJnZzRYqP7VdHa+dQV+Q9xLtSMXdtxJRW+kPbQMc7MfrPZR3MGPjBbnYyzxpIkwqRG5JJGiq3a47Alg68YPlK4++2oSudhdo5e+n6ajr3ionqHQylo4B9im59Ase6EFmbhCi3slwLj4TXgEiyivwOxKJ6OOdrkxXAEun4nVij+VQS+sRRp1O6rXwnOy1pOi9yZj7P93Mp2uApfNMvvIRAn/nIsjdQDH3rIDLoI+lE+6/dtuiFYBDlHz3RXbdHSTClknRB7qlXDMKawCbPbnK9F8XBa9OQRYrFb+nmz23vmerABvpulwt339RhWoPZFGFIk7k9k6l5cV6sw6w0ZOrqHzvojGkRZCJdjhwP9iJntush54ALJ2KwJUrVL4M4A9frbbrZovX7fdiWwbwN8m4+7l2LVSt9t0zgM0AxEHhVflbF/flBbvjtHLot9pxHLQK6jxdupOH2n1GuxpR+S6Yb2332dfk/USPOnA/2qrLr5s16DkFm8EJm84Xq5/wPP7LC5eaaVop+pNEzPlmwJ67wa6lZ5cN4BDQw9l8+StEdNeFsjcLmMz89VQi8qdEdKYlZCzdtOwAm3EHIblfZeabLc1lVTYjccsK/NlEIvrESgxwxQAOCWHv9jz+Aph/cSUWoGd9Ej2mFH3RlkWq03GuOMBm4JLwRh4+z+DbOp3ManhOsvxY4UvpeOSR1TGe1TCK0BiC/OS7APoQwKHqHKtsoPOGQzMA/7sCvp5MRp9aTSNdNRRcvyhSTqJQqN7pgT8O4F3MvArC3uZGKdVsAPxIgb4djzv3EtHsagLWjGXVAhxeLCnxlC9W38fsbQPTNgZPrMRiSgU5ED9EpB5KxJx7iKjFkxlXYrR+n68KgOuXJ6ituQ1E2wj8eoA2McuxWPYuqbcM8BEG7QTzw1E38pBtR4C90S7e0qsS4AbsPJYrYYuqVrcy8VZm3gqmcSakiTkFQpqZ0kRIy7PMyBBxBowME2WJkQHxCSLaR0z7PMfZl4xiPxFdXaKvAAAADElEQVQVlwOEXvbx/3Bccpan8cseAAAAAElFTkSuQmCC",Pn=kt(59301),dn=({className:gi,dataSource:bn=[],col:pe=4,right:Se,bottom:ve=23,precision:zn=0,wrapWidth:kn=1200,trackEventItems:Qn,loading:$e,handleVery:On=()=>!0})=>{const Fe=Math.floor((kn-(pe-1)*Se)/pe);return Pn.createElement(Tt.Z,{spinning:$e},Pn.createElement("div",{className:ge()(qe.list,gi)},!!bn.length&&bn.map((Pe,Zn)=>{const{subject_identifier:$t,id:Ze,identifier:wn,power:ri}=Pe,We=Pe.is_public!=0&&Pe.is_public;return Pn.createElement("div",{className:qe.wrap,key:Ze,style:{width:Fe,marginRight:(1+Zn)%pe===0?0:Se+zn,marginBottom:ve}},Pn.createElement("a",{className:qe.li,onClick:je=>{je.preventDefault(),On(Pe==null?void 0:Pe.first_category_url)&&(Qn&&(0,Gt.L9)([Qn]),(0,Gt.xg)(Pe.first_category_url))}},Pn.createElement("div",{className:qe.top},Pn.createElement(Dt.Z,{title:Pe.name},Pn.createElement("div",{className:qe.name},Pe.name)),Pn.createElement("img",{className:qe.img,src:Yt.Z.IMG_SERVER+"/images/"+Pe.avatar_url}),Pn.createElement("div",{className:qe.text,title:Pe.creator},Pe.creator),$t&&Pn.createElement("div",{className:qe.btns},Pn.createElement("div",null,"\u5F00\u653E\u8BFE\u7A0B"),Pn.createElement("aside",null,"\u5F00\u653E\u8BFE\u5802")),We&&Pn.createElement("div",{className:qe.sign},"\u516C\u5F00")),Pn.createElement("div",{className:qe.bottom},Pe.visits>0&&Pn.createElement(Dt.Z,{title:"\u8BBF\u95EE\u91CF",placement:"bottom"},Pn.createElement("span",null,Pn.createElement("i",{className:"iconfont icon-liulanyan"}),Pn.createElement("span",null,Pe.visits))),Pe.course_members_count>0&&Pn.createElement(Dt.Z,{title:"\u6210\u5458",placement:"bottom"},Pn.createElement("span",null,Pn.createElement("i",{className:"iconfont icon-chengyuan"}),Pe.course_members_count)),Pe.tasks_count>0&&Pn.createElement(Dt.Z,{title:"\u4F5C\u4E1A",placement:"bottom"},Pn.createElement("span",null,Pn.createElement("i",{className:"iconfont icon-zuoye"}),Pe.tasks_count)),Pe.is_end?Pn.createElement("div",{style:{color:"#6B758B"}},"\u5DF2\u7ED3\u675F"):Pn.createElement("div",{style:{color:"#00B187"}},"\u8FDB\u884C\u4E2D"))),!Pe.is_accessible&&Pn.createElement("div",{className:qe.lockWrap},Pn.createElement("img",{src:`${Yt.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),Pn.createElement("span",{className:"mt15 font16 c-white"},"\u975E\u8BFE\u5802\u6210\u5458\u4E0D\u53EF\u8FDB\u5165")))}),!bn.length&&Pn.createElement(Ce.Z,null)))},sn={flex_box_center:"flex_box_center___d27mZ",flex_space_between:"flex_space_between___qfRU9",flex_box_vertical_center:"flex_box_vertical_center___fCRld",flex_box_center_end:"flex_box_center_end___ORMV8",flex_box_column:"flex_box_column___PNKtZ",tabs:"tabs___alpa7",tabsWrap:"tabsWrap___aCQjw",tab:"tab___MKLr4",active:"active___nl_4v"},jn=kt(71570),Sn=({dataSource:gi=[],value:bn,onChange:pe,className:Se,style:ve={},tabBarExtraContent:zn})=>pt.createElement("div",{className:ge()(sn.tabs,Se),style:ve},pt.createElement("div",{className:sn.tabsWrap},gi.map((kn,Qn)=>!(kn!=null&&kn.hide)&&pt.createElement("aside",{className:sn.tab,onClick:()=>{pe(kn.id),kn.link&&jn.history.push(kn.link)},key:Qn},pt.createElement("div",{className:bn===kn.id?sn.active:""},kn.name),(kn==null?void 0:kn.resetCount)==null&&(kn==null?void 0:kn.total)!==void 0&&pt.createElement("span",null,"\uFF08",kn==null?void 0:kn.total,"\uFF09"),(kn==null?void 0:kn.resetCount)!==void 0&&(kn==null?void 0:kn.total)!==void 0&&pt.createElement(Dt.Z,{title:(kn==null?void 0:kn.tip)!=null?kn==null?void 0:kn.tip:""},pt.createElement("span",{style:{color:"#9096A3"}},"\uFF08",pt.createElement("span",{style:{color:"#000"}},kn==null?void 0:kn.resetCount),"/",pt.createElement("span",null,kn==null?void 0:kn.total),"\uFF09"))))),pt.createElement("div",{className:sn.tabBar},zn)),Mn=({className:gi,style:bn={},children:pe})=>pt.createElement("div",{className:ge()(gi),style:bn},pe),ui={flex_box_center:"flex_box_center___e6HxQ",flex_space_between:"flex_space_between___RnXYe",flex_box_vertical_center:"flex_box_vertical_center___lVxPk",flex_box_center_end:"flex_box_center_end___bu8yv",flex_box_column:"flex_box_column___JczGj",orderWrap:"orderWrap___ZfyGX",orderIconWrap:"orderIconWrap___XTB_O",orderAsc:"orderAsc___KWHmA",orderDesc:"orderDesc___rHdbB",active:"active___a7eSP",cursorPointer:"cursorPointer___gs9kL",orderTextWrap:"orderTextWrap___teAKn"},_t=kt(75727),Lt=kt(93041);const Pt=[{id:"updated_at",name:"\u6700\u65B0\u52A8\u6001"},{id:"created_at",name:"\u6700\u65B0\u521B\u5EFA"},{id:"name",name:"\u540D\u79F0\u6392\u5E8F"}];var zt=({sortValue:gi,dropValue:bn,className:pe,onSort:Se,onDrop:ve,dataSource:zn=Pt})=>{var kn;return pt.createElement("div",{className:ge()(ui.orderWrap,pe)},pt.createElement(_t.Z,{dropdownRender:()=>pt.createElement(Lt.default,null,zn.map((Qn,$e)=>pt.createElement(Lt.default.Item,{key:$e,onClick:()=>ve(Qn.id)},Qn.name)))},pt.createElement("span",{className:ui.orderTextWrap},(kn=zn.find(Qn=>bn===Qn.id))==null?void 0:kn.name)),pt.createElement("span",{className:ui.orderIconWrap},pt.createElement("span",{className:ui.orderAsc},pt.createElement("i",{className:gi==="asc"?`iconfont icon-sanjiaoxing-up font12 ${ui.cursorPointer} ${ui.active}`:`iconfont icon-sanjiaoxing-up font12 ${ui.cursorPointer}`,onClick:()=>Se(gi==="asc"?"desc":"asc")})),pt.createElement("span",{className:ui.orderDesc},pt.createElement("i",{className:gi==="desc"?`iconfont icon-sanjiaoxing-down font12 ${ui.cursorPointer} ${ui.active}`:`iconfont icon-sanjiaoxing-down font12 ${ui.cursorPointer}`,onClick:()=>Se(gi==="asc"?"desc":"asc")}))))},Mt={flex_box_center:"flex_box_center___LCi0B",flex_space_between:"flex_space_between___hzONe",flex_box_vertical_center:"flex_box_vertical_center___ZyQRE",flex_box_center_end:"flex_box_center_end___XKM74",flex_box_column:"flex_box_column___p8LCU",btn:"btn___In02G","mediacy-round":"mediacy-round___uveEv","mediacy-default":"mediacy-default___dDxsd",default:"default___K791v"},Kt=kt(99571),ye=Object.defineProperty,Ue=Object.getOwnPropertySymbols,Qe=Object.prototype.hasOwnProperty,ce=Object.prototype.propertyIsEnumerable,Oe=(gi,bn,pe)=>bn in gi?ye(gi,bn,{enumerable:!0,configurable:!0,writable:!0,value:pe}):gi[bn]=pe,Le=(gi,bn)=>{for(var pe in bn||(bn={}))Qe.call(bn,pe)&&Oe(gi,pe,bn[pe]);if(Ue)for(var pe of Ue(bn))ce.call(bn,pe)&&Oe(gi,pe,bn[pe]);return gi},Xe=(gi,bn)=>{var pe={};for(var Se in gi)Qe.call(gi,Se)&&bn.indexOf(Se)<0&&(pe[Se]=gi[Se]);if(gi!=null&&Ue)for(var Se of Ue(gi))bn.indexOf(Se)<0&&ce.call(gi,Se)&&(pe[Se]=gi[Se]);return pe},vn=(gi,bn,pe)=>new Promise((Se,ve)=>{var zn=$e=>{try{Qn(pe.next($e))}catch(On){ve(On)}},kn=$e=>{try{Qn(pe.throw($e))}catch(On){ve(On)}},Qn=$e=>$e.done?Se($e.value):Promise.resolve($e.value).then(zn,kn);Qn((pe=pe.apply(gi,bn)).next())}),hn=gi=>{var bn=gi,{className:pe,style:Se,children:ve,loading:zn=!1,openLoading:kn,onClick:Qn=()=>{},size:$e="middle",shape:On="round"}=bn,Fe=Xe(bn,["className","style","children","loading","openLoading","onClick","size","shape"]);const[Pe,Zn]=(0,pt.useState)(!1);return pt.createElement(Kt.ZP,Le({onClick:(0,ne.throttle)($t=>vn(void 0,null,function*(){kn&&Zn(!0);try{yield Qn($t)}catch(Ze){console.log("error",Ze)}kn&&Zn(!1)}),2e3,{leading:!0,trailing:!1}),className:ge()(Mt.btn,Mt[`${$e}-${On}`],pe),style:Se,size:$e,shape:On,loading:Pe||zn},Fe),ve)},Ti={flex_box_center:"flex_box_center___TB7bQ",flex_space_between:"flex_space_between___oBlTb",flex_box_vertical_center:"flex_box_vertical_center___b5XbB",flex_box_center_end:"flex_box_center_end___CNhe7",flex_box_column:"flex_box_column___yHXKW",head:"head___ghH72",node:"node___mjPEy"},Je=({className:gi,style:bn,children:pe=null,onClick:Se,title:ve})=>pt.createElement("div",{className:ge()(Ti.head,gi),style:bn},pt.createElement("span",{className:"primary-hover",onClick:Se},pt.createElement("i",{className:"iconfont icon-fanhui2 font12"}),"\u8FD4\u56DE"),pt.createElement("b",{title:ve},ve),pt.createElement("div",{className:Ti.node},pe)),rn={flex_box_center:"flex_box_center___AlHuF",flex_space_between:"flex_space_between___vN2LW",flex_box_vertical_center:"flex_box_vertical_center___Ac7D2",flex_box_center_end:"flex_box_center_end___y38I7",flex_box_column:"flex_box_column___iQE6P",btns:"btns___sNgTb",confirm:"confirm___Ozirl",cancel:"cancel___aiq1I"},Ln=({confirmShow:gi=!0,confirmTitle:bn,confirmClick:pe,cancelShow:Se=!0,cancelTitle:ve,cancelClick:zn,className:kn,style:Qn,confirmLoading:$e=!1})=>pt.createElement("div",{className:ge()(rn.btns,kn),style:Qn},gi&&pt.createElement(Kt.ZP,{loading:$e,onClick:pe,type:"primary",className:rn.confirm},bn),Se&&pt.createElement(Kt.ZP,{onClick:zn,className:rn.cancel},ve)),nn={flex_box_center:"flex_box_center___jkpdr",flex_space_between:"flex_space_between___OtsL8",flex_box_vertical_center:"flex_box_vertical_center___rbcb_",flex_box_center_end:"flex_box_center_end___zBR21",flex_box_column:"flex_box_column___nS_eP",fixedBottom:"fixedBottom___oJl7m",wrap:"wrap___A3Oq1",center:"center____VL1y"},mi=({className:gi,style:bn={},LeftContent:pe,children:Se,RightContent:ve})=>pt.createElement("div",{className:ge()(nn.fixedBottom,gi),style:bn},pt.createElement("div",{className:nn.wrap},pt.createElement("div",{className:nn.left},pe),pt.createElement("div",{className:nn.center},Se),pt.createElement("div",{className:nn.right},ve))),ei={flex_box_center:"flex_box_center___tY8Yn",flex_space_between:"flex_space_between___vHdYA",flex_box_vertical_center:"flex_box_vertical_center___pa61F",flex_box_center_end:"flex_box_center_end___HyDXt",flex_box_column:"flex_box_column___UjZek",crumbs:"crumbs___V41Oe",hover:"hover___bEIVd"},Wi=({className:gi,style:bn={},dataSource:pe=[]})=>pt.createElement("div",{className:ge()(ei.crumbs,gi),style:bn},pe.map((Se,ve)=>ve<pe.length-1?pt.createElement(pt.Fragment,{key:ve},Se.path||Se.onClick?pt.createElement("span",{className:ei.hover,onClick:Se!=null&&Se.onClick?Se.onClick:()=>jn.history.push(Se.path)},Se.name):pt.createElement("span",null,Se.name),pt.createElement("span",null,"\xA0",">","\xA0")):pt.createElement("span",{key:ve,style:{color:"#5F6368"}},Se.name))),An=kt(11938),gn=Object.defineProperty,Rn=Object.defineProperties,si=Object.getOwnPropertyDescriptors,xi=Object.getOwnPropertySymbols,di=Object.prototype.hasOwnProperty,Oi=Object.prototype.propertyIsEnumerable,wt=(gi,bn,pe)=>bn in gi?gn(gi,bn,{enumerable:!0,configurable:!0,writable:!0,value:pe}):gi[bn]=pe,yn=(gi,bn)=>{for(var pe in bn||(bn={}))di.call(bn,pe)&&wt(gi,pe,bn[pe]);if(xi)for(var pe of xi(bn))Oi.call(bn,pe)&&wt(gi,pe,bn[pe]);return gi},Wn=(gi,bn)=>Rn(gi,si(bn)),ki=(gi,bn)=>{var pe={};for(var Se in gi)di.call(gi,Se)&&bn.indexOf(Se)<0&&(pe[Se]=gi[Se]);if(gi!=null&&xi)for(var Se of xi(gi))bn.indexOf(Se)<0&&Oi.call(gi,Se)&&(pe[Se]=gi[Se]);return pe};const{Countdown:Ui}=An.default;var Mr=gi=>{var bn=gi,{onChange:pe}=bn,Se=ki(bn,["onChange"]);const[ve,zn]=(0,pt.useState)(null);(0,pt.useEffect)(()=>{typeof ve=="number"&&ve>=0&&pe(ve)},[ve]);const kn=Qn=>{const $e=Math.floor(Qn/1e3);zn($e)};return pt.createElement(Ui,Wn(yn({},Se),{onChange:kn}))}},23206:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Z:function(){return Ut}});var pt=kt(59301);function Ut(le,Me){const ue=(0,pt.useRef)();(0,pt.useEffect)(()=>{ue.current=le}),(0,pt.useEffect)(()=>{function It(){ue.current()}if(Me!==null){let qt=setInterval(It,Me);return()=>clearInterval(qt)}},[Me])}},45688:function(Dn,Gn,kt){"use strict";kt.d(Gn,{h:function(){return pt}});var pt=(Ut=>(Ut[Ut.NOMATCH=-1]="NOMATCH",Ut[Ut.OK=0]="OK",Ut[Ut.TIMEOUT=2]="TIMEOUT",Ut[Ut.PODFAILURE=3]="PODFAILURE",Ut[Ut.COMPILEFAILURE=4]="COMPILEFAILURE",Ut[Ut.EXECUTEFAILURE=5]="EXECUTEFAILURE",Ut[Ut.HIDE_COMPILE_STATUS=11]="HIDE_COMPILE_STATUS",Ut))(pt||{})},8846:function(Dn,Gn,kt){"use strict";kt.d(Gn,{H7:function(){return nt},MK:function(){return Bt},MU:function(){return Rt},X6:function(){return ie},bM:function(){return ne},fi:function(){return et},fu:function(){return ge},n4:function(){return ht},rX:function(){return Ee},vl:function(){return st},zO:function(){return Ae}});var pt=kt(24092),Ut=Object.defineProperty,le=Object.getOwnPropertySymbols,Me=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,It=(gt,vt,St)=>vt in gt?Ut(gt,vt,{enumerable:!0,configurable:!0,writable:!0,value:St}):gt[vt]=St,qt=(gt,vt)=>{for(var St in vt||(vt={}))Me.call(vt,St)&&It(gt,St,vt[St]);if(le)for(var St of le(vt))ue.call(vt,St)&&It(gt,St,vt[St]);return gt};function ge(gt,vt){return(0,pt.U2)(`myproblems/${gt}.json`,qt({hidePopLogin:!0},vt||{}))}function ne(gt,vt){return(0,pt.v_)(`myproblems/${gt}/code_submit.json`,vt)}function Rt(gt,vt){return(0,pt.v_)(`myproblems/${gt}/code_debug.json`,vt)}function Ae(gt,vt){return vt.language&&(vt.language=encodeURIComponent(vt.language)),(0,pt.U2)(`myproblems/${gt}/submit_records.json`,vt)}function ie(gt){return(0,pt.U2)("myproblems/record_detail.json",{id:gt})}function Ee(gt,vt){return(0,pt.U2)(`myproblems/${gt}/result.json`,{mode:vt})}function Bt(gt,vt){return(0,pt.v_)(`myproblems/${gt}/add_notes.json`,vt)}function nt(gt,vt){return(0,pt.v_)(`myproblems/${gt}/restore_initial_code.json`,vt)}function et(gt){return(0,pt.v_)(`myproblems/${gt}/sync_code.json`)}function ht(gt,vt){return(0,pt.v_)(`myproblems/${gt}/update_code.json`,vt)}function st(gt,vt){return(0,pt.v_)(`discusses/${gt}/plus.json`,vt)}},34399:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Z:function(){return Ea}});var pt=kt(59301),Ut={flex_box_center:"flex_box_center___bZaL5",flex_space_between:"flex_space_between___oaJSq",flex_box_vertical_center:"flex_box_vertical_center____hsuP",flex_box_center_end:"flex_box_center_end___ZYbPQ",flex_box_column:"flex_box_column___nE_62",wrap:"wrap___ulhwR",left:"left___kyWln",title:"title___jsO1D",total:"total___GEhiU",list:"list___u9dBZ",name:"name___Wxggs",b:"b___Y15YO",r:"r___mKQoe",l:"l___uelFD",tag:"tag___Mpkbg",right:"right___mQ3dU",examName:"examName___Na1r8",t:"t___IgCWK",num:"num___CXI8j",topWarp:"topWarp___Kicpu",head:"head___jx3W8",so:"so___qYW7F",btn:"btn___EMJDz",content:"content___sHGsV",titleWrap:"titleWrap___I__GR",single:"single___K5iv9",analysis:"analysis___NoAuR",text:"text___xESW2",modalColumn:"modalColumn___I_tK_",modalRow:"modalRow___lyw_U",sup:"sup___HSz3Z",popover:"popover___kE8aI"},le=kt(28284),Me=kt(25399),ue=kt(99571),It=kt(62957),qt=kt(71051),ge=kt(6767),ne=kt(37568),Rt=kt(37285),Ae=kt(62673),ie=kt(77019),Ee=kt(5269),Bt=kt(13747),nt=kt(37639),et=Object.defineProperty,ht=Object.getOwnPropertySymbols,st=Object.prototype.hasOwnProperty,gt=Object.prototype.propertyIsEnumerable,vt=(xe,fe,Ve)=>fe in xe?et(xe,fe,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):xe[fe]=Ve,St=(xe,fe)=>{for(var Ve in fe||(fe={}))st.call(fe,Ve)&&vt(xe,Ve,fe[Ve]);if(ht)for(var Ve of ht(fe))gt.call(fe,Ve)&&vt(xe,Ve,fe[Ve]);return xe};const Et=xe=>React.createElement("svg",St({width:34,height:34,xmlns:"http://www.w3.org/2000/svg"},xe),React.createElement("title",null,"\u7F16\u7EC4 6"),React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("rect",{fill:"#E4E6FD",width:34,height:34,rx:10}),React.createElement("g",{fillRule:"nonzero"},React.createElement("path",{d:"M13.808 11.448a.558.558 0 0 1 0 .788l-1.564 1.565a.558.558 0 1 1-.789-.79l1.564-1.563a.558.558 0 0 1 .79 0Zm9.882 2.462a.558.558 0 0 1-.789 0l-1.564-1.563a.558.558 0 1 1 .789-.789l1.564 1.564a.556.556 0 0 1 0 .788Z",fill:"#6678EB"}),React.createElement("path",{d:"M21.753 21.707a5.937 5.937 0 1 0-8.58.015l-.937.936a.558.558 0 1 0 .789.788l.995-.994a5.91 5.91 0 0 0 3.436 1.095c1.287 0 2.48-.41 3.452-1.106l.992.992a.558.558 0 1 0 .789-.789l-.936-.937Z",fill:"#6678EB"}),React.createElement("path",{d:"m20.858 18.95-3.024-1.745v-2.054a.558.558 0 1 0-1.117 0v2.351c0 .064.011.126.031.184a.551.551 0 0 0 .258.33l3.293 1.9a.557.557 0 0 0 .559-.966Z",fill:"#FFF"}))));var Tt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBmaWxsPSIjRTRFNkZEIiB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIvPjxnIGZpbGwtcnVsZT0ibm9uemVybyI+PHBhdGggZD0iTTEzLjgwOCAxMS40NDhhLjU1OC41NTggMCAwIDEgMCAuNzg4bC0xLjU2NCAxLjU2NWEuNTU4LjU1OCAwIDEgMS0uNzg5LS43OWwxLjU2NC0xLjU2M2EuNTU4LjU1OCAwIDAgMSAuNzkgMFptOS44ODIgMi40NjJhLjU1OC41NTggMCAwIDEtLjc4OSAwbC0xLjU2NC0xLjU2M2EuNTU4LjU1OCAwIDEgMSAuNzg5LS43ODlsMS41NjQgMS41NjRhLjU1Ni41NTYgMCAwIDEgMCAuNzg4WiIgZmlsbD0iIzY2NzhFQiIvPjxwYXRoIGQ9Ik0yMS43NTMgMjEuNzA3YTUuOTM3IDUuOTM3IDAgMSAwLTguNTguMDE1bC0uOTM3LjkzNmEuNTU4LjU1OCAwIDEgMCAuNzg5Ljc4OGwuOTk1LS45OTRhNS45MSA1LjkxIDAgMCAwIDMuNDM2IDEuMDk1YzEuMjg3IDAgMi40OC0uNDEgMy40NTItMS4xMDZsLjk5Mi45OTJhLjU1OC41NTggMCAxIDAgLjc4OS0uNzg5bC0uOTM2LS45MzdaIiBmaWxsPSIjNjY3OEVCIi8+PHBhdGggZD0ibTIwLjg1OCAxOC45NS0zLjAyNC0xLjc0NXYtMi4wNTRhLjU1OC41NTggMCAxIDAtMS4xMTcgMHYyLjM1MWMwIC4wNjQuMDExLjEyNi4wMzEuMTg0YS41NTEuNTUxIDAgMCAwIC4yNTguMzNsMy4yOTMgMS45YS41NTcuNTU3IDAgMCAwIC41NTktLjk2NloiIGZpbGw9IiNGRkYiLz48L2c+PC9nPjwvc3ZnPg==",Dt=kt(79074),Jt=kt(71570),Yt=kt(59895),Gt=kt(24092),me=Object.defineProperty,ae=Object.getOwnPropertySymbols,Ne=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,we=(xe,fe,Ve)=>fe in xe?me(xe,fe,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):xe[fe]=Ve,tn=(xe,fe)=>{for(var Ve in fe||(fe={}))Ne.call(fe,Ve)&&we(xe,Ve,fe[Ve]);if(ae)for(var Ve of ae(fe))Ce.call(fe,Ve)&&we(xe,Ve,fe[Ve]);return xe};const _e=xe=>React.createElement("svg",tn({width:34,height:34,xmlns:"http://www.w3.org/2000/svg"},xe),React.createElement("title",null,"\u7F16\u7EC4 12"),React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("rect",{width:34,height:34,rx:10,fill:"#EAF3F4"}),React.createElement("path",{d:"M25.905 15.37a.775.775 0 0 0-.626-.529l-4.814-.7-2.152-4.362a.776.776 0 0 0-1.392 0l-2.153 4.363-4.814.699a.775.775 0 0 0-.43 1.323l3.484 3.396-.823 4.794a.777.777 0 0 0 1.126.818l4.306-2.264 4.305 2.264a.778.778 0 0 0 .817-.059.777.777 0 0 0 .31-.759l-.823-4.794 3.483-3.396a.777.777 0 0 0 .196-.795Z",fill:"#21C0A6",fillRule:"nonzero"})));var an="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIgZmlsbD0iI0VBRjNGNCIvPjxwYXRoIGQ9Ik0yNS45MDUgMTUuMzdhLjc3NS43NzUgMCAwIDAtLjYyNi0uNTI5bC00LjgxNC0uNy0yLjE1Mi00LjM2MmEuNzc2Ljc3NiAwIDAgMC0xLjM5MiAwbC0yLjE1MyA0LjM2My00LjgxNC42OTlhLjc3NS43NzUgMCAwIDAtLjQzIDEuMzIzbDMuNDg0IDMuMzk2LS44MjMgNC43OTRhLjc3Ny43NzcgMCAwIDAgMS4xMjYuODE4bDQuMzA2LTIuMjY0IDQuMzA1IDIuMjY0YS43NzguNzc4IDAgMCAwIC44MTctLjA1OS43NzcuNzc3IDAgMCAwIC4zMS0uNzU5bC0uODIzLTQuNzk0IDMuNDgzLTMuMzk2YS43NzcuNzc3IDAgMCAwIC4xOTYtLjc5NVoiIGZpbGw9IiMyMUMwQTYiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvZz48L3N2Zz4=",Ke=Object.defineProperty,oe=Object.getOwnPropertySymbols,Xt=Object.prototype.hasOwnProperty,qe=Object.prototype.propertyIsEnumerable,_n=(xe,fe,Ve)=>fe in xe?Ke(xe,fe,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):xe[fe]=Ve,Pn=(xe,fe)=>{for(var Ve in fe||(fe={}))Xt.call(fe,Ve)&&_n(xe,Ve,fe[Ve]);if(oe)for(var Ve of oe(fe))qe.call(fe,Ve)&&_n(xe,Ve,fe[Ve]);return xe};const De=xe=>React.createElement("svg",Pn({width:34,height:34,xmlns:"http://www.w3.org/2000/svg"},xe),React.createElement("title",null,"\u9898\u76EE"),React.createElement("g",{fill:"none",fillRule:"evenodd"},React.createElement("rect",{fill:"#E7F3FF",width:34,height:34,rx:10}),React.createElement("g",{fill:"#4C6FFF",fillRule:"nonzero"},React.createElement("path",{d:"m23.719 13.325-4.098-3.94c-.097-.13-.225-.162-.355-.162-.129 0-.258.064-.387.161l-7.55 7.753c-.065.065-.098.162-.13.227l-1.032 5.427c-.033.194.032.323.16.484.13.13.227.162.389.162h.096l4.776-1.099c.097-.032.194-.064.258-.161l7.841-8.108c.194-.162.194-.517.033-.744h-.001Zm-8.1 8.044a.534.534 0 0 1-.386.162.56.56 0 0 1-.388-.162l-3-2.81c-.226-.194-.226-.517-.033-.743.194-.227.517-.227.743-.033l3 2.811c.259.226.291.55.065.776ZM17 22.92h6.844v1.055H17z"}))));var dn="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBmaWxsPSIjRTdGM0ZGIiB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIvPjxnIGZpbGw9IiM0QzZGRkYiIGZpbGwtcnVsZT0ibm9uemVybyI+PHBhdGggZD0ibTIzLjcxOSAxMy4zMjUtNC4wOTgtMy45NGMtLjA5Ny0uMTMtLjIyNS0uMTYyLS4zNTUtLjE2Mi0uMTI5IDAtLjI1OC4wNjQtLjM4Ny4xNjFsLTcuNTUgNy43NTNjLS4wNjUuMDY1LS4wOTguMTYyLS4xMy4yMjdsLTEuMDMyIDUuNDI3Yy0uMDMzLjE5NC4wMzIuMzIzLjE2LjQ4NC4xMy4xMy4yMjcuMTYyLjM4OS4xNjJoLjA5Nmw0Ljc3Ni0xLjA5OWMuMDk3LS4wMzIuMTk0LS4wNjQuMjU4LS4xNjFsNy44NDEtOC4xMDhjLjE5NC0uMTYyLjE5NC0uNTE3LjAzMy0uNzQ0aC0uMDAxWm0tOC4xIDguMDQ0YS41MzQuNTM0IDAgMCAxLS4zODYuMTYyLjU2LjU2IDAgMCAxLS4zODgtLjE2MmwtMy0yLjgxYy0uMjI2LS4xOTQtLjIyNi0uNTE3LS4wMzMtLjc0My4xOTQtLjIyNy41MTctLjIyNy43NDMtLjAzM2wzIDIuODExYy4yNTkuMjI2LjI5MS41NS4wNjUuNzc2Wk0xNyAyMi45Mmg2Ljg0NHYxLjA1NUgxN3oiLz48L2c+PC9nPjwvc3ZnPg==",sn=kt(93092),jn=kt(19565),Te=kt(43749),Sn=kt(39928),ee={wrap:"wrap___OIoOI",modal:"modal___Z3hfU",titleWrap:"titleWrap___aK3oG",required:"required___NHoO7",title:"title___uxb1R",colorGray:"colorGray___O8YPg",choiceWrap:"choiceWrap___t51sb",answer:"answer___vsBnh",activeAnswer:"activeAnswer___AJN4p",deleteIcon:"deleteIcon___WvOJZ",addIcon:"addIcon___UyeIs",editorWrap:"editorWrap___uqcFU",htmlWrap:"htmlWrap___GcBNL",radio:"radio___e8qQ5",color333:"color333___PLzVK",color999:"color999___v3EY0",fold:"fold___OfvPe",head:"head___EejYX",collapseWrapper:"collapseWrapper___sQyVD",panelHeader:"panelHeader___Ivicf",open:"open___aEOQE",close:"close___z4P5H",inputBorder:"inputBorder___ix67O",keywordTag:"keywordTag___iGx08",scoreByBlankRadio:"scoreByBlankRadio___Kwu7q"},Mn=kt(59301),ui=Object.defineProperty,_t=Object.defineProperties,Lt=Object.getOwnPropertyDescriptors,Pt=Object.getOwnPropertySymbols,Nt=Object.prototype.hasOwnProperty,zt=Object.prototype.propertyIsEnumerable,Mt=(xe,fe,Ve)=>fe in xe?ui(xe,fe,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):xe[fe]=Ve,Kt=(xe,fe)=>{for(var Ve in fe||(fe={}))Nt.call(fe,Ve)&&Mt(xe,Ve,fe[Ve]);if(Pt)for(var Ve of Pt(fe))zt.call(fe,Ve)&&Mt(xe,Ve,fe[Ve]);return xe},ye=(xe,fe)=>_t(xe,Lt(fe)),Ue=(xe,fe)=>{var Ve={};for(var Zt in xe)Nt.call(xe,Zt)&&fe.indexOf(Zt)<0&&(Ve[Zt]=xe[Zt]);if(xe!=null&&Pt)for(var Zt of Pt(xe))fe.indexOf(Zt)<0&&zt.call(xe,Zt)&&(Ve[Zt]=xe[Zt]);return Ve};const Qe=null,ce=(xe,fe)=>{var Ve=xe,{globalSetting:Zt,loading:Ye,dispatch:pr,isEdit:oo,editData:rr}=Ve,Sr=Ue(Ve,["globalSetting","loading","dispatch","isEdit","editData"]);const[xo,Vr]=(0,pt.useState)(""),[Po,Ur]=(0,pt.useState)(""),[Ri,Gi]=(0,pt.useState)([]),[kr,wr]=(0,pt.useState)(""),[Qi,ar]=(0,pt.useState)(),[so,xr]=(0,pt.useState)(!1),[Ji,er]=(0,pt.useState)({}),[tr,bi]=(0,pt.useState)([]);(0,pt.useEffect)(()=>{!rr||!oo||(Vr(rr==null?void 0:rr.name),Ur(rr==null?void 0:rr.analysis),ar(rr==null?void 0:rr.is_ordered),er(rr),xr(!0))},[rr]),(0,pt.useEffect)(()=>{if(!so)return;const zi=rr==null?void 0:rr.standard_answer.map(Nr=>Nr==null?void 0:Nr.answer_text);Gi(zi);const ta=rr==null?void 0:rr.standard_answer.map(Nr=>Nr==null?void 0:Nr.score);bi(ta),xr(!1)},[so]),(0,pt.useImperativeHandle)(fe,()=>({onSave:ho,Clear:Ir}));const ho=()=>{let zi=[],ta=!1;return xo?(Ri.forEach((Nr,ra)=>{zi.push({position:ra+1,answer_text:[],score:tr[ra]}),Nr==null||Nr.forEach((Aa,cl)=>{zi[ra].answer_text.push(Aa),(!Aa||!(0,Yt.eR)(Aa,1e4))&&(wr(`${ra}-${cl}`),ge.ZP.info(Aa?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),ta=!0)})}),ta?!1:(zi==null?void 0:zi.length)>20?(ge.ZP.warning("\u586B\u7A7A\u9898\u6807\u51C6\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A/\u4E0D\u80FD\u8D85\u8FC720\u4E2A\uFF01"),!1):{name:xo,analysis:Po,standard_answers:zi,is_ordered:Qi,downcase:Ji==null?void 0:Ji.downcase,no_space:Ji==null?void 0:Ji.no_space,use_blank_score:Ji==null?void 0:Ji.use_blank_score}):(ge.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},Ir=()=>{Vr(""),Ur(""),Gi([]),ar(!1)},fo=(zi,ta,Nr)=>{const ra=Ri.slice();if(ta&&ra.splice(zi,ta),Nr)for(let Aa=0;Aa<Nr;Aa++)ra.splice(zi+Aa,0,[""]);Gi(ra)},Mo=(zi,ta,Nr)=>{wr("");let ra=Ri.slice();ra[zi][ta]=Nr,Gi(ra)},dr=zi=>{let ta=Ri.slice();ta[zi]=[...ta[zi],""],Gi(ta)},po=(zi,ta)=>{let Nr=Ri.slice();if(!Nr[zi][ta]){Nr[zi]=Nr[zi].filter((ra,Aa)=>Aa!==ta),Gi(Nr);return}It.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:ee.modal,onOk:()=>{Nr[zi]=Nr[zi].filter((ra,Aa)=>Aa!==ta),Gi(Nr)}})},Za=zi=>{It.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:ee.modal,onOk:()=>{let ta=Ri.slice();ta=Ri.filter((Nr,ra)=>zi!==ra),Gi(ta)}})};return Mn.createElement("section",{className:ee.wrap},Mn.createElement("p",{className:ee.titleWrap},Mn.createElement("span",{className:ee.required},"*"),Mn.createElement("span",{className:ee.title},"\u9898\u5E72\uFF1A")),Mn.createElement("div",null,Mn.createElement(Te.Z,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:xo,onChange:zi=>Vr(zi),showNullButton:!0,onPlaceholderChange:fo})),Mn.createElement("div",{className:"mt20"},Ri.map((zi,ta)=>Mn.createElement("div",{style:{display:"flex"}},Mn.createElement("div",{style:{flex:1}},Mn.createElement(Sn.Z,{key:ta,answers:zi,index:ta,flex:1,is_md:!0,activeOptionErrorIndex:kr,onAnswerChange:Mo,addChildAnswer:dr,deleteChildAnswer:po,deleteChildAnswermain:Za})),Ji.use_blank_score&&Mn.createElement("div",{style:{display:"flex",alignItems:"center",width:"165px"}},Mn.createElement("span",{style:{color:"red",margin:"auto 5px auto 10px"}},"*"),"\u5206\u503C\uFF1A",Mn.createElement(qt.Z,{style:{width:"100px"},size:"large",defaultValue:tr[ta],onBlur:Nr=>{tr[ta]=Nr.target.value,bi([...tr])}}))))),Mn.createElement("div",null,Mn.createElement(Ae.default,{className:`${ee.color333} font14 mt20`,checked:Ji.use_blank_score,onChange:zi=>er(ye(Kt({},Ji),{use_blank_score:zi.target.checked}))},"\u5224\u5206\u65F6\u6309\u7A7A\u7ED9\u5206"),Mn.createElement("span",{style:{color:"#999999",fontSize:"12px"}},"\uFF08\u9009\u4E2D\uFF0C\u5219\u9700\u8981\u8BBE\u7F6E\u6BCF\u7A7A\u5206\u503C\uFF0C\u5B66\u751F\u7B54\u6848\u5224\u5206\u65F6\u6309\u7A7A\u7ED9\u5206\uFF09")),Mn.createElement("div",null,Mn.createElement(Ae.default,{className:`${ee.color333} font14 mt20`,checked:Ji.downcase,onChange:zi=>er(ye(Kt({},Ji),{downcase:zi.target.checked}))},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),Mn.createElement("div",null,Mn.createElement(Ae.default,{className:`${ee.color333} font14 mt20`,checked:Ji.no_space,onChange:zi=>er(ye(Kt({},Ji),{no_space:zi.target.checked}))},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),Mn.createElement("div",{className:"mt20"},(Ri==null?void 0:Ri.length)>1&&Mn.createElement("span",null,Mn.createElement(Ae.default,{checked:Qi,onChange:zi=>ar(zi.target.checked),className:`${ee.color333} font14`},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),Mn.createElement("span",{className:`${ee.color999} font12`},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),Mn.createElement("p",{className:ee.titleWrap},Mn.createElement("span",{className:ee.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),Mn.createElement(jn.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Po,onChange:zi=>Ur(zi)}))};var Oe=(0,Jt.connect)(({loading:xe,globalSetting:fe})=>({globalSetting:fe,loading:xe.effects}),null,null,{forwardRef:!0})((0,pt.forwardRef)(ce)),Le=kt(47889),Xe=Object.getOwnPropertySymbols,vn=Object.prototype.hasOwnProperty,cn=Object.prototype.propertyIsEnumerable,hn=(xe,fe)=>{var Ve={};for(var Zt in xe)vn.call(xe,Zt)&&fe.indexOf(Zt)<0&&(Ve[Zt]=xe[Zt]);if(xe!=null&&Xe)for(var Zt of Xe(xe))fe.indexOf(Zt)<0&&cn.call(xe,Zt)&&(Ve[Zt]=xe[Zt]);return Ve};const Ti=null,Ge=(xe,fe)=>{var Ve=xe,{globalSetting:Zt,loading:Ye,editData:pr,dispatch:oo,onRef:rr=()=>{},isEdit:Sr}=Ve,xo=hn(Ve,["globalSetting","loading","editData","dispatch","onRef","isEdit"]);const[Vr,Po]=(0,pt.useState)(),[Ur,Ri]=(0,pt.useState)(""),[Gi,kr]=(0,pt.useState)("");(0,pt.useEffect)(()=>{if(!pr||!Sr)return;Ri(pr==null?void 0:pr.name),kr(pr==null?void 0:pr.analysis);const ar=pr==null?void 0:pr.choices.find(so=>so.is_answer);Po(ar.choice_text==="\u6B63\u786E"?"0":"1")},[pr]),(0,pt.useImperativeHandle)(fe,()=>({onSave:wr,Clear:Qi}));const wr=()=>Ur?Vr?{name:Ur,choices:[{choice_text:"\u6B63\u786E",is_answer:Vr==="0"?1:0},{choice_text:"\u9519\u8BEF",is_answer:Vr==="1"?1:0}],analysis:Gi}:(ge.ZP.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),!1):(ge.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1),Qi=()=>{Ri(""),kr(""),Po("")};return pt.createElement("section",{className:ee.wrap},pt.createElement("p",{className:ee.titleWrap},pt.createElement("span",{className:ee.required},"*"),pt.createElement("span",{className:ee.title},"\u9898\u5E72\uFF1A")),pt.createElement(jn.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Ur,onChange:ar=>Ri(ar)}),pt.createElement("p",{className:ee.titleWrap},pt.createElement("span",{className:ee.required},"*"),pt.createElement("span",{className:ee.title},"\u7B54\u6848\u9009\u9879\uFF1A",pt.createElement("span",{className:ee.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),pt.createElement(Le.ZP.Group,{buttonStyle:"solid",value:Vr,onChange:ar=>Po(ar.target.value)},pt.createElement(Le.ZP.Button,{value:"0",className:`${ee.radio} mr40`},"\u6B63\u786E"),pt.createElement(Le.ZP.Button,{value:"1",className:ee.radio},"\u9519\u8BEF")),pt.createElement("p",{className:ee.titleWrap},pt.createElement("span",{className:ee.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),pt.createElement(jn.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Gi,onChange:ar=>kr(ar)}))};var Je=(0,Jt.connect)(({loading:xe,globalSetting:fe})=>({globalSetting:fe,loading:xe.effects}),null,null,{forwardRef:!0})((0,pt.forwardRef)(Ge)),rn=Object.getOwnPropertySymbols,Xn=Object.prototype.hasOwnProperty,Ln=Object.prototype.propertyIsEnumerable,nn=(xe,fe)=>{var Ve={};for(var Zt in xe)Xn.call(xe,Zt)&&fe.indexOf(Zt)<0&&(Ve[Zt]=xe[Zt]);if(xe!=null&&rn)for(var Zt of rn(xe))fe.indexOf(Zt)<0&&Ln.call(xe,Zt)&&(Ve[Zt]=xe[Zt]);return Ve};const Kn=null,mi=(xe,fe)=>{var Ve=xe,{globalSetting:Zt,loading:Ye,editData:pr,dispatch:oo,onRef:rr=()=>{},isEdit:Sr}=Ve,xo=nn(Ve,["globalSetting","loading","editData","dispatch","onRef","isEdit"]);const[Vr,Po]=(0,pt.useState)([]);(0,pt.useEffect)(()=>{var kr;if(!pr||!Sr)return;const wr=(kr=pr==null?void 0:pr.shixun)==null?void 0:kr.challenges.map(Qi=>({id:Qi==null?void 0:Qi.id,score:Qi.score}));Po(wr)},[pr]),(0,pt.useImperativeHandle)(fe,()=>({onSave:Ur,Clear:Ri}));const Ur=()=>({challenges:[...Vr]}),Ri=()=>{Po([])};console.log("editData--",pr);const Gi=kr=>{var wr,Qi;return pt.createElement("div",null,(Qi=(wr=kr==null?void 0:kr.shixun)==null?void 0:wr.challenges)==null?void 0:Qi.map((ar,so)=>{var xr;return pt.createElement("div",{className:"c-grey-666 font14 ml25",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"15px"}},pt.createElement("div",null,pt.createElement("span",{className:"mr5"},"\u7B2C",so+1,"\u5173"),pt.createElement(Me.Z,{key:so,title:ar==null?void 0:ar.challenge_name},pt.createElement("span",null,(0,Yt.Pq)(ar==null?void 0:ar.challenge_name,44)))),pt.createElement("p",{style:{marginBottom:0}},pt.createElement("span",{className:ee.required},"*"),pt.createElement("span",{className:ee.title},"\u5206\u503C\uFF1A"),pt.createElement(qt.Z,{precision:1,min:1,max:100,className:ee.baseFormItem,style:{width:176},value:(xr=Vr.find(Ji=>Ji.id===ar.id))==null?void 0:xr.score,onChange:Ji=>{Vr.find(er=>er.id===ar.id).score=Ji,Po([...Vr])}})))}),pt.createElement("div",{style:{clear:"both"}}))};return pt.createElement("section",{className:ee.wrap},pt.createElement(Dt.Z,{style:{paddingRight:10},className:ee.titleHtml,value:`${pr==null?void 0:pr.position}\u3001${pr==null?void 0:pr.name}`}),pt.createElement("p",{style:{marginBottom:"10px",marginTop:"25px"}},pt.createElement("span",{className:ee.required},"*"),pt.createElement("span",{className:ee.title},"\u5173\u5361")),Gi(pr))};var ei=(0,Jt.connect)(({loading:xe,globalSetting:fe})=>({globalSetting:fe,loading:xe.effects}),null,null,{forwardRef:!0})((0,pt.forwardRef)(mi)),Si=Object.getOwnPropertySymbols,Wi=Object.prototype.hasOwnProperty,An=Object.prototype.propertyIsEnumerable,gn=(xe,fe)=>{var Ve={};for(var Zt in xe)Wi.call(xe,Zt)&&fe.indexOf(Zt)<0&&(Ve[Zt]=xe[Zt]);if(xe!=null&&Si)for(var Zt of Si(xe))fe.indexOf(Zt)<0&&An.call(xe,Zt)&&(Ve[Zt]=xe[Zt]);return Ve};const Rn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],si=(xe,fe)=>{var Ve=xe,{editData:Zt,globalSetting:Ye,loading:pr,dispatch:oo,onRef:rr=()=>{},isEdit:Sr}=Ve,xo=gn(Ve,["editData","globalSetting","loading","dispatch","onRef","isEdit"]);const[Vr,Po]=(0,pt.useState)([]),[Ur,Ri]=(0,pt.useState)(),[Gi,kr]=(0,pt.useState)([]),[wr,Qi]=(0,pt.useState)(""),[ar,so]=(0,pt.useState)("");(0,pt.useEffect)(()=>{Po(["","","",""])},[]),(0,pt.useEffect)(()=>{if(!Zt||!Sr)return;Qi(Zt==null?void 0:Zt.name),so(Zt==null?void 0:Zt.analysis),Po(Zt==null?void 0:Zt.choices.map(tr=>tr.choice_text));const er=[];Zt==null||Zt.choices.map((tr,bi)=>{tr.is_answer&&er.push(bi)}),kr(er)},[Zt]),(0,pt.useImperativeHandle)(fe,()=>({onSave:xr,Clear:Ji}));const xr=()=>{if(!wr)return ge.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;const er=Vr.findIndex(bi=>!bi);if(er>-1)return ge.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${Rn[er]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!Gi.length)return ge.ZP.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;if(Gi.length<2)return ge.ZP.info("\u591A\u9009\u9898\u6700\u5C0F\u6B63\u786E\u9009\u9879\u4E3A2\u4E2A"),!1;const tr=Vr.map((bi,ho)=>({choice_text:bi,is_answer:Gi.includes(ho)?1:0}));return{name:wr,choices:tr,analysis:ar}},Ji=()=>{Po(["","","",""]),Qi(""),so(""),kr("")};return pt.createElement("section",{className:ee.wrap},pt.createElement("p",{className:ee.titleWrap},pt.createElement("span",{className:ee.required},"*"),pt.createElement("span",{className:ee.title},"\u9898\u5E72\uFF1A")),pt.createElement(jn.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:wr,onChange:er=>Qi(er)}),pt.createElement("p",{className:ee.titleWrap},pt.createElement("span",{className:ee.required},"*"),pt.createElement("span",{className:ee.title},"\u7B54\u6848\u9009\u9879\uFF1A",pt.createElement("span",{className:ee.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Vr.map((er,tr)=>pt.createElement("div",{className:ee.choiceWrap,key:tr},pt.createElement(Me.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},pt.createElement("div",{className:`${ee.answer} ${Gi.includes(tr)?ee.activeAnswer:""}`,onClick:()=>{Gi.includes(tr)?kr(Gi.filter(bi=>bi!==tr)):kr([...Gi,tr])}},Rn[tr])),pt.createElement("div",{className:ee.editorWrap},Ur===tr?pt.createElement(jn.Z,{id:`single-question-option-${tr}`,watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:er,onChange:bi=>{Vr[tr]=bi,Po(Vr)}}):pt.createElement("div",{className:ee.htmlWrap,onClick:()=>Ri(tr)},pt.createElement(Dt.Z,{value:er}))),tr>1&&pt.createElement(Me.Z,{title:"\u5220\u9664"},pt.createElement("i",{className:`${ee.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>{Po(Vr.filter((bi,ho)=>ho!==tr)),Gi.includes(tr)?kr(Gi.filter(bi=>bi!==tr)):kr([...Gi,tr])}})),tr<7&&tr===Vr.length-1&&pt.createElement(Me.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},pt.createElement("i",{className:`${ee.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>Po([...Vr,""])})))),pt.createElement("p",{className:ee.titleWrap},pt.createElement("span",{className:ee.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),pt.createElement(jn.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:ar,onChange:er=>so(er)}))};var xi=(0,Jt.connect)(({loading:xe,globalSetting:fe})=>({globalSetting:fe,loading:xe.effects}),null,null,{forwardRef:!0})((0,pt.forwardRef)(si)),di=Object.getOwnPropertySymbols,Oi=Object.prototype.hasOwnProperty,wt=Object.prototype.propertyIsEnumerable,yn=(xe,fe)=>{var Ve={};for(var Zt in xe)Oi.call(xe,Zt)&&fe.indexOf(Zt)<0&&(Ve[Zt]=xe[Zt]);if(xe!=null&&di)for(var Zt of di(xe))fe.indexOf(Zt)<0&&wt.call(xe,Zt)&&(Ve[Zt]=xe[Zt]);return Ve};const Wn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ki=(xe,fe)=>{var Ve=xe,{editData:Zt,globalSetting:Ye,loading:pr,dispatch:oo,onRef:rr=()=>{},isEdit:Sr}=Ve,xo=yn(Ve,["editData","globalSetting","loading","dispatch","onRef","isEdit"]);const[Vr,Po]=(0,pt.useState)([]),[Ur,Ri]=(0,pt.useState)(),[Gi,kr]=(0,pt.useState)(),[wr,Qi]=(0,pt.useState)(""),[ar,so]=(0,pt.useState)("");(0,pt.useEffect)(()=>{Po(["","","",""])},[]),(0,pt.useEffect)(()=>{if(!Zt||!Sr)return;const er=[],tr=[];Zt==null||Zt.choices.forEach((bi,ho)=>{er.push(bi.choice_text),bi.is_answer&&tr.push(ho)}),Qi(Zt==null?void 0:Zt.name),so(Zt==null?void 0:Zt.analysis),Po(er),kr(tr)},[Zt]),(0,pt.useImperativeHandle)(fe,()=>({onSave:xr,Clear:Ji}));const xr=()=>{if(!wr)return ge.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;const er=Vr.findIndex(bi=>!bi);if(er>-1)return ge.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${Wn[er]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!Array.isArray(Gi))return ge.ZP.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),!1;const tr=Vr.map((bi,ho)=>({choice_text:bi,is_answer:Gi.includes(ho)?1:0}));return{name:wr,choices:tr,analysis:ar}},Ji=()=>{Po(["","","",""]),Qi(""),so(""),kr("")};return pt.createElement("section",{className:ee.wrap},pt.createElement("p",{className:ee.titleWrap},pt.createElement("span",{className:ee.required},"*"),pt.createElement("span",{className:ee.title},"\u9898\u5E72\uFF1A")),pt.createElement(jn.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:wr,onChange:er=>Qi(er)}),pt.createElement("p",{className:ee.titleWrap},pt.createElement("span",{className:ee.required},"*"),pt.createElement("span",{className:ee.title},"\u7B54\u6848\u9009\u9879\uFF1A",pt.createElement("span",{className:ee.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Vr.map((er,tr)=>pt.createElement("div",{className:ee.choiceWrap,key:tr},pt.createElement(Me.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},pt.createElement("div",{className:`${ee.answer} ${Gi!=null&&Gi.includes(tr)?ee.activeAnswer:""}`,onClick:()=>kr([tr])},Wn[tr])),pt.createElement("div",{className:ee.editorWrap},Ur===tr?pt.createElement(jn.Z,{id:`single-question-option-${tr}`,watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:er,onChange:bi=>{Vr[tr]=bi,Po(Vr)}}):pt.createElement("div",{className:ee.htmlWrap,onClick:()=>Ri(tr)},pt.createElement(Dt.Z,{value:er}))),tr>1&&pt.createElement(Me.Z,{title:"\u5220\u9664"},pt.createElement("i",{className:`${ee.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>{Po(Vr.filter((bi,ho)=>ho!==tr)),tr===Gi&&kr(null)}})),tr<7&&tr===Vr.length-1&&pt.createElement(Me.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},pt.createElement("i",{className:`${ee.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>Po([...Vr,""])})))),pt.createElement("p",{className:ee.titleWrap},pt.createElement("span",{className:ee.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),pt.createElement(jn.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:ar,onChange:er=>so(er)}))};var Ui=(0,Jt.connect)(({loading:xe,globalSetting:fe})=>({globalSetting:fe,loading:xe.effects}),null,null,{forwardRef:!0})((0,pt.forwardRef)(ki)),ur=kt(96599),Mr=kt(71411),gi=kt(61485),bn=kt(59301),pe=Object.defineProperty,Se=Object.defineProperties,ve=Object.getOwnPropertyDescriptors,zn=Object.getOwnPropertySymbols,kn=Object.prototype.hasOwnProperty,Qn=Object.prototype.propertyIsEnumerable,$e=(xe,fe,Ve)=>fe in xe?pe(xe,fe,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):xe[fe]=Ve,On=(xe,fe)=>{for(var Ve in fe||(fe={}))kn.call(fe,Ve)&&$e(xe,Ve,fe[Ve]);if(zn)for(var Ve of zn(fe))Qn.call(fe,Ve)&&$e(xe,Ve,fe[Ve]);return xe},Fe=(xe,fe)=>Se(xe,ve(fe)),Pe=(xe,fe)=>{var Ve={};for(var Zt in xe)kn.call(xe,Zt)&&fe.indexOf(Zt)<0&&(Ve[Zt]=xe[Zt]);if(xe!=null&&zn)for(var Zt of zn(xe))fe.indexOf(Zt)<0&&Qn.call(xe,Zt)&&(Ve[Zt]=xe[Zt]);return Ve},Zn=(xe,fe,Ve)=>new Promise((Zt,Ye)=>{var pr=Sr=>{try{rr(Ve.next(Sr))}catch(xo){Ye(xo)}},oo=Sr=>{try{rr(Ve.throw(Sr))}catch(xo){Ye(xo)}},rr=Sr=>Sr.done?Zt(Sr.value):Promise.resolve(Sr.value).then(pr,oo);rr((Ve=Ve.apply(xe,fe)).next())});const $t=xe=>{if(!xe)return!1;if(/^s*$/.test(xe)||xe.trim()===""){ge.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C");return}let fe=new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]");return xe==="|"?(ge.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},Ze=({value:xe=[],onClose:fe})=>bn.createElement(ur.default,{closable:!0,onClose:fe,className:ee.keywordTag},bn.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},xe.join(" \u6216 "))),wn=(xe,fe)=>{var Ve=xe,{editData:Zt,globalSetting:Ye,loading:pr,dispatch:oo,onRef:rr=()=>{},isEdit:Sr}=Ve,xo=Pe(Ve,["editData","globalSetting","loading","dispatch","onRef","isEdit"]);const[Vr,Po]=(0,pt.useState)(""),[Ur,Ri]=(0,pt.useState)(""),[Gi,kr]=(0,pt.useState)(""),[wr,Qi]=(0,pt.useState)(""),[ar]=le.default.useForm(),so=le.default.useWatch("use_keywords",ar);(0,pt.useEffect)(()=>{var tr;!Zt||!Sr||(Po(Zt==null?void 0:Zt.name),Ri(Zt==null?void 0:Zt.analysis),kr((tr=Zt==null?void 0:Zt.answer_texts)==null?void 0:tr[0]),ar.setFieldsValue(On({},Zt)))},[Zt]),(0,pt.useImperativeHandle)(fe,()=>({onSave:xr,Clear:Ji}));const xr=()=>Zn(void 0,null,function*(){if(!Vr)return ge.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;try{yield ar.validateFields()}catch(bi){ge.ZP.error(bi.errorFields[0].errors[0]);return}const tr=ar.getFieldsValue();return console.log(tr,"values"),On({name:Vr,answer_texts:[Gi],analysis:Ur},tr)}),Ji=()=>{Po(""),Ri(""),kr(""),ar.resetFields()},er=Zt==null?void 0:Zt.score;return bn.createElement("section",{className:ee.wrap},bn.createElement("p",{className:ee.titleWrap},bn.createElement("span",{className:ee.required},"*"),bn.createElement("span",{className:ee.title},"\u9898\u5E72\uFF1A")),bn.createElement(jn.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Vr,onChange:tr=>Po(tr)}),bn.createElement("p",{className:ee.titleWrap},bn.createElement("span",{className:ee.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),bn.createElement(jn.Z,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:Gi,onChange:tr=>kr(tr)}),bn.createElement("p",{className:ee.titleWrap},bn.createElement("span",{className:ee.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),bn.createElement(jn.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Ur,onChange:tr=>Ri(tr)}),bn.createElement(le.default,{form:ar,size:"large",onFinishFailed:tr=>Zn(void 0,null,function*(){var bi,ho;ge.ZP.error(tr.errorFields[0].errors[0]),ar.scrollToField((ho=(bi=tr==null?void 0:tr.errorFields)==null?void 0:bi[0])==null?void 0:ho.name,{behavior:"smooth",block:"center"})})},bn.createElement(ie.Z,{align:"middle",className:"mb30 mt20"},bn.createElement(le.default.Item,{noStyle:!0,name:"use_keywords",valuePropName:"checked"},bn.createElement(Mr.Z,null)),bn.createElement(Ee.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),bn.createElement(Ee.Z,null,bn.createElement(Me.Z,{placement:"right",title:"\u9009\u4E2D\u540E\uFF0C\u9700\u8981\u8BBE\u7F6E\u6BCF\u4E2A\u5173\u952E\u8BCD\u7684\u5206\u503C\uFF0C\u7CFB\u7EDF\u4F1A\u6839\u636E\u8BBE\u7F6E\u7684\u5173\u952E\u8BCD\u8FDB\u884C\u81EA\u52A8\u5224\u5206\uFF1B \u6240\u6709\u5173\u952E\u8BCD\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u5C0F\u9898\u5206\u503C\u3002"},bn.createElement(gi.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),so&&bn.createElement(le.default.List,{name:"keywords",rules:[{validator(tr,bi){return bi!=null&&bi.length?(bi==null?void 0:bi.reduce((Ir,fo)=>Ir+fo.score,0))>parseFloat(er)?Promise.reject(new Error("\u6240\u6709\u5173\u952E\u8BCD\u7684\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u8BE5\u5C0F\u9898\u7684\u5206\u503C")):Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u5224\u5206\u5173\u952E\u8BCD"))}}]},(tr,{add:bi,remove:ho})=>bn.createElement(bn.Fragment,null,bn.createElement("div",{className:"mb10"},"\u5173\u952E\u8BCD"),bn.createElement(ie.Z,{align:"middle",className:"font14 mb30"},bn.createElement(Ee.Z,{flex:1},bn.createElement(ne.default,{value:wr,onChange:Ir=>{Qi(Ir.target.value)},maxLength:50,allowClear:!0,onPressEnter:Ir=>{var fo,Mo,dr,po;const Za=`${(fo=Ir.target)==null?void 0:fo.value}`,zi=(dr=(Mo=Za==null?void 0:Za.split("|"))==null?void 0:Mo.filter(ra=>!!ra))==null?void 0:dr.map(ra=>ra==null?void 0:ra.trim()),ta=ar.getFieldValue("keywords"),Nr=((po=ta==null?void 0:ta.map(ra=>ra==null?void 0:ra.keyword))==null?void 0:po.flat())||[];for(const ra of zi)if(Nr.includes(ra)){ge.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}$t(Za)&&(bi({keyword:zi,score:1}),Qi(""))},className:ee.inputBorder,placeholder:"\u652F\u6301\u8BBE\u7F6E\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u8BF7\u7528\u201C|\u201D\u5206\u9694\u5F00"})),bn.createElement(Ee.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),tr.map(Ir=>{var fo=Ir,{key:Mo,name:dr}=fo,po=Pe(fo,["key","name"]);return bn.createElement(ie.Z,{key:Mo,style:{marginRight:148}},bn.createElement(Ee.Z,{flex:1},bn.createElement(ie.Z,{align:"middle",justify:"space-between"},bn.createElement(le.default.Item,Fe(On({},po),{name:[dr,"keyword"]}),bn.createElement(Ze,{onClose:()=>ho(dr)})),bn.createElement(le.default.Item,Fe(On({},po),{name:[dr,"score"],label:"\u5206\u503C",rules:[{required:!0}]}),bn.createElement(qt.Z,{min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))})))))};var ri=(0,Jt.connect)(({loading:xe,globalSetting:fe})=>({globalSetting:fe,loading:xe.effects}),null,null,{forwardRef:!0})((0,pt.forwardRef)(wn)),We=kt(8848),je={wrap:"wrap___Cc0gS",deleteIcon:"deleteIcon___ebwMv",keywordTag:"keywordTag___lUfL5",questionTitleEditorWrap:"questionTitleEditorWrap___u9UgK",choiceWrap:"choiceWrap___VHsr3",choiceIndex:"choiceIndex___rsj9r",judgementIndex:"judgementIndex___fMm6E",setAnswerBtn:"setAnswerBtn___krVC9",activeAnswer:"activeAnswer___WiYo2",activeJudgementAnswer:"activeJudgementAnswer___M6iww",actionWrapper:"actionWrapper___oKI8_",addIcon:"addIcon___eMbGP",inputBorder:"inputBorder___ob_6x",placeholder:"placeholder___Vkwr4",blankWrapper:"blankWrapper____MZQ5",blankInput:"blankInput___ephwY",blankInputNumberWrapper:"blankInputNumberWrapper___C1UJS",addBtn:"addBtn___qRBpJ",blankIndex:"blankIndex___QsKgf",baseInputWrapper:"baseInputWrapper___juqCB",collapseWrapper:"collapseWrapper___kAXJ0",panelHeader:"panelHeader___hLTSe",open:"open___wWDjf",close:"close___XPTJ0",hide:"hide___VytUy"},Vn=kt(32134),ci=kt(12893),Mi=Object.defineProperty,pi=Object.defineProperties,oi=Object.getOwnPropertyDescriptors,hi=Object.getOwnPropertySymbols,Bi=Object.prototype.hasOwnProperty,_i=Object.prototype.propertyIsEnumerable,Ki=(xe,fe,Ve)=>fe in xe?Mi(xe,fe,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):xe[fe]=Ve,en=(xe,fe)=>{for(var Ve in fe||(fe={}))Bi.call(fe,Ve)&&Ki(xe,Ve,fe[Ve]);if(hi)for(var Ve of hi(fe))_i.call(fe,Ve)&&Ki(xe,Ve,fe[Ve]);return xe},no=(xe,fe)=>pi(xe,oi(fe)),vr=(xe,fe)=>{var Ve={};for(var Zt in xe)Bi.call(xe,Zt)&&fe.indexOf(Zt)<0&&(Ve[Zt]=xe[Zt]);if(xe!=null&&hi)for(var Zt of hi(xe))fe.indexOf(Zt)<0&&_i.call(xe,Zt)&&(Ve[Zt]=xe[Zt]);return Ve};const Xr=xe=>{var fe=xe,{value:Ve,onChange:Zt,scrollId:Ye}=fe,pr=vr(fe,["value","onChange","scrollId"]);return pt.createElement("div",{id:Ye||""},pt.createElement(jn.Z,no(en({},pr),{defaultValue:Ve,onChange:(oo,rr)=>{rr!=null&&rr.length?Zt(oo,rr):Zt(oo)}})))},He=({value:xe,onChange:fe,placeholder:Ve,height:Zt=140,isEdit:Ye})=>Ye?pt.createElement(jn.Z,{watch:!0,isFocus:!0,height:Zt,placeholder:Ve,defaultValue:xe,onChange:fe}):pt.createElement("div",{style:{cursor:"pointer"}},xe?pt.createElement(Dt.Z,{className:je.inputBorder,value:xe}):pt.createElement("div",{className:`${je.inputBorder} ${je.placeholder}`},Ve));var Hn=kt(59301),Fi=Object.defineProperty,Hi=Object.defineProperties,Ii=Object.getOwnPropertyDescriptors,Yi=Object.getOwnPropertySymbols,Ar=Object.prototype.hasOwnProperty,Pr=Object.prototype.propertyIsEnumerable,Br=(xe,fe,Ve)=>fe in xe?Fi(xe,fe,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):xe[fe]=Ve,Fr=(xe,fe)=>{for(var Ve in fe||(fe={}))Ar.call(fe,Ve)&&Br(xe,Ve,fe[Ve]);if(Yi)for(var Ve of Yi(fe))Pr.call(fe,Ve)&&Br(xe,Ve,fe[Ve]);return xe},fn=(xe,fe)=>Hi(xe,Ii(fe)),io=(xe,fe)=>{var Ve={};for(var Zt in xe)Ar.call(xe,Zt)&&fe.indexOf(Zt)<0&&(Ve[Zt]=xe[Zt]);if(xe!=null&&Yi)for(var Zt of Yi(xe))fe.indexOf(Zt)<0&&Pr.call(xe,Zt)&&(Ve[Zt]=xe[Zt]);return Ve};const pn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Di=({value:xe,onChange:fe,choiceTextKey:Ve,answerKey:Zt,index:Ye,isEdit:pr,setInputActive:oo,form:rr,choiceOptionsPath:Sr,allowChangeMode:xo,showAddIcon:Vr,addItem:Po,deleteItem:Ur})=>{const Ri=(xe==null?void 0:xe[Zt])===!0,Gi=()=>{const wr=rr.getFieldValue(Sr);rr.setFieldValue(Sr,wr.map(Qi=>fn(Fr({},Qi),{[Zt]:!1})))},kr=()=>{Ri?fe(fn(Fr({},xe),{[Zt]:!1})):(xo||Gi(),fe(fn(Fr({},xe),{[Zt]:!0})))};return Hn.createElement(ie.Z,{className:je.choiceWrap,align:"middle",wrap:!1},Hn.createElement(Ee.Z,{onClick:kr,className:`${je.choiceIndex} ${Ri?je.activeAnswer:""}`},pn[Ye]),Hn.createElement(Ee.Z,{flex:1,className:`${je.editorWrap} ml15`,onClick:oo},Hn.createElement(He,{height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",isEdit:pr,value:xe==null?void 0:xe[Ve],onChange:wr=>{fe(fn(Fr({},xe),{[Ve]:wr}))}})),Hn.createElement(Ee.Z,{flex:"0 0 auto",className:"ml15"},Hn.createElement("div",{onClick:kr,className:`${je.setAnswerBtn} ${Ri?je.activeAnswer:""}`},Ri?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")),Hn.createElement(Ee.Z,{className:je.actionWrapper},Hn.createElement(Me.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},Hn.createElement(Vn.Z,{className:je.addIcon,onClick:Po,style:{visibility:Vr?"visible":"hidden"}})),Hn.createElement(Me.Z,{title:"\u5220\u9664"},Hn.createElement(ci.Z,{className:je.deleteIcon,onClick:Ur,style:{visibility:Ye>1?"visible":"hidden"}}))))},$i=({questionTitlePlaceholder:xe,titleKey:fe,choiceKey:Ve,analysisKey:Zt,choiceTextKey:Ye,answerKey:pr,choiceOptionsPath:oo,allowChangeMode:rr=!0,form:Sr,showAnalysis:xo=!0})=>{const[Vr,Po]=(0,pt.useState)(),[Ur,Ri]=(0,pt.useState)(!1);return Hn.createElement("div",{className:je.wrap},Hn.createElement("div",{className:je.questionTitleEditorWrap},Hn.createElement(le.default.Item,{label:"\u9898\u5E72",name:fe,labelCol:{span:24},rules:[{required:!0}]},Hn.createElement(Xr,{scrollId:Array.isArray(fe)?fe.join("_"):`${fe}`,watch:!0,height:140,placeholder:xe}))),Hn.createElement(le.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),Hn.createElement(le.default.List,{name:Ve,rules:[{validator(Gi,kr){const wr=kr.some(ar=>ar[pr]),Qi=kr.findIndex(ar=>{var so;return((so=ar[Ye])==null?void 0:so.length)<=0});return Qi!==-1?Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${pn[Qi]}\u9009\u9879\u7684\u5185\u5BB9`)):wr?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},(Gi,{add:kr,remove:wr})=>Hn.createElement("div",{id:Array.isArray(oo)?oo.join("_"):`${oo}`},Gi.map((Qi,ar)=>{var so=Qi,{key:xr,name:Ji}=so,er=io(so,["key","name"]);const tr=Vr===xr,bi=()=>{Po(xr)},ho=ar<7&&ar===Gi.length-1,Ir=()=>kr({[Ye]:"",[pr]:0}),fo=()=>wr(Ji);return Hn.createElement(le.default.Item,fn(Fr({},er),{key:xr,name:Ji,noStyle:!0}),Hn.createElement(Di,{choiceTextKey:Ye,answerKey:pr,index:ar,isEdit:tr,setInputActive:bi,form:Sr,choiceOptionsPath:oo,allowChangeMode:rr,showAddIcon:ho,addItem:Ir,deleteItem:fo}))}),Gi.length<8&&Hn.createElement("div",{className:`${je.addBtn} mb30`,onClick:()=>kr({[Ye]:"",[pr]:0})},"\u6DFB\u52A0\u9009\u9879"))),xo&&Hn.createElement("div",{onClick:()=>Ri(!0)},Hn.createElement(le.default.Item,{name:Zt,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},Hn.createElement(He,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Ur}))))};var Ai=kt(59301),bo=Object.defineProperty,Fo=Object.defineProperties,ao=Object.getOwnPropertyDescriptors,co=Object.getOwnPropertySymbols,Re=Object.prototype.hasOwnProperty,mn=Object.prototype.propertyIsEnumerable,Ie=(xe,fe,Ve)=>fe in xe?bo(xe,fe,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):xe[fe]=Ve,At=(xe,fe)=>{for(var Ve in fe||(fe={}))Re.call(fe,Ve)&&Ie(xe,Ve,fe[Ve]);if(co)for(var Ve of co(fe))mn.call(fe,Ve)&&Ie(xe,Ve,fe[Ve]);return xe},Un=(xe,fe)=>Fo(xe,ao(fe)),Nn=(xe,fe)=>{var Ve={};for(var Zt in xe)Re.call(xe,Zt)&&fe.indexOf(Zt)<0&&(Ve[Zt]=xe[Zt]);if(xe!=null&&co)for(var Zt of co(xe))fe.indexOf(Zt)<0&&mn.call(xe,Zt)&&(Ve[Zt]=xe[Zt]);return Ve};const Yn=({value:xe,onChange:fe})=>{const Ve=Ye=>{It.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:je.modal,onOk:()=>{const pr=[...xe];pr.splice(Ye,1),fe(pr)}})},Zt=()=>{const Ye=[...xe];Ye.push(""),fe(Ye)};return Ai.createElement(ie.Z,{align:"middle",className:"ml20",gutter:[40,20]},xe==null?void 0:xe.map((Ye,pr)=>Ai.createElement(Ee.Z,{key:`${Ye}_${pr}`,className:je.blankWrapper},Ai.createElement(ne.default,{className:je.blankInput,defaultValue:Ye,maxLength:1e3,onBlur:oo=>{const rr=[...xe],Sr=oo.target.value.trim();rr[pr]=Sr,fe(rr)}}),Ai.createElement(Me.Z,{title:"\u5220\u9664"},Ai.createElement(ci.Z,{className:je.deleteIcon,style:{marginLeft:15,visibility:pr>0?"visible":"hidden"},onClick:()=>Ve(pr)})))),Ai.createElement(Ee.Z,null,Ai.createElement("div",{className:`${je.addBtn}`,onClick:()=>{Zt()}},"\u65B0\u589E\u7B54\u6848")))},ai=({value:xe=!0,onChange:fe})=>Ai.createElement(Mr.Z,{checked:!xe,onChange:Ve=>{fe(!Ve)}}),vi="\u2581",Cn=({questionTitlePlaceholder:xe,form:fe,name:Ve,scoreByBlank:Zt="use_blank_score",answerKey:Ye,titleKey:pr="name",analysisKey:oo="analysis",isOrdered:rr="is_ordered"})=>{var Sr,xo;const[Vr,Po]=(0,pt.useState)(!1),Ur=(xr,Ji)=>{const er=Ji.line;let tr=0;for(let ho=0;ho<er;ho++)tr+=xr.getLine(ho).split(vi).length-1;const bi=xr.getLine(er).substring(0,Ji.ch);return tr+=bi.split(vi).length-1,tr},Ri=(xr,Ji,er,tr)=>{const bi=xr.getRange(Ji.from,Ji.to);let ho=0;if(Ji.text.forEach(Ir=>{ho+=Ir.split(vi).length-1}),Ji.origin!=="setValue"){if(bi&&bi.indexOf(vi)!==-1){const Ir=bi.split(vi).length-1,fo=Ur(xr,Ji.from);if(console.log(`\u5220\u9664${Ir}\u4E2A\uFF0C \u524D\u9762\u6709${fo}\u4E2A\uFF0C\u65B0\u589E${ho}\u4E2A`),Ir>1){const Mo=Array.from({length:Ir},(dr,po)=>fo+po);tr(Mo)}else tr(fo)}else if(ho>0){const Ir=Ur(xr,Ji.from);console.log(`\u65B0\u589E${ho}\u4E2A\uFF0C\u4E4B\u524D\u6709${Ir}\u4E2A`),er(ho,Ir)}}},Gi=()=>{const xr=fe.getFieldValue(["sub_item_banks",...Ye]);fe.setFieldValue(["sub_item_banks",...Ye],xr==null?void 0:xr.map((Ji,er)=>Un(At({},Ji),{position:er+1})))},kr=(0,pt.useRef)(),wr=(xr,Ji)=>{for(let er=0;er<xr;er++)kr.current({position:null,answer_text:[""]},Ji+er);Gi()},Qi=(0,pt.useRef)(),ar=xr=>{Qi.current(xr),Gi()},so=(xo=(Sr=fe.getFieldValue("sub_item_banks"))==null?void 0:Sr[Ye==null?void 0:Ye[0]])==null?void 0:xo[Ye==null?void 0:Ye[1]];return Ai.createElement("div",{className:je.wrap},Ai.createElement("div",{className:je.questionTitleEditorWrap},Ai.createElement(le.default.Item,{label:"\u9898\u5E72",name:pr,labelCol:{span:24},rules:[{required:!0}]},Ai.createElement(Xr,{scrollId:"name",watch:!0,height:140,placeholder:xe,showNullButton:!0,onCMBeforeChange:(xr,Ji)=>{Ri(xr,Ji,wr,ar)}}))),Ai.createElement(le.default.List,{name:Ye,rules:[{validator(xr,Ji){if((Ji==null?void 0:Ji.length)===0)return Promise.reject(new Error("\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"));for(const er of Ji){const{answer_text:tr}=er||{};if(tr!=null&&tr.some(bi=>(bi==null?void 0:bi.length)===0))return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(xr,{add:Ji,remove:er},{errors:tr})=>(kr.current=Ji,Qi.current=er,Ai.createElement(Ai.Fragment,null,Ai.createElement(le.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),xr.map((bi,ho)=>{var Ir=bi,{key:fo,name:Mo}=Ir,dr=Nn(Ir,["key","name"]);return Ai.createElement(ie.Z,{className:"mb20",key:fo,align:"middle",wrap:!1},Ai.createElement(Ee.Z,{flex:"0 0 auto",className:`${je.blankIndex}`},"\u586B\u7A7A\u9879",ho+1),Ai.createElement(Ee.Z,{flex:1},Ai.createElement(ie.Z,{align:"top",justify:"space-between",wrap:!1},Ai.createElement(Ee.Z,null,Ai.createElement(le.default.Item,Un(At({},dr),{name:[Mo,"answer_text"],noStyle:!0}),Ai.createElement(Yn,null))),(fe==null?void 0:fe.getFieldValue(["sub_item_banks",...Zt]))&&Ai.createElement(Ee.Z,{flex:"224px"},Ai.createElement(le.default.Item,Un(At({},dr),{name:[Mo,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:je.blankInputNumberWrapper}),Ai.createElement(qt.Z,{className:je.blankInput,min:.1,max:100,style:{width:"100%"},placeholder:"\u6309\u7A7A\u7ED9\u5206\u8BF7\u8F93\u5165\u5206\u503C"})))),Ai.createElement(le.default.Item,Un(At({},dr),{name:[Mo,"position"],noStyle:!0}),Ai.createElement(ne.default,{type:"hidden"}))))})))),Ai.createElement(ie.Z,{align:"middle"},Ai.createElement(le.default.Item,{name:[Ve,"downcase"],valuePropName:"checked"},Ai.createElement(Mr.Z,null)),Ai.createElement(Ee.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),Ai.createElement(ie.Z,{align:"middle"},Ai.createElement(le.default.Item,{name:[Ve,"no_space"],valuePropName:"checked"},Ai.createElement(Mr.Z,null)),Ai.createElement(Ee.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(so==null?void 0:so.length)>1&&Ai.createElement(ie.Z,{align:"middle",className:(so==null?void 0:so.length)>1?"mb30":`${je.hide}`},Ai.createElement(le.default.Item,{name:rr},Ai.createElement(ai,null)),Ai.createElement(Ee.Z,{className:"ml10"},"\u5141\u8BB8\u5B66\u751F\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u4E0E\u6807\u51C6\u7B54\u6848\u7684\u987A\u5E8F\u4E0D\u4E00\u81F4")),Ai.createElement("div",{onClick:()=>Po(!0)},Ai.createElement(le.default.Item,{name:oo,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},Ai.createElement(He,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Vr}))))};var $n=Object.defineProperty,ti=Object.defineProperties,ii=Object.getOwnPropertyDescriptors,ni=Object.getOwnPropertySymbols,Vi=Object.prototype.hasOwnProperty,Ei=Object.prototype.propertyIsEnumerable,yi=(xe,fe,Ve)=>fe in xe?$n(xe,fe,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):xe[fe]=Ve,ln=(xe,fe)=>{for(var Ve in fe||(fe={}))Vi.call(fe,Ve)&&yi(xe,Ve,fe[Ve]);if(ni)for(var Ve of ni(fe))Ei.call(fe,Ve)&&yi(xe,Ve,fe[Ve]);return xe},Pi=(xe,fe)=>ti(xe,ii(fe)),qi=(xe,fe)=>{var Ve={};for(var Zt in xe)Vi.call(xe,Zt)&&fe.indexOf(Zt)<0&&(Ve[Zt]=xe[Zt]);if(xe!=null&&ni)for(var Zt of ni(xe))fe.indexOf(Zt)<0&&Ei.call(xe,Zt)&&(Ve[Zt]=xe[Zt]);return Ve};const Tr={\u6B63\u786E:"T",\u9519\u8BEF:"F"},Lr=({value:xe,onChange:fe,form:Ve,choiceKey:Zt})=>{const Ye=(xe==null?void 0:xe.is_answer)===!0,pr=xe==null?void 0:xe.choice_text,oo=()=>{var rr;const Sr=(rr=Ve==null?void 0:Ve.getFieldValue(["sub_item_banks",...Zt]))==null?void 0:rr.map(xo=>({choice_text:xo==null?void 0:xo.choice_text,is_answer:!1}));Ve==null||Ve.setFieldValue(["sub_item_banks",...Zt],Sr),fe(Pi(ln({},xe),{is_answer:!0}))};return pt.createElement(ie.Z,{className:je.choiceWrap,align:"middle",wrap:!1},pt.createElement(Ee.Z,{onClick:oo,className:`${je.choiceIndex} ${je.judgementIndex} ${Ye?je.activeAnswer:""}`},Tr[pr]),pt.createElement(Ee.Z,{flex:1,className:`${je.editorWrap} ml15`},pt.createElement("div",{className:`${je.inputBorder} ${je.placeholder} ${Ye?je.activeJudgementAnswer:""}`},pr)),pt.createElement(Ee.Z,{flex:"0 0 auto",className:"ml15"},pt.createElement("div",{onClick:oo,className:`${je.setAnswerBtn} ${Ye?je.activeAnswer:""}`},Ye?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},Rr=({questionTitlePlaceholder:xe,choiceKey:fe="choices",form:Ve,titleKey:Zt="name",analysisKey:Ye="analysis"})=>{const[pr,oo]=(0,pt.useState)(!1);return pt.createElement("div",{className:je.wrap},pt.createElement("div",{className:je.questionTitleEditorWrap},pt.createElement(le.default.Item,{label:"\u9898\u5E72",name:Zt,labelCol:{span:24},rules:[{required:!0}]},pt.createElement(Xr,{scrollId:"name",watch:!0,height:140,placeholder:xe}))),pt.createElement(le.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},pt.createElement(le.default.List,{name:fe,rules:[{validator(rr,Sr){return Sr.some(Vr=>(Vr==null?void 0:Vr.is_answer)===!0)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},rr=>pt.createElement("div",{id:"choices"},rr.map(Sr=>{var xo=Sr,{key:Vr,name:Po}=xo,Ur=qi(xo,["key","name"]);return pt.createElement(le.default.Item,Pi(ln({},Ur),{key:Vr,name:Po,noStyle:!0}),pt.createElement(Lr,{form:Ve,choiceKey:fe}))})))),pt.createElement("div",{onClick:()=>oo(!0)},pt.createElement(le.default.Item,{name:Ye,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},pt.createElement(He,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:pr}))))};var Zr=Object.defineProperty,jr=Object.defineProperties,Co=Object.getOwnPropertyDescriptors,vo=Object.getOwnPropertySymbols,Uo=Object.prototype.hasOwnProperty,Be=Object.prototype.propertyIsEnumerable,Wr=(xe,fe,Ve)=>fe in xe?Zr(xe,fe,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):xe[fe]=Ve,qr=(xe,fe)=>{for(var Ve in fe||(fe={}))Uo.call(fe,Ve)&&Wr(xe,Ve,fe[Ve]);if(vo)for(var Ve of vo(fe))Be.call(fe,Ve)&&Wr(xe,Ve,fe[Ve]);return xe},fr=(xe,fe)=>jr(xe,Co(fe)),Qr=(xe,fe)=>{var Ve={};for(var Zt in xe)Uo.call(xe,Zt)&&fe.indexOf(Zt)<0&&(Ve[Zt]=xe[Zt]);if(xe!=null&&vo)for(var Zt of vo(xe))fe.indexOf(Zt)<0&&Be.call(xe,Zt)&&(Ve[Zt]=xe[Zt]);return Ve};const hr=xe=>{var fe=xe,{value:Ve,onChange:Zt}=fe,Ye=Qr(fe,["value","onChange"]);const pr=oo=>{Zt([oo])};return pt.createElement(jn.Z,fr(qr({},Ye),{defaultValue:Ve==null?void 0:Ve[0],onChange:pr}))},zo=xe=>{if(!xe)return!1;let fe=new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]");return xe==="|"?(ge.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},Eo=({value:xe=[],onClose:fe})=>pt.createElement(ur.default,{closable:!0,onClose:fe,className:je.keywordTag},xe==null?void 0:xe.join(" \u6216 ")),Jr=({questionTitlePlaceholder:xe,form:fe,showKeywords:Ve,isMustKeyWords:Zt=Ve,titleKey:Ye="name",analysisKey:pr="analysis",answerTexts:oo="answer_texts",keywords:rr="keywords",useKeywords:Sr="use_keywords",indexs:xo})=>{const[Vr,Po]=(0,pt.useState)(!1),[Ur,Ri]=(0,pt.useState)(""),Gi=le.default.useWatch("sub_item_banks",fe),{use_keywords:kr,score:wr}=(Gi==null?void 0:Gi[xo])||{};return console.log(kr,wr,"itemValues"),pt.createElement("div",{className:je.wrap},pt.createElement("div",{className:je.questionTitleEditorWrap},pt.createElement(le.default.Item,{label:"\u9898\u5E72",name:Ye,labelCol:{span:24},rules:[{required:!0}]},pt.createElement(Xr,{scrollId:"name",watch:!0,height:140,placeholder:xe}))),pt.createElement(le.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:oo,labelCol:{span:24}},pt.createElement(hr,{watch:!0,height:140,placeholder:"\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"})),Ve&&!Zt&&pt.createElement(le.default.Item,{hidden:!0,name:Sr,valuePropName:"checked"},pt.createElement(Mr.Z,{defaultChecked:!0})),Ve&&Zt&&pt.createElement(ie.Z,{align:"middle",className:"mb30"},pt.createElement(le.default.Item,{name:Sr,valuePropName:"checked"},pt.createElement(Mr.Z,null)),pt.createElement(Ee.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),pt.createElement(Ee.Z,null,pt.createElement(Me.Z,{placement:"right",title:"\u9009\u4E2D\u540E\uFF0C\u9700\u8981\u8BBE\u7F6E\u6BCF\u4E2A\u5173\u952E\u8BCD\u7684\u5206\u503C\uFF0C\u7CFB\u7EDF\u4F1A\u6839\u636E\u8BBE\u7F6E\u7684\u5173\u952E\u8BCD\u8FDB\u884C\u81EA\u52A8\u5224\u5206\uFF1B \u6240\u6709\u5173\u952E\u8BCD\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u5C0F\u9898\u5206\u503C\u3002"},pt.createElement(gi.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),(kr||!Zt)&&pt.createElement(le.default.List,{name:rr,rules:[{validator(Qi,ar){return Zt?ar!=null&&ar.length?(ar==null?void 0:ar.reduce((xr,Ji)=>xr+Ji.score,0))>parseFloat(wr)?Promise.reject(new Error("\u6240\u6709\u5173\u952E\u8BCD\u7684\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u5C0F\u4E8E\u7B49\u4E8E\u8BE5\u5C0F\u9898\u7684\u5206\u503C")):Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u5224\u5206\u5173\u952E\u8BCD")):Promise.resolve()}}]},(Qi,{add:ar,remove:so})=>pt.createElement(pt.Fragment,null,pt.createElement("div",{className:`${je.title} mb10`},Zt?"\u5173\u952E\u8BCD":pt.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),pt.createElement(ie.Z,{align:"middle",className:"font14 mb30"},pt.createElement(Ee.Z,{flex:1},pt.createElement(ne.default,{value:Ur,onChange:xr=>{Ri(xr.target.value)},maxLength:50,allowClear:!0,onPressEnter:xr=>{var Ji,er,tr,bi;const ho=`${(Ji=xr.target)==null?void 0:Ji.value}`,Ir=(tr=(er=ho==null?void 0:ho.split("|"))==null?void 0:er.filter(dr=>!!dr))==null?void 0:tr.map(dr=>dr==null?void 0:dr.trim()),fo=fe.getFieldValue(["sub_item_banks",...rr]),Mo=((bi=fo==null?void 0:fo.map(dr=>dr==null?void 0:dr.keyword))==null?void 0:bi.flat())||[];for(const dr of Ir)if(Mo.includes(dr)){ge.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}zo(ho)&&(ar({keyword:Ir,score:1}),Ri(""))},className:je.inputBorder,placeholder:"\u652F\u6301\u8BBE\u7F6E\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u8BF7\u7528\u201C|\u201D\u5206\u9694\u5F00"})),pt.createElement(Ee.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),Qi.map(xr=>{var Ji=xr,{key:er,name:tr}=Ji,bi=Qr(Ji,["key","name"]);return pt.createElement(ie.Z,{key:er,className:"mb20",style:{marginRight:148}},pt.createElement(Ee.Z,{flex:1},pt.createElement(ie.Z,{align:"middle",justify:"space-between"},pt.createElement(le.default.Item,fr(qr({},bi),{name:[tr,"keyword"]}),pt.createElement(Eo,{onClose:()=>so(tr)})),Zt&&pt.createElement(le.default.Item,fr(qr({},bi),{name:[tr,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:je.blankInputNumberWrapper}),pt.createElement(qt.Z,{className:je.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),pt.createElement("div",{onClick:()=>Po(!0)},pt.createElement(le.default.Item,{name:pr,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},pt.createElement(He,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Vr}))))};var Dr=kt(59301),za=Object.defineProperty,aa=Object.defineProperties,es=Object.getOwnPropertyDescriptors,La=Object.getOwnPropertySymbols,ir=Object.prototype.hasOwnProperty,_o=Object.prototype.propertyIsEnumerable,ia=(xe,fe,Ve)=>fe in xe?za(xe,fe,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):xe[fe]=Ve,ca=(xe,fe)=>{for(var Ve in fe||(fe={}))ir.call(fe,Ve)&&ia(xe,Ve,fe[Ve]);if(La)for(var Ve of La(fe))_o.call(fe,Ve)&&ia(xe,Ve,fe[Ve]);return xe},$r=(xe,fe)=>aa(xe,es(fe)),Kr=(xe,fe)=>{var Ve={};for(var Zt in xe)ir.call(xe,Zt)&&fe.indexOf(Zt)<0&&(Ve[Zt]=xe[Zt]);if(xe!=null&&La)for(var Zt of La(xe))fe.indexOf(Zt)<0&&_o.call(xe,Zt)&&(Ve[Zt]=xe[Zt]);return Ve},In=(xe,fe,Ve)=>new Promise((Zt,Ye)=>{var pr=Sr=>{try{rr(Ve.next(Sr))}catch(xo){Ye(xo)}},oo=Sr=>{try{rr(Ve.throw(Sr))}catch(xo){Ye(xo)}},rr=Sr=>Sr.done?Zt(Sr.value):Promise.resolve(Sr.value).then(pr,oo);rr((Ve=Ve.apply(xe,fe)).next())});const{Panel:gr}=We.default,eo=null,Vo=(xe,fe)=>{var Ve=xe,{globalSetting:Zt,loading:Ye,dispatch:pr,editData:oo,onRef:rr=()=>{},isEdit:Sr}=Ve,xo=Kr(Ve,["globalSetting","loading","dispatch","editData","onRef","isEdit"]);const[Vr,Po]=(0,pt.useState)(""),[Ur,Ri]=(0,pt.useState)([]),[Gi]=le.default.useForm();(0,pt.useEffect)(()=>{!oo||!Sr||(Po(oo==null?void 0:oo.name),Ri(oo==null?void 0:oo.sub_item_banks),Gi.setFieldsValue(ca({},oo)))},[oo]),(0,pt.useEffect)(()=>{Ri(Gi.getFieldValue("sub_item_banks"))},[le.default.useWatch("sub_item_banks",Gi)]),(0,pt.useImperativeHandle)(fe,()=>({onSave:kr,Clear:wr}));const kr=()=>In(void 0,null,function*(){if(!Vr)return ge.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;try{yield Gi.validateFields()}catch(er){return console.log(er,"errInfo"),ge.ZP.error(er.errorFields[0].errors[0]),!1}const Ji=Ur.map(er=>ca({id:er.id>1?er.id:null},er));return{name:Vr,sub_item_banks:Ji}}),wr=()=>{Po(""),Ri([])},Qi={single:"\u5355\u9009\u9898",multiple:"\u591A\u9009\u9898",judgement:"\u5224\u65AD\u9898",completion:"\u586B\u7A7A\u9898",subjective:"\u7B80\u7B54\u9898",practical:"\u5B9E\u8BAD\u9898",program:"\u7F16\u7A0B\u9898",bprogram:"\u7A0B\u5E8F\u586B\u7A7A\u9898",combination:"\u7EC4\u5408\u9898"},ar=({value:Ji})=>Dr.createElement("div",{style:{textAlign:"center",color:"#DF3065",margin:"0 5px"}},Ji),[so,xr]=(0,pt.useState)();return Dr.createElement("section",{className:ee.wrap},Dr.createElement("p",{className:ee.titleWrap},Dr.createElement("span",{className:ee.required},"*"),Dr.createElement("span",{className:ee.title},"\u9898\u5E72\uFF1A")),Dr.createElement(jn.Z,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Vr,onChange:Ji=>Po(Ji)}),Dr.createElement(le.default,{form:Gi,autoComplete:"off"},Dr.createElement(le.default.List,{name:"sub_item_banks",rules:[{validator(Ji,er){return er?Promise.resolve():Promise.reject(new Error("\u8BF7\u6DFB\u52A0\u5C0F\u9898"))}}]},(Ji,{add:er,remove:tr})=>{const bi=Gi.getFieldValue("sub_item_banks");return Dr.createElement(Dr.Fragment,null,Dr.createElement(We.default,{className:Ji.length>0?ee.collapseWrapper:"",bordered:!1,expandIcon:({isActive:ho})=>Dr.createElement("i",{className:`iconfont icon-weizhankai ${ho?ee.open:ee.close}`,style:{fontSize:14,transition:"all .2s"}})},Ji.map((ho,Ir)=>{var fo=ho,{key:Mo,name:dr}=fo,po=Kr(fo,["key","name"]),Za,zi,ta,Nr,ra,Aa,cl,lu,uu,zs,Ml,Ro;return Dr.createElement(gr,{className:ee.panel,forceRender:!0,header:Dr.createElement("div",{className:ee.panelHeader},"\u7B2C",Ir+1,"\u5C0F\u9898",Dr.createElement("span",null,"\uFF08",Qi[(Za=bi==null?void 0:bi[dr])==null?void 0:Za.item_type],"\uFF09")),extra:Dr.createElement(ie.Z,{align:"middle",onClick:ds=>ds.stopPropagation(),style:{display:"flex",alignItems:"center"}},((zi=bi==null?void 0:bi[dr])==null?void 0:zi.item_type)=="completion"&&Dr.createElement(le.default.Item,$r(ca({},po),{name:[dr,"score"],className:ee.blankInputNumberWrapper,style:{marginBottom:0}}),((ta=bi==null?void 0:bi[dr])==null?void 0:ta.item_type)=="completion"&&Dr.createElement("div",{style:{display:"flex",alignItems:"center",color:"#191919"}},"\u5171",Dr.createElement(ar,{value:(Nr=bi==null?void 0:bi[dr])==null?void 0:Nr.score}),"\u5206")),((ra=bi==null?void 0:bi[dr])==null?void 0:ra.item_type)=="completion"&&Dr.createElement(Dr.Fragment,null,Dr.createElement(Le.ZP.Group,{defaultValue:(Aa=bi==null?void 0:bi[dr])==null?void 0:Aa.use_blank_score,className:ee.scoreByBlankRadio,style:{marginRight:10},optionType:"button",options:[{label:"\u6309\u7A7A\u7ED9\u5206",value:!0},{label:"\u6309\u9898\u7ED9\u5206",value:!1}],onChange:ds=>{var hu;console.log(Gi.getFieldsValue()),Gi==null||Gi.setFieldValue(["sub_item_banks",dr,"use_blank_score"],(hu=ds==null?void 0:ds.target)==null?void 0:hu.value),xr(new Date)}}),Dr.createElement(Me.Z,{overlayInnerStyle:{width:460},title:Dr.createElement("div",null,"\u6309\u7A7A\u7ED9\u5206\uFF1A\u9700\u8981\u5206\u522B\u8BBE\u7F6E\u6BCF\u4E2A\u586B\u7A7A\u9879\u7684\u5206\u503C\uFF0C\u586B\u7A7A\u9879\u7B54\u5BF9\u4E4B\u540E\u5219\u83B7\u5F97\u5BF9\u5E94\u7684\u5206\u503C\u3002",Dr.createElement("br",null),"\u6309\u9898\u7ED9\u5206\uFF1A\u7B54\u5BF9\u5168\u90E8\u586B\u7A7A\u9879\u4E4B\u540E\u624D\u80FD\u83B7\u5F97\u8BE5\u5C0F\u9898\u7684\u5206\u503C\u3002")},Dr.createElement("i",{className:"icon-tishixiaowenhao font18 c-3061d0"})))),key:Mo},Dr.createElement(le.default.Item,$r(ca({},po),{name:dr}),(((cl=bi==null?void 0:bi[dr])==null?void 0:cl.item_type)=="single"||((lu=bi==null?void 0:bi[dr])==null?void 0:lu.item_type)=="multiple")&&Dr.createElement($i,{questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9",allowChangeMode:((uu=bi==null?void 0:bi[dr])==null?void 0:uu.item_type)!="single",form:Gi,choiceKey:[dr,"choices"],titleKey:[dr,"name"],analysisKey:[dr,"analysis"],choiceOptionsPath:["sub_item_banks",dr,"choices"],choiceTextKey:"choice_text",answerKey:"is_answer"}),((zs=bi==null?void 0:bi[dr])==null?void 0:zs.item_type)=="completion"&&Dr.createElement(Cn,{form:Gi,name:dr,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",scoreByBlank:[dr,"use_blank_score"],titleKey:[dr,"name"],analysisKey:[dr,"analysis"],isOrdered:[dr,"is_ordered"],answerKey:[dr,"standard_answer"],key:so}),((Ml=bi==null?void 0:bi[dr])==null?void 0:Ml.item_type)=="judgement"&&Dr.createElement(Rr,{form:Gi,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",titleKey:[dr,"name"],analysisKey:[dr,"analysis"],choiceKey:[dr,"choices"]}),((Ro=bi==null?void 0:bi[dr])==null?void 0:Ro.item_type)=="subjective"&&Dr.createElement(Jr,{showKeywords:!0,form:Gi,titleKey:[dr,"name"],analysisKey:[dr,"analysis"],answerTexts:[dr,"answer_texts"],useKeywords:[dr,"use_keywords"],keywords:[dr,"keywords"],indexs:dr,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u7B80\u7B54\u9898\u9898\u5E72\u5185\u5BB9"})))})))})))};var Va=(0,Jt.connect)(({loading:xe,globalSetting:fe})=>({globalSetting:fe,loading:xe.effects}),null,null,{forwardRef:!0})((0,pt.forwardRef)(Vo)),Ba=kt(44399),Or=kt(17149),fa=kt(82326),Sa=kt(54172),Yo={flex_box_center:"flex_box_center___xDdtW",flex_space_between:"flex_space_between___J4mFI",flex_box_vertical_center:"flex_box_vertical_center___hDYn6",flex_box_center_end:"flex_box_center_end___H7l1j",flex_box_column:"flex_box_column___TPd2T",questionInfo:"questionInfo___ABq66",label:"label___VQOr7",content:"content____HZ6z",leftPart:"leftPart___YB0y5",rightPart:"rightPart___UVMmS",dragItem:"dragItem___Hbx8k",blackText:"blackText___U4u33",greyText:"greyText___rWIL_",iconWrapper:"iconWrapper___I0kek",contentArea:"contentArea___hGC13",dragging:"dragging___z7VVY",hidden:"hidden___nWAxb",dragIcon:"dragIcon___j91TC",deleteIcon:"deleteIcon___cmCqc",disabled:"disabled___ZlKMj",challengeNameWrapper:"challengeNameWrapper___SpiRb",challengeName:"challengeName___lmQe2",shixunPreviewFooter:"shixunPreviewFooter___u0CzD",shixunInfoWrapper:"shixunInfoWrapper___HzLHD",shixunInfo:"shixunInfo___qaQlF",btnToDetail:"btnToDetail___scXqr",fixedBottom:"fixedBottom___wTBAR",cancelBtn:"cancelBtn___Km4Gi",confirmBtn:"confirmBtn___WrECz",previewBtn:"previewBtn____oGPS",setScoreModalTable:"setScoreModalTable___CjDlp",title:"title___cQWdZ",tipcontent:"tipcontent___A8tZ5",name:"name___CvfT9",tip:"tip___EvoCF",info:"info___y_ayi",img:"img___X9CNn"},No=kt(46133),Ka=kt(94052),us=kt(77513),Ko=kt(16948),hs=kt(12635),Xs=kt(37208),ga=({open:xe,onCancel:fe,onOk:Ve})=>{const Zt=(0,Ka.g)(),[Ye,pr,oo,rr]=(0,Ko.U)(us.Gm,{page:1,limit:10,keyword:"",diff:"",shixun_publish_status:"",discipline_id:"",sub_discipline_id:"",type:0,include_shixuns:!0,item_type:"SHIXUN"}),[Sr,xo]=(0,pt.useState)(!1);(0,pt.useEffect)(()=>{xe&&oo({page:1,limit:10,type:0},!0).then(Gi=>{(Gi==null?void 0:Gi.shixuns_count)===0&&xo(!0)})},[xe]);const[Vr,Po]=(0,pt.useState)([]),[Ur,Ri]=(0,pt.useState)([]);return pt.createElement(It.default,{title:"\u9009\u62E9\u5B9E\u8BAD\u9898",open:xe,width:948,centered:!0,closable:!0,onCancel:fe,onOk:()=>Ve(Ur),destroyOnClose:!0},pt.createElement(ie.Z,{justify:"space-between",className:"mb20",style:{maxHeight:650}},pt.createElement(Ee.Z,null,pt.createElement(Or.Z,{style:{width:160},size:"large",placeholder:"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",options:Zt,onChange:Gi=>{oo({page:1,discipline_id:Gi==null?void 0:Gi[0],sub_discipline_id:Gi==null?void 0:Gi[1]})}}),pt.createElement(fa.default,{className:"ml20",style:{width:118},size:"large",placeholder:"\u96BE\u5EA6",allowClear:!0,options:[{label:"\u521D\u7EA7",value:1},{label:"\u4E2D\u7EA7",value:2},{label:"\u4E2D\u9AD8\u7EA7",value:3},{label:"\u9AD8\u7EA7",value:4}],onChange:Gi=>oo({page:1,diff:Gi})}),pt.createElement(fa.default,{className:"ml20",placeholder:"\u5168\u90E8\u72B6\u6001",style:{width:118},size:"large",allowClear:!0,options:[{label:"\u672A\u53D1\u5E03",value:"unpublish"},{label:"\u9759\u9ED8\u53D1\u5E03",value:"silent_publish"},{label:"\u516C\u5F00\u53D1\u5E03",value:"public_publish"}],onChange:Gi=>oo({page:1,shixun_publish_status:Gi})})),pt.createElement(No.t7,{placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",style:{width:290},onChange:Gi=>{oo({keyword:Gi,page:1})}})),Sr?pt.createElement("div",null,pt.createElement(hs.Z,{customText:"\u6682\u65E0\u6570\u636E",ButtonText:"\u524D\u5F80\u5B9E\u8DF5\u9879\u76EE\u5E93\uFF0C\u6DFB\u52A0\u66F4\u591A\u8BD5\u9898>",ButtonClick:()=>(0,Yt.xg)("/shixuns")})):pt.createElement(Sa.default,{loading:pr,rowKey:"id",columns:[{title:"\u8BD5\u9898\u540D\u79F0",dataIndex:"name",width:"30%",ellipsis:{showTitle:!0},render:(Gi,kr)=>pt.createElement("div",{style:{display:"flex",alignItems:"center"}},pt.createElement("div",{className:kr!=null&&kr.high_resources_consume?Yo.title:"",title:Gi||"--"},pt.createElement(Dt.Z,{key:1,showLines:1,showTextOnly:!0,value:Gi||"--"})),(kr==null?void 0:kr.high_resources_consume)&&pt.createElement(Xs.Z,{type:"shixun",style:{marginLeft:10}}))},{title:"\u96BE\u5EA6",dataIndex:"level"},{title:"\u5173\u5361\u6570\u91CF",dataIndex:"challenges_count",key:"challenges_count",render:(Gi,kr,wr)=>pt.createElement("span",null,Gi||"- -")},{title:"\u4F7F\u7528\u6B21\u6570",dataIndex:"study_count"},{title:pt.createElement("span",null,"\u53D1\u5E03\u72B6\u6001 ",pt.createElement(Me.Z,{title:"\u672A\u53D1\u5E03\u7684\u5B9E\u8DF5\u9879\u76EE\u4E0D\u80FD\u88AB\u9009\u7528"},pt.createElement(gi.Z,null))),dataIndex:"shixun_tag_num_name",key:"shixun_tag_num_name",width:100,render:(Gi,kr,wr)=>pt.createElement("span",null,Gi||"- -")},{title:"\u64CD\u4F5C",render(Gi,kr){const{title:wr,challenge_names:Qi,author_name:ar,identifier:so,author_school_name:xr,study_count:Ji}=kr||{};return pt.createElement("div",null,pt.createElement("span",{style:{color:"#165DFF",cursor:"pointer"},onClick:()=>{It.default.confirm({title:"\u9898\u76EE\u8BE6\u60C5",closable:!0,width:1e3,centered:!0,icon:null,footer:null,content:pt.createElement("div",null,pt.createElement(Dt.Z,{value:wr,style:{marginBottom:18}}),pt.createElement("div",{className:Yo.challengeNameWrapper},Qi.map((er,tr)=>pt.createElement("div",{className:Yo.challengeName,key:tr},"\u7B2C",(0,Yt.EM)(tr+1),"\u9898\xA0",er))),pt.createElement(ie.Z,{className:Yo.shixunPreviewFooter,justify:"space-between",style:{alignItems:"center"}},pt.createElement(Ee.Z,{className:Yo.shixunInfoWrapper},pt.createElement("span",null,"\u521B\u5EFA\u8005"),pt.createElement("span",{className:Yo.shixunInfo},ar.split("\u3001")[0]),pt.createElement("span",null,"\u6240\u5C5E\u5355\u4F4D"),pt.createElement("span",{className:Yo.shixunInfo},xr),pt.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570"),pt.createElement("span",{className:Yo.shixunInfo},Ji)),pt.createElement(ue.ZP,{type:"primary",className:Yo.btnToDetail,onClick:()=>(0,Yt.xg)(`/shixuns/${so}/challenges?exercise=true`)},pt.createElement("i",{className:"iconfont icon-shixunkecheng"}),"\u5B9E\u8BAD\u8BE6\u60C5")))})}},"\u67E5\u770B"),(kr==null?void 0:kr.shixun_tag_num)===1&&pt.createElement("a",{target:"_blank",href:`/shixuns/${kr==null?void 0:kr.identifier}/challenges`,style:{marginLeft:10}},"\u53BB\u53D1\u5E03"))}}],dataSource:rr==null?void 0:rr.items,rowSelection:{type:"radio",selectedRowKeys:Vr,preserveSelectedRowKeys:!0,getCheckboxProps:Gi=>({disabled:Gi.shixun_tag_num===1}),onChange(Gi,kr){var wr,Qi,ar;console.log(Gi),Po(Gi);const so=[];for(const Ji of Ur)Gi.includes(Ji.id)&&so.push(Ji);const xr=so.map(Ji=>Ji.id);for(const Ji of kr)Ji&&Gi.includes(Ji.id)&&!xr.includes(Ji.id)&&so.push({id:Ji.id,difficulty:Ji.level,identifier:Ji.identifier,name:Ji.name,real_name:(wr=Ji==null?void 0:Ji.author_name)==null?void 0:wr.split("\u3001")[0],school_name:Ji.author_school_name,challenge_names:Ji.challenge_names,challenges:(Qi=Ji.challenge_names)==null?void 0:Qi.map((er,tr)=>({subject:er,id:tr,score:5})),score:((ar=Ji.challenge_names)==null?void 0:ar.length)*5,study_count:Ji.study_count,challenges_count:Ji.challenges_count});Ri(so)}},pagination:{current:Ye.page,pageSize:Ye.limit,total:rr==null?void 0:rr.items_count,showTotal:Gi=>pt.createElement("span",null,"\u5171\xA0",pt.createElement("span",{style:{color:"#165DFF"}},Gi),"\xA0\u6761\u6570\u636E"),showQuickJumper:!0,onChange(Gi,kr){oo({page:Gi,limit:kr})},size:"default"},scroll:{y:400}}))},Iu=kt(91652),Cu=kt(87527),Zl=(xe,fe,Ve)=>new Promise((Zt,Ye)=>{var pr=Sr=>{try{rr(Ve.next(Sr))}catch(xo){Ye(xo)}},oo=Sr=>{try{rr(Ve.throw(Sr))}catch(xo){Ye(xo)}},rr=Sr=>Sr.done?Zt(Sr.value):Promise.resolve(Sr.value).then(pr,oo);rr((Ve=Ve.apply(xe,fe)).next())}),js=({visible:xe,getdata:fe,onCancel:Ve,onRandomExchange:Zt,selectFromProblemSet:Ye,questionParams:pr})=>{const[oo,rr]=(0,pt.useState)(!1),[Sr,xo]=(0,pt.useState)(!1),[Vr,Po]=(0,pt.useState)({}),Ur=(0,Jt.useParams)(),[Ri,Gi]=(0,pt.useState)(),kr=(wr,Qi)=>Zl(void 0,null,function*(){xo(!0);const ar=yield(0,Gt.ZP)(`/api/exercises/${Ur.categoryId}/toggle_random_question.json`,{method:"post",body:{question_id:pr.id,item_bank_id:wr,shixuns_info:[{id:wr,is_copy:Qi!=1,is_use:Qi!=1}]}});xo(!1),ar!=null&&ar.status||(ge.ZP.info("\u6362\u9898\u6210\u529F"),Ve(),fe())});return pt.createElement(It.default,{title:"\u8BF7\u9009\u62E9\u66FF\u6362\u65B9\u5F0F",open:xe,onCancel:Ve,centered:!0,maskClosable:!0,footer:null},pt.createElement(ie.Z,{justify:"center",className:"pb20"},pt.createElement(Ba.Z,{onClick:Zt},"\u968F\u673A\u66F4\u6362"),(pr==null?void 0:pr.type)!=="PRACTICAL"&&pt.createElement(ue.ZP,{style:{marginLeft:24},onClick:Ye},"\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9"),(pr==null?void 0:pr.type)==="PRACTICAL"&&pt.createElement(ue.ZP,{style:{marginLeft:24},onClick:()=>{rr(!0)}},"\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9")),pt.createElement(ga,{open:oo,onCancel:()=>rr(!1),onOk:wr=>Zl(void 0,null,function*(){if(console.log("----selectedRows",wr,Ur),(wr==null?void 0:wr.length)<=0){ge.ZP.info("\u8BF7\u9009\u62E9\u5B9E\u8BAD");return}let Qi=wr==null?void 0:wr.map(so=>so==null?void 0:so.id),ar=yield(0,Cu.Tr)({id:[...Qi],course_id:Ur.coursesId,type:"shixun"});(ar==null?void 0:ar.student_count)===0?kr(Qi==null?void 0:Qi[0],1):(Gi(Qi),Po(ar)),rr(!1)})}),pt.createElement(Iu.Z,{resdata:Vr,type:"shixun",okloading:Sr,oktext:(Vr==null?void 0:Vr.can_copy_num)===0?"\u786E\u5B9A":"\u4E00\u952E\u590D\u5236\u5E76\u66FF\u6362",onok:wr=>Zl(void 0,null,function*(){kr(Ri==null?void 0:Ri[0],2)})}))},Fl=kt(41912),ru=kt(24334),ou=kt(68462),xa=kt(1464),rl=kt(15761),_u=Object.defineProperty,au=Object.defineProperties,su=Object.getOwnPropertyDescriptors,Xa=Object.getOwnPropertySymbols,ns=Object.prototype.hasOwnProperty,Fa=Object.prototype.propertyIsEnumerable,Ma=(xe,fe,Ve)=>fe in xe?_u(xe,fe,{enumerable:!0,configurable:!0,writable:!0,value:Ve}):xe[fe]=Ve,Lo=(xe,fe)=>{for(var Ve in fe||(fe={}))ns.call(fe,Ve)&&Ma(xe,Ve,fe[Ve]);if(Xa)for(var Ve of Xa(fe))Fa.call(fe,Ve)&&Ma(xe,Ve,fe[Ve]);return xe},ro=(xe,fe)=>au(xe,su(fe)),uo=(xe,fe,Ve)=>new Promise((Zt,Ye)=>{var pr=Sr=>{try{rr(Ve.next(Sr))}catch(xo){Ye(xo)}},oo=Sr=>{try{rr(Ve.throw(Sr))}catch(xo){Ye(xo)}},rr=Sr=>Sr.done?Zt(Sr.value):Promise.resolve(Sr.value).then(pr,oo);rr((Ve=Ve.apply(xe,fe)).next())}),Ea=({data:xe,submit:fe,goBack:Ve,loading:Zt,onTypeScore:Ye,editPreview:pr=!1,onSkipExamination:oo,selectValue:rr,onExchange:Sr,getdata:xo,handleMarkWrongQuestion:Vr})=>{var Po,Ur,Ri,Gi,kr,wr,Qi,ar,so,xr,Ji;const er=(0,pt.useRef)(),[tr,bi]=(0,pt.useState)(null),[ho,Ir]=(0,pt.useState)(!1),[fo,Mo]=(0,pt.useState)(!1),dr=(0,pt.useRef)(),[po]=le.default.useForm(),Za=(0,Jt.useParams)(),[zi,ta]=(0,pt.useState)(!1);(0,pt.useEffect)(()=>{Ir(!0)},[]),(0,pt.useEffect)(()=>{pr||(0,Yt.Dk)("\u8BD5\u5377\u9884\u89C8")},[pr]);const Nr=["\u5BB9\u6613","\u7B80\u5355","\u9002\u4E2D","\u56F0\u96BE"],ra={SINGLE:"\u5355\u9009\u9898",MULTIPLE:"\u591A\u9009\u9898",JUDGMENT:"\u5224\u65AD\u9898",COMPLETION:"\u586B\u7A7A\u9898",SUBJECTIVE:"\u7B80\u7B54\u9898",PRACTICAL:"\u5B9E\u8BAD\u9898",PROGRAM:"\u7F16\u7A0B\u9898",BPROGRAM:"\u7A0B\u5E8F\u586B\u7A7A\u9898",COMBINATION:"\u7EC4\u5408\u9898"},Aa={single:"\u5355\u9009\u9898",multiple:"\u591A\u9009\u9898",judgement:"\u5224\u65AD\u9898",completion:"\u586B\u7A7A\u9898",subjective:"\u7B80\u7B54\u9898",practical:"\u5B9E\u8BAD\u9898",program:"\u7F16\u7A0B\u9898",bprogram:"\u7A0B\u5E8F\u586B\u7A7A\u9898",combination:"\u7EC4\u5408\u9898"},cl=Fn=>{var sr;const jo=[];return pt.createElement(pt.Fragment,null,pt.createElement("aside",{className:Ut.single},(sr=Fn==null?void 0:Fn.choices)==null?void 0:sr.map((Gr,Zi)=>(Gr.is_answer&&jo.push(rl.k4[Zi]),pt.createElement("ul",{key:Zi},pt.createElement("li",null,rl.k4[Zi],"\u3001"),pt.createElement("li",null,pt.createElement(Dt.Z,{value:Gr.choice_text})))))),pt.createElement("div",{className:Ut.analysis},pt.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",jo.join(""),pt.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",Nr[Fn.difficulty])),pt.createElement("aside",null,pt.createElement("span",{className:Ut.text},"\u89E3\u6790:"),pt.createElement(Dt.Z,{value:Fn.analysis?Fn.analysis:"\u6682\u65E0\u89E3\u6790"})),pt.createElement("ul",null,pt.createElement("li",null,pt.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(Fn==null?void 0:Fn.discipline_name)||"--"}/${Fn==null?void 0:Fn.sub_discipline_name}`),pt.createElement(Me.Z,{title:Fn==null?void 0:Fn.tag_discipline_name},pt.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},pt.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Fn==null?void 0:Fn.tag_discipline_name)))))},lu=(Fn,sr)=>{var jo;const Gr=(jo=Fn==null?void 0:Fn.standard_answer)==null?void 0:jo.map((Zi,Jo)=>{var lo;return pt.createElement("div",{key:Jo},`\u7B54\u6848\uFF08\u586B\u7A7A${Zi==null?void 0:Zi.position}\uFF09\uFF1A${(lo=Zi==null?void 0:Zi.answer_text)==null?void 0:lo.join("\u3001")}`)});return pt.createElement(pt.Fragment,null,pt.createElement("div",{className:Ut.analysis},pt.createElement("div",{style:{display:"flex"}},pt.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A"),pt.createElement("div",null,Gr)),pt.createElement("aside",null,pt.createElement("span",{className:Ut.text},"\u89E3\u6790:"),pt.createElement(Dt.Z,{value:Fn.analysis?Fn.analysis:"\u6682\u65E0\u89E3\u6790"})),pt.createElement("ul",null,pt.createElement("li",null,pt.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),sr?`${(sr==null?void 0:sr.discipline_name)||"--"}/${sr==null?void 0:sr.sub_discipline_name}`:`${(Fn==null?void 0:Fn.discipline_name)||"--"}/${Fn==null?void 0:Fn.sub_discipline_name}`),pt.createElement(Me.Z,{title:sr?sr==null?void 0:sr.tag_discipline_name:Fn==null?void 0:Fn.tag_discipline_name},pt.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},pt.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),sr?sr==null?void 0:sr.tag_discipline_name:Fn==null?void 0:Fn.tag_discipline_name)))))},uu=Fn=>{var sr;const jo=(sr=Fn==null?void 0:Fn.standard_answer)==null?void 0:sr.map((Gr,Zi)=>pt.createElement("div",{key:Zi},`\u7B54\u6848\uFF08\u586B\u7A7A${(Gr==null?void 0:Gr.position)||(Gr==null?void 0:Gr.exercise_choice_id)}\uFF09\uFF1A${Gr==null?void 0:Gr.answer_text}`));return pt.createElement(pt.Fragment,null,pt.createElement("div",{className:Ut.analysis},pt.createElement("div",{style:{display:"flex"}},pt.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A"),pt.createElement("div",null,jo)),pt.createElement("aside",null,pt.createElement("span",{className:Ut.text},"\u89E3\u6790:"),pt.createElement(Dt.Z,{value:Fn.analysis?Fn.analysis:"\u6682\u65E0\u89E3\u6790"})),pt.createElement("ul",null,pt.createElement("li",null,pt.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(Fn==null?void 0:Fn.discipline_name)||"--"}/${Fn==null?void 0:Fn.sub_discipline_name}`),pt.createElement(Me.Z,{title:Fn==null?void 0:Fn.tag_discipline_name},pt.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},pt.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Fn==null?void 0:Fn.tag_discipline_name)))))},zs=(Fn,sr)=>{var jo;return pt.createElement("div",{className:Ut.analysis},pt.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",(jo=Fn==null?void 0:Fn.answer_texts)==null?void 0:jo[0]),pt.createElement("aside",null,pt.createElement("span",{className:Ut.text},"\u89E3\u6790:"),pt.createElement(Dt.Z,{value:Fn.analysis?Fn.analysis:"\u6682\u65E0\u89E3\u6790"})),pt.createElement("ul",null,pt.createElement("li",null,pt.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),sr?`${(sr==null?void 0:sr.discipline_name)||"--"}/${sr==null?void 0:sr.sub_discipline_name}`:`${(Fn==null?void 0:Fn.discipline_name)||"--"}/${Fn==null?void 0:Fn.sub_discipline_name}`),pt.createElement(Me.Z,{title:sr?sr==null?void 0:sr.tag_discipline_name:Fn==null?void 0:Fn.tag_discipline_name},pt.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},pt.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),sr?sr==null?void 0:sr.tag_discipline_name:Fn==null?void 0:Fn.tag_discipline_name))))},Ml=Fn=>{var sr,jo;return pt.createElement("div",{className:Ut.analysis},pt.createElement("aside",null,pt.createElement("span",{className:Ut.text},"\u9884\u671F\u8F93\u51FA:"),pt.createElement(Dt.Z,{value:(sr=Fn==null?void 0:Fn.program_attr)==null?void 0:sr.description})),pt.createElement("div",{style:{marginTop:20}},"\u6B63\u786E\u7B54\u6848\uFF1A",((jo=Fn==null?void 0:Fn.program_attr)==null?void 0:jo.answer_text)||"--"),pt.createElement("aside",null,pt.createElement("span",{className:Ut.text},"\u89E3\u6790:"),pt.createElement(Dt.Z,{value:Fn.analysis?Fn.analysis:"\u6682\u65E0\u89E3\u6790"})),pt.createElement("ul",null,pt.createElement("li",null,pt.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(Fn==null?void 0:Fn.discipline_name)||"--"}/${Fn==null?void 0:Fn.sub_discipline_name}`),pt.createElement(Me.Z,{title:Fn==null?void 0:Fn.tag_discipline_name},pt.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},pt.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Fn==null?void 0:Fn.tag_discipline_name))))},Ro=(Fn,sr)=>{var jo;return pt.createElement("div",null,(jo=Fn==null?void 0:Fn.sub_item_banks)==null?void 0:jo.map((Gr,Zi)=>{var Jo,lo;const ea=[];return pt.createElement(pt.Fragment,null,pt.createElement("div",{style:{marginLeft:25,fontSize:"16px",color:"#333",paddingTop:"15px"}},sr+1+"."+(Zi+1),"\uFF08",ra[Gr.item_type]||Aa[Gr.item_type],"\uFF09",Gr.name),(Gr.item_type=="SINGLE"||Gr.item_type=="MULTIPLE"||Gr.item_type=="JUDGMENT"||Gr.item_type=="single"||Gr.item_type=="multiple"||Gr.item_type=="judgement")&&pt.createElement(pt.Fragment,null,pt.createElement("aside",{className:Ut.single},(Jo=Gr==null?void 0:Gr.choices)==null?void 0:Jo.map((Cr,Qo)=>(Cr.is_answer&&ea.push(rl.k4[Qo]),pt.createElement("ul",{key:Qo},pt.createElement("li",null,rl.k4[Qo],"\u3001"),pt.createElement("li",null,pt.createElement(Dt.Z,{value:Cr.choice_text})))))),pt.createElement("div",{className:Ut.analysis},pt.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",ea.join(""),pt.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",Nr[Gr.difficulty])),pt.createElement("aside",null,pt.createElement("span",{className:Ut.text},"\u89E3\u6790:"),pt.createElement(Dt.Z,{value:Gr.analysis?Gr.analysis:"\u6682\u65E0\u89E3\u6790"})),pt.createElement("ul",null,pt.createElement("li",null,pt.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(Fn==null?void 0:Fn.discipline_name)||"--"}/${Fn==null?void 0:Fn.sub_discipline_name}`),pt.createElement(Me.Z,{title:Fn==null?void 0:Fn.tag_discipline_name},pt.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},pt.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Fn==null?void 0:Fn.tag_discipline_name))))),(Gr.item_type=="COMPLETION"||Gr.item_type=="completion")&&lu(Gr,Fn),(Gr.item_type=="SUBJECTIVE"||Gr.item_type=="subjective")&&zs(Gr,Fn),((lo=xe==null?void 0:xe.exam)==null?void 0:lo.exercise_status)===3&&pt.createElement("div",{className:"flex gap-20px mt20"},pt.createElement(ou.Z,{state:Gr==null?void 0:Gr.is_wrong,onClick:()=>{Vr==null||Vr({value:ro(Lo({},Gr),{question_id:Gr==null?void 0:Gr.id,question_score:Gr==null?void 0:Gr.score})})}}),Gr.item_type=="single"&&pt.createElement(ue.ZP,{style:{color:"#3061D0"},onClick:()=>{Wl({value:Gr})}},"\u589E\u8BBE\u6B63\u786E\u7B54\u6848")))}))},ds=Fn=>{var sr,jo,Gr;return pt.createElement("div",{style:{marginTop:"12px"}},(jo=(sr=Fn==null?void 0:Fn.shixun)==null?void 0:sr.challenges)==null?void 0:jo.map((Zi,Jo)=>pt.createElement("div",{className:"c-grey-666 font14 mb10 ml25",style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},pt.createElement("div",null,pt.createElement("span",{className:"mr5"},"\u7B2C",Jo+1,"\u5173"),pt.createElement(Me.Z,{key:Jo,title:Zi==null?void 0:Zi.challenge_name},pt.createElement("span",null,(0,Yt.Pq)(Zi==null?void 0:Zi.challenge_name,44)))),pr&&pt.createElement("div",null,"\u5206\u503C\uFF1A",Zi.score,"\u5206"))),pt.createElement(Jt.Link,{style:{float:"right"},target:"_blank",to:`/shixuns/${(Gr=Fn==null?void 0:Fn.shixun)==null?void 0:Gr.identifier}/challenges`},"\u5B9E\u8BAD\u8BE6\u60C5"),pt.createElement("div",{style:{clear:"both"}}))},hu=Fn=>{let sr=Fn.questions_score/Fn.questions_count;It.default.confirm({icon:null,centered:!0,title:"\u5206\u6570\u8BBE\u7F6E",content:pt.createElement("div",{className:Ut.modalColumn},pt.createElement("div",{className:Ut.modalRow,style:{justifyContent:"flex-start"}},pt.createElement("sup",{className:Ut.sup},"*"),pt.createElement("span",null,Fn==null?void 0:Fn.name,"\uFF1A"),pt.createElement(qt.Z,{min:0,precision:1,defaultValue:sr,onChange:jo=>{sr=jo}}),pt.createElement("span",{className:"ml5"},"\u5206/\u9898"))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>uo(void 0,null,function*(){var jo;if(!sr)return ge.ZP.warning("\u5206\u6570\u4E0D\u80FD\u4E3A\u7A7A\u6216\u4E3A0"),Promise.reject();const Gr={type:Fn==null?void 0:Fn.type,score:sr,scoreTotal:Number((jo=sr*Fn.questions_count)==null?void 0:jo.toFixed(1))};Ye(Gr)})})},Gl=()=>{let Fn="";It.default.confirm({icon:null,centered:!0,title:"\u4FDD\u5B58\u8BD5\u5377",content:pt.createElement("div",{className:Ut.modalColumn},pt.createElement("div",{style:{color:"#676A6C",display:"flex",alignItems:"center"},className:"font14 mt20"},pt.createElement("img",{style:{marginRight:5},src:sn.Z}),"\u4FDD\u5B58\u540E\u5355\u72EC\u751F\u6210\u4E00\u4EFD\u4EBA\u5DE5\u7EC4\u5377\u7C7B\u578B\u7684\u56FA\u5B9A\u8BD5\u5377\u3002"),pt.createElement("div",{className:Ut.modalRow,style:{marginTop:20}},pt.createElement("sup",{className:Ut.sup},"*"),pt.createElement("span",{style:{flexShrink:0}},"\u8BD5\u5377\u540D\u79F0\uFF1A"),pt.createElement(ne.default,{placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0",min:0,maxLength:60,defaultValue:Fn,onChange:sr=>{Fn=sr.target.value}}))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>uo(void 0,null,function*(){var sr;if(!Fn)return ge.ZP.warning("\u8BD5\u5377\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"),Promise.reject();const jo=[],Gr=[],Zi=[],Jo=[];(sr=xe==null?void 0:xe.questionList)==null||sr.forEach(ea=>{var Cr;(Cr=ea.questions)==null||Cr.forEach(Qo=>{let Bo=ea.questions_score/ea.questions_count;Bo=Bo&&Bo.toFixed(1),ea.type==="COMBINATION"&&Zi.push({id:Qo.id,sub_item_bank_ids:Qo.sub_item_banks.map(Ta=>Ta.id)}),ea.type==="PRACTICAL"?Jo.push(Qo.id):(jo.push(Qo.id),Gr.push(Bo))})}),console.log("-----",Zi),yield fe({item_bank_ids:jo,item_bank_scores:Gr,name:Fn,combination_item_banks:Zi,shixun_ids:Jo})})})},Ph=(Fn,sr,jo,Gr)=>{var Zi;const Jo=`${location.pathname}${location.search}`,lo=(Zi=Gr.questions)==null?void 0:Zi.map(ea=>ea==null?void 0:ea.id);if(Jo.includes("exercise"))dr.current={id:Fn,ids:lo,type:sr,index:jo},Mo(!0);else{let ea=It.default.confirm({icon:null,centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:"\u786E\u8BA4\u8981\u66F4\u6362\u8BE5\u8BD5\u9898\u5417\uFF1F",cancelButtonProps:{disabled:!1},maskClosable:!0,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>uo(void 0,null,function*(){ea.update({cancelButtonProps:{disabled:!0}}),yield Sr({single_question_id:Fn,seleted_item_bank_ids:lo},{type:sr,index:jo}),ea.update({cancelButtonProps:{disabled:!1}}),ge.ZP.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u8BD5\u9898")})})}},Hl=Fn=>{var sr;const jo=(sr=Fn.questions)==null?void 0:sr.map(Jo=>Jo==null?void 0:Jo.id),Gr=Fn.name;let Zi=It.default.confirm({icon:null,centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:`\u786E\u8BA4\u66F4\u6362${Gr}\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F`,cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>uo(void 0,null,function*(){Zi.update({cancelButtonProps:{disabled:!0}}),yield Sr({seleted_item_bank_ids:jo},{type:Fn.type}),Zi.update({cancelButtonProps:{disabled:!1}}),ge.ZP.success(`\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210${Gr}\u8BD5\u9898`)})})},ko=()=>{let Fn=It.default.confirm({icon:null,centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:"\u786E\u8BA4\u66F4\u6362\u9884\u89C8\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F",cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>uo(void 0,null,function*(){Fn.update({cancelButtonProps:{disabled:!0}}),yield Sr(),Fn.update({cancelButtonProps:{disabled:!1}}),ge.ZP.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u6574\u5F20\u8BD5\u9898")})})},Oo=Fn=>{console.log(Fn,"key"),oo(Fn-1)},Pa=(Fn,sr)=>{var jo,Gr;if(sr==="SINGLE")return pt.createElement(pt.Fragment,null,pt.createElement(Ui,{ref:er,editData:Fn,isEdit:!0}),pt.createElement(Rt.Z,null));if(sr==="MULTIPLE")return pt.createElement(pt.Fragment,null,pt.createElement(xi,{ref:er,editData:Fn,isEdit:!0}),pt.createElement(Rt.Z,null));if(sr==="JUDGMENT")return pt.createElement(pt.Fragment,null,pt.createElement(Je,{ref:er,editData:Fn,isEdit:!0}),pt.createElement(Rt.Z,null));if(sr==="COMPLETION")return pt.createElement(pt.Fragment,null,pt.createElement(Oe,{ref:er,editData:Fn,isEdit:!0}),pt.createElement(Rt.Z,null));if(sr==="SUBJECTIVE")return pt.createElement(pt.Fragment,null,pt.createElement(ri,{ref:er,editData:Fn,isEdit:!0}),pt.createElement(Rt.Z,null));if(sr==="COMBINATION")return pt.createElement(pt.Fragment,null,pt.createElement(Va,{ref:er,editData:Fn,isEdit:!0}),pt.createElement(Rt.Z,null));if(sr==="BPROGRAM")return pt.createElement(pt.Fragment,null,pt.createElement(le.default,{form:po,style:{marginTop:20},onFinishFailed:Zi=>{var Jo,lo;Zi.errorFields[0].name.includes("standard_answers")?ge.ZP.error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"):ge.ZP.error(Zi.errorFields[0].errors[0]),po.scrollToField((lo=(Jo=Zi==null?void 0:Zi.errorFields)==null?void 0:Jo[0])==null?void 0:lo.name,{behavior:"smooth",block:"center"})},onFinish:Zi=>uo(void 0,null,function*(){var Jo;let lo=ro(Lo({question_score:Fn.score},Zi),{question_type:8,hack:ro(Lo({},Zi.hack),{difficult:Fn.program_attr.difficult}),hack_codes:ro(Lo({},Zi.hack_codes),{code:ru.Base64.encode((Jo=Zi.hack_codes)==null?void 0:Jo.code)})});zi&&(lo.is_cover=1);const ea=yield(0,Gt.ZP)(`/api/exercise_questions/${Fn.id}.json`,{method:"put",body:lo});(ea==null?void 0:ea.status)===0&&(ge.ZP.success("\u7F16\u8F91\u6210\u529F"),Oo(rr+1)),bi(null)})},pt.createElement(Fl.tc,{form:po,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",scoreByBlank:!1,hackidentifier:(jo=Fn==null?void 0:Fn.program_attr)==null?void 0:jo.identifier,answerKey:"standard_answers"}),pt.createElement(Rt.Z,null)));if(sr==="PROGRAM"&&Jt.history.push(`/problems/${(Gr=Fn==null?void 0:Fn.program_attr)==null?void 0:Gr.identifier}/edit?type=exercises&express_id=${Za.categoryId}&question_id=${Fn==null?void 0:Fn.id}&score=${Fn==null?void 0:Fn.score}&callback_url=${location.pathname}&select=${rr}&exercise=true`),sr==="PRACTICAL")return pt.createElement(pt.Fragment,null,pt.createElement(ei,{ref:er,editData:Fn,isEdit:!0}),pt.createElement(Rt.Z,null))},is=(Fn,sr)=>uo(void 0,null,function*(){var jo,Gr,Zi,Jo,lo,ea;const Cr=yield(jo=er.current)==null?void 0:jo.onSave();if(!Cr)return;const Qo=Er=>{const vs=Er.map(ys=>ys.choice_text.trim().replace(/^\s+|\s+$/g,""));return new Set(vs).size!==vs.length},Bo={question_score:sr.score,analysis:Cr.analysis};if(Fn==="SINGLE"||Fn==="MULTIPLE"||Fn==="JUDGMENT"){if(Fn!=="JUDGMENT"&&Qo(Cr==null?void 0:Cr.choices)){ge.ZP.error("\u9009\u62E9\u9898\u9009\u9879\u5185\u5BB9\u4E0D\u80FD\u91CD\u590D\uFF0C\u8BF7\u4FEE\u6539\u540E\u518D\u4FDD\u5B58");return}const Er=[],vs=[];Bo.question_type=Fn==="JUDGMENT"?2:1,Bo.question_title=Cr==null?void 0:Cr.name,(Gr=Cr==null?void 0:Cr.choices)==null||Gr.forEach((bl,ys)=>{Er.push(bl.choice_text),bl!=null&&bl.is_answer&&vs.push(ys+1)}),Bo.question_choices=Er,Bo.standard_answers=vs}if(Fn==="COMPLETION"){let Er=(Zi=Cr==null?void 0:Cr.standard_answers)==null?void 0:Zi.map((ys,Ua)=>(ys==null?void 0:ys.score)<=0?Ua+1:null).filter(ys=>ys!==null);if((Er==null?void 0:Er.length)>0)return ge.ZP.warning(`\u7B2C${Er.join("\u3001")}\u9879\u7684\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A`),!1;let vs=(Jo=Cr==null?void 0:Cr.standard_answers)==null?void 0:Jo.reduce((ys,Ua)=>ys+(Number(Ua==null?void 0:Ua.score)||0),0);if(parseFloat(vs.toFixed(2))!=(Bo==null?void 0:Bo.question_score))return ge.ZP.warning("\u5404\u586B\u7A7A\u9879\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E\u8BE5\u5C0F\u9898\u5206\u503C\uFF01"),!1;Bo.is_ordered=Cr.is_ordered,Bo.question_title=Cr==null?void 0:Cr.name,Bo.use_blank_score=Cr==null?void 0:Cr.use_blank_score,Bo.question_type=3;const bl=[];(lo=Cr==null?void 0:Cr.standard_answers)==null||lo.forEach((ys,Ua)=>{bl.push({choice_id:ys.position,answer_text:ys.answer_text,score:ys.score})}),Bo.standard_answers=bl,Bo.downcase=Cr==null?void 0:Cr.downcase,Bo.no_space=Cr==null?void 0:Cr.no_space}if(Fn==="SUBJECTIVE"&&(console.log("editorData"),console.log(Cr),Bo.question_title=Cr==null?void 0:Cr.name,Bo.question_type=4,Bo.answer_texts=Cr==null?void 0:Cr.answer_texts,Bo.use_keywords=Cr==null?void 0:Cr.use_keywords,Bo.keywords=Cr==null?void 0:Cr.keywords),Fn==="COMBINATION"){Bo.question_title=Cr==null?void 0:Cr.name,Bo.question_type=7;try{Bo.sub_questions=(ea=Cr==null?void 0:Cr.sub_item_banks)==null?void 0:ea.map((Er,vs)=>{var bl,ys,Ua;if((Er==null?void 0:Er.item_type)=="single"||(Er==null?void 0:Er.item_type)=="multiple"){if(Qo(Er==null?void 0:Er.choices))throw new Error(`\u7B2C${vs+1}\u5C0F\u9898\u9009\u9879\u5185\u5BB9\u91CD\u590D\uFF0C\u8BF7\u4FEE\u6539\u540E\u518D\u4FDD\u5B58`);const nh=[],$o=[];return(bl=Er==null?void 0:Er.choices)==null||bl.forEach((Zs,ih)=>{nh.push(Zs.choice_text),Zs!=null&&Zs.is_answer&&$o.push(ih+1)}),{id:Er.id,question_id:Er.id,question_title:Er.name,difficulty:Er.difficulty,question_type:(Er==null?void 0:Er.item_type)=="single"?0:(Er==null?void 0:Er.item_type)=="multiple"?1:2,question_choices:nh,standard_answers:$o,analysis:Er.analysis,question_score:Er==null?void 0:Er.score}}else if((Er==null?void 0:Er.item_type)=="completion"){let nh=(ys=Er==null?void 0:Er.standard_answer)==null?void 0:ys.reduce((Zs,ih)=>Zs+(Number(ih==null?void 0:ih.score)||0),0);if(parseFloat(nh.toFixed(2))!=(Er==null?void 0:Er.score))throw new Error("\u5404\u586B\u7A7A\u9879\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E\u8BE5\u5C0F\u9898\u5206\u503C\uFF01");const $o=[];return(Ua=Er==null?void 0:Er.standard_answer)==null||Ua.forEach((Zs,ih)=>{$o.push({choice_id:Zs.position,answer_text:Zs.answer_text,score:Zs.score})}),{id:Er.id,question_id:Er.id,is_ordered:Er.is_ordered,question_title:Er.name,difficulty:Er.difficulty,question_type:3,standard_answers:$o,use_blank_score:Er.use_blank_score,analysis:Er.analysis,downcase:Er==null?void 0:Er.downcase,no_space:Er==null?void 0:Er.no_space,question_score:Er==null?void 0:Er.score}}else if((Er==null?void 0:Er.item_type)=="subjective")return{id:Er.id,question_id:Er.id,question_title:Er.name,question_type:4,difficulty:Er.difficulty,answer_texts:Er==null?void 0:Er.answer_texts,analysis:Er.analysis,question_score:Er==null?void 0:Er.score,use_keywords:Er.use_keywords,keywords:Er==null?void 0:Er.keywords}})}catch(Er){ge.ZP.warning(Er.message);return}delete Bo.analysis}let Ta=!1;(sr==null?void 0:sr.is_my)===1&&(Ta=yield new Promise((vs,bl)=>{It.default.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:()=>{vs(!0)},onCancel:()=>{vs(!1)}})})),Ta&&(Bo.is_cover=1);const du=Fn!=="PRACTICAL"?yield(0,Gt.ZP)(`/api/exercise_questions/${sr.id}.json`,{method:"put",body:Bo}):yield(0,Gt.ZP)(`/api/exercise_questions/${sr.id}/update_shixun_score.json`,{method:"post",body:Lo({},Cr)});(du==null?void 0:du.status)===0&&(ge.ZP.success("\u7F16\u8F91\u6210\u529F"),Oo(rr+1),bi(null))}),Ja=()=>uo(void 0,null,function*(){(0,Jt.getDvaApp)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!0,text:"\u6B63\u5728\u66F4\u65B0\u8BD5\u5377\uFF0C\u8BF7\u7A0D\u540E..."}}),(yield(0,Gt.ZP)(`/api/exercises/${Za.categoryId}/sync_random_question.json`,{method:"post"})).status===0&&(yield oo(rr),ge.ZP.success("\u66F4\u65B0\u6210\u529F")),(0,Jt.getDvaApp)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1}})}),Wl=({value:Fn}={})=>{var sr;const jo=[];let Gr=[];const Zi=(sr=Fn==null?void 0:Fn.choices)==null?void 0:sr.map((lo,ea)=>{var Cr;const Qo=ea+1;return lo!=null&&lo.is_answer&&(jo.push(Qo),Gr.push(Qo)),{value:Qo,label:pt.createElement(Dt.Z,{className:"c-black font14",value:`${(Cr=rl.k4)==null?void 0:Cr[ea]}. ${lo==null?void 0:lo.choice_text}`}),disabled:lo==null?void 0:lo.origin_standard_answer}}),Jo=It.default.confirm({centered:!0,icon:null,title:"\u589E\u8BBE\u6B63\u786E\u7B54\u6848",width:800,content:pt.createElement(pt.Fragment,null,"\u5F53\u524D\u8BD5\u9898\u7684\u6B63\u786E\u7B54\u6848\u4E3A ",jo==null?void 0:jo.map(lo=>{var ea;return(ea=rl.k4)==null?void 0:ea[lo-1]}),"\uFF0C\u8BF7\u9009\u62E9\u9700\u8981\u589E\u8BBE\u4E3A\u6B63\u786E\u7B54\u6848\u7684\u9009\u9879\u3002",pt.createElement("br",null),"\u52FE\u9009\u63D0\u4EA4\u4E4B\u540E\uFF0C\u9009\u4E2D\u589E\u8BBE\u4E3A\u6B63\u786E\u7B54\u6848\u4EFB\u4E00\u9009\u9879\u7684\u5B66\u751F\u4E5F\u4F1A\u83B7\u5F97\u8BE5\u5C0F\u9898\u7684\u5206\u503C\uFF0C\u4F46\u4E0D\u4F1A\u4FEE\u6539\u5F53\u524D\u8BD5\u9898\u7684\u9898\u578B\u3002\u53D6\u6D88\u52FE\u9009\u63D0\u4EA4\u4E4B\u540E\uFF0C\u4E5F\u4F1A\u91CD\u65B0\u8BA1\u7B97\u5BF9\u5E94\u5B66\u751F\u7684\u5F97\u5206\u3002",pt.createElement("br",null),pt.createElement(Ae.default.Group,{className:"flex-col mt20",options:Zi,defaultValue:Gr,onChange:lo=>{Gr=lo}})),onOk:()=>uo(void 0,null,function*(){const lo=yield(0,Gt.ZP)(`/api/exercises/${Za.categoryId}/questions/${Fn==null?void 0:Fn.id}/add_standard_answers.json`,{method:"put",body:{standard_answer:Gr}});(lo==null?void 0:lo.status)===0&&(ge.ZP.success("\u4FEE\u6539\u6210\u529F"),Oo(rr+1))})})},kl=(Po=xe==null?void 0:xe.questionList)==null?void 0:Po.reduce((Fn,sr)=>Fn+Number(sr.questions_score),0),Vl=pr&&((Ur=xe==null?void 0:xe.exam)==null?void 0:Ur.exercise_status)!==1;return pt.createElement("section",{className:Ut.wrap},pt.createElement("div",{id:"id_left_preview",className:Ut.left,onMouseEnter:Fn=>{const sr=document.getElementById("id_left_preview");sr.style.overflowY="auto"},onMouseLeave:Fn=>{const sr=document.getElementById("id_left_preview");sr.style.overflowY="hidden"}},pt.createElement("div",{className:Ut.title},pt.createElement("div",{className:"body-overflow-initial"},pt.createElement("b",null),pt.createElement("span",null,"\u7B54\u9898\u5361"))),pt.createElement("div",{className:Ut.total},pt.createElement("div",null,pt.createElement("img",{src:an}),pt.createElement("span",null,"\u9898\u6570(\u9053)"),pt.createElement("aside",null,xe==null?void 0:xe.all_questions_count)),pt.createElement("div",{className:"mr30 ml30"},pt.createElement("img",{src:dn}),pt.createElement("span",null,"\u603B\u5206(\u5206)"),pt.createElement("aside",null,kl&&kl.toFixed(1))),pt.createElement("div",null,pt.createElement("img",{src:Tt}),pt.createElement("span",null,"\u65F6\u957F(\u5206)"),pt.createElement("aside",null,((Ri=xe==null?void 0:xe.exam)==null?void 0:Ri.time)===-1||((Gi=xe==null?void 0:xe.exam)==null?void 0:Gi.time)===null?"\u4E0D\u9650":(kr=xe==null?void 0:xe.exam)==null?void 0:kr.time))),(wr=xe==null?void 0:xe.questionList)==null?void 0:wr.map((Fn,sr)=>{var jo;return pt.createElement("div",{className:Ut.list,key:sr},pt.createElement("div",{className:Ut.name},pt.createElement("b",null),pt.createElement("span",null,Fn.name)),pt.createElement("aside",null,pt.createElement("div",null,"\u5171",pt.createElement("span",{className:Ut.b},Fn.questions_count),"\u9898 ",pt.createElement("span",{className:Ut.l},"|"),"\u5171",pt.createElement("span",{className:Ut.r},Fn.questions_score),"\u5206"),pt.createElement("div",{className:Ut.answerSheet},(jo=Fn==null?void 0:Fn.questions)==null?void 0:jo.map((Gr,Zi)=>pt.createElement("div",{onClick:()=>{const Jo=`Anchor_${Gr==null?void 0:Gr.id}`;let lo=document.getElementById(Jo);lo&&setTimeout(()=>lo.scrollIntoView({block:"center",behavior:"smooth"}))},key:Gr==null?void 0:Gr.id,className:Ut.tag},Zi+1)))))})),pt.createElement("div",{className:Ut.right},pt.createElement("div",{className:Ut.examName,id:"examName"},pt.createElement("div",{className:Ut.name},pt.createElement(Me.Z,{title:(Qi=xe==null?void 0:xe.exam)==null?void 0:Qi.name,getPopupContainer:Fn=>Fn.parentNode},pt.createElement("span",{className:Ut.t},(ar=xe==null?void 0:xe.exam)==null?void 0:ar.name))),pr&&((so=xe==null?void 0:xe.exam)==null?void 0:so.exercise_status)===1&&pt.createElement(No.op,{openLoading:!0,shape:"default",onClick:()=>{It.default.confirm({title:"\u63D0\u793A",content:"\u786E\u8BA4\u6839\u636E\u6700\u65B0\u7684\u968F\u673A\u7EC4\u5377\u62BD\u9898\u89C4\u5219\u91CD\u65B0\u751F\u6210\u8BD5\u5377\u5417\uFF1F",onOk:()=>{Ja()}})},type:"primary"},"\u66F4\u65B0\u8BD5\u5377"),!pr&&pt.createElement(ue.ZP,{onClick:ko,type:"primary"},"\u968F\u673A\u66F4\u6362")),pt.createElement("div",{className:Ut.topWarp},(xr=xe==null?void 0:xe.questionList)==null?void 0:xr.map((Fn,sr)=>{var jo,Gr;return pt.createElement(pt.Fragment,{key:sr},pt.createElement("div",{className:Ut.head,style:sr===0?{border:0,marginTop:-16}:{}},pt.createElement("div",{className:Ut.name},pt.createElement("b",null),pt.createElement("span",null,Fn.name)),pt.createElement("div",{className:Ut.so},"\u5171",pt.createElement("span",{className:Ut.b},Fn.questions_count," "),"\u9898 ",Fn.type==="COMBINATION"&&`\uFF08\u5305\u542B${(jo=Fn==null?void 0:Fn.questions)==null?void 0:jo.map(Zi=>{var Jo;return(Jo=Zi==null?void 0:Zi.sub_item_banks)==null?void 0:Jo.length}).reduce((Zi,Jo)=>Zi+Jo)}\u5C0F\u9898\uFF09`,pt.createElement("span",{className:Ut.l},"|"),"\u5171",pt.createElement("span",{className:Ut.r},Fn.questions_score),"\u5206"),!pr&&pt.createElement("div",{className:Ut.btn},pt.createElement(ue.ZP,{onClick:()=>{hu(Fn)},type:"primary",ghost:!0,className:"mr20"},"\u8BBE\u7F6E\u5F97\u5206"),pt.createElement(ue.ZP,{onClick:()=>Hl(Fn),type:"primary",ghost:!0},"\u968F\u673A\u66F4\u6362"))),(Gr=Fn==null?void 0:Fn.questions)==null?void 0:Gr.map((Zi,Jo)=>{var lo,ea,Cr,Qo;return tr===(Zi==null?void 0:Zi.id)?pt.createElement("div",{id:`Anchor_${Zi==null?void 0:Zi.id}`,className:Ut.content,style:{padding:0,marginTop:24},key:Zi==null?void 0:Zi.id},pt.createElement("div",{style:{float:"right",marginTop:`${(Fn==null?void 0:Fn.type)==="PRACTICAL"?"-2px":"-6px"}`}},pt.createElement(ue.ZP,{onClick:()=>bi(null),className:"mr20",type:"primary",ghost:!0},"\u53D6\u6D88"),pt.createElement(ue.ZP,{onClick:()=>{is(Fn==null?void 0:Fn.type,Zi)},type:"primary"},"\u4FDD\u5B58")),Pa(Zi,Fn.type)):pt.createElement("div",{id:`Anchor_${Zi==null?void 0:Zi.id}`,className:Ut.content,key:Zi==null?void 0:Zi.id},pt.createElement("div",{className:Ut.titleWrap},(Zi==null?void 0:Zi.item_type)==="bprogram"?pt.createElement(Dt.Z,{style:{paddingRight:10},value:Jo+1+"\u3001"+((lo=Zi==null?void 0:Zi.program_attr)==null?void 0:lo.description)}):pt.createElement(Dt.Z,{style:{paddingRight:10},className:Ut.titleHtml,value:Jo+1+`\u3001${(Zi==null?void 0:Zi.item_type)==="combination"?"\uFF08\u9898\u5E72\uFF09":""}`+(Zi==null?void 0:Zi.name)}),pr&&pt.createElement(ue.ZP,{onClick:()=>{var Bo,Ta,du;if(tr){ge.ZP.warning("\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898");return}po.setFieldsValue({standard_answers:Zi==null?void 0:Zi.standard_answer,hack:Lo(Lo({},Zi),Zi==null?void 0:Zi.program_attr),hack_codes:ro(Lo({},Zi==null?void 0:Zi.program_attr),{code:ru.Base64.decode(((Bo=Zi==null?void 0:Zi.program_attr)==null?void 0:Bo.code)||"")}),hack_sets:Lo({},(Ta=Zi==null?void 0:Zi.hack_sets)==null?void 0:Ta[0])}),(Zi==null?void 0:Zi.item_type)=="program"?Jt.history.push(`/problems/newedit/${(du=Zi==null?void 0:Zi.program_attr)==null?void 0:du.identifier}?type=exercises&express_id=${Za.categoryId}&question_id=${Zi==null?void 0:Zi.id}&score=${Zi==null?void 0:Zi.score}&exercise=true&callback_url=/classrooms/${Za.coursesId}/exercise/${Za.categoryId}/detail?random=true`):bi(Zi==null?void 0:Zi.id)},type:"primary",style:{marginLeft:"auto"},ghost:!0},"\u7F16\u8F91"),!Vl&&pt.createElement(ue.ZP,{disabled:Vl,className:"ml20",onClick:()=>Ph(Zi==null?void 0:Zi.id,Fn.type,Jo,Fn),type:"primary",ghost:!0},"\u6362\u4E00\u9898")),(Zi==null?void 0:Zi.item_type)==="bprogram"&&pt.createElement(Dt.Z,{style:{paddingRight:10,paddingLeft:25},showProgramFill:!0,disabledFill:!0,className:Ut.titleHtml,value:ru.Base64.decode(((ea=Zi==null?void 0:Zi.program_attr)==null?void 0:ea.code)||"")}),(Fn.type==="SINGLE"||Fn.type==="JUDGMENT"||Fn.type==="MULTIPLE")&&cl(Zi),Fn.type==="COMPLETION"&&lu(Zi),Fn.type==="SUBJECTIVE"&&zs(Zi),Fn.type==="PROGRAM"&&Ml(Zi),Fn.type==="BPROGRAM"&&uu(Zi),Fn.type==="COMBINATION"&&Ro(Zi,Jo),Fn.type==="PRACTICAL"&&ds(Zi),pt.createElement(ie.Z,{className:"mt20",wrap:!1,align:"middle",gutter:20},((Cr=xe==null?void 0:xe.exam)==null?void 0:Cr.exercise_status)===3&&!["PROGRAM","BPROGRAM","PRACTICAL","COMBINATION"].includes(Fn.type)&&pt.createElement(Ee.Z,null,pt.createElement(ou.Z,{state:Zi==null?void 0:Zi.is_wrong,onClick:()=>{Vr==null||Vr({value:ro(Lo({},Zi),{question_id:Zi==null?void 0:Zi.id,question_score:Zi==null?void 0:Zi.score})})}})),["PROGRAM","BPROGRAM","PRACTICAL"].includes(Fn.type)&&(Zi==null?void 0:Zi.show_resubmit)&&pt.createElement(Ee.Z,null,pt.createElement(xa.C,{dataSource:ro(Lo({},Zi),{question_id:Zi==null?void 0:Zi.id})})),((Qo=xe==null?void 0:xe.exam)==null?void 0:Qo.exercise_status)===3&&["SINGLE"].includes(Fn.type)&&pt.createElement(Ee.Z,null,pt.createElement(ue.ZP,{style:{color:"#3061D0"},onClick:()=>{Wl({value:Zi})}},"\u589E\u8BBE\u6B63\u786E\u7B54\u6848"))))}))}))),pr?pt.createElement(No.vr,null,pt.createElement(Bt.Z,{showTotal:Yt.rU,total:(Ji=xe==null?void 0:xe.exam)==null?void 0:Ji.total_num,pageSize:1,current:rr+1,showSizeChanger:!1,onChange:Oo,showQuickJumper:!1,hideOnSinglePage:!1})):pt.createElement(No.vr,{LeftContent:pt.createElement(No.op,{onClick:Ve,shape:"default",style:{height:38,background:"#fff",boxShadow:"none"}},"\u8FD4\u56DE"),RightContent:pt.createElement(ie.Z,{align:"middle"},pt.createElement(nt.Z,{color:"#55575D",overlayClassName:Ut.popover,open:ho,getPopupContainer:Fn=>Fn==null?void 0:Fn.parentNode,content:"\u5982\u60A8\u5BF9\u6B64\u4EFD\u8BD5\u9898\u6EE1\u610F\uFF0C\u53EF\u5C06\u6B64\u4EFD\u8BD5\u9898\u4FDD\u5B58\u4E3A\u56FA\u5B9A\u8BD5\u5377"},pt.createElement(No.op,{onMouseEnter:()=>Ir(!0),onMouseLeave:()=>Ir(!1),onClick:()=>Gl(),shape:"default",style:{height:38,background:"#fff",boxShadow:"none"}},"\u4FDD\u5B58")),pt.createElement(No.op,{shape:"default",type:"primary",onClick:()=>fe(),style:{height:38,marginLeft:20}},"\u63D0\u4EA4"))}),pt.createElement(js,{visible:fo,questionParams:dr.current,getdata:xo,onRandomExchange:()=>uo(void 0,null,function*(){const Fn=dr.current;yield Sr({single_question_id:Fn.id,seleted_item_bank_ids:Fn.ids},{type:Fn.type,index:Fn.index}),Mo(!1)}),selectFromProblemSet:()=>{const Fn=dr.current,sr=`${location.pathname}${location.search}`;sr.includes("exercise")&&Jt.history.push(`/paperlibrary/exchangequestion?type=exercise&qid=${Fn.id}&qtype=${Fn.type}&exerciseid=${Za.categoryId}&from=${sr}`)},onCancel:()=>{Mo(!1)}}))}},53265:function(Dn,Gn,kt){"use strict";kt.r(Gn),kt.d(Gn,{default:function(){return st}});var pt=kt(59301),Ut=kt(71570),le={flex_box_center:"flex_box_center___kQBcj",flex_space_between:"flex_space_between___Znlbo",flex_box_vertical_center:"flex_box_vertical_center___CPD50",flex_box_center_end:"flex_box_center_end___jzPvK",flex_box_column:"flex_box_column___cvIBS",wrap:"wrap___lab8O",crumbs:"crumbs___qvTza"},Me=kt(34399),ue=kt(6767),It=kt(458),qt=kt(24092),ge=kt(59895),ne=kt(59301),Rt=Object.defineProperty,Ae=Object.getOwnPropertySymbols,ie=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable,Bt=(gt,vt,St)=>vt in gt?Rt(gt,vt,{enumerable:!0,configurable:!0,writable:!0,value:St}):gt[vt]=St,nt=(gt,vt)=>{for(var St in vt||(vt={}))ie.call(vt,St)&&Bt(gt,St,vt[St]);if(Ae)for(var St of Ae(vt))Ee.call(vt,St)&&Bt(gt,St,vt[St]);return gt},et=(gt,vt,St)=>new Promise((Et,Tt)=>{var Dt=Gt=>{try{Yt(St.next(Gt))}catch(me){Tt(me)}},Jt=Gt=>{try{Yt(St.throw(Gt))}catch(me){Tt(me)}},Yt=Gt=>Gt.done?Et(Gt.value):Promise.resolve(Gt.value).then(Dt,Jt);Yt((St=St.apply(gt,vt)).next())});const ht=({paperlibrary:gt,user:vt,globalSetting:St,dispatch:Et,location:Tt})=>{var Dt,Jt,Yt,Gt;const[me]=(0,Ut.useSearchParams)(),ae=me.get("select")||0,[Ne,Ce]=(0,pt.useState)(!1),[we,tn]=(0,pt.useState)(!0),[_e,an]=(0,pt.useState)(Number(ae)),[Ke,oe]=(0,pt.useState)({}),Xt=(0,Ut.useParams)(),{userInfo:qe}=vt,{actionTabs:_n}=gt;(0,pt.useEffect)(()=>(Et({type:"globalSetting/footerToggle",payload:!1}),()=>{Et({type:"globalSetting/footerToggle",payload:!0})}),[]),(0,pt.useEffect)(()=>(Et({type:"globalSetting/onlyShowBackTopToggle",payload:!1}),Et({type:"globalSetting/onlyShowBackTopIconToggle",payload:!1}),Et({type:"exercise/getWorkSetting",payload:nt({},Xt)}),()=>{Et({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),Et({type:"globalSetting/onlyShowBackTopIconToggle",payload:!0})}),[]),(0,pt.useEffect)(()=>{Pn(_e)},[]),(0,pt.useEffect)(()=>{var Sn;(Sn=_n==null?void 0:_n.params)!=null&&Sn.isUpdateData&&Pn(_e)},[(Dt=_n==null?void 0:_n.params)==null?void 0:Dt.isUpdateData]);const Pn=(Sn=0)=>et(void 0,null,function*(){console.log(Xt),tn(!0);const ee=yield(0,qt.ZP)(`/api/exercises/${Xt.categoryId}/preview_random_exercise.json`,{method:"get",params:{num:Sn}});Et({type:"paperlibrary/setActionTabs",payload:{params:{isUpdateData:!1}}}),tn(!1),oe((0,ge.PF)(ee))}),De=()=>{Ut.history.push(`/classrooms/${Xt.coursesId}/exercise`)},dn=()=>{alert("\u4FDD\u5B58")},sn=(Sn,ee)=>et(void 0,null,function*(){const Mn=yield(0,qt.ZP)(`/api/exercises/${Xt.categoryId}/toggle_random_question.json`,{method:"post",body:{question_id:Sn==null?void 0:Sn.single_question_id}});Mn!=null&&Mn.question&&(ue.ZP.info("\u6362\u9898\u6210\u529F"),Pn(_e))}),jn=Sn=>et(void 0,null,function*(){document.body.scrollIntoView(),an(Sn),yield Pn(Sn)}),Te=Sn=>{Et({type:"exercise/setActionTabs",payload:{key:"\u6807\u8BB0\u9519\u9898",params:Sn}})};return console.log((0,Ut.useLocation)(),"location333"),ne.createElement("section",{className:le.wrap},ne.createElement(It.Z,{loading:we,active:!0,paragraph:{rows:5}},((Yt=(Jt=(0,Ut.useLocation)())==null?void 0:Jt.pathname)==null?void 0:Yt.includes("preview"))&&ne.createElement("div",{className:le.crumbs},ne.createElement("b",null),ne.createElement("span",{className:"current",onClick:()=>Ut.history.push(`/classrooms/${Xt.coursesId}/exercise`)},`${(Gt=qe==null?void 0:qe.course)==null?void 0:Gt.course_name}>`),ne.createElement("span",{className:"current",onClick:()=>Ut.history.push(`/classrooms/${Xt.coursesId}/exercise`)},"\u8BD5\u5377\u5217\u8868>"),ne.createElement("span",{style:{color:"#bebebe"}},"\u9884\u89C8")),ne.createElement(Me.Z,{loading:Ne,submit:dn,goBack:De,data:Ke,getdata:()=>{Pn(_e)},selectValue:_e,editPreview:!0,onExchange:sn,onSkipExamination:jn,handleMarkWrongQuestion:Te})))};var st=(0,Ut.connect)(({paperlibrary:gt,user:vt,globalSetting:St})=>({paperlibrary:gt,user:vt,globalSetting:St}))(ht)},94052:function(Dn,Gn,kt){"use strict";kt.d(Gn,{g:function(){return ue}});var pt=kt(59301),Ut=kt(79833),le=kt(10733),Me=(It,qt,ge)=>new Promise((ne,Rt)=>{var Ae=Bt=>{try{Ee(ge.next(Bt))}catch(nt){Rt(nt)}},ie=Bt=>{try{Ee(ge.throw(Bt))}catch(nt){Rt(nt)}},Ee=Bt=>Bt.done?ne(Bt.value):Promise.resolve(Bt.value).then(Ae,ie);Ee((ge=ge.apply(It,qt)).next())});const ue=()=>{const[It,qt]=(0,pt.useState)([]);return(0,pt.useEffect)(()=>{Me(void 0,null,function*(){const ne=yield(0,Ut.d1)({source:"question"});ne!=null&&ne.disciplines&&qt((0,le.L)(ne==null?void 0:ne.disciplines))})},[]),It}},16948:function(Dn,Gn,kt){"use strict";kt.d(Gn,{U:function(){return ne}});var pt=kt(59301),Ut=Object.defineProperty,le=Object.getOwnPropertySymbols,Me=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,It=(Rt,Ae,ie)=>Ae in Rt?Ut(Rt,Ae,{enumerable:!0,configurable:!0,writable:!0,value:ie}):Rt[Ae]=ie,qt=(Rt,Ae)=>{for(var ie in Ae||(Ae={}))Me.call(Ae,ie)&&It(Rt,ie,Ae[ie]);if(le)for(var ie of le(Ae))ue.call(Ae,ie)&&It(Rt,ie,Ae[ie]);return Rt},ge=(Rt,Ae,ie)=>new Promise((Ee,Bt)=>{var nt=st=>{try{ht(ie.next(st))}catch(gt){Bt(gt)}},et=st=>{try{ht(ie.throw(st))}catch(gt){Bt(gt)}},ht=st=>st.done?Ee(st.value):Promise.resolve(st.value).then(nt,et);ht((ie=ie.apply(Rt,Ae)).next())});function ne(Rt,Ae){const[ie,Ee]=(0,pt.useState)(Ae),[Bt,nt]=(0,pt.useState)(!1),[et,ht]=(0,pt.useState)();return[ie,Bt,(gt,vt=!1)=>ge(this,null,function*(){const St=vt?Ae:qt(qt({},ie),gt);nt(!0),Ee(St);const Et=yield Rt(St);return nt(!1),ht(Et),Et}),et,ht]}},49405:function(Dn,Gn,kt){"use strict";kt.d(Gn,{AL:function(){return St},Iy:function(){return Ae},Qv:function(){return Bt},ez:function(){return vt},jb:function(){return ie}});var pt=kt(32834),Ut=kt.n(pt),le=kt(11690),Me=kt.n(le);let ue=1;function It(Yt,Gt){const me=Yt.match(/^(\s+)(?:```)/);if(me===null)return Gt;const ae=me[1];return Gt.split(`
`).map(Ne=>{const Ce=Ne.match(/^\s+/);if(Ce===null)return Ne;const[we]=Ce;return we.length>=ae.length?Ne.slice(ae.length):Ne}).join(`
`)}let qt=[],ge=["<ul>"];const ne=new(Ut()).Renderer,Rt=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Ae(){qt.length=0,ge=["<ul>"]}const ie={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function Ee(Yt,Gt,me,ae){if(Gt>=Yt.length||Yt[Gt].level<=me)return Gt;var Ne=Yt[Gt];ae.push("<li><a href='#"+ue+Ne.anchor+"'>"+Ne.text+"</a>"),Gt++;var Ce=[];return Gt=Ee(Yt,Gt,Ne.level,Ce),Ce.length>0&&(ae.push("<ul>"),Ce.forEach(function(we){ae.push(we)}),ae.push("</ul>")),ae.push("</li>"),Gt=Ee(Yt,Gt,me,ae),Gt}function Bt(){return Ee(qt,0,0,ge),ge.push("</ul>"),ge.join("")}const nt={heading(Yt){const Gt=Rt.exec(Yt);if(ue+=1,Gt)return{type:"heading",raw:Gt[0],depth:Gt[1].length,text:Gt[2]}},fences(Yt){const Gt=this.rules.block.fences.exec(Yt);if(Gt){const me=Gt[0];let ae=It(me,Gt[3]||"");const Ne=Gt[2]?Gt[2].trim():Gt[2];if(["latex","katex","math"].indexOf(Ne)>=0){const Ce=st(),we=ae;ae=Ce,gt[Ce]={type:"block",expression:we}}return{type:"code",raw:me,lang:Ne,text:ae}}}},et=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let ht=0;const st=()=>`__special_katext_id_${ht++}__`;let gt={};function vt(){return gt}function St(){ht=0,gt={}}function Et(Yt){return Yt=Yt.replace(et,(Gt,me)=>{const ae=st();return gt[ae]={type:"inline",expression:me},ae}),Yt}const Tt=ne.listitem;ne.listitem=function(Yt){return Tt(Et(Yt))};const Dt=ne.paragraph;ne.paragraph=function(Yt){return Dt(Et(Yt))};const Jt=ne.tablecell;ne.tablecell=function(Yt,Gt){return Jt(Et(Yt),Gt)},ne.code=function(Yt,Gt,me){const ae=(Gt||"").match(/\S*/)[0];return ae?["latex","katex","math"].indexOf(ae)>=0?`<p class='editormd-tex'>${Yt}</p>`:`<pre class="prettyprint linenums"><code class="language-${Gt}">${me?Yt:(0,le.escape)(Yt,!0)}</code></pre>
`:'<pre class="prettyprint linenums"><code>'+(me?Yt:(0,le.escape)(Yt,!0))+"</code></pre>"},ne.heading=function(Yt,Gt,me){let ae=this.options.headerPrefix+me.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return qt.push({anchor:ae,level:Gt,text:Yt}),"<h"+Gt+' id="'+ue+ae+'">'+Yt+"</h"+Gt+">"},Ut().setOptions({silent:!0,gfm:!0,pedantic:!1}),Ut().use({tokenizer:nt,renderer:ne}),Gn.ZP=Ut()},99498:function(Dn,Gn,kt){(function(pt){pt(kt(89780))})(function(pt){pt.defineOption("placeholder","",function(ge,ne,Rt){var Ae=Rt&&Rt!=pt.Init;if(ne&&!Ae)ge.on("blur",ue),ge.on("change",It),ge.on("swapDoc",It),pt.on(ge.getInputField(),"compositionupdate",ge.state.placeholderCompose=function(){Me(ge)}),It(ge);else if(!ne&&Ae){ge.off("blur",ue),ge.off("change",It),ge.off("swapDoc",It),pt.off(ge.getInputField(),"compositionupdate",ge.state.placeholderCompose),Ut(ge);var ie=ge.getWrapperElement();ie.className=ie.className.replace(" CodeMirror-empty","")}ne&&!ge.hasFocus()&&ue(ge)});function Ut(ge){ge.state.placeholder&&(ge.state.placeholder.parentNode.removeChild(ge.state.placeholder),ge.state.placeholder=null)}function le(ge){Ut(ge);var ne=ge.state.placeholder=document.createElement("pre");ne.style.cssText="height: 0; overflow: visible",ne.style.direction=ge.getOption("direction"),ne.className="CodeMirror-placeholder CodeMirror-line-like";var Rt=ge.getOption("placeholder");typeof Rt=="string"&&(Rt=document.createTextNode(Rt)),ne.appendChild(Rt),ge.display.lineSpace.insertBefore(ne,ge.display.lineSpace.firstChild)}function Me(ge){setTimeout(function(){var ne=!1,Rt=ge.getInputField();Rt.nodeName=="TEXTAREA"?ne=!Rt.value:ge.lineCount()==1&&(ne=!/[^\u200b]/.test(Rt.querySelector(".CodeMirror-line").textContent)),ne?le(ge):Ut(ge)},20)}function ue(ge){qt(ge)&&le(ge)}function It(ge){var ne=ge.getWrapperElement(),Rt=qt(ge);ne.className=ne.className.replace(" CodeMirror-empty","")+(Rt?" CodeMirror-empty":""),Rt?le(ge):Ut(ge)}function qt(ge){return ge.lineCount()===1&&ge.getLine(0)===""}})},25717:function(Dn,Gn,kt){(function(pt){pt(kt(89780))})(function(pt){var Ut={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},le=pt.Pos;pt.defineOption("autoCloseBrackets",!1,function(nt,et,ht){ht&&ht!=pt.Init&&(nt.removeKeyMap(ue),nt.state.closeBrackets=null),et&&(It(Me(et,"pairs")),nt.state.closeBrackets=et,nt.addKeyMap(ue))});function Me(nt,et){return et=="pairs"&&typeof nt=="string"?nt:typeof nt=="object"&&nt[et]!=null?nt[et]:Ut[et]}var ue={Backspace:ne,Enter:Rt};function It(nt){for(var et=0;et<nt.length;et++){var ht=nt.charAt(et),st="'"+ht+"'";ue[st]||(ue[st]=qt(ht))}}It(Ut.pairs+"`");function qt(nt){return function(et){return ie(et,nt)}}function ge(nt){var et=nt.state.closeBrackets;if(!et||et.override)return et;var ht=nt.getModeAt(nt.getCursor());return ht.closeBrackets||et}function ne(nt){var et=ge(nt);if(!et||nt.getOption("disableInput"))return pt.Pass;for(var ht=Me(et,"pairs"),st=nt.listSelections(),gt=0;gt<st.length;gt++){if(!st[gt].empty())return pt.Pass;var vt=Ee(nt,st[gt].head);if(!vt||ht.indexOf(vt)%2!=0)return pt.Pass}for(var gt=st.length-1;gt>=0;gt--){var St=st[gt].head;nt.replaceRange("",le(St.line,St.ch-1),le(St.line,St.ch+1),"+delete")}}function Rt(nt){var et=ge(nt),ht=et&&Me(et,"explode");if(!ht||nt.getOption("disableInput"))return pt.Pass;for(var st=nt.listSelections(),gt=0;gt<st.length;gt++){if(!st[gt].empty())return pt.Pass;var vt=Ee(nt,st[gt].head);if(!vt||ht.indexOf(vt)%2!=0)return pt.Pass}nt.operation(function(){var St=nt.lineSeparator()||`
`;nt.replaceSelection(St+St,null),nt.execCommand("goCharLeft"),st=nt.listSelections();for(var Et=0;Et<st.length;Et++){var Tt=st[Et].head.line;nt.indentLine(Tt,null,!0),nt.indentLine(Tt+1,null,!0)}})}function Ae(nt){var et=pt.cmpPos(nt.anchor,nt.head)>0;return{anchor:new le(nt.anchor.line,nt.anchor.ch+(et?-1:1)),head:new le(nt.head.line,nt.head.ch+(et?1:-1))}}function ie(nt,et){var ht=ge(nt);if(!ht||nt.getOption("disableInput"))return pt.Pass;var st=Me(ht,"pairs"),gt=st.indexOf(et);if(gt==-1)return pt.Pass;for(var vt=Me(ht,"closeBefore"),St=Me(ht,"triples"),Et=st.charAt(gt+1)==et,Tt=nt.listSelections(),Dt=gt%2==0,Jt,Yt=0;Yt<Tt.length;Yt++){var Gt=Tt[Yt],me=Gt.head,ae,Ne=nt.getRange(me,le(me.line,me.ch+1));if(Dt&&!Gt.empty())ae="surround";else if((Et||!Dt)&&Ne==et)Et&&Bt(nt,me)?ae="both":St.indexOf(et)>=0&&nt.getRange(me,le(me.line,me.ch+3))==et+et+et?ae="skipThree":ae="skip";else if(Et&&me.ch>1&&St.indexOf(et)>=0&&nt.getRange(le(me.line,me.ch-2),me)==et+et){if(me.ch>2&&/\bstring/.test(nt.getTokenTypeAt(le(me.line,me.ch-2))))return pt.Pass;ae="addFour"}else if(Et){var Ce=me.ch==0?" ":nt.getRange(le(me.line,me.ch-1),me);if(!pt.isWordChar(Ne)&&Ce!=et&&!pt.isWordChar(Ce))ae="both";else return pt.Pass}else if(Dt&&(Ne.length===0||/\s/.test(Ne)||vt.indexOf(Ne)>-1))ae="both";else return pt.Pass;if(!Jt)Jt=ae;else if(Jt!=ae)return pt.Pass}var we=gt%2?st.charAt(gt-1):et,tn=gt%2?et:st.charAt(gt+1);nt.operation(function(){if(Jt=="skip")nt.execCommand("goCharRight");else if(Jt=="skipThree")for(var _e=0;_e<3;_e++)nt.execCommand("goCharRight");else if(Jt=="surround"){for(var an=nt.getSelections(),_e=0;_e<an.length;_e++)an[_e]=we+an[_e]+tn;nt.replaceSelections(an,"around"),an=nt.listSelections().slice();for(var _e=0;_e<an.length;_e++)an[_e]=Ae(an[_e]);nt.setSelections(an)}else Jt=="both"?(nt.replaceSelection(we+tn,null),nt.triggerElectric(we+tn),nt.execCommand("goCharLeft")):Jt=="addFour"&&(nt.replaceSelection(we+we+we+we,"before"),nt.execCommand("goCharRight"))})}function Ee(nt,et){var ht=nt.getRange(le(et.line,et.ch-1),le(et.line,et.ch+1));return ht.length==2?ht:null}function Bt(nt,et){var ht=nt.getTokenAt(le(et.line,et.ch+1));return/\bstring/.test(ht.type)&&ht.start==et.ch&&(et.ch==0||!/\bstring/.test(nt.getTokenTypeAt(et)))}})},6313:function(Dn,Gn,kt){(function(pt){pt(kt(89780),kt(32855))})(function(pt){pt.defineOption("autoCloseTags",!1,function(ne,Rt,Ae){if(Ae!=pt.Init&&Ae&&ne.removeKeyMap("autoCloseTags"),!!Rt){var ie={name:"autoCloseTags"};(typeof Rt!="object"||Rt.whenClosing!==!1)&&(ie["'/'"]=function(Ee){return It(Ee)}),(typeof Rt!="object"||Rt.whenOpening!==!1)&&(ie["'>'"]=function(Ee){return Me(Ee)}),ne.addKeyMap(ie)}});var Ut=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],le=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function Me(ne){if(ne.getOption("disableInput"))return pt.Pass;for(var Rt=ne.listSelections(),Ae=[],ie=ne.getOption("autoCloseTags"),Ee=0;Ee<Rt.length;Ee++){if(!Rt[Ee].empty())return pt.Pass;var Bt=Rt[Ee].head,nt=ne.getTokenAt(Bt),et=pt.innerMode(ne.getMode(),nt.state),ht=et.state,st=et.mode.xmlCurrentTag&&et.mode.xmlCurrentTag(ht),gt=st&&st.name;if(!gt)return pt.Pass;var vt=et.mode.configuration=="html",St=typeof ie=="object"&&ie.dontCloseTags||vt&&Ut,Et=typeof ie=="object"&&ie.indentTags||vt&&le;nt.end>Bt.ch&&(gt=gt.slice(0,gt.length-nt.end+Bt.ch));var Tt=gt.toLowerCase();if(!gt||nt.type=="string"&&(nt.end!=Bt.ch||!/[\"\']/.test(nt.string.charAt(nt.string.length-1))||nt.string.length==1)||nt.type=="tag"&&st.close||nt.string.indexOf("/")==Bt.ch-nt.start-1||St&&qt(St,Tt)>-1||ge(ne,et.mode.xmlCurrentContext&&et.mode.xmlCurrentContext(ht)||[],gt,Bt,!0))return pt.Pass;var Dt=typeof ie=="object"&&ie.emptyTags;if(Dt&&qt(Dt,gt)>-1){Ae[Ee]={text:"/>",newPos:pt.Pos(Bt.line,Bt.ch+2)};continue}var Jt=Et&&qt(Et,Tt)>-1;Ae[Ee]={indent:Jt,text:">"+(Jt?`
`:"")+"</"+gt+">",newPos:Jt?pt.Pos(Bt.line+1,0):pt.Pos(Bt.line,Bt.ch+1)}}for(var Yt=typeof ie=="object"&&ie.dontIndentOnAutoClose,Ee=Rt.length-1;Ee>=0;Ee--){var Gt=Ae[Ee];ne.replaceRange(Gt.text,Rt[Ee].head,Rt[Ee].anchor,"+insert");var me=ne.listSelections().slice(0);me[Ee]={head:Gt.newPos,anchor:Gt.newPos},ne.setSelections(me),!Yt&&Gt.indent&&(ne.indentLine(Gt.newPos.line,null,!0),ne.indentLine(Gt.newPos.line+1,null,!0))}}function ue(ne,Rt){for(var Ae=ne.listSelections(),ie=[],Ee=Rt?"/":"</",Bt=ne.getOption("autoCloseTags"),nt=typeof Bt=="object"&&Bt.dontIndentOnSlash,et=0;et<Ae.length;et++){if(!Ae[et].empty())return pt.Pass;var ht=Ae[et].head,st=ne.getTokenAt(ht),gt=pt.innerMode(ne.getMode(),st.state),vt=gt.state;if(Rt&&(st.type=="string"||st.string.charAt(0)!="<"||st.start!=ht.ch-1))return pt.Pass;var St,Et=gt.mode.name!="xml"&&ne.getMode().name=="htmlmixed";if(Et&&gt.mode.name=="javascript")St=Ee+"script";else if(Et&&gt.mode.name=="css")St=Ee+"style";else{var Tt=gt.mode.xmlCurrentContext&&gt.mode.xmlCurrentContext(vt);if(!Tt||Tt.length&&ge(ne,Tt,Tt[Tt.length-1],ht))return pt.Pass;St=Ee+Tt[Tt.length-1]}ne.getLine(ht.line).charAt(st.end)!=">"&&(St+=">"),ie[et]=St}if(ne.replaceSelections(ie),Ae=ne.listSelections(),!nt)for(var et=0;et<Ae.length;et++)(et==Ae.length-1||Ae[et].head.line<Ae[et+1].head.line)&&ne.indentLine(Ae[et].head.line)}function It(ne){return ne.getOption("disableInput")?pt.Pass:ue(ne,!0)}pt.commands.closeTag=function(ne){return ue(ne)};function qt(ne,Rt){if(ne.indexOf)return ne.indexOf(Rt);for(var Ae=0,ie=ne.length;Ae<ie;++Ae)if(ne[Ae]==Rt)return Ae;return-1}function ge(ne,Rt,Ae,ie,Ee){if(!pt.scanForClosingTag)return!1;var Bt=Math.min(ne.lastLine()+1,ie.line+500),nt=pt.scanForClosingTag(ne,ie,null,Bt);if(!nt||nt.tag!=Ae)return!1;for(var et=Ee?1:0,ht=Rt.length-1;ht>=0&&Rt[ht]==Ae;ht--)++et;ie=nt.to;for(var ht=1;ht<et;ht++){var st=pt.scanForClosingTag(ne,ie,null,Bt);if(!st||st.tag!=Ae)return!1;ie=st.to}return!0}})},32855:function(Dn,Gn,kt){(function(pt){pt(kt(89780))})(function(pt){"use strict";var Ut=pt.Pos;function le(ht,st){return ht.line-st.line||ht.ch-st.ch}var Me="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ue=Me+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",It=new RegExp("<(/?)(["+Me+"]["+ue+"]*)","g");function qt(ht,st,gt,vt){this.line=st,this.ch=gt,this.cm=ht,this.text=ht.getLine(st),this.min=vt?Math.max(vt.from,ht.firstLine()):ht.firstLine(),this.max=vt?Math.min(vt.to-1,ht.lastLine()):ht.lastLine()}function ge(ht,st){var gt=ht.cm.getTokenTypeAt(Ut(ht.line,st));return gt&&/\btag\b/.test(gt)}function ne(ht){if(!(ht.line>=ht.max))return ht.ch=0,ht.text=ht.cm.getLine(++ht.line),!0}function Rt(ht){if(!(ht.line<=ht.min))return ht.text=ht.cm.getLine(--ht.line),ht.ch=ht.text.length,!0}function Ae(ht){for(;;){var st=ht.text.indexOf(">",ht.ch);if(st==-1){if(ne(ht))continue;return}if(!ge(ht,st+1)){ht.ch=st+1;continue}var gt=ht.text.lastIndexOf("/",st),vt=gt>-1&&!/\S/.test(ht.text.slice(gt+1,st));return ht.ch=st+1,vt?"selfClose":"regular"}}function ie(ht){for(;;){var st=ht.ch?ht.text.lastIndexOf("<",ht.ch-1):-1;if(st==-1){if(Rt(ht))continue;return}if(!ge(ht,st+1)){ht.ch=st;continue}It.lastIndex=st,ht.ch=st;var gt=It.exec(ht.text);if(gt&&gt.index==st)return gt}}function Ee(ht){for(;;){It.lastIndex=ht.ch;var st=It.exec(ht.text);if(!st){if(ne(ht))continue;return}if(!ge(ht,st.index+1)){ht.ch=st.index+1;continue}return ht.ch=st.index+st[0].length,st}}function Bt(ht){for(;;){var st=ht.ch?ht.text.lastIndexOf(">",ht.ch-1):-1;if(st==-1){if(Rt(ht))continue;return}if(!ge(ht,st+1)){ht.ch=st;continue}var gt=ht.text.lastIndexOf("/",st),vt=gt>-1&&!/\S/.test(ht.text.slice(gt+1,st));return ht.ch=st+1,vt?"selfClose":"regular"}}function nt(ht,st){for(var gt=[];;){var vt=Ee(ht),St,Et=ht.line,Tt=ht.ch-(vt?vt[0].length:0);if(!vt||!(St=Ae(ht)))return;if(St!="selfClose")if(vt[1]){for(var Dt=gt.length-1;Dt>=0;--Dt)if(gt[Dt]==vt[2]){gt.length=Dt;break}if(Dt<0&&(!st||st==vt[2]))return{tag:vt[2],from:Ut(Et,Tt),to:Ut(ht.line,ht.ch)}}else gt.push(vt[2])}}function et(ht,st){for(var gt=[];;){var vt=Bt(ht);if(!vt)return;if(vt=="selfClose"){ie(ht);continue}var St=ht.line,Et=ht.ch,Tt=ie(ht);if(!Tt)return;if(Tt[1])gt.push(Tt[2]);else{for(var Dt=gt.length-1;Dt>=0;--Dt)if(gt[Dt]==Tt[2]){gt.length=Dt;break}if(Dt<0&&(!st||st==Tt[2]))return{tag:Tt[2],from:Ut(ht.line,ht.ch),to:Ut(St,Et)}}}}pt.registerHelper("fold","xml",function(ht,st){for(var gt=new qt(ht,st.line,0);;){var vt=Ee(gt);if(!vt||gt.line!=st.line)return;var St=Ae(gt);if(!St)return;if(!vt[1]&&St!="selfClose"){var Et=Ut(gt.line,gt.ch),Tt=nt(gt,vt[2]);return Tt&&le(Tt.from,Et)>0?{from:Et,to:Tt.from}:null}}}),pt.findMatchingTag=function(ht,st,gt){var vt=new qt(ht,st.line,st.ch,gt);if(!(vt.text.indexOf(">")==-1&&vt.text.indexOf("<")==-1)){var St=Ae(vt),Et=St&&Ut(vt.line,vt.ch),Tt=St&&ie(vt);if(!(!St||!Tt||le(vt,st)>0)){var Dt={from:Ut(vt.line,vt.ch),to:Et,tag:Tt[2]};return St=="selfClose"?{open:Dt,close:null,at:"open"}:Tt[1]?{open:et(vt,Tt[2]),close:Dt,at:"close"}:(vt=new qt(ht,Et.line,Et.ch,gt),{open:Dt,close:nt(vt,Tt[2]),at:"open"})}}},pt.findEnclosingTag=function(ht,st,gt,vt){for(var St=new qt(ht,st.line,st.ch,gt);;){var Et=et(St,vt);if(!Et)break;var Tt=new qt(ht,st.line,st.ch,gt),Dt=nt(Tt,Et.tag);if(Dt)return{open:Et,close:Dt}}},pt.scanForClosingTag=function(ht,st,gt,vt){var St=new qt(ht,st.line,st.ch,vt?{from:0,to:vt}:null);return nt(St,gt)}})},89780:function(Dn){(function(Gn,kt){Dn.exports=kt()})(this,function(){"use strict";var Gn=navigator.userAgent,kt=navigator.platform,pt=/gecko\/\d/i.test(Gn),Ut=/MSIE \d/.test(Gn),le=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Gn),Me=/Edge\/(\d+)/.exec(Gn),ue=Ut||le||Me,It=ue&&(Ut?document.documentMode||6:+(Me||le)[1]),qt=!Me&&/WebKit\//.test(Gn),ge=qt&&/Qt\/\d+\.\d+/.test(Gn),ne=!Me&&/Chrome\//.test(Gn),Rt=/Opera\//.test(Gn),Ae=/Apple Computer/.test(navigator.vendor),ie=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Gn),Ee=/PhantomJS/.test(Gn),Bt=!Me&&/AppleWebKit/.test(Gn)&&/Mobile\/\w+/.test(Gn),nt=/Android/.test(Gn),et=Bt||nt||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Gn),ht=Bt||/Mac/.test(kt),st=/\bCrOS\b/.test(Gn),gt=/win/i.test(kt),vt=Rt&&Gn.match(/Version\/(\d*\.\d*)/);vt&&(vt=Number(vt[1])),vt&&vt>=15&&(Rt=!1,qt=!0);var St=ht&&(ge||Rt&&(vt==null||vt<12.11)),Et=pt||ue&&It>=9;function Tt(it){return new RegExp("(^|\\s)"+it+"(?:$|\\s)\\s*")}var Dt=function(it,at){var ct=it.className,dt=Tt(at).exec(ct);if(dt){var mt=ct.slice(dt.index+dt[0].length);it.className=ct.slice(0,dt.index)+(mt?dt[1]+mt:"")}};function Jt(it){for(var at=it.childNodes.length;at>0;--at)it.removeChild(it.firstChild);return it}function Yt(it,at){return Jt(it).appendChild(at)}function Gt(it,at,ct,dt){var mt=document.createElement(it);if(ct&&(mt.className=ct),dt&&(mt.style.cssText=dt),typeof at=="string")mt.appendChild(document.createTextNode(at));else if(at)for(var Ft=0;Ft<at.length;++Ft)mt.appendChild(at[Ft]);return mt}function me(it,at,ct,dt){var mt=Gt(it,at,ct,dt);return mt.setAttribute("role","presentation"),mt}var ae;document.createRange?ae=function(it,at,ct,dt){var mt=document.createRange();return mt.setEnd(dt||it,ct),mt.setStart(it,at),mt}:ae=function(it,at,ct){var dt=document.body.createTextRange();try{dt.moveToElementText(it.parentNode)}catch(mt){return dt}return dt.collapse(!0),dt.moveEnd("character",ct),dt.moveStart("character",at),dt};function Ne(it,at){if(at.nodeType==3&&(at=at.parentNode),it.contains)return it.contains(at);do if(at.nodeType==11&&(at=at.host),at==it)return!0;while(at=at.parentNode)}function Ce(){var it;try{it=document.activeElement}catch(at){it=document.body||null}for(;it&&it.shadowRoot&&it.shadowRoot.activeElement;)it=it.shadowRoot.activeElement;return it}function we(it,at){var ct=it.className;Tt(at).test(ct)||(it.className+=(ct?" ":"")+at)}function tn(it,at){for(var ct=it.split(" "),dt=0;dt<ct.length;dt++)ct[dt]&&!Tt(ct[dt]).test(at)&&(at+=" "+ct[dt]);return at}var _e=function(it){it.select()};Bt?_e=function(it){it.selectionStart=0,it.selectionEnd=it.value.length}:ue&&(_e=function(it){try{it.select()}catch(at){}});function an(it){var at=Array.prototype.slice.call(arguments,1);return function(){return it.apply(null,at)}}function Ke(it,at,ct){at||(at={});for(var dt in it)it.hasOwnProperty(dt)&&(ct!==!1||!at.hasOwnProperty(dt))&&(at[dt]=it[dt]);return at}function oe(it,at,ct,dt,mt){at==null&&(at=it.search(/[^\s\u00a0]/),at==-1&&(at=it.length));for(var Ft=dt||0,Ot=mt||0;;){var Vt=it.indexOf(" ",Ft);if(Vt<0||Vt>=at)return Ot+(at-Ft);Ot+=Vt-Ft,Ot+=ct-Ot%ct,Ft=Vt+1}}var Xt=function(){this.id=null,this.f=null,this.time=0,this.handler=an(this.onTimeout,this)};Xt.prototype.onTimeout=function(it){it.id=0,it.time<=+new Date?it.f():setTimeout(it.handler,it.time-+new Date)},Xt.prototype.set=function(it,at){this.f=at;var ct=+new Date+it;(!this.id||ct<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,it),this.time=ct)};function qe(it,at){for(var ct=0;ct<it.length;++ct)if(it[ct]==at)return ct;return-1}var _n=50,Pn={toString:function(){return"CodeMirror.Pass"}},De={scroll:!1},dn={origin:"*mouse"},sn={origin:"+move"};function jn(it,at,ct){for(var dt=0,mt=0;;){var Ft=it.indexOf(" ",dt);Ft==-1&&(Ft=it.length);var Ot=Ft-dt;if(Ft==it.length||mt+Ot>=at)return dt+Math.min(Ot,at-mt);if(mt+=Ft-dt,mt+=ct-mt%ct,dt=Ft+1,mt>=at)return dt}}var Te=[""];function Sn(it){for(;Te.length<=it;)Te.push(ee(Te)+" ");return Te[it]}function ee(it){return it[it.length-1]}function Mn(it,at){for(var ct=[],dt=0;dt<it.length;dt++)ct[dt]=at(it[dt],dt);return ct}function ui(it,at,ct){for(var dt=0,mt=ct(at);dt<it.length&&ct(it[dt])<=mt;)dt++;it.splice(dt,0,at)}function _t(){}function Lt(it,at){var ct;return Object.create?ct=Object.create(it):(_t.prototype=it,ct=new _t),at&&Ke(at,ct),ct}var Pt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Nt(it){return/\w/.test(it)||it>"\x80"&&(it.toUpperCase()!=it.toLowerCase()||Pt.test(it))}function zt(it,at){return at?at.source.indexOf("\\w")>-1&&Nt(it)?!0:at.test(it):Nt(it)}function Mt(it){for(var at in it)if(it.hasOwnProperty(at)&&it[at])return!1;return!0}var Kt=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ye(it){return it.charCodeAt(0)>=768&&Kt.test(it)}function Ue(it,at,ct){for(;(ct<0?at>0:at<it.length)&&ye(it.charAt(at));)at+=ct;return at}function Qe(it,at,ct){for(var dt=at>ct?-1:1;;){if(at==ct)return at;var mt=(at+ct)/2,Ft=dt<0?Math.ceil(mt):Math.floor(mt);if(Ft==at)return it(Ft)?at:ct;it(Ft)?ct=Ft:at=Ft+dt}}function ce(it,at,ct,dt){if(!it)return dt(at,ct,"ltr",0);for(var mt=!1,Ft=0;Ft<it.length;++Ft){var Ot=it[Ft];(Ot.from<ct&&Ot.to>at||at==ct&&Ot.to==at)&&(dt(Math.max(Ot.from,at),Math.min(Ot.to,ct),Ot.level==1?"rtl":"ltr",Ft),mt=!0)}mt||dt(at,ct,"ltr")}var Oe=null;function Le(it,at,ct){var dt;Oe=null;for(var mt=0;mt<it.length;++mt){var Ft=it[mt];if(Ft.from<at&&Ft.to>at)return mt;Ft.to==at&&(Ft.from!=Ft.to&&ct=="before"?dt=mt:Oe=mt),Ft.from==at&&(Ft.from!=Ft.to&&ct!="before"?dt=mt:Oe=mt)}return dt!=null?dt:Oe}var Xe=function(){var it="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",at="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function ct(se){return se<=247?it.charAt(se):1424<=se&&se<=1524?"R":1536<=se&&se<=1785?at.charAt(se-1536):1774<=se&&se<=2220?"r":8192<=se&&se<=8203?"w":se==8204?"b":"L"}var dt=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,mt=/[stwN]/,Ft=/[LRr]/,Ot=/[Lb1n]/,Vt=/[1n]/;function Ht(se,ze,de){this.level=se,this.from=ze,this.to=de}return function(se,ze){var de=ze=="ltr"?"L":"R";if(se.length==0||ze=="ltr"&&!dt.test(se))return!1;for(var xn=se.length,un=[],wi=0;wi<xn;++wi)un.push(ct(se.charCodeAt(wi)));for(var Li=0,ji=de;Li<xn;++Li){var lr=un[Li];lr=="m"?un[Li]=ji:ji=lr}for(var _r=0,yr=de;_r<xn;++_r){var Hr=un[_r];Hr=="1"&&yr=="r"?un[_r]="n":Ft.test(Hr)&&(yr=Hr,Hr=="r"&&(un[_r]="R"))}for(var wo=1,mr=un[0];wo<xn-1;++wo){var Go=un[wo];Go=="+"&&mr=="1"&&un[wo+1]=="1"?un[wo]="1":Go==","&&mr==un[wo+1]&&(mr=="1"||mr=="n")&&(un[wo]=mr),mr=Go}for(var ka=0;ka<xn;++ka){var fs=un[ka];if(fs==",")un[ka]="N";else if(fs=="%"){var Ra=void 0;for(Ra=ka+1;Ra<xn&&un[Ra]=="%";++Ra);for(var al=ka&&un[ka-1]=="!"||Ra<xn&&un[Ra]=="1"?"1":"N",Hs=ka;Hs<Ra;++Hs)un[Hs]=al;ka=Ra-1}}for(var as=0,ml=de;as<xn;++as){var Ts=un[as];ml=="L"&&Ts=="1"?un[as]="L":Ft.test(Ts)&&(ml=Ts)}for(var ss=0;ss<xn;++ss)if(mt.test(un[ss])){var na=void 0;for(na=ss+1;na<xn&&mt.test(un[na]);++na);for(var Ga=(ss?un[ss-1]:de)=="L",Ps=(na<xn?un[na]:de)=="L",Ds=Ga==Ps?Ga?"L":"R":de,fu=ss;fu<na;++fu)un[fu]=Ds;ss=na-1}for(var ja=[],Xl,Ya=0;Ya<xn;)if(Ot.test(un[Ya])){var _c=Ya;for(++Ya;Ya<xn&&Ot.test(un[Ya]);++Ya);ja.push(new Ht(0,_c,Ya))}else{var Tl=Ya,vl=ja.length,sl=ze=="rtl"?1:0;for(++Ya;Ya<xn&&un[Ya]!="L";++Ya);for(var ma=Tl;ma<Ya;)if(Vt.test(un[ma])){Tl<ma&&(ja.splice(vl,0,new Ht(1,Tl,ma)),vl+=sl);var ws=ma;for(++ma;ma<Ya&&Vt.test(un[ma]);++ma);ja.splice(vl,0,new Ht(2,ws,ma)),vl+=sl,Tl=ma}else++ma;Tl<Ya&&ja.splice(vl,0,new Ht(1,Tl,Ya))}return ze=="ltr"&&(ja[0].level==1&&(Xl=se.match(/^\s+/))&&(ja[0].from=Xl[0].length,ja.unshift(new Ht(0,0,Xl[0].length))),ee(ja).level==1&&(Xl=se.match(/\s+$/))&&(ee(ja).to-=Xl[0].length,ja.push(new Ht(0,xn-Xl[0].length,xn)))),ze=="rtl"?ja.reverse():ja}}();function vn(it,at){var ct=it.order;return ct==null&&(ct=it.order=Xe(it.text,at)),ct}var cn=[],hn=function(it,at,ct){if(it.addEventListener)it.addEventListener(at,ct,!1);else if(it.attachEvent)it.attachEvent("on"+at,ct);else{var dt=it._handlers||(it._handlers={});dt[at]=(dt[at]||cn).concat(ct)}};function Ti(it,at){return it._handlers&&it._handlers[at]||cn}function Ge(it,at,ct){if(it.removeEventListener)it.removeEventListener(at,ct,!1);else if(it.detachEvent)it.detachEvent("on"+at,ct);else{var dt=it._handlers,mt=dt&&dt[at];if(mt){var Ft=qe(mt,ct);Ft>-1&&(dt[at]=mt.slice(0,Ft).concat(mt.slice(Ft+1)))}}}function Je(it,at){var ct=Ti(it,at);if(ct.length)for(var dt=Array.prototype.slice.call(arguments,2),mt=0;mt<ct.length;++mt)ct[mt].apply(null,dt)}function rn(it,at,ct){return typeof at=="string"&&(at={type:at,preventDefault:function(){this.defaultPrevented=!0}}),Je(it,ct||at.type,it,at),ei(at)||at.codemirrorIgnore}function Xn(it){var at=it._handlers&&it._handlers.cursorActivity;if(at)for(var ct=it.curOp.cursorActivityHandlers||(it.curOp.cursorActivityHandlers=[]),dt=0;dt<at.length;++dt)qe(ct,at[dt])==-1&&ct.push(at[dt])}function Ln(it,at){return Ti(it,at).length>0}function nn(it){it.prototype.on=function(at,ct){hn(this,at,ct)},it.prototype.off=function(at,ct){Ge(this,at,ct)}}function Kn(it){it.preventDefault?it.preventDefault():it.returnValue=!1}function mi(it){it.stopPropagation?it.stopPropagation():it.cancelBubble=!0}function ei(it){return it.defaultPrevented!=null?it.defaultPrevented:it.returnValue==!1}function Si(it){Kn(it),mi(it)}function Wi(it){return it.target||it.srcElement}function An(it){var at=it.which;return at==null&&(it.button&1?at=1:it.button&2?at=3:it.button&4&&(at=2)),ht&&it.ctrlKey&&at==1&&(at=3),at}var gn=function(){if(ue&&It<9)return!1;var it=Gt("div");return"draggable"in it||"dragDrop"in it}(),Rn;function si(it){if(Rn==null){var at=Gt("span","\u200B");Yt(it,Gt("span",[at,document.createTextNode("x")])),it.firstChild.offsetHeight!=0&&(Rn=at.offsetWidth<=1&&at.offsetHeight>2&&!(ue&&It<8))}var ct=Rn?Gt("span","\u200B"):Gt("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return ct.setAttribute("cm-text",""),ct}var xi;function di(it){if(xi!=null)return xi;var at=Yt(it,document.createTextNode("A\u062EA")),ct=ae(at,0,1).getBoundingClientRect(),dt=ae(at,1,2).getBoundingClientRect();return Jt(it),!ct||ct.left==ct.right?!1:xi=dt.right-ct.right<3}var Oi=`
b`.split(/\n/).length!=3?function(it){for(var at=0,ct=[],dt=it.length;at<=dt;){var mt=it.indexOf(`
`,at);mt==-1&&(mt=it.length);var Ft=it.slice(at,it.charAt(mt-1)=="\r"?mt-1:mt),Ot=Ft.indexOf("\r");Ot!=-1?(ct.push(Ft.slice(0,Ot)),at+=Ot+1):(ct.push(Ft),at=mt+1)}return ct}:function(it){return it.split(/\r\n?|\n/)},wt=window.getSelection?function(it){try{return it.selectionStart!=it.selectionEnd}catch(at){return!1}}:function(it){var at;try{at=it.ownerDocument.selection.createRange()}catch(ct){}return!at||at.parentElement()!=it?!1:at.compareEndPoints("StartToEnd",at)!=0},yn=function(){var it=Gt("div");return"oncopy"in it?!0:(it.setAttribute("oncopy","return;"),typeof it.oncopy=="function")}(),Wn=null;function ki(it){if(Wn!=null)return Wn;var at=Yt(it,Gt("span","x")),ct=at.getBoundingClientRect(),dt=ae(at,0,1).getBoundingClientRect();return Wn=Math.abs(ct.left-dt.left)>1}var Ui={},ur={};function Mr(it,at){arguments.length>2&&(at.dependencies=Array.prototype.slice.call(arguments,2)),Ui[it]=at}function gi(it,at){ur[it]=at}function bn(it){if(typeof it=="string"&&ur.hasOwnProperty(it))it=ur[it];else if(it&&typeof it.name=="string"&&ur.hasOwnProperty(it.name)){var at=ur[it.name];typeof at=="string"&&(at={name:at}),it=Lt(at,it),it.name=at.name}else{if(typeof it=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(it))return bn("application/xml");if(typeof it=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(it))return bn("application/json")}return typeof it=="string"?{name:it}:it||{name:"null"}}function pe(it,at){at=bn(at);var ct=Ui[at.name];if(!ct)return pe(it,"text/plain");var dt=ct(it,at);if(Se.hasOwnProperty(at.name)){var mt=Se[at.name];for(var Ft in mt)mt.hasOwnProperty(Ft)&&(dt.hasOwnProperty(Ft)&&(dt["_"+Ft]=dt[Ft]),dt[Ft]=mt[Ft])}if(dt.name=at.name,at.helperType&&(dt.helperType=at.helperType),at.modeProps)for(var Ot in at.modeProps)dt[Ot]=at.modeProps[Ot];return dt}var Se={};function ve(it,at){var ct=Se.hasOwnProperty(it)?Se[it]:Se[it]={};Ke(at,ct)}function zn(it,at){if(at===!0)return at;if(it.copyState)return it.copyState(at);var ct={};for(var dt in at){var mt=at[dt];mt instanceof Array&&(mt=mt.concat([])),ct[dt]=mt}return ct}function kn(it,at){for(var ct;it.innerMode&&(ct=it.innerMode(at),!(!ct||ct.mode==it));)at=ct.state,it=ct.mode;return ct||{mode:it,state:at}}function Qn(it,at,ct){return it.startState?it.startState(at,ct):!0}var $e=function(it,at,ct){this.pos=this.start=0,this.string=it,this.tabSize=at||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=ct};$e.prototype.eol=function(){return this.pos>=this.string.length},$e.prototype.sol=function(){return this.pos==this.lineStart},$e.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},$e.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},$e.prototype.eat=function(it){var at=this.string.charAt(this.pos),ct;if(typeof it=="string"?ct=at==it:ct=at&&(it.test?it.test(at):it(at)),ct)return++this.pos,at},$e.prototype.eatWhile=function(it){for(var at=this.pos;this.eat(it););return this.pos>at},$e.prototype.eatSpace=function(){for(var it=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>it},$e.prototype.skipToEnd=function(){this.pos=this.string.length},$e.prototype.skipTo=function(it){var at=this.string.indexOf(it,this.pos);if(at>-1)return this.pos=at,!0},$e.prototype.backUp=function(it){this.pos-=it},$e.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=oe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?oe(this.string,this.lineStart,this.tabSize):0)},$e.prototype.indentation=function(){return oe(this.string,null,this.tabSize)-(this.lineStart?oe(this.string,this.lineStart,this.tabSize):0)},$e.prototype.match=function(it,at,ct){if(typeof it=="string"){var dt=function(Ot){return ct?Ot.toLowerCase():Ot},mt=this.string.substr(this.pos,it.length);if(dt(mt)==dt(it))return at!==!1&&(this.pos+=it.length),!0}else{var Ft=this.string.slice(this.pos).match(it);return Ft&&Ft.index>0?null:(Ft&&at!==!1&&(this.pos+=Ft[0].length),Ft)}},$e.prototype.current=function(){return this.string.slice(this.start,this.pos)},$e.prototype.hideFirstChars=function(it,at){this.lineStart+=it;try{return at()}finally{this.lineStart-=it}},$e.prototype.lookAhead=function(it){var at=this.lineOracle;return at&&at.lookAhead(it)},$e.prototype.baseToken=function(){var it=this.lineOracle;return it&&it.baseToken(this.pos)};function On(it,at){if(at-=it.first,at<0||at>=it.size)throw new Error("There is no line "+(at+it.first)+" in the document.");for(var ct=it;!ct.lines;)for(var dt=0;;++dt){var mt=ct.children[dt],Ft=mt.chunkSize();if(at<Ft){ct=mt;break}at-=Ft}return ct.lines[at]}function Fe(it,at,ct){var dt=[],mt=at.line;return it.iter(at.line,ct.line+1,function(Ft){var Ot=Ft.text;mt==ct.line&&(Ot=Ot.slice(0,ct.ch)),mt==at.line&&(Ot=Ot.slice(at.ch)),dt.push(Ot),++mt}),dt}function Pe(it,at,ct){var dt=[];return it.iter(at,ct,function(mt){dt.push(mt.text)}),dt}function Zn(it,at){var ct=at-it.height;if(ct)for(var dt=it;dt;dt=dt.parent)dt.height+=ct}function $t(it){if(it.parent==null)return null;for(var at=it.parent,ct=qe(at.lines,it),dt=at.parent;dt;at=dt,dt=dt.parent)for(var mt=0;dt.children[mt]!=at;++mt)ct+=dt.children[mt].chunkSize();return ct+at.first}function Ze(it,at){var ct=it.first;t:do{for(var dt=0;dt<it.children.length;++dt){var mt=it.children[dt],Ft=mt.height;if(at<Ft){it=mt;continue t}at-=Ft,ct+=mt.chunkSize()}return ct}while(!it.lines);for(var Ot=0;Ot<it.lines.length;++Ot){var Vt=it.lines[Ot],Ht=Vt.height;if(at<Ht)break;at-=Ht}return ct+Ot}function wn(it,at){return at>=it.first&&at<it.first+it.size}function ri(it,at){return String(it.lineNumberFormatter(at+it.firstLineNumber))}function We(it,at,ct){if(ct===void 0&&(ct=null),!(this instanceof We))return new We(it,at,ct);this.line=it,this.ch=at,this.sticky=ct}function je(it,at){return it.line-at.line||it.ch-at.ch}function Vn(it,at){return it.sticky==at.sticky&&je(it,at)==0}function ci(it){return We(it.line,it.ch)}function Mi(it,at){return je(it,at)<0?at:it}function pi(it,at){return je(it,at)<0?it:at}function oi(it,at){return Math.max(it.first,Math.min(at,it.first+it.size-1))}function hi(it,at){if(at.line<it.first)return We(it.first,0);var ct=it.first+it.size-1;return at.line>ct?We(ct,On(it,ct).text.length):Bi(at,On(it,at.line).text.length)}function Bi(it,at){var ct=it.ch;return ct==null||ct>at?We(it.line,at):ct<0?We(it.line,0):it}function _i(it,at){for(var ct=[],dt=0;dt<at.length;dt++)ct[dt]=hi(it,at[dt]);return ct}var Ki=function(it,at){this.state=it,this.lookAhead=at},en=function(it,at,ct,dt){this.state=at,this.doc=it,this.line=ct,this.maxLookAhead=dt||0,this.baseTokens=null,this.baseTokenPos=1};en.prototype.lookAhead=function(it){var at=this.doc.getLine(this.line+it);return at!=null&&it>this.maxLookAhead&&(this.maxLookAhead=it),at},en.prototype.baseToken=function(it){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=it;)this.baseTokenPos+=2;var at=this.baseTokens[this.baseTokenPos+1];return{type:at&&at.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-it}},en.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},en.fromSaved=function(it,at,ct){return at instanceof Ki?new en(it,zn(it.mode,at.state),ct,at.lookAhead):new en(it,zn(it.mode,at),ct)},en.prototype.save=function(it){var at=it!==!1?zn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Ki(at,this.maxLookAhead):at};function no(it,at,ct,dt){var mt=[it.state.modeGen],Ft={};Ar(it,at.text,it.doc.mode,ct,function(se,ze){return mt.push(se,ze)},Ft,dt);for(var Ot=ct.state,Vt=function(se){ct.baseTokens=mt;var ze=it.state.overlays[se],de=1,xn=0;ct.state=!0,Ar(it,at.text,ze.mode,ct,function(un,wi){for(var Li=de;xn<un;){var ji=mt[de];ji>un&&mt.splice(de,1,un,mt[de+1],ji),de+=2,xn=Math.min(un,ji)}if(wi)if(ze.opaque)mt.splice(Li,de-Li,un,"overlay "+wi),de=Li+2;else for(;Li<de;Li+=2){var lr=mt[Li+1];mt[Li+1]=(lr?lr+" ":"")+"overlay "+wi}},Ft),ct.state=Ot,ct.baseTokens=null,ct.baseTokenPos=1},Ht=0;Ht<it.state.overlays.length;++Ht)Vt(Ht);return{styles:mt,classes:Ft.bgClass||Ft.textClass?Ft:null}}function vr(it,at,ct){if(!at.styles||at.styles[0]!=it.state.modeGen){var dt=Xr(it,$t(at)),mt=at.text.length>it.options.maxHighlightLength&&zn(it.doc.mode,dt.state),Ft=no(it,at,dt);mt&&(dt.state=mt),at.stateAfter=dt.save(!mt),at.styles=Ft.styles,Ft.classes?at.styleClasses=Ft.classes:at.styleClasses&&(at.styleClasses=null),ct===it.doc.highlightFrontier&&(it.doc.modeFrontier=Math.max(it.doc.modeFrontier,++it.doc.highlightFrontier))}return at.styles}function Xr(it,at,ct){var dt=it.doc,mt=it.display;if(!dt.mode.startState)return new en(dt,!0,at);var Ft=Pr(it,at,ct),Ot=Ft>dt.first&&On(dt,Ft-1).stateAfter,Vt=Ot?en.fromSaved(dt,Ot,Ft):new en(dt,Qn(dt.mode),Ft);return dt.iter(Ft,at,function(Ht){He(it,Ht.text,Vt);var se=Vt.line;Ht.stateAfter=se==at-1||se%5==0||se>=mt.viewFrom&&se<mt.viewTo?Vt.save():null,Vt.nextLine()}),ct&&(dt.modeFrontier=Vt.line),Vt}function He(it,at,ct,dt){var mt=it.doc.mode,Ft=new $e(at,it.options.tabSize,ct);for(Ft.start=Ft.pos=dt||0,at==""&&Hn(mt,ct.state);!Ft.eol();)Fi(mt,Ft,ct.state),Ft.start=Ft.pos}function Hn(it,at){if(it.blankLine)return it.blankLine(at);if(it.innerMode){var ct=kn(it,at);if(ct.mode.blankLine)return ct.mode.blankLine(ct.state)}}function Fi(it,at,ct,dt){for(var mt=0;mt<10;mt++){dt&&(dt[0]=kn(it,ct).mode);var Ft=it.token(at,ct);if(at.pos>at.start)return Ft}throw new Error("Mode "+it.name+" failed to advance stream.")}var Hi=function(it,at,ct){this.start=it.start,this.end=it.pos,this.string=it.current(),this.type=at||null,this.state=ct};function Ii(it,at,ct,dt){var mt=it.doc,Ft=mt.mode,Ot;at=hi(mt,at);var Vt=On(mt,at.line),Ht=Xr(it,at.line,ct),se=new $e(Vt.text,it.options.tabSize,Ht),ze;for(dt&&(ze=[]);(dt||se.pos<at.ch)&&!se.eol();)se.start=se.pos,Ot=Fi(Ft,se,Ht.state),dt&&ze.push(new Hi(se,Ot,zn(mt.mode,Ht.state)));return dt?ze:new Hi(se,Ot,Ht.state)}function Yi(it,at){if(it)for(;;){var ct=it.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!ct)break;it=it.slice(0,ct.index)+it.slice(ct.index+ct[0].length);var dt=ct[1]?"bgClass":"textClass";at[dt]==null?at[dt]=ct[2]:new RegExp("(?:^|\\s)"+ct[2]+"(?:$|\\s)").test(at[dt])||(at[dt]+=" "+ct[2])}return it}function Ar(it,at,ct,dt,mt,Ft,Ot){var Vt=ct.flattenSpans;Vt==null&&(Vt=it.options.flattenSpans);var Ht=0,se=null,ze=new $e(at,it.options.tabSize,dt),de,xn=it.options.addModeClass&&[null];for(at==""&&Yi(Hn(ct,dt.state),Ft);!ze.eol();){if(ze.pos>it.options.maxHighlightLength?(Vt=!1,Ot&&He(it,at,dt,ze.pos),ze.pos=at.length,de=null):de=Yi(Fi(ct,ze,dt.state,xn),Ft),xn){var un=xn[0].name;un&&(de="m-"+(de?un+" "+de:un))}if(!Vt||se!=de){for(;Ht<ze.start;)Ht=Math.min(ze.start,Ht+5e3),mt(Ht,se);se=de}ze.start=ze.pos}for(;Ht<ze.pos;){var wi=Math.min(ze.pos,Ht+5e3);mt(wi,se),Ht=wi}}function Pr(it,at,ct){for(var dt,mt,Ft=it.doc,Ot=ct?-1:at-(it.doc.mode.innerMode?1e3:100),Vt=at;Vt>Ot;--Vt){if(Vt<=Ft.first)return Ft.first;var Ht=On(Ft,Vt-1),se=Ht.stateAfter;if(se&&(!ct||Vt+(se instanceof Ki?se.lookAhead:0)<=Ft.modeFrontier))return Vt;var ze=oe(Ht.text,null,it.options.tabSize);(mt==null||dt>ze)&&(mt=Vt-1,dt=ze)}return mt}function Br(it,at){if(it.modeFrontier=Math.min(it.modeFrontier,at),!(it.highlightFrontier<at-10)){for(var ct=it.first,dt=at-1;dt>ct;dt--){var mt=On(it,dt).stateAfter;if(mt&&(!(mt instanceof Ki)||dt+mt.lookAhead<at)){ct=dt+1;break}}it.highlightFrontier=Math.min(it.highlightFrontier,ct)}}var Fr=!1,fn=!1;function io(){Fr=!0}function pn(){fn=!0}function Di(it,at,ct){this.marker=it,this.from=at,this.to=ct}function $i(it,at){if(it)for(var ct=0;ct<it.length;++ct){var dt=it[ct];if(dt.marker==at)return dt}}function Ai(it,at){for(var ct,dt=0;dt<it.length;++dt)it[dt]!=at&&(ct||(ct=[])).push(it[dt]);return ct}function bo(it,at){it.markedSpans=it.markedSpans?it.markedSpans.concat([at]):[at],at.marker.attachLine(it)}function Fo(it,at,ct){var dt;if(it)for(var mt=0;mt<it.length;++mt){var Ft=it[mt],Ot=Ft.marker,Vt=Ft.from==null||(Ot.inclusiveLeft?Ft.from<=at:Ft.from<at);if(Vt||Ft.from==at&&Ot.type=="bookmark"&&(!ct||!Ft.marker.insertLeft)){var Ht=Ft.to==null||(Ot.inclusiveRight?Ft.to>=at:Ft.to>at);(dt||(dt=[])).push(new Di(Ot,Ft.from,Ht?null:Ft.to))}}return dt}function ao(it,at,ct){var dt;if(it)for(var mt=0;mt<it.length;++mt){var Ft=it[mt],Ot=Ft.marker,Vt=Ft.to==null||(Ot.inclusiveRight?Ft.to>=at:Ft.to>at);if(Vt||Ft.from==at&&Ot.type=="bookmark"&&(!ct||Ft.marker.insertLeft)){var Ht=Ft.from==null||(Ot.inclusiveLeft?Ft.from<=at:Ft.from<at);(dt||(dt=[])).push(new Di(Ot,Ht?null:Ft.from-at,Ft.to==null?null:Ft.to-at))}}return dt}function co(it,at){if(at.full)return null;var ct=wn(it,at.from.line)&&On(it,at.from.line).markedSpans,dt=wn(it,at.to.line)&&On(it,at.to.line).markedSpans;if(!ct&&!dt)return null;var mt=at.from.ch,Ft=at.to.ch,Ot=je(at.from,at.to)==0,Vt=Fo(ct,mt,Ot),Ht=ao(dt,Ft,Ot),se=at.text.length==1,ze=ee(at.text).length+(se?mt:0);if(Vt)for(var de=0;de<Vt.length;++de){var xn=Vt[de];if(xn.to==null){var un=$i(Ht,xn.marker);un?se&&(xn.to=un.to==null?null:un.to+ze):xn.to=mt}}if(Ht)for(var wi=0;wi<Ht.length;++wi){var Li=Ht[wi];if(Li.to!=null&&(Li.to+=ze),Li.from==null){var ji=$i(Vt,Li.marker);ji||(Li.from=ze,se&&(Vt||(Vt=[])).push(Li))}else Li.from+=ze,se&&(Vt||(Vt=[])).push(Li)}Vt&&(Vt=Re(Vt)),Ht&&Ht!=Vt&&(Ht=Re(Ht));var lr=[Vt];if(!se){var _r=at.text.length-2,yr;if(_r>0&&Vt)for(var Hr=0;Hr<Vt.length;++Hr)Vt[Hr].to==null&&(yr||(yr=[])).push(new Di(Vt[Hr].marker,null,null));for(var wo=0;wo<_r;++wo)lr.push(yr);lr.push(Ht)}return lr}function Re(it){for(var at=0;at<it.length;++at){var ct=it[at];ct.from!=null&&ct.from==ct.to&&ct.marker.clearWhenEmpty!==!1&&it.splice(at--,1)}return it.length?it:null}function mn(it,at,ct){var dt=null;if(it.iter(at.line,ct.line+1,function(un){if(un.markedSpans)for(var wi=0;wi<un.markedSpans.length;++wi){var Li=un.markedSpans[wi].marker;Li.readOnly&&(!dt||qe(dt,Li)==-1)&&(dt||(dt=[])).push(Li)}}),!dt)return null;for(var mt=[{from:at,to:ct}],Ft=0;Ft<dt.length;++Ft)for(var Ot=dt[Ft],Vt=Ot.find(0),Ht=0;Ht<mt.length;++Ht){var se=mt[Ht];if(!(je(se.to,Vt.from)<0||je(se.from,Vt.to)>0)){var ze=[Ht,1],de=je(se.from,Vt.from),xn=je(se.to,Vt.to);(de<0||!Ot.inclusiveLeft&&!de)&&ze.push({from:se.from,to:Vt.from}),(xn>0||!Ot.inclusiveRight&&!xn)&&ze.push({from:Vt.to,to:se.to}),mt.splice.apply(mt,ze),Ht+=ze.length-3}}return mt}function Ie(it){var at=it.markedSpans;if(at){for(var ct=0;ct<at.length;++ct)at[ct].marker.detachLine(it);it.markedSpans=null}}function At(it,at){if(at){for(var ct=0;ct<at.length;++ct)at[ct].marker.attachLine(it);it.markedSpans=at}}function Un(it){return it.inclusiveLeft?-1:0}function Nn(it){return it.inclusiveRight?1:0}function Yn(it,at){var ct=it.lines.length-at.lines.length;if(ct!=0)return ct;var dt=it.find(),mt=at.find(),Ft=je(dt.from,mt.from)||Un(it)-Un(at);if(Ft)return-Ft;var Ot=je(dt.to,mt.to)||Nn(it)-Nn(at);return Ot||at.id-it.id}function ai(it,at){var ct=fn&&it.markedSpans,dt;if(ct)for(var mt=void 0,Ft=0;Ft<ct.length;++Ft)mt=ct[Ft],mt.marker.collapsed&&(at?mt.from:mt.to)==null&&(!dt||Yn(dt,mt.marker)<0)&&(dt=mt.marker);return dt}function vi(it){return ai(it,!0)}function Cn(it){return ai(it,!1)}function $n(it,at){var ct=fn&&it.markedSpans,dt;if(ct)for(var mt=0;mt<ct.length;++mt){var Ft=ct[mt];Ft.marker.collapsed&&(Ft.from==null||Ft.from<at)&&(Ft.to==null||Ft.to>at)&&(!dt||Yn(dt,Ft.marker)<0)&&(dt=Ft.marker)}return dt}function ti(it,at,ct,dt,mt){var Ft=On(it,at),Ot=fn&&Ft.markedSpans;if(Ot)for(var Vt=0;Vt<Ot.length;++Vt){var Ht=Ot[Vt];if(Ht.marker.collapsed){var se=Ht.marker.find(0),ze=je(se.from,ct)||Un(Ht.marker)-Un(mt),de=je(se.to,dt)||Nn(Ht.marker)-Nn(mt);if(!(ze>=0&&de<=0||ze<=0&&de>=0)&&(ze<=0&&(Ht.marker.inclusiveRight&&mt.inclusiveLeft?je(se.to,ct)>=0:je(se.to,ct)>0)||ze>=0&&(Ht.marker.inclusiveRight&&mt.inclusiveLeft?je(se.from,dt)<=0:je(se.from,dt)<0)))return!0}}}function ii(it){for(var at;at=vi(it);)it=at.find(-1,!0).line;return it}function ni(it){for(var at;at=Cn(it);)it=at.find(1,!0).line;return it}function Vi(it){for(var at,ct;at=Cn(it);)it=at.find(1,!0).line,(ct||(ct=[])).push(it);return ct}function Ei(it,at){var ct=On(it,at),dt=ii(ct);return ct==dt?at:$t(dt)}function yi(it,at){if(at>it.lastLine())return at;var ct=On(it,at),dt;if(!ln(it,ct))return at;for(;dt=Cn(ct);)ct=dt.find(1,!0).line;return $t(ct)+1}function ln(it,at){var ct=fn&&at.markedSpans;if(ct){for(var dt=void 0,mt=0;mt<ct.length;++mt)if(dt=ct[mt],!!dt.marker.collapsed){if(dt.from==null)return!0;if(!dt.marker.widgetNode&&dt.from==0&&dt.marker.inclusiveLeft&&Pi(it,at,dt))return!0}}}function Pi(it,at,ct){if(ct.to==null){var dt=ct.marker.find(1,!0);return Pi(it,dt.line,$i(dt.line.markedSpans,ct.marker))}if(ct.marker.inclusiveRight&&ct.to==at.text.length)return!0;for(var mt=void 0,Ft=0;Ft<at.markedSpans.length;++Ft)if(mt=at.markedSpans[Ft],mt.marker.collapsed&&!mt.marker.widgetNode&&mt.from==ct.to&&(mt.to==null||mt.to!=ct.from)&&(mt.marker.inclusiveLeft||ct.marker.inclusiveRight)&&Pi(it,at,mt))return!0}function qi(it){it=ii(it);for(var at=0,ct=it.parent,dt=0;dt<ct.lines.length;++dt){var mt=ct.lines[dt];if(mt==it)break;at+=mt.height}for(var Ft=ct.parent;Ft;ct=Ft,Ft=ct.parent)for(var Ot=0;Ot<Ft.children.length;++Ot){var Vt=Ft.children[Ot];if(Vt==ct)break;at+=Vt.height}return at}function Tr(it){if(it.height==0)return 0;for(var at=it.text.length,ct,dt=it;ct=vi(dt);){var mt=ct.find(0,!0);dt=mt.from.line,at+=mt.from.ch-mt.to.ch}for(dt=it;ct=Cn(dt);){var Ft=ct.find(0,!0);at-=dt.text.length-Ft.from.ch,dt=Ft.to.line,at+=dt.text.length-Ft.to.ch}return at}function Lr(it){var at=it.display,ct=it.doc;at.maxLine=On(ct,ct.first),at.maxLineLength=Tr(at.maxLine),at.maxLineChanged=!0,ct.iter(function(dt){var mt=Tr(dt);mt>at.maxLineLength&&(at.maxLineLength=mt,at.maxLine=dt)})}var Rr=function(it,at,ct){this.text=it,At(this,at),this.height=ct?ct(this):1};Rr.prototype.lineNo=function(){return $t(this)},nn(Rr);function Zr(it,at,ct,dt){it.text=at,it.stateAfter&&(it.stateAfter=null),it.styles&&(it.styles=null),it.order!=null&&(it.order=null),Ie(it),At(it,ct);var mt=dt?dt(it):1;mt!=it.height&&Zn(it,mt)}function jr(it){it.parent=null,Ie(it)}var Co={},vo={};function Uo(it,at){if(!it||/^\s*$/.test(it))return null;var ct=at.addModeClass?vo:Co;return ct[it]||(ct[it]=it.replace(/\S+/g,"cm-$&"))}function Be(it,at){var ct=me("span",null,null,qt?"padding-right: .1px":null),dt={pre:me("pre",[ct],"CodeMirror-line"),content:ct,col:0,pos:0,cm:it,trailingSpace:!1,splitSpaces:it.getOption("lineWrapping")};at.measure={};for(var mt=0;mt<=(at.rest?at.rest.length:0);mt++){var Ft=mt?at.rest[mt-1]:at.line,Ot=void 0;dt.pos=0,dt.addToken=qr,di(it.display.measure)&&(Ot=vn(Ft,it.doc.direction))&&(dt.addToken=Qr(dt.addToken,Ot)),dt.map=[];var Vt=at!=it.display.externalMeasured&&$t(Ft);zo(Ft,dt,vr(it,Ft,Vt)),Ft.styleClasses&&(Ft.styleClasses.bgClass&&(dt.bgClass=tn(Ft.styleClasses.bgClass,dt.bgClass||"")),Ft.styleClasses.textClass&&(dt.textClass=tn(Ft.styleClasses.textClass,dt.textClass||""))),dt.map.length==0&&dt.map.push(0,0,dt.content.appendChild(si(it.display.measure))),mt==0?(at.measure.map=dt.map,at.measure.cache={}):((at.measure.maps||(at.measure.maps=[])).push(dt.map),(at.measure.caches||(at.measure.caches=[])).push({}))}if(qt){var Ht=dt.content.lastChild;(/\bcm-tab\b/.test(Ht.className)||Ht.querySelector&&Ht.querySelector(".cm-tab"))&&(dt.content.className="cm-tab-wrap-hack")}return Je(it,"renderLine",it,at.line,dt.pre),dt.pre.className&&(dt.textClass=tn(dt.pre.className,dt.textClass||"")),dt}function Wr(it){var at=Gt("span","\u2022","cm-invalidchar");return at.title="\\u"+it.charCodeAt(0).toString(16),at.setAttribute("aria-label",at.title),at}function qr(it,at,ct,dt,mt,Ft,Ot){if(at){var Vt=it.splitSpaces?fr(at,it.trailingSpace):at,Ht=it.cm.state.specialChars,se=!1,ze;if(!Ht.test(at))it.col+=at.length,ze=document.createTextNode(Vt),it.map.push(it.pos,it.pos+at.length,ze),ue&&It<9&&(se=!0),it.pos+=at.length;else{ze=document.createDocumentFragment();for(var de=0;;){Ht.lastIndex=de;var xn=Ht.exec(at),un=xn?xn.index-de:at.length-de;if(un){var wi=document.createTextNode(Vt.slice(de,de+un));ue&&It<9?ze.appendChild(Gt("span",[wi])):ze.appendChild(wi),it.map.push(it.pos,it.pos+un,wi),it.col+=un,it.pos+=un}if(!xn)break;de+=un+1;var Li=void 0;if(xn[0]==" "){var ji=it.cm.options.tabSize,lr=ji-it.col%ji;Li=ze.appendChild(Gt("span",Sn(lr),"cm-tab")),Li.setAttribute("role","presentation"),Li.setAttribute("cm-text"," "),it.col+=lr}else xn[0]=="\r"||xn[0]==`
`?(Li=ze.appendChild(Gt("span",xn[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Li.setAttribute("cm-text",xn[0]),it.col+=1):(Li=it.cm.options.specialCharPlaceholder(xn[0]),Li.setAttribute("cm-text",xn[0]),ue&&It<9?ze.appendChild(Gt("span",[Li])):ze.appendChild(Li),it.col+=1);it.map.push(it.pos,it.pos+1,Li),it.pos++}}if(it.trailingSpace=Vt.charCodeAt(at.length-1)==32,ct||dt||mt||se||Ft||Ot){var _r=ct||"";dt&&(_r+=dt),mt&&(_r+=mt);var yr=Gt("span",[ze],_r,Ft);if(Ot)for(var Hr in Ot)Ot.hasOwnProperty(Hr)&&Hr!="style"&&Hr!="class"&&yr.setAttribute(Hr,Ot[Hr]);return it.content.appendChild(yr)}it.content.appendChild(ze)}}function fr(it,at){if(it.length>1&&!/ /.test(it))return it;for(var ct=at,dt="",mt=0;mt<it.length;mt++){var Ft=it.charAt(mt);Ft==" "&&ct&&(mt==it.length-1||it.charCodeAt(mt+1)==32)&&(Ft="\xA0"),dt+=Ft,ct=Ft==" "}return dt}function Qr(it,at){return function(ct,dt,mt,Ft,Ot,Vt,Ht){mt=mt?mt+" cm-force-border":"cm-force-border";for(var se=ct.pos,ze=se+dt.length;;){for(var de=void 0,xn=0;xn<at.length&&(de=at[xn],!(de.to>se&&de.from<=se));xn++);if(de.to>=ze)return it(ct,dt,mt,Ft,Ot,Vt,Ht);it(ct,dt.slice(0,de.to-se),mt,Ft,null,Vt,Ht),Ft=null,dt=dt.slice(de.to-se),se=de.to}}}function hr(it,at,ct,dt){var mt=!dt&&ct.widgetNode;mt&&it.map.push(it.pos,it.pos+at,mt),!dt&&it.cm.display.input.needsContentAttribute&&(mt||(mt=it.content.appendChild(document.createElement("span"))),mt.setAttribute("cm-marker",ct.id)),mt&&(it.cm.display.input.setUneditable(mt),it.content.appendChild(mt)),it.pos+=at,it.trailingSpace=!1}function zo(it,at,ct){var dt=it.markedSpans,mt=it.text,Ft=0;if(!dt){for(var Ot=1;Ot<ct.length;Ot+=2)at.addToken(at,mt.slice(Ft,Ft=ct[Ot]),Uo(ct[Ot+1],at.cm.options));return}for(var Vt=mt.length,Ht=0,se=1,ze="",de,xn,un=0,wi,Li,ji,lr,_r;;){if(un==Ht){wi=Li=ji=xn="",_r=null,lr=null,un=1/0;for(var yr=[],Hr=void 0,wo=0;wo<dt.length;++wo){var mr=dt[wo],Go=mr.marker;if(Go.type=="bookmark"&&mr.from==Ht&&Go.widgetNode)yr.push(Go);else if(mr.from<=Ht&&(mr.to==null||mr.to>Ht||Go.collapsed&&mr.to==Ht&&mr.from==Ht)){if(mr.to!=null&&mr.to!=Ht&&un>mr.to&&(un=mr.to,Li=""),Go.className&&(wi+=" "+Go.className),Go.css&&(xn=(xn?xn+";":"")+Go.css),Go.startStyle&&mr.from==Ht&&(ji+=" "+Go.startStyle),Go.endStyle&&mr.to==un&&(Hr||(Hr=[])).push(Go.endStyle,mr.to),Go.title&&((_r||(_r={})).title=Go.title),Go.attributes)for(var ka in Go.attributes)(_r||(_r={}))[ka]=Go.attributes[ka];Go.collapsed&&(!lr||Yn(lr.marker,Go)<0)&&(lr=mr)}else mr.from>Ht&&un>mr.from&&(un=mr.from)}if(Hr)for(var fs=0;fs<Hr.length;fs+=2)Hr[fs+1]==un&&(Li+=" "+Hr[fs]);if(!lr||lr.from==Ht)for(var Ra=0;Ra<yr.length;++Ra)hr(at,0,yr[Ra]);if(lr&&(lr.from||0)==Ht){if(hr(at,(lr.to==null?Vt+1:lr.to)-Ht,lr.marker,lr.from==null),lr.to==null)return;lr.to==Ht&&(lr=!1)}}if(Ht>=Vt)break;for(var al=Math.min(Vt,un);;){if(ze){var Hs=Ht+ze.length;if(!lr){var as=Hs>al?ze.slice(0,al-Ht):ze;at.addToken(at,as,de?de+wi:wi,ji,Ht+as.length==un?Li:"",xn,_r)}if(Hs>=al){ze=ze.slice(al-Ht),Ht=al;break}Ht=Hs,ji=""}ze=mt.slice(Ft,Ft=ct[se++]),de=Uo(ct[se++],at.cm.options)}}}function Eo(it,at,ct){this.line=at,this.rest=Vi(at),this.size=this.rest?$t(ee(this.rest))-ct+1:1,this.node=this.text=null,this.hidden=ln(it,at)}function Jr(it,at,ct){for(var dt=[],mt,Ft=at;Ft<ct;Ft=mt){var Ot=new Eo(it.doc,On(it.doc,Ft),Ft);mt=Ft+Ot.size,dt.push(Ot)}return dt}var Dr=null;function za(it){Dr?Dr.ops.push(it):it.ownsGroup=Dr={ops:[it],delayedCallbacks:[]}}function aa(it){var at=it.delayedCallbacks,ct=0;do{for(;ct<at.length;ct++)at[ct].call(null);for(var dt=0;dt<it.ops.length;dt++){var mt=it.ops[dt];if(mt.cursorActivityHandlers)for(;mt.cursorActivityCalled<mt.cursorActivityHandlers.length;)mt.cursorActivityHandlers[mt.cursorActivityCalled++].call(null,mt.cm)}}while(ct<at.length)}function es(it,at){var ct=it.ownsGroup;if(ct)try{aa(ct)}finally{Dr=null,at(ct)}}var La=null;function ir(it,at){var ct=Ti(it,at);if(ct.length){var dt=Array.prototype.slice.call(arguments,2),mt;Dr?mt=Dr.delayedCallbacks:La?mt=La:(mt=La=[],setTimeout(_o,0));for(var Ft=function(Vt){mt.push(function(){return ct[Vt].apply(null,dt)})},Ot=0;Ot<ct.length;++Ot)Ft(Ot)}}function _o(){var it=La;La=null;for(var at=0;at<it.length;++at)it[at]()}function ia(it,at,ct,dt){for(var mt=0;mt<at.changes.length;mt++){var Ft=at.changes[mt];Ft=="text"?In(it,at):Ft=="gutter"?eo(it,at,ct,dt):Ft=="class"?gr(it,at):Ft=="widget"&&Vo(it,at,dt)}at.changes=null}function ca(it){return it.node==it.text&&(it.node=Gt("div",null,null,"position: relative"),it.text.parentNode&&it.text.parentNode.replaceChild(it.node,it.text),it.node.appendChild(it.text),ue&&It<8&&(it.node.style.zIndex=2)),it.node}function $r(it,at){var ct=at.bgClass?at.bgClass+" "+(at.line.bgClass||""):at.line.bgClass;if(ct&&(ct+=" CodeMirror-linebackground"),at.background)ct?at.background.className=ct:(at.background.parentNode.removeChild(at.background),at.background=null);else if(ct){var dt=ca(at);at.background=dt.insertBefore(Gt("div",null,ct),dt.firstChild),it.display.input.setUneditable(at.background)}}function Kr(it,at){var ct=it.display.externalMeasured;return ct&&ct.line==at.line?(it.display.externalMeasured=null,at.measure=ct.measure,ct.built):Be(it,at)}function In(it,at){var ct=at.text.className,dt=Kr(it,at);at.text==at.node&&(at.node=dt.pre),at.text.parentNode.replaceChild(dt.pre,at.text),at.text=dt.pre,dt.bgClass!=at.bgClass||dt.textClass!=at.textClass?(at.bgClass=dt.bgClass,at.textClass=dt.textClass,gr(it,at)):ct&&(at.text.className=ct)}function gr(it,at){$r(it,at),at.line.wrapClass?ca(at).className=at.line.wrapClass:at.node!=at.text&&(at.node.className="");var ct=at.textClass?at.textClass+" "+(at.line.textClass||""):at.line.textClass;at.text.className=ct||""}function eo(it,at,ct,dt){if(at.gutter&&(at.node.removeChild(at.gutter),at.gutter=null),at.gutterBackground&&(at.node.removeChild(at.gutterBackground),at.gutterBackground=null),at.line.gutterClass){var mt=ca(at);at.gutterBackground=Gt("div",null,"CodeMirror-gutter-background "+at.line.gutterClass,"left: "+(it.options.fixedGutter?dt.fixedPos:-dt.gutterTotalWidth)+"px; width: "+dt.gutterTotalWidth+"px"),it.display.input.setUneditable(at.gutterBackground),mt.insertBefore(at.gutterBackground,at.text)}var Ft=at.line.gutterMarkers;if(it.options.lineNumbers||Ft){var Ot=ca(at),Vt=at.gutter=Gt("div",null,"CodeMirror-gutter-wrapper","left: "+(it.options.fixedGutter?dt.fixedPos:-dt.gutterTotalWidth)+"px");if(it.display.input.setUneditable(Vt),Ot.insertBefore(Vt,at.text),at.line.gutterClass&&(Vt.className+=" "+at.line.gutterClass),it.options.lineNumbers&&(!Ft||!Ft["CodeMirror-linenumbers"])&&(at.lineNumber=Vt.appendChild(Gt("div",ri(it.options,ct),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+dt.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+it.display.lineNumInnerWidth+"px"))),Ft)for(var Ht=0;Ht<it.display.gutterSpecs.length;++Ht){var se=it.display.gutterSpecs[Ht].className,ze=Ft.hasOwnProperty(se)&&Ft[se];ze&&Vt.appendChild(Gt("div",[ze],"CodeMirror-gutter-elt","left: "+dt.gutterLeft[se]+"px; width: "+dt.gutterWidth[se]+"px"))}}}function Vo(it,at,ct){at.alignable&&(at.alignable=null);for(var dt=Tt("CodeMirror-linewidget"),mt=at.node.firstChild,Ft=void 0;mt;mt=Ft)Ft=mt.nextSibling,dt.test(mt.className)&&at.node.removeChild(mt);Ba(it,at,ct)}function Va(it,at,ct,dt){var mt=Kr(it,at);return at.text=at.node=mt.pre,mt.bgClass&&(at.bgClass=mt.bgClass),mt.textClass&&(at.textClass=mt.textClass),gr(it,at),eo(it,at,ct,dt),Ba(it,at,dt),at.node}function Ba(it,at,ct){if(Or(it,at.line,at,ct,!0),at.rest)for(var dt=0;dt<at.rest.length;dt++)Or(it,at.rest[dt],at,ct,!1)}function Or(it,at,ct,dt,mt){if(at.widgets)for(var Ft=ca(ct),Ot=0,Vt=at.widgets;Ot<Vt.length;++Ot){var Ht=Vt[Ot],se=Gt("div",[Ht.node],"CodeMirror-linewidget"+(Ht.className?" "+Ht.className:""));Ht.handleMouseEvents||se.setAttribute("cm-ignore-events","true"),fa(Ht,se,ct,dt),it.display.input.setUneditable(se),mt&&Ht.above?Ft.insertBefore(se,ct.gutter||ct.text):Ft.appendChild(se),ir(Ht,"redraw")}}function fa(it,at,ct,dt){if(it.noHScroll){(ct.alignable||(ct.alignable=[])).push(at);var mt=dt.wrapperWidth;at.style.left=dt.fixedPos+"px",it.coverGutter||(mt-=dt.gutterTotalWidth,at.style.paddingLeft=dt.gutterTotalWidth+"px"),at.style.width=mt+"px"}it.coverGutter&&(at.style.zIndex=5,at.style.position="relative",it.noHScroll||(at.style.marginLeft=-dt.gutterTotalWidth+"px"))}function Sa(it){if(it.height!=null)return it.height;var at=it.doc.cm;if(!at)return 0;if(!Ne(document.body,it.node)){var ct="position: relative;";it.coverGutter&&(ct+="margin-left: -"+at.display.gutters.offsetWidth+"px;"),it.noHScroll&&(ct+="width: "+at.display.wrapper.clientWidth+"px;"),Yt(at.display.measure,Gt("div",[it.node],null,ct))}return it.height=it.node.parentNode.offsetHeight}function Yo(it,at){for(var ct=Wi(at);ct!=it.wrapper;ct=ct.parentNode)if(!ct||ct.nodeType==1&&ct.getAttribute("cm-ignore-events")=="true"||ct.parentNode==it.sizer&&ct!=it.mover)return!0}function No(it){return it.lineSpace.offsetTop}function Ka(it){return it.mover.offsetHeight-it.lineSpace.offsetHeight}function us(it){if(it.cachedPaddingH)return it.cachedPaddingH;var at=Yt(it.measure,Gt("pre","x","CodeMirror-line-like")),ct=window.getComputedStyle?window.getComputedStyle(at):at.currentStyle,dt={left:parseInt(ct.paddingLeft),right:parseInt(ct.paddingRight)};return!isNaN(dt.left)&&!isNaN(dt.right)&&(it.cachedPaddingH=dt),dt}function Ko(it){return _n-it.display.nativeBarWidth}function hs(it){return it.display.scroller.clientWidth-Ko(it)-it.display.barWidth}function Xs(it){return it.display.scroller.clientHeight-Ko(it)-it.display.barHeight}function Ou(it,at,ct){var dt=it.options.lineWrapping,mt=dt&&hs(it);if(!at.measure.heights||dt&&at.measure.width!=mt){var Ft=at.measure.heights=[];if(dt){at.measure.width=mt;for(var Ot=at.text.firstChild.getClientRects(),Vt=0;Vt<Ot.length-1;Vt++){var Ht=Ot[Vt],se=Ot[Vt+1];Math.abs(Ht.bottom-se.bottom)>2&&Ft.push((Ht.bottom+se.top)/2-ct.top)}}Ft.push(ct.bottom-ct.top)}}function ga(it,at,ct){if(it.line==at)return{map:it.measure.map,cache:it.measure.cache};for(var dt=0;dt<it.rest.length;dt++)if(it.rest[dt]==at)return{map:it.measure.maps[dt],cache:it.measure.caches[dt]};for(var mt=0;mt<it.rest.length;mt++)if($t(it.rest[mt])>ct)return{map:it.measure.maps[mt],cache:it.measure.caches[mt],before:!0}}function Iu(it,at){at=ii(at);var ct=$t(at),dt=it.display.externalMeasured=new Eo(it.doc,at,ct);dt.lineN=ct;var mt=dt.built=Be(it,dt);return dt.text=mt.pre,Yt(it.display.lineMeasure,mt.pre),dt}function Cu(it,at,ct,dt){return js(it,Ll(it,at),ct,dt)}function Zl(it,at){if(at>=it.display.viewFrom&&at<it.display.viewTo)return it.display.view[kr(it,at)];var ct=it.display.externalMeasured;if(ct&&at>=ct.lineN&&at<ct.lineN+ct.size)return ct}function Ll(it,at){var ct=$t(at),dt=Zl(it,ct);dt&&!dt.text?dt=null:dt&&dt.changes&&(ia(it,dt,ct,Vr(it)),it.curOp.forceUpdate=!0),dt||(dt=Iu(it,at));var mt=ga(dt,at,ct);return{line:at,view:dt,rect:null,map:mt.map,cache:mt.cache,before:mt.before,hasHeights:!1}}function js(it,at,ct,dt,mt){at.before&&(ct=-1);var Ft=ct+(dt||""),Ot;return at.cache.hasOwnProperty(Ft)?Ot=at.cache[Ft]:(at.rect||(at.rect=at.view.text.getBoundingClientRect()),at.hasHeights||(Ou(it,at.view,at.rect),at.hasHeights=!0),Ot=xa(it,at,ct,dt),Ot.bogus||(at.cache[Ft]=Ot)),{left:Ot.left,right:Ot.right,top:mt?Ot.rtop:Ot.top,bottom:mt?Ot.rbottom:Ot.bottom}}var Fl={left:0,right:0,top:0,bottom:0};function ru(it,at,ct){for(var dt,mt,Ft,Ot,Vt,Ht,se=0;se<it.length;se+=3)if(Vt=it[se],Ht=it[se+1],at<Vt?(mt=0,Ft=1,Ot="left"):at<Ht?(mt=at-Vt,Ft=mt+1):(se==it.length-3||at==Ht&&it[se+3]>at)&&(Ft=Ht-Vt,mt=Ft-1,at>=Ht&&(Ot="right")),mt!=null){if(dt=it[se+2],Vt==Ht&&ct==(dt.insertLeft?"left":"right")&&(Ot=ct),ct=="left"&&mt==0)for(;se&&it[se-2]==it[se-3]&&it[se-1].insertLeft;)dt=it[(se-=3)+2],Ot="left";if(ct=="right"&&mt==Ht-Vt)for(;se<it.length-3&&it[se+3]==it[se+4]&&!it[se+5].insertLeft;)dt=it[(se+=3)+2],Ot="right";break}return{node:dt,start:mt,end:Ft,collapse:Ot,coverStart:Vt,coverEnd:Ht}}function ou(it,at){var ct=Fl;if(at=="left")for(var dt=0;dt<it.length&&(ct=it[dt]).left==ct.right;dt++);else for(var mt=it.length-1;mt>=0&&(ct=it[mt]).left==ct.right;mt--);return ct}function xa(it,at,ct,dt){var mt=ru(at.map,ct,dt),Ft=mt.node,Ot=mt.start,Vt=mt.end,Ht=mt.collapse,se;if(Ft.nodeType==3){for(var ze=0;ze<4;ze++){for(;Ot&&ye(at.line.text.charAt(mt.coverStart+Ot));)--Ot;for(;mt.coverStart+Vt<mt.coverEnd&&ye(at.line.text.charAt(mt.coverStart+Vt));)++Vt;if(ue&&It<9&&Ot==0&&Vt==mt.coverEnd-mt.coverStart?se=Ft.parentNode.getBoundingClientRect():se=ou(ae(Ft,Ot,Vt).getClientRects(),dt),se.left||se.right||Ot==0)break;Vt=Ot,Ot=Ot-1,Ht="right"}ue&&It<11&&(se=rl(it.display.measure,se))}else{Ot>0&&(Ht=dt="right");var de;it.options.lineWrapping&&(de=Ft.getClientRects()).length>1?se=de[dt=="right"?de.length-1:0]:se=Ft.getBoundingClientRect()}if(ue&&It<9&&!Ot&&(!se||!se.left&&!se.right)){var xn=Ft.parentNode.getClientRects()[0];xn?se={left:xn.left,right:xn.left+xo(it.display),top:xn.top,bottom:xn.bottom}:se=Fl}for(var un=se.top-at.rect.top,wi=se.bottom-at.rect.top,Li=(un+wi)/2,ji=at.view.measure.heights,lr=0;lr<ji.length-1&&!(Li<ji[lr]);lr++);var _r=lr?ji[lr-1]:0,yr=ji[lr],Hr={left:(Ht=="right"?se.right:se.left)-at.rect.left,right:(Ht=="left"?se.left:se.right)-at.rect.left,top:_r,bottom:yr};return!se.left&&!se.right&&(Hr.bogus=!0),it.options.singleCursorHeightPerLine||(Hr.rtop=un,Hr.rbottom=wi),Hr}function rl(it,at){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!ki(it))return at;var ct=screen.logicalXDPI/screen.deviceXDPI,dt=screen.logicalYDPI/screen.deviceYDPI;return{left:at.left*ct,right:at.right*ct,top:at.top*dt,bottom:at.bottom*dt}}function _u(it){if(it.measure&&(it.measure.cache={},it.measure.heights=null,it.rest))for(var at=0;at<it.rest.length;at++)it.measure.caches[at]={}}function au(it){it.display.externalMeasure=null,Jt(it.display.lineMeasure);for(var at=0;at<it.display.view.length;at++)_u(it.display.view[at])}function su(it){au(it),it.display.cachedCharWidth=it.display.cachedTextHeight=it.display.cachedPaddingH=null,it.options.lineWrapping||(it.display.maxLineChanged=!0),it.display.lineNumChars=null}function Xa(){return ne&&nt?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ns(){return ne&&nt?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Fa(it){var at=0;if(it.widgets)for(var ct=0;ct<it.widgets.length;++ct)it.widgets[ct].above&&(at+=Sa(it.widgets[ct]));return at}function Ma(it,at,ct,dt,mt){if(!mt){var Ft=Fa(at);ct.top+=Ft,ct.bottom+=Ft}if(dt=="line")return ct;dt||(dt="local");var Ot=qi(at);if(dt=="local"?Ot+=No(it.display):Ot-=it.display.viewOffset,dt=="page"||dt=="window"){var Vt=it.display.lineSpace.getBoundingClientRect();Ot+=Vt.top+(dt=="window"?0:ns());var Ht=Vt.left+(dt=="window"?0:Xa());ct.left+=Ht,ct.right+=Ht}return ct.top+=Ot,ct.bottom+=Ot,ct}function Lo(it,at,ct){if(ct=="div")return at;var dt=at.left,mt=at.top;if(ct=="page")dt-=Xa(),mt-=ns();else if(ct=="local"||!ct){var Ft=it.display.sizer.getBoundingClientRect();dt+=Ft.left,mt+=Ft.top}var Ot=it.display.lineSpace.getBoundingClientRect();return{left:dt-Ot.left,top:mt-Ot.top}}function ro(it,at,ct,dt,mt){return dt||(dt=On(it.doc,at.line)),Ma(it,dt,Cu(it,dt,at.ch,mt),ct)}function uo(it,at,ct,dt,mt,Ft){dt=dt||On(it.doc,at.line),mt||(mt=Ll(it,dt));function Ot(wi,Li){var ji=js(it,mt,wi,Li?"right":"left",Ft);return Li?ji.left=ji.right:ji.right=ji.left,Ma(it,dt,ji,ct)}var Vt=vn(dt,it.doc.direction),Ht=at.ch,se=at.sticky;if(Ht>=dt.text.length?(Ht=dt.text.length,se="before"):Ht<=0&&(Ht=0,se="after"),!Vt)return Ot(se=="before"?Ht-1:Ht,se=="before");function ze(wi,Li,ji){var lr=Vt[Li],_r=lr.level==1;return Ot(ji?wi-1:wi,_r!=ji)}var de=Le(Vt,Ht,se),xn=Oe,un=ze(Ht,de,se=="before");return xn!=null&&(un.other=ze(Ht,xn,se!="before")),un}function Ia(it,at){var ct=0;at=hi(it.doc,at),it.options.lineWrapping||(ct=xo(it.display)*at.ch);var dt=On(it.doc,at.line),mt=qi(dt)+No(it.display);return{left:ct,right:ct,top:mt,bottom:mt+dt.height}}function Ea(it,at,ct,dt,mt){var Ft=We(it,at,ct);return Ft.xRel=mt,dt&&(Ft.outside=dt),Ft}function xe(it,at,ct){var dt=it.doc;if(ct+=it.display.viewOffset,ct<0)return Ea(dt.first,0,null,-1,-1);var mt=Ze(dt,ct),Ft=dt.first+dt.size-1;if(mt>Ft)return Ea(dt.first+dt.size-1,On(dt,Ft).text.length,null,1,1);at<0&&(at=0);for(var Ot=On(dt,mt);;){var Vt=Ye(it,Ot,mt,at,ct),Ht=$n(Ot,Vt.ch+(Vt.xRel>0||Vt.outside>0?1:0));if(!Ht)return Vt;var se=Ht.find(1);if(se.line==mt)return se;Ot=On(dt,mt=se.line)}}function fe(it,at,ct,dt){dt-=Fa(at);var mt=at.text.length,Ft=Qe(function(Ot){return js(it,ct,Ot-1).bottom<=dt},mt,0);return mt=Qe(function(Ot){return js(it,ct,Ot).top>dt},Ft,mt),{begin:Ft,end:mt}}function Ve(it,at,ct,dt){ct||(ct=Ll(it,at));var mt=Ma(it,at,js(it,ct,dt),"line").top;return fe(it,at,ct,mt)}function Zt(it,at,ct,dt){return it.bottom<=ct?!1:it.top>ct?!0:(dt?it.left:it.right)>at}function Ye(it,at,ct,dt,mt){mt-=qi(at);var Ft=Ll(it,at),Ot=Fa(at),Vt=0,Ht=at.text.length,se=!0,ze=vn(at,it.doc.direction);if(ze){var de=(it.options.lineWrapping?oo:pr)(it,at,ct,Ft,ze,dt,mt);se=de.level!=1,Vt=se?de.from:de.to-1,Ht=se?de.to:de.from-1}var xn=null,un=null,wi=Qe(function(wo){var mr=js(it,Ft,wo);return mr.top+=Ot,mr.bottom+=Ot,Zt(mr,dt,mt,!1)?(mr.top<=mt&&mr.left<=dt&&(xn=wo,un=mr),!0):!1},Vt,Ht),Li,ji,lr=!1;if(un){var _r=dt-un.left<un.right-dt,yr=_r==se;wi=xn+(yr?0:1),ji=yr?"after":"before",Li=_r?un.left:un.right}else{!se&&(wi==Ht||wi==Vt)&&wi++,ji=wi==0?"after":wi==at.text.length?"before":js(it,Ft,wi-(se?1:0)).bottom+Ot<=mt==se?"after":"before";var Hr=uo(it,We(ct,wi,ji),"line",at,Ft);Li=Hr.left,lr=mt<Hr.top?-1:mt>=Hr.bottom?1:0}return wi=Ue(at.text,wi,1),Ea(ct,wi,ji,lr,dt-Li)}function pr(it,at,ct,dt,mt,Ft,Ot){var Vt=Qe(function(de){var xn=mt[de],un=xn.level!=1;return Zt(uo(it,We(ct,un?xn.to:xn.from,un?"before":"after"),"line",at,dt),Ft,Ot,!0)},0,mt.length-1),Ht=mt[Vt];if(Vt>0){var se=Ht.level!=1,ze=uo(it,We(ct,se?Ht.from:Ht.to,se?"after":"before"),"line",at,dt);Zt(ze,Ft,Ot,!0)&&ze.top>Ot&&(Ht=mt[Vt-1])}return Ht}function oo(it,at,ct,dt,mt,Ft,Ot){var Vt=fe(it,at,dt,Ot),Ht=Vt.begin,se=Vt.end;/\s/.test(at.text.charAt(se-1))&&se--;for(var ze=null,de=null,xn=0;xn<mt.length;xn++){var un=mt[xn];if(!(un.from>=se||un.to<=Ht)){var wi=un.level!=1,Li=js(it,dt,wi?Math.min(se,un.to)-1:Math.max(Ht,un.from)).right,ji=Li<Ft?Ft-Li+1e9:Li-Ft;(!ze||de>ji)&&(ze=un,de=ji)}}return ze||(ze=mt[mt.length-1]),ze.from<Ht&&(ze={from:Ht,to:ze.to,level:ze.level}),ze.to>se&&(ze={from:ze.from,to:se,level:ze.level}),ze}var rr;function Sr(it){if(it.cachedTextHeight!=null)return it.cachedTextHeight;if(rr==null){rr=Gt("pre",null,"CodeMirror-line-like");for(var at=0;at<49;++at)rr.appendChild(document.createTextNode("x")),rr.appendChild(Gt("br"));rr.appendChild(document.createTextNode("x"))}Yt(it.measure,rr);var ct=rr.offsetHeight/50;return ct>3&&(it.cachedTextHeight=ct),Jt(it.measure),ct||1}function xo(it){if(it.cachedCharWidth!=null)return it.cachedCharWidth;var at=Gt("span","xxxxxxxxxx"),ct=Gt("pre",[at],"CodeMirror-line-like");Yt(it.measure,ct);var dt=at.getBoundingClientRect(),mt=(dt.right-dt.left)/10;return mt>2&&(it.cachedCharWidth=mt),mt||10}function Vr(it){for(var at=it.display,ct={},dt={},mt=at.gutters.clientLeft,Ft=at.gutters.firstChild,Ot=0;Ft;Ft=Ft.nextSibling,++Ot){var Vt=it.display.gutterSpecs[Ot].className;ct[Vt]=Ft.offsetLeft+Ft.clientLeft+mt,dt[Vt]=Ft.clientWidth}return{fixedPos:Po(at),gutterTotalWidth:at.gutters.offsetWidth,gutterLeft:ct,gutterWidth:dt,wrapperWidth:at.wrapper.clientWidth}}function Po(it){return it.scroller.getBoundingClientRect().left-it.sizer.getBoundingClientRect().left}function Ur(it){var at=Sr(it.display),ct=it.options.lineWrapping,dt=ct&&Math.max(5,it.display.scroller.clientWidth/xo(it.display)-3);return function(mt){if(ln(it.doc,mt))return 0;var Ft=0;if(mt.widgets)for(var Ot=0;Ot<mt.widgets.length;Ot++)mt.widgets[Ot].height&&(Ft+=mt.widgets[Ot].height);return ct?Ft+(Math.ceil(mt.text.length/dt)||1)*at:Ft+at}}function Ri(it){var at=it.doc,ct=Ur(it);at.iter(function(dt){var mt=ct(dt);mt!=dt.height&&Zn(dt,mt)})}function Gi(it,at,ct,dt){var mt=it.display;if(!ct&&Wi(at).getAttribute("cm-not-content")=="true")return null;var Ft,Ot,Vt=mt.lineSpace.getBoundingClientRect();try{Ft=at.clientX-Vt.left,Ot=at.clientY-Vt.top}catch(de){return null}var Ht=xe(it,Ft,Ot),se;if(dt&&Ht.xRel>0&&(se=On(it.doc,Ht.line).text).length==Ht.ch){var ze=oe(se,se.length,it.options.tabSize)-se.length;Ht=We(Ht.line,Math.max(0,Math.round((Ft-us(it.display).left)/xo(it.display))-ze))}return Ht}function kr(it,at){if(at>=it.display.viewTo||(at-=it.display.viewFrom,at<0))return null;for(var ct=it.display.view,dt=0;dt<ct.length;dt++)if(at-=ct[dt].size,at<0)return dt}function wr(it,at,ct,dt){at==null&&(at=it.doc.first),ct==null&&(ct=it.doc.first+it.doc.size),dt||(dt=0);var mt=it.display;if(dt&&ct<mt.viewTo&&(mt.updateLineNumbers==null||mt.updateLineNumbers>at)&&(mt.updateLineNumbers=at),it.curOp.viewChanged=!0,at>=mt.viewTo)fn&&Ei(it.doc,at)<mt.viewTo&&ar(it);else if(ct<=mt.viewFrom)fn&&yi(it.doc,ct+dt)>mt.viewFrom?ar(it):(mt.viewFrom+=dt,mt.viewTo+=dt);else if(at<=mt.viewFrom&&ct>=mt.viewTo)ar(it);else if(at<=mt.viewFrom){var Ft=so(it,ct,ct+dt,1);Ft?(mt.view=mt.view.slice(Ft.index),mt.viewFrom=Ft.lineN,mt.viewTo+=dt):ar(it)}else if(ct>=mt.viewTo){var Ot=so(it,at,at,-1);Ot?(mt.view=mt.view.slice(0,Ot.index),mt.viewTo=Ot.lineN):ar(it)}else{var Vt=so(it,at,at,-1),Ht=so(it,ct,ct+dt,1);Vt&&Ht?(mt.view=mt.view.slice(0,Vt.index).concat(Jr(it,Vt.lineN,Ht.lineN)).concat(mt.view.slice(Ht.index)),mt.viewTo+=dt):ar(it)}var se=mt.externalMeasured;se&&(ct<se.lineN?se.lineN+=dt:at<se.lineN+se.size&&(mt.externalMeasured=null))}function Qi(it,at,ct){it.curOp.viewChanged=!0;var dt=it.display,mt=it.display.externalMeasured;if(mt&&at>=mt.lineN&&at<mt.lineN+mt.size&&(dt.externalMeasured=null),!(at<dt.viewFrom||at>=dt.viewTo)){var Ft=dt.view[kr(it,at)];if(Ft.node!=null){var Ot=Ft.changes||(Ft.changes=[]);qe(Ot,ct)==-1&&Ot.push(ct)}}}function ar(it){it.display.viewFrom=it.display.viewTo=it.doc.first,it.display.view=[],it.display.viewOffset=0}function so(it,at,ct,dt){var mt=kr(it,at),Ft,Ot=it.display.view;if(!fn||ct==it.doc.first+it.doc.size)return{index:mt,lineN:ct};for(var Vt=it.display.viewFrom,Ht=0;Ht<mt;Ht++)Vt+=Ot[Ht].size;if(Vt!=at){if(dt>0){if(mt==Ot.length-1)return null;Ft=Vt+Ot[mt].size-at,mt++}else Ft=Vt-at;at+=Ft,ct+=Ft}for(;Ei(it.doc,ct)!=ct;){if(mt==(dt<0?0:Ot.length-1))return null;ct+=dt*Ot[mt-(dt<0?1:0)].size,mt+=dt}return{index:mt,lineN:ct}}function xr(it,at,ct){var dt=it.display,mt=dt.view;mt.length==0||at>=dt.viewTo||ct<=dt.viewFrom?(dt.view=Jr(it,at,ct),dt.viewFrom=at):(dt.viewFrom>at?dt.view=Jr(it,at,dt.viewFrom).concat(dt.view):dt.viewFrom<at&&(dt.view=dt.view.slice(kr(it,at))),dt.viewFrom=at,dt.viewTo<ct?dt.view=dt.view.concat(Jr(it,dt.viewTo,ct)):dt.viewTo>ct&&(dt.view=dt.view.slice(0,kr(it,ct)))),dt.viewTo=ct}function Ji(it){for(var at=it.display.view,ct=0,dt=0;dt<at.length;dt++){var mt=at[dt];!mt.hidden&&(!mt.node||mt.changes)&&++ct}return ct}function er(it){it.display.input.showSelection(it.display.input.prepareSelection())}function tr(it,at){at===void 0&&(at=!0);for(var ct=it.doc,dt={},mt=dt.cursors=document.createDocumentFragment(),Ft=dt.selection=document.createDocumentFragment(),Ot=0;Ot<ct.sel.ranges.length;Ot++)if(!(!at&&Ot==ct.sel.primIndex)){var Vt=ct.sel.ranges[Ot];if(!(Vt.from().line>=it.display.viewTo||Vt.to().line<it.display.viewFrom)){var Ht=Vt.empty();(Ht||it.options.showCursorWhenSelecting)&&bi(it,Vt.head,mt),Ht||Ir(it,Vt,Ft)}}return dt}function bi(it,at,ct){var dt=uo(it,at,"div",null,null,!it.options.singleCursorHeightPerLine),mt=ct.appendChild(Gt("div","\xA0","CodeMirror-cursor"));if(mt.style.left=dt.left+"px",mt.style.top=dt.top+"px",mt.style.height=Math.max(0,dt.bottom-dt.top)*it.options.cursorHeight+"px",dt.other){var Ft=ct.appendChild(Gt("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));Ft.style.display="",Ft.style.left=dt.other.left+"px",Ft.style.top=dt.other.top+"px",Ft.style.height=(dt.other.bottom-dt.other.top)*.85+"px"}}function ho(it,at){return it.top-at.top||it.left-at.left}function Ir(it,at,ct){var dt=it.display,mt=it.doc,Ft=document.createDocumentFragment(),Ot=us(it.display),Vt=Ot.left,Ht=Math.max(dt.sizerWidth,hs(it)-dt.sizer.offsetLeft)-Ot.right,se=mt.direction=="ltr";function ze(yr,Hr,wo,mr){Hr<0&&(Hr=0),Hr=Math.round(Hr),mr=Math.round(mr),Ft.appendChild(Gt("div",null,"CodeMirror-selected","position: absolute; left: "+yr+`px;
top: `+Hr+"px; width: "+(wo==null?Ht-yr:wo)+`px;
height: `+(mr-Hr)+"px"))}function de(yr,Hr,wo){var mr=On(mt,yr),Go=mr.text.length,ka,fs;function Ra(as,ml){return ro(it,We(yr,as),"div",mr,ml)}function al(as,ml,Ts){var ss=Ve(it,mr,null,as),na=ml=="ltr"==(Ts=="after")?"left":"right",Ga=Ts=="after"?ss.begin:ss.end-(/\s/.test(mr.text.charAt(ss.end-1))?2:1);return Ra(Ga,na)[na]}var Hs=vn(mr,mt.direction);return ce(Hs,Hr||0,wo==null?Go:wo,function(as,ml,Ts,ss){var na=Ts=="ltr",Ga=Ra(as,na?"left":"right"),Ps=Ra(ml-1,na?"right":"left"),Ds=Hr==null&&as==0,fu=wo==null&&ml==Go,ja=ss==0,Xl=!Hs||ss==Hs.length-1;if(Ps.top-Ga.top<=3){var Ya=(se?Ds:fu)&&ja,_c=(se?fu:Ds)&&Xl,Tl=Ya?Vt:(na?Ga:Ps).left,vl=_c?Ht:(na?Ps:Ga).right;ze(Tl,Ga.top,vl-Tl,Ga.bottom)}else{var sl,ma,ws,Gu;na?(sl=se&&Ds&&ja?Vt:Ga.left,ma=se?Ht:al(as,Ts,"before"),ws=se?Vt:al(ml,Ts,"after"),Gu=se&&fu&&Xl?Ht:Ps.right):(sl=se?al(as,Ts,"before"):Vt,ma=!se&&Ds&&ja?Ht:Ga.right,ws=!se&&fu&&Xl?Vt:Ps.left,Gu=se?al(ml,Ts,"after"):Ht),ze(sl,Ga.top,ma-sl,Ga.bottom),Ga.bottom<Ps.top&&ze(Vt,Ga.bottom,null,Ps.top),ze(ws,Ps.top,Gu-ws,Ps.bottom)}(!ka||ho(Ga,ka)<0)&&(ka=Ga),ho(Ps,ka)<0&&(ka=Ps),(!fs||ho(Ga,fs)<0)&&(fs=Ga),ho(Ps,fs)<0&&(fs=Ps)}),{start:ka,end:fs}}var xn=at.from(),un=at.to();if(xn.line==un.line)de(xn.line,xn.ch,un.ch);else{var wi=On(mt,xn.line),Li=On(mt,un.line),ji=ii(wi)==ii(Li),lr=de(xn.line,xn.ch,ji?wi.text.length+1:null).end,_r=de(un.line,ji?0:null,un.ch).start;ji&&(lr.top<_r.top-2?(ze(lr.right,lr.top,null,lr.bottom),ze(Vt,_r.top,_r.left,_r.bottom)):ze(lr.right,lr.top,_r.left-lr.right,lr.bottom)),lr.bottom<_r.top&&ze(Vt,lr.bottom,null,_r.top)}ct.appendChild(Ft)}function fo(it){if(it.state.focused){var at=it.display;clearInterval(at.blinker);var ct=!0;at.cursorDiv.style.visibility="",it.options.cursorBlinkRate>0?at.blinker=setInterval(function(){it.hasFocus()||Za(it),at.cursorDiv.style.visibility=(ct=!ct)?"":"hidden"},it.options.cursorBlinkRate):it.options.cursorBlinkRate<0&&(at.cursorDiv.style.visibility="hidden")}}function Mo(it){it.state.focused||(it.display.input.focus(),po(it))}function dr(it){it.state.delayingBlurEvent=!0,setTimeout(function(){it.state.delayingBlurEvent&&(it.state.delayingBlurEvent=!1,Za(it))},100)}function po(it,at){it.state.delayingBlurEvent&&(it.state.delayingBlurEvent=!1),it.options.readOnly!="nocursor"&&(it.state.focused||(Je(it,"focus",it,at),it.state.focused=!0,we(it.display.wrapper,"CodeMirror-focused"),!it.curOp&&it.display.selForContextMenu!=it.doc.sel&&(it.display.input.reset(),qt&&setTimeout(function(){return it.display.input.reset(!0)},20)),it.display.input.receivedFocus()),fo(it))}function Za(it,at){it.state.delayingBlurEvent||(it.state.focused&&(Je(it,"blur",it,at),it.state.focused=!1,Dt(it.display.wrapper,"CodeMirror-focused")),clearInterval(it.display.blinker),setTimeout(function(){it.state.focused||(it.display.shift=!1)},150))}function zi(it){for(var at=it.display,ct=at.lineDiv.offsetTop,dt=0;dt<at.view.length;dt++){var mt=at.view[dt],Ft=it.options.lineWrapping,Ot=void 0,Vt=0;if(!mt.hidden){if(ue&&It<8){var Ht=mt.node.offsetTop+mt.node.offsetHeight;Ot=Ht-ct,ct=Ht}else{var se=mt.node.getBoundingClientRect();Ot=se.bottom-se.top,!Ft&&mt.text.firstChild&&(Vt=mt.text.firstChild.getBoundingClientRect().right-se.left-1)}var ze=mt.line.height-Ot;if((ze>.005||ze<-.005)&&(Zn(mt.line,Ot),ta(mt.line),mt.rest))for(var de=0;de<mt.rest.length;de++)ta(mt.rest[de]);if(Vt>it.display.sizerWidth){var xn=Math.ceil(Vt/xo(it.display));xn>it.display.maxLineLength&&(it.display.maxLineLength=xn,it.display.maxLine=mt.line,it.display.maxLineChanged=!0)}}}}function ta(it){if(it.widgets)for(var at=0;at<it.widgets.length;++at){var ct=it.widgets[at],dt=ct.node.parentNode;dt&&(ct.height=dt.offsetHeight)}}function Nr(it,at,ct){var dt=ct&&ct.top!=null?Math.max(0,ct.top):it.scroller.scrollTop;dt=Math.floor(dt-No(it));var mt=ct&&ct.bottom!=null?ct.bottom:dt+it.wrapper.clientHeight,Ft=Ze(at,dt),Ot=Ze(at,mt);if(ct&&ct.ensure){var Vt=ct.ensure.from.line,Ht=ct.ensure.to.line;Vt<Ft?(Ft=Vt,Ot=Ze(at,qi(On(at,Vt))+it.wrapper.clientHeight)):Math.min(Ht,at.lastLine())>=Ot&&(Ft=Ze(at,qi(On(at,Ht))-it.wrapper.clientHeight),Ot=Ht)}return{from:Ft,to:Math.max(Ot,Ft+1)}}function ra(it,at){if(!rn(it,"scrollCursorIntoView")){var ct=it.display,dt=ct.sizer.getBoundingClientRect(),mt=null;if(at.top+dt.top<0?mt=!0:at.bottom+dt.top>(window.innerHeight||document.documentElement.clientHeight)&&(mt=!1),mt!=null&&!Ee){var Ft=Gt("div","\u200B",null,`position: absolute;
top: `+(at.top-ct.viewOffset-No(it.display))+`px;
height: `+(at.bottom-at.top+Ko(it)+ct.barHeight)+`px;
left: `+at.left+"px; width: "+Math.max(2,at.right-at.left)+"px;");it.display.lineSpace.appendChild(Ft),Ft.scrollIntoView(mt),it.display.lineSpace.removeChild(Ft)}}}function Aa(it,at,ct,dt){dt==null&&(dt=0);var mt;!it.options.lineWrapping&&at==ct&&(at=at.ch?We(at.line,at.sticky=="before"?at.ch-1:at.ch,"after"):at,ct=at.sticky=="before"?We(at.line,at.ch+1,"before"):at);for(var Ft=0;Ft<5;Ft++){var Ot=!1,Vt=uo(it,at),Ht=!ct||ct==at?Vt:uo(it,ct);mt={left:Math.min(Vt.left,Ht.left),top:Math.min(Vt.top,Ht.top)-dt,right:Math.max(Vt.left,Ht.left),bottom:Math.max(Vt.bottom,Ht.bottom)+dt};var se=lu(it,mt),ze=it.doc.scrollTop,de=it.doc.scrollLeft;if(se.scrollTop!=null&&(Gl(it,se.scrollTop),Math.abs(it.doc.scrollTop-ze)>1&&(Ot=!0)),se.scrollLeft!=null&&(Hl(it,se.scrollLeft),Math.abs(it.doc.scrollLeft-de)>1&&(Ot=!0)),!Ot)break}return mt}function cl(it,at){var ct=lu(it,at);ct.scrollTop!=null&&Gl(it,ct.scrollTop),ct.scrollLeft!=null&&Hl(it,ct.scrollLeft)}function lu(it,at){var ct=it.display,dt=Sr(it.display);at.top<0&&(at.top=0);var mt=it.curOp&&it.curOp.scrollTop!=null?it.curOp.scrollTop:ct.scroller.scrollTop,Ft=Xs(it),Ot={};at.bottom-at.top>Ft&&(at.bottom=at.top+Ft);var Vt=it.doc.height+Ka(ct),Ht=at.top<dt,se=at.bottom>Vt-dt;if(at.top<mt)Ot.scrollTop=Ht?0:at.top;else if(at.bottom>mt+Ft){var ze=Math.min(at.top,(se?Vt:at.bottom)-Ft);ze!=mt&&(Ot.scrollTop=ze)}var de=it.options.fixedGutter?0:ct.gutters.offsetWidth,xn=it.curOp&&it.curOp.scrollLeft!=null?it.curOp.scrollLeft:ct.scroller.scrollLeft-de,un=hs(it)-ct.gutters.offsetWidth,wi=at.right-at.left>un;return wi&&(at.right=at.left+un),at.left<10?Ot.scrollLeft=0:at.left<xn?Ot.scrollLeft=Math.max(0,at.left+de-(wi?0:10)):at.right>un+xn-3&&(Ot.scrollLeft=at.right+(wi?0:10)-un),Ot}function uu(it,at){at!=null&&(ds(it),it.curOp.scrollTop=(it.curOp.scrollTop==null?it.doc.scrollTop:it.curOp.scrollTop)+at)}function zs(it){ds(it);var at=it.getCursor();it.curOp.scrollToPos={from:at,to:at,margin:it.options.cursorScrollMargin}}function Ml(it,at,ct){(at!=null||ct!=null)&&ds(it),at!=null&&(it.curOp.scrollLeft=at),ct!=null&&(it.curOp.scrollTop=ct)}function Ro(it,at){ds(it),it.curOp.scrollToPos=at}function ds(it){var at=it.curOp.scrollToPos;if(at){it.curOp.scrollToPos=null;var ct=Ia(it,at.from),dt=Ia(it,at.to);hu(it,ct,dt,at.margin)}}function hu(it,at,ct,dt){var mt=lu(it,{left:Math.min(at.left,ct.left),top:Math.min(at.top,ct.top)-dt,right:Math.max(at.right,ct.right),bottom:Math.max(at.bottom,ct.bottom)+dt});Ml(it,mt.scrollLeft,mt.scrollTop)}function Gl(it,at){Math.abs(it.doc.scrollTop-at)<2||(pt||Zs(it,{top:at}),Ph(it,at,!0),pt&&Zs(it),du(it,100))}function Ph(it,at,ct){at=Math.max(0,Math.min(it.display.scroller.scrollHeight-it.display.scroller.clientHeight,at)),!(it.display.scroller.scrollTop==at&&!ct)&&(it.doc.scrollTop=at,it.display.scrollbars.setScrollTop(at),it.display.scroller.scrollTop!=at&&(it.display.scroller.scrollTop=at))}function Hl(it,at,ct,dt){at=Math.max(0,Math.min(at,it.display.scroller.scrollWidth-it.display.scroller.clientWidth)),!((ct?at==it.doc.scrollLeft:Math.abs(it.doc.scrollLeft-at)<2)&&!dt)&&(it.doc.scrollLeft=at,sf(it),it.display.scroller.scrollLeft!=at&&(it.display.scroller.scrollLeft=at),it.display.scrollbars.setScrollLeft(at))}function ko(it){var at=it.display,ct=at.gutters.offsetWidth,dt=Math.round(it.doc.height+Ka(it.display));return{clientHeight:at.scroller.clientHeight,viewHeight:at.wrapper.clientHeight,scrollWidth:at.scroller.scrollWidth,clientWidth:at.scroller.clientWidth,viewWidth:at.wrapper.clientWidth,barLeft:it.options.fixedGutter?ct:0,docHeight:dt,scrollHeight:dt+Ko(it)+at.barHeight,nativeBarWidth:at.nativeBarWidth,gutterWidth:ct}}var Oo=function(it,at,ct){this.cm=ct;var dt=this.vert=Gt("div",[Gt("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),mt=this.horiz=Gt("div",[Gt("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");dt.tabIndex=mt.tabIndex=-1,it(dt),it(mt),hn(dt,"scroll",function(){dt.clientHeight&&at(dt.scrollTop,"vertical")}),hn(mt,"scroll",function(){mt.clientWidth&&at(mt.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,ue&&It<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Oo.prototype.update=function(it){var at=it.scrollWidth>it.clientWidth+1,ct=it.scrollHeight>it.clientHeight+1,dt=it.nativeBarWidth;if(ct){this.vert.style.display="block",this.vert.style.bottom=at?dt+"px":"0";var mt=it.viewHeight-(at?dt:0);this.vert.firstChild.style.height=Math.max(0,it.scrollHeight-it.clientHeight+mt)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(at){this.horiz.style.display="block",this.horiz.style.right=ct?dt+"px":"0",this.horiz.style.left=it.barLeft+"px";var Ft=it.viewWidth-it.barLeft-(ct?dt:0);this.horiz.firstChild.style.width=Math.max(0,it.scrollWidth-it.clientWidth+Ft)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&it.clientHeight>0&&(dt==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:ct?dt:0,bottom:at?dt:0}},Oo.prototype.setScrollLeft=function(it){this.horiz.scrollLeft!=it&&(this.horiz.scrollLeft=it),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Oo.prototype.setScrollTop=function(it){this.vert.scrollTop!=it&&(this.vert.scrollTop=it),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Oo.prototype.zeroWidthHack=function(){var it=ht&&!ie?"12px":"18px";this.horiz.style.height=this.vert.style.width=it,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Xt,this.disableVert=new Xt},Oo.prototype.enableZeroWidthBar=function(it,at,ct){it.style.pointerEvents="auto";function dt(){var mt=it.getBoundingClientRect(),Ft=ct=="vert"?document.elementFromPoint(mt.right-1,(mt.top+mt.bottom)/2):document.elementFromPoint((mt.right+mt.left)/2,mt.bottom-1);Ft!=it?it.style.pointerEvents="none":at.set(1e3,dt)}at.set(1e3,dt)},Oo.prototype.clear=function(){var it=this.horiz.parentNode;it.removeChild(this.horiz),it.removeChild(this.vert)};var Pa=function(){};Pa.prototype.update=function(){return{bottom:0,right:0}},Pa.prototype.setScrollLeft=function(){},Pa.prototype.setScrollTop=function(){},Pa.prototype.clear=function(){};function is(it,at){at||(at=ko(it));var ct=it.display.barWidth,dt=it.display.barHeight;Ja(it,at);for(var mt=0;mt<4&&ct!=it.display.barWidth||dt!=it.display.barHeight;mt++)ct!=it.display.barWidth&&it.options.lineWrapping&&zi(it),Ja(it,ko(it)),ct=it.display.barWidth,dt=it.display.barHeight}function Ja(it,at){var ct=it.display,dt=ct.scrollbars.update(at);ct.sizer.style.paddingRight=(ct.barWidth=dt.right)+"px",ct.sizer.style.paddingBottom=(ct.barHeight=dt.bottom)+"px",ct.heightForcer.style.borderBottom=dt.bottom+"px solid transparent",dt.right&&dt.bottom?(ct.scrollbarFiller.style.display="block",ct.scrollbarFiller.style.height=dt.bottom+"px",ct.scrollbarFiller.style.width=dt.right+"px"):ct.scrollbarFiller.style.display="",dt.bottom&&it.options.coverGutterNextToScrollbar&&it.options.fixedGutter?(ct.gutterFiller.style.display="block",ct.gutterFiller.style.height=dt.bottom+"px",ct.gutterFiller.style.width=at.gutterWidth+"px"):ct.gutterFiller.style.display=""}var Wl={native:Oo,null:Pa};function kl(it){it.display.scrollbars&&(it.display.scrollbars.clear(),it.display.scrollbars.addClass&&Dt(it.display.wrapper,it.display.scrollbars.addClass)),it.display.scrollbars=new Wl[it.options.scrollbarStyle](function(at){it.display.wrapper.insertBefore(at,it.display.scrollbarFiller),hn(at,"mousedown",function(){it.state.focused&&setTimeout(function(){return it.display.input.focus()},0)}),at.setAttribute("cm-not-content","true")},function(at,ct){ct=="horizontal"?Hl(it,at):Gl(it,at)},it),it.display.scrollbars.addClass&&we(it.display.wrapper,it.display.scrollbars.addClass)}var Vl=0;function Fn(it){it.curOp={cm:it,viewChanged:!1,startHeight:it.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Vl},za(it.curOp)}function sr(it){var at=it.curOp;at&&es(at,function(ct){for(var dt=0;dt<ct.ops.length;dt++)ct.ops[dt].cm.curOp=null;jo(ct)})}function jo(it){for(var at=it.ops,ct=0;ct<at.length;ct++)Gr(at[ct]);for(var dt=0;dt<at.length;dt++)Zi(at[dt]);for(var mt=0;mt<at.length;mt++)Jo(at[mt]);for(var Ft=0;Ft<at.length;Ft++)lo(at[Ft]);for(var Ot=0;Ot<at.length;Ot++)ea(at[Ot])}function Gr(it){var at=it.cm,ct=at.display;bl(at),it.updateMaxLine&&Lr(at),it.mustUpdate=it.viewChanged||it.forceUpdate||it.scrollTop!=null||it.scrollToPos&&(it.scrollToPos.from.line<ct.viewFrom||it.scrollToPos.to.line>=ct.viewTo)||ct.maxLineChanged&&at.options.lineWrapping,it.update=it.mustUpdate&&new vs(at,it.mustUpdate&&{top:it.scrollTop,ensure:it.scrollToPos},it.forceUpdate)}function Zi(it){it.updatedDisplay=it.mustUpdate&&nh(it.cm,it.update)}function Jo(it){var at=it.cm,ct=at.display;it.updatedDisplay&&zi(at),it.barMeasure=ko(at),ct.maxLineChanged&&!at.options.lineWrapping&&(it.adjustWidthTo=Cu(at,ct.maxLine,ct.maxLine.text.length).left+3,at.display.sizerWidth=it.adjustWidthTo,it.barMeasure.scrollWidth=Math.max(ct.scroller.clientWidth,ct.sizer.offsetLeft+it.adjustWidthTo+Ko(at)+at.display.barWidth),it.maxScrollLeft=Math.max(0,ct.sizer.offsetLeft+it.adjustWidthTo-hs(at))),(it.updatedDisplay||it.selectionChanged)&&(it.preparedSelection=ct.input.prepareSelection())}function lo(it){var at=it.cm;it.adjustWidthTo!=null&&(at.display.sizer.style.minWidth=it.adjustWidthTo+"px",it.maxScrollLeft<at.doc.scrollLeft&&Hl(at,Math.min(at.display.scroller.scrollLeft,it.maxScrollLeft),!0),at.display.maxLineChanged=!1);var ct=it.focus&&it.focus==Ce();it.preparedSelection&&at.display.input.showSelection(it.preparedSelection,ct),(it.updatedDisplay||it.startHeight!=at.doc.height)&&is(at,it.barMeasure),it.updatedDisplay&&Ch(at,it.barMeasure),it.selectionChanged&&fo(at),at.state.focused&&it.updateInput&&at.display.input.reset(it.typing),ct&&Mo(it.cm)}function ea(it){var at=it.cm,ct=at.display,dt=at.doc;if(it.updatedDisplay&&$o(at,it.update),ct.wheelStartX!=null&&(it.scrollTop!=null||it.scrollLeft!=null||it.scrollToPos)&&(ct.wheelStartX=ct.wheelStartY=null),it.scrollTop!=null&&Ph(at,it.scrollTop,it.forceScroll),it.scrollLeft!=null&&Hl(at,it.scrollLeft,!0,!0),it.scrollToPos){var mt=Aa(at,hi(dt,it.scrollToPos.from),hi(dt,it.scrollToPos.to),it.scrollToPos.margin);ra(at,mt)}var Ft=it.maybeHiddenMarkers,Ot=it.maybeUnhiddenMarkers;if(Ft)for(var Vt=0;Vt<Ft.length;++Vt)Ft[Vt].lines.length||Je(Ft[Vt],"hide");if(Ot)for(var Ht=0;Ht<Ot.length;++Ht)Ot[Ht].lines.length&&Je(Ot[Ht],"unhide");ct.wrapper.offsetHeight&&(dt.scrollTop=at.display.scroller.scrollTop),it.changeObjs&&Je(at,"changes",at,it.changeObjs),it.update&&it.update.finish()}function Cr(it,at){if(it.curOp)return at();Fn(it);try{return at()}finally{sr(it)}}function Qo(it,at){return function(){if(it.curOp)return at.apply(it,arguments);Fn(it);try{return at.apply(it,arguments)}finally{sr(it)}}}function Bo(it){return function(){if(this.curOp)return it.apply(this,arguments);Fn(this);try{return it.apply(this,arguments)}finally{sr(this)}}}function Ta(it){return function(){var at=this.cm;if(!at||at.curOp)return it.apply(this,arguments);Fn(at);try{return it.apply(this,arguments)}finally{sr(at)}}}function du(it,at){it.doc.highlightFrontier<it.display.viewTo&&it.state.highlight.set(at,an(Er,it))}function Er(it){var at=it.doc;if(!(at.highlightFrontier>=it.display.viewTo)){var ct=+new Date+it.options.workTime,dt=Xr(it,at.highlightFrontier),mt=[];at.iter(dt.line,Math.min(at.first+at.size,it.display.viewTo+500),function(Ft){if(dt.line>=it.display.viewFrom){var Ot=Ft.styles,Vt=Ft.text.length>it.options.maxHighlightLength?zn(at.mode,dt.state):null,Ht=no(it,Ft,dt,!0);Vt&&(dt.state=Vt),Ft.styles=Ht.styles;var se=Ft.styleClasses,ze=Ht.classes;ze?Ft.styleClasses=ze:se&&(Ft.styleClasses=null);for(var de=!Ot||Ot.length!=Ft.styles.length||se!=ze&&(!se||!ze||se.bgClass!=ze.bgClass||se.textClass!=ze.textClass),xn=0;!de&&xn<Ot.length;++xn)de=Ot[xn]!=Ft.styles[xn];de&&mt.push(dt.line),Ft.stateAfter=dt.save(),dt.nextLine()}else Ft.text.length<=it.options.maxHighlightLength&&He(it,Ft.text,dt),Ft.stateAfter=dt.line%5==0?dt.save():null,dt.nextLine();if(+new Date>ct)return du(it,it.options.workDelay),!0}),at.highlightFrontier=dt.line,at.modeFrontier=Math.max(at.modeFrontier,dt.line),mt.length&&Cr(it,function(){for(var Ft=0;Ft<mt.length;Ft++)Qi(it,mt[Ft],"text")})}}var vs=function(it,at,ct){var dt=it.display;this.viewport=at,this.visible=Nr(dt,it.doc,at),this.editorIsHidden=!dt.wrapper.offsetWidth,this.wrapperHeight=dt.wrapper.clientHeight,this.wrapperWidth=dt.wrapper.clientWidth,this.oldDisplayWidth=hs(it),this.force=ct,this.dims=Vr(it),this.events=[]};vs.prototype.signal=function(it,at){Ln(it,at)&&this.events.push(arguments)},vs.prototype.finish=function(){for(var it=0;it<this.events.length;it++)Je.apply(null,this.events[it])};function bl(it){var at=it.display;!at.scrollbarsClipped&&at.scroller.offsetWidth&&(at.nativeBarWidth=at.scroller.offsetWidth-at.scroller.clientWidth,at.heightForcer.style.height=Ko(it)+"px",at.sizer.style.marginBottom=-at.nativeBarWidth+"px",at.sizer.style.borderRightWidth=Ko(it)+"px",at.scrollbarsClipped=!0)}function ys(it){if(it.hasFocus())return null;var at=Ce();if(!at||!Ne(it.display.lineDiv,at))return null;var ct={activeElt:at};if(window.getSelection){var dt=window.getSelection();dt.anchorNode&&dt.extend&&Ne(it.display.lineDiv,dt.anchorNode)&&(ct.anchorNode=dt.anchorNode,ct.anchorOffset=dt.anchorOffset,ct.focusNode=dt.focusNode,ct.focusOffset=dt.focusOffset)}return ct}function Ua(it){if(!(!it||!it.activeElt||it.activeElt==Ce())&&(it.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(it.activeElt.nodeName)&&it.anchorNode&&Ne(document.body,it.anchorNode)&&Ne(document.body,it.focusNode))){var at=window.getSelection(),ct=document.createRange();ct.setEnd(it.anchorNode,it.anchorOffset),ct.collapse(!1),at.removeAllRanges(),at.addRange(ct),at.extend(it.focusNode,it.focusOffset)}}function nh(it,at){var ct=it.display,dt=it.doc;if(at.editorIsHidden)return ar(it),!1;if(!at.force&&at.visible.from>=ct.viewFrom&&at.visible.to<=ct.viewTo&&(ct.updateLineNumbers==null||ct.updateLineNumbers>=ct.viewTo)&&ct.renderedView==ct.view&&Ji(it)==0)return!1;rs(it)&&(ar(it),at.dims=Vr(it));var mt=dt.first+dt.size,Ft=Math.max(at.visible.from-it.options.viewportMargin,dt.first),Ot=Math.min(mt,at.visible.to+it.options.viewportMargin);ct.viewFrom<Ft&&Ft-ct.viewFrom<20&&(Ft=Math.max(dt.first,ct.viewFrom)),ct.viewTo>Ot&&ct.viewTo-Ot<20&&(Ot=Math.min(mt,ct.viewTo)),fn&&(Ft=Ei(it.doc,Ft),Ot=yi(it.doc,Ot));var Vt=Ft!=ct.viewFrom||Ot!=ct.viewTo||ct.lastWrapHeight!=at.wrapperHeight||ct.lastWrapWidth!=at.wrapperWidth;xr(it,Ft,Ot),ct.viewOffset=qi(On(it.doc,ct.viewFrom)),it.display.mover.style.top=ct.viewOffset+"px";var Ht=Ji(it);if(!Vt&&Ht==0&&!at.force&&ct.renderedView==ct.view&&(ct.updateLineNumbers==null||ct.updateLineNumbers>=ct.viewTo))return!1;var se=ys(it);return Ht>4&&(ct.lineDiv.style.display="none"),ih(it,ct.updateLineNumbers,at.dims),Ht>4&&(ct.lineDiv.style.display=""),ct.renderedView=ct.view,Ua(se),Jt(ct.cursorDiv),Jt(ct.selectionDiv),ct.gutters.style.height=ct.sizer.style.minHeight=0,Vt&&(ct.lastWrapHeight=at.wrapperHeight,ct.lastWrapWidth=at.wrapperWidth,du(it,400)),ct.updateLineNumbers=null,!0}function $o(it,at){for(var ct=at.viewport,dt=!0;;dt=!1){if(!dt||!it.options.lineWrapping||at.oldDisplayWidth==hs(it)){if(ct&&ct.top!=null&&(ct={top:Math.min(it.doc.height+Ka(it.display)-Xs(it),ct.top)}),at.visible=Nr(it.display,it.doc,ct),at.visible.from>=it.display.viewFrom&&at.visible.to<=it.display.viewTo)break}else dt&&(at.visible=Nr(it.display,it.doc,ct));if(!nh(it,at))break;zi(it);var mt=ko(it);er(it),is(it,mt),Ch(it,mt),at.force=!1}at.signal(it,"update",it),(it.display.viewFrom!=it.display.reportedViewFrom||it.display.viewTo!=it.display.reportedViewTo)&&(at.signal(it,"viewportChange",it,it.display.viewFrom,it.display.viewTo),it.display.reportedViewFrom=it.display.viewFrom,it.display.reportedViewTo=it.display.viewTo)}function Zs(it,at){var ct=new vs(it,at);if(nh(it,ct)){zi(it),$o(it,ct);var dt=ko(it);er(it),is(it,dt),Ch(it,dt),ct.finish()}}function ih(it,at,ct){var dt=it.display,mt=it.options.lineNumbers,Ft=dt.lineDiv,Ot=Ft.firstChild;function Vt(wi){var Li=wi.nextSibling;return qt&&ht&&it.display.currentWheelTarget==wi?wi.style.display="none":wi.parentNode.removeChild(wi),Li}for(var Ht=dt.view,se=dt.viewFrom,ze=0;ze<Ht.length;ze++){var de=Ht[ze];if(!de.hidden)if(!de.node||de.node.parentNode!=Ft){var xn=Va(it,de,se,ct);Ft.insertBefore(xn,Ot)}else{for(;Ot!=de.node;)Ot=Vt(Ot);var un=mt&&at!=null&&at<=se&&de.lineNumber;de.changes&&(qe(de.changes,"gutter")>-1&&(un=!1),ia(it,de,se,ct)),un&&(Jt(de.lineNumber),de.lineNumber.appendChild(document.createTextNode(ri(it.options,se)))),Ot=de.node.nextSibling}se+=de.size}for(;Ot;)Ot=Vt(Ot)}function wh(it){var at=it.gutters.offsetWidth;it.sizer.style.marginLeft=at+"px"}function Ch(it,at){it.display.sizer.style.minHeight=at.docHeight+"px",it.display.heightForcer.style.top=at.docHeight+"px",it.display.gutters.style.height=at.docHeight+it.display.barHeight+Ko(it)+"px"}function sf(it){var at=it.display,ct=at.view;if(!(!at.alignWidgets&&(!at.gutters.firstChild||!it.options.fixedGutter))){for(var dt=Po(at)-at.scroller.scrollLeft+it.doc.scrollLeft,mt=at.gutters.offsetWidth,Ft=dt+"px",Ot=0;Ot<ct.length;Ot++)if(!ct[Ot].hidden){it.options.fixedGutter&&(ct[Ot].gutter&&(ct[Ot].gutter.style.left=Ft),ct[Ot].gutterBackground&&(ct[Ot].gutterBackground.style.left=Ft));var Vt=ct[Ot].alignable;if(Vt)for(var Ht=0;Ht<Vt.length;Ht++)Vt[Ht].style.left=Ft}it.options.fixedGutter&&(at.gutters.style.left=dt+mt+"px")}}function rs(it){if(!it.options.lineNumbers)return!1;var at=it.doc,ct=ri(it.options,at.first+at.size-1),dt=it.display;if(ct.length!=dt.lineNumChars){var mt=dt.measure.appendChild(Gt("div",[Gt("div",ct)],"CodeMirror-linenumber CodeMirror-gutter-elt")),Ft=mt.firstChild.offsetWidth,Ot=mt.offsetWidth-Ft;return dt.lineGutter.style.width="",dt.lineNumInnerWidth=Math.max(Ft,dt.lineGutter.offsetWidth-Ot)+1,dt.lineNumWidth=dt.lineNumInnerWidth+Ot,dt.lineNumChars=dt.lineNumInnerWidth?ct.length:-1,dt.lineGutter.style.width=dt.lineNumWidth+"px",wh(it.display),!0}return!1}function Ss(it,at){for(var ct=[],dt=!1,mt=0;mt<it.length;mt++){var Ft=it[mt],Ot=null;if(typeof Ft!="string"&&(Ot=Ft.style,Ft=Ft.className),Ft=="CodeMirror-linenumbers")if(at)dt=!0;else continue;ct.push({className:Ft,style:Ot})}return at&&!dt&&ct.push({className:"CodeMirror-linenumbers",style:null}),ct}function td(it){var at=it.gutters,ct=it.gutterSpecs;Jt(at),it.lineGutter=null;for(var dt=0;dt<ct.length;++dt){var mt=ct[dt],Ft=mt.className,Ot=mt.style,Vt=at.appendChild(Gt("div",null,"CodeMirror-gutter "+Ft));Ot&&(Vt.style.cssText=Ot),Ft=="CodeMirror-linenumbers"&&(it.lineGutter=Vt,Vt.style.width=(it.lineNumWidth||1)+"px")}at.style.display=ct.length?"":"none",wh(it)}function Nl(it){td(it.display),wr(it),sf(it)}function Eh(it,at,ct,dt){var mt=this;this.input=ct,mt.scrollbarFiller=Gt("div",null,"CodeMirror-scrollbar-filler"),mt.scrollbarFiller.setAttribute("cm-not-content","true"),mt.gutterFiller=Gt("div",null,"CodeMirror-gutter-filler"),mt.gutterFiller.setAttribute("cm-not-content","true"),mt.lineDiv=me("div",null,"CodeMirror-code"),mt.selectionDiv=Gt("div",null,null,"position: relative; z-index: 1"),mt.cursorDiv=Gt("div",null,"CodeMirror-cursors"),mt.measure=Gt("div",null,"CodeMirror-measure"),mt.lineMeasure=Gt("div",null,"CodeMirror-measure"),mt.lineSpace=me("div",[mt.measure,mt.lineMeasure,mt.selectionDiv,mt.cursorDiv,mt.lineDiv],null,"position: relative; outline: none");var Ft=me("div",[mt.lineSpace],"CodeMirror-lines");mt.mover=Gt("div",[Ft],null,"position: relative"),mt.sizer=Gt("div",[mt.mover],"CodeMirror-sizer"),mt.sizerWidth=null,mt.heightForcer=Gt("div",null,null,"position: absolute; height: "+_n+"px; width: 1px;"),mt.gutters=Gt("div",null,"CodeMirror-gutters"),mt.lineGutter=null,mt.scroller=Gt("div",[mt.sizer,mt.heightForcer,mt.gutters],"CodeMirror-scroll"),mt.scroller.setAttribute("tabIndex","-1"),mt.wrapper=Gt("div",[mt.scrollbarFiller,mt.gutterFiller,mt.scroller],"CodeMirror"),ue&&It<8&&(mt.gutters.style.zIndex=-1,mt.scroller.style.paddingRight=0),!qt&&!(pt&&et)&&(mt.scroller.draggable=!0),it&&(it.appendChild?it.appendChild(mt.wrapper):it(mt.wrapper)),mt.viewFrom=mt.viewTo=at.first,mt.reportedViewFrom=mt.reportedViewTo=at.first,mt.view=[],mt.renderedView=null,mt.externalMeasured=null,mt.viewOffset=0,mt.lastWrapHeight=mt.lastWrapWidth=0,mt.updateLineNumbers=null,mt.nativeBarWidth=mt.barHeight=mt.barWidth=0,mt.scrollbarsClipped=!1,mt.lineNumWidth=mt.lineNumInnerWidth=mt.lineNumChars=null,mt.alignWidgets=!1,mt.cachedCharWidth=mt.cachedTextHeight=mt.cachedPaddingH=null,mt.maxLine=null,mt.maxLineLength=0,mt.maxLineChanged=!1,mt.wheelDX=mt.wheelDY=mt.wheelStartX=mt.wheelStartY=null,mt.shift=!1,mt.selForContextMenu=null,mt.activeTouch=null,mt.gutterSpecs=Ss(dt.gutters,dt.lineNumbers),td(mt),ct.init(mt)}var fl=0,Qa=null;ue?Qa=-.53:pt?Qa=15:ne?Qa=-.7:Ae&&(Qa=-1/3);function Eu(it){var at=it.wheelDeltaX,ct=it.wheelDeltaY;return at==null&&it.detail&&it.axis==it.HORIZONTAL_AXIS&&(at=it.detail),ct==null&&it.detail&&it.axis==it.VERTICAL_AXIS?ct=it.detail:ct==null&&(ct=it.wheelDelta),{x:at,y:ct}}function Bl(it){var at=Eu(it);return at.x*=Qa,at.y*=Qa,at}function xs(it,at){var ct=Eu(at),dt=ct.x,mt=ct.y,Ft=it.display,Ot=Ft.scroller,Vt=Ot.scrollWidth>Ot.clientWidth,Ht=Ot.scrollHeight>Ot.clientHeight;if(dt&&Vt||mt&&Ht){if(mt&&ht&&qt){t:for(var se=at.target,ze=Ft.view;se!=Ot;se=se.parentNode)for(var de=0;de<ze.length;de++)if(ze[de].node==se){it.display.currentWheelTarget=se;break t}}if(dt&&!pt&&!Rt&&Qa!=null){mt&&Ht&&Gl(it,Math.max(0,Ot.scrollTop+mt*Qa)),Hl(it,Math.max(0,Ot.scrollLeft+dt*Qa)),(!mt||mt&&Ht)&&Kn(at),Ft.wheelStartX=null;return}if(mt&&Qa!=null){var xn=mt*Qa,un=it.doc.scrollTop,wi=un+Ft.wrapper.clientHeight;xn<0?un=Math.max(0,un+xn-50):wi=Math.min(it.doc.height,wi+xn+50),Zs(it,{top:un,bottom:wi})}fl<20&&(Ft.wheelStartX==null?(Ft.wheelStartX=Ot.scrollLeft,Ft.wheelStartY=Ot.scrollTop,Ft.wheelDX=dt,Ft.wheelDY=mt,setTimeout(function(){if(Ft.wheelStartX!=null){var Li=Ot.scrollLeft-Ft.wheelStartX,ji=Ot.scrollTop-Ft.wheelStartY,lr=ji&&Ft.wheelDY&&ji/Ft.wheelDY||Li&&Ft.wheelDX&&Li/Ft.wheelDX;Ft.wheelStartX=Ft.wheelStartY=null,lr&&(Qa=(Qa*fl+lr)/(fl+1),++fl)}},200)):(Ft.wheelDX+=dt,Ft.wheelDY+=mt))}}var Kl=function(it,at){this.ranges=it,this.primIndex=at};Kl.prototype.primary=function(){return this.ranges[this.primIndex]},Kl.prototype.equals=function(it){if(it==this)return!0;if(it.primIndex!=this.primIndex||it.ranges.length!=this.ranges.length)return!1;for(var at=0;at<this.ranges.length;at++){var ct=this.ranges[at],dt=it.ranges[at];if(!Vn(ct.anchor,dt.anchor)||!Vn(ct.head,dt.head))return!1}return!0},Kl.prototype.deepCopy=function(){for(var it=[],at=0;at<this.ranges.length;at++)it[at]=new la(ci(this.ranges[at].anchor),ci(this.ranges[at].head));return new Kl(it,this.primIndex)},Kl.prototype.somethingSelected=function(){for(var it=0;it<this.ranges.length;it++)if(!this.ranges[it].empty())return!0;return!1},Kl.prototype.contains=function(it,at){at||(at=it);for(var ct=0;ct<this.ranges.length;ct++){var dt=this.ranges[ct];if(je(at,dt.from())>=0&&je(it,dt.to())<=0)return ct}return-1};var la=function(it,at){this.anchor=it,this.head=at};la.prototype.from=function(){return pi(this.anchor,this.head)},la.prototype.to=function(){return Mi(this.anchor,this.head)},la.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function cu(it,at,ct){var dt=it&&it.options.selectionsMayTouch,mt=at[ct];at.sort(function(xn,un){return je(xn.from(),un.from())}),ct=qe(at,mt);for(var Ft=1;Ft<at.length;Ft++){var Ot=at[Ft],Vt=at[Ft-1],Ht=je(Vt.to(),Ot.from());if(dt&&!Ot.empty()?Ht>0:Ht>=0){var se=pi(Vt.from(),Ot.from()),ze=Mi(Vt.to(),Ot.to()),de=Vt.empty()?Ot.from()==Ot.head:Vt.from()==Vt.head;Ft<=ct&&--ct,at.splice(--Ft,2,new la(de?ze:se,de?se:ze))}}return new Kl(at,ct)}function rh(it,at){return new Kl([new la(it,at||it)],0)}function Lh(it){return it.text?We(it.from.line+it.text.length-1,ee(it.text).length+(it.text.length==1?it.from.ch:0)):it.to}function ed(it,at){if(je(it,at.from)<0)return it;if(je(it,at.to)<=0)return Lh(at);var ct=it.line+at.text.length-(at.to.line-at.from.line)-1,dt=it.ch;return it.line==at.to.line&&(dt+=Lh(at).ch-at.to.ch),We(ct,dt)}function mc(it,at){for(var ct=[],dt=0;dt<it.sel.ranges.length;dt++){var mt=it.sel.ranges[dt];ct.push(new la(ed(mt.anchor,at),ed(mt.head,at)))}return cu(it.cm,ct,it.sel.primIndex)}function Id(it,at,ct){return it.line==at.line?We(ct.line,it.ch-at.ch+ct.ch):We(ct.line+(it.line-at.line),it.ch)}function vc(it,at,ct){for(var dt=[],mt=We(it.first,0),Ft=mt,Ot=0;Ot<at.length;Ot++){var Vt=at[Ot],Ht=Id(Vt.from,mt,Ft),se=Id(Lh(Vt),mt,Ft);if(mt=Vt.to,Ft=se,ct=="around"){var ze=it.sel.ranges[Ot],de=je(ze.head,ze.anchor)<0;dt[Ot]=new la(de?se:Ht,de?Ht:se)}else dt[Ot]=new la(Ht,Ht)}return new Kl(dt,it.sel.primIndex)}function Zo(it){it.doc.mode=pe(it.options,it.doc.modeOption),yc(it)}function yc(it){it.doc.iter(function(at){at.stateAfter&&(at.stateAfter=null),at.styles&&(at.styles=null)}),it.doc.modeFrontier=it.doc.highlightFrontier=it.doc.first,du(it,100),it.state.modeGen++,it.curOp&&wr(it)}function gg(it,at){return at.from.ch==0&&at.to.ch==0&&ee(at.text)==""&&(!it.cm||it.cm.options.wholeLineUpdateBefore)}function lf(it,at,ct,dt){function mt(_r){return ct?ct[_r]:null}function Ft(_r,yr,Hr){Zr(_r,yr,Hr,dt),ir(_r,"change",_r,at)}function Ot(_r,yr){for(var Hr=[],wo=_r;wo<yr;++wo)Hr.push(new Rr(se[wo],mt(wo),dt));return Hr}var Vt=at.from,Ht=at.to,se=at.text,ze=On(it,Vt.line),de=On(it,Ht.line),xn=ee(se),un=mt(se.length-1),wi=Ht.line-Vt.line;if(at.full)it.insert(0,Ot(0,se.length)),it.remove(se.length,it.size-se.length);else if(gg(it,at)){var Li=Ot(0,se.length-1);Ft(de,de.text,un),wi&&it.remove(Vt.line,wi),Li.length&&it.insert(Vt.line,Li)}else if(ze==de)if(se.length==1)Ft(ze,ze.text.slice(0,Vt.ch)+xn+ze.text.slice(Ht.ch),un);else{var ji=Ot(1,se.length-1);ji.push(new Rr(xn+ze.text.slice(Ht.ch),un,dt)),Ft(ze,ze.text.slice(0,Vt.ch)+se[0],mt(0)),it.insert(Vt.line+1,ji)}else if(se.length==1)Ft(ze,ze.text.slice(0,Vt.ch)+se[0]+de.text.slice(Ht.ch),mt(0)),it.remove(Vt.line+1,wi);else{Ft(ze,ze.text.slice(0,Vt.ch)+se[0],mt(0)),Ft(de,xn+de.text.slice(Ht.ch),un);var lr=Ot(1,se.length-1);wi>1&&it.remove(Vt.line+1,wi-1),it.insert(Vt.line+1,lr)}ir(it,"change",it,at)}function Lu(it,at,ct){function dt(mt,Ft,Ot){if(mt.linked)for(var Vt=0;Vt<mt.linked.length;++Vt){var Ht=mt.linked[Vt];if(Ht.doc!=Ft){var se=Ot&&Ht.sharedHist;ct&&!se||(at(Ht.doc,se),dt(Ht.doc,mt,se))}}}dt(it,null,!0)}function uf(it,at){if(at.cm)throw new Error("This document is already in use.");it.doc=at,at.cm=it,Ri(it),Zo(it),Sc(it),it.options.lineWrapping||Lr(it),it.options.mode=at.modeOption,wr(it)}function Sc(it){(it.doc.direction=="rtl"?we:Dt)(it.display.lineDiv,"CodeMirror-rtl")}function q0(it){Cr(it,function(){Sc(it),wr(it)})}function _d(it){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=it||1}function hf(it,at){var ct={from:ci(at.from),to:Lh(at),text:Fe(it,at.from,at.to)};return Fh(it,ct,at.from.line,at.to.line+1),Lu(it,function(dt){return Fh(dt,ct,at.from.line,at.to.line+1)},!0),ct}function Rd(it){for(;it.length;){var at=ee(it);if(at.ranges)it.pop();else break}}function xc(it,at){if(at)return Rd(it.done),ee(it.done);if(it.done.length&&!ee(it.done).ranges)return ee(it.done);if(it.done.length>1&&!it.done[it.done.length-2].ranges)return it.done.pop(),ee(it.done)}function Pc(it,at,ct,dt){var mt=it.history;mt.undone.length=0;var Ft=+new Date,Ot,Vt;if((mt.lastOp==dt||mt.lastOrigin==at.origin&&at.origin&&(at.origin.charAt(0)=="+"&&mt.lastModTime>Ft-(it.cm?it.cm.options.historyEventDelay:500)||at.origin.charAt(0)=="*"))&&(Ot=xc(mt,mt.lastOp==dt)))Vt=ee(Ot.changes),je(at.from,at.to)==0&&je(at.from,Vt.to)==0?Vt.to=Lh(at):Ot.changes.push(hf(it,at));else{var Ht=ee(mt.done);for((!Ht||!Ht.ranges)&&jd(it.sel,mt.done),Ot={changes:[hf(it,at)],generation:mt.generation},mt.done.push(Ot);mt.done.length>mt.undoDepth;)mt.done.shift(),mt.done[0].ranges||mt.done.shift()}mt.done.push(ct),mt.generation=++mt.maxGeneration,mt.lastModTime=mt.lastSelTime=Ft,mt.lastOp=mt.lastSelOp=dt,mt.lastOrigin=mt.lastSelOrigin=at.origin,Vt||Je(it,"historyAdded")}function pg(it,at,ct,dt){var mt=at.charAt(0);return mt=="*"||mt=="+"&&ct.ranges.length==dt.ranges.length&&ct.somethingSelected()==dt.somethingSelected()&&new Date-it.history.lastSelTime<=(it.cm?it.cm.options.historyEventDelay:500)}function wc(it,at,ct,dt){var mt=it.history,Ft=dt&&dt.origin;ct==mt.lastSelOp||Ft&&mt.lastSelOrigin==Ft&&(mt.lastModTime==mt.lastSelTime&&mt.lastOrigin==Ft||pg(it,Ft,ee(mt.done),at))?mt.done[mt.done.length-1]=at:jd(at,mt.done),mt.lastSelTime=+new Date,mt.lastSelOrigin=Ft,mt.lastSelOp=ct,dt&&dt.clearRedo!==!1&&Rd(mt.undone)}function jd(it,at){var ct=ee(at);ct&&ct.ranges&&ct.equals(it)||at.push(it)}function Fh(it,at,ct,dt){var mt=at["spans_"+it.id],Ft=0;it.iter(Math.max(it.first,ct),Math.min(it.first+it.size,dt),function(Ot){Ot.markedSpans&&((mt||(mt=at["spans_"+it.id]={}))[Ft]=Ot.markedSpans),++Ft})}function Js(it){if(!it)return null;for(var at,ct=0;ct<it.length;++ct)it[ct].marker.explicitlyCleared?at||(at=it.slice(0,ct)):at&&at.push(it[ct]);return at?at.length?at:null:it}function Ru(it,at){var ct=at["spans_"+it.id];if(!ct)return null;for(var dt=[],mt=0;mt<at.text.length;++mt)dt.push(Js(ct[mt]));return dt}function df(it,at){var ct=Ru(it,at),dt=co(it,at);if(!ct)return dt;if(!dt)return ct;for(var mt=0;mt<ct.length;++mt){var Ft=ct[mt],Ot=dt[mt];if(Ft&&Ot)t:for(var Vt=0;Vt<Ot.length;++Vt){for(var Ht=Ot[Vt],se=0;se<Ft.length;++se)if(Ft[se].marker==Ht.marker)continue t;Ft.push(Ht)}else Ot&&(ct[mt]=Ot)}return ct}function oh(it,at,ct){for(var dt=[],mt=0;mt<it.length;++mt){var Ft=it[mt];if(Ft.ranges){dt.push(ct?Kl.prototype.deepCopy.call(Ft):Ft);continue}var Ot=Ft.changes,Vt=[];dt.push({changes:Vt});for(var Ht=0;Ht<Ot.length;++Ht){var se=Ot[Ht],ze=void 0;if(Vt.push({from:se.from,to:se.to,text:se.text}),at)for(var de in se)(ze=de.match(/^spans_(\d+)$/))&&qe(at,Number(ze[1]))>-1&&(ee(Vt)[de]=se[de],delete se[de])}}return dt}function cf(it,at,ct,dt){if(dt){var mt=it.anchor;if(ct){var Ft=je(at,mt)<0;Ft!=je(ct,mt)<0?(mt=at,at=ct):Ft!=je(at,ct)<0&&(at=ct)}return new la(mt,at)}else return new la(ct||at,at)}function ff(it,at,ct,dt,mt){mt==null&&(mt=it.cm&&(it.cm.display.shift||it.extend)),Gs(it,new Kl([cf(it.sel.primary(),at,ct,mt)],0),dt)}function Hp(it,at,ct){for(var dt=[],mt=it.cm&&(it.cm.display.shift||it.extend),Ft=0;Ft<it.sel.ranges.length;Ft++)dt[Ft]=cf(it.sel.ranges[Ft],at[Ft],null,mt);var Ot=cu(it.cm,dt,it.sel.primIndex);Gs(it,Ot,ct)}function Mh(it,at,ct,dt){var mt=it.sel.ranges.slice(0);mt[at]=ct,Gs(it,cu(it.cm,mt,it.sel.primIndex),dt)}function nd(it,at,ct,dt){Gs(it,rh(at,ct),dt)}function Wp(it,at,ct){var dt={ranges:at.ranges,update:function(mt){this.ranges=[];for(var Ft=0;Ft<mt.length;Ft++)this.ranges[Ft]=new la(hi(it,mt[Ft].anchor),hi(it,mt[Ft].head))},origin:ct&&ct.origin};return Je(it,"beforeSelectionChange",it,dt),it.cm&&Je(it.cm,"beforeSelectionChange",it.cm,dt),dt.ranges!=at.ranges?cu(it.cm,dt.ranges,dt.ranges.length-1):at}function gf(it,at,ct){var dt=it.history.done,mt=ee(dt);mt&&mt.ranges?(dt[dt.length-1]=at,id(it,at,ct)):Gs(it,at,ct)}function Gs(it,at,ct){id(it,at,ct),wc(it,it.sel,it.cm?it.cm.curOp.id:NaN,ct)}function id(it,at,ct){(Ln(it,"beforeSelectionChange")||it.cm&&Ln(it.cm,"beforeSelectionChange"))&&(at=Wp(it,at,ct));var dt=ct&&ct.bias||(je(at.primary().head,it.sel.primary().head)<0?-1:1);mg(it,Ec(it,at,dt,!0)),!(ct&&ct.scroll===!1)&&it.cm&&zs(it.cm)}function mg(it,at){at.equals(it.sel)||(it.sel=at,it.cm&&(it.cm.curOp.updateInput=1,it.cm.curOp.selectionChanged=!0,Xn(it.cm)),ir(it,"cursorActivity",it))}function Cc(it){mg(it,Ec(it,it.sel,null,!1))}function Ec(it,at,ct,dt){for(var mt,Ft=0;Ft<at.ranges.length;Ft++){var Ot=at.ranges[Ft],Vt=at.ranges.length==it.sel.ranges.length&&it.sel.ranges[Ft],Ht=Lc(it,Ot.anchor,Vt&&Vt.anchor,ct,dt),se=Lc(it,Ot.head,Vt&&Vt.head,ct,dt);(mt||Ht!=Ot.anchor||se!=Ot.head)&&(mt||(mt=at.ranges.slice(0,Ft)),mt[Ft]=new la(Ht,se))}return mt?cu(it.cm,mt,at.primIndex):at}function ah(it,at,ct,dt,mt){var Ft=On(it,at.line);if(Ft.markedSpans)for(var Ot=0;Ot<Ft.markedSpans.length;++Ot){var Vt=Ft.markedSpans[Ot],Ht=Vt.marker,se="selectLeft"in Ht?!Ht.selectLeft:Ht.inclusiveLeft,ze="selectRight"in Ht?!Ht.selectRight:Ht.inclusiveRight;if((Vt.from==null||(se?Vt.from<=at.ch:Vt.from<at.ch))&&(Vt.to==null||(ze?Vt.to>=at.ch:Vt.to>at.ch))){if(mt&&(Je(Ht,"beforeCursorEnter"),Ht.explicitlyCleared))if(Ft.markedSpans){--Ot;continue}else break;if(!Ht.atomic)continue;if(ct){var de=Ht.find(dt<0?1:-1),xn=void 0;if((dt<0?ze:se)&&(de=vg(it,de,-dt,de&&de.line==at.line?Ft:null)),de&&de.line==at.line&&(xn=je(de,ct))&&(dt<0?xn<0:xn>0))return ah(it,de,at,dt,mt)}var un=Ht.find(dt<0?-1:1);return(dt<0?se:ze)&&(un=vg(it,un,dt,un.line==at.line?Ft:null)),un?ah(it,un,at,dt,mt):null}}return at}function Lc(it,at,ct,dt,mt){var Ft=dt||1,Ot=ah(it,at,ct,Ft,mt)||!mt&&ah(it,at,ct,Ft,!0)||ah(it,at,ct,-Ft,mt)||!mt&&ah(it,at,ct,-Ft,!0);return Ot||(it.cantEdit=!0,We(it.first,0))}function vg(it,at,ct,dt){return ct<0&&at.ch==0?at.line>it.first?hi(it,We(at.line-1)):null:ct>0&&at.ch==(dt||On(it,at.line)).text.length?at.line<it.first+it.size-1?We(at.line+1,0):null:new We(at.line,at.ch+ct)}function $a(it){it.setSelection(We(it.firstLine(),0),We(it.lastLine()),De)}function Fc(it,at,ct){var dt={canceled:!1,from:at.from,to:at.to,text:at.text,origin:at.origin,cancel:function(){return dt.canceled=!0}};return ct&&(dt.update=function(mt,Ft,Ot,Vt){mt&&(dt.from=hi(it,mt)),Ft&&(dt.to=hi(it,Ft)),Ot&&(dt.text=Ot),Vt!==void 0&&(dt.origin=Vt)}),Je(it,"beforeChange",it,dt),it.cm&&Je(it.cm,"beforeChange",it.cm,dt),dt.canceled?(it.cm&&(it.cm.curOp.updateInput=2),null):{from:dt.from,to:dt.to,text:dt.text,origin:dt.origin}}function kh(it,at,ct){if(it.cm){if(!it.cm.curOp)return Qo(it.cm,kh)(it,at,ct);if(it.cm.state.suppressEdits)return}if(!((Ln(it,"beforeChange")||it.cm&&Ln(it.cm,"beforeChange"))&&(at=Fc(it,at,!0),!at))){var dt=Fr&&!ct&&mn(it,at.from,at.to);if(dt)for(var mt=dt.length-1;mt>=0;--mt)rd(it,{from:dt[mt].from,to:dt[mt].to,text:mt?[""]:at.text,origin:at.origin});else rd(it,at)}}function rd(it,at){if(!(at.text.length==1&&at.text[0]==""&&je(at.from,at.to)==0)){var ct=mc(it,at);Pc(it,at,ct,it.cm?it.cm.curOp.id:NaN),zd(it,at,ct,co(it,at));var dt=[];Lu(it,function(mt,Ft){!Ft&&qe(dt,mt.history)==-1&&(Sg(mt.history,at),dt.push(mt.history)),zd(mt,at,null,co(mt,at))})}}function Mc(it,at,ct){var dt=it.cm&&it.cm.state.suppressEdits;if(!(dt&&!ct)){for(var mt=it.history,Ft,Ot=it.sel,Vt=at=="undo"?mt.done:mt.undone,Ht=at=="undo"?mt.undone:mt.done,se=0;se<Vt.length&&(Ft=Vt[se],!(ct?Ft.ranges&&!Ft.equals(it.sel):!Ft.ranges));se++);if(se!=Vt.length){for(mt.lastOrigin=mt.lastSelOrigin=null;;)if(Ft=Vt.pop(),Ft.ranges){if(jd(Ft,Ht),ct&&!Ft.equals(it.sel)){Gs(it,Ft,{clearRedo:!1});return}Ot=Ft}else if(dt){Vt.push(Ft);return}else break;var ze=[];jd(Ot,Ht),Ht.push({changes:ze,generation:mt.generation}),mt.generation=Ft.generation||++mt.maxGeneration;for(var de=Ln(it,"beforeChange")||it.cm&&Ln(it.cm,"beforeChange"),xn=function(Li){var ji=Ft.changes[Li];if(ji.origin=at,de&&!Fc(it,ji,!1))return Vt.length=0,{};ze.push(hf(it,ji));var lr=Li?mc(it,ji):ee(Vt);zd(it,ji,lr,df(it,ji)),!Li&&it.cm&&it.cm.scrollIntoView({from:ji.from,to:Lh(ji)});var _r=[];Lu(it,function(yr,Hr){!Hr&&qe(_r,yr.history)==-1&&(Sg(yr.history,ji),_r.push(yr.history)),zd(yr,ji,null,df(yr,ji))})},un=Ft.changes.length-1;un>=0;--un){var wi=xn(un);if(wi)return wi.v}}}}function yg(it,at){if(at!=0&&(it.first+=at,it.sel=new Kl(Mn(it.sel.ranges,function(mt){return new la(We(mt.anchor.line+at,mt.anchor.ch),We(mt.head.line+at,mt.head.ch))}),it.sel.primIndex),it.cm)){wr(it.cm,it.first,it.first-at,at);for(var ct=it.cm.display,dt=ct.viewFrom;dt<ct.viewTo;dt++)Qi(it.cm,dt,"gutter")}}function zd(it,at,ct,dt){if(it.cm&&!it.cm.curOp)return Qo(it.cm,zd)(it,at,ct,dt);if(at.to.line<it.first){yg(it,at.text.length-1-(at.to.line-at.from.line));return}if(!(at.from.line>it.lastLine())){if(at.from.line<it.first){var mt=at.text.length-1-(it.first-at.from.line);yg(it,mt),at={from:We(it.first,0),to:We(at.to.line+mt,at.to.ch),text:[ee(at.text)],origin:at.origin}}var Ft=it.lastLine();at.to.line>Ft&&(at={from:at.from,to:We(Ft,On(it,Ft).text.length),text:[at.text[0]],origin:at.origin}),at.removed=Fe(it,at.from,at.to),ct||(ct=mc(it,at)),it.cm?Vp(it.cm,at,dt):lf(it,at,dt),id(it,ct,De),it.cantEdit&&Lc(it,We(it.firstLine(),0))&&(it.cantEdit=!1)}}function Vp(it,at,ct){var dt=it.doc,mt=it.display,Ft=at.from,Ot=at.to,Vt=!1,Ht=Ft.line;it.options.lineWrapping||(Ht=$t(ii(On(dt,Ft.line))),dt.iter(Ht,Ot.line+1,function(un){if(un==mt.maxLine)return Vt=!0,!0})),dt.sel.contains(at.from,at.to)>-1&&Xn(it),lf(dt,at,ct,Ur(it)),it.options.lineWrapping||(dt.iter(Ht,Ft.line+at.text.length,function(un){var wi=Tr(un);wi>mt.maxLineLength&&(mt.maxLine=un,mt.maxLineLength=wi,mt.maxLineChanged=!0,Vt=!1)}),Vt&&(it.curOp.updateMaxLine=!0)),Br(dt,Ft.line),du(it,400);var se=at.text.length-(Ot.line-Ft.line)-1;at.full?wr(it):Ft.line==Ot.line&&at.text.length==1&&!gg(it.doc,at)?Qi(it,Ft.line,"text"):wr(it,Ft.line,Ot.line+1,se);var ze=Ln(it,"changes"),de=Ln(it,"change");if(de||ze){var xn={from:Ft,to:Ot,text:at.text,removed:at.removed,origin:at.origin};de&&ir(it,"change",it,xn),ze&&(it.curOp.changeObjs||(it.curOp.changeObjs=[])).push(xn)}it.display.selForContextMenu=null}function od(it,at,ct,dt,mt){var Ft;dt||(dt=ct),je(dt,ct)<0&&(Ft=[dt,ct],ct=Ft[0],dt=Ft[1]),typeof at=="string"&&(at=it.splitLines(at)),kh(it,{from:ct,to:dt,text:at,origin:mt})}function Ul(it,at,ct,dt){ct<it.line?it.line+=dt:at<it.line&&(it.line=at,it.ch=0)}function Kp(it,at,ct,dt){for(var mt=0;mt<it.length;++mt){var Ft=it[mt],Ot=!0;if(Ft.ranges){Ft.copied||(Ft=it[mt]=Ft.deepCopy(),Ft.copied=!0);for(var Vt=0;Vt<Ft.ranges.length;Vt++)Ul(Ft.ranges[Vt].anchor,at,ct,dt),Ul(Ft.ranges[Vt].head,at,ct,dt);continue}for(var Ht=0;Ht<Ft.changes.length;++Ht){var se=Ft.changes[Ht];if(ct<se.from.line)se.from=We(se.from.line+dt,se.from.ch),se.to=We(se.to.line+dt,se.to.ch);else if(at<=se.to.line){Ot=!1;break}}Ot||(it.splice(0,mt+1),mt=0)}}function Sg(it,at){var ct=at.from.line,dt=at.to.line,mt=at.text.length-(dt-ct)-1;Kp(it.done,ct,dt,mt),Kp(it.undone,ct,dt,mt)}function ad(it,at,ct,dt){var mt=at,Ft=at;return typeof at=="number"?Ft=On(it,oi(it,at)):mt=$t(at),mt==null?null:(dt(Ft,mt)&&it.cm&&Qi(it.cm,mt,ct),Ft)}function Zd(it){this.lines=it,this.parent=null;for(var at=0,ct=0;ct<it.length;++ct)it[ct].parent=this,at+=it[ct].height;this.height=at}Zd.prototype={chunkSize:function(){return this.lines.length},removeInner:function(it,at){for(var ct=it,dt=it+at;ct<dt;++ct){var mt=this.lines[ct];this.height-=mt.height,jr(mt),ir(mt,"delete")}this.lines.splice(it,at)},collapse:function(it){it.push.apply(it,this.lines)},insertInner:function(it,at,ct){this.height+=ct,this.lines=this.lines.slice(0,it).concat(at).concat(this.lines.slice(it));for(var dt=0;dt<at.length;++dt)at[dt].parent=this},iterN:function(it,at,ct){for(var dt=it+at;it<dt;++it)if(ct(this.lines[it]))return!0}};function _a(it){this.children=it;for(var at=0,ct=0,dt=0;dt<it.length;++dt){var mt=it[dt];at+=mt.chunkSize(),ct+=mt.height,mt.parent=this}this.size=at,this.height=ct,this.parent=null}_a.prototype={chunkSize:function(){return this.size},removeInner:function(it,at){this.size-=at;for(var ct=0;ct<this.children.length;++ct){var dt=this.children[ct],mt=dt.chunkSize();if(it<mt){var Ft=Math.min(at,mt-it),Ot=dt.height;if(dt.removeInner(it,Ft),this.height-=Ot-dt.height,mt==Ft&&(this.children.splice(ct--,1),dt.parent=null),(at-=Ft)==0)break;it=0}else it-=mt}if(this.size-at<25&&(this.children.length>1||!(this.children[0]instanceof Zd))){var Vt=[];this.collapse(Vt),this.children=[new Zd(Vt)],this.children[0].parent=this}},collapse:function(it){for(var at=0;at<this.children.length;++at)this.children[at].collapse(it)},insertInner:function(it,at,ct){this.size+=at.length,this.height+=ct;for(var dt=0;dt<this.children.length;++dt){var mt=this.children[dt],Ft=mt.chunkSize();if(it<=Ft){if(mt.insertInner(it,at,ct),mt.lines&&mt.lines.length>50){for(var Ot=mt.lines.length%25+25,Vt=Ot;Vt<mt.lines.length;){var Ht=new Zd(mt.lines.slice(Vt,Vt+=25));mt.height-=Ht.height,this.children.splice(++dt,0,Ht),Ht.parent=this}mt.lines=mt.lines.slice(0,Ot),this.maybeSpill()}break}it-=Ft}},maybeSpill:function(){if(!(this.children.length<=10)){var it=this;do{var at=it.children.splice(it.children.length-5,5),ct=new _a(at);if(it.parent){it.size-=ct.size,it.height-=ct.height;var mt=qe(it.parent.children,it);it.parent.children.splice(mt+1,0,ct)}else{var dt=new _a(it.children);dt.parent=it,it.children=[dt,ct],it=dt}ct.parent=it.parent}while(it.children.length>10);it.parent.maybeSpill()}},iterN:function(it,at,ct){for(var dt=0;dt<this.children.length;++dt){var mt=this.children[dt],Ft=mt.chunkSize();if(it<Ft){var Ot=Math.min(at,Ft-it);if(mt.iterN(it,Ot,ct))return!0;if((at-=Ot)==0)break;it=0}else it-=Ft}}};var sh=function(it,at,ct){if(ct)for(var dt in ct)ct.hasOwnProperty(dt)&&(this[dt]=ct[dt]);this.doc=it,this.node=at};sh.prototype.clear=function(){var it=this.doc.cm,at=this.line.widgets,ct=this.line,dt=$t(ct);if(!(dt==null||!at)){for(var mt=0;mt<at.length;++mt)at[mt]==this&&at.splice(mt--,1);at.length||(ct.widgets=null);var Ft=Sa(this);Zn(ct,Math.max(0,ct.height-Ft)),it&&(Cr(it,function(){Up(it,ct,-Ft),Qi(it,dt,"widget")}),ir(it,"lineWidgetCleared",it,this,dt))}},sh.prototype.changed=function(){var it=this,at=this.height,ct=this.doc.cm,dt=this.line;this.height=null;var mt=Sa(this)-at;mt&&(ln(this.doc,dt)||Zn(dt,dt.height+mt),ct&&Cr(ct,function(){ct.curOp.forceUpdate=!0,Up(ct,dt,mt),ir(ct,"lineWidgetChanged",ct,it,$t(dt))}))},nn(sh);function Up(it,at,ct){qi(at)<(it.curOp&&it.curOp.scrollTop||it.doc.scrollTop)&&uu(it,ct)}function pf(it,at,ct,dt){var mt=new sh(it,ct,dt),Ft=it.cm;return Ft&&mt.noHScroll&&(Ft.display.alignWidgets=!0),ad(it,at,"widget",function(Ot){var Vt=Ot.widgets||(Ot.widgets=[]);if(mt.insertAt==null?Vt.push(mt):Vt.splice(Math.min(Vt.length-1,Math.max(0,mt.insertAt)),0,mt),mt.line=Ot,Ft&&!ln(it,Ot)){var Ht=qi(Ot)<it.scrollTop;Zn(Ot,Ot.height+Sa(mt)),Ht&&uu(Ft,mt.height),Ft.curOp.forceUpdate=!0}return!0}),Ft&&ir(Ft,"lineWidgetAdded",Ft,mt,typeof at=="number"?at:$t(at)),mt}var Yp=0,be=function(it,at){this.lines=[],this.type=at,this.doc=it,this.id=++Yp};be.prototype.clear=function(){if(!this.explicitlyCleared){var it=this.doc.cm,at=it&&!it.curOp;if(at&&Fn(it),Ln(this,"clear")){var ct=this.find();ct&&ir(this,"clear",ct.from,ct.to)}for(var dt=null,mt=null,Ft=0;Ft<this.lines.length;++Ft){var Ot=this.lines[Ft],Vt=$i(Ot.markedSpans,this);it&&!this.collapsed?Qi(it,$t(Ot),"text"):it&&(Vt.to!=null&&(mt=$t(Ot)),Vt.from!=null&&(dt=$t(Ot))),Ot.markedSpans=Ai(Ot.markedSpans,Vt),Vt.from==null&&this.collapsed&&!ln(this.doc,Ot)&&it&&Zn(Ot,Sr(it.display))}if(it&&this.collapsed&&!it.options.lineWrapping)for(var Ht=0;Ht<this.lines.length;++Ht){var se=ii(this.lines[Ht]),ze=Tr(se);ze>it.display.maxLineLength&&(it.display.maxLine=se,it.display.maxLineLength=ze,it.display.maxLineChanged=!0)}dt!=null&&it&&this.collapsed&&wr(it,dt,mt+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,it&&Cc(it.doc)),it&&ir(it,"markerCleared",it,this,dt,mt),at&&sr(it),this.parent&&this.parent.clear()}},be.prototype.find=function(it,at){it==null&&this.type=="bookmark"&&(it=1);for(var ct,dt,mt=0;mt<this.lines.length;++mt){var Ft=this.lines[mt],Ot=$i(Ft.markedSpans,this);if(Ot.from!=null&&(ct=We(at?Ft:$t(Ft),Ot.from),it==-1))return ct;if(Ot.to!=null&&(dt=We(at?Ft:$t(Ft),Ot.to),it==1))return dt}return ct&&{from:ct,to:dt}},be.prototype.changed=function(){var it=this,at=this.find(-1,!0),ct=this,dt=this.doc.cm;!at||!dt||Cr(dt,function(){var mt=at.line,Ft=$t(at.line),Ot=Zl(dt,Ft);if(Ot&&(_u(Ot),dt.curOp.selectionChanged=dt.curOp.forceUpdate=!0),dt.curOp.updateMaxLine=!0,!ln(ct.doc,mt)&&ct.height!=null){var Vt=ct.height;ct.height=null;var Ht=Sa(ct)-Vt;Ht&&Zn(mt,mt.height+Ht)}ir(dt,"markerChanged",dt,it)})},be.prototype.attachLine=function(it){if(!this.lines.length&&this.doc.cm){var at=this.doc.cm.curOp;(!at.maybeHiddenMarkers||qe(at.maybeHiddenMarkers,this)==-1)&&(at.maybeUnhiddenMarkers||(at.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(it)},be.prototype.detachLine=function(it){if(this.lines.splice(qe(this.lines,it),1),!this.lines.length&&this.doc.cm){var at=this.doc.cm.curOp;(at.maybeHiddenMarkers||(at.maybeHiddenMarkers=[])).push(this)}},nn(be);function sd(it,at,ct,dt,mt){if(dt&&dt.shared)return Xp(it,at,ct,dt,mt);if(it.cm&&!it.cm.curOp)return Qo(it.cm,sd)(it,at,ct,dt,mt);var Ft=new be(it,mt),Ot=je(at,ct);if(dt&&Ke(dt,Ft,!1),Ot>0||Ot==0&&Ft.clearWhenEmpty!==!1)return Ft;if(Ft.replacedWith&&(Ft.collapsed=!0,Ft.widgetNode=me("span",[Ft.replacedWith],"CodeMirror-widget"),dt.handleMouseEvents||Ft.widgetNode.setAttribute("cm-ignore-events","true"),dt.insertLeft&&(Ft.widgetNode.insertLeft=!0)),Ft.collapsed){if(ti(it,at.line,at,ct,Ft)||at.line!=ct.line&&ti(it,ct.line,at,ct,Ft))throw new Error("Inserting collapsed marker partially overlapping an existing one");pn()}Ft.addToHistory&&Pc(it,{from:at,to:ct,origin:"markText"},it.sel,NaN);var Vt=at.line,Ht=it.cm,se;if(it.iter(Vt,ct.line+1,function(de){Ht&&Ft.collapsed&&!Ht.options.lineWrapping&&ii(de)==Ht.display.maxLine&&(se=!0),Ft.collapsed&&Vt!=at.line&&Zn(de,0),bo(de,new Di(Ft,Vt==at.line?at.ch:null,Vt==ct.line?ct.ch:null)),++Vt}),Ft.collapsed&&it.iter(at.line,ct.line+1,function(de){ln(it,de)&&Zn(de,0)}),Ft.clearOnEnter&&hn(Ft,"beforeCursorEnter",function(){return Ft.clear()}),Ft.readOnly&&(io(),(it.history.done.length||it.history.undone.length)&&it.clearHistory()),Ft.collapsed&&(Ft.id=++Yp,Ft.atomic=!0),Ht){if(se&&(Ht.curOp.updateMaxLine=!0),Ft.collapsed)wr(Ht,at.line,ct.line+1);else if(Ft.className||Ft.startStyle||Ft.endStyle||Ft.css||Ft.attributes||Ft.title)for(var ze=at.line;ze<=ct.line;ze++)Qi(Ht,ze,"text");Ft.atomic&&Cc(Ht.doc),ir(Ht,"markerAdded",Ht,Ft)}return Ft}var ju=function(it,at){this.markers=it,this.primary=at;for(var ct=0;ct<it.length;++ct)it[ct].parent=this};ju.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var it=0;it<this.markers.length;++it)this.markers[it].clear();ir(this,"clear")}},ju.prototype.find=function(it,at){return this.primary.find(it,at)},nn(ju);function Xp(it,at,ct,dt,mt){dt=Ke(dt),dt.shared=!1;var Ft=[sd(it,at,ct,dt,mt)],Ot=Ft[0],Vt=dt.widgetNode;return Lu(it,function(Ht){Vt&&(dt.widgetNode=Vt.cloneNode(!0)),Ft.push(sd(Ht,hi(Ht,at),hi(Ht,ct),dt,mt));for(var se=0;se<Ht.linked.length;++se)if(Ht.linked[se].isParent)return;Ot=ee(Ft)}),new ju(Ft,Ot)}function xg(it){return it.findMarks(We(it.first,0),it.clipPos(We(it.lastLine())),function(at){return at.parent})}function Jp(it,at){for(var ct=0;ct<at.length;ct++){var dt=at[ct],mt=dt.find(),Ft=it.clipPos(mt.from),Ot=it.clipPos(mt.to);if(je(Ft,Ot)){var Vt=sd(it,Ft,Ot,dt.primary,dt.primary.type);dt.markers.push(Vt),Vt.parent=dt}}}function Pg(it){for(var at=function(dt){var mt=it[dt],Ft=[mt.primary.doc];Lu(mt.primary.doc,function(Ht){return Ft.push(Ht)});for(var Ot=0;Ot<mt.markers.length;Ot++){var Vt=mt.markers[Ot];qe(Ft,Vt.doc)==-1&&(Vt.parent=null,mt.markers.splice(Ot--,1))}},ct=0;ct<it.length;ct++)at(ct)}var tv=0,As=function(it,at,ct,dt,mt){if(!(this instanceof As))return new As(it,at,ct,dt,mt);ct==null&&(ct=0),_a.call(this,[new Zd([new Rr("",null)])]),this.first=ct,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=ct;var Ft=We(ct,0);this.sel=rh(Ft),this.history=new _d(null),this.id=++tv,this.modeOption=at,this.lineSep=dt,this.direction=mt=="rtl"?"rtl":"ltr",this.extend=!1,typeof it=="string"&&(it=this.splitLines(it)),lf(this,{from:Ft,to:Ft,text:it}),Gs(this,rh(Ft),De)};As.prototype=Lt(_a.prototype,{constructor:As,iter:function(it,at,ct){ct?this.iterN(it-this.first,at-it,ct):this.iterN(this.first,this.first+this.size,it)},insert:function(it,at){for(var ct=0,dt=0;dt<at.length;++dt)ct+=at[dt].height;this.insertInner(it-this.first,at,ct)},remove:function(it,at){this.removeInner(it-this.first,at)},getValue:function(it){var at=Pe(this,this.first,this.first+this.size);return it===!1?at:at.join(it||this.lineSeparator())},setValue:Ta(function(it){var at=We(this.first,0),ct=this.first+this.size-1;kh(this,{from:at,to:We(ct,On(this,ct).text.length),text:this.splitLines(it),origin:"setValue",full:!0},!0),this.cm&&Ml(this.cm,0,0),Gs(this,rh(at),De)}),replaceRange:function(it,at,ct,dt){at=hi(this,at),ct=ct?hi(this,ct):at,od(this,it,at,ct,dt)},getRange:function(it,at,ct){var dt=Fe(this,hi(this,it),hi(this,at));return ct===!1?dt:dt.join(ct||this.lineSeparator())},getLine:function(it){var at=this.getLineHandle(it);return at&&at.text},getLineHandle:function(it){if(wn(this,it))return On(this,it)},getLineNumber:function(it){return $t(it)},getLineHandleVisualStart:function(it){return typeof it=="number"&&(it=On(this,it)),ii(it)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(it){return hi(this,it)},getCursor:function(it){var at=this.sel.primary(),ct;return it==null||it=="head"?ct=at.head:it=="anchor"?ct=at.anchor:it=="end"||it=="to"||it===!1?ct=at.to():ct=at.from(),ct},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Ta(function(it,at,ct){nd(this,hi(this,typeof it=="number"?We(it,at||0):it),null,ct)}),setSelection:Ta(function(it,at,ct){nd(this,hi(this,it),hi(this,at||it),ct)}),extendSelection:Ta(function(it,at,ct){ff(this,hi(this,it),at&&hi(this,at),ct)}),extendSelections:Ta(function(it,at){Hp(this,_i(this,it),at)}),extendSelectionsBy:Ta(function(it,at){var ct=Mn(this.sel.ranges,it);Hp(this,_i(this,ct),at)}),setSelections:Ta(function(it,at,ct){if(it.length){for(var dt=[],mt=0;mt<it.length;mt++)dt[mt]=new la(hi(this,it[mt].anchor),hi(this,it[mt].head));at==null&&(at=Math.min(it.length-1,this.sel.primIndex)),Gs(this,cu(this.cm,dt,at),ct)}}),addSelection:Ta(function(it,at,ct){var dt=this.sel.ranges.slice(0);dt.push(new la(hi(this,it),hi(this,at||it))),Gs(this,cu(this.cm,dt,dt.length-1),ct)}),getSelection:function(it){for(var at=this.sel.ranges,ct,dt=0;dt<at.length;dt++){var mt=Fe(this,at[dt].from(),at[dt].to());ct=ct?ct.concat(mt):mt}return it===!1?ct:ct.join(it||this.lineSeparator())},getSelections:function(it){for(var at=[],ct=this.sel.ranges,dt=0;dt<ct.length;dt++){var mt=Fe(this,ct[dt].from(),ct[dt].to());it!==!1&&(mt=mt.join(it||this.lineSeparator())),at[dt]=mt}return at},replaceSelection:function(it,at,ct){for(var dt=[],mt=0;mt<this.sel.ranges.length;mt++)dt[mt]=it;this.replaceSelections(dt,at,ct||"+input")},replaceSelections:Ta(function(it,at,ct){for(var dt=[],mt=this.sel,Ft=0;Ft<mt.ranges.length;Ft++){var Ot=mt.ranges[Ft];dt[Ft]={from:Ot.from(),to:Ot.to(),text:this.splitLines(it[Ft]),origin:ct}}for(var Vt=at&&at!="end"&&vc(this,dt,at),Ht=dt.length-1;Ht>=0;Ht--)kh(this,dt[Ht]);Vt?gf(this,Vt):this.cm&&zs(this.cm)}),undo:Ta(function(){Mc(this,"undo")}),redo:Ta(function(){Mc(this,"redo")}),undoSelection:Ta(function(){Mc(this,"undo",!0)}),redoSelection:Ta(function(){Mc(this,"redo",!0)}),setExtending:function(it){this.extend=it},getExtending:function(){return this.extend},historySize:function(){for(var it=this.history,at=0,ct=0,dt=0;dt<it.done.length;dt++)it.done[dt].ranges||++at;for(var mt=0;mt<it.undone.length;mt++)it.undone[mt].ranges||++ct;return{undo:at,redo:ct}},clearHistory:function(){var it=this;this.history=new _d(this.history.maxGeneration),Lu(this,function(at){return at.history=it.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(it){return it&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(it){return this.history.generation==(it||this.cleanGeneration)},getHistory:function(){return{done:oh(this.history.done),undone:oh(this.history.undone)}},setHistory:function(it){var at=this.history=new _d(this.history.maxGeneration);at.done=oh(it.done.slice(0),null,!0),at.undone=oh(it.undone.slice(0),null,!0)},setGutterMarker:Ta(function(it,at,ct){return ad(this,it,"gutter",function(dt){var mt=dt.gutterMarkers||(dt.gutterMarkers={});return mt[at]=ct,!ct&&Mt(mt)&&(dt.gutterMarkers=null),!0})}),clearGutter:Ta(function(it){var at=this;this.iter(function(ct){ct.gutterMarkers&&ct.gutterMarkers[it]&&ad(at,ct,"gutter",function(){return ct.gutterMarkers[it]=null,Mt(ct.gutterMarkers)&&(ct.gutterMarkers=null),!0})})}),lineInfo:function(it){var at;if(typeof it=="number"){if(!wn(this,it)||(at=it,it=On(this,it),!it))return null}else if(at=$t(it),at==null)return null;return{line:at,handle:it,text:it.text,gutterMarkers:it.gutterMarkers,textClass:it.textClass,bgClass:it.bgClass,wrapClass:it.wrapClass,widgets:it.widgets}},addLineClass:Ta(function(it,at,ct){return ad(this,it,at=="gutter"?"gutter":"class",function(dt){var mt=at=="text"?"textClass":at=="background"?"bgClass":at=="gutter"?"gutterClass":"wrapClass";if(!dt[mt])dt[mt]=ct;else{if(Tt(ct).test(dt[mt]))return!1;dt[mt]+=" "+ct}return!0})}),removeLineClass:Ta(function(it,at,ct){return ad(this,it,at=="gutter"?"gutter":"class",function(dt){var mt=at=="text"?"textClass":at=="background"?"bgClass":at=="gutter"?"gutterClass":"wrapClass",Ft=dt[mt];if(Ft)if(ct==null)dt[mt]=null;else{var Ot=Ft.match(Tt(ct));if(!Ot)return!1;var Vt=Ot.index+Ot[0].length;dt[mt]=Ft.slice(0,Ot.index)+(!Ot.index||Vt==Ft.length?"":" ")+Ft.slice(Vt)||null}else return!1;return!0})}),addLineWidget:Ta(function(it,at,ct){return pf(this,it,at,ct)}),removeLineWidget:function(it){it.clear()},markText:function(it,at,ct){return sd(this,hi(this,it),hi(this,at),ct,ct&&ct.type||"range")},setBookmark:function(it,at){var ct={replacedWith:at&&(at.nodeType==null?at.widget:at),insertLeft:at&&at.insertLeft,clearWhenEmpty:!1,shared:at&&at.shared,handleMouseEvents:at&&at.handleMouseEvents};return it=hi(this,it),sd(this,it,it,ct,"bookmark")},findMarksAt:function(it){it=hi(this,it);var at=[],ct=On(this,it.line).markedSpans;if(ct)for(var dt=0;dt<ct.length;++dt){var mt=ct[dt];(mt.from==null||mt.from<=it.ch)&&(mt.to==null||mt.to>=it.ch)&&at.push(mt.marker.parent||mt.marker)}return at},findMarks:function(it,at,ct){it=hi(this,it),at=hi(this,at);var dt=[],mt=it.line;return this.iter(it.line,at.line+1,function(Ft){var Ot=Ft.markedSpans;if(Ot)for(var Vt=0;Vt<Ot.length;Vt++){var Ht=Ot[Vt];!(Ht.to!=null&&mt==it.line&&it.ch>=Ht.to||Ht.from==null&&mt!=it.line||Ht.from!=null&&mt==at.line&&Ht.from>=at.ch)&&(!ct||ct(Ht.marker))&&dt.push(Ht.marker.parent||Ht.marker)}++mt}),dt},getAllMarks:function(){var it=[];return this.iter(function(at){var ct=at.markedSpans;if(ct)for(var dt=0;dt<ct.length;++dt)ct[dt].from!=null&&it.push(ct[dt].marker)}),it},posFromIndex:function(it){var at,ct=this.first,dt=this.lineSeparator().length;return this.iter(function(mt){var Ft=mt.text.length+dt;if(Ft>it)return at=it,!0;it-=Ft,++ct}),hi(this,We(ct,at))},indexFromPos:function(it){it=hi(this,it);var at=it.ch;if(it.line<this.first||it.ch<0)return 0;var ct=this.lineSeparator().length;return this.iter(this.first,it.line,function(dt){at+=dt.text.length+ct}),at},copy:function(it){var at=new As(Pe(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return at.scrollTop=this.scrollTop,at.scrollLeft=this.scrollLeft,at.sel=this.sel,at.extend=!1,it&&(at.history.undoDepth=this.history.undoDepth,at.setHistory(this.getHistory())),at},linkedDoc:function(it){it||(it={});var at=this.first,ct=this.first+this.size;it.from!=null&&it.from>at&&(at=it.from),it.to!=null&&it.to<ct&&(ct=it.to);var dt=new As(Pe(this,at,ct),it.mode||this.modeOption,at,this.lineSep,this.direction);return it.sharedHist&&(dt.history=this.history),(this.linked||(this.linked=[])).push({doc:dt,sharedHist:it.sharedHist}),dt.linked=[{doc:this,isParent:!0,sharedHist:it.sharedHist}],Jp(dt,xg(this)),dt},unlinkDoc:function(it){if(it instanceof qo&&(it=it.doc),this.linked)for(var at=0;at<this.linked.length;++at){var ct=this.linked[at];if(ct.doc==it){this.linked.splice(at,1),it.unlinkDoc(this),Pg(xg(this));break}}if(it.history==this.history){var dt=[it.id];Lu(it,function(mt){return dt.push(mt.id)},!0),it.history=new _d(null),it.history.done=oh(this.history.done,dt),it.history.undone=oh(this.history.undone,dt)}},iterLinkedDocs:function(it){Lu(this,it)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(it){return this.lineSep?it.split(this.lineSep):Oi(it)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Ta(function(it){it!="rtl"&&(it="ltr"),it!=this.direction&&(this.direction=it,this.iter(function(at){return at.order=null}),this.cm&&q0(this.cm))})}),As.prototype.eachLine=As.prototype.iter;var kc=0;function wg(it){var at=this;if(qp(at),!(rn(at,it)||Yo(at.display,it))){Kn(it),ue&&(kc=+new Date);var ct=Gi(at,it,!0),dt=it.dataTransfer.files;if(!(!ct||at.isReadOnly()))if(dt&&dt.length&&window.FileReader&&window.File)for(var mt=dt.length,Ft=Array(mt),Ot=0,Vt=function(){++Ot==mt&&Qo(at,function(){ct=hi(at.doc,ct);var un={from:ct,to:ct,text:at.doc.splitLines(Ft.filter(function(wi){return wi!=null}).join(at.doc.lineSeparator())),origin:"paste"};kh(at.doc,un),gf(at.doc,rh(hi(at.doc,ct),hi(at.doc,Lh(un))))})()},Ht=function(un,wi){if(at.options.allowDropFileTypes&&qe(at.options.allowDropFileTypes,un.type)==-1){Vt();return}var Li=new FileReader;Li.onerror=function(){return Vt()},Li.onload=function(){var ji=Li.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(ji)){Vt();return}Ft[wi]=ji,Vt()},Li.readAsText(un)},se=0;se<dt.length;se++)Ht(dt[se],se);else{if(at.state.draggingText&&at.doc.sel.contains(ct)>-1){at.state.draggingText(it),setTimeout(function(){return at.display.input.focus()},20);return}try{var ze=it.dataTransfer.getData("Text");if(ze){var de;if(at.state.draggingText&&!at.state.draggingText.copy&&(de=at.listSelections()),id(at.doc,rh(ct,ct)),de)for(var xn=0;xn<de.length;++xn)od(at.doc,"",de[xn].anchor,de[xn].head,"drag");at.replaceSelection(ze,"around","paste"),at.display.input.focus()}}catch(un){}}}}function Qp(it,at){if(ue&&(!it.state.draggingText||+new Date-kc<100)){Si(at);return}if(!(rn(it,at)||Yo(it.display,at))&&(at.dataTransfer.setData("Text",it.getSelection()),at.dataTransfer.effectAllowed="copyMove",at.dataTransfer.setDragImage&&!Ae)){var ct=Gt("img",null,null,"position: fixed; left: 0; top: 0;");ct.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Rt&&(ct.width=ct.height=1,it.display.wrapper.appendChild(ct),ct._top=ct.offsetTop),at.dataTransfer.setDragImage(ct,0,0),Rt&&ct.parentNode.removeChild(ct)}}function $p(it,at){var ct=Gi(it,at);if(ct){var dt=document.createDocumentFragment();bi(it,ct,dt),it.display.dragCursor||(it.display.dragCursor=Gt("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),it.display.lineSpace.insertBefore(it.display.dragCursor,it.display.cursorDiv)),Yt(it.display.dragCursor,dt)}}function qp(it){it.display.dragCursor&&(it.display.lineSpace.removeChild(it.display.dragCursor),it.display.dragCursor=null)}function tm(it){if(document.getElementsByClassName){for(var at=document.getElementsByClassName("CodeMirror"),ct=[],dt=0;dt<at.length;dt++){var mt=at[dt].CodeMirror;mt&&ct.push(mt)}ct.length&&ct[0].operation(function(){for(var Ft=0;Ft<ct.length;Ft++)it(ct[Ft])})}}var Cg=!1;function Al(){Cg||(Gd(),Cg=!0)}function Gd(){var it;hn(window,"resize",function(){it==null&&(it=setTimeout(function(){it=null,tm(Eg)},100))}),hn(window,"blur",function(){return tm(Za)})}function Eg(it){var at=it.display;at.cachedCharWidth=at.cachedTextHeight=at.cachedPaddingH=null,at.scrollbarsClipped=!1,it.setSize()}for(var zu={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},bc=0;bc<10;bc++)zu[bc+48]=zu[bc+96]=String(bc);for(var mf=65;mf<=90;mf++)zu[mf]=String.fromCharCode(mf);for(var Nc=1;Nc<=12;Nc++)zu[Nc+111]=zu[Nc+63235]="F"+Nc;var gl={};gl.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},gl.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},gl.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},gl.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},gl.default=ht?gl.macDefault:gl.pcDefault;function Lg(it){var at=it.split(/-(?!$)/);it=at[at.length-1];for(var ct,dt,mt,Ft,Ot=0;Ot<at.length-1;Ot++){var Vt=at[Ot];if(/^(cmd|meta|m)$/i.test(Vt))Ft=!0;else if(/^a(lt)?$/i.test(Vt))ct=!0;else if(/^(c|ctrl|control)$/i.test(Vt))dt=!0;else if(/^s(hift)?$/i.test(Vt))mt=!0;else throw new Error("Unrecognized modifier name: "+Vt)}return ct&&(it="Alt-"+it),dt&&(it="Ctrl-"+it),Ft&&(it="Cmd-"+it),mt&&(it="Shift-"+it),it}function Fg(it){var at={};for(var ct in it)if(it.hasOwnProperty(ct)){var dt=it[ct];if(/^(name|fallthrough|(de|at)tach)$/.test(ct))continue;if(dt=="..."){delete it[ct];continue}for(var mt=Mn(ct.split(" "),Lg),Ft=0;Ft<mt.length;Ft++){var Ot=void 0,Vt=void 0;Ft==mt.length-1?(Vt=mt.join(" "),Ot=dt):(Vt=mt.slice(0,Ft+1).join(" "),Ot="...");var Ht=at[Vt];if(!Ht)at[Vt]=Ot;else if(Ht!=Ot)throw new Error("Inconsistent bindings for "+Vt)}delete it[ct]}for(var se in at)it[se]=at[se];return it}function Yl(it,at,ct,dt){at=ld(at);var mt=at.call?at.call(it,dt):at[it];if(mt===!1)return"nothing";if(mt==="...")return"multi";if(mt!=null&&ct(mt))return"handled";if(at.fallthrough){if(Object.prototype.toString.call(at.fallthrough)!="[object Array]")return Yl(it,at.fallthrough,ct,dt);for(var Ft=0;Ft<at.fallthrough.length;Ft++){var Ot=Yl(it,at.fallthrough[Ft],ct,dt);if(Ot)return Ot}}}function Hd(it){var at=typeof it=="string"?it:zu[it.keyCode];return at=="Ctrl"||at=="Alt"||at=="Shift"||at=="Mod"}function Mg(it,at,ct){var dt=it;return at.altKey&&dt!="Alt"&&(it="Alt-"+it),(St?at.metaKey:at.ctrlKey)&&dt!="Ctrl"&&(it="Ctrl-"+it),(St?at.ctrlKey:at.metaKey)&&dt!="Mod"&&(it="Cmd-"+it),!ct&&at.shiftKey&&dt!="Shift"&&(it="Shift-"+it),it}function em(it,at){if(Rt&&it.keyCode==34&&it.char)return!1;var ct=zu[it.keyCode];return ct==null||it.altGraphKey?!1:(it.keyCode==3&&it.code&&(ct=it.code),Mg(ct,it,at))}function ld(it){return typeof it=="string"?gl[it]:it}function pl(it,at){for(var ct=it.doc.sel.ranges,dt=[],mt=0;mt<ct.length;mt++){for(var Ft=at(ct[mt]);dt.length&&je(Ft.from,ee(dt).to)<=0;){var Ot=dt.pop();if(je(Ot.from,Ft.from)<0){Ft.from=Ot.from;break}}dt.push(Ft)}Cr(it,function(){for(var Vt=dt.length-1;Vt>=0;Vt--)od(it.doc,"",dt[Vt].from,dt[Vt].to,"+delete");zs(it)})}function kg(it,at,ct){var dt=Ue(it.text,at+ct,ct);return dt<0||dt>it.text.length?null:dt}function qa(it,at,ct){var dt=kg(it,at.ch,ct);return dt==null?null:new We(at.line,dt,ct<0?"after":"before")}function Bc(it,at,ct,dt,mt){if(it){at.doc.direction=="rtl"&&(mt=-mt);var Ft=vn(ct,at.doc.direction);if(Ft){var Ot=mt<0?ee(Ft):Ft[0],Vt=mt<0==(Ot.level==1),Ht=Vt?"after":"before",se;if(Ot.level>0||at.doc.direction=="rtl"){var ze=Ll(at,ct);se=mt<0?ct.text.length-1:0;var de=js(at,ze,se).top;se=Qe(function(xn){return js(at,ze,xn).top==de},mt<0==(Ot.level==1)?Ot.from:Ot.to-1,se),Ht=="before"&&(se=kg(ct,se,1))}else se=mt<0?Ot.to:Ot.from;return new We(dt,se,Ht)}}return new We(dt,mt<0?ct.text.length:0,mt<0?"before":"after")}function vf(it,at,ct,dt){var mt=vn(at,it.doc.direction);if(!mt)return qa(at,ct,dt);ct.ch>=at.text.length?(ct.ch=at.text.length,ct.sticky="before"):ct.ch<=0&&(ct.ch=0,ct.sticky="after");var Ft=Le(mt,ct.ch,ct.sticky),Ot=mt[Ft];if(it.doc.direction=="ltr"&&Ot.level%2==0&&(dt>0?Ot.to>ct.ch:Ot.from<ct.ch))return qa(at,ct,dt);var Vt=function(lr,_r){return kg(at,lr instanceof We?lr.ch:lr,_r)},Ht,se=function(lr){return it.options.lineWrapping?(Ht=Ht||Ll(it,at),Ve(it,at,Ht,lr)):{begin:0,end:at.text.length}},ze=se(ct.sticky=="before"?Vt(ct,-1):ct.ch);if(it.doc.direction=="rtl"||Ot.level==1){var de=Ot.level==1==dt<0,xn=Vt(ct,de?1:-1);if(xn!=null&&(de?xn<=Ot.to&&xn<=ze.end:xn>=Ot.from&&xn>=ze.begin)){var un=de?"before":"after";return new We(ct.line,xn,un)}}var wi=function(lr,_r,yr){for(var Hr=function(ka,fs){return fs?new We(ct.line,Vt(ka,1),"before"):new We(ct.line,ka,"after")};lr>=0&&lr<mt.length;lr+=_r){var wo=mt[lr],mr=_r>0==(wo.level!=1),Go=mr?yr.begin:Vt(yr.end,-1);if(wo.from<=Go&&Go<wo.to||(Go=mr?wo.from:Vt(wo.to,-1),yr.begin<=Go&&Go<yr.end))return Hr(Go,mr)}},Li=wi(Ft+dt,dt,ze);if(Li)return Li;var ji=dt>0?ze.end:Vt(ze.begin,-1);return ji!=null&&!(dt>0&&ji==at.text.length)&&(Li=wi(dt>0?0:mt.length-1,dt,se(ji)),Li)?Li:null}var bh={selectAll:$a,singleSelection:function(it){return it.setSelection(it.getCursor("anchor"),it.getCursor("head"),De)},killLine:function(it){return pl(it,function(at){if(at.empty()){var ct=On(it.doc,at.head.line).text.length;return at.head.ch==ct&&at.head.line<it.lastLine()?{from:at.head,to:We(at.head.line+1,0)}:{from:at.head,to:We(at.head.line,ct)}}else return{from:at.from(),to:at.to()}})},deleteLine:function(it){return pl(it,function(at){return{from:We(at.from().line,0),to:hi(it.doc,We(at.to().line+1,0))}})},delLineLeft:function(it){return pl(it,function(at){return{from:We(at.from().line,0),to:at.from()}})},delWrappedLineLeft:function(it){return pl(it,function(at){var ct=it.charCoords(at.head,"div").top+5,dt=it.coordsChar({left:0,top:ct},"div");return{from:dt,to:at.from()}})},delWrappedLineRight:function(it){return pl(it,function(at){var ct=it.charCoords(at.head,"div").top+5,dt=it.coordsChar({left:it.display.lineDiv.offsetWidth+100,top:ct},"div");return{from:at.from(),to:dt}})},undo:function(it){return it.undo()},redo:function(it){return it.redo()},undoSelection:function(it){return it.undoSelection()},redoSelection:function(it){return it.redoSelection()},goDocStart:function(it){return it.extendSelection(We(it.firstLine(),0))},goDocEnd:function(it){return it.extendSelection(We(it.lastLine()))},goLineStart:function(it){return it.extendSelectionsBy(function(at){return Wd(it,at.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(it){return it.extendSelectionsBy(function(at){return bg(it,at.head)},{origin:"+move",bias:1})},goLineEnd:function(it){return it.extendSelectionsBy(function(at){return Vd(it,at.head.line)},{origin:"+move",bias:-1})},goLineRight:function(it){return it.extendSelectionsBy(function(at){var ct=it.cursorCoords(at.head,"div").top+5;return it.coordsChar({left:it.display.lineDiv.offsetWidth+100,top:ct},"div")},sn)},goLineLeft:function(it){return it.extendSelectionsBy(function(at){var ct=it.cursorCoords(at.head,"div").top+5;return it.coordsChar({left:0,top:ct},"div")},sn)},goLineLeftSmart:function(it){return it.extendSelectionsBy(function(at){var ct=it.cursorCoords(at.head,"div").top+5,dt=it.coordsChar({left:0,top:ct},"div");return dt.ch<it.getLine(dt.line).search(/\S/)?bg(it,at.head):dt},sn)},goLineUp:function(it){return it.moveV(-1,"line")},goLineDown:function(it){return it.moveV(1,"line")},goPageUp:function(it){return it.moveV(-1,"page")},goPageDown:function(it){return it.moveV(1,"page")},goCharLeft:function(it){return it.moveH(-1,"char")},goCharRight:function(it){return it.moveH(1,"char")},goColumnLeft:function(it){return it.moveH(-1,"column")},goColumnRight:function(it){return it.moveH(1,"column")},goWordLeft:function(it){return it.moveH(-1,"word")},goGroupRight:function(it){return it.moveH(1,"group")},goGroupLeft:function(it){return it.moveH(-1,"group")},goWordRight:function(it){return it.moveH(1,"word")},delCharBefore:function(it){return it.deleteH(-1,"codepoint")},delCharAfter:function(it){return it.deleteH(1,"char")},delWordBefore:function(it){return it.deleteH(-1,"word")},delWordAfter:function(it){return it.deleteH(1,"word")},delGroupBefore:function(it){return it.deleteH(-1,"group")},delGroupAfter:function(it){return it.deleteH(1,"group")},indentAuto:function(it){return it.indentSelection("smart")},indentMore:function(it){return it.indentSelection("add")},indentLess:function(it){return it.indentSelection("subtract")},insertTab:function(it){return it.replaceSelection(" ")},insertSoftTab:function(it){for(var at=[],ct=it.listSelections(),dt=it.options.tabSize,mt=0;mt<ct.length;mt++){var Ft=ct[mt].from(),Ot=oe(it.getLine(Ft.line),Ft.ch,dt);at.push(Sn(dt-Ot%dt))}it.replaceSelections(at)},defaultTab:function(it){it.somethingSelected()?it.indentSelection("add"):it.execCommand("insertTab")},transposeChars:function(it){return Cr(it,function(){for(var at=it.listSelections(),ct=[],dt=0;dt<at.length;dt++)if(at[dt].empty()){var mt=at[dt].head,Ft=On(it.doc,mt.line).text;if(Ft){if(mt.ch==Ft.length&&(mt=new We(mt.line,mt.ch-1)),mt.ch>0)mt=new We(mt.line,mt.ch+1),it.replaceRange(Ft.charAt(mt.ch-1)+Ft.charAt(mt.ch-2),We(mt.line,mt.ch-2),mt,"+transpose");else if(mt.line>it.doc.first){var Ot=On(it.doc,mt.line-1).text;Ot&&(mt=new We(mt.line,1),it.replaceRange(Ft.charAt(0)+it.doc.lineSeparator()+Ot.charAt(Ot.length-1),We(mt.line-1,Ot.length-1),mt,"+transpose"))}}ct.push(new la(mt,mt))}it.setSelections(ct)})},newlineAndIndent:function(it){return Cr(it,function(){for(var at=it.listSelections(),ct=at.length-1;ct>=0;ct--)it.replaceRange(it.doc.lineSeparator(),at[ct].anchor,at[ct].head,"+input");at=it.listSelections();for(var dt=0;dt<at.length;dt++)it.indentLine(at[dt].from().line,null,!0);zs(it)})},openLine:function(it){return it.replaceSelection(`
`,"start")},toggleOverwrite:function(it){return it.toggleOverwrite()}};function Wd(it,at){var ct=On(it.doc,at),dt=ii(ct);return dt!=ct&&(at=$t(dt)),Bc(!0,it,dt,at,1)}function Vd(it,at){var ct=On(it.doc,at),dt=ni(ct);return dt!=ct&&(at=$t(dt)),Bc(!0,it,ct,at,-1)}function bg(it,at){var ct=Wd(it,at.line),dt=On(it.doc,ct.line),mt=vn(dt,it.doc.direction);if(!mt||mt[0].level==0){var Ft=Math.max(ct.ch,dt.text.search(/\S/)),Ot=at.line==ct.line&&at.ch<=Ft&&at.ch;return We(ct.line,Ot?0:Ft,ct.sticky)}return ct}function Kd(it,at,ct){if(typeof at=="string"&&(at=bh[at],!at))return!1;it.display.input.ensurePolled();var dt=it.display.shift,mt=!1;try{it.isReadOnly()&&(it.state.suppressEdits=!0),ct&&(it.display.shift=!1),mt=at(it)!=Pn}finally{it.display.shift=dt,it.state.suppressEdits=!1}return mt}function Ng(it,at,ct){for(var dt=0;dt<it.state.keyMaps.length;dt++){var mt=Yl(at,it.state.keyMaps[dt],ct,it);if(mt)return mt}return it.options.extraKeys&&Yl(at,it.options.extraKeys,ct,it)||Yl(at,it.options.keyMap,ct,it)}var Zu=new Xt;function ud(it,at,ct,dt){var mt=it.state.keySeq;if(mt){if(Hd(at))return"handled";if(/\'$/.test(at)?it.state.keySeq=null:Zu.set(50,function(){it.state.keySeq==mt&&(it.state.keySeq=null,it.display.input.reset())}),yf(it,mt+" "+at,ct,dt))return!0}return yf(it,at,ct,dt)}function yf(it,at,ct,dt){var mt=Ng(it,at,dt);return mt=="multi"&&(it.state.keySeq=at),mt=="handled"&&ir(it,"keyHandled",it,at,ct),(mt=="handled"||mt=="multi")&&(Kn(ct),fo(it)),!!mt}function Sf(it,at){var ct=em(at,!0);return ct?at.shiftKey&&!it.state.keySeq?ud(it,"Shift-"+ct,at,function(dt){return Kd(it,dt,!0)})||ud(it,ct,at,function(dt){if(typeof dt=="string"?/^go[A-Z]/.test(dt):dt.motion)return Kd(it,dt)}):ud(it,ct,at,function(dt){return Kd(it,dt)}):!1}function xf(it,at,ct){return ud(it,"'"+ct+"'",at,function(dt){return Kd(it,dt,!0)})}var hd=null;function Bg(it){var at=this;if(!(it.target&&it.target!=at.display.input.getField())&&(at.curOp.focus=Ce(),!rn(at,it))){ue&&It<11&&it.keyCode==27&&(it.returnValue=!1);var ct=it.keyCode;at.display.shift=ct==16||it.shiftKey;var dt=Sf(at,it);Rt&&(hd=dt?ct:null,!dt&&ct==88&&!yn&&(ht?it.metaKey:it.ctrlKey)&&at.replaceSelection("",null,"cut")),pt&&!ht&&!dt&&ct==46&&it.shiftKey&&!it.ctrlKey&&document.execCommand&&document.execCommand("cut"),ct==18&&!/\bCodeMirror-crosshair\b/.test(at.display.lineDiv.className)&&Ag(at)}}function Ag(it){var at=it.display.lineDiv;we(at,"CodeMirror-crosshair");function ct(dt){(dt.keyCode==18||!dt.altKey)&&(Dt(at,"CodeMirror-crosshair"),Ge(document,"keyup",ct),Ge(document,"mouseover",ct))}hn(document,"keyup",ct),hn(document,"mouseover",ct)}function Tg(it){it.keyCode==16&&(this.doc.sel.shift=!1),rn(this,it)}function Fu(it){var at=this;if(!(it.target&&it.target!=at.display.input.getField())&&!(Yo(at.display,it)||rn(at,it)||it.ctrlKey&&!it.altKey||ht&&it.metaKey)){var ct=it.keyCode,dt=it.charCode;if(Rt&&ct==hd){hd=null,Kn(it);return}if(!(Rt&&(!it.which||it.which<10)&&Sf(at,it))){var mt=String.fromCharCode(dt==null?ct:dt);mt!="\b"&&(xf(at,it,mt)||at.display.input.onKeyPress(it))}}}var nm=400,Dg=function(it,at,ct){this.time=it,this.pos=at,this.button=ct};Dg.prototype.compare=function(it,at,ct){return this.time+nm>it&&je(at,this.pos)==0&&ct==this.button};var Ud,dd;function Og(it,at){var ct=+new Date;return dd&&dd.compare(ct,it,at)?(Ud=dd=null,"triple"):Ud&&Ud.compare(ct,it,at)?(dd=new Dg(ct,it,at),Ud=null,"double"):(Ud=new Dg(ct,it,at),dd=null,"single")}function Mu(it){var at=this,ct=at.display;if(!(rn(at,it)||ct.activeTouch&&ct.input.supportsTouch())){if(ct.input.ensurePolled(),ct.shift=it.shiftKey,Yo(ct,it)){qt||(ct.scroller.draggable=!1,setTimeout(function(){return ct.scroller.draggable=!0},100));return}if(!Cf(at,it)){var dt=Gi(at,it),mt=An(it),Ft=dt?Og(dt,mt):"single";window.focus(),mt==1&&at.state.selectingText&&at.state.selectingText(it),!(dt&&Ig(at,mt,dt,Ft,it))&&(mt==1?dt?im(at,dt,Ft,it):Wi(it)==ct.scroller&&Kn(it):mt==2?(dt&&ff(at.doc,dt),setTimeout(function(){return ct.input.focus()},20)):mt==3&&(Et?at.display.input.onContextMenu(it):dr(at)))}}}function Ig(it,at,ct,dt,mt){var Ft="Click";return dt=="double"?Ft="Double"+Ft:dt=="triple"&&(Ft="Triple"+Ft),Ft=(at==1?"Left":at==2?"Middle":"Right")+Ft,ud(it,Mg(Ft,mt),mt,function(Ot){if(typeof Ot=="string"&&(Ot=bh[Ot]),!Ot)return!1;var Vt=!1;try{it.isReadOnly()&&(it.state.suppressEdits=!0),Vt=Ot(it,ct)!=Pn}finally{it.state.suppressEdits=!1}return Vt})}function Pf(it,at,ct){var dt=it.getOption("configureMouse"),mt=dt?dt(it,at,ct):{};if(mt.unit==null){var Ft=st?ct.shiftKey&&ct.metaKey:ct.altKey;mt.unit=Ft?"rectangle":at=="single"?"char":at=="double"?"word":"line"}return(mt.extend==null||it.doc.extend)&&(mt.extend=it.doc.extend||ct.shiftKey),mt.addNew==null&&(mt.addNew=ht?ct.metaKey:ct.ctrlKey),mt.moveOnDrag==null&&(mt.moveOnDrag=!(ht?ct.altKey:ct.ctrlKey)),mt}function im(it,at,ct,dt){ue?setTimeout(an(Mo,it),0):it.curOp.focus=Ce();var mt=Pf(it,ct,dt),Ft=it.doc.sel,Ot;it.options.dragDrop&&gn&&!it.isReadOnly()&&ct=="single"&&(Ot=Ft.contains(at))>-1&&(je((Ot=Ft.ranges[Ot]).from(),at)<0||at.xRel>0)&&(je(Ot.to(),at)>0||at.xRel<0)?_g(it,dt,at,mt):ev(it,dt,at,mt)}function _g(it,at,ct,dt){var mt=it.display,Ft=!1,Ot=Qo(it,function(se){qt&&(mt.scroller.draggable=!1),it.state.draggingText=!1,Ge(mt.wrapper.ownerDocument,"mouseup",Ot),Ge(mt.wrapper.ownerDocument,"mousemove",Vt),Ge(mt.scroller,"dragstart",Ht),Ge(mt.scroller,"drop",Ot),Ft||(Kn(se),dt.addNew||ff(it.doc,ct,null,null,dt.extend),qt&&!Ae||ue&&It==9?setTimeout(function(){mt.wrapper.ownerDocument.body.focus({preventScroll:!0}),mt.input.focus()},20):mt.input.focus())}),Vt=function(se){Ft=Ft||Math.abs(at.clientX-se.clientX)+Math.abs(at.clientY-se.clientY)>=10},Ht=function(){return Ft=!0};qt&&(mt.scroller.draggable=!0),it.state.draggingText=Ot,Ot.copy=!dt.moveOnDrag,mt.scroller.dragDrop&&mt.scroller.dragDrop(),hn(mt.wrapper.ownerDocument,"mouseup",Ot),hn(mt.wrapper.ownerDocument,"mousemove",Vt),hn(mt.scroller,"dragstart",Ht),hn(mt.scroller,"drop",Ot),dr(it),setTimeout(function(){return mt.input.focus()},20)}function Rg(it,at,ct){if(ct=="char")return new la(at,at);if(ct=="word")return it.findWordAt(at);if(ct=="line")return new la(We(at.line,0),hi(it.doc,We(at.line+1,0)));var dt=ct(it,at);return new la(dt.from,dt.to)}function ev(it,at,ct,dt){var mt=it.display,Ft=it.doc;Kn(at);var Ot,Vt,Ht=Ft.sel,se=Ht.ranges;if(dt.addNew&&!dt.extend?(Vt=Ft.sel.contains(ct),Vt>-1?Ot=se[Vt]:Ot=new la(ct,ct)):(Ot=Ft.sel.primary(),Vt=Ft.sel.primIndex),dt.unit=="rectangle")dt.addNew||(Ot=new la(ct,ct)),ct=Gi(it,at,!0,!0),Vt=-1;else{var ze=Rg(it,ct,dt.unit);dt.extend?Ot=cf(Ot,ze.anchor,ze.head,dt.extend):Ot=ze}dt.addNew?Vt==-1?(Vt=se.length,Gs(Ft,cu(it,se.concat([Ot]),Vt),{scroll:!1,origin:"*mouse"})):se.length>1&&se[Vt].empty()&&dt.unit=="char"&&!dt.extend?(Gs(Ft,cu(it,se.slice(0,Vt).concat(se.slice(Vt+1)),0),{scroll:!1,origin:"*mouse"}),Ht=Ft.sel):Mh(Ft,Vt,Ot,dn):(Vt=0,Gs(Ft,new Kl([Ot],0),dn),Ht=Ft.sel);var de=ct;function xn(yr){if(je(de,yr)!=0)if(de=yr,dt.unit=="rectangle"){for(var Hr=[],wo=it.options.tabSize,mr=oe(On(Ft,ct.line).text,ct.ch,wo),Go=oe(On(Ft,yr.line).text,yr.ch,wo),ka=Math.min(mr,Go),fs=Math.max(mr,Go),Ra=Math.min(ct.line,yr.line),al=Math.min(it.lastLine(),Math.max(ct.line,yr.line));Ra<=al;Ra++){var Hs=On(Ft,Ra).text,as=jn(Hs,ka,wo);ka==fs?Hr.push(new la(We(Ra,as),We(Ra,as))):Hs.length>as&&Hr.push(new la(We(Ra,as),We(Ra,jn(Hs,fs,wo))))}Hr.length||Hr.push(new la(ct,ct)),Gs(Ft,cu(it,Ht.ranges.slice(0,Vt).concat(Hr),Vt),{origin:"*mouse",scroll:!1}),it.scrollIntoView(yr)}else{var ml=Ot,Ts=Rg(it,yr,dt.unit),ss=ml.anchor,na;je(Ts.anchor,ss)>0?(na=Ts.head,ss=pi(ml.from(),Ts.anchor)):(na=Ts.anchor,ss=Mi(ml.to(),Ts.head));var Ga=Ht.ranges.slice(0);Ga[Vt]=rm(it,new la(hi(Ft,ss),na)),Gs(Ft,cu(it,Ga,Vt),dn)}}var un=mt.wrapper.getBoundingClientRect(),wi=0;function Li(yr){var Hr=++wi,wo=Gi(it,yr,!0,dt.unit=="rectangle");if(wo)if(je(wo,de)!=0){it.curOp.focus=Ce(),xn(wo);var mr=Nr(mt,Ft);(wo.line>=mr.to||wo.line<mr.from)&&setTimeout(Qo(it,function(){wi==Hr&&Li(yr)}),150)}else{var Go=yr.clientY<un.top?-20:yr.clientY>un.bottom?20:0;Go&&setTimeout(Qo(it,function(){wi==Hr&&(mt.scroller.scrollTop+=Go,Li(yr))}),50)}}function ji(yr){it.state.selectingText=!1,wi=1/0,yr&&(Kn(yr),mt.input.focus()),Ge(mt.wrapper.ownerDocument,"mousemove",lr),Ge(mt.wrapper.ownerDocument,"mouseup",_r),Ft.history.lastSelOrigin=null}var lr=Qo(it,function(yr){yr.buttons===0||!An(yr)?ji(yr):Li(yr)}),_r=Qo(it,ji);it.state.selectingText=_r,hn(mt.wrapper.ownerDocument,"mousemove",lr),hn(mt.wrapper.ownerDocument,"mouseup",_r)}function rm(it,at){var ct=at.anchor,dt=at.head,mt=On(it.doc,ct.line);if(je(ct,dt)==0&&ct.sticky==dt.sticky)return at;var Ft=vn(mt);if(!Ft)return at;var Ot=Le(Ft,ct.ch,ct.sticky),Vt=Ft[Ot];if(Vt.from!=ct.ch&&Vt.to!=ct.ch)return at;var Ht=Ot+(Vt.from==ct.ch==(Vt.level!=1)?0:1);if(Ht==0||Ht==Ft.length)return at;var se;if(dt.line!=ct.line)se=(dt.line-ct.line)*(it.doc.direction=="ltr"?1:-1)>0;else{var ze=Le(Ft,dt.ch,dt.sticky),de=ze-Ot||(dt.ch-ct.ch)*(Vt.level==1?-1:1);ze==Ht-1||ze==Ht?se=de<0:se=de>0}var xn=Ft[Ht+(se?-1:0)],un=se==(xn.level==1),wi=un?xn.from:xn.to,Li=un?"after":"before";return ct.ch==wi&&ct.sticky==Li?at:new la(new We(ct.line,wi,Li),dt)}function wf(it,at,ct,dt){var mt,Ft;if(at.touches)mt=at.touches[0].clientX,Ft=at.touches[0].clientY;else try{mt=at.clientX,Ft=at.clientY}catch(xn){return!1}if(mt>=Math.floor(it.display.gutters.getBoundingClientRect().right))return!1;dt&&Kn(at);var Ot=it.display,Vt=Ot.lineDiv.getBoundingClientRect();if(Ft>Vt.bottom||!Ln(it,ct))return ei(at);Ft-=Vt.top-Ot.viewOffset;for(var Ht=0;Ht<it.display.gutterSpecs.length;++Ht){var se=Ot.gutters.childNodes[Ht];if(se&&se.getBoundingClientRect().right>=mt){var ze=Ze(it.doc,Ft),de=it.display.gutterSpecs[Ht];return Je(it,ct,it,ze,de.className,at),ei(at)}}}function Cf(it,at){return wf(it,at,"gutterClick",!0)}function Ef(it,at){Yo(it.display,at)||om(it,at)||rn(it,at,"contextmenu")||Et||it.display.input.onContextMenu(at)}function om(it,at){return Ln(it,"gutterContextMenu")?wf(it,at,"gutterContextMenu",!1):!1}function Lf(it){it.display.wrapper.className=it.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+it.options.theme.replace(/(^|\s)\s*/g," cm-s-"),su(it)}var Nh={toString:function(){return"CodeMirror.Init"}},jg={},Ac={};function am(it){var at=it.optionHandlers;function ct(dt,mt,Ft,Ot){it.defaults[dt]=mt,Ft&&(at[dt]=Ot?function(Vt,Ht,se){se!=Nh&&Ft(Vt,Ht,se)}:Ft)}it.defineOption=ct,it.Init=Nh,ct("value","",function(dt,mt){return dt.setValue(mt)},!0),ct("mode",null,function(dt,mt){dt.doc.modeOption=mt,Zo(dt)},!0),ct("indentUnit",2,Zo,!0),ct("indentWithTabs",!1),ct("smartIndent",!0),ct("tabSize",4,function(dt){yc(dt),su(dt),wr(dt)},!0),ct("lineSeparator",null,function(dt,mt){if(dt.doc.lineSep=mt,!!mt){var Ft=[],Ot=dt.doc.first;dt.doc.iter(function(Ht){for(var se=0;;){var ze=Ht.text.indexOf(mt,se);if(ze==-1)break;se=ze+mt.length,Ft.push(We(Ot,ze))}Ot++});for(var Vt=Ft.length-1;Vt>=0;Vt--)od(dt.doc,mt,Ft[Vt],We(Ft[Vt].line,Ft[Vt].ch+mt.length))}}),ct("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(dt,mt,Ft){dt.state.specialChars=new RegExp(mt.source+(mt.test(" ")?"":"| "),"g"),Ft!=Nh&&dt.refresh()}),ct("specialCharPlaceholder",Wr,function(dt){return dt.refresh()},!0),ct("electricChars",!0),ct("inputStyle",et?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),ct("spellcheck",!1,function(dt,mt){return dt.getInputField().spellcheck=mt},!0),ct("autocorrect",!1,function(dt,mt){return dt.getInputField().autocorrect=mt},!0),ct("autocapitalize",!1,function(dt,mt){return dt.getInputField().autocapitalize=mt},!0),ct("rtlMoveVisually",!gt),ct("wholeLineUpdateBefore",!0),ct("theme","default",function(dt){Lf(dt),Nl(dt)},!0),ct("keyMap","default",function(dt,mt,Ft){var Ot=ld(mt),Vt=Ft!=Nh&&ld(Ft);Vt&&Vt.detach&&Vt.detach(dt,Ot),Ot.attach&&Ot.attach(dt,Vt||null)}),ct("extraKeys",null),ct("configureMouse",null),ct("lineWrapping",!1,sm,!0),ct("gutters",[],function(dt,mt){dt.display.gutterSpecs=Ss(mt,dt.options.lineNumbers),Nl(dt)},!0),ct("fixedGutter",!0,function(dt,mt){dt.display.gutters.style.left=mt?Po(dt.display)+"px":"0",dt.refresh()},!0),ct("coverGutterNextToScrollbar",!1,function(dt){return is(dt)},!0),ct("scrollbarStyle","native",function(dt){kl(dt),is(dt),dt.display.scrollbars.setScrollTop(dt.doc.scrollTop),dt.display.scrollbars.setScrollLeft(dt.doc.scrollLeft)},!0),ct("lineNumbers",!1,function(dt,mt){dt.display.gutterSpecs=Ss(dt.options.gutters,mt),Nl(dt)},!0),ct("firstLineNumber",1,Nl,!0),ct("lineNumberFormatter",function(dt){return dt},Nl,!0),ct("showCursorWhenSelecting",!1,er,!0),ct("resetSelectionOnContextMenu",!0),ct("lineWiseCopyCut",!0),ct("pasteLinesPerSelection",!0),ct("selectionsMayTouch",!1),ct("readOnly",!1,function(dt,mt){mt=="nocursor"&&(Za(dt),dt.display.input.blur()),dt.display.input.readOnlyChanged(mt)}),ct("screenReaderLabel",null,function(dt,mt){mt=mt===""?null:mt,dt.display.input.screenReaderLabelChanged(mt)}),ct("disableInput",!1,function(dt,mt){mt||dt.display.input.reset()},!0),ct("dragDrop",!0,Ff),ct("allowDropFileTypes",null),ct("cursorBlinkRate",530),ct("cursorScrollMargin",0),ct("cursorHeight",1,er,!0),ct("singleCursorHeightPerLine",!0,er,!0),ct("workTime",100),ct("workDelay",100),ct("flattenSpans",!0,yc,!0),ct("addModeClass",!1,yc,!0),ct("pollInterval",100),ct("undoDepth",200,function(dt,mt){return dt.doc.history.undoDepth=mt}),ct("historyEventDelay",1250),ct("viewportMargin",10,function(dt){return dt.refresh()},!0),ct("maxHighlightLength",1e4,yc,!0),ct("moveInputWithCursor",!0,function(dt,mt){mt||dt.display.input.resetPosition()}),ct("tabindex",null,function(dt,mt){return dt.display.input.getField().tabIndex=mt||""}),ct("autofocus",null),ct("direction","ltr",function(dt,mt){return dt.doc.setDirection(mt)},!0),ct("phrases",null)}function Ff(it,at,ct){var dt=ct&&ct!=Nh;if(!at!=!dt){var mt=it.display.dragFunctions,Ft=at?hn:Ge;Ft(it.display.scroller,"dragstart",mt.start),Ft(it.display.scroller,"dragenter",mt.enter),Ft(it.display.scroller,"dragover",mt.over),Ft(it.display.scroller,"dragleave",mt.leave),Ft(it.display.scroller,"drop",mt.drop)}}function sm(it){it.options.lineWrapping?(we(it.display.wrapper,"CodeMirror-wrap"),it.display.sizer.style.minWidth="",it.display.sizerWidth=null):(Dt(it.display.wrapper,"CodeMirror-wrap"),Lr(it)),Ri(it),wr(it),su(it),setTimeout(function(){return is(it)},100)}function qo(it,at){var ct=this;if(!(this instanceof qo))return new qo(it,at);this.options=at=at?Ke(at):{},Ke(jg,at,!1);var dt=at.value;typeof dt=="string"?dt=new As(dt,at.mode,null,at.lineSeparator,at.direction):at.mode&&(dt.modeOption=at.mode),this.doc=dt;var mt=new qo.inputStyles[at.inputStyle](this),Ft=this.display=new Eh(it,dt,mt,at);Ft.wrapper.CodeMirror=this,Lf(this),at.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),kl(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Xt,keySeq:null,specialChars:null},at.autofocus&&!et&&Ft.input.focus(),ue&&It<11&&setTimeout(function(){return ct.display.input.reset(!0)},20),Yd(this),Al(),Fn(this),this.curOp.forceUpdate=!0,uf(this,dt),at.autofocus&&!et||this.hasFocus()?setTimeout(function(){ct.hasFocus()&&!ct.state.focused&&po(ct)},20):Za(this);for(var Ot in Ac)Ac.hasOwnProperty(Ot)&&Ac[Ot](this,at[Ot],Nh);rs(this),at.finishInit&&at.finishInit(this);for(var Vt=0;Vt<cd.length;++Vt)cd[Vt](this);sr(this),qt&&at.lineWrapping&&getComputedStyle(Ft.lineDiv).textRendering=="optimizelegibility"&&(Ft.lineDiv.style.textRendering="auto")}qo.defaults=jg,qo.optionHandlers=Ac;function Yd(it){var at=it.display;hn(at.scroller,"mousedown",Qo(it,Mu)),ue&&It<11?hn(at.scroller,"dblclick",Qo(it,function(Ht){if(!rn(it,Ht)){var se=Gi(it,Ht);if(!(!se||Cf(it,Ht)||Yo(it.display,Ht))){Kn(Ht);var ze=it.findWordAt(se);ff(it.doc,ze.anchor,ze.head)}}})):hn(at.scroller,"dblclick",function(Ht){return rn(it,Ht)||Kn(Ht)}),hn(at.scroller,"contextmenu",function(Ht){return Ef(it,Ht)}),hn(at.input.getField(),"contextmenu",function(Ht){at.scroller.contains(Ht.target)||Ef(it,Ht)});var ct,dt={end:0};function mt(){at.activeTouch&&(ct=setTimeout(function(){return at.activeTouch=null},1e3),dt=at.activeTouch,dt.end=+new Date)}function Ft(Ht){if(Ht.touches.length!=1)return!1;var se=Ht.touches[0];return se.radiusX<=1&&se.radiusY<=1}function Ot(Ht,se){if(se.left==null)return!0;var ze=se.left-Ht.left,de=se.top-Ht.top;return ze*ze+de*de>20*20}hn(at.scroller,"touchstart",function(Ht){if(!rn(it,Ht)&&!Ft(Ht)&&!Cf(it,Ht)){at.input.ensurePolled(),clearTimeout(ct);var se=+new Date;at.activeTouch={start:se,moved:!1,prev:se-dt.end<=300?dt:null},Ht.touches.length==1&&(at.activeTouch.left=Ht.touches[0].pageX,at.activeTouch.top=Ht.touches[0].pageY)}}),hn(at.scroller,"touchmove",function(){at.activeTouch&&(at.activeTouch.moved=!0)}),hn(at.scroller,"touchend",function(Ht){var se=at.activeTouch;if(se&&!Yo(at,Ht)&&se.left!=null&&!se.moved&&new Date-se.start<300){var ze=it.coordsChar(at.activeTouch,"page"),de;!se.prev||Ot(se,se.prev)?de=new la(ze,ze):!se.prev.prev||Ot(se,se.prev.prev)?de=it.findWordAt(ze):de=new la(We(ze.line,0),hi(it.doc,We(ze.line+1,0))),it.setSelection(de.anchor,de.head),it.focus(),Kn(Ht)}mt()}),hn(at.scroller,"touchcancel",mt),hn(at.scroller,"scroll",function(){at.scroller.clientHeight&&(Gl(it,at.scroller.scrollTop),Hl(it,at.scroller.scrollLeft,!0),Je(it,"scroll",it))}),hn(at.scroller,"mousewheel",function(Ht){return xs(it,Ht)}),hn(at.scroller,"DOMMouseScroll",function(Ht){return xs(it,Ht)}),hn(at.wrapper,"scroll",function(){return at.wrapper.scrollTop=at.wrapper.scrollLeft=0}),at.dragFunctions={enter:function(Ht){rn(it,Ht)||Si(Ht)},over:function(Ht){rn(it,Ht)||($p(it,Ht),Si(Ht))},start:function(Ht){return Qp(it,Ht)},drop:Qo(it,wg),leave:function(Ht){rn(it,Ht)||qp(it)}};var Vt=at.input.getField();hn(Vt,"keyup",function(Ht){return Tg.call(it,Ht)}),hn(Vt,"keydown",Qo(it,Bg)),hn(Vt,"keypress",Qo(it,Fu)),hn(Vt,"focus",function(Ht){return po(it,Ht)}),hn(Vt,"blur",function(Ht){return Za(it,Ht)})}var cd=[];qo.defineInitHook=function(it){return cd.push(it)};function cs(it,at,ct,dt){var mt=it.doc,Ft;ct==null&&(ct="add"),ct=="smart"&&(mt.mode.indent?Ft=Xr(it,at).state:ct="prev");var Ot=it.options.tabSize,Vt=On(mt,at),Ht=oe(Vt.text,null,Ot);Vt.stateAfter&&(Vt.stateAfter=null);var se=Vt.text.match(/^\s*/)[0],ze;if(!dt&&!/\S/.test(Vt.text))ze=0,ct="not";else if(ct=="smart"&&(ze=mt.mode.indent(Ft,Vt.text.slice(se.length),Vt.text),ze==Pn||ze>150)){if(!dt)return;ct="prev"}ct=="prev"?at>mt.first?ze=oe(On(mt,at-1).text,null,Ot):ze=0:ct=="add"?ze=Ht+it.options.indentUnit:ct=="subtract"?ze=Ht-it.options.indentUnit:typeof ct=="number"&&(ze=Ht+ct),ze=Math.max(0,ze);var de="",xn=0;if(it.options.indentWithTabs)for(var un=Math.floor(ze/Ot);un;--un)xn+=Ot,de+=" ";if(xn<ze&&(de+=Sn(ze-xn)),de!=se)return od(mt,de,We(at,0),We(at,se.length),"+input"),Vt.stateAfter=null,!0;for(var wi=0;wi<mt.sel.ranges.length;wi++){var Li=mt.sel.ranges[wi];if(Li.head.line==at&&Li.head.ch<se.length){var ji=We(at,se.length);Mh(mt,wi,new la(ji,ji));break}}}var ol=null;function fd(it){ol=it}function Tc(it,at,ct,dt,mt){var Ft=it.doc;it.display.shift=!1,dt||(dt=Ft.sel);var Ot=+new Date-200,Vt=mt=="paste"||it.state.pasteIncoming>Ot,Ht=Oi(at),se=null;if(Vt&&dt.ranges.length>1)if(ol&&ol.text.join(`
`)==at){if(dt.ranges.length%ol.text.length==0){se=[];for(var ze=0;ze<ol.text.length;ze++)se.push(Ft.splitLines(ol.text[ze]))}}else Ht.length==dt.ranges.length&&it.options.pasteLinesPerSelection&&(se=Mn(Ht,function(lr){return[lr]}));for(var de=it.curOp.updateInput,xn=dt.ranges.length-1;xn>=0;xn--){var un=dt.ranges[xn],wi=un.from(),Li=un.to();un.empty()&&(ct&&ct>0?wi=We(wi.line,wi.ch-ct):it.state.overwrite&&!Vt?Li=We(Li.line,Math.min(On(Ft,Li.line).text.length,Li.ch+ee(Ht).length)):Vt&&ol&&ol.lineWise&&ol.text.join(`
`)==Ht.join(`
`)&&(wi=Li=We(wi.line,0)));var ji={from:wi,to:Li,text:se?se[xn%se.length]:Ht,origin:mt||(Vt?"paste":it.state.cutIncoming>Ot?"cut":"+input")};kh(it.doc,ji),ir(it,"inputRead",it,ji)}at&&!Vt&&Zg(it,at),zs(it),it.curOp.updateInput<2&&(it.curOp.updateInput=de),it.curOp.typing=!0,it.state.pasteIncoming=it.state.cutIncoming=-1}function zg(it,at){var ct=it.clipboardData&&it.clipboardData.getData("Text");if(ct)return it.preventDefault(),!at.isReadOnly()&&!at.options.disableInput&&Cr(at,function(){return Tc(at,ct,0,null,"paste")}),!0}function Zg(it,at){if(!(!it.options.electricChars||!it.options.smartIndent))for(var ct=it.doc.sel,dt=ct.ranges.length-1;dt>=0;dt--){var mt=ct.ranges[dt];if(!(mt.head.ch>100||dt&&ct.ranges[dt-1].head.line==mt.head.line)){var Ft=it.getModeAt(mt.head),Ot=!1;if(Ft.electricChars){for(var Vt=0;Vt<Ft.electricChars.length;Vt++)if(at.indexOf(Ft.electricChars.charAt(Vt))>-1){Ot=cs(it,mt.head.line,"smart");break}}else Ft.electricInput&&Ft.electricInput.test(On(it.doc,mt.head.line).text.slice(0,mt.head.ch))&&(Ot=cs(it,mt.head.line,"smart"));Ot&&ir(it,"electricInput",it,mt.head.line)}}}function Gg(it){for(var at=[],ct=[],dt=0;dt<it.doc.sel.ranges.length;dt++){var mt=it.doc.sel.ranges[dt].head.line,Ft={anchor:We(mt,0),head:We(mt+1,0)};ct.push(Ft),at.push(it.getRange(Ft.anchor,Ft.head))}return{text:at,ranges:ct}}function Hg(it,at,ct,dt){it.setAttribute("autocorrect",ct?"":"off"),it.setAttribute("autocapitalize",dt?"":"off"),it.setAttribute("spellcheck",!!at)}function Wg(){var it=Gt("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),at=Gt("div",[it],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return qt?it.style.width="1000px":it.setAttribute("wrap","off"),Bt&&(it.style.border="1px solid black"),Hg(it),at}function Bh(it){var at=it.optionHandlers,ct=it.helpers={};it.prototype={constructor:it,focus:function(){window.focus(),this.display.input.focus()},setOption:function(dt,mt){var Ft=this.options,Ot=Ft[dt];Ft[dt]==mt&&dt!="mode"||(Ft[dt]=mt,at.hasOwnProperty(dt)&&Qo(this,at[dt])(this,mt,Ot),Je(this,"optionChange",this,dt))},getOption:function(dt){return this.options[dt]},getDoc:function(){return this.doc},addKeyMap:function(dt,mt){this.state.keyMaps[mt?"push":"unshift"](ld(dt))},removeKeyMap:function(dt){for(var mt=this.state.keyMaps,Ft=0;Ft<mt.length;++Ft)if(mt[Ft]==dt||mt[Ft].name==dt)return mt.splice(Ft,1),!0},addOverlay:Bo(function(dt,mt){var Ft=dt.token?dt:it.getMode(this.options,dt);if(Ft.startState)throw new Error("Overlays may not be stateful.");ui(this.state.overlays,{mode:Ft,modeSpec:dt,opaque:mt&&mt.opaque,priority:mt&&mt.priority||0},function(Ot){return Ot.priority}),this.state.modeGen++,wr(this)}),removeOverlay:Bo(function(dt){for(var mt=this.state.overlays,Ft=0;Ft<mt.length;++Ft){var Ot=mt[Ft].modeSpec;if(Ot==dt||typeof dt=="string"&&Ot.name==dt){mt.splice(Ft,1),this.state.modeGen++,wr(this);return}}}),indentLine:Bo(function(dt,mt,Ft){typeof mt!="string"&&typeof mt!="number"&&(mt==null?mt=this.options.smartIndent?"smart":"prev":mt=mt?"add":"subtract"),wn(this.doc,dt)&&cs(this,dt,mt,Ft)}),indentSelection:Bo(function(dt){for(var mt=this.doc.sel.ranges,Ft=-1,Ot=0;Ot<mt.length;Ot++){var Vt=mt[Ot];if(Vt.empty())Vt.head.line>Ft&&(cs(this,Vt.head.line,dt,!0),Ft=Vt.head.line,Ot==this.doc.sel.primIndex&&zs(this));else{var Ht=Vt.from(),se=Vt.to(),ze=Math.max(Ft,Ht.line);Ft=Math.min(this.lastLine(),se.line-(se.ch?0:1))+1;for(var de=ze;de<Ft;++de)cs(this,de,dt);var xn=this.doc.sel.ranges;Ht.ch==0&&mt.length==xn.length&&xn[Ot].from().ch>0&&Mh(this.doc,Ot,new la(Ht,xn[Ot].to()),De)}}}),getTokenAt:function(dt,mt){return Ii(this,dt,mt)},getLineTokens:function(dt,mt){return Ii(this,We(dt),mt,!0)},getTokenTypeAt:function(dt){dt=hi(this.doc,dt);var mt=vr(this,On(this.doc,dt.line)),Ft=0,Ot=(mt.length-1)/2,Vt=dt.ch,Ht;if(Vt==0)Ht=mt[2];else for(;;){var se=Ft+Ot>>1;if((se?mt[se*2-1]:0)>=Vt)Ot=se;else if(mt[se*2+1]<Vt)Ft=se+1;else{Ht=mt[se*2+2];break}}var ze=Ht?Ht.indexOf("overlay "):-1;return ze<0?Ht:ze==0?null:Ht.slice(0,ze-1)},getModeAt:function(dt){var mt=this.doc.mode;return mt.innerMode?it.innerMode(mt,this.getTokenAt(dt).state).mode:mt},getHelper:function(dt,mt){return this.getHelpers(dt,mt)[0]},getHelpers:function(dt,mt){var Ft=[];if(!ct.hasOwnProperty(mt))return Ft;var Ot=ct[mt],Vt=this.getModeAt(dt);if(typeof Vt[mt]=="string")Ot[Vt[mt]]&&Ft.push(Ot[Vt[mt]]);else if(Vt[mt])for(var Ht=0;Ht<Vt[mt].length;Ht++){var se=Ot[Vt[mt][Ht]];se&&Ft.push(se)}else Vt.helperType&&Ot[Vt.helperType]?Ft.push(Ot[Vt.helperType]):Ot[Vt.name]&&Ft.push(Ot[Vt.name]);for(var ze=0;ze<Ot._global.length;ze++){var de=Ot._global[ze];de.pred(Vt,this)&&qe(Ft,de.val)==-1&&Ft.push(de.val)}return Ft},getStateAfter:function(dt,mt){var Ft=this.doc;return dt=oi(Ft,dt==null?Ft.first+Ft.size-1:dt),Xr(this,dt+1,mt).state},cursorCoords:function(dt,mt){var Ft,Ot=this.doc.sel.primary();return dt==null?Ft=Ot.head:typeof dt=="object"?Ft=hi(this.doc,dt):Ft=dt?Ot.from():Ot.to(),uo(this,Ft,mt||"page")},charCoords:function(dt,mt){return ro(this,hi(this.doc,dt),mt||"page")},coordsChar:function(dt,mt){return dt=Lo(this,dt,mt||"page"),xe(this,dt.left,dt.top)},lineAtHeight:function(dt,mt){return dt=Lo(this,{top:dt,left:0},mt||"page").top,Ze(this.doc,dt+this.display.viewOffset)},heightAtLine:function(dt,mt,Ft){var Ot=!1,Vt;if(typeof dt=="number"){var Ht=this.doc.first+this.doc.size-1;dt<this.doc.first?dt=this.doc.first:dt>Ht&&(dt=Ht,Ot=!0),Vt=On(this.doc,dt)}else Vt=dt;return Ma(this,Vt,{top:0,left:0},mt||"page",Ft||Ot).top+(Ot?this.doc.height-qi(Vt):0)},defaultTextHeight:function(){return Sr(this.display)},defaultCharWidth:function(){return xo(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(dt,mt,Ft,Ot,Vt){var Ht=this.display;dt=uo(this,hi(this.doc,dt));var se=dt.bottom,ze=dt.left;if(mt.style.position="absolute",mt.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(mt),Ht.sizer.appendChild(mt),Ot=="over")se=dt.top;else if(Ot=="above"||Ot=="near"){var de=Math.max(Ht.wrapper.clientHeight,this.doc.height),xn=Math.max(Ht.sizer.clientWidth,Ht.lineSpace.clientWidth);(Ot=="above"||dt.bottom+mt.offsetHeight>de)&&dt.top>mt.offsetHeight?se=dt.top-mt.offsetHeight:dt.bottom+mt.offsetHeight<=de&&(se=dt.bottom),ze+mt.offsetWidth>xn&&(ze=xn-mt.offsetWidth)}mt.style.top=se+"px",mt.style.left=mt.style.right="",Vt=="right"?(ze=Ht.sizer.clientWidth-mt.offsetWidth,mt.style.right="0px"):(Vt=="left"?ze=0:Vt=="middle"&&(ze=(Ht.sizer.clientWidth-mt.offsetWidth)/2),mt.style.left=ze+"px"),Ft&&cl(this,{left:ze,top:se,right:ze+mt.offsetWidth,bottom:se+mt.offsetHeight})},triggerOnKeyDown:Bo(Bg),triggerOnKeyPress:Bo(Fu),triggerOnKeyUp:Tg,triggerOnMouseDown:Bo(Mu),execCommand:function(dt){if(bh.hasOwnProperty(dt))return bh[dt].call(null,this)},triggerElectric:Bo(function(dt){Zg(this,dt)}),findPosH:function(dt,mt,Ft,Ot){var Vt=1;mt<0&&(Vt=-1,mt=-mt);for(var Ht=hi(this.doc,dt),se=0;se<mt&&(Ht=Dc(this.doc,Ht,Vt,Ft,Ot),!Ht.hitSide);++se);return Ht},moveH:Bo(function(dt,mt){var Ft=this;this.extendSelectionsBy(function(Ot){return Ft.display.shift||Ft.doc.extend||Ot.empty()?Dc(Ft.doc,Ot.head,dt,mt,Ft.options.rtlMoveVisually):dt<0?Ot.from():Ot.to()},sn)}),deleteH:Bo(function(dt,mt){var Ft=this.doc.sel,Ot=this.doc;Ft.somethingSelected()?Ot.replaceSelection("",null,"+delete"):pl(this,function(Vt){var Ht=Dc(Ot,Vt.head,dt,mt,!1);return dt<0?{from:Ht,to:Vt.head}:{from:Vt.head,to:Ht}})}),findPosV:function(dt,mt,Ft,Ot){var Vt=1,Ht=Ot;mt<0&&(Vt=-1,mt=-mt);for(var se=hi(this.doc,dt),ze=0;ze<mt;++ze){var de=uo(this,se,"div");if(Ht==null?Ht=de.left:de.left=Ht,se=Ah(this,de,Vt,Ft),se.hitSide)break}return se},moveV:Bo(function(dt,mt){var Ft=this,Ot=this.doc,Vt=[],Ht=!this.display.shift&&!Ot.extend&&Ot.sel.somethingSelected();if(Ot.extendSelectionsBy(function(ze){if(Ht)return dt<0?ze.from():ze.to();var de=uo(Ft,ze.head,"div");ze.goalColumn!=null&&(de.left=ze.goalColumn),Vt.push(de.left);var xn=Ah(Ft,de,dt,mt);return mt=="page"&&ze==Ot.sel.primary()&&uu(Ft,ro(Ft,xn,"div").top-de.top),xn},sn),Vt.length)for(var se=0;se<Ot.sel.ranges.length;se++)Ot.sel.ranges[se].goalColumn=Vt[se]}),findWordAt:function(dt){var mt=this.doc,Ft=On(mt,dt.line).text,Ot=dt.ch,Vt=dt.ch;if(Ft){var Ht=this.getHelper(dt,"wordChars");(dt.sticky=="before"||Vt==Ft.length)&&Ot?--Ot:++Vt;for(var se=Ft.charAt(Ot),ze=zt(se,Ht)?function(de){return zt(de,Ht)}:/\s/.test(se)?function(de){return/\s/.test(de)}:function(de){return!/\s/.test(de)&&!zt(de)};Ot>0&&ze(Ft.charAt(Ot-1));)--Ot;for(;Vt<Ft.length&&ze(Ft.charAt(Vt));)++Vt}return new la(We(dt.line,Ot),We(dt.line,Vt))},toggleOverwrite:function(dt){dt!=null&&dt==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?we(this.display.cursorDiv,"CodeMirror-overwrite"):Dt(this.display.cursorDiv,"CodeMirror-overwrite"),Je(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Ce()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Bo(function(dt,mt){Ml(this,dt,mt)}),getScrollInfo:function(){var dt=this.display.scroller;return{left:dt.scrollLeft,top:dt.scrollTop,height:dt.scrollHeight-Ko(this)-this.display.barHeight,width:dt.scrollWidth-Ko(this)-this.display.barWidth,clientHeight:Xs(this),clientWidth:hs(this)}},scrollIntoView:Bo(function(dt,mt){dt==null?(dt={from:this.doc.sel.primary().head,to:null},mt==null&&(mt=this.options.cursorScrollMargin)):typeof dt=="number"?dt={from:We(dt,0),to:null}:dt.from==null&&(dt={from:dt,to:null}),dt.to||(dt.to=dt.from),dt.margin=mt||0,dt.from.line!=null?Ro(this,dt):hu(this,dt.from,dt.to,dt.margin)}),setSize:Bo(function(dt,mt){var Ft=this,Ot=function(Ht){return typeof Ht=="number"||/^\d+$/.test(String(Ht))?Ht+"px":Ht};dt!=null&&(this.display.wrapper.style.width=Ot(dt)),mt!=null&&(this.display.wrapper.style.height=Ot(mt)),this.options.lineWrapping&&au(this);var Vt=this.display.viewFrom;this.doc.iter(Vt,this.display.viewTo,function(Ht){if(Ht.widgets){for(var se=0;se<Ht.widgets.length;se++)if(Ht.widgets[se].noHScroll){Qi(Ft,Vt,"widget");break}}++Vt}),this.curOp.forceUpdate=!0,Je(this,"refresh",this)}),operation:function(dt){return Cr(this,dt)},startOperation:function(){return Fn(this)},endOperation:function(){return sr(this)},refresh:Bo(function(){var dt=this.display.cachedTextHeight;wr(this),this.curOp.forceUpdate=!0,su(this),Ml(this,this.doc.scrollLeft,this.doc.scrollTop),wh(this.display),(dt==null||Math.abs(dt-Sr(this.display))>.5||this.options.lineWrapping)&&Ri(this),Je(this,"refresh",this)}),swapDoc:Bo(function(dt){var mt=this.doc;return mt.cm=null,this.state.selectingText&&this.state.selectingText(),uf(this,dt),su(this),this.display.input.reset(),Ml(this,dt.scrollLeft,dt.scrollTop),this.curOp.forceScroll=!0,ir(this,"swapDoc",this,mt),mt}),phrase:function(dt){var mt=this.options.phrases;return mt&&Object.prototype.hasOwnProperty.call(mt,dt)?mt[dt]:dt},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},nn(it),it.registerHelper=function(dt,mt,Ft){ct.hasOwnProperty(dt)||(ct[dt]=it[dt]={_global:[]}),ct[dt][mt]=Ft},it.registerGlobalHelper=function(dt,mt,Ft,Ot){it.registerHelper(dt,mt,Ot),ct[dt]._global.push({pred:Ft,val:Ot})}}function Dc(it,at,ct,dt,mt){var Ft=at,Ot=ct,Vt=On(it,at.line),Ht=mt&&it.direction=="rtl"?-ct:ct;function se(){var _r=at.line+Ht;return _r<it.first||_r>=it.first+it.size?!1:(at=new We(_r,at.ch,at.sticky),Vt=On(it,_r))}function ze(_r){var yr;if(dt=="codepoint"){var Hr=Vt.text.charCodeAt(at.ch+(dt>0?0:-1));isNaN(Hr)?yr=null:yr=new We(at.line,Math.max(0,Math.min(Vt.text.length,at.ch+ct*(Hr>=55296&&Hr<56320?2:1))),-ct)}else mt?yr=vf(it.cm,Vt,at,ct):yr=qa(Vt,at,ct);if(yr==null)if(!_r&&se())at=Bc(mt,it.cm,Vt,at.line,Ht);else return!1;else at=yr;return!0}if(dt=="char"||dt=="codepoint")ze();else if(dt=="column")ze(!0);else if(dt=="word"||dt=="group")for(var de=null,xn=dt=="group",un=it.cm&&it.cm.getHelper(at,"wordChars"),wi=!0;!(ct<0&&!ze(!wi));wi=!1){var Li=Vt.text.charAt(at.ch)||`
`,ji=zt(Li,un)?"w":xn&&Li==`
`?"n":!xn||/\s/.test(Li)?null:"p";if(xn&&!wi&&!ji&&(ji="s"),de&&de!=ji){ct<0&&(ct=1,ze(),at.sticky="after");break}if(ji&&(de=ji),ct>0&&!ze(!wi))break}var lr=Lc(it,at,Ft,Ot,!0);return Vn(Ft,lr)&&(lr.hitSide=!0),lr}function Ah(it,at,ct,dt){var mt=it.doc,Ft=at.left,Ot;if(dt=="page"){var Vt=Math.min(it.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Ht=Math.max(Vt-.5*Sr(it.display),3);Ot=(ct>0?at.bottom:at.top)+ct*Ht}else dt=="line"&&(Ot=ct>0?at.bottom+3:at.top-3);for(var se;se=xe(it,Ft,Ot),!!se.outside;){if(ct<0?Ot<=0:Ot>=mt.height){se.hitSide=!0;break}Ot+=ct*5}return se}var pa=function(it){this.cm=it,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Xt,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};pa.prototype.init=function(it){var at=this,ct=this,dt=ct.cm,mt=ct.div=it.lineDiv;Hg(mt,dt.options.spellcheck,dt.options.autocorrect,dt.options.autocapitalize);function Ft(Vt){for(var Ht=Vt.target;Ht;Ht=Ht.parentNode){if(Ht==mt)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Ht.className))break}return!1}hn(mt,"paste",function(Vt){!Ft(Vt)||rn(dt,Vt)||zg(Vt,dt)||It<=11&&setTimeout(Qo(dt,function(){return at.updateFromDOM()}),20)}),hn(mt,"compositionstart",function(Vt){at.composing={data:Vt.data,done:!1}}),hn(mt,"compositionupdate",function(Vt){at.composing||(at.composing={data:Vt.data,done:!1})}),hn(mt,"compositionend",function(Vt){at.composing&&(Vt.data!=at.composing.data&&at.readFromDOMSoon(),at.composing.done=!0)}),hn(mt,"touchstart",function(){return ct.forceCompositionEnd()}),hn(mt,"input",function(){at.composing||at.readFromDOMSoon()});function Ot(Vt){if(!(!Ft(Vt)||rn(dt,Vt))){if(dt.somethingSelected())fd({lineWise:!1,text:dt.getSelections()}),Vt.type=="cut"&&dt.replaceSelection("",null,"cut");else if(dt.options.lineWiseCopyCut){var Ht=Gg(dt);fd({lineWise:!0,text:Ht.text}),Vt.type=="cut"&&dt.operation(function(){dt.setSelections(Ht.ranges,0,De),dt.replaceSelection("",null,"cut")})}else return;if(Vt.clipboardData){Vt.clipboardData.clearData();var se=ol.text.join(`
`);if(Vt.clipboardData.setData("Text",se),Vt.clipboardData.getData("Text")==se){Vt.preventDefault();return}}var ze=Wg(),de=ze.firstChild;dt.display.lineSpace.insertBefore(ze,dt.display.lineSpace.firstChild),de.value=ol.text.join(`
`);var xn=document.activeElement;_e(de),setTimeout(function(){dt.display.lineSpace.removeChild(ze),xn.focus(),xn==mt&&ct.showPrimarySelection()},50)}}hn(mt,"copy",Ot),hn(mt,"cut",Ot)},pa.prototype.screenReaderLabelChanged=function(it){it?this.div.setAttribute("aria-label",it):this.div.removeAttribute("aria-label")},pa.prototype.prepareSelection=function(){var it=tr(this.cm,!1);return it.focus=document.activeElement==this.div,it},pa.prototype.showSelection=function(it,at){!it||!this.cm.display.view.length||((it.focus||at)&&this.showPrimarySelection(),this.showMultipleSelections(it))},pa.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},pa.prototype.showPrimarySelection=function(){var it=this.getSelection(),at=this.cm,ct=at.doc.sel.primary(),dt=ct.from(),mt=ct.to();if(at.display.viewTo==at.display.viewFrom||dt.line>=at.display.viewTo||mt.line<at.display.viewFrom){it.removeAllRanges();return}var Ft=Oc(at,it.anchorNode,it.anchorOffset),Ot=Oc(at,it.focusNode,it.focusOffset);if(!(Ft&&!Ft.bad&&Ot&&!Ot.bad&&je(pi(Ft,Ot),dt)==0&&je(Mi(Ft,Ot),mt)==0)){var Vt=at.display.view,Ht=dt.line>=at.display.viewFrom&&Mf(at,dt)||{node:Vt[0].measure.map[2],offset:0},se=mt.line<at.display.viewTo&&Mf(at,mt);if(!se){var ze=Vt[Vt.length-1].measure,de=ze.maps?ze.maps[ze.maps.length-1]:ze.map;se={node:de[de.length-1],offset:de[de.length-2]-de[de.length-3]}}if(!Ht||!se){it.removeAllRanges();return}var xn=it.rangeCount&&it.getRangeAt(0),un;try{un=ae(Ht.node,Ht.offset,se.offset,se.node)}catch(wi){}un&&(!pt&&at.state.focused?(it.collapse(Ht.node,Ht.offset),un.collapsed||(it.removeAllRanges(),it.addRange(un))):(it.removeAllRanges(),it.addRange(un)),xn&&it.anchorNode==null?it.addRange(xn):pt&&this.startGracePeriod()),this.rememberSelection()}},pa.prototype.startGracePeriod=function(){var it=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){it.gracePeriod=!1,it.selectionChanged()&&it.cm.operation(function(){return it.cm.curOp.selectionChanged=!0})},20)},pa.prototype.showMultipleSelections=function(it){Yt(this.cm.display.cursorDiv,it.cursors),Yt(this.cm.display.selectionDiv,it.selection)},pa.prototype.rememberSelection=function(){var it=this.getSelection();this.lastAnchorNode=it.anchorNode,this.lastAnchorOffset=it.anchorOffset,this.lastFocusNode=it.focusNode,this.lastFocusOffset=it.focusOffset},pa.prototype.selectionInEditor=function(){var it=this.getSelection();if(!it.rangeCount)return!1;var at=it.getRangeAt(0).commonAncestorContainer;return Ne(this.div,at)},pa.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},pa.prototype.blur=function(){this.div.blur()},pa.prototype.getField=function(){return this.div},pa.prototype.supportsTouch=function(){return!0},pa.prototype.receivedFocus=function(){var it=this;this.selectionInEditor()?this.pollSelection():Cr(this.cm,function(){return it.cm.curOp.selectionChanged=!0});function at(){it.cm.state.focused&&(it.pollSelection(),it.polling.set(it.cm.options.pollInterval,at))}this.polling.set(this.cm.options.pollInterval,at)},pa.prototype.selectionChanged=function(){var it=this.getSelection();return it.anchorNode!=this.lastAnchorNode||it.anchorOffset!=this.lastAnchorOffset||it.focusNode!=this.lastFocusNode||it.focusOffset!=this.lastFocusOffset},pa.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var it=this.getSelection(),at=this.cm;if(nt&&ne&&this.cm.display.gutterSpecs.length&&Vg(it.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var ct=Oc(at,it.anchorNode,it.anchorOffset),dt=Oc(at,it.focusNode,it.focusOffset);ct&&dt&&Cr(at,function(){Gs(at.doc,rh(ct,dt),De),(ct.bad||dt.bad)&&(at.curOp.selectionChanged=!0)})}}},pa.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var it=this.cm,at=it.display,ct=it.doc.sel.primary(),dt=ct.from(),mt=ct.to();if(dt.ch==0&&dt.line>it.firstLine()&&(dt=We(dt.line-1,On(it.doc,dt.line-1).length)),mt.ch==On(it.doc,mt.line).text.length&&mt.line<it.lastLine()&&(mt=We(mt.line+1,0)),dt.line<at.viewFrom||mt.line>at.viewTo-1)return!1;var Ft,Ot,Vt;dt.line==at.viewFrom||(Ft=kr(it,dt.line))==0?(Ot=$t(at.view[0].line),Vt=at.view[0].node):(Ot=$t(at.view[Ft].line),Vt=at.view[Ft-1].node.nextSibling);var Ht=kr(it,mt.line),se,ze;if(Ht==at.view.length-1?(se=at.viewTo-1,ze=at.lineDiv.lastChild):(se=$t(at.view[Ht+1].line)-1,ze=at.view[Ht+1].node.previousSibling),!Vt)return!1;for(var de=it.doc.splitLines(Jd(it,Vt,ze,Ot,se)),xn=Fe(it.doc,We(Ot,0),We(se,On(it.doc,se).text.length));de.length>1&&xn.length>1;)if(ee(de)==ee(xn))de.pop(),xn.pop(),se--;else if(de[0]==xn[0])de.shift(),xn.shift(),Ot++;else break;for(var un=0,wi=0,Li=de[0],ji=xn[0],lr=Math.min(Li.length,ji.length);un<lr&&Li.charCodeAt(un)==ji.charCodeAt(un);)++un;for(var _r=ee(de),yr=ee(xn),Hr=Math.min(_r.length-(de.length==1?un:0),yr.length-(xn.length==1?un:0));wi<Hr&&_r.charCodeAt(_r.length-wi-1)==yr.charCodeAt(yr.length-wi-1);)++wi;if(de.length==1&&xn.length==1&&Ot==dt.line)for(;un&&un>dt.ch&&_r.charCodeAt(_r.length-wi-1)==yr.charCodeAt(yr.length-wi-1);)un--,wi++;de[de.length-1]=_r.slice(0,_r.length-wi).replace(/^\u200b+/,""),de[0]=de[0].slice(un).replace(/\u200b+$/,"");var wo=We(Ot,un),mr=We(se,xn.length?ee(xn).length-wi:0);if(de.length>1||de[0]||je(wo,mr))return od(it.doc,de,wo,mr,"+input"),!0},pa.prototype.ensurePolled=function(){this.forceCompositionEnd()},pa.prototype.reset=function(){this.forceCompositionEnd()},pa.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},pa.prototype.readFromDOMSoon=function(){var it=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(it.readDOMTimeout=null,it.composing)if(it.composing.done)it.composing=null;else return;it.updateFromDOM()},80))},pa.prototype.updateFromDOM=function(){var it=this;(this.cm.isReadOnly()||!this.pollContent())&&Cr(this.cm,function(){return wr(it.cm)})},pa.prototype.setUneditable=function(it){it.contentEditable="false"},pa.prototype.onKeyPress=function(it){it.charCode==0||this.composing||(it.preventDefault(),this.cm.isReadOnly()||Qo(this.cm,Tc)(this.cm,String.fromCharCode(it.charCode==null?it.keyCode:it.charCode),0))},pa.prototype.readOnlyChanged=function(it){this.div.contentEditable=String(it!="nocursor")},pa.prototype.onContextMenu=function(){},pa.prototype.resetPosition=function(){},pa.prototype.needsContentAttribute=!0;function Mf(it,at){var ct=Zl(it,at.line);if(!ct||ct.hidden)return null;var dt=On(it.doc,at.line),mt=ga(ct,dt,at.line),Ft=vn(dt,it.doc.direction),Ot="left";if(Ft){var Vt=Le(Ft,at.ch);Ot=Vt%2?"right":"left"}var Ht=ru(mt.map,at.ch,Ot);return Ht.offset=Ht.collapse=="right"?Ht.end:Ht.start,Ht}function Vg(it){for(var at=it;at;at=at.parentNode)if(/CodeMirror-gutter-wrapper/.test(at.className))return!0;return!1}function Xd(it,at){return at&&(it.bad=!0),it}function Jd(it,at,ct,dt,mt){var Ft="",Ot=!1,Vt=it.doc.lineSeparator(),Ht=!1;function se(un){return function(wi){return wi.id==un}}function ze(){Ot&&(Ft+=Vt,Ht&&(Ft+=Vt),Ot=Ht=!1)}function de(un){un&&(ze(),Ft+=un)}function xn(un){if(un.nodeType==1){var wi=un.getAttribute("cm-text");if(wi){de(wi);return}var Li=un.getAttribute("cm-marker"),ji;if(Li){var lr=it.findMarks(We(dt,0),We(mt+1,0),se(+Li));lr.length&&(ji=lr[0].find(0))&&de(Fe(it.doc,ji.from,ji.to).join(Vt));return}if(un.getAttribute("contenteditable")=="false")return;var _r=/^(pre|div|p|li|table|br)$/i.test(un.nodeName);if(!/^br$/i.test(un.nodeName)&&un.textContent.length==0)return;_r&&ze();for(var yr=0;yr<un.childNodes.length;yr++)xn(un.childNodes[yr]);/^(pre|p)$/i.test(un.nodeName)&&(Ht=!0),_r&&(Ot=!0)}else un.nodeType==3&&de(un.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;xn(at),at!=ct;)at=at.nextSibling,Ht=!1;return Ft}function Oc(it,at,ct){var dt;if(at==it.display.lineDiv){if(dt=it.display.lineDiv.childNodes[ct],!dt)return Xd(it.clipPos(We(it.display.viewTo-1)),!0);at=null,ct=0}else for(dt=at;;dt=dt.parentNode){if(!dt||dt==it.display.lineDiv)return null;if(dt.parentNode&&dt.parentNode==it.display.lineDiv)break}for(var mt=0;mt<it.display.view.length;mt++){var Ft=it.display.view[mt];if(Ft.node==dt)return lm(Ft,at,ct)}}function lm(it,at,ct){var dt=it.text.firstChild,mt=!1;if(!at||!Ne(dt,at))return Xd(We($t(it.line),0),!0);if(at==dt&&(mt=!0,at=dt.childNodes[ct],ct=0,!at)){var Ft=it.rest?ee(it.rest):it.line;return Xd(We($t(Ft),Ft.text.length),mt)}var Ot=at.nodeType==3?at:null,Vt=at;for(!Ot&&at.childNodes.length==1&&at.firstChild.nodeType==3&&(Ot=at.firstChild,ct&&(ct=Ot.nodeValue.length));Vt.parentNode!=dt;)Vt=Vt.parentNode;var Ht=it.measure,se=Ht.maps;function ze(ji,lr,_r){for(var yr=-1;yr<(se?se.length:0);yr++)for(var Hr=yr<0?Ht.map:se[yr],wo=0;wo<Hr.length;wo+=3){var mr=Hr[wo+2];if(mr==ji||mr==lr){var Go=$t(yr<0?it.line:it.rest[yr]),ka=Hr[wo]+_r;return(_r<0||mr!=ji)&&(ka=Hr[wo+(_r?1:0)]),We(Go,ka)}}}var de=ze(Ot,Vt,ct);if(de)return Xd(de,mt);for(var xn=Vt.nextSibling,un=Ot?Ot.nodeValue.length-ct:0;xn;xn=xn.nextSibling){if(de=ze(xn,xn.firstChild,0),de)return Xd(We(de.line,de.ch-un),mt);un+=xn.textContent.length}for(var wi=Vt.previousSibling,Li=ct;wi;wi=wi.previousSibling){if(de=ze(wi,wi.firstChild,-1),de)return Xd(We(de.line,de.ch+Li),mt);Li+=wi.textContent.length}}var os=function(it){this.cm=it,this.prevInput="",this.pollingFast=!1,this.polling=new Xt,this.hasSelection=!1,this.composing=null};os.prototype.init=function(it){var at=this,ct=this,dt=this.cm;this.createField(it);var mt=this.textarea;it.wrapper.insertBefore(this.wrapper,it.wrapper.firstChild),Bt&&(mt.style.width="0px"),hn(mt,"input",function(){ue&&It>=9&&at.hasSelection&&(at.hasSelection=null),ct.poll()}),hn(mt,"paste",function(Ot){rn(dt,Ot)||zg(Ot,dt)||(dt.state.pasteIncoming=+new Date,ct.fastPoll())});function Ft(Ot){if(!rn(dt,Ot)){if(dt.somethingSelected())fd({lineWise:!1,text:dt.getSelections()});else if(dt.options.lineWiseCopyCut){var Vt=Gg(dt);fd({lineWise:!0,text:Vt.text}),Ot.type=="cut"?dt.setSelections(Vt.ranges,null,De):(ct.prevInput="",mt.value=Vt.text.join(`
`),_e(mt))}else return;Ot.type=="cut"&&(dt.state.cutIncoming=+new Date)}}hn(mt,"cut",Ft),hn(mt,"copy",Ft),hn(it.scroller,"paste",function(Ot){if(!(Yo(it,Ot)||rn(dt,Ot))){if(!mt.dispatchEvent){dt.state.pasteIncoming=+new Date,ct.focus();return}var Vt=new Event("paste");Vt.clipboardData=Ot.clipboardData,mt.dispatchEvent(Vt)}}),hn(it.lineSpace,"selectstart",function(Ot){Yo(it,Ot)||Kn(Ot)}),hn(mt,"compositionstart",function(){var Ot=dt.getCursor("from");ct.composing&&ct.composing.range.clear(),ct.composing={start:Ot,range:dt.markText(Ot,dt.getCursor("to"),{className:"CodeMirror-composing"})}}),hn(mt,"compositionend",function(){ct.composing&&(ct.poll(),ct.composing.range.clear(),ct.composing=null)})},os.prototype.createField=function(it){this.wrapper=Wg(),this.textarea=this.wrapper.firstChild},os.prototype.screenReaderLabelChanged=function(it){it?this.textarea.setAttribute("aria-label",it):this.textarea.removeAttribute("aria-label")},os.prototype.prepareSelection=function(){var it=this.cm,at=it.display,ct=it.doc,dt=tr(it);if(it.options.moveInputWithCursor){var mt=uo(it,ct.sel.primary().head,"div"),Ft=at.wrapper.getBoundingClientRect(),Ot=at.lineDiv.getBoundingClientRect();dt.teTop=Math.max(0,Math.min(at.wrapper.clientHeight-10,mt.top+Ot.top-Ft.top)),dt.teLeft=Math.max(0,Math.min(at.wrapper.clientWidth-10,mt.left+Ot.left-Ft.left))}return dt},os.prototype.showSelection=function(it){var at=this.cm,ct=at.display;Yt(ct.cursorDiv,it.cursors),Yt(ct.selectionDiv,it.selection),it.teTop!=null&&(this.wrapper.style.top=it.teTop+"px",this.wrapper.style.left=it.teLeft+"px")},os.prototype.reset=function(it){if(!(this.contextMenuPending||this.composing)){var at=this.cm;if(at.somethingSelected()){this.prevInput="";var ct=at.getSelection();this.textarea.value=ct,at.state.focused&&_e(this.textarea),ue&&It>=9&&(this.hasSelection=ct)}else it||(this.prevInput=this.textarea.value="",ue&&It>=9&&(this.hasSelection=null))}},os.prototype.getField=function(){return this.textarea},os.prototype.supportsTouch=function(){return!1},os.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!et||Ce()!=this.textarea))try{this.textarea.focus()}catch(it){}},os.prototype.blur=function(){this.textarea.blur()},os.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},os.prototype.receivedFocus=function(){this.slowPoll()},os.prototype.slowPoll=function(){var it=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){it.poll(),it.cm.state.focused&&it.slowPoll()})},os.prototype.fastPoll=function(){var it=!1,at=this;at.pollingFast=!0;function ct(){var dt=at.poll();!dt&&!it?(it=!0,at.polling.set(60,ct)):(at.pollingFast=!1,at.slowPoll())}at.polling.set(20,ct)},os.prototype.poll=function(){var it=this,at=this.cm,ct=this.textarea,dt=this.prevInput;if(this.contextMenuPending||!at.state.focused||wt(ct)&&!dt&&!this.composing||at.isReadOnly()||at.options.disableInput||at.state.keySeq)return!1;var mt=ct.value;if(mt==dt&&!at.somethingSelected())return!1;if(ue&&It>=9&&this.hasSelection===mt||ht&&/[\uf700-\uf7ff]/.test(mt))return at.display.input.reset(),!1;if(at.doc.sel==at.display.selForContextMenu){var Ft=mt.charCodeAt(0);if(Ft==8203&&!dt&&(dt="\u200B"),Ft==8666)return this.reset(),this.cm.execCommand("undo")}for(var Ot=0,Vt=Math.min(dt.length,mt.length);Ot<Vt&&dt.charCodeAt(Ot)==mt.charCodeAt(Ot);)++Ot;return Cr(at,function(){Tc(at,mt.slice(Ot),dt.length-Ot,null,it.composing?"*compose":null),mt.length>1e3||mt.indexOf(`
`)>-1?ct.value=it.prevInput="":it.prevInput=mt,it.composing&&(it.composing.range.clear(),it.composing.range=at.markText(it.composing.start,at.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},os.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},os.prototype.onKeyPress=function(){ue&&It>=9&&(this.hasSelection=null),this.fastPoll()},os.prototype.onContextMenu=function(it){var at=this,ct=at.cm,dt=ct.display,mt=at.textarea;at.contextMenuPending&&at.contextMenuPending();var Ft=Gi(ct,it),Ot=dt.scroller.scrollTop;if(!Ft||Rt)return;var Vt=ct.options.resetSelectionOnContextMenu;Vt&&ct.doc.sel.contains(Ft)==-1&&Qo(ct,Gs)(ct.doc,rh(Ft),De);var Ht=mt.style.cssText,se=at.wrapper.style.cssText,ze=at.wrapper.offsetParent.getBoundingClientRect();at.wrapper.style.cssText="position: static",mt.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(it.clientY-ze.top-5)+"px; left: "+(it.clientX-ze.left-5)+`px;
z-index: 1000; background: `+(ue?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var de;qt&&(de=window.scrollY),dt.input.focus(),qt&&window.scrollTo(null,de),dt.input.reset(),ct.somethingSelected()||(mt.value=at.prevInput=" "),at.contextMenuPending=un,dt.selForContextMenu=ct.doc.sel,clearTimeout(dt.detectingSelectAll);function xn(){if(mt.selectionStart!=null){var Li=ct.somethingSelected(),ji="\u200B"+(Li?mt.value:"");mt.value="\u21DA",mt.value=ji,at.prevInput=Li?"":"\u200B",mt.selectionStart=1,mt.selectionEnd=ji.length,dt.selForContextMenu=ct.doc.sel}}function un(){if(at.contextMenuPending==un&&(at.contextMenuPending=!1,at.wrapper.style.cssText=se,mt.style.cssText=Ht,ue&&It<9&&dt.scrollbars.setScrollTop(dt.scroller.scrollTop=Ot),mt.selectionStart!=null)){(!ue||ue&&It<9)&&xn();var Li=0,ji=function(){dt.selForContextMenu==ct.doc.sel&&mt.selectionStart==0&&mt.selectionEnd>0&&at.prevInput=="\u200B"?Qo(ct,$a)(ct):Li++<10?dt.detectingSelectAll=setTimeout(ji,500):(dt.selForContextMenu=null,dt.input.reset())};dt.detectingSelectAll=setTimeout(ji,200)}}if(ue&&It>=9&&xn(),Et){Si(it);var wi=function(){Ge(window,"mouseup",wi),setTimeout(un,20)};hn(window,"mouseup",wi)}else setTimeout(un,50)},os.prototype.readOnlyChanged=function(it){it||this.reset(),this.textarea.disabled=it=="nocursor",this.textarea.readOnly=!!it},os.prototype.setUneditable=function(){},os.prototype.needsContentAttribute=!1;function um(it,at){if(at=at?Ke(at):{},at.value=it.value,!at.tabindex&&it.tabIndex&&(at.tabindex=it.tabIndex),!at.placeholder&&it.placeholder&&(at.placeholder=it.placeholder),at.autofocus==null){var ct=Ce();at.autofocus=ct==it||it.getAttribute("autofocus")!=null&&ct==document.body}function dt(){it.value=Vt.getValue()}var mt;if(it.form&&(hn(it.form,"submit",dt),!at.leaveSubmitMethodAlone)){var Ft=it.form;mt=Ft.submit;try{var Ot=Ft.submit=function(){dt(),Ft.submit=mt,Ft.submit(),Ft.submit=Ot}}catch(Ht){}}at.finishInit=function(Ht){Ht.save=dt,Ht.getTextArea=function(){return it},Ht.toTextArea=function(){Ht.toTextArea=isNaN,dt(),it.parentNode.removeChild(Ht.getWrapperElement()),it.style.display="",it.form&&(Ge(it.form,"submit",dt),!at.leaveSubmitMethodAlone&&typeof it.form.submit=="function"&&(it.form.submit=mt))}},it.style.display="none";var Vt=qo(function(Ht){return it.parentNode.insertBefore(Ht,it.nextSibling)},at);return Vt}function Qd(it){it.off=Ge,it.on=hn,it.wheelEventPixels=Bl,it.Doc=As,it.splitLines=Oi,it.countColumn=oe,it.findColumn=jn,it.isWordChar=Nt,it.Pass=Pn,it.signal=Je,it.Line=Rr,it.changeEnd=Lh,it.scrollbarModel=Wl,it.Pos=We,it.cmpPos=je,it.modes=Ui,it.mimeModes=ur,it.resolveMode=bn,it.getMode=pe,it.modeExtensions=Se,it.extendMode=ve,it.copyState=zn,it.startState=Qn,it.innerMode=kn,it.commands=bh,it.keyMap=gl,it.keyName=em,it.isModifierKey=Hd,it.lookupKey=Yl,it.normalizeKeyMap=Fg,it.StringStream=$e,it.SharedTextMarker=ju,it.TextMarker=be,it.LineWidget=sh,it.e_preventDefault=Kn,it.e_stopPropagation=mi,it.e_stop=Si,it.addClass=we,it.contains=Ne,it.rmClass=Dt,it.keyNames=zu}am(qo),Bh(qo);var lh="iter insert remove copy getEditor constructor".split(" ");for(var Ic in As.prototype)As.prototype.hasOwnProperty(Ic)&&qe(lh,Ic)<0&&(qo.prototype[Ic]=function(it){return function(){return it.apply(this.doc,arguments)}}(As.prototype[Ic]));return nn(As),qo.inputStyles={textarea:os,contenteditable:pa},qo.defineMode=function(it){!qo.defaults.mode&&it!="null"&&(qo.defaults.mode=it),Mr.apply(this,arguments)},qo.defineMIME=gi,qo.defineMode("null",function(){return{token:function(it){return it.skipToEnd()}}}),qo.defineMIME("text/plain","null"),qo.defineExtension=function(it,at){qo.prototype[it]=at},qo.defineDocExtension=function(it,at){As.prototype[it]=at},qo.fromTextArea=um,Qd(qo),qo.version="5.58.2",qo})},25419:function(Dn,Gn,kt){(function(pt){pt(kt(89780),kt(15525),kt(98101))})(function(pt){"use strict";pt.defineMode("markdown",function(Ut,le){var Me=pt.getMode(Ut,"text/html"),ue=Me.name=="null";function It(oe){if(pt.findModeByName){var Xt=pt.findModeByName(oe);Xt&&(oe=Xt.mime||Xt.mimes[0])}var qe=pt.getMode(Ut,oe);return qe.name=="null"?null:qe}le.highlightFormatting===void 0&&(le.highlightFormatting=!1),le.maxBlockquoteDepth===void 0&&(le.maxBlockquoteDepth=0),le.taskLists===void 0&&(le.taskLists=!1),le.strikethrough===void 0&&(le.strikethrough=!1),le.emoji===void 0&&(le.emoji=!1),le.fencedCodeBlockHighlighting===void 0&&(le.fencedCodeBlockHighlighting=!0),le.fencedCodeBlockDefaultMode===void 0&&(le.fencedCodeBlockDefaultMode="text/plain"),le.xml===void 0&&(le.xml=!0),le.tokenTypeOverrides===void 0&&(le.tokenTypeOverrides={});var qt={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var ge in qt)qt.hasOwnProperty(ge)&&le.tokenTypeOverrides[ge]&&(qt[ge]=le.tokenTypeOverrides[ge]);var ne=/^([*\-_])(?:\s*\1){2,}\s*$/,Rt=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,Ae=/^\[(x| )\](?=\s)/i,ie=le.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,Ee=/^ {0,3}(?:\={1,}|-{2,})\s*$/,Bt=/^[^#!\[\]*_\\<>` "'(~:]+/,nt=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,et=/^\s*\[[^\]]+?\]:.*$/,ht=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,st=" ";function gt(oe,Xt,qe){return Xt.f=Xt.inline=qe,qe(oe,Xt)}function vt(oe,Xt,qe){return Xt.f=Xt.block=qe,qe(oe,Xt)}function St(oe){return!oe||!/\S/.test(oe.string)}function Et(oe){if(oe.linkTitle=!1,oe.linkHref=!1,oe.linkText=!1,oe.em=!1,oe.strong=!1,oe.strikethrough=!1,oe.quote=0,oe.indentedCode=!1,oe.f==Dt){var Xt=ue;if(!Xt){var qe=pt.innerMode(Me,oe.htmlState);Xt=qe.mode.name=="xml"&&qe.state.tagStart===null&&!qe.state.context&&qe.state.tokenize.isInText}Xt&&(oe.f=me,oe.block=Tt,oe.htmlState=null)}return oe.trailingSpace=0,oe.trailingSpaceNewLine=!1,oe.prevLine=oe.thisLine,oe.thisLine={stream:null},null}function Tt(oe,Xt){var qe=oe.column()===Xt.indentation,_n=St(Xt.prevLine.stream),Pn=Xt.indentedCode,De=Xt.prevLine.hr,dn=Xt.list!==!1,sn=(Xt.listStack[Xt.listStack.length-1]||0)+3;Xt.indentedCode=!1;var jn=Xt.indentation;if(Xt.indentationDiff===null&&(Xt.indentationDiff=Xt.indentation,dn)){for(Xt.list=null;jn<Xt.listStack[Xt.listStack.length-1];)Xt.listStack.pop(),Xt.listStack.length?Xt.indentation=Xt.listStack[Xt.listStack.length-1]:Xt.list=!1;Xt.list!==!1&&(Xt.indentationDiff=jn-Xt.listStack[Xt.listStack.length-1])}var Te=!_n&&!De&&!Xt.prevLine.header&&(!dn||!Pn)&&!Xt.prevLine.fencedCodeEnd,Sn=(Xt.list===!1||De||_n)&&Xt.indentation<=sn&&oe.match(ne),ee=null;if(Xt.indentationDiff>=4&&(Pn||Xt.prevLine.fencedCodeEnd||Xt.prevLine.header||_n))return oe.skipToEnd(),Xt.indentedCode=!0,qt.code;if(oe.eatSpace())return null;if(qe&&Xt.indentation<=sn&&(ee=oe.match(ie))&&ee[1].length<=6)return Xt.quote=0,Xt.header=ee[1].length,Xt.thisLine.header=!0,le.highlightFormatting&&(Xt.formatting="header"),Xt.f=Xt.inline,Yt(Xt);if(Xt.indentation<=sn&&oe.eat(">"))return Xt.quote=qe?1:Xt.quote+1,le.highlightFormatting&&(Xt.formatting="quote"),oe.eatSpace(),Yt(Xt);if(!Sn&&!Xt.setext&&qe&&Xt.indentation<=sn&&(ee=oe.match(Rt))){var Mn=ee[1]?"ol":"ul";return Xt.indentation=jn+oe.current().length,Xt.list=!0,Xt.quote=0,Xt.listStack.push(Xt.indentation),Xt.em=!1,Xt.strong=!1,Xt.code=!1,Xt.strikethrough=!1,le.taskLists&&oe.match(Ae,!1)&&(Xt.taskList=!0),Xt.f=Xt.inline,le.highlightFormatting&&(Xt.formatting=["list","list-"+Mn]),Yt(Xt)}else{if(qe&&Xt.indentation<=sn&&(ee=oe.match(nt,!0)))return Xt.quote=0,Xt.fencedEndRE=new RegExp(ee[1]+"+ *$"),Xt.localMode=le.fencedCodeBlockHighlighting&&It(ee[2]||le.fencedCodeBlockDefaultMode),Xt.localMode&&(Xt.localState=pt.startState(Xt.localMode)),Xt.f=Xt.block=Jt,le.highlightFormatting&&(Xt.formatting="code-block"),Xt.code=-1,Yt(Xt);if(Xt.setext||(!Te||!dn)&&!Xt.quote&&Xt.list===!1&&!Xt.code&&!Sn&&!et.test(oe.string)&&(ee=oe.lookAhead(1))&&(ee=ee.match(Ee)))return Xt.setext?(Xt.header=Xt.setext,Xt.setext=0,oe.skipToEnd(),le.highlightFormatting&&(Xt.formatting="header")):(Xt.header=ee[0].charAt(0)=="="?1:2,Xt.setext=Xt.header),Xt.thisLine.header=!0,Xt.f=Xt.inline,Yt(Xt);if(Sn)return oe.skipToEnd(),Xt.hr=!0,Xt.thisLine.hr=!0,qt.hr;if(oe.peek()==="[")return gt(oe,Xt,tn)}return gt(oe,Xt,Xt.inline)}function Dt(oe,Xt){var qe=Me.token(oe,Xt.htmlState);if(!ue){var _n=pt.innerMode(Me,Xt.htmlState);(_n.mode.name=="xml"&&_n.state.tagStart===null&&!_n.state.context&&_n.state.tokenize.isInText||Xt.md_inside&&oe.current().indexOf(">")>-1)&&(Xt.f=me,Xt.block=Tt,Xt.htmlState=null)}return qe}function Jt(oe,Xt){var qe=Xt.listStack[Xt.listStack.length-1]||0,_n=Xt.indentation<qe,Pn=qe+3;if(Xt.fencedEndRE&&Xt.indentation<=Pn&&(_n||oe.match(Xt.fencedEndRE))){le.highlightFormatting&&(Xt.formatting="code-block");var De;return _n||(De=Yt(Xt)),Xt.localMode=Xt.localState=null,Xt.block=Tt,Xt.f=me,Xt.fencedEndRE=null,Xt.code=0,Xt.thisLine.fencedCodeEnd=!0,_n?vt(oe,Xt,Xt.block):De}else return Xt.localMode?Xt.localMode.token(oe,Xt.localState):(oe.skipToEnd(),qt.code)}function Yt(oe){var Xt=[];if(oe.formatting){Xt.push(qt.formatting),typeof oe.formatting=="string"&&(oe.formatting=[oe.formatting]);for(var qe=0;qe<oe.formatting.length;qe++)Xt.push(qt.formatting+"-"+oe.formatting[qe]),oe.formatting[qe]==="header"&&Xt.push(qt.formatting+"-"+oe.formatting[qe]+"-"+oe.header),oe.formatting[qe]==="quote"&&(!le.maxBlockquoteDepth||le.maxBlockquoteDepth>=oe.quote?Xt.push(qt.formatting+"-"+oe.formatting[qe]+"-"+oe.quote):Xt.push("error"))}if(oe.taskOpen)return Xt.push("meta"),Xt.length?Xt.join(" "):null;if(oe.taskClosed)return Xt.push("property"),Xt.length?Xt.join(" "):null;if(oe.linkHref?Xt.push(qt.linkHref,"url"):(oe.strong&&Xt.push(qt.strong),oe.em&&Xt.push(qt.em),oe.strikethrough&&Xt.push(qt.strikethrough),oe.emoji&&Xt.push(qt.emoji),oe.linkText&&Xt.push(qt.linkText),oe.code&&Xt.push(qt.code),oe.image&&Xt.push(qt.image),oe.imageAltText&&Xt.push(qt.imageAltText,"link"),oe.imageMarker&&Xt.push(qt.imageMarker)),oe.header&&Xt.push(qt.header,qt.header+"-"+oe.header),oe.quote&&(Xt.push(qt.quote),!le.maxBlockquoteDepth||le.maxBlockquoteDepth>=oe.quote?Xt.push(qt.quote+"-"+oe.quote):Xt.push(qt.quote+"-"+le.maxBlockquoteDepth)),oe.list!==!1){var _n=(oe.listStack.length-1)%3;_n?_n===1?Xt.push(qt.list2):Xt.push(qt.list3):Xt.push(qt.list1)}return oe.trailingSpaceNewLine?Xt.push("trailing-space-new-line"):oe.trailingSpace&&Xt.push("trailing-space-"+(oe.trailingSpace%2?"a":"b")),Xt.length?Xt.join(" "):null}function Gt(oe,Xt){if(oe.match(Bt,!0))return Yt(Xt)}function me(oe,Xt){var qe=Xt.text(oe,Xt);if(typeof qe!="undefined")return qe;if(Xt.list)return Xt.list=null,Yt(Xt);if(Xt.taskList){var _n=oe.match(Ae,!0)[1]===" ";return _n?Xt.taskOpen=!0:Xt.taskClosed=!0,le.highlightFormatting&&(Xt.formatting="task"),Xt.taskList=!1,Yt(Xt)}if(Xt.taskOpen=!1,Xt.taskClosed=!1,Xt.header&&oe.match(/^#+$/,!0))return le.highlightFormatting&&(Xt.formatting="header"),Yt(Xt);var Pn=oe.next();if(Xt.linkTitle){Xt.linkTitle=!1;var De=Pn;Pn==="("&&(De=")"),De=(De+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var dn="^\\s*(?:[^"+De+"\\\\]+|\\\\\\\\|\\\\.)"+De;if(oe.match(new RegExp(dn),!0))return qt.linkHref}if(Pn==="`"){var sn=Xt.formatting;le.highlightFormatting&&(Xt.formatting="code"),oe.eatWhile("`");var jn=oe.current().length;if(Xt.code==0&&(!Xt.quote||jn==1))return Xt.code=jn,Yt(Xt);if(jn==Xt.code){var Te=Yt(Xt);return Xt.code=0,Te}else return Xt.formatting=sn,Yt(Xt)}else if(Xt.code)return Yt(Xt);if(Pn==="\\"&&(oe.next(),le.highlightFormatting)){var Sn=Yt(Xt),ee=qt.formatting+"-escape";return Sn?Sn+" "+ee:ee}if(Pn==="!"&&oe.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return Xt.imageMarker=!0,Xt.image=!0,le.highlightFormatting&&(Xt.formatting="image"),Yt(Xt);if(Pn==="["&&Xt.imageMarker&&oe.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return Xt.imageMarker=!1,Xt.imageAltText=!0,le.highlightFormatting&&(Xt.formatting="image"),Yt(Xt);if(Pn==="]"&&Xt.imageAltText){le.highlightFormatting&&(Xt.formatting="image");var Sn=Yt(Xt);return Xt.imageAltText=!1,Xt.image=!1,Xt.inline=Xt.f=Ne,Sn}if(Pn==="["&&!Xt.image)return Xt.linkText&&oe.match(/^.*?\]/)||(Xt.linkText=!0,le.highlightFormatting&&(Xt.formatting="link")),Yt(Xt);if(Pn==="]"&&Xt.linkText){le.highlightFormatting&&(Xt.formatting="link");var Sn=Yt(Xt);return Xt.linkText=!1,Xt.inline=Xt.f=oe.match(/\(.*?\)| ?\[.*?\]/,!1)?Ne:me,Sn}if(Pn==="<"&&oe.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){Xt.f=Xt.inline=ae,le.highlightFormatting&&(Xt.formatting="link");var Sn=Yt(Xt);return Sn?Sn+=" ":Sn="",Sn+qt.linkInline}if(Pn==="<"&&oe.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){Xt.f=Xt.inline=ae,le.highlightFormatting&&(Xt.formatting="link");var Sn=Yt(Xt);return Sn?Sn+=" ":Sn="",Sn+qt.linkEmail}if(le.xml&&Pn==="<"&&oe.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Mn=oe.string.indexOf(">",oe.pos);if(Mn!=-1){var ui=oe.string.substring(oe.start,Mn);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ui)&&(Xt.md_inside=!0)}return oe.backUp(1),Xt.htmlState=pt.startState(Me),vt(oe,Xt,Dt)}if(le.xml&&Pn==="<"&&oe.match(/^\/\w*?>/))return Xt.md_inside=!1,"tag";if(Pn==="*"||Pn==="_"){for(var _t=1,Lt=oe.pos==1?" ":oe.string.charAt(oe.pos-2);_t<3&&oe.eat(Pn);)_t++;var Pt=oe.peek()||" ",Nt=!/\s/.test(Pt)&&(!ht.test(Pt)||/\s/.test(Lt)||ht.test(Lt)),zt=!/\s/.test(Lt)&&(!ht.test(Lt)||/\s/.test(Pt)||ht.test(Pt)),Mt=null,Kt=null;if(_t%2&&(!Xt.em&&Nt&&(Pn==="*"||!zt||ht.test(Lt))?Mt=!0:Xt.em==Pn&&zt&&(Pn==="*"||!Nt||ht.test(Pt))&&(Mt=!1)),_t>1&&(!Xt.strong&&Nt&&(Pn==="*"||!zt||ht.test(Lt))?Kt=!0:Xt.strong==Pn&&zt&&(Pn==="*"||!Nt||ht.test(Pt))&&(Kt=!1)),Kt!=null||Mt!=null){le.highlightFormatting&&(Xt.formatting=Mt==null?"strong":Kt==null?"em":"strong em"),Mt===!0&&(Xt.em=Pn),Kt===!0&&(Xt.strong=Pn);var Te=Yt(Xt);return Mt===!1&&(Xt.em=!1),Kt===!1&&(Xt.strong=!1),Te}}else if(Pn===" "&&(oe.eat("*")||oe.eat("_"))){if(oe.peek()===" ")return Yt(Xt);oe.backUp(1)}if(le.strikethrough){if(Pn==="~"&&oe.eatWhile(Pn)){if(Xt.strikethrough){le.highlightFormatting&&(Xt.formatting="strikethrough");var Te=Yt(Xt);return Xt.strikethrough=!1,Te}else if(oe.match(/^[^\s]/,!1))return Xt.strikethrough=!0,le.highlightFormatting&&(Xt.formatting="strikethrough"),Yt(Xt)}else if(Pn===" "&&oe.match(/^~~/,!0)){if(oe.peek()===" ")return Yt(Xt);oe.backUp(2)}}if(le.emoji&&Pn===":"&&oe.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){Xt.emoji=!0,le.highlightFormatting&&(Xt.formatting="emoji");var ye=Yt(Xt);return Xt.emoji=!1,ye}return Pn===" "&&(oe.match(/^ +$/,!1)?Xt.trailingSpace++:Xt.trailingSpace&&(Xt.trailingSpaceNewLine=!0)),Yt(Xt)}function ae(oe,Xt){var qe=oe.next();if(qe===">"){Xt.f=Xt.inline=me,le.highlightFormatting&&(Xt.formatting="link");var _n=Yt(Xt);return _n?_n+=" ":_n="",_n+qt.linkInline}return oe.match(/^[^>]+/,!0),qt.linkInline}function Ne(oe,Xt){if(oe.eatSpace())return null;var qe=oe.next();return qe==="("||qe==="["?(Xt.f=Xt.inline=we(qe==="("?")":"]"),le.highlightFormatting&&(Xt.formatting="link-string"),Xt.linkHref=!0,Yt(Xt)):"error"}var Ce={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function we(oe){return function(Xt,qe){var _n=Xt.next();if(_n===oe){qe.f=qe.inline=me,le.highlightFormatting&&(qe.formatting="link-string");var Pn=Yt(qe);return qe.linkHref=!1,Pn}return Xt.match(Ce[oe]),qe.linkHref=!0,Yt(qe)}}function tn(oe,Xt){return oe.match(/^([^\]\\]|\\.)*\]:/,!1)?(Xt.f=_e,oe.next(),le.highlightFormatting&&(Xt.formatting="link"),Xt.linkText=!0,Yt(Xt)):gt(oe,Xt,me)}function _e(oe,Xt){if(oe.match(/^\]:/,!0)){Xt.f=Xt.inline=an,le.highlightFormatting&&(Xt.formatting="link");var qe=Yt(Xt);return Xt.linkText=!1,qe}return oe.match(/^([^\]\\]|\\.)+/,!0),qt.linkText}function an(oe,Xt){return oe.eatSpace()?null:(oe.match(/^[^\s]+/,!0),oe.peek()===void 0?Xt.linkTitle=!0:oe.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),Xt.f=Xt.inline=me,qt.linkHref+" url")}var Ke={startState:function(){return{f:Tt,prevLine:{stream:null},thisLine:{stream:null},block:Tt,htmlState:null,indentation:0,inline:me,text:Gt,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(oe){return{f:oe.f,prevLine:oe.prevLine,thisLine:oe.thisLine,block:oe.block,htmlState:oe.htmlState&&pt.copyState(Me,oe.htmlState),indentation:oe.indentation,localMode:oe.localMode,localState:oe.localMode?pt.copyState(oe.localMode,oe.localState):null,inline:oe.inline,text:oe.text,formatting:!1,linkText:oe.linkText,linkTitle:oe.linkTitle,linkHref:oe.linkHref,code:oe.code,em:oe.em,strong:oe.strong,strikethrough:oe.strikethrough,emoji:oe.emoji,header:oe.header,setext:oe.setext,hr:oe.hr,taskList:oe.taskList,list:oe.list,listStack:oe.listStack.slice(0),quote:oe.quote,indentedCode:oe.indentedCode,trailingSpace:oe.trailingSpace,trailingSpaceNewLine:oe.trailingSpaceNewLine,md_inside:oe.md_inside,fencedEndRE:oe.fencedEndRE}},token:function(oe,Xt){if(Xt.formatting=!1,oe!=Xt.thisLine.stream){if(Xt.header=0,Xt.hr=!1,oe.match(/^\s*$/,!0))return Et(Xt),null;if(Xt.prevLine=Xt.thisLine,Xt.thisLine={stream:oe},Xt.taskList=!1,Xt.trailingSpace=0,Xt.trailingSpaceNewLine=!1,!Xt.localState&&(Xt.f=Xt.block,Xt.f!=Dt)){var qe=oe.match(/^\s*/,!0)[0].replace(/\t/g,st).length;if(Xt.indentation=qe,Xt.indentationDiff=null,qe>0)return null}}return Xt.f(oe,Xt)},innerMode:function(oe){return oe.block==Dt?{state:oe.htmlState,mode:Me}:oe.localState?{state:oe.localState,mode:oe.localMode}:{state:oe,mode:Ke}},indent:function(oe,Xt,qe){return oe.block==Dt&&Me.indent?Me.indent(oe.htmlState,Xt,qe):oe.localState&&oe.localMode.indent?oe.localMode.indent(oe.localState,Xt,qe):pt.Pass},blankLine:Et,getType:Yt,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Ke},"xml"),pt.defineMIME("text/markdown","markdown"),pt.defineMIME("text/x-markdown","markdown")})},98101:function(Dn,Gn,kt){(function(pt){pt(kt(89780))})(function(pt){"use strict";pt.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var Ut=0;Ut<pt.modeInfo.length;Ut++){var le=pt.modeInfo[Ut];le.mimes&&(le.mime=le.mimes[0])}pt.findModeByMIME=function(Me){Me=Me.toLowerCase();for(var ue=0;ue<pt.modeInfo.length;ue++){var It=pt.modeInfo[ue];if(It.mime==Me)return It;if(It.mimes){for(var qt=0;qt<It.mimes.length;qt++)if(It.mimes[qt]==Me)return It}}if(/\+xml$/.test(Me))return pt.findModeByMIME("application/xml");if(/\+json$/.test(Me))return pt.findModeByMIME("application/json")},pt.findModeByExtension=function(Me){Me=Me.toLowerCase();for(var ue=0;ue<pt.modeInfo.length;ue++){var It=pt.modeInfo[ue];if(It.ext){for(var qt=0;qt<It.ext.length;qt++)if(It.ext[qt]==Me)return It}}},pt.findModeByFileName=function(Me){for(var ue=0;ue<pt.modeInfo.length;ue++){var It=pt.modeInfo[ue];if(It.file&&It.file.test(Me))return It}var qt=Me.lastIndexOf("."),ge=qt>-1&&Me.substring(qt+1,Me.length);if(ge)return pt.findModeByExtension(ge)},pt.findModeByName=function(Me){Me=Me.toLowerCase();for(var ue=0;ue<pt.modeInfo.length;ue++){var It=pt.modeInfo[ue];if(It.name.toLowerCase()==Me)return It;if(It.alias){for(var qt=0;qt<It.alias.length;qt++)if(It.alias[qt].toLowerCase()==Me)return It}}}})},67549:function(Dn,Gn,kt){(function(pt){pt(kt(89780))})(function(pt){"use strict";pt.defineMode("stex",function(Ut,le){"use strict";function Me(Bt,nt){Bt.cmdState.push(nt)}function ue(Bt){return Bt.cmdState.length>0?Bt.cmdState[Bt.cmdState.length-1]:null}function It(Bt){var nt=Bt.cmdState.pop();nt&&nt.closeBracket()}function qt(Bt){for(var nt=Bt.cmdState,et=nt.length-1;et>=0;et--){var ht=nt[et];if(ht.name!="DEFAULT")return ht}return{styleIdentifier:function(){return null}}}function ge(Bt,nt,et){return function(){this.name=Bt,this.bracketNo=0,this.style=nt,this.styles=et,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var ne={};ne.importmodule=ge("importmodule","tag",["string","builtin"]),ne.documentclass=ge("documentclass","tag",["","atom"]),ne.usepackage=ge("usepackage","tag",["atom"]),ne.begin=ge("begin","tag",["atom"]),ne.end=ge("end","tag",["atom"]),ne.label=ge("label","tag",["atom"]),ne.ref=ge("ref","tag",["atom"]),ne.eqref=ge("eqref","tag",["atom"]),ne.cite=ge("cite","tag",["atom"]),ne.bibitem=ge("bibitem","tag",["atom"]),ne.Bibitem=ge("Bibitem","tag",["atom"]),ne.RBibitem=ge("RBibitem","tag",["atom"]),ne.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function Rt(Bt,nt){Bt.f=nt}function Ae(Bt,nt){var et;if(Bt.match(/^\\[a-zA-Z@]+/)){var ht=Bt.current().slice(1);return et=ne.hasOwnProperty(ht)?ne[ht]:ne.DEFAULT,et=new et,Me(nt,et),Rt(nt,Ee),et.style}if(Bt.match(/^\\[$&%#{}_]/)||Bt.match(/^\\[,;!\/\\]/))return"tag";if(Bt.match("\\["))return Rt(nt,function(gt,vt){return ie(gt,vt,"\\]")}),"keyword";if(Bt.match("\\("))return Rt(nt,function(gt,vt){return ie(gt,vt,"\\)")}),"keyword";if(Bt.match("$$"))return Rt(nt,function(gt,vt){return ie(gt,vt,"$$")}),"keyword";if(Bt.match("$"))return Rt(nt,function(gt,vt){return ie(gt,vt,"$")}),"keyword";var st=Bt.next();if(st=="%")return Bt.skipToEnd(),"comment";if(st=="}"||st=="]"){if(et=ue(nt),et)et.closeBracket(st),Rt(nt,Ee);else return"error";return"bracket"}else return st=="{"||st=="["?(et=ne.DEFAULT,et=new et,Me(nt,et),"bracket"):/\d/.test(st)?(Bt.eatWhile(/[\w.%]/),"atom"):(Bt.eatWhile(/[\w\-_]/),et=qt(nt),et.name=="begin"&&(et.argument=Bt.current()),et.styleIdentifier())}function ie(Bt,nt,et){if(Bt.eatSpace())return null;if(et&&Bt.match(et))return Rt(nt,Ae),"keyword";if(Bt.match(/^\\[a-zA-Z@]+/))return"tag";if(Bt.match(/^[a-zA-Z]+/))return"variable-2";if(Bt.match(/^\\[$&%#{}_]/)||Bt.match(/^\\[,;!\/]/)||Bt.match(/^[\^_&]/))return"tag";if(Bt.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(Bt.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var ht=Bt.next();return ht=="{"||ht=="}"||ht=="["||ht=="]"||ht=="("||ht==")"?"bracket":ht=="%"?(Bt.skipToEnd(),"comment"):"error"}function Ee(Bt,nt){var et=Bt.peek(),ht;return et=="{"||et=="["?(ht=ue(nt),ht.openBracket(et),Bt.eat(et),Rt(nt,Ae),"bracket"):/[ \t\r]/.test(et)?(Bt.eat(et),null):(Rt(nt,Ae),It(nt),Ae(Bt,nt))}return{startState:function(){var Bt=le.inMathMode?function(nt,et){return ie(nt,et)}:Ae;return{cmdState:[],f:Bt}},copyState:function(Bt){return{cmdState:Bt.cmdState.slice(),f:Bt.f}},token:function(Bt,nt){return nt.f(Bt,nt)},blankLine:function(Bt){Bt.f=Ae,Bt.cmdState.length=0},lineComment:"%"}}),pt.defineMIME("text/x-stex","stex"),pt.defineMIME("text/x-latex","stex")})},15525:function(Dn,Gn,kt){(function(pt){pt(kt(89780))})(function(pt){"use strict";var Ut={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},le={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};pt.defineMode("xml",function(Me,ue){var It=Me.indentUnit,qt={},ge=ue.htmlMode?Ut:le;for(var ne in ge)qt[ne]=ge[ne];for(var ne in ue)qt[ne]=ue[ne];var Rt,Ae;function ie(ae,Ne){function Ce(_e){return Ne.tokenize=_e,_e(ae,Ne)}var we=ae.next();if(we=="<")return ae.eat("!")?ae.eat("[")?ae.match("CDATA[")?Ce(nt("atom","]]>")):null:ae.match("--")?Ce(nt("comment","-->")):ae.match("DOCTYPE",!0,!0)?(ae.eatWhile(/[\w\._\-]/),Ce(et(1))):null:ae.eat("?")?(ae.eatWhile(/[\w\._\-]/),Ne.tokenize=nt("meta","?>"),"meta"):(Rt=ae.eat("/")?"closeTag":"openTag",Ne.tokenize=Ee,"tag bracket");if(we=="&"){var tn;return ae.eat("#")?ae.eat("x")?tn=ae.eatWhile(/[a-fA-F\d]/)&&ae.eat(";"):tn=ae.eatWhile(/[\d]/)&&ae.eat(";"):tn=ae.eatWhile(/[\w\.\-:]/)&&ae.eat(";"),tn?"atom":"error"}else return ae.eatWhile(/[^&<]/),null}ie.isInText=!0;function Ee(ae,Ne){var Ce=ae.next();if(Ce==">"||Ce=="/"&&ae.eat(">"))return Ne.tokenize=ie,Rt=Ce==">"?"endTag":"selfcloseTag","tag bracket";if(Ce=="=")return Rt="equals",null;if(Ce=="<"){Ne.tokenize=ie,Ne.state=vt,Ne.tagName=Ne.tagStart=null;var we=Ne.tokenize(ae,Ne);return we?we+" tag error":"tag error"}else return/[\'\"]/.test(Ce)?(Ne.tokenize=Bt(Ce),Ne.stringStartCol=ae.column(),Ne.tokenize(ae,Ne)):(ae.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Bt(ae){var Ne=function(Ce,we){for(;!Ce.eol();)if(Ce.next()==ae){we.tokenize=Ee;break}return"string"};return Ne.isInAttribute=!0,Ne}function nt(ae,Ne){return function(Ce,we){for(;!Ce.eol();){if(Ce.match(Ne)){we.tokenize=ie;break}Ce.next()}return ae}}function et(ae){return function(Ne,Ce){for(var we;(we=Ne.next())!=null;){if(we=="<")return Ce.tokenize=et(ae+1),Ce.tokenize(Ne,Ce);if(we==">")if(ae==1){Ce.tokenize=ie;break}else return Ce.tokenize=et(ae-1),Ce.tokenize(Ne,Ce)}return"meta"}}function ht(ae,Ne,Ce){this.prev=ae.context,this.tagName=Ne,this.indent=ae.indented,this.startOfLine=Ce,(qt.doNotIndent.hasOwnProperty(Ne)||ae.context&&ae.context.noIndent)&&(this.noIndent=!0)}function st(ae){ae.context&&(ae.context=ae.context.prev)}function gt(ae,Ne){for(var Ce;;){if(!ae.context||(Ce=ae.context.tagName,!qt.contextGrabbers.hasOwnProperty(Ce)||!qt.contextGrabbers[Ce].hasOwnProperty(Ne)))return;st(ae)}}function vt(ae,Ne,Ce){return ae=="openTag"?(Ce.tagStart=Ne.column(),St):ae=="closeTag"?Et:vt}function St(ae,Ne,Ce){return ae=="word"?(Ce.tagName=Ne.current(),Ae="tag",Jt):qt.allowMissingTagName&&ae=="endTag"?(Ae="tag bracket",Jt(ae,Ne,Ce)):(Ae="error",St)}function Et(ae,Ne,Ce){if(ae=="word"){var we=Ne.current();return Ce.context&&Ce.context.tagName!=we&&qt.implicitlyClosed.hasOwnProperty(Ce.context.tagName)&&st(Ce),Ce.context&&Ce.context.tagName==we||qt.matchClosing===!1?(Ae="tag",Tt):(Ae="tag error",Dt)}else return qt.allowMissingTagName&&ae=="endTag"?(Ae="tag bracket",Tt(ae,Ne,Ce)):(Ae="error",Dt)}function Tt(ae,Ne,Ce){return ae!="endTag"?(Ae="error",Tt):(st(Ce),vt)}function Dt(ae,Ne,Ce){return Ae="error",Tt(ae,Ne,Ce)}function Jt(ae,Ne,Ce){if(ae=="word")return Ae="attribute",Yt;if(ae=="endTag"||ae=="selfcloseTag"){var we=Ce.tagName,tn=Ce.tagStart;return Ce.tagName=Ce.tagStart=null,ae=="selfcloseTag"||qt.autoSelfClosers.hasOwnProperty(we)?gt(Ce,we):(gt(Ce,we),Ce.context=new ht(Ce,we,tn==Ce.indented)),vt}return Ae="error",Jt}function Yt(ae,Ne,Ce){return ae=="equals"?Gt:(qt.allowMissing||(Ae="error"),Jt(ae,Ne,Ce))}function Gt(ae,Ne,Ce){return ae=="string"?me:ae=="word"&&qt.allowUnquoted?(Ae="string",Jt):(Ae="error",Jt(ae,Ne,Ce))}function me(ae,Ne,Ce){return ae=="string"?me:Jt(ae,Ne,Ce)}return{startState:function(ae){var Ne={tokenize:ie,state:vt,indented:ae||0,tagName:null,tagStart:null,context:null};return ae!=null&&(Ne.baseIndent=ae),Ne},token:function(ae,Ne){if(!Ne.tagName&&ae.sol()&&(Ne.indented=ae.indentation()),ae.eatSpace())return null;Rt=null;var Ce=Ne.tokenize(ae,Ne);return(Ce||Rt)&&Ce!="comment"&&(Ae=null,Ne.state=Ne.state(Rt||Ce,ae,Ne),Ae&&(Ce=Ae=="error"?Ce+" error":Ae)),Ce},indent:function(ae,Ne,Ce){var we=ae.context;if(ae.tokenize.isInAttribute)return ae.tagStart==ae.indented?ae.stringStartCol+1:ae.indented+It;if(we&&we.noIndent)return pt.Pass;if(ae.tokenize!=Ee&&ae.tokenize!=ie)return Ce?Ce.match(/^(\s*)/)[0].length:0;if(ae.tagName)return qt.multilineTagIndentPastTag!==!1?ae.tagStart+ae.tagName.length+2:ae.tagStart+It*(qt.multilineTagIndentFactor||1);if(qt.alignCDATA&&/<!\[CDATA\[/.test(Ne))return 0;var tn=Ne&&/^<(\/)?([\w_:\.-]*)/.exec(Ne);if(tn&&tn[1])for(;we;)if(we.tagName==tn[2]){we=we.prev;break}else if(qt.implicitlyClosed.hasOwnProperty(we.tagName))we=we.prev;else break;else if(tn)for(;we;){var _e=qt.contextGrabbers[we.tagName];if(_e&&_e.hasOwnProperty(tn[2]))we=we.prev;else break}for(;we&&we.prev&&!we.startOfLine;)we=we.prev;return we?we.indent+It:ae.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:qt.htmlMode?"html":"xml",helperType:qt.htmlMode?"html":"xml",skipAttribute:function(ae){ae.state==Gt&&(ae.state=Jt)},xmlCurrentTag:function(ae){return ae.tagName?{name:ae.tagName,close:ae.type=="closeTag"}:null},xmlCurrentContext:function(ae){for(var Ne=[],Ce=ae.context;Ce;Ce=Ce.prev)Ce.tagName&&Ne.push(Ce.tagName);return Ne.reverse()}}}),pt.defineMIME("text/xml","xml"),pt.defineMIME("application/xml","xml"),pt.mimeModes.hasOwnProperty("text/html")||pt.defineMIME("text/html",{name:"xml",htmlMode:!0})})},12378:function(Dn,Gn,kt){"use strict";kt.d(Gn,{$u:function(){return ne},BD:function(){return _t},E9:function(){return ge},FF:function(){return Rn},FJ:function(){return vt},Hn:function(){return gt},KX:function(){return Et},NB:function(){return ce},S0:function(){return ee},UL:function(){return Rt},Vk:function(){return st},Vm:function(){return Le},YI:function(){return Mn},ZA:function(){return le},Zt:function(){return Ae},al:function(){return Mt},bn:function(){return zt},bx:function(){return Lt},g2:function(){return ui},h1:function(){return Gt},hD:function(){return nn},l4:function(){return It},rU:function(){return Oe},s_:function(){return Pt},uz:function(){return Qe},z6:function(){return ie}}),Dn=kt.hmd(Dn),function(){var wt;function yn(a){var y=0;return function(){return y<a.length?{done:!1,value:a[y++]}:{done:!0}}}function Wn(a){var y=typeof Symbol!="undefined"&&Symbol.iterator&&a[Symbol.iterator];return y?y.call(a):{next:yn(a)}}function ki(a){for(var y,x=[];!(y=a.next()).done;)x.push(y.value);return x}var Ui=typeof Object.create=="function"?Object.create:function(a){function y(){}return y.prototype=a,new y},ur;if(typeof Object.setPrototypeOf=="function")ur=Object.setPrototypeOf;else{var Mr;t:{var gi={a:!0},bn={};try{bn.__proto__=gi,Mr=bn.a;break t}catch(a){}Mr=!1}ur=Mr?function(a,y){if(a.__proto__=y,a.__proto__!==y)throw new TypeError(a+" is not extensible");return a}:null}var pe=ur;function Se(a,y){if(a.prototype=Ui(y.prototype),a.prototype.constructor=a,pe)pe(a,y);else for(var x in y)if(x!="prototype")if(Object.defineProperties){var E=Object.getOwnPropertyDescriptor(y,x);E&&Object.defineProperty(a,x,E)}else a[x]=y[x];a.QA=y.prototype}var ve=typeof kt.g!="undefined"&&kt.g!=null?kt.g:self,zn=typeof Object.assign=="function"?Object.assign:function(a,y){for(var x=1;x<arguments.length;x++){var E=arguments[x];if(E)for(var b in E)Object.prototype.hasOwnProperty.call(E,b)&&(a[b]=E[b])}return a},kn=typeof Object.defineProperties=="function"?Object.defineProperty:function(a,y,x){a!=Array.prototype&&a!=Object.prototype&&(a[y]=x.value)};function Qn(a,y){if(y){var x=ve;a=a.split(".");for(var E=0;E<a.length-1;E++){var b=a[E];b in x||(x[b]={}),x=x[b]}a=a[a.length-1],E=x[a],y=y(E),y!=E&&y!=null&&kn(x,a,{writable:!0,value:y})}}Qn("Object.assign",function(a){return a||zn}),Qn("Array.prototype.fill",function(a){return a||function(y,x,E){var b=this.length||0;for(0>x&&(x=Math.max(0,b+x)),(E==null||E>b)&&(E=b),E=Number(E),0>E&&(E=Math.max(0,b+E)),x=Number(x||0);x<E;x++)this[x]=y;return this}});var $e=typeof globalThis=="object"&&globalThis||typeof kt.g=="object"&&kt.g.global===kt.g&&kt.g||typeof self=="object"&&self.self===self&&self||{};$e.requestAnimationFrame===void 0&&($e.setImmediate===void 0?$e.requestAnimationFrame=function(a){$e.setTimeout(a,0)}:$e.requestAnimationFrame=$e.setImmediate);function On(){}function Fe(a,y){var x=-1;return function(){var E=this,b=arguments;x!==-1&&$e.clearTimeout(x),x=Pe(function(){x=-1,a.apply(E,b)},y)}}function Pe(a,y){return $e.setTimeout(a,y)}function Zn(a){return $e.document.createElement(a)}function $t(a){throw Error(a)}function Ze(a,y){a="The object is frozen, so its properties cannot be set: "+a.toString(),y!==void 0&&(a+=" to value: "+y),$t(a)}function wn(a,y,x,E){x=x===null?"*":typeof x=="string"?x:typeof x=="function"&&typeof x.className=="string"?x.className:"",E!==void 0&&(x+="."+E),$t(x+" is not in the range "+y+": "+a)}function ri(a){$e.console&&$e.console.log(a)}function We(a){return typeof a=="object"&&a!==null}function je(a){return Array.isArray(a)||$e.NodeList&&a instanceof $e.NodeList||$e.HTMLCollection&&a instanceof $e.HTMLCollection}function Vn(a){return Array.prototype.slice.call(a)}function ci(a,y,x){Array.isArray(a)?y>=a.length?a.push(x):a.splice(y,0,x):$t("Cannot insert an object into an HTMLCollection or NodeList: "+x+" at "+y)}function Mi(a,y){Array.isArray(a)?y>=a.length?a.pop():a.splice(y,1):$t("Cannot remove an object from an HTMLCollection or NodeList at "+y)}function pi(){var a=Xr.pop();return a===void 0?[]:a}function oi(a){a.length=0,Xr.push(a)}function hi(a){if(typeof a=="function"){if(a.className)return a.className;if(a.name)return a.name;var y=a.toString();if(y=y.substring(9,y.indexOf("(")).trim(),y!=="")return a._className=y}else if(We(a)&&a.constructor)return hi(a.constructor);return typeof a}function Bi(a){var y=a;return We(a)&&(a.text?y=a.text:a.name?y=a.name:a.key!==void 0?y=a.key:a.id!==void 0?y=a.id:a.constructor===Object&&(a.Text?y=a.Text:a.Name?y=a.Name:a.Key!==void 0?y=a.Key:a.Id!==void 0?y=a.Id:a.ID!==void 0&&(y=a.ID))),y===void 0?"undefined":y===null?"null":y.toString()}function _i(a,y){if(a.hasOwnProperty(y))return!0;for(a=Object.getPrototypeOf(a);a&&a!==Function;){if(a.hasOwnProperty(y))return!0;var x=a.CA;if(x&&x[y])return!0;a=Object.getPrototypeOf(a)}return!1}function Ki(a,y,x){Object.defineProperty(Nr.prototype,a,{get:y,set:x})}function en(a){for(var y=[],x=0;256>x;x++)y["0123456789abcdef".charAt(x>>4)+"0123456789abcdef".charAt(x&15)]=String.fromCharCode(x);a.length%2&&(a="0"+a),x=[];for(var E=0,b=0;b<a.length;b+=2)x[E++]=y[a.substr(b,2)];for(a=x.join(""),a=a===""?"0":a,y=[],x=0;256>x;x++)y[x]=x;for(x=E=0;256>x;x++)E=(E+y[x]+119)%256,b=y[x],y[x]=y[E],y[E]=b;E=x=0;for(var z="",tt=0;tt<a.length;tt++)x=(x+1)%256,E=(E+y[x])%256,b=y[x],y[x]=y[E],y[E]=b,z+=String.fromCharCode(a.charCodeAt(tt)^y[(y[x]+y[E])%256]);return z.indexOf("GoJS 2.1 evaluation")>-1||z.indexOf("\xA9 1998-2021 Northwoods Software")>-1||z.indexOf("Not for distribution or production use")>-1||z.indexOf("gojs.net")>-1?"":z}var no=$e.navigator!==void 0&&0<$e.navigator.userAgent.indexOf("Trident/7"),vr=$e.navigator!==void 0&&$e.navigator.platform!==void 0&&$e.navigator.platform.match(/(iPhone|iPod|iPad|Mac)/i)!==null,Xr=[];Object.freeze([]),On.className="Util",On.Dx="32ab5ff3b26f42dc0ed90f21472913b5",On.adym="gojs.net",On.vfo="28e645fdb266",On.className="Util";function He(a,y,x){Di(this),this.j=a,this.xa=y,this.o=x}He.prototype.toString=function(){return"EnumValue."+this.xa};function Hn(a,y){return y==null||y===""?null:a[y]}ve.Object.defineProperties(He.prototype,{classType:{get:function(){return this.j}},name:{get:function(){return this.xa}},value:{get:function(){return this.o}}}),He.className="EnumValue";function Fi(){this.ew=[]}Fi.prototype.toString=function(){return this.ew.join("")},Fi.prototype.add=function(a){a!==""&&this.ew.push(a)},Fi.className="StringBuilder";function Hi(){}Hi.className="PropertyCollection";var Ii={EA:!1,JA:!1,GA:!1,IA:!1,NA:!1,LA:!1,nx:!1,FA:null,trace:function(a){$e.console&&$e.console.log(a)},HA:function(a,y,x,E){a.strokeStyle="red",a.fillStyle="red",a.font="8px sans-serif",a.beginPath(),a.moveTo(-10,0),a.lineTo(10,0),a.moveTo(0,-10),a.lineTo(0,10),a.stroke(),a.setTransform(1,0,0,1,0,0),a.scale(x,x),a.transform(y.m11,y.m12,y.m21,y.m22,y.dx,y.dy),a.lineWidth=2,a.beginPath(),a.moveTo(E.left,E.top+20),a.lineTo(E.left,E.top),a.lineTo(E.left+20,E.top),a.moveTo(E.right,E.bottom-20),a.lineTo(E.right,E.bottom),a.lineTo(E.right-20,E.bottom),a.stroke(),a.fillText("DB: "+Math.round(E.x)+", "+Math.round(E.y)+", "+Math.round(E.width)+", "+Math.round(E.height),E.left,E.top-5)},DA:function(a){var y={},x;for(x in a){if(y.x=x,y.x!=="licenseKey"){var E=a[y.x];if(E.prototype!==void 0){y.Zl=Object.getOwnPropertyNames(E.prototype);for(var b={Tj:0};b.Tj<y.Zl.length;b={Tj:b.Tj},b.Tj++){var z=Object.getOwnPropertyDescriptor(E.prototype,y.Zl[b.Tj]);z.get!==void 0&&z.set===void 0&&Object.defineProperty(E.prototype,y.Zl[b.Tj],{set:function(tt,rt){return function(){throw Error("Property "+tt.Zl[rt.Tj]+" of "+tt.x+" is read-only.")}}(y,b)})}}}y={Zl:y.Zl,x:y.x}}}};function Yi(){}Yi.prototype.reset=function(){},Yi.prototype.next=function(){return!1},Yi.prototype.Ad=function(){return!1},Yi.prototype.first=function(){return null},Yi.prototype.any=function(){return!1},Yi.prototype.all=function(){return!0},Yi.prototype.each=function(){return this},Yi.prototype.map=function(){return this},Yi.prototype.filter=function(){return this},Yi.prototype.de=function(){},Yi.prototype.toString=function(){return"EmptyIterator"},ve.Object.defineProperties(Yi.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}}),Yi.prototype.first=Yi.prototype.first,Yi.prototype.hasNext=Yi.prototype.Ad,Yi.prototype.next=Yi.prototype.next,Yi.prototype.reset=Yi.prototype.reset;var Ar=null;Yi.className="EmptyIterator",Ar=new Yi;function Pr(a){this.key=-1,this.value=a}Pr.prototype.reset=function(){this.key=-1},Pr.prototype.next=function(){return this.key===-1?(this.key=0,!0):!1},Pr.prototype.Ad=function(){return this.next()},Pr.prototype.first=function(){return this.key=0,this.value},Pr.prototype.any=function(a){return this.key=-1,a(this.value)},Pr.prototype.all=function(a){return this.key=-1,a(this.value)},Pr.prototype.each=function(a){return this.key=-1,a(this.value),this},Pr.prototype.map=function(a){return new Pr(a(this.value))},Pr.prototype.filter=function(a){return a(this.value)?new Pr(this.value):Ar},Pr.prototype.de=function(){this.value=null},Pr.prototype.toString=function(){return"SingletonIterator("+this.value+")"},ve.Object.defineProperties(Pr.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}}),Pr.prototype.first=Pr.prototype.first,Pr.prototype.hasNext=Pr.prototype.Ad,Pr.prototype.next=Pr.prototype.next,Pr.prototype.reset=Pr.prototype.reset,Pr.className="SingletonIterator";function Br(a){this.Bb=a,this.qf=null,a.Sa=null,this.qa=a.Ja,this.Za=-1}Br.prototype.reset=function(){var a=this.Bb;a.Sa=null,this.qa=a.Ja,this.Za=-1},Br.prototype.next=function(){var a=this.Bb;if(a.Ja!==this.qa&&0>this.key)return!1;a=a.s;var y=a.length,x=++this.Za,E=this.qf;if(E!==null)for(;x<y;){var b=a[x];if(E(b))return this.key=this.Za=x,this.value=b,!0;x++}else{if(x<y)return this.key=x,this.value=a[x],!0;this.de()}return!1},Br.prototype.Ad=function(){return this.next()},Br.prototype.first=function(){var a=this.Bb;this.qa=a.Ja,this.Za=0,a=a.s;var y=a.length,x=this.qf;if(x!==null){for(var E=0;E<y;){var b=a[E];if(x(b))return this.key=this.Za=E,this.value=b;E++}return null}return 0<y?(a=a[0],this.key=0,this.value=a):null},Br.prototype.any=function(a){var y=this.Bb;y.Sa=null,this.Za=-1,y=y.s;for(var x=y.length,E=this.qf,b=0;b<x;b++){var z=y[b];if((E===null||E(z))&&a(z))return!0}return!1},Br.prototype.all=function(a){var y=this.Bb;y.Sa=null,this.Za=-1,y=y.s;for(var x=y.length,E=this.qf,b=0;b<x;b++){var z=y[b];if((E===null||E(z))&&!a(z))return!1}return!0},Br.prototype.each=function(a){var y=this.Bb;y.Sa=null,this.Za=-1,y=y.s;for(var x=y.length,E=this.qf,b=0;b<x;b++){var z=y[b];(E===null||E(z))&&a(z)}return this},Br.prototype.map=function(a){var y=this.Bb;y.Sa=null,this.Za=-1;var x=[];y=y.s;for(var E=y.length,b=this.qf,z=0;z<E;z++){var tt=y[z];(b===null||b(tt))&&x.push(a(tt))}return a=new fn,a.s=x,a.xb(),a.iterator},Br.prototype.filter=function(a){var y=this.Bb;y.Sa=null,this.Za=-1;var x=[];y=y.s;for(var E=y.length,b=this.qf,z=0;z<E;z++){var tt=y[z];(b===null||b(tt))&&a(tt)&&x.push(tt)}return a=new fn,a.s=x,a.xb(),a.iterator},Br.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.qf=null,this.Bb.Sa=this},Br.prototype.toString=function(){return"ListIterator@"+this.Za+"/"+this.Bb.count},ve.Object.defineProperties(Br.prototype,{iterator:{get:function(){return this}},predicate:{get:function(){return this.qf},set:function(a){this.qf=a}},count:{get:function(){var a=this.qf;if(a!==null){for(var y=0,x=this.Bb.s,E=x.length,b=0;b<E;b++)a(x[b])&&y++;return y}return this.Bb.s.length}}}),Br.prototype.first=Br.prototype.first,Br.prototype.hasNext=Br.prototype.Ad,Br.prototype.next=Br.prototype.next,Br.prototype.reset=Br.prototype.reset,Br.className="ListIterator";function Fr(a){this.Bb=a,a.Hg=null,this.qa=a.Ja,this.Za=a.s.length}Fr.prototype.reset=function(){var a=this.Bb;a.Hg=null,this.qa=a.Ja,this.Za=a.s.length},Fr.prototype.next=function(){var a=this.Bb;if(a.Ja!==this.qa&&0>this.key)return!1;var y=--this.Za;return 0<=y?(this.key=y,this.value=a.s[y],!0):(this.de(),!1)},Fr.prototype.Ad=function(){return this.next()},Fr.prototype.first=function(){var a=this.Bb;this.qa=a.Ja;var y=a.s;return this.Za=a=y.length-1,0<=a?(y=y[a],this.key=a,this.value=y):null},Fr.prototype.any=function(a){var y=this.Bb;y.Hg=null,y=y.s;var x=y.length;for(this.Za=x,--x;0<=x;x--)if(a(y[x]))return!0;return!1},Fr.prototype.all=function(a){var y=this.Bb;y.Hg=null,y=y.s;var x=y.length;for(this.Za=x,--x;0<=x;x--)if(!a(y[x]))return!1;return!0},Fr.prototype.each=function(a){var y=this.Bb;y.Hg=null,y=y.s;var x=y.length;for(this.Za=x,--x;0<=x;x--)a(y[x]);return this},Fr.prototype.map=function(a){var y=this.Bb;y.Hg=null;var x=[];y=y.s;var E=y.length;for(this.Za=E,--E;0<=E;E--)x.push(a(y[E]));return a=new fn,a.s=x,a.xb(),a.iterator},Fr.prototype.filter=function(a){var y=this.Bb;y.Hg=null;var x=[];y=y.s;var E=y.length;for(this.Za=E,--E;0<=E;E--){var b=y[E];a(b)&&x.push(b)}return a=new fn,a.s=x,a.xb(),a.iterator},Fr.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.Bb.Hg=this},Fr.prototype.toString=function(){return"ListIteratorBackwards("+this.Za+"/"+this.Bb.count+")"},ve.Object.defineProperties(Fr.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.Bb.s.length}}}),Fr.prototype.first=Fr.prototype.first,Fr.prototype.hasNext=Fr.prototype.Ad,Fr.prototype.next=Fr.prototype.next,Fr.prototype.reset=Fr.prototype.reset,Fr.className="ListIteratorBackwards";function fn(a){Di(this),this._isFrozen=!1,this.s=[],this.Ja=0,this.Hg=this.Sa=null,typeof a=="string"&&$t("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}wt=fn.prototype,wt.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return this._isFrozen=!1,this},wt.toString=function(){return"List()#"+Ai(this)},wt.add=function(a){return a===null?this:(this._isFrozen&&Ze(this,a),this.s.push(a),this.xb(),this)},wt.push=function(a){this.add(a)},wt.addAll=function(a){if(a===null)return this;this._isFrozen&&Ze(this);var y=this.s;if(je(a))for(var x=a.length,E=0;E<x;E++)y.push(a[E]);else for(a=a.iterator;a.next();)y.push(a.value);return this.xb(),this},wt.clear=function(){this._isFrozen&&Ze(this),this.s.length=0,this.xb()},wt.contains=function(a){return a===null?!1:this.s.indexOf(a)!==-1},wt.has=function(a){return this.contains(a)},wt.indexOf=function(a){return a===null?-1:this.s.indexOf(a)},wt.M=function(a){var y=this.s;return(0>a||a>=y.length)&&wn(a,"0 <= i < length",fn,"elt:i"),y[a]},wt.get=function(a){return this.M(a)},wt.cd=function(a,y){var x=this.s;(0>a||a>=x.length)&&wn(a,"0 <= i < length",fn,"setElt:i"),this._isFrozen&&Ze(this,a),x[a]=y},wt.set=function(a,y){this.cd(a,y)},wt.first=function(){var a=this.s;return a.length===0?null:a[0]},wt.jc=function(){var a=this.s,y=a.length;return 0<y?a[y-1]:null},wt.pop=function(){this._isFrozen&&Ze(this);var a=this.s;return 0<a.length?a.pop():null},fn.prototype.any=function(a){for(var y=this.s,x=y.length,E=0;E<x;E++)if(a(y[E]))return!0;return!1},fn.prototype.all=function(a){for(var y=this.s,x=y.length,E=0;E<x;E++)if(!a(y[E]))return!1;return!0},fn.prototype.each=function(a){for(var y=this.s,x=y.length,E=0;E<x;E++)a(y[E]);return this},fn.prototype.map=function(a){for(var y=new fn,x=[],E=this.s,b=E.length,z=0;z<b;z++)x.push(a(E[z]));return y.s=x,y.xb(),y},fn.prototype.filter=function(a){for(var y=new fn,x=[],E=this.s,b=E.length,z=0;z<b;z++){var tt=E[z];a(tt)&&x.push(tt)}return y.s=x,y.xb(),y},wt=fn.prototype,wt.Gb=function(a,y){0>a&&wn(a,">= 0",fn,"insertAt:i"),this._isFrozen&&Ze(this,a);var x=this.s;a>=x.length?x.push(y):x.splice(a,0,y),this.xb()},wt.remove=function(a){if(a===null)return!1;this._isFrozen&&Ze(this,a);var y=this.s;return a=y.indexOf(a),a===-1?!1:(a===y.length-1?y.pop():y.splice(a,1),this.xb(),!0)},wt.delete=function(a){return this.remove(a)},wt.mb=function(a){var y=this.s;(0>a||a>=y.length)&&wn(a,"0 <= i < length",fn,"removeAt:i"),this._isFrozen&&Ze(this,a),a===y.length-1?y.pop():y.splice(a,1),this.xb()},wt.removeRange=function(a,y){var x=this.s,E=x.length;if(0>a)a=0;else if(a>=E)return this;if(0>y)return this;if(y>=E&&(y=E-1),a>y)return this;this._isFrozen&&Ze(this);for(var b=a,z=y+1;z<E;)x[b++]=x[z++];return x.length=E-(y-a+1),this.xb(),this},fn.prototype.copy=function(){var a=new fn,y=this.s;return 0<y.length&&(a.s=Array.prototype.slice.call(y)),a},wt=fn.prototype,wt.Fa=function(){for(var a=this.s,y=this.count,x=Array(y),E=0;E<y;E++)x[E]=a[E];return x},wt.Iv=function(){for(var a=new pn,y=this.s,x=this.count,E=0;E<x;E++)a.add(y[E]);return a},wt.sort=function(a){return this._isFrozen&&Ze(this),this.s.sort(a),this.xb(),this},wt.zi=function(a,y,x){var E=this.s,b=E.length;y===void 0&&(y=0),x===void 0&&(x=b),this._isFrozen&&Ze(this);var z=x-y;if(1>=z)return this;if((0>y||y>=b-1)&&wn(y,"0 <= from < length",fn,"sortRange:from"),z===2)return x=E[y],b=E[y+1],0<a(x,b)&&(E[y]=b,E[y+1]=x,this.xb()),this;if(y===0)if(x>=b)E.sort(a);else for(y=E.slice(0,x),y.sort(a),a=0;a<x;a++)E[a]=y[a];else if(x>=b)for(x=E.slice(y),x.sort(a),a=y;a<b;a++)E[a]=x[a-y];else for(b=E.slice(y,x),b.sort(a),a=y;a<x;a++)E[a]=b[a-y];return this.xb(),this},wt.reverse=function(){return this._isFrozen&&Ze(this),this.s.reverse(),this.xb(),this},ve.Object.defineProperties(fn.prototype,{_dataArray:{get:function(){return this.s}},count:{get:function(){return this.s.length}},size:{get:function(){return this.s.length}},length:{get:function(){return this.s.length}},iterator:{get:function(){if(0>=this.s.length)return Ar;var a=this.Sa;return a!==null?(a.reset(),a):new Br(this)}},iteratorBackwards:{get:function(){if(0>=this.s.length)return Ar;var a=this.Hg;return a!==null?(a.reset(),a):new Fr(this)}}}),fn.prototype.reverse=fn.prototype.reverse,fn.prototype.sortRange=fn.prototype.zi,fn.prototype.sort=fn.prototype.sort,fn.prototype.toSet=fn.prototype.Iv,fn.prototype.toArray=fn.prototype.Fa,fn.prototype.removeRange=fn.prototype.removeRange,fn.prototype.removeAt=fn.prototype.mb,fn.prototype.delete=fn.prototype.delete,fn.prototype.remove=fn.prototype.remove,fn.prototype.insertAt=fn.prototype.Gb,fn.prototype.pop=fn.prototype.pop,fn.prototype.last=fn.prototype.jc,fn.prototype.first=fn.prototype.first,fn.prototype.set=fn.prototype.set,fn.prototype.setElt=fn.prototype.cd,fn.prototype.get=fn.prototype.get,fn.prototype.elt=fn.prototype.M,fn.prototype.indexOf=fn.prototype.indexOf,fn.prototype.has=fn.prototype.has,fn.prototype.contains=fn.prototype.contains,fn.prototype.clear=fn.prototype.clear,fn.prototype.addAll=fn.prototype.addAll,fn.prototype.push=fn.prototype.push,fn.prototype.add=fn.prototype.add,fn.prototype.thaw=fn.prototype.ka,fn.prototype.freeze=fn.prototype.freeze,fn.className="List";function io(a){this.eg=a,a.Sa=null,this.qa=a.Ja,this.sa=null}io.prototype.reset=function(){var a=this.eg;a.Sa=null,this.qa=a.Ja,this.sa=null},io.prototype.next=function(){var a=this.eg;if(a.Ja!==this.qa&&this.key===null)return!1;var y=this.sa;return y=y===null?a.ea:y.va,y!==null?(this.sa=y,this.value=y.value,this.key=y.key,!0):(this.de(),!1)},io.prototype.Ad=function(){return this.next()},io.prototype.first=function(){var a=this.eg;if(this.qa=a.Ja,a=a.ea,a!==null){this.sa=a;var y=a.value;return this.key=a.key,this.value=y}return null},io.prototype.any=function(a){var y=this.eg;for(this.sa=y.Sa=null,y=y.ea;y!==null;){if(a(y.value))return!0;y=y.va}return!1},io.prototype.all=function(a){var y=this.eg;for(this.sa=y.Sa=null,y=y.ea;y!==null;){if(!a(y.value))return!1;y=y.va}return!0},io.prototype.each=function(a){var y=this.eg;for(this.sa=y.Sa=null,y=y.ea;y!==null;)a(y.value),y=y.va;return this},io.prototype.map=function(a){var y=this.eg;y.Sa=null;var x=new fn;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},io.prototype.filter=function(a){var y=this.eg;y.Sa=null;var x=new fn;for(y=y.ea;y!==null;){var E=y.value;a(E)&&x.add(E),y=y.va}return x.iterator},io.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.eg.Sa=this},io.prototype.toString=function(){return this.sa!==null?"SetIterator@"+this.sa.value:"SetIterator"},ve.Object.defineProperties(io.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.eg.Sb}}}),io.prototype.first=io.prototype.first,io.prototype.hasNext=io.prototype.Ad,io.prototype.next=io.prototype.next,io.prototype.reset=io.prototype.reset,io.className="SetIterator";function pn(a){Di(this),this._isFrozen=!1,this.Tb={},this.Sb=0,this.Sa=null,this.Ja=0,this.kf=this.ea=null,typeof a=="string"&&$t("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}wt=pn.prototype,wt.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return this._isFrozen=!1,this},wt.toString=function(){return"Set()#"+Ai(this)},wt.add=function(a){if(a===null)return this;this._isFrozen&&Ze(this,a);var y=a;return We(a)&&(y=$i(a)),this.Tb[y]===void 0&&(this.Sb++,a=new Re(a,a),this.Tb[y]=a,y=this.kf,y===null?this.ea=a:(a.ll=y,y.va=a),this.kf=a,this.xb()),this},wt.addAll=function(a){if(a===null)return this;if(this._isFrozen&&Ze(this),je(a))for(var y=a.length,x=0;x<y;x++)this.add(a[x]);else for(a=a.iterator;a.next();)this.add(a.value);return this},wt.contains=function(a){if(a===null)return!1;var y=a;return We(a)&&(y=Ai(a),y===void 0)?!1:this.Tb[y]!==void 0},wt.has=function(a){return this.contains(a)},wt.Sy=function(a){if(a===null)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0},wt.Ty=function(a){if(a===null)return!0;for(a=a.iterator;a.next();)if(this.contains(a.value))return!0;return!1},wt.first=function(){var a=this.ea;return a===null?null:a.value},pn.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y.value))return!0;y=y.va}return!1},pn.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y.value))return!1;y=y.va}return!0},pn.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y.value),y=y.va;return this},pn.prototype.map=function(a){for(var y=new pn,x=this.ea;x!==null;)y.add(a(x.value)),x=x.va;return y},pn.prototype.filter=function(a){for(var y=new pn,x=this.ea;x!==null;){var E=x.value;a(E)&&y.add(E),x=x.va}return y},wt=pn.prototype,wt.remove=function(a){if(a===null)return!1;this._isFrozen&&Ze(this,a);var y=a;if(We(a)&&(y=Ai(a),y===void 0)||(a=this.Tb[y],a===void 0))return!1;var x=a.va,E=a.ll;return x!==null&&(x.ll=E),E!==null&&(E.va=x),this.ea===a&&(this.ea=x),this.kf===a&&(this.kf=E),delete this.Tb[y],this.Sb--,this.xb(),!0},wt.delete=function(a){return this.remove(a)},wt.hp=function(a){if(a===null)return this;if(this._isFrozen&&Ze(this),je(a))for(var y=a.length,x=0;x<y;x++)this.remove(a[x]);else for(a=a.iterator;a.next();)this.remove(a.value);return this},wt.pA=function(a){if(a===null||this.count===0)return this;this._isFrozen&&Ze(this);var y=new pn;y.addAll(a),a=[];for(var x=this.iterator;x.next();){var E=x.value;y.contains(E)||a.push(E)}return this.hp(a),this},wt.clear=function(){this._isFrozen&&Ze(this),this.Tb={},this.Sb=0,this.Sa!==null&&this.Sa.reset(),this.kf=this.ea=null,this.xb()},pn.prototype.copy=function(){var a=new pn,y=this.Tb,x;for(x in y)a.add(y[x].value);return a},pn.prototype.Fa=function(){var a=Array(this.Sb),y=this.Tb,x=0,E;for(E in y)a[x]=y[E].value,x++;return a},pn.prototype.Hv=function(){var a=new fn,y=this.Tb,x;for(x in y)a.add(y[x].value);return a};function Di(a){a.__gohashid=bo++}function $i(a){var y=a.__gohashid;return y===void 0&&(y=bo++,a.__gohashid=y),y}function Ai(a){return a.__gohashid}ve.Object.defineProperties(pn.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.Sb)return Ar;var a=this.Sa;return a!==null?(a.reset(),a):new io(this)}}}),pn.prototype.toList=pn.prototype.Hv,pn.prototype.toArray=pn.prototype.Fa,pn.prototype.clear=pn.prototype.clear,pn.prototype.retainAll=pn.prototype.pA,pn.prototype.removeAll=pn.prototype.hp,pn.prototype.delete=pn.prototype.delete,pn.prototype.remove=pn.prototype.remove,pn.prototype.first=pn.prototype.first,pn.prototype.containsAny=pn.prototype.Ty,pn.prototype.containsAll=pn.prototype.Sy,pn.prototype.has=pn.prototype.has,pn.prototype.contains=pn.prototype.contains,pn.prototype.addAll=pn.prototype.addAll,pn.prototype.add=pn.prototype.add,pn.prototype.thaw=pn.prototype.ka,pn.prototype.freeze=pn.prototype.freeze;var bo=1;pn.className="Set",pn.uniqueHash=Di,pn.hashIdUnique=$i,pn.hashId=Ai;function Fo(a){this.ma=a,this.qa=a.Ja,this.sa=null}Fo.prototype.reset=function(){this.qa=this.ma.Ja,this.sa=null},Fo.prototype.next=function(){var a=this.ma;if(a.Ja!==this.qa&&this.key===null)return!1;var y=this.sa;return y=y===null?a.ea:y.va,y!==null?(this.sa=y,this.value=this.key=a=y.key,!0):(this.de(),!1)},Fo.prototype.Ad=function(){return this.next()},Fo.prototype.first=function(){var a=this.ma;return this.qa=a.Ja,a=a.ea,a!==null?(this.sa=a,this.value=this.key=a=a.key):null},Fo.prototype.any=function(a){var y=this.ma;for(this.sa=null,y=y.ea;y!==null;){if(a(y.key))return!0;y=y.va}return!1},Fo.prototype.all=function(a){var y=this.ma;for(this.sa=null,y=y.ea;y!==null;){if(!a(y.key))return!1;y=y.va}return!0},Fo.prototype.each=function(a){var y=this.ma;for(this.sa=null,y=y.ea;y!==null;)a(y.key),y=y.va;return this},Fo.prototype.map=function(a){var y=this.ma;this.sa=null;var x=new fn;for(y=y.ea;y!==null;)x.add(a(y.key)),y=y.va;return x.iterator},Fo.prototype.filter=function(a){var y=this.ma;this.sa=null;var x=new fn;for(y=y.ea;y!==null;){var E=y.key;a(E)&&x.add(E),y=y.va}return x.iterator},Fo.prototype.de=function(){this.value=this.key=null,this.qa=-1},Fo.prototype.toString=function(){return this.sa!==null?"MapKeySetIterator@"+this.sa.value:"MapKeySetIterator"},ve.Object.defineProperties(Fo.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),Fo.prototype.first=Fo.prototype.first,Fo.prototype.hasNext=Fo.prototype.Ad,Fo.prototype.next=Fo.prototype.next,Fo.prototype.reset=Fo.prototype.reset,Fo.className="MapKeySetIterator";function ao(a){pn.call(this),Di(this),this._isFrozen=!0,this.ma=a}Se(ao,pn),wt=ao.prototype,wt.freeze=function(){return this},wt.ka=function(){return this},wt.toString=function(){return"MapKeySet("+this.ma.toString()+")"},wt.add=function(){$t("This Set is read-only: "+this.toString())},wt.contains=function(a){return this.ma.contains(a)},wt.has=function(a){return this.contains(a)},wt.remove=function(){$t("This Set is read-only: "+this.toString())},wt.delete=function(a){return this.remove(a)},wt.clear=function(){$t("This Set is read-only: "+this.toString())},wt.first=function(){var a=this.ma.ea;return a!==null?a.key:null},ao.prototype.any=function(a){for(var y=this.ma.ea;y!==null;){if(a(y.key))return!0;y=y.va}return!1},ao.prototype.all=function(a){for(var y=this.ma.ea;y!==null;){if(!a(y.key))return!1;y=y.va}return!0},ao.prototype.each=function(a){for(var y=this.ma.ea;y!==null;)a(y.key),y=y.va;return this},ao.prototype.map=function(a){for(var y=new pn,x=this.ma.ea;x!==null;)y.add(a(x.key)),x=x.va;return y},ao.prototype.filter=function(a){for(var y=new pn,x=this.ma.ea;x!==null;){var E=x.key;a(E)&&y.add(E),x=x.va}return y},ao.prototype.copy=function(){return new ao(this.ma)},ao.prototype.Iv=function(){var a=new pn,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},ao.prototype.Fa=function(){var a=this.ma.Tb,y=Array(this.ma.Sb),x=0,E;for(E in a)y[x]=a[E].key,x++;return y},ao.prototype.Hv=function(){var a=new fn,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},ve.Object.defineProperties(ao.prototype,{count:{get:function(){return this.ma.Sb}},size:{get:function(){return this.ma.Sb}},iterator:{get:function(){return 0>=this.ma.Sb?Ar:new Fo(this.ma)}}}),ao.prototype.toList=ao.prototype.Hv,ao.prototype.toArray=ao.prototype.Fa,ao.prototype.toSet=ao.prototype.Iv,ao.prototype.first=ao.prototype.first,ao.prototype.clear=ao.prototype.clear,ao.prototype.delete=ao.prototype.delete,ao.prototype.remove=ao.prototype.remove,ao.prototype.has=ao.prototype.has,ao.prototype.contains=ao.prototype.contains,ao.prototype.add=ao.prototype.add,ao.prototype.thaw=ao.prototype.ka,ao.prototype.freeze=ao.prototype.freeze,ao.className="MapKeySet";function co(a){this.ma=a,a.jf=null,this.qa=a.Ja,this.sa=null}co.prototype.reset=function(){var a=this.ma;a.jf=null,this.qa=a.Ja,this.sa=null},co.prototype.next=function(){var a=this.ma;if(a.Ja!==this.qa&&this.key===null)return!1;var y=this.sa;return y=y===null?a.ea:y.va,y!==null?(this.sa=y,this.value=y.value,this.key=y.key,!0):(this.de(),!1)},co.prototype.Ad=function(){return this.next()},co.prototype.first=function(){var a=this.ma;if(this.qa=a.Ja,a=a.ea,a!==null){this.sa=a;var y=a.value;return this.key=a.key,this.value=y}return null},co.prototype.any=function(a){var y=this.ma;for(this.sa=y.jf=null,y=y.ea;y!==null;){if(a(y.value))return!0;y=y.va}return!1},co.prototype.all=function(a){var y=this.ma;for(this.sa=y.jf=null,y=y.ea;y!==null;){if(!a(y.value))return!1;y=y.va}return!0},co.prototype.each=function(a){var y=this.ma;for(this.sa=y.jf=null,y=y.ea;y!==null;)a(y.value),y=y.va;return this},co.prototype.map=function(a){var y=this.ma;this.sa=y.jf=null;var x=new fn;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},co.prototype.filter=function(a){var y=this.ma;this.sa=y.jf=null;var x=new fn;for(y=y.ea;y!==null;){var E=y.value;a(E)&&x.add(E),y=y.va}return x.iterator},co.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.jf=this},co.prototype.toString=function(){return this.sa!==null?"MapValueSetIterator@"+this.sa.value:"MapValueSetIterator"},ve.Object.defineProperties(co.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),co.prototype.first=co.prototype.first,co.prototype.hasNext=co.prototype.Ad,co.prototype.next=co.prototype.next,co.prototype.reset=co.prototype.reset,co.className="MapValueSetIterator";function Re(a,y){this.key=a,this.value=y,this.ll=this.va=null}Re.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"},Re.className="KeyValuePair";function mn(a){this.ma=a,a.Sa=null,this.qa=a.Ja,this.sa=null}mn.prototype.reset=function(){var a=this.ma;a.Sa=null,this.qa=a.Ja,this.sa=null},mn.prototype.next=function(){var a=this.ma;if(a.Ja!==this.qa&&this.key===null)return!1;var y=this.sa;return y=y===null?a.ea:y.va,y!==null?(this.sa=y,this.key=y.key,this.value=y.value,!0):(this.de(),!1)},mn.prototype.Ad=function(){return this.next()},mn.prototype.first=function(){var a=this.ma;return this.qa=a.Ja,a=a.ea,a!==null?(this.sa=a,this.key=a.key,this.value=a.value,a):null},mn.prototype.any=function(a){var y=this.ma;for(this.sa=y.Sa=null,y=y.ea;y!==null;){if(a(y))return!0;y=y.va}return!1},mn.prototype.all=function(a){var y=this.ma;for(this.sa=y.Sa=null,y=y.ea;y!==null;){if(!a(y))return!1;y=y.va}return!0},mn.prototype.each=function(a){var y=this.ma;for(this.sa=y.Sa=null,y=y.ea;y!==null;)a(y),y=y.va;return this},mn.prototype.map=function(a){var y=this.ma;this.sa=y.Sa=null;var x=new fn;for(y=y.ea;y!==null;)x.add(a(y)),y=y.va;return x.iterator},mn.prototype.filter=function(a){var y=this.ma;this.sa=y.Sa=null;var x=new fn;for(y=y.ea;y!==null;)a(y)&&x.add(y),y=y.va;return x.iterator},mn.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.Sa=this},mn.prototype.toString=function(){return this.sa!==null?"MapIterator@"+this.sa:"MapIterator"},ve.Object.defineProperties(mn.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),mn.prototype.first=mn.prototype.first,mn.prototype.hasNext=mn.prototype.Ad,mn.prototype.next=mn.prototype.next,mn.prototype.reset=mn.prototype.reset,mn.className="MapIterator";function Ie(a){Di(this),this._isFrozen=!1,this.Tb={},this.Sb=0,this.jf=this.Sa=null,this.Ja=0,this.kf=this.ea=null,typeof a=="string"&&$t("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}wt=Ie.prototype,wt.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return this._isFrozen=!1,this},wt.toString=function(){return"Map()#"+Ai(this)},wt.add=function(a,y){this._isFrozen&&Ze(this,a);var x=a;We(a)&&(x=$i(a));var E=this.Tb[x];return E===void 0?(this.Sb++,a=new Re(a,y),this.Tb[x]=a,x=this.kf,x===null?this.ea=a:(a.ll=x,x.va=a),this.kf=a,this.xb()):E.value=y,this},wt.set=function(a,y){return this.add(a,y)},wt.addAll=function(a){if(a===null)return this;if(je(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];this.add(E.key,E.value)}else if(a instanceof Ie)for(a=a.iterator;a.next();)this.add(a.key,a.value);else for(a=a.iterator;a.next();)y=a.value,this.add(y.key,y.value);return this},wt.first=function(){return this.ea},Ie.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y))return!0;y=y.va}return!1},Ie.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y))return!1;y=y.va}return!0},Ie.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y),y=y.va;return this},Ie.prototype.map=function(a){for(var y=new Ie,x=this.ea;x!==null;)y.add(x.key,a(x)),x=x.va;return y},Ie.prototype.filter=function(a){for(var y=new Ie,x=this.ea;x!==null;)a(x)&&y.add(x.key,x.value),x=x.va;return y},wt=Ie.prototype,wt.contains=function(a){var y=a;return We(a)&&(y=Ai(a),y===void 0)?!1:this.Tb[y]!==void 0},wt.has=function(a){return this.contains(a)},wt.I=function(a){var y=a;return We(a)&&(y=Ai(a),y===void 0)?null:(a=this.Tb[y],a===void 0?null:a.value)},wt.get=function(a){return this.I(a)},wt.remove=function(a){if(a===null)return!1;this._isFrozen&&Ze(this,a);var y=a;if(We(a)&&(y=Ai(a),y===void 0)||(a=this.Tb[y],a===void 0))return!1;var x=a.va,E=a.ll;return x!==null&&(x.ll=E),E!==null&&(E.va=x),this.ea===a&&(this.ea=x),this.kf===a&&(this.kf=E),delete this.Tb[y],this.Sb--,this.xb(),!0},wt.delete=function(a){return this.remove(a)},wt.clear=function(){this._isFrozen&&Ze(this),this.Tb={},this.Sb=0,this.Sa!==null&&this.Sa.reset(),this.jf!==null&&this.jf.reset(),this.kf=this.ea=null,this.xb()},Ie.prototype.copy=function(){var a=new Ie,y=this.Tb,x;for(x in y){var E=y[x];a.add(E.key,E.value)}return a},Ie.prototype.Fa=function(){var a=this.Tb,y=Array(this.Sb),x=0,E;for(E in a){var b=a[E];y[x]=new Re(b.key,b.value),x++}return y},Ie.prototype.Lf=function(){return new ao(this)},ve.Object.defineProperties(Ie.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.count)return Ar;var a=this.Sa;return a!==null?(a.reset(),a):new mn(this)}},iteratorKeys:{get:function(){return 0>=this.count?Ar:new Fo(this)}},iteratorValues:{get:function(){if(0>=this.count)return Ar;var a=this.jf;return a!==null?(a.reset(),a):new co(this)}}}),Ie.prototype.toKeySet=Ie.prototype.Lf,Ie.prototype.toArray=Ie.prototype.Fa,Ie.prototype.clear=Ie.prototype.clear,Ie.prototype.delete=Ie.prototype.delete,Ie.prototype.remove=Ie.prototype.remove,Ie.prototype.get=Ie.prototype.get,Ie.prototype.getValue=Ie.prototype.I,Ie.prototype.has=Ie.prototype.has,Ie.prototype.contains=Ie.prototype.contains,Ie.prototype.first=Ie.prototype.first,Ie.prototype.addAll=Ie.prototype.addAll,Ie.prototype.set=Ie.prototype.set,Ie.prototype.add=Ie.prototype.add,Ie.prototype.thaw=Ie.prototype.ka,Ie.prototype.freeze=Ie.prototype.freeze,Ie.className="Map";function At(a,y){a===void 0?this.y=this.x=0:typeof a=="number"&&typeof y=="number"?(this.x=a,this.y=y):$t("Invalid arguments to Point constructor: "+a+", "+y),this._isFrozen=!1}var Un,Nn,Yn,ai,vi;At.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this},At.prototype.h=function(a,y){return this.x=a,this.y=y,this},At.prototype.sg=function(a,y){return this.x=a,this.y=y,this},At.prototype.set=function(a){return this.x=a.x,this.y=a.y,this},At.prototype.copy=function(){var a=new At;return a.x=this.x,a.y=this.y,a},wt=At.prototype,wt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},wt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return Object.isFrozen(this)&&$t("cannot thaw constant: "+this),this._isFrozen=!1,this};function Cn(a){if(typeof a=="string"){a=a.split(" ");for(var y=0,x=0;a[y]==="";)y++;var E=a[y++];E&&(x=parseFloat(E));for(var b=0;a[y]==="";)y++;return(E=a[y++])&&(b=parseFloat(E)),new At(x,b)}return new At}function $n(a){return a.x.toString()+" "+a.y.toString()}wt.toString=function(){return"Point("+this.x+","+this.y+")"},wt.D=function(a){return a instanceof At?this.x===a.x&&this.y===a.y:!1},wt.hi=function(a,y){return this.x===a&&this.y===y},wt.Xa=function(a){return Zt.B(this.x,a.x)&&Zt.B(this.y,a.y)},wt.add=function(a){return this.x+=a.x,this.y+=a.y,this},wt.re=function(a){return this.x-=a.x,this.y-=a.y,this},wt.offset=function(a,y){return this.x+=a,this.y+=y,this},At.prototype.rotate=function(a){if(a===0)return this;var y=this.x,x=this.y;if(y===0&&x===0)return this;if(360<=a?a-=360:0>a&&(a+=360),a===90){a=0;var E=1}else a===180?(a=-1,E=0):a===270?(a=0,E=-1):(E=a*Math.PI/180,a=Math.cos(E),E=Math.sin(E));return this.x=a*y-E*x,this.y=E*y+a*x,this},wt=At.prototype,wt.scale=function(a,y){return this.x*=a,this.y*=y,this},wt.Bf=function(a){var y=a.x-this.x;return a=a.y-this.y,y*y+a*a},wt.zd=function(a,y){return a-=this.x,y-=this.y,a*a+y*y},wt.normalize=function(){var a=this.x,y=this.y,x=Math.sqrt(a*a+y*y);return 0<x&&(this.x=a/x,this.y=y/x),this},wt.ab=function(a){return ti(a.x-this.x,a.y-this.y)},wt.direction=function(a,y){return ti(a-this.x,y-this.y)};function ti(a,y){if(a===0)return 0<y?90:0>y?270:0;if(y===0)return 0<a?0:180;if(isNaN(a)||isNaN(y))return 0;var x=180*Math.atan(Math.abs(y/a))/Math.PI;return 0>a?x=0>y?x+180:180-x:0>y&&(x=360-x),x}wt.Ry=function(a,y){return Zt.Fl(a.x,a.y,y.x,y.y,this.x,this.y)},wt.fA=function(a,y,x,E){return Zt.qh(a,y,x,E,this.x,this.y,this),this},wt.gA=function(a,y){return Zt.qh(a.x,a.y,y.x,y.y,this.x,this.y,this),this},wt.uA=function(a,y,x,E){return Zt.No(this.x,this.y,a,y,x,E,this),this},wt.vA=function(a,y){return Zt.No(this.x,this.y,a.x,a.y,y.width,y.height,this),this},wt.xi=function(a,y){return this.x=a.x+y.x*a.width+y.offsetX,this.y=a.y+y.y*a.height+y.offsetY,this},wt.yi=function(a,y,x,E,b){return this.x=a+b.x*x+b.offsetX,this.y=y+b.y*E+b.offsetY,this},wt.transform=function(a){return a.Ga(this),this};function ii(a,y){return y.Cd(a),a}function ni(a,y,x,E,b,z){var tt=b-x,rt=z-E,ot=tt*tt+rt*rt;x-=a,E-=y;var lt=-x*tt-E*rt;return 0>=lt||lt>=ot?(tt=b-a,rt=z-y,Math.min(x*x+E*E,tt*tt+rt*rt)):(a=tt*E-rt*x,a*a/ot)}function Vi(a,y,x,E){return a=x-a,y=E-y,a*a+y*y}function Ei(a,y,x,E){return a=x-a,y=E-y,a===0?0<y?90:0>y?270:0:y===0?0<a?0:180:isNaN(a)||isNaN(y)?0:(E=180*Math.atan(Math.abs(y/a))/Math.PI,0>a?E=0>y?E+180:180-E:0>y&&(E=360-E),E)}wt.w=function(){return isFinite(this.x)&&isFinite(this.y)},At.alloc=function(){var a=yi.pop();return a===void 0?new At:a},At.allocAt=function(a,y){var x=yi.pop();return x===void 0?new At(a,y):(x.x=a,x.y=y,x)},At.free=function(a){yi.push(a)},At.prototype.isReal=At.prototype.w,At.prototype.setSpot=At.prototype.yi,At.prototype.setRectSpot=At.prototype.xi,At.prototype.snapToGridPoint=At.prototype.vA,At.prototype.snapToGrid=At.prototype.uA,At.prototype.projectOntoLineSegmentPoint=At.prototype.gA,At.prototype.projectOntoLineSegment=At.prototype.fA,At.intersectingLineSegments=function(a,y,x,E,b,z,tt,rt){return Zt.Rl(a,y,x,E,b,z,tt,rt)},At.prototype.compareWithLineSegmentPoint=At.prototype.Ry,At.compareWithLineSegment=function(a,y,x,E,b,z){return Zt.Fl(a,y,x,E,b,z)},At.prototype.direction=At.prototype.direction,At.prototype.directionPoint=At.prototype.ab,At.prototype.normalize=At.prototype.normalize,At.prototype.distanceSquared=At.prototype.zd,At.prototype.distanceSquaredPoint=At.prototype.Bf,At.prototype.scale=At.prototype.scale,At.prototype.rotate=At.prototype.rotate,At.prototype.offset=At.prototype.offset,At.prototype.subtract=At.prototype.re,At.prototype.add=At.prototype.add,At.prototype.equalsApprox=At.prototype.Xa,At.prototype.equalTo=At.prototype.hi,At.prototype.equals=At.prototype.D,At.prototype.set=At.prototype.set,At.prototype.setTo=At.prototype.sg;var yi=[];At.className="Point",At.parse=Cn,At.stringify=$n,At.distanceLineSegmentSquared=ni,At.distanceSquared=Vi,At.direction=Ei,At.Origin=Un=new At(0,0).ja(),At.InfiniteTopLeft=Nn=new At(-1/0,-1/0).ja(),At.InfiniteBottomRight=Yn=new At(1/0,1/0).ja(),At.SixPoint=ai=new At(6,6).ja(),At.NoPoint=vi=new At(NaN,NaN).ja(),At.parse=Cn,At.stringify=$n,At.distanceLineSegmentSquared=ni,At.distanceSquared=Vi,At.direction=Ei;function ln(a,y){a===void 0?this.height=this.width=0:typeof a=="number"&&(0<=a||isNaN(a))&&typeof y=="number"&&(0<=y||isNaN(y))?(this.width=a,this.height=y):$t("Invalid arguments to Size constructor: "+a+", "+y),this._isFrozen=!1}var Pi,qi,Tr,Lr,Rr,Zr,jr;ln.prototype.assign=function(a){return this.width=a.width,this.height=a.height,this},ln.prototype.h=function(a,y){return this.width=a,this.height=y,this},ln.prototype.sg=function(a,y){return this.width=a,this.height=y,this},ln.prototype.set=function(a){return this.width=a.width,this.height=a.height,this},ln.prototype.copy=function(){var a=new ln;return a.width=this.width,a.height=this.height,a},wt=ln.prototype,wt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},wt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return Object.isFrozen(this)&&$t("cannot thaw constant: "+this),this._isFrozen=!1,this};function Co(a){if(typeof a=="string"){a=a.split(" ");for(var y=0,x=0;a[y]==="";)y++;var E=a[y++];E&&(x=parseFloat(E));for(var b=0;a[y]==="";)y++;return(E=a[y++])&&(b=parseFloat(E)),new ln(x,b)}return new ln}function vo(a){return a.width.toString()+" "+a.height.toString()}wt.toString=function(){return"Size("+this.width+","+this.height+")"},wt.D=function(a){return a instanceof ln?this.width===a.width&&this.height===a.height:!1},wt.hi=function(a,y){return this.width===a&&this.height===y},wt.Xa=function(a){return Zt.B(this.width,a.width)&&Zt.B(this.height,a.height)},wt.Bc=function(a,y){return a=this.width+a,this.width=0<=a?a:0,y=this.height+y,this.height=0<=y?y:0,this},wt.w=function(){return isFinite(this.width)&&isFinite(this.height)},ln.alloc=function(){var a=Uo.pop();return a===void 0?new ln:a},ln.free=function(a){Uo.push(a)},ln.prototype.isReal=ln.prototype.w,ln.prototype.inflate=ln.prototype.Bc,ln.prototype.equalsApprox=ln.prototype.Xa,ln.prototype.equalTo=ln.prototype.hi,ln.prototype.equals=ln.prototype.D,ln.prototype.set=ln.prototype.set,ln.prototype.setTo=ln.prototype.sg;var Uo=[];ln.className="Size",ln.parse=Co,ln.stringify=vo,ln.ZeroSize=Pi=new ln(0,0).ja(),ln.OneSize=qi=new ln(1,1).ja(),ln.SixSize=Tr=new ln(6,6).ja(),ln.EightSize=Lr=new ln(8,8).ja(),ln.TenSize=Rr=new ln(10,10).ja(),ln.InfiniteSize=Zr=new ln(1/0,1/0).ja(),ln.NoSize=jr=new ln(NaN,NaN).ja(),ln.parse=Co,ln.stringify=vo;function Be(a,y,x,E){a===void 0?this.height=this.width=this.y=this.x=0:typeof a=="number"&&typeof y=="number"&&typeof x=="number"&&(0<=x||isNaN(x))&&typeof E=="number"&&(0<=E||isNaN(E))?(this.x=a,this.y=y,this.width=x,this.height=E):a instanceof At?(x=a.x,a=a.y,y instanceof At?(E=y.x,y=y.y,this.x=Math.min(x,E),this.y=Math.min(a,y),this.width=Math.abs(x-E),this.height=Math.abs(a-y)):y instanceof ln?(this.x=x,this.y=a,this.width=y.width,this.height=y.height):$t("Incorrect second argument supplied to Rect constructor "+y)):$t("Invalid arguments to Rect constructor: "+a+", "+y+", "+x+", "+E),this._isFrozen=!1}wt=Be.prototype,wt.assign=function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this},wt.h=function(a,y,x,E){return this.x=a,this.y=y,this.width=x,this.height=E,this};function Wr(a,y,x){a.width=y,a.height=x}wt.sg=function(a,y,x,E){return this.x=a,this.y=y,this.width=x,this.height=E,this},wt.set=function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this},wt.dd=function(a){return this.x=a.x,this.y=a.y,this},wt.tA=function(a){return this.width=a.width,this.height=a.height,this},Be.prototype.copy=function(){var a=new Be;return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},wt=Be.prototype,wt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},wt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return Object.isFrozen(this)&&$t("cannot thaw constant: "+this),this._isFrozen=!1,this};function qr(a){if(typeof a=="string"){a=a.split(" ");for(var y=0,x=0;a[y]==="";)y++;var E=a[y++];E&&(x=parseFloat(E));for(var b=0;a[y]==="";)y++;(E=a[y++])&&(b=parseFloat(E));for(var z=0;a[y]==="";)y++;(E=a[y++])&&(z=parseFloat(E));for(var tt=0;a[y]==="";)y++;return(E=a[y++])&&(tt=parseFloat(E)),new Be(x,b,z,tt)}return new Be}function fr(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}wt.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"},wt.D=function(a){return a instanceof Be?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1},wt.hi=function(a,y,x,E){return this.x===a&&this.y===y&&this.width===x&&this.height===E},wt.Xa=function(a){return Zt.B(this.x,a.x)&&Zt.B(this.y,a.y)&&Zt.B(this.width,a.width)&&Zt.B(this.height,a.height)};function Qr(a,y){return Zt.$(a.x,y.x)&&Zt.$(a.y,y.y)&&Zt.$(a.width,y.width)&&Zt.$(a.height,y.height)}wt.ca=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y},wt.Re=function(a){return this.x<=a.x&&a.x+a.width<=this.x+this.width&&this.y<=a.y&&a.y+a.height<=this.y+this.height},wt.contains=function(a,y,x,E){return x===void 0&&(x=0),E===void 0&&(E=0),this.x<=a&&a+x<=this.x+this.width&&this.y<=y&&y+E<=this.y+this.height},wt.offset=function(a,y){return this.x+=a,this.y+=y,this},wt.Bc=function(a,y){return hr(this,y,a,y,a)},wt.Co=function(a){return hr(this,a.top,a.right,a.bottom,a.left)},wt.Fv=function(a){return hr(this,-a.top,-a.right,-a.bottom,-a.left)},wt.Hz=function(a,y,x,E){return hr(this,a,y,x,E)};function hr(a,y,x,E,b){var z=a.width;return x+b<=-z?(a.x+=z/2,a.width=0):(a.x-=b,a.width+=x+b),x=a.height,y+E<=-x?(a.y+=x/2,a.height=0):(a.y-=y,a.height+=y+E),a}wt.Ex=function(a){return zo(this,a.x,a.y,a.width,a.height)},wt.Uu=function(a,y,x,E){return zo(this,a,y,x,E)};function zo(a,y,x,E,b){var z=Math.max(a.x,y),tt=Math.max(a.y,x);return y=Math.min(a.x+a.width,y+E),x=Math.min(a.y+a.height,x+b),a.x=z,a.y=tt,a.width=Math.max(0,y-z),a.height=Math.max(0,x-tt),a}wt.Yc=function(a){return this.Vu(a.x,a.y,a.width,a.height)},wt.Vu=function(a,y,x,E){var b=this.width,z=this.x;return b!==1/0&&x!==1/0&&(b+=z,x+=a,isNaN(x)||isNaN(b)||z>x||a>b)?!1:(a=this.height,x=this.y,!(a!==1/0&&E!==1/0&&(a+=x,E+=y,isNaN(E)||isNaN(a)||x>E||y>a)))};function Eo(a,y){var x=a.width,E=a.x,b=y.x-10;return E>y.width+10+10+b||b>x+E?!1:(x=a.height,a=a.y,E=y.y-10,!(a>y.height+10+10+E||E>x+a))}wt.Ye=function(a){return Jr(this,a.x,a.y,0,0)},wt.ed=function(a){return Jr(this,a.x,a.y,a.width,a.height)},wt.Kv=function(a,y,x,E){return x===void 0&&(x=0),E===void 0&&(E=0),Jr(this,a,y,x,E)};function Jr(a,y,x,E,b){var z=Math.min(a.x,y),tt=Math.min(a.y,x);return y=Math.max(a.x+a.width,y+E),x=Math.max(a.y+a.height,x+b),a.x=z,a.y=tt,a.width=y-z,a.height=x-tt,a}wt.yi=function(a,y,x){return this.x=a-x.offsetX-x.x*this.width,this.y=y-x.offsetY-x.y*this.height,this};function Dr(a,y,x,E,b,z,tt,rt){return tt===void 0&&(tt=0),rt===void 0&&(rt=0),a<=b&&b+tt<=a+x&&y<=z&&z+rt<=y+E}function za(a,y,x,E,b,z,tt,rt){return a>tt+b||b>x+a?!1:!(y>rt+z||z>E+y)}wt.w=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},wt.Mz=function(){return this.width===0&&this.height===0},Be.alloc=function(){var a=La.pop();return a===void 0?new Be:a},Be.allocAt=function(a,y,x,E){var b=La.pop();return b===void 0?new Be(a,y,x,E):b.h(a,y,x,E)},Be.free=function(a){La.push(a)},ve.Object.defineProperties(Be.prototype,{left:{get:function(){return this.x},set:function(a){this.x=a}},top:{get:function(){return this.y},set:function(a){this.y=a}},right:{get:function(){return this.x+this.width},set:function(a){this.x+=a-(this.x+this.width)}},bottom:{get:function(){return this.y+this.height},set:function(a){this.y+=a-(this.y+this.height)}},position:{get:function(){return new At(this.x,this.y)},set:function(a){this.x=a.x,this.y=a.y}},size:{get:function(){return new ln(this.width,this.height)},set:function(a){this.width=a.width,this.height=a.height}},center:{get:function(){return new At(this.x+this.width/2,this.y+this.height/2)},set:function(a){this.x=a.x-this.width/2,this.y=a.y-this.height/2}},centerX:{get:function(){return this.x+this.width/2},set:function(a){this.x=a-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(a){this.y=a-this.height/2}}}),Be.prototype.isEmpty=Be.prototype.Mz,Be.prototype.isReal=Be.prototype.w,Be.intersectsLineSegment=function(a,y,x,E,b,z,tt,rt){return Zt.Fx(a,y,x,E,b,z,tt,rt)},Be.prototype.setSpot=Be.prototype.yi,Be.prototype.union=Be.prototype.Kv,Be.prototype.unionRect=Be.prototype.ed,Be.prototype.unionPoint=Be.prototype.Ye,Be.prototype.intersects=Be.prototype.Vu,Be.prototype.intersectsRect=Be.prototype.Yc,Be.prototype.intersect=Be.prototype.Uu,Be.prototype.intersectRect=Be.prototype.Ex,Be.prototype.grow=Be.prototype.Hz,Be.prototype.subtractMargin=Be.prototype.Fv,Be.prototype.addMargin=Be.prototype.Co,Be.prototype.inflate=Be.prototype.Bc,Be.prototype.offset=Be.prototype.offset,Be.prototype.contains=Be.prototype.contains,Be.prototype.containsRect=Be.prototype.Re,Be.prototype.containsPoint=Be.prototype.ca,Be.prototype.equalsApprox=Be.prototype.Xa,Be.prototype.equalTo=Be.prototype.hi,Be.prototype.equals=Be.prototype.D,Be.prototype.setSize=Be.prototype.tA,Be.prototype.setPoint=Be.prototype.dd,Be.prototype.set=Be.prototype.set,Be.prototype.setTo=Be.prototype.sg;var aa=null,es=null,La=[];Be.className="Rect",Be.parse=qr,Be.stringify=fr,Be.contains=Dr,Be.intersects=za,Be.ZeroRect=aa=new Be(0,0,0,0).ja(),Be.NoRect=es=new Be(NaN,NaN,NaN,NaN).ja(),Be.parse=qr,Be.stringify=fr,Be.contains=Dr,Be.intersects=za;function ir(a,y,x,E){a===void 0?this.left=this.bottom=this.right=this.top=0:y===void 0?this.left=this.bottom=this.right=this.top=a:x===void 0?(this.top=a,this.right=y,this.bottom=a,this.left=y):E!==void 0?(this.top=a,this.right=y,this.bottom=x,this.left=E):$t("Invalid arguments to Margin constructor: "+a+", "+y+", "+x+", "+E),this._isFrozen=!1}ir.prototype.assign=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},ir.prototype.sg=function(a,y,x,E){return this.top=a,this.right=y,this.bottom=x,this.left=E,this},ir.prototype.set=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},ir.prototype.copy=function(){var a=new ir;return a.top=this.top,a.right=this.right,a.bottom=this.bottom,a.left=this.left,a},wt=ir.prototype,wt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},wt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return Object.isFrozen(this)&&$t("cannot thaw constant: "+this),this._isFrozen=!1,this};function _o(a){if(typeof a=="string"){a=a.split(" ");for(var y=0,x=NaN;a[y]==="";)y++;var E=a[y++];if(E&&(x=parseFloat(E)),isNaN(x))return new ir;for(var b=NaN;a[y]==="";)y++;if((E=a[y++])&&(b=parseFloat(E)),isNaN(b))return new ir(x);for(var z=NaN;a[y]==="";)y++;if((E=a[y++])&&(z=parseFloat(E)),isNaN(z))return new ir(x,b);for(var tt=NaN;a[y]==="";)y++;return(E=a[y++])&&(tt=parseFloat(E)),isNaN(tt)?new ir(x,b):new ir(x,b,z,tt)}return new ir}function ia(a){return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()}wt.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"},wt.D=function(a){return a instanceof ir?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1},wt.hi=function(a,y,x,E){return this.top===a&&this.right===y&&this.bottom===x&&this.left===E},wt.Xa=function(a){return Zt.B(this.top,a.top)&&Zt.B(this.right,a.right)&&Zt.B(this.bottom,a.bottom)&&Zt.B(this.left,a.left)},wt.w=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)},ir.alloc=function(){var a=Kr.pop();return a===void 0?new ir:a},ir.free=function(a){Kr.push(a)},ir.prototype.isReal=ir.prototype.w,ir.prototype.equalsApprox=ir.prototype.Xa,ir.prototype.equalTo=ir.prototype.hi,ir.prototype.equals=ir.prototype.D,ir.prototype.set=ir.prototype.set,ir.prototype.setTo=ir.prototype.sg;var ca=null,$r=null,Kr=[];ir.className="Margin",ir.parse=_o,ir.stringify=ia,ir.ZeroMargin=ca=new ir(0,0,0,0).ja(),ir.TwoMargin=$r=new ir(2,2,2,2).ja(),ir.parse=_o,ir.stringify=ia;function In(a,y,x,E){a===void 0?this.offsetY=this.offsetX=this.y=this.x=0:(y===void 0&&(y=0),x===void 0&&(x=0),E===void 0&&(E=0),this.x=a,this.y=y,this.offsetX=x,this.offsetY=E),this._isFrozen=!1}var gr,eo,Vo,Va,Ba,Or,fa,Sa,Yo,No,Ka,us,Ko,hs,Xs,Ou,ga,Iu,Cu,Zl,Ll,js,Fl,ru,ou,xa,rl,_u,au,su,Xa,ns,Fa,Ma,Lo,ro;In.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},In.prototype.sg=function(a,y,x,E){return this.x=a,this.y=y,this.offsetX=x,this.offsetY=E,this},In.prototype.set=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},In.prototype.copy=function(){var a=new In;return a.x=this.x,a.y=this.y,a.offsetX=this.offsetX,a.offsetY=this.offsetY,a},wt=In.prototype,wt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},wt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return Object.isFrozen(this)&&$t("cannot thaw constant: "+this),this._isFrozen=!1,this};function uo(a,y){return a.x=NaN,a.y=NaN,a.offsetX=y,a}function Ia(a){if(typeof a=="string"){if(a=a.trim(),a==="None")return gr;if(a==="TopLeft")return eo;if(a==="Top"||a==="TopCenter"||a==="MiddleTop")return Vo;if(a==="TopRight")return Va;if(a==="Left"||a==="LeftCenter"||a==="MiddleLeft")return Ba;if(a==="Center")return Or;if(a==="Right"||a==="RightCenter"||a==="MiddleRight")return fa;if(a==="BottomLeft")return Sa;if(a==="Bottom"||a==="BottomCenter"||a==="MiddleBottom")return Yo;if(a==="BottomRight")return No;if(a==="TopSide")return Ka;if(a==="LeftSide")return us;if(a==="RightSide")return Ko;if(a==="BottomSide")return hs;if(a==="TopBottomSides")return Xs;if(a==="LeftRightSides")return Ou;if(a==="TopLeftSides")return ga;if(a==="TopRightSides")return Iu;if(a==="BottomLeftSides")return Cu;if(a==="BottomRightSides")return Zl;if(a==="NotTopSide")return Ll;if(a==="NotLeftSide")return js;if(a==="NotRightSide")return Fl;if(a==="NotBottomSide")return ru;if(a==="AllSides")return ou;if(a==="Default")return xa;a=a.split(" ");for(var y=0,x=0;a[y]==="";)y++;var E=a[y++];E!==void 0&&0<E.length&&(x=parseFloat(E));for(var b=0;a[y]==="";)y++;E=a[y++],E!==void 0&&0<E.length&&(b=parseFloat(E));for(var z=0;a[y]==="";)y++;E=a[y++],E!==void 0&&0<E.length&&(z=parseFloat(E));for(var tt=0;a[y]==="";)y++;return E=a[y++],E!==void 0&&0<E.length&&(tt=parseFloat(E)),new In(x,b,z,tt)}return new In}function Ea(a){return a.sb()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString()}wt.toString=function(){return this.sb()?this.offsetX===0&&this.offsetY===0?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.D(gr)?"None":this.D(eo)?"TopLeft":this.D(Vo)?"Top":this.D(Va)?"TopRight":this.D(Ba)?"Left":this.D(Or)?"Center":this.D(fa)?"Right":this.D(Sa)?"BottomLeft":this.D(Yo)?"Bottom":this.D(No)?"BottomRight":this.D(Ka)?"TopSide":this.D(us)?"LeftSide":this.D(Ko)?"RightSide":this.D(hs)?"BottomSide":this.D(Xs)?"TopBottomSides":this.D(Ou)?"LeftRightSides":this.D(ga)?"TopLeftSides":this.D(Iu)?"TopRightSides":this.D(Cu)?"BottomLeftSides":this.D(Zl)?"BottomRightSides":this.D(Ll)?"NotTopSide":this.D(js)?"NotLeftSide":this.D(Fl)?"NotRightSide":this.D(ru)?"NotBottomSide":this.D(ou)?"AllSides":this.D(xa)?"Default":"None"},wt.D=function(a){return a instanceof In?(this.x===a.x||isNaN(this.x)&&isNaN(a.x))&&(this.y===a.y||isNaN(this.y)&&isNaN(a.y))&&this.offsetX===a.offsetX&&this.offsetY===a.offsetY:!1},wt.gv=function(){return new In(.5-(this.x-.5),.5-(this.y-.5),-this.offsetX,-this.offsetY)},wt.Hf=function(a){if(!this.$c())return!1;if(!a.$c())if(a.D(rl))a=us;else if(a.D(_u))a=Ko;else if(a.D(au))a=Ka;else if(a.D(su))a=hs;else return!1;return a=a.offsetY,(this.offsetY&a)===a},wt.sb=function(){return!isNaN(this.x)&&!isNaN(this.y)},wt.Mc=function(){return isNaN(this.x)||isNaN(this.y)},wt.$c=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===1&&this.offsetY!==0},wt.ys=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===0&&this.offsetY===0},wt.Xb=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===-1&&this.offsetY===0},In.alloc=function(){var a=xe.pop();return a===void 0?new In:a},In.free=function(a){xe.push(a)},In.prototype.isDefault=In.prototype.Xb,In.prototype.isNone=In.prototype.ys,In.prototype.isSide=In.prototype.$c,In.prototype.isNoSpot=In.prototype.Mc,In.prototype.isSpot=In.prototype.sb,In.prototype.includesSide=In.prototype.Hf,In.prototype.opposite=In.prototype.gv,In.prototype.equals=In.prototype.D,In.prototype.set=In.prototype.set,In.prototype.setTo=In.prototype.sg;var xe=[];In.className="Spot",In.parse=Ia,In.stringify=Ea,In.None=gr=uo(new In(0,0,0,0),0).ja(),In.Default=xa=uo(new In(0,0,-1,0),-1).ja(),In.TopLeft=eo=new In(0,0,0,0).ja(),In.TopCenter=Vo=new In(.5,0,0,0).ja(),In.TopRight=Va=new In(1,0,0,0).ja(),In.LeftCenter=Ba=new In(0,.5,0,0).ja(),In.Center=Or=new In(.5,.5,0,0).ja(),In.RightCenter=fa=new In(1,.5,0,0).ja(),In.BottomLeft=Sa=new In(0,1,0,0).ja(),In.BottomCenter=Yo=new In(.5,1,0,0).ja(),In.BottomRight=No=new In(1,1,0,0).ja(),In.MiddleTop=Xa=Vo,In.MiddleLeft=ns=Ba,In.MiddleRight=Fa=fa,In.MiddleBottom=Ma=Yo,In.Top=au=Vo,In.Left=rl=Ba,In.Right=_u=fa,In.Bottom=su=Yo,In.TopSide=Ka=uo(new In(0,0,1,1),1).ja(),In.LeftSide=us=uo(new In(0,0,1,2),1).ja(),In.RightSide=Ko=uo(new In(0,0,1,4),1).ja(),In.BottomSide=hs=uo(new In(0,0,1,8),1).ja(),In.TopBottomSides=Xs=uo(new In(0,0,1,9),1).ja(),In.LeftRightSides=Ou=uo(new In(0,0,1,6),1).ja(),In.TopLeftSides=ga=uo(new In(0,0,1,3),1).ja(),In.TopRightSides=Iu=uo(new In(0,0,1,5),1).ja(),In.BottomLeftSides=Cu=uo(new In(0,0,1,10),1).ja(),In.BottomRightSides=Zl=uo(new In(0,0,1,12),1).ja(),In.NotTopSide=Ll=uo(new In(0,0,1,14),1).ja(),In.NotLeftSide=js=uo(new In(0,0,1,13),1).ja(),In.NotRightSide=Fl=uo(new In(0,0,1,11),1).ja(),In.NotBottomSide=ru=uo(new In(0,0,1,7),1).ja(),In.AllSides=ou=uo(new In(0,0,1,15),1).ja(),Lo=new In(.156,.156).ja(),ro=new In(.844,.844).ja(),In.parse=Ia,In.stringify=Ea;function fe(){this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0}fe.prototype.set=function(a){return this.m11=a.m11,this.m12=a.m12,this.m21=a.m21,this.m22=a.m22,this.dx=a.dx,this.dy=a.dy,this},fe.prototype.setTransform=function(a,y,x,E,b,z){return this.m11=a,this.m12=y,this.m21=x,this.m22=E,this.dx=b,this.dy=z,this},fe.prototype.copy=function(){var a=new fe;return a.m11=this.m11,a.m12=this.m12,a.m21=this.m21,a.m22=this.m22,a.dx=this.dx,a.dy=this.dy,a},fe.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"},fe.prototype.D=function(a){return this.m11===a.m11&&this.m12===a.m12&&this.m21===a.m21&&this.m22===a.m22&&this.dx===a.dx&&this.dy===a.dy},fe.prototype.ws=function(){return this.dx===0&&this.dy===0&&this.m11===1&&this.m12===0&&this.m21===0&&this.m22===1},fe.prototype.reset=function(){return this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0,this},fe.prototype.multiply=function(a){var y=this.m11*a.m11+this.m21*a.m12,x=this.m12*a.m11+this.m22*a.m12,E=this.m11*a.m21+this.m21*a.m22,b=this.m12*a.m21+this.m22*a.m22;return this.dx=this.m11*a.dx+this.m21*a.dy+this.dx,this.dy=this.m12*a.dx+this.m22*a.dy+this.dy,this.m11=y,this.m12=x,this.m21=E,this.m22=b,this},fe.prototype.bv=function(a){var y=1/(a.m11*a.m22-a.m12*a.m21),x=a.m22*y,E=-a.m12*y,b=-a.m21*y,z=a.m11*y,tt=y*(a.m21*a.dy-a.m22*a.dx);return a=y*(a.m12*a.dx-a.m11*a.dy),y=this.m11*x+this.m21*E,x=this.m12*x+this.m22*E,E=this.m11*b+this.m21*z,b=this.m12*b+this.m22*z,this.dx=this.m11*tt+this.m21*a+this.dx,this.dy=this.m12*tt+this.m22*a+this.dy,this.m11=y,this.m12=x,this.m21=E,this.m22=b,this},fe.prototype.Vj=function(){var a=1/(this.m11*this.m22-this.m12*this.m21),y=-this.m12*a,x=-this.m21*a,E=this.m11*a,b=a*(this.m21*this.dy-this.m22*this.dx),z=a*(this.m12*this.dx-this.m11*this.dy);return this.m11=this.m22*a,this.m12=y,this.m21=x,this.m22=E,this.dx=b,this.dy=z,this},fe.prototype.rotate=function(a,y,x){if(360<=a?a-=360:0>a&&(a+=360),a===0)return this;if(this.translate(y,x),a===90){a=0;var E=1}else a===180?(a=-1,E=0):a===270?(a=0,E=-1):(E=a*Math.PI/180,a=Math.cos(E),E=Math.sin(E));var b=this.m12*a+this.m22*E,z=this.m11*-E+this.m21*a,tt=this.m12*-E+this.m22*a;return this.m11=this.m11*a+this.m21*E,this.m12=b,this.m21=z,this.m22=tt,this.translate(-y,-x),this},wt=fe.prototype,wt.translate=function(a,y){return this.dx+=this.m11*a+this.m21*y,this.dy+=this.m12*a+this.m22*y,this},wt.scale=function(a,y){return y===void 0&&(y=a),this.m11*=a,this.m12*=a,this.m21*=y,this.m22*=y,this},wt.Ga=function(a){var y=a.x,x=a.y;return a.h(y*this.m11+x*this.m21+this.dx,y*this.m12+x*this.m22+this.dy)},wt.Cd=function(a){var y=1/(this.m11*this.m22-this.m12*this.m21),x=a.x,E=a.y;return a.h(x*this.m22*y+E*-this.m21*y+y*(this.m21*this.dy-this.m22*this.dx),x*-this.m12*y+E*this.m11*y+y*(this.m12*this.dx-this.m11*this.dy))},wt.Eu=function(a){var y=1/(this.m11*this.m22-this.m12*this.m21),x=1.25*a.x,E=1.2*a.y;return a.h(x*this.m22*y+E*-this.m21*y+y*(this.m21*this.dy-this.m22*this.dx),x*-this.m12*y+E*this.m11*y+y*(this.m12*this.dx-this.m11*this.dy))},wt.pp=function(a){var y=a.x,x=a.y,E=y+a.width,b=x+a.height,z=this.m11,tt=this.m12,rt=this.m21,ot=this.m22,lt=this.dx,ut=this.dy,ft=y*z+x*rt+lt,yt=y*tt+x*ot+ut,xt=E*z+x*rt+lt,Ct=E*tt+x*ot+ut;return x=y*z+b*rt+lt,y=y*tt+b*ot+ut,z=E*z+b*rt+lt,E=E*tt+b*ot+ut,b=Math.min(ft,xt),ft=Math.max(ft,xt),xt=Math.min(yt,Ct),yt=Math.max(yt,Ct),b=Math.min(b,x),ft=Math.max(ft,x),xt=Math.min(xt,y),yt=Math.max(yt,y),b=Math.min(b,z),ft=Math.max(ft,z),xt=Math.min(xt,E),yt=Math.max(yt,E),a.h(b,xt,ft-b,yt-xt),a},fe.alloc=function(){var a=Ve.pop();return a===void 0?new fe:a},fe.free=function(a){Ve.push(a)},fe.prototype.transformRect=fe.prototype.pp,fe.prototype.transformPoint=fe.prototype.Ga,fe.prototype.scale=fe.prototype.scale,fe.prototype.translate=fe.prototype.translate,fe.prototype.rotate=fe.prototype.rotate,fe.prototype.invert=fe.prototype.Vj,fe.prototype.multiplyInverted=fe.prototype.bv,fe.prototype.multiply=fe.prototype.multiply,fe.prototype.reset=fe.prototype.reset,fe.prototype.isIdentity=fe.prototype.ws,fe.prototype.equals=fe.prototype.D,fe.prototype.setTransform=fe.prototype.setTransform,fe.prototype.set=fe.prototype.set;var Ve=[];fe.className="Transform",fe.xF="54a702f3e53909c447824c6706603faf4c";var Zt={AA:"7da71ca0ad381e90",wg:(Math.sqrt(2)-1)/3*4,Uv:null,sqrt:function(a){if(0>=a)return 0;var y=Zt.Uv;if(y===null){y=[];for(var x=0;2e3>=x;x++)y[x]=Math.sqrt(x);Zt.Uv=y}return 1>a?(x=1/a,2e3>=x?1/y[x|0]:Math.sqrt(a)):2e3>=a?y[a|0]:Math.sqrt(a)},B:function(a,y){return a-=y,.5>a&&-.5<a},$:function(a,y){return a-=y,5e-8>a&&-5e-8<a},Yb:function(a,y,x,E,b,z,tt){if(0>=b&&(b=1e-6),a<x)var rt=a,ot=x;else rt=x,ot=a;if(y<E)var lt=y,ut=E;else lt=E,ut=y;if(a===x)return lt<=tt&&tt<=ut&&a-b<=z&&z<=a+b;if(y===E)return rt<=z&&z<=ot&&y-b<=tt&&tt<=y+b;if(ot+=b,rt-=b,rt<=z&&z<=ot&&(ut+=b,lt-=b,lt<=tt&&tt<=ut))if(ot-rt>ut-lt)if(a-x>b||x-a>b){if(z=(E-y)/(x-a)*(z-a)+y,z-b<=tt&&tt<=z+b)return!0}else return!0;else if(y-E>b||E-y>b){if(tt=(x-a)/(E-y)*(tt-y)+a,tt-b<=z&&z<=tt+b)return!0}else return!0;return!1},cs:function(a,y,x,E,b,z,tt,rt,ot,lt,ut,ft){if(Zt.Yb(a,y,tt,rt,ft,x,E)&&Zt.Yb(a,y,tt,rt,ft,b,z))return Zt.Yb(a,y,tt,rt,ft,lt,ut);var yt=(a+x)/2,xt=(y+E)/2,Ct=(x+b)/2,bt=(E+z)/2;b=(b+tt)/2,z=(z+rt)/2,E=(yt+Ct)/2,x=(xt+bt)/2,Ct=(Ct+b)/2,bt=(bt+z)/2;var Wt=(E+Ct)/2,jt=(x+bt)/2;return Zt.cs(a,y,yt,xt,E,x,Wt,jt,ot,lt,ut,ft)||Zt.cs(Wt,jt,Ct,bt,b,z,tt,rt,ot,lt,ut,ft)},ax:function(a,y,x,E,b,z,tt,rt,ot){var lt=(x+b)/2,ut=(E+z)/2;return ot.h((((a+x)/2+lt)/2+(lt+(b+tt)/2)/2)/2,(((y+E)/2+ut)/2+(ut+(z+rt)/2)/2)/2),ot},My:function(a,y,x,E,b,z,tt,rt){var ot=(x+b)/2,lt=(E+z)/2;return Ei(((a+x)/2+ot)/2,((y+E)/2+lt)/2,(ot+(b+tt)/2)/2,(lt+(z+rt)/2)/2)},Dl:function(a,y,x,E,b,z,tt,rt,ot,lt){if(Zt.Yb(a,y,tt,rt,ot,x,E)&&Zt.Yb(a,y,tt,rt,ot,b,z))Jr(lt,a,y,0,0),Jr(lt,tt,rt,0,0);else{var ut=(a+x)/2,ft=(y+E)/2,yt=(x+b)/2,xt=(E+z)/2;b=(b+tt)/2,z=(z+rt)/2,E=(ut+yt)/2,x=(ft+xt)/2,yt=(yt+b)/2,xt=(xt+z)/2;var Ct=(E+yt)/2,bt=(x+xt)/2;Zt.Dl(a,y,ut,ft,E,x,Ct,bt,ot,lt),Zt.Dl(Ct,bt,yt,xt,b,z,tt,rt,ot,lt)}return lt},Qe:function(a,y,x,E,b,z,tt,rt,ot,lt){if(Zt.Yb(a,y,tt,rt,ot,x,E)&&Zt.Yb(a,y,tt,rt,ot,b,z))lt.length===0&&(lt.push(a),lt.push(y)),lt.push(tt),lt.push(rt);else{var ut=(a+x)/2,ft=(y+E)/2,yt=(x+b)/2,xt=(E+z)/2;b=(b+tt)/2,z=(z+rt)/2,E=(ut+yt)/2,x=(ft+xt)/2,yt=(yt+b)/2,xt=(xt+z)/2;var Ct=(E+yt)/2,bt=(x+xt)/2;Zt.Qe(a,y,ut,ft,E,x,Ct,bt,ot,lt),Zt.Qe(Ct,bt,yt,xt,b,z,tt,rt,ot,lt)}return lt},jv:function(a,y,x,E,b,z,tt,rt,ot,lt){if(Zt.Yb(a,y,b,z,lt,x,E))return Zt.Yb(a,y,b,z,lt,rt,ot);var ut=(a+x)/2,ft=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var yt=(ut+x)/2,xt=(ft+E)/2;return Zt.jv(a,y,ut,ft,yt,xt,tt,rt,ot,lt)||Zt.jv(yt,xt,x,E,b,z,tt,rt,ot,lt)},OA:function(a,y,x,E,b,z,tt){return tt.h(((a+x)/2+(x+b)/2)/2,((y+E)/2+(E+z)/2)/2),tt},iv:function(a,y,x,E,b,z,tt,rt){if(Zt.Yb(a,y,b,z,tt,x,E))Jr(rt,a,y,0,0),Jr(rt,b,z,0,0);else{var ot=(a+x)/2,lt=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var ut=(ot+x)/2,ft=(lt+E)/2;Zt.iv(a,y,ot,lt,ut,ft,tt,rt),Zt.iv(ut,ft,x,E,b,z,tt,rt)}return rt},ep:function(a,y,x,E,b,z,tt,rt){if(Zt.Yb(a,y,b,z,tt,x,E))rt.length===0&&(rt.push(a),rt.push(y)),rt.push(b),rt.push(z);else{var ot=(a+x)/2,lt=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var ut=(ot+x)/2,ft=(lt+E)/2;Zt.ep(a,y,ot,lt,ut,ft,tt,rt),Zt.ep(ut,ft,x,E,b,z,tt,rt)}return rt},Eo:function(a,y,x,E,b,z,tt,rt,ot,lt,ut,ft,yt,xt){if(Zt.Yb(a,y,tt,rt,yt,x,E)&&Zt.Yb(a,y,tt,rt,yt,b,z))return!Zt.Rl(a,y,tt,rt,ot,lt,ut,ft)||(yt=(a-tt)*(lt-ft)-(y-rt)*(ot-ut),yt===0)?!1:(xt.h(((a*rt-y*tt)*(ot-ut)-(a-tt)*(ot*ft-lt*ut))/yt,((a*rt-y*tt)*(lt-ft)-(y-rt)*(ot*ft-lt*ut))/yt),!0);var Ct=(a+x)/2,bt=(y+E)/2,Wt=(x+b)/2,jt=(E+z)/2;b=(b+tt)/2,z=(z+rt)/2,E=(Ct+Wt)/2,x=(bt+jt)/2,Wt=(Wt+b)/2,jt=(jt+z)/2;var Qt=(E+Wt)/2,te=(x+jt)/2,re=1/0,he=!1,ke=0,Jn=0;return Zt.Eo(a,y,Ct,bt,E,x,Qt,te,ot,lt,ut,ft,yt,xt)&&(a=(xt.x-ot)*(xt.x-ot)+(xt.y-lt)*(xt.y-lt),a<re&&(re=a,he=!0,ke=xt.x,Jn=xt.y)),Zt.Eo(Qt,te,Wt,jt,b,z,tt,rt,ot,lt,ut,ft,yt,xt)&&(xt.x-ot)*(xt.x-ot)+(xt.y-lt)*(xt.y-lt)<re&&(he=!0,ke=xt.x,Jn=xt.y),he&&(xt.x=ke,xt.y=Jn),he},Fo:function(a,y,x,E,b,z,tt,rt,ot,lt,ut,ft,yt){var xt=0;if(Zt.Yb(a,y,tt,rt,yt,x,E)&&Zt.Yb(a,y,tt,rt,yt,b,z)){if(yt=(a-tt)*(lt-ft)-(y-rt)*(ot-ut),yt===0)return xt;var Ct=((a*rt-y*tt)*(ot-ut)-(a-tt)*(ot*ft-lt*ut))/yt,bt=((a*rt-y*tt)*(lt-ft)-(y-rt)*(ot*ft-lt*ut))/yt;if(Ct>=ut)return xt;if((ot>ut?ot-ut:ut-ot)<(lt>ft?lt-ft:ft-lt)){if(y<rt?(ot=y,a=rt):(ot=rt,a=y),bt<ot||bt>a)return xt}else if(a<tt?(ot=a,a=tt):ot=tt,Ct<ot||Ct>a)return xt;0<yt?xt++:0>yt&&xt--}else{Ct=(a+x)/2,bt=(y+E)/2;var Wt=(x+b)/2,jt=(E+z)/2;b=(b+tt)/2,z=(z+rt)/2,E=(Ct+Wt)/2,x=(bt+jt)/2,Wt=(Wt+b)/2,jt=(jt+z)/2;var Qt=(E+Wt)/2,te=(x+jt)/2;xt+=Zt.Fo(a,y,Ct,bt,E,x,Qt,te,ot,lt,ut,ft,yt),xt+=Zt.Fo(Qt,te,Wt,jt,b,z,tt,rt,ot,lt,ut,ft,yt)}return xt},qh:function(a,y,x,E,b,z,tt){return Zt.$(a,x)?(y<E?(x=y,y=E):x=E,z<x?(tt.h(a,x),!1):z>y?(tt.h(a,y),!1):(tt.h(a,z),!0)):Zt.$(y,E)?(a<x?(E=a,a=x):E=x,b<E?(tt.h(E,y),!1):b>a?(tt.h(a,y),!1):(tt.h(b,y),!0)):(b=((a-b)*(a-x)+(y-z)*(y-E))/((x-a)*(x-a)+(E-y)*(E-y)),-5e-6>b?(tt.h(a,y),!1):1.000005<b?(tt.h(x,E),!1):(tt.h(a+b*(x-a),y+b*(E-y)),!0))},Ve:function(a,y,x,E,b,z,tt,rt,ot){return Zt.B(a,x)&&Zt.B(y,E)?(ot.h(a,y),!1):Zt.$(b,tt)?Zt.$(a,x)?(Zt.qh(a,y,x,E,b,z,ot),!1):Zt.qh(a,y,x,E,b,(E-y)/(x-a)*(b-a)+y,ot):(rt=(rt-z)/(tt-b),Zt.$(a,x)?(x=rt*(a-b)+z,y<E?(b=y,y=E):b=E,x<b?(ot.h(a,b),!1):x>y?(ot.h(a,y),!1):(ot.h(a,x),!0)):(tt=(E-y)/(x-a),Zt.$(rt,tt)?(Zt.qh(a,y,x,E,b,z,ot),!1):(b=(tt*a-rt*b+z-y)/(tt-rt),Zt.$(tt,0)?(a<x?(E=a,a=x):E=x,b<E?(ot.h(E,y),!1):b>a?(ot.h(a,y),!1):(ot.h(b,y),!0)):Zt.qh(a,y,x,E,b,tt*(b-a)+y,ot))))},MA:function(a,y,x,E,b){return Zt.Ve(x.x,x.y,E.x,E.y,a.x,a.y,y.x,y.y,b)},KA:function(a,y,x,E,b,z,tt,rt,ot,lt){function ut(Wt,jt){var Qt=(Wt-a)*(Wt-a)+(jt-y)*(jt-y);Qt<ft&&(ft=Qt,ot.h(Wt,jt))}var ft=1/0;ut(ot.x,ot.y);var yt=0,xt=0,Ct=0,bt=0;if(b<tt?(yt=b,xt=tt):(yt=tt,xt=b),z<rt?(Ct=b,bt=tt):(Ct=tt,bt=b),yt=(xt-yt)/2+lt,lt=(bt-Ct)/2+lt,b=(b+tt)/2,z=(z+rt)/2,yt===0||lt===0)return ot;if(.5>(x>a?x-a:a-x)){if(yt=1-(x-b)*(x-b)/(yt*yt),0>yt)return ot;yt=Math.sqrt(yt),E=-lt*yt+z,ut(x,lt*yt+z),ut(x,E)}else{if(x=(E-y)/(x-a),E=1/(yt*yt)+x*x/(lt*lt),rt=2*x*(y-x*a)/(lt*lt)-2*x*z/(lt*lt)-2*b/(yt*yt),yt=rt*rt-4*E*(2*x*a*z/(lt*lt)-2*y*z/(lt*lt)+z*z/(lt*lt)+b*b/(yt*yt)-1+(y-x*a)*(y-x*a)/(lt*lt)),0>yt)return ot;yt=Math.sqrt(yt),lt=(-rt+yt)/(2*E),ut(lt,x*lt-x*a+y),yt=(-rt-yt)/(2*E),ut(yt,x*yt-x*a+y)}return ot},Ff:function(a,y,x,E,b,z,tt,rt,ot){var lt=1e21,ut=a,ft=y;if(Zt.Ve(a,y,a,E,b,z,tt,rt,ot)){var yt=(ot.x-b)*(ot.x-b)+(ot.y-z)*(ot.y-z);yt<lt&&(lt=yt,ut=ot.x,ft=ot.y)}return Zt.Ve(x,y,x,E,b,z,tt,rt,ot)&&(yt=(ot.x-b)*(ot.x-b)+(ot.y-z)*(ot.y-z),yt<lt&&(lt=yt,ut=ot.x,ft=ot.y)),Zt.Ve(a,y,x,y,b,z,tt,rt,ot)&&(y=(ot.x-b)*(ot.x-b)+(ot.y-z)*(ot.y-z),y<lt&&(lt=y,ut=ot.x,ft=ot.y)),Zt.Ve(a,E,x,E,b,z,tt,rt,ot)&&(a=(ot.x-b)*(ot.x-b)+(ot.y-z)*(ot.y-z),a<lt&&(lt=a,ut=ot.x,ft=ot.y)),ot.h(ut,ft),1e21>lt},us:function(a,y,x){return Zt.Fx(a.x,a.y,a.width,a.height,y.x,y.y,x.x,x.y)},Fx:function(a,y,x,E,b,z,tt,rt){var ot=a+x,lt=y+E;return b===tt?(z<rt?(tt=z,z=rt):tt=rt,a<=b&&b<=ot&&tt<=lt&&z>=y):z===rt?(b<tt?(rt=b,b=tt):rt=tt,y<=z&&z<=lt&&rt<=ot&&b>=a):!!(Dr(a,y,x,E,b,z)||Dr(a,y,x,E,tt,rt)||Zt.Rl(a,y,ot,y,b,z,tt,rt)||Zt.Rl(ot,y,ot,lt,b,z,tt,rt)||Zt.Rl(ot,lt,a,lt,b,z,tt,rt)||Zt.Rl(a,lt,a,y,b,z,tt,rt))},Rl:function(a,y,x,E,b,z,tt,rt){return a===x&&y===E&&b===tt&&z===rt?a===b&&y===z:0>=Zt.Fl(a,y,x,E,b,z)*Zt.Fl(a,y,x,E,tt,rt)&&0>=Zt.Fl(b,z,tt,rt,a,y)*Zt.Fl(b,z,tt,rt,x,E)},Fl:function(a,y,x,E,b,z){return x-=a,E-=y,a=b-a,y=z-y,z=a*E-y*x,z===0&&(z=a*x+y*E,0<z&&(z=(a-x)*x+(y-E)*E,0>z&&(z=0))),z},bp:function(a){return 0>a&&(a+=360),360<=a&&(a-=360),a},jx:function(a,y,x,E,b,z){var tt=Math.PI;z||(E*=tt/180,b*=tt/180);var rt=E>b?-1:1;z=[];var ot=tt/2,lt=E;if(E=Math.min(2*tt,Math.abs(b-E)),1e-5>E)return ot=lt+rt*Math.min(E,ot),rt=a+x*Math.cos(lt),lt=y+x*Math.sin(lt),a+=x*Math.cos(ot),y+=x*Math.sin(ot),x=(rt+a)/2,ot=(lt+y)/2,z.push([rt,lt,x,ot,x,ot,a,y]),z;for(;1e-5<E;)b=lt+rt*Math.min(E,ot),z.push(Zt.Vy(x,lt,b,a,y)),E-=Math.abs(b-lt),lt=b;return z},Vy:function(a,y,x,E,b){var z=(x-y)/2,tt=a*Math.cos(z),rt=a*Math.sin(z),ot=-rt,lt=tt*tt+ot*ot,ut=lt+tt*tt+ot*rt;return lt=4/3*(Math.sqrt(2*lt*ut)-ut)/(tt*rt-ot*tt),rt=tt-lt*ot,tt=ot+lt*tt,ot=-tt,lt=z+y,z=Math.cos(lt),lt=Math.sin(lt),[E+a*Math.cos(y),b+a*Math.sin(y),E+rt*z-tt*lt,b+rt*lt+tt*z,E+rt*z-ot*lt,b+rt*lt+ot*z,E+a*Math.cos(x),b+a*Math.sin(x)]},No:function(a,y,x,E,b,z,tt){x=Math.floor((a-x)/b)*b+x,E=Math.floor((y-E)/z)*z+E;var rt=x;return x+b-a<b/2&&(rt=x+b),a=E,E+z-y<z/2&&(a=E+z),tt.h(rt,a),tt},vx:function(a,y){var x=Math.max(a,y);a=Math.min(a,y);var E;do y=x%a,x=E=a,a=y;while(0<y);return E},$y:function(a,y,x,E){var b=0>x,z=0>E;if(a<y)var tt=1,rt=0;else tt=0,rt=1;var ot=tt===0?a:y,lt=tt===0?x:E;return(tt===0?b:z)&&(lt=-lt),tt=rt,x=tt===0?x:E,(tt===0?b:z)&&(x=-x),Zt.az(ot,tt===0?a:y,lt,x,0,0)},az:function(a,y,x,E,b,z){if(0<E)if(0<x){b=a*a,z=y*y,a*=x;var tt=y*E,rt=-z+tt,ot=-z+Math.sqrt(a*a+tt*tt);y=rt;for(var lt=0;9999999999>lt&&(y=.5*(rt+ot),!(y===rt||y===ot));++lt){var ut=a/(y+b),ft=tt/(y+z);if(ut=ut*ut+ft*ft-1,0<ut)rt=y;else if(0>ut)ot=y;else break}x=b*x/(y+b)-x,E=z*E/(y+z)-E,x=Math.sqrt(x*x+E*E)}else x=Math.abs(E-y);else E=a*a-y*y,z=a*x,z<E?(E=z/E,z=y*Math.sqrt(Math.abs(1-E*E)),x=a*E-x,x=Math.sqrt(x*x+z*z)):x=Math.abs(x-a);return x},Ze:new Hi,um:new Hi,Mf:new Hi,Nf:0,vm:100};Zt.za=Zt.AA;function Ye(a){Di(this),this.l=2,a===void 0&&(a=Ye.o),this.na=a,this.Ec=this.Dc=this.pd=this.od=0,a===Ye.o?this.ee=new fn:(Ye.V===null&&(Ye.V=new fn().freeze()),this.ee=Ye.V),this.aq=this.ee.Ja,this.Ip=new Be().freeze(),this.ym=this.tk=null,this.zm=NaN,this.fg=eo,this.gg=No,this.Rk=this.Sk=NaN,this.Uf=xn}Ye.prototype.copy=function(){var a=new Ye;if(a.l=this.l&-2,a.na=this.na,a.od=this.od,a.pd=this.pd,a.Dc=this.Dc,a.Ec=this.Ec,this.na===Ye.o){for(var y=this.ee.s,x=a.ee,E=0;E<y.length;E++)x.add(y[E].copy());a.ee=x}else a.ee=this.ee;return a.aq=this.aq,a.Ip.assign(this.Ip),a.tk=this.tk,a.ym=this.ym,a.zm=this.zm,a.fg=this.fg.J(),a.gg=this.gg.J(),a.Sk=this.Sk,a.Rk=this.Rk,a.Uf=this.Uf,a},Ye.prototype.ja=function(){return this.freeze(),Object.freeze(this),this},Ye.prototype.freeze=function(){if(this._isFrozen=!0,this.type!==Ye.o)return this;var a=this.figures;a.freeze(),a=a.s;for(var y=a.length,x=0;x<y;x++)a[x].freeze();return this},Ye.prototype.ka=function(){if(Object.isFrozen(this)&&$t("cannot thaw constant: "+this),this._isFrozen=!1,this.type!==Ye.o)return this;var a=this.figures;a.ka(),a=a.s;for(var y=a.length,x=0;x<y;x++)a[x].ka();return this},Ye.prototype.Xa=function(a){if(!(a instanceof Ye))return!1;if(this.type!==a.type)return this.type===Ye.j&&a.type===Ye.o?pr(this,a):a.type===Ye.j&&this.type===Ye.o?pr(a,this):!1;if(this.type===Ye.o){var y=this.figures.s;a=a.figures.s;var x=y.length;if(x!==a.length)return!1;for(var E=0;E<x;E++)if(!y[E].Xa(a[E]))return!1;return!0}return Zt.B(this.startX,a.startX)&&Zt.B(this.startY,a.startY)&&Zt.B(this.endX,a.endX)&&Zt.B(this.endY,a.endY)};function pr(a,y){return a.type!==Ye.j||y.type!==Ye.o?!1:!!(y.figures.count===1&&(y=y.figures.M(0),y.segments.count===1&&Zt.B(a.startX,y.startX)&&Zt.B(a.startY,y.startY)&&(y=y.segments.M(0),y.type===Qi&&Zt.B(a.endX,y.endX)&&Zt.B(a.endY,y.endY))))}Ye.ia=function(a){return a.toString()},Ye.prototype.qb=function(a){a.classType===Ye&&(this.type=a)},Ye.prototype.toString=function(a){switch(a===void 0&&(a=-1),this.type){case Ye.j:return 0>a?"M"+this.startX.toString()+" "+this.startY.toString()+"L"+this.endX.toString()+" "+this.endY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a)+"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);case Ye.u:var y=new Be(this.startX,this.startY,0,0);return y.Kv(this.endX,this.endY,0,0),0>a?"M"+y.x.toString()+" "+y.y.toString()+"H"+y.right.toString()+"V"+y.bottom.toString()+"H"+y.left.toString()+"z":"M"+y.x.toFixed(a)+" "+y.y.toFixed(a)+"H"+y.right.toFixed(a)+"V"+y.bottom.toFixed(a)+"H"+y.left.toFixed(a)+"z";case Ye.F:if(y=new Be(this.startX,this.startY,0,0),y.Kv(this.endX,this.endY,0,0),0>a)return a=y.left.toString()+" "+(y.y+y.height/2).toString(),"M"+a+"A"+(y.width/2).toString()+" "+(y.height/2).toString()+" 0 0 1 "+(y.right.toString()+" "+(y.y+y.height/2).toString())+"A"+(y.width/2).toString()+" "+(y.height/2).toString()+" 0 0 1 "+a;var x=y.left.toFixed(a)+" "+(y.y+y.height/2).toFixed(a);return"M"+x+"A"+(y.width/2).toFixed(a)+" "+(y.height/2).toFixed(a)+" 0 0 1 "+(y.right.toFixed(a)+" "+(y.y+y.height/2).toFixed(a))+"A"+(y.width/2).toFixed(a)+" "+(y.height/2).toFixed(a)+" 0 0 1 "+x;case Ye.o:y="",x=this.figures.s;for(var E=x.length,b=0;b<E;b++){var z=x[b];0<b&&(y+=" x "),z.isFilled&&(y+="F "),y+=z.toString(a)}return y;default:return this.type.toString()}},Ye.nb=function(a){a=a.split(/[Xx]/);for(var y=a.length,x="",E=0;E<y;E++){var b=a[E];x=b.match(/[Ff]/)!==null?E===0?x+b:x+("X"+(b[0]===" "?"":" ")+b):x+((E===0?"":"X ")+"F"+(b[0]===" "?"":" ")+b)}return x},Ye.parse=function(a,y){function x(){return bt>=re-1?!0:lt[bt+1].match(he)!==null}function E(){return bt++,lt[bt]}function b(nr){var Xi=parseFloat(E()),to=parseFloat(E());Wt===Wt.toLowerCase()&&(Xi=te.x+Xi,to=te.y+to),nr.h(Xi,to)}function z(){return b(te),te}function tt(){return b(Qt),Qt}function rt(){var nr=jt.toLowerCase();return nr!=="c"&&nr!=="s"&&nr!=="q"&&nr!=="t"?te:new At(2*te.x-Qt.x,2*te.y-Qt.y)}y===void 0&&(y=!1);var ot=/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm;a=a.replace(/,/gm," "),a=a.replace(ot,"$1 $2"),a=a.replace(ot,"$1 $2"),a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([^s])/gm,"$1 $2"),a=a.replace(/([^s])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2"),a=a.replace(/([0-9])([+\-])/gm,"$1 $2"),a=a.replace(/[\s\r\t\n]+/gm," "),a=a.replace(/^\s+|\s+$/g,"");var lt=a.split(" ");for(a=0;a<lt.length;a++){var ut=lt[a];if(ut.match(/(\.[0-9]*)(\.)/gm)!==null){ot=pi();for(var ft="",yt=!1,xt=0;xt<ut.length;xt++){var Ct=ut[xt];Ct!=="."||yt?Ct==="."?(ot.push(ft),ft="."):ft+=Ct:(yt=!0,ft+=Ct)}for(ot.push(ft),lt.splice(a,1),ut=0;ut<ot.length;ut++)lt.splice(a+ut,0,ot[ut]);a+=ot.length-1,oi(ot)}}var bt=-1,Wt="",jt="";ot=new At(0,0);var Qt=new At(0,0),te=new At(0,0),re=lt.length;a=N1(null),yt=ft=ut=!1,xt=!0,Ct=null;for(var he=/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/;!(bt>=re-1);)if(jt=Wt,Wt=E(),Wt!=="")switch(Wt.toUpperCase()){case"X":xt=!0,ft=ut=!1;break;case"M":for(Ct=z(),a.mc===null||xt===!0?(Zf(a,Ct.x,Ct.y,ut,!ft,yt),xt=!1):a.moveTo(Ct.x,Ct.y),ot.assign(te);!x();)Ct=z(),a.lineTo(Ct.x,Ct.y);break;case"L":for(;!x();)Ct=z(),a.lineTo(Ct.x,Ct.y);break;case"H":for(;!x();)te=new At((Wt===Wt.toLowerCase()?te.x:0)+parseFloat(E()),te.y),a.lineTo(te.x,te.y);break;case"V":for(;!x();)te=new At(te.x,(Wt===Wt.toLowerCase()?te.y:0)+parseFloat(E())),a.lineTo(te.x,te.y);break;case"C":for(;!x();){Ct=new At,b(Ct);var ke=tt(),Jn=z();Ih(a,Ct.x,Ct.y,ke.x,ke.y,Jn.x,Jn.y)}break;case"S":for(;!x();)Ct=rt(),ke=tt(),Jn=z(),Ih(a,Ct.x,Ct.y,ke.x,ke.y,Jn.x,Jn.y);break;case"Q":for(;!x();)Ct=tt(),ke=z(),jm(a,Ct.x,Ct.y,ke.x,ke.y);break;case"T":for(;!x();)Qt=Ct=rt(),ke=z(),jm(a,Ct.x,Ct.y,ke.x,ke.y);break;case"B":for(;!x();){Ct=parseFloat(E()),ke=parseFloat(E()),Jn=parseFloat(E());var fi=parseFloat(E()),li=parseFloat(E()),Bn=li,on=!1;x()||(Bn=parseFloat(E()),x()||(on=parseFloat(E())!==0)),Wt===Wt.toLowerCase()&&(Jn+=te.x,fi+=te.y),a.arcTo(Ct,ke,Jn,fi,li,Bn,on)}break;case"A":for(;!x();)Ct=Math.abs(parseFloat(E())),ke=Math.abs(parseFloat(E())),Jn=parseFloat(E()),li=fi=!1,on=Bn=0,Bn=E(),Bn.length===1?(fi=!!parseFloat(Bn),li=!!parseFloat(E()),Bn=parseFloat(E())):Bn.length===2?(fi=!!parseFloat(Bn[0]),li=!!parseFloat(Bn[1]),Bn=parseFloat(E())):(fi=!!parseFloat(Bn[0]),li=!!parseFloat(Bn[1]),Bn=parseFloat(Bn.slice(2))),on=parseFloat(E()),Wt===Wt.toLowerCase()&&(Bn=te.x+Bn,on=te.y+on),te.h(Bn,on),wx(a,Ct,ke,Jn,fi,li,Bn,on);break;case"Z":Px(a),te.assign(ot);break;case"F":for(Ct="",ke=1;lt[bt+ke];)if(lt[bt+ke]==="0")yt=!0,ke++;else if(lt[bt+ke].match(/[Uu]/)!==null)ke++;else if(lt[bt+ke].match(he)===null)ke++;else{Ct=lt[bt+ke];break}Ct.match(/[Mm]/)?ut=!0:0<a.mc.segments.length&&(a.mc.isFilled=!0);break;case"U":for(Ct="",ke=1;lt[bt+ke];)if(lt[bt+ke].match(/[Ff]/)!==null)ke++;else if(lt[bt+ke].match(he)===null)ke++;else{Ct=lt[bt+ke];break}Ct.match(/[Mm]/)?ft=!0:a.mc.isShadowed=!1}if(ot=a.os,zm=a,y)for(y=ot.figures.iterator;y.next();)y.value.isFilled=!0;return ot},Ye.Ha=function(a,y){for(var x=a.length,E=At.alloc(),b=0;b<x;b++){var z=a[b];E.x=z[0],E.y=z[1],y.Ga(E),z[0]=E.x,z[1]=E.y,E.x=z[2],E.y=z[3],y.Ga(E),z[2]=E.x,z[3]=E.y,E.x=z[4],E.y=z[5],y.Ga(E),z[4]=E.x,z[5]=E.y,E.x=z[6],E.y=z[7],y.Ga(E),z[6]=E.x,z[7]=E.y}At.free(E)},Ye.prototype.Zu=function(){if(this._isInvalidBounds)return!0;if(this.type===Ye.o){if(this.aq!==this.figures.Ja)return!0;for(var a=this.figures.s,y=a.length,x=0;x<y;x++)if(a[x].Zu())return!0}return!1},Ye.prototype.computeBounds=function(){if(this._isInvalidBounds=!1,this.ym=this.tk=null,this.zm=NaN,this.type===Ye.o){this.aq=this.figures.Ja;for(var a=this.figures.s,y=a.length,x=0;x<y;x++){var E=a[x];E._isInvalidBounds=!1;var b=E.segments;E.sr=b.Ja,E=b.s,b=E.length;for(var z=0;z<b;z++){var tt=E[z];tt._isInvalidBounds=!1,tt.ae=null}}}a=this.Ip,a.ka(),isNaN(this.Sk)||isNaN(this.Rk)?a.h(0,0,0,0):a.h(0,0,this.Sk,this.Rk),oo(this,a,!1),Jr(a,0,0,0,0),a.freeze()},Ye.prototype.ix=function(){var a=new Be;return oo(this,a,!0),a};function oo(a,y,x){switch(a.type){case Ye.j:case Ye.u:case Ye.F:x?y.h(a.od,a.pd,0,0):Jr(y,a.od,a.pd,0,0),Jr(y,a.Dc,a.Ec,0,0);break;case Ye.o:var E=a.figures;a=E.s,E=E.length;for(var b=0;b<E;b++){var z=a[b];x&&b===0?y.h(z.startX,z.startY,0,0):Jr(y,z.startX,z.startY,0,0);for(var tt=z.segments.s,rt=tt.length,ot=z.startX,lt=z.startY,ut=0;ut<rt;ut++){var ft=tt[ut];switch(ft.type){case Qi:case wr:ot=ft.endX,lt=ft.endY,Jr(y,ot,lt,0,0);break;case ar:Zt.Dl(ot,lt,ft.point1X,ft.point1Y,ft.point2X,ft.point2Y,ft.endX,ft.endY,.5,y),ot=ft.endX,lt=ft.endY;break;case so:Zt.iv(ot,lt,ft.point1X,ft.point1Y,ft.endX,ft.endY,.5,y),ot=ft.endX,lt=ft.endY;break;case xr:case Ji:var yt=ft.type===xr?Gi(ft,z):kr(ft,z,ot,lt),xt=yt.length;if(xt===0){ot=ft.type===xr?ft.centerX:ft.endX,lt=ft.type===xr?ft.centerY:ft.endY,Jr(y,ot,lt,0,0);break}ft=null;for(var Ct=0;Ct<xt;Ct++)ft=yt[Ct],Zt.Dl(ft[0],ft[1],ft[2],ft[3],ft[4],ft[5],ft[6],ft[7],.5,y);ft!==null&&(ot=ft[6],lt=ft[7]);break;default:$t("Unknown Segment type: "+ft.type)}}}break;default:$t("Unknown Geometry type: "+a.type)}}Ye.prototype.normalize=function(){this._isFrozen&&Ze(this);var a=this.ix();return this.offset(-a.x,-a.y),new At(-a.x,-a.y)},Ye.prototype.offset=function(a,y){return this._isFrozen&&Ze(this),this.transform(1,0,0,1,a,y),this},Ye.prototype.scale=function(a,y){return this._isFrozen&&Ze(this),this.transform(a,0,0,y,0,0),this},Ye.prototype.rotate=function(a,y,x){this._isFrozen&&Ze(this),y===void 0&&(y=0),x===void 0&&(x=0);var E=fe.alloc();return E.reset(),E.rotate(a,y,x),this.transform(E.m11,E.m12,E.m21,E.m22,E.dx,E.dy),fe.free(E),this},wt=Ye.prototype,wt.transform=function(a,y,x,E,b,z){switch(this.type){case Ye.j:case Ye.u:case Ye.F:var tt=this.od,rt=this.pd;this.od=tt*a+rt*x+b,this.pd=tt*y+rt*E+z,tt=this.Dc,rt=this.Ec,this.Dc=tt*a+rt*x+b,this.Ec=tt*y+rt*E+z;break;case Ye.o:for(var ot=this.figures.s,lt=ot.length,ut=0;ut<lt;ut++){var ft=ot[ut];tt=ft.startX,rt=ft.startY,ft.startX=tt*a+rt*x+b,ft.startY=tt*y+rt*E+z,ft=ft.segments.s;for(var yt=ft.length,xt=0;xt<yt;xt++){var Ct=ft[xt];switch(Ct.type){case Qi:case wr:tt=Ct.endX,rt=Ct.endY,Ct.endX=tt*a+rt*x+b,Ct.endY=tt*y+rt*E+z;break;case ar:tt=Ct.point1X,rt=Ct.point1Y,Ct.point1X=tt*a+rt*x+b,Ct.point1Y=tt*y+rt*E+z,tt=Ct.point2X,rt=Ct.point2Y,Ct.point2X=tt*a+rt*x+b,Ct.point2Y=tt*y+rt*E+z,tt=Ct.endX,rt=Ct.endY,Ct.endX=tt*a+rt*x+b,Ct.endY=tt*y+rt*E+z;break;case so:tt=Ct.point1X,rt=Ct.point1Y,Ct.point1X=tt*a+rt*x+b,Ct.point1Y=tt*y+rt*E+z,tt=Ct.endX,rt=Ct.endY,Ct.endX=tt*a+rt*x+b,Ct.endY=tt*y+rt*E+z;break;case xr:tt=Ct.centerX,rt=Ct.centerY,Ct.centerX=tt*a+rt*x+b,Ct.centerY=tt*y+rt*E+z,y!==0&&(tt=180*Math.atan2(y,a)/Math.PI,0>tt&&(tt+=360),Ct.startAngle+=tt),0>a&&(Ct.startAngle=180-Ct.startAngle,Ct.sweepAngle=-Ct.sweepAngle),0>E&&(Ct.startAngle=-Ct.startAngle,Ct.sweepAngle=-Ct.sweepAngle),Ct.radiusX*=Math.sqrt(a*a+x*x),Ct.radiusY!==void 0&&(Ct.radiusY*=Math.sqrt(y*y+E*E));break;case Ji:if(tt=Ct.endX,rt=Ct.endY,Ct.endX=tt*a+rt*x+b,Ct.endY=tt*y+rt*E+z,Ct.radiusX===0||Ct.radiusY===0)break;y!==0&&(tt=180*Math.atan2(y,a)/Math.PI,0>tt&&(tt+=360),Ct.xAxisRotation+=tt),0>a&&(Ct.xAxisRotation=180-Ct.xAxisRotation,Ct.isClockwiseArc=!Ct.isClockwiseArc),0>E&&(Ct.xAxisRotation=-Ct.xAxisRotation,Ct.isClockwiseArc=!Ct.isClockwiseArc),Ct.radiusX*=Math.sqrt(a*a+x*x),Ct.radiusY*=Math.sqrt(y*y+E*E);break;default:$t("Unknown Segment type: "+Ct.type)}}}}return this._isInvalidBounds=!0,this},wt.ca=function(a,y){y===void 0&&(y=0);var x=this.od,E=this.pd,b=this.Dc,z=this.Ec;switch(this.type){case Ye.j:return Zt.Yb(x,E,b,z,y,a.x,a.y);case Ye.u:var tt=Be.allocAt(Math.min(x,b)-y,Math.min(E,z)-y,Math.abs(b-x)+2*y,Math.abs(z-E)+2*y);return a=tt.ca(a),Be.free(tt),a;case Ye.F:tt=Math.min(x,b)-y;var rt=Math.min(E,z)-y;return x=(Math.abs(b-x)+2*y)/2,y=(Math.abs(z-E)+2*y)/2,0>=x||0>=y?!1:(tt=a.x-(tt+x),rt=a.y-(rt+y),1>=tt*tt/(x*x)+rt*rt/(y*y));case Ye.o:return rr(this,a,y,!0,!1);default:return!1}};function rr(a,y,x,E,b){var z=y.x;y=y.y;for(var tt=a.bounds.x-20,rt=0,ot,lt,ut,ft,yt=a.figures.s,xt=yt.length,Ct=0;Ct<xt;Ct++){var bt=yt[Ct],Wt=!bt.isEvenOdd;if(bt.isFilled){if(E&&bt.ca(z,y,x))return!0;var jt=bt.segments;ot=bt.startX,lt=bt.startY;for(var Qt=ot,te=lt,re=jt.s,he=0;he<=jt.length;he++){var ke=void 0;if(he!==jt.length){ke=re[he];var Jn=ke.type;a=ke.endX,ft=ke.endY}else Jn=Qi,a=Qt,ft=te;switch(Jn){case wr:if(Qt=Sr(z,y,tt,y,ot,lt,Qt,te),isNaN(Qt))return!0;rt+=Qt,Qt=a,te=ft;break;case Qi:if(ot=Sr(z,y,tt,y,ot,lt,a,ft),isNaN(ot))return!0;rt+=ot;break;case ar:ut=Zt.Fo(ot,lt,ke.point1X,ke.point1Y,ke.point2X,ke.point2Y,a,ft,tt,y,z,y,.5),rt+=ut;break;case so:ut=Zt.Fo(ot,lt,(ot+2*ke.point1X)/3,(lt+2*ke.point1Y)/3,(2*ke.point1X+a)/3,(2*ke.point1Y+ft)/3,a,ft,tt,y,z,y,.5),rt+=ut;break;case xr:case Ji:Jn=ke.type===xr?Gi(ke,bt):kr(ke,bt,ot,lt);var fi=Jn.length;if(fi===0){if(ot=Sr(z,y,tt,y,ot,lt,ke.type===xr?ke.centerX:ke.endX,ke.type===xr?ke.centerY:ke.endY),isNaN(ot))return!0;rt+=ot;break}ke=null;for(var li=0;li<fi;li++){if(ke=Jn[li],li===0){if(ut=Sr(z,y,tt,y,ot,lt,ke[0],ke[1]),isNaN(ut))return!0;rt+=ut}ut=Zt.Fo(ke[0],ke[1],ke[2],ke[3],ke[4],ke[5],ke[6],ke[7],tt,y,z,y,.5),rt+=ut}ke!==null&&(a=ke[6],ft=ke[7]);break;default:$t("Unknown Segment type: "+ke.type)}ot=a,lt=ft}if(Wt){if(rt!==0)return!0}else if(rt%2!==0)return!0;rt=0}else if(bt.ca(z,y,b?x:x+2))return!0}return!1}function Sr(a,y,x,E,b,z,tt,rt){if(Zt.Yb(b,z,tt,rt,.05,a,y))return NaN;var ot=(a-x)*(z-rt);if(ot===0)return 0;var lt=((a*E-y*x)*(b-tt)-(a-x)*(b*rt-z*tt))/ot;if(y=(a*E-y*x)*(z-rt)/ot,lt>=a)return 0;if((b>tt?b-tt:tt-b)<(z>rt?z-rt:rt-z)){if(z<rt){if(y<z||y>rt)return 0}else if(y<rt||y>z)return 0}else if(b<tt){if(lt<b||lt>tt)return 0}else if(lt<tt||lt>b)return 0;return 0<ot?1:-1}function xo(a,y,x,E){a=a.figures.s;for(var b=a.length,z=0;z<b;z++)if(a[z].ca(y,x,E))return!0;return!1}wt.Pu=function(a,y){if(0>a?a=0:1<a&&(a=1),y===void 0&&(y=new At),this.type===Ye.j)return y.h(this.startX+a*(this.endX-this.startX),this.startY+a*(this.endY-this.startY)),y;for(var x=this.flattenedSegments,E=this.flattenedLengths,b=x.length,z=this.flattenedTotalLength*a,tt=0,rt=0;rt<b;rt++){var ot=E[rt],lt=ot.length;for(a=0;a<lt;a++){var ut=ot[a];if(tt+ut>=z)return E=z-tt,E=ut===0?0:E/ut,x=x[rt],rt=x[2*a],b=x[2*a+1],y.h(rt+(x[2*a+2]-rt)*E,b+(x[2*a+3]-b)*E),y;tt+=ut}}return y},wt.wx=function(a){if(0>a?a=0:1<a&&(a=1),this.type===Ye.j)return 180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI;for(var y=this.flattenedSegments,x=this.flattenedLengths,E=y.length,b=this.flattenedTotalLength*a,z=0,tt=0;tt<E;tt++){var rt=x[tt],ot=rt.length;for(a=0;a<ot;a++){var lt=rt[a];if(z+lt>=b)return b=y[tt],y=b[2*a],x=b[2*a+1],E=b[2*a+2],a=b[2*a+3],1>Math.abs(E-y)&&1>Math.abs(a-x)?0:1>Math.abs(E-y)?0<=a-x?90:270:1>Math.abs(a-x)?0<=E-y?0:180:180*Math.atan2(a-x,E-y)/Math.PI;z+=lt}}return NaN},wt.Qu=function(a,y){if(0>a?a=0:1<a&&(a=1),y===void 0&&(y=[]),y.length=3,this.type===Ye.j)return y[0]=this.startX+a*(this.endX-this.startX),y[1]=this.startY+a*(this.endY-this.startY),y[2]=180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI,y;for(var x=this.flattenedSegments,E=this.flattenedLengths,b=x.length,z=this.flattenedTotalLength*a,tt=0,rt=0;rt<b;rt++){var ot=E[rt],lt=ot.length;for(a=0;a<lt;a++){var ut=ot[a];if(tt+ut>=z)return E=z-tt,E=ut===0?0:E/ut,ut=x[rt],x=ut[2*a],rt=ut[2*a+1],b=ut[2*a+2],a=ut[2*a+3],y[0]=x+(b-x)*E,y[1]=rt+(a-rt)*E,y[2]=1>Math.abs(b-x)&&1>Math.abs(a-rt)?0:1>Math.abs(b-x)?0<=a-rt?90:270:1>Math.abs(a-rt)?0<=b-x?0:180:180*Math.atan2(a-rt,b-x)/Math.PI,y;tt+=ut}}return y},wt.xx=function(a){if(this.type===Ye.j){var y=this.startX,x=this.startY,E=this.endX,b=this.endY;if(y!==E||x!==b){var z=a.x;if(a=a.y,y===E){if(x<b){var tt=x;E=b}else tt=b,E=x;return a<=tt?tt===x?0:1:a>=E?E===x?0:1:Math.abs(a-x)/(E-tt)}if(x===b)return y<E?tt=y:(tt=E,E=y),z<=tt?tt===y?0:1:z>=E?E===y?0:1:Math.abs(z-y)/(E-tt);tt=(E-y)*(E-y)+(b-x)*(b-x);var rt=At.alloc();return Zt.qh(y,x,E,b,z,a,rt),a=rt.x,z=rt.y,At.free(rt),Math.sqrt(((a-y)*(a-y)+(z-x)*(z-x))/tt)}}else if(this.type===Ye.u){tt=this.startX,rt=this.startY;var ot=this.endX;if(b=this.endY,tt!==ot||rt!==b){y=ot-tt,x=b-rt,z=2*y+2*x,E=a.x,a=a.y,E=Math.min(Math.max(E,tt),ot),a=Math.min(Math.max(a,rt),b),tt=Math.abs(E-tt),ot=Math.abs(E-ot),rt=Math.abs(a-rt),b=Math.abs(a-b);var lt=Math.min(tt,ot,rt,b);if(lt===rt)return E/z;if(lt===ot)return(y+a)/z;if(lt===b)return(2*y+x-E)/z;if(lt===tt)return(2*y+2*x-a)/z}}else{y=this.flattenedSegments,x=this.flattenedLengths,z=this.flattenedTotalLength,E=At.alloc(),b=1/0,rt=tt=0,ot=y.length;for(var ut=lt=0,ft=0;ft<ot;ft++)for(var yt=y[ft],xt=x[ft],Ct=yt.length,bt=0;bt<Ct;bt+=2){var Wt=yt[bt],jt=yt[bt+1];if(bt!==0){Zt.qh(lt,ut,Wt,jt,a.x,a.y,E);var Qt=(E.x-a.x)*(E.x-a.x)+(E.y-a.y)*(E.y-a.y);Qt<b&&(b=Qt,tt=rt,tt+=Math.sqrt((E.x-lt)*(E.x-lt)+(E.y-ut)*(E.y-ut))),rt+=xt[(bt-2)/2]}lt=Wt,ut=jt}return At.free(E),a=tt/z,0>a?0:1<a?1:a}return 0};function Vr(a){if(a.tk===null){var y=a.tk=[],x=a.ym=[],E=[],b=[];if(a.type===Ye.j)E.push(a.startX),E.push(a.startY),E.push(a.endX),E.push(a.endY),y.push(E),b.push(Math.sqrt((a.startX-a.endX)*(a.startX-a.endX)+(a.startY-a.endY)*(a.startY-a.endY))),x.push(b);else if(a.type===Ye.u)E.push(a.startX),E.push(a.startY),E.push(a.endX),E.push(a.startY),E.push(a.endX),E.push(a.endY),E.push(a.startX),E.push(a.endY),E.push(a.startX),E.push(a.startY),y.push(E),b.push(Math.abs(a.startX-a.endX)),b.push(Math.abs(a.startY-a.endY)),b.push(Math.abs(a.startX-a.endX)),b.push(Math.abs(a.startY-a.endY)),x.push(b);else if(a.type===Ye.F){var z=new Ur;z.startX=a.endX,z.startY=(a.startY+a.endY)/2;var tt=new Ri(xr);if(tt.startAngle=0,tt.sweepAngle=360,tt.centerX=(a.startX+a.endX)/2,tt.centerY=(a.startY+a.endY)/2,tt.radiusX=Math.abs(a.startX-a.endX)/2,tt.radiusY=Math.abs(a.startY-a.endY)/2,z.add(tt),a=Gi(tt,z),b=a.length,b===0)E.push(tt.centerX),E.push(tt.centerY);else{tt=z.startX,z=z.startY;for(var rt=0;rt<b;rt++){var ot=a[rt];Zt.Qe(tt,z,ot[2],ot[3],ot[4],ot[5],ot[6],ot[7],.5,E),tt=ot[6],z=ot[7]}}y.push(E),x.push(Po(E))}else for(a=a.figures.iterator;a.next();){b=a.value,E=[],E.push(b.startX),E.push(b.startY),tt=b.startX,z=b.startY,rt=tt,ot=z;for(var lt=b.segments.s,ut=lt.length,ft=0;ft<ut;ft++){var yt=lt[ft];switch(yt.type){case wr:4<=E.length&&(y.push(E),x.push(Po(E))),E=[],E.push(yt.endX),E.push(yt.endY),tt=yt.endX,z=yt.endY,rt=tt,ot=z;break;case Qi:E.push(yt.endX),E.push(yt.endY),tt=yt.endX,z=yt.endY;break;case ar:Zt.Qe(tt,z,yt.point1X,yt.point1Y,yt.point2X,yt.point2Y,yt.endX,yt.endY,.5,E),tt=yt.endX,z=yt.endY;break;case so:Zt.ep(tt,z,yt.point1X,yt.point1Y,yt.endX,yt.endY,.5,E),tt=yt.endX,z=yt.endY;break;case xr:var xt=Gi(yt,b),Ct=xt.length;if(Ct===0){E.push(yt.centerX),E.push(yt.centerY),tt=yt.centerX,z=yt.centerY;break}for(var bt=0;bt<Ct;bt++){var Wt=xt[bt];Zt.Qe(tt,z,Wt[2],Wt[3],Wt[4],Wt[5],Wt[6],Wt[7],.5,E),tt=Wt[6],z=Wt[7]}break;case Ji:if(xt=kr(yt,b,tt,z),Ct=xt.length,bt=yt.endX,Wt=yt.endY,Ct===0){E.push(bt),E.push(Wt),tt=bt,z=Wt;break}for(bt=0;bt<Ct;bt++)Wt=xt[bt],Zt.Qe(tt,z,Wt[2],Wt[3],Wt[4],Wt[5],Wt[6],Wt[7],.5,E),tt=Wt[6],z=Wt[7];break;default:$t("Segment not of valid type: "+yt.type)}yt.isClosed&&(E.push(rt),E.push(ot))}4<=E.length&&(y.push(E),x.push(Po(E)))}}}function Po(a){for(var y=[],x=0,E=0,b=a.length,z=0;z<b;z+=2){var tt=a[z],rt=a[z+1];z!==0&&y.push(Math.sqrt(Vi(x,E,tt,rt))),x=tt,E=rt}return y}wt.add=function(a){return this.ee.add(a),this},wt.pm=function(a,y,x,E,b,z,tt,rt){return this._isFrozen&&Ze(this),this.fg=new In(a,y,b,z).freeze(),this.gg=new In(x,E,tt,rt).freeze(),this},ve.Object.defineProperties(Ye.prototype,{_isFrozen:{get:function(){return(this.l&1)!==0},set:function(a){this.l=a?this.l|1:this.l&-2}},_isInvalidBounds:{get:function(){return(this.l&2)!==0},set:function(a){this.l=a?this.l|2:this.l&-3}},flattenedSegments:{get:function(){return Vr(this),this.tk}},flattenedLengths:{get:function(){return Vr(this),this.ym}},flattenedTotalLength:{get:function(){var a=this.zm;if(isNaN(a)){if(this.type===Ye.j){a=Math.abs(this.endX-this.startX);var y=Math.abs(this.endY-this.startY);a=Math.sqrt(a*a+y*y)}else if(this.type===Ye.u)a=2*Math.abs(this.endX-this.startX)+2*Math.abs(this.endY-this.startY);else{y=this.flattenedLengths;for(var x=y.length,E=a=0;E<x;E++)for(var b=y[E],z=b.length,tt=0;tt<z;tt++)a+=b[tt]}this.zm=a}return a}},type:{get:function(){return this.na},set:function(a){this.na!==a&&(this._isFrozen&&Ze(this,a),this.na=a,a===Ye.o?this.ee=new fn:(Ye.V===null&&(Ye.V=new fn().freeze()),this.ee=Ye.V),this._isInvalidBounds=!0)}},startX:{get:function(){return this.od},set:function(a){this.od!==a&&(this._isFrozen&&Ze(this,a),this.od=a,this._isInvalidBounds=!0)}},startY:{get:function(){return this.pd},set:function(a){this.pd!==a&&(this._isFrozen&&Ze(this,a),this.pd=a,this._isInvalidBounds=!0)}},endX:{get:function(){return this.Dc},set:function(a){this.Dc!==a&&(this._isFrozen&&Ze(this,a),this.Dc=a,this._isInvalidBounds=!0)}},endY:{get:function(){return this.Ec},set:function(a){this.Ec!==a&&(this._isFrozen&&Ze(this,a),this.Ec=a,this._isInvalidBounds=!0)}},figures:{get:function(){return this.ee},set:function(a){this.ee!==a&&(this._isFrozen&&Ze(this,a),this.ee=a,this._isInvalidBounds=!0)}},spot1:{get:function(){return this.fg},set:function(a){this._isFrozen&&Ze(this,a),this.fg=a.J()}},spot2:{get:function(){return this.gg},set:function(a){this._isFrozen&&Ze(this,a),this.gg=a.J()}},defaultStretch:{get:function(){return this.Uf},set:function(a){this._isFrozen&&Ze(this,a),this.Uf=a}},bounds:{get:function(){return this.Zu()&&this.computeBounds(),this.Ip}}}),Ye.prototype.setSpots=Ye.prototype.pm,Ye.prototype.add=Ye.prototype.add,Ye.prototype.getFractionForPoint=Ye.prototype.xx,Ye.prototype.getPointAndAngleAlongPath=Ye.prototype.Qu,Ye.prototype.getAngleAlongPath=Ye.prototype.wx,Ye.prototype.getPointAlongPath=Ye.prototype.Pu,Ye.prototype.containsPoint=Ye.prototype.ca,Ye.prototype.transform=Ye.prototype.transform,Ye.prototype.rotate=Ye.prototype.rotate,Ye.prototype.scale=Ye.prototype.scale,Ye.prototype.offset=Ye.prototype.offset,Ye.prototype.normalize=Ye.prototype.normalize,Ye.prototype.computeBoundsWithoutOrigin=Ye.prototype.ix,Ye.prototype.equalsApprox=Ye.prototype.Xa,Ye.className="Geometry",Ye.j=new He(Ye,"Line",0),Ye.u=new He(Ye,"Rectangle",1),Ye.F=new He(Ye,"Ellipse",2),Ye.o=new He(Ye,"Path",3),Ye.V=null,Ye.hb="UuBbMmZzLlHhVvCcSsQqTtAaFfXx",Ye.className="Geometry",Ye.stringify=Ye.ia,Ye.fillPath=Ye.nb,Ye.parse=Ye.parse,Ye.Line=Ye.j,Ye.Rectangle=Ye.u,Ye.Ellipse=Ye.F,Ye.Path=Ye.o;function Ur(a,y,x,E,b){Di(this),x===void 0&&(x=!0),E===void 0&&(E=!0),b===void 0&&(b=!1),this.l=2|(x?4:0)|(E?8:0)|(b?16:0),a!==void 0?this.od=a:this.od=0,y!==void 0?this.pd=y:this.pd=0,this.pl=new fn,this.sr=this.pl.Ja,this.fw=null}Ur.prototype.copy=function(){var a=new Ur;a.l=this.l&-2,a.od=this.od,a.pd=this.pd;for(var y=this.pl.s,x=y.length,E=a.pl,b=0;b<x;b++){var z=y[b].copy();E.add(z)}return a.sr=this.sr,a.fw=this.fw,a},wt=Ur.prototype,wt.Xa=function(a){if(!(a instanceof Ur&&Zt.B(this.startX,a.startX)&&Zt.B(this.startY,a.startY)))return!1;var y=this.segments.s;a=a.segments.s;var x=y.length;if(x!==a.length)return!1;for(var E=0;E<x;E++)if(!y[E].Xa(a[E]))return!1;return!0},wt.toString=function(a){a===void 0&&(a=-1);for(var y=0>a?"M"+this.startX.toString()+" "+this.startY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a),x=this.segments.s,E=x.length,b=0;b<E;b++)y+=" "+x[b].toString(a);return y},wt.freeze=function(){this._isFrozen=!0;var a=this.segments;a.freeze();var y=a.s;a=a.length;for(var x=0;x<a;x++)y[x].freeze();return this},wt.ka=function(){this._isFrozen=!1;var a=this.segments;a.ka(),a=a.s;for(var y=a.length,x=0;x<y;x++)a[x].ka();return this},wt.Zu=function(){if(this._isInvalidBounds)return!0;var a=this.segments;if(this.sr!==a.Ja)return!0;a=a.s;for(var y=a.length,x=0;x<y;x++)if(a[x]._isInvalidBounds)return!0;return!1},wt.add=function(a){return this.pl.add(a),this},wt.ca=function(a,y,x){for(var E=this.startX,b=this.startY,z=E,tt=b,rt=this.segments.s,ot=rt.length,lt=0;lt<ot;lt++){var ut=rt[lt];switch(ut.type){case wr:z=ut.endX,tt=ut.endY,E=ut.endX,b=ut.endY;break;case Qi:if(Zt.Yb(E,b,ut.endX,ut.endY,x,a,y))return!0;E=ut.endX,b=ut.endY;break;case ar:if(Zt.cs(E,b,ut.point1X,ut.point1Y,ut.point2X,ut.point2Y,ut.endX,ut.endY,.5,a,y,x))return!0;E=ut.endX,b=ut.endY;break;case so:if(Zt.jv(E,b,ut.point1X,ut.point1Y,ut.endX,ut.endY,.5,a,y,x))return!0;E=ut.endX,b=ut.endY;break;case xr:case Ji:var ft=ut.type===xr?Gi(ut,this):kr(ut,this,E,b),yt=ft.length,xt=ut.type===xr?ut.centerX:ut.endX,Ct=ut.type===xr?ut.centerY:ut.endY;if(yt===0){if(Zt.Yb(E,b,xt,Ct,x,a,y))return!0;E=xt,b=Ct;break}for(xt=null,Ct=0;Ct<yt;Ct++)if(xt=ft[Ct],Ct===0&&Zt.Yb(E,b,xt[0],xt[1],x,a,y)||Zt.cs(xt[0],xt[1],xt[2],xt[3],xt[4],xt[5],xt[6],xt[7],.5,a,y,x))return!0;xt!==null&&(E=xt[6],b=xt[7]);break;default:$t("Unknown Segment type: "+ut.type)}if(ut.isClosed&&(E!==z||b!==tt)&&Zt.Yb(E,b,z,tt,x,a,y))return!0}return!1},ve.Object.defineProperties(Ur.prototype,{_isFrozen:{get:function(){return(this.l&1)!==0},set:function(a){this.l=a?this.l|1:this.l&-2}},_isInvalidBounds:{get:function(){return(this.l&2)!==0},set:function(a){this.l=a?this.l|2:this.l&-3}},isFilled:{get:function(){return(this.l&4)!==0},set:function(a){this._isFrozen&&Ze(this,a),this.l=a?this.l|4:this.l&-5}},isShadowed:{get:function(){return(this.l&8)!==0},set:function(a){this._isFrozen&&Ze(this,a),this.l=a?this.l|8:this.l&-9}},isEvenOdd:{get:function(){return(this.l&16)!==0},set:function(a){this._isFrozen&&Ze(this,a),this.l=a?this.l|16:this.l&-17}},startX:{get:function(){return this.od},set:function(a){this._isFrozen&&Ze(this,a),this.od=a,this._isInvalidBounds=!0}},startY:{get:function(){return this.pd},set:function(a){this._isFrozen&&Ze(this,a),this.pd=a,this._isInvalidBounds=!0}},segments:{get:function(){return this.pl},set:function(a){this._isFrozen&&Ze(this,a),this.pl=a,this._isInvalidBounds=!0}}}),Ur.prototype.add=Ur.prototype.add,Ur.prototype.equalsApprox=Ur.prototype.Xa,Ur.className="PathFigure";function Ri(a,y,x,E,b,z,tt,rt){Di(this),a===void 0&&(a=Qi),this.na=a,this.l=2,y!==void 0?this.Dc=y:this.Dc=0,x!==void 0?this.Ec=x:this.Ec=0,E===void 0&&(E=0),b===void 0&&(b=0),z===void 0&&(z=0),tt===void 0&&(tt=0),a===Ji?(a=z%360,0>a&&(a+=360),this.Ne=a,this.Vh=0,this.Wh=Math.max(E,0),this.Pg=Math.max(b,0),typeof tt=="boolean"?tt&&(this.isLargeArc=!0):typeof tt=="number"&&tt&&(this.isLargeArc=!0),rt&&(this.isClockwiseArc=!0)):(this.Ne=E,this.Vh=b,a===xr&&(z=Math.max(z,0)),this.Wh=z,typeof tt=="number"?(a===xr&&(tt=Math.max(tt,0)),this.Pg=tt):this.Pg=0),this.ae=null}Ri.prototype.copy=function(){var a=new Ri;return a.na=this.na,a.l=this.l&-2,a.Dc=this.Dc,a.Ec=this.Ec,a.Ne=this.Ne,a.Vh=this.Vh,a.Wh=this.Wh,a.Pg=this.Pg,a},wt=Ri.prototype,wt.Xa=function(a){if(!(a instanceof Ri)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case wr:case Qi:return Zt.B(this.endX,a.endX)&&Zt.B(this.endY,a.endY);case ar:return Zt.B(this.endX,a.endX)&&Zt.B(this.endY,a.endY)&&Zt.B(this.point1X,a.point1X)&&Zt.B(this.point1Y,a.point1Y)&&Zt.B(this.point2X,a.point2X)&&Zt.B(this.point2Y,a.point2Y);case so:return Zt.B(this.endX,a.endX)&&Zt.B(this.endY,a.endY)&&Zt.B(this.point1X,a.point1X)&&Zt.B(this.point1Y,a.point1Y);case xr:return Zt.B(this.startAngle,a.startAngle)&&Zt.B(this.sweepAngle,a.sweepAngle)&&Zt.B(this.centerX,a.centerX)&&Zt.B(this.centerY,a.centerY)&&Zt.B(this.radiusX,a.radiusX)&&Zt.B(this.radiusY,a.radiusY);case Ji:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&Zt.B(this.xAxisRotation,a.xAxisRotation)&&Zt.B(this.endX,a.endX)&&Zt.B(this.endY,a.endY)&&Zt.B(this.radiusX,a.radiusX)&&Zt.B(this.radiusY,a.radiusY);default:return!1}},wt.qb=function(a){a.classType===Ri&&(this.type=a)},wt.toString=function(a){switch(a===void 0&&(a=-1),this.type){case wr:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Qi:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case ar:a=0>a?"C"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.point2X.toString()+" "+this.point2Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"C"+this.point1X.toFixed(a)+" "+this.point1Y.toFixed(a)+" "+this.point2X.toFixed(a)+" "+this.point2Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case so:a=0>a?"Q"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"Q"+this.point1X.toFixed(a)+" "+this.point1Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case xr:a=0>a?"B"+this.startAngle.toString()+" "+this.sweepAngle.toString()+" "+this.centerX.toString()+" "+this.centerY.toString()+" "+this.radiusX.toString()+" "+this.radiusY.toString():"B"+this.startAngle.toFixed(a)+" "+this.sweepAngle.toFixed(a)+" "+this.centerX.toFixed(a)+" "+this.centerY.toFixed(a)+" "+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a);break;case Ji:a=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.xAxisRotation.toString()+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toString()+" "+this.endY.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+" "+this.xAxisRotation.toFixed(a)+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;default:a=this.type.toString()}return a+(this.isClosed?"z":"")},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return this._isFrozen=!1,this},wt.close=function(){return this.isClosed=!0,this};function Gi(a,y){if(a.ae!==null&&y._isInvalidBounds===!1)return a.ae;var x=a.radiusX,E=a.radiusY;if(E===void 0&&(E=x),x===0||E===0)return a.ae=[],a.ae;y=a.Ne;var b=a.Vh,z=Zt.jx(0,0,x<E?x:E,a.startAngle,a.startAngle+a.sweepAngle,!1);if(x!==E){var tt=fe.alloc();tt.reset(),x<E?tt.scale(1,E/x):tt.scale(x/E,1),Ye.Ha(z,tt),fe.free(tt)}for(x=z.length,E=0;E<x;E++)tt=z[E],tt[0]+=y,tt[1]+=b,tt[2]+=y,tt[3]+=b,tt[4]+=y,tt[5]+=b,tt[6]+=y,tt[7]+=b;return a.ae=z,a.ae}function kr(a,y,x,E){function b(bt,Wt,jt,Qt){return(bt*Qt<Wt*jt?-1:1)*Math.acos((bt*jt+Wt*Qt)/(Math.sqrt(bt*bt+Wt*Wt)*Math.sqrt(jt*jt+Qt*Qt)))}if(a.ae!==null&&y._isInvalidBounds===!1)return a.ae;if(a.radiusX===0||a.radiusY===0)return a.ae=[],a.ae;y=a.Wh;var z=a.Pg;y===0&&(y=1e-4),z===0&&(z=1e-4);var tt=Math.PI/180*a.Ne,rt=a.isLargeArc,ot=a.isClockwiseArc,lt=a.Dc,ut=a.Ec,ft=Math.cos(tt),yt=Math.sin(tt),xt=ft*(x-lt)/2+yt*(E-ut)/2;tt=-yt*(x-lt)/2+ft*(E-ut)/2;var Ct=xt*xt/(y*y)+tt*tt/(z*z);return 1<Ct&&(y*=Math.sqrt(Ct),z*=Math.sqrt(Ct)),Ct=(rt===ot?-1:1)*Math.sqrt((y*y*z*z-y*y*tt*tt-z*z*xt*xt)/(y*y*tt*tt+z*z*xt*xt)),isNaN(Ct)&&(Ct=0),rt=Ct*y*tt/z,Ct=Ct*-z*xt/y,isNaN(rt)&&(rt=0),isNaN(Ct)&&(Ct=0),x=(x+lt)/2+ft*rt-yt*Ct,E=(E+ut)/2+yt*rt+ft*Ct,ut=b(1,0,(xt-rt)/y,(tt-Ct)/z),ft=(xt-rt)/y,lt=(tt-Ct)/z,xt=(-xt-rt)/y,rt=(-tt-Ct)/z,tt=b(ft,lt,xt,rt),xt=(ft*xt+lt*rt)/(Math.sqrt(ft*ft+lt*lt)*Math.sqrt(xt*xt+rt*rt)),-1>=xt?tt=Math.PI:1<=xt&&(tt=0),!ot&&0<tt&&(tt-=2*Math.PI),ot&&0>tt&&(tt+=2*Math.PI),ot=y>z?1:y/z,xt=y>z?z/y:1,y=Zt.jx(0,0,y>z?y:z,ut,ut+tt,!0),z=fe.alloc(),z.reset(),z.translate(x,E),z.rotate(a.Ne,0,0),z.scale(ot,xt),Ye.Ha(y,z),fe.free(z),a.ae=y,a.ae}ve.Object.defineProperties(Ri.prototype,{_isFrozen:{get:function(){return(this.l&1)!==0},set:function(a){this.l=a?this.l|1:this.l&-2}},_isInvalidBounds:{get:function(){return(this.l&2)!==0},set:function(a){this.l=a?this.l|2:this.l&-3}},isClosed:{get:function(){return(this.l&8)!==0},set:function(a){this.isClosed!==a&&(this.l=a?this.l|8:this.l&-9,this._isInvalidBounds=!0)}},type:{get:function(){return this.na},set:function(a){this._isFrozen&&Ze(this,a),this.na=a,this._isInvalidBounds=!0}},endX:{get:function(){return this.Dc},set:function(a){this._isFrozen&&Ze(this,a),this.Dc=a,this._isInvalidBounds=!0}},endY:{get:function(){return this.Ec},set:function(a){this._isFrozen&&Ze(this,a),this.Ec=a,this._isInvalidBounds=!0}},point1X:{get:function(){return this.Ne},set:function(a){this._isFrozen&&Ze(this,a),this.Ne=a,this._isInvalidBounds=!0}},point1Y:{get:function(){return this.Vh},set:function(a){this._isFrozen&&Ze(this,a),this.Vh=a,this._isInvalidBounds=!0}},point2X:{get:function(){return this.Wh},set:function(a){this._isFrozen&&Ze(this,a),this.Wh=a,this._isInvalidBounds=!0}},point2Y:{get:function(){return this.Pg},set:function(a){this._isFrozen&&Ze(this,a),this.Pg=a,this._isInvalidBounds=!0}},centerX:{get:function(){return this.Ne},set:function(a){this._isFrozen&&Ze(this,a),this.Ne=a,this._isInvalidBounds=!0}},centerY:{get:function(){return this.Vh},set:function(a){this._isFrozen&&Ze(this,a),this.Vh=a,this._isInvalidBounds=!0}},radiusX:{get:function(){return this.Wh},set:function(a){0>a&&wn(a,">= zero",Ri,"radiusX"),this._isFrozen&&Ze(this,a),this.Wh=a,this._isInvalidBounds=!0}},radiusY:{get:function(){return this.Pg},set:function(a){0>a&&wn(a,">= zero",Ri,"radiusY"),this._isFrozen&&Ze(this,a),this.Pg=a,this._isInvalidBounds=!0}},startAngle:{get:function(){return this.Dc},set:function(a){this._isFrozen&&Ze(this,a),a%=360,0>a&&(a+=360),this.Dc=a,this._isInvalidBounds=!0}},sweepAngle:{get:function(){return this.Ec},set:function(a){this._isFrozen&&Ze(this,a),360<a&&(a=360),-360>a&&(a=-360),this.Ec=a,this._isInvalidBounds=!0}},isClockwiseArc:{get:function(){return(this.l&4)!==0},set:function(a){this._isFrozen&&Ze(this,a),this.l=a?this.l|4:this.l&-5,this._isInvalidBounds=!0}},isLargeArc:{get:function(){return(this.l&16)!==0},set:function(a){this._isFrozen&&Ze(this,a),this.l=a?this.l|16:this.l&-17,this._isInvalidBounds=!0}},xAxisRotation:{get:function(){return this.Ne},set:function(a){this._isFrozen&&Ze(this,a),a%=360,0>a&&(a+=360),this.Ne=a,this._isInvalidBounds=!0}}}),Ri.prototype.equalsApprox=Ri.prototype.Xa;var wr=new He(Ri,"Move",0),Qi=new He(Ri,"Line",1),ar=new He(Ri,"Bezier",2),so=new He(Ri,"QuadraticBezier",3),xr=new He(Ri,"Arc",4),Ji=new He(Ri,"SvgArc",4);Ri.className="PathSegment",Ri.Move=wr,Ri.Line=Qi,Ri.Bezier=ar,Ri.QuadraticBezier=so,Ri.Arc=xr,Ri.SvgArc=Ji;function er(){this.H=null,this.xu=new At(0,0).freeze(),this.mt=new At(0,0).freeze(),this.Bp=this.Rq=0,this.Cp=1,this.xq="",this.Wr=this.Tp=!1,this.Rp=this.Ep=0,this.xg=this.nq=this.tq=!1,this.Zp=null,this.Rr=0,this.xd=this.Nr=null}er.prototype.copy=function(){var a=new er;return this.clone(a)},er.prototype.clone=function(a){return a.H=this.H,a.xu.assign(this.viewPoint),a.mt.assign(this.documentPoint),a.Rq=this.Rq,a.Bp=this.Bp,a.Cp=this.Cp,a.xq=this.xq,a.Tp=this.Tp,a.Wr=this.Wr,a.Ep=this.Ep,a.Rp=this.Rp,a.tq=this.tq,a.nq=this.nq,a.xg=this.xg,a.Zp=this.Zp,a.Rr=this.Rr,a.Nr=this.Nr,a.xd=this.xd,a},er.prototype.toString=function(){var a="^";return this.modifiers!==0&&(a+="M:"+this.modifiers),this.button!==0&&(a+="B:"+this.button),this.key!==""&&(a+="K:"+this.key),this.clickCount!==0&&(a+="C:"+this.clickCount),this.delta!==0&&(a+="D:"+this.delta),this.handled&&(a+="h"),this.bubbles&&(a+="b"),this.documentPoint!==null&&(a+="@"+this.documentPoint.toString()),a},er.prototype.So=function(a,y){var x=this.diagram;return x===null||Mg(x,a,y),y},er.prototype.Bz=function(a,y){var x=this.diagram;return x===null||(Mg(x,a,y),y.assign(x.Ps(y))),y},ve.Object.defineProperties(er.prototype,{diagram:{get:function(){return this.H},set:function(a){this.H=a}},viewPoint:{get:function(){return this.xu},set:function(a){this.xu.assign(a)}},documentPoint:{get:function(){return this.mt},set:function(a){this.mt.assign(a)}},modifiers:{get:function(){return this.Rq},set:function(a){this.Rq=a}},button:{get:function(){return this.Bp},set:function(a){if(this.Bp=a,this.event===null)switch(a){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}}},buttons:{get:function(){return this.Cp},set:function(a){this.Cp=a}},key:{get:function(){return this.xq},set:function(a){this.xq=a}},down:{get:function(){return this.Tp},set:function(a){this.Tp=a}},up:{get:function(){return this.Wr},set:function(a){this.Wr=a}},clickCount:{get:function(){return this.Ep},set:function(a){this.Ep=a}},delta:{get:function(){return this.Rp},set:function(a){this.Rp=a}},isMultiTouch:{get:function(){return this.tq},set:function(a){this.tq=a}},handled:{get:function(){return this.nq},set:function(a){this.nq=a}},bubbles:{get:function(){return this.xg},set:function(a){this.xg=a}},event:{get:function(){return this.Zp},set:function(a){this.Zp=a}},isTouchEvent:{get:function(){var a=this.event;return a===null?!1:a.pointerType==="touch"||a.pointerType==="pen"}},timestamp:{get:function(){return this.Rr},set:function(a){this.Rr=a}},targetDiagram:{get:function(){return this.Nr},set:function(a){this.Nr=a}},targetObject:{get:function(){return this.xd},set:function(a){this.xd=a}},control:{get:function(){return(this.modifiers&1)!==0},set:function(a){this.modifiers=a?this.modifiers|1:this.modifiers&-2}},shift:{get:function(){return(this.modifiers&4)!==0},set:function(a){this.modifiers=a?this.modifiers|4:this.modifiers&-5}},alt:{get:function(){return(this.modifiers&2)!==0},set:function(a){this.modifiers=a?this.modifiers|2:this.modifiers&-3}},meta:{get:function(){return(this.modifiers&8)!==0},set:function(a){this.modifiers=a?this.modifiers|8:this.modifiers&-9}},left:{get:function(){var a=this.event;return a===null||a.type!=="mousedown"&&a.type!=="mouseup"&&a.type!=="pointerdown"&&a.type!=="pointerup"?(this.buttons&1)!==0:this.button===0},set:function(a){this.buttons=a?this.buttons|1:this.buttons&-2}},right:{get:function(){var a=this.event;return a===null||a.type!=="mousedown"&&a.type!=="mouseup"&&a.type!=="pointerdown"&&a.type!=="pointerup"?(this.buttons&2)!==0:this.button===2},set:function(a){this.buttons=a?this.buttons|2:this.buttons&-3}},middle:{get:function(){var a=this.event;return a===null||a.type!=="mousedown"&&a.type!=="mouseup"&&a.type!=="pointerdown"&&a.type!=="pointerup"?(this.buttons&4)!==0:this.button===1},set:function(a){this.buttons=a?this.buttons|4:this.buttons&-5}}}),er.prototype.getMultiTouchDocumentPoint=er.prototype.Bz,er.prototype.getMultiTouchViewPoint=er.prototype.So,er.className="InputEvent";function tr(){this.H=null,this.xa="",this.ar=this.Lr=null}tr.prototype.copy=function(){var a=new tr;return a.H=this.H,a.xa=this.xa,a.Lr=this.Lr,a.ar=this.ar,a},tr.prototype.toString=function(){var a="*"+this.name;return this.subject!==null&&(a+=":"+this.subject.toString()),this.parameter!==null&&(a+="("+this.parameter.toString()+")"),a},ve.Object.defineProperties(tr.prototype,{diagram:{get:function(){return this.H},set:function(a){this.H=a}},name:{get:function(){return this.xa},set:function(a){this.xa=a}},subject:{get:function(){return this.Lr},set:function(a){this.Lr=a}},parameter:{get:function(){return this.ar},set:function(a){this.ar=a}}}),tr.className="DiagramEvent";function bi(){this.Fm=Ir,this.rf=this.Qq="",this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null}bi.prototype.clear=function(){this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null},bi.prototype.copy=function(){var a=new bi;a.Fm=this.Fm,a.Qq=this.Qq,a.rf=this.rf,a.cc=this.cc,a.H=this.H,a.Qn=this.Qn;var y=this.Sn;return a.Sn=We(y)&&typeof y.J=="function"?y.J():y,y=this.Rn,a.Rn=We(y)&&typeof y.J=="function"?y.J():y,y=this.Mn,a.Mn=We(y)&&typeof y.J=="function"?y.J():y,y=this.Ln,a.Ln=We(y)&&typeof y.J=="function"?y.J():y,a},bi.prototype.qb=function(a){a.classType===bi&&(this.change=a)},bi.prototype.toString=function(){var a="";return a=this.change===ho?a+"* ":this.change===Ir?a+(this.model!==null?"!m":"!d"):a+((this.model!==null?"!m":"!d")+this.change),this.propertyName&&typeof this.propertyName=="string"&&(a+=" "+this.propertyName),this.modelChange&&this.modelChange!==this.propertyName&&(a+=" "+this.modelChange),a+=": ",this.change===ho?this.oldValue!==null&&(a+=" "+this.oldValue):(this.object!==null&&(a+=Bi(this.object)),this.oldValue!==null&&(a+=" old: "+Bi(this.oldValue)),this.oldParam!==null&&(a+=" "+this.oldParam),this.newValue!==null&&(a+=" new: "+Bi(this.newValue)),this.newParam!==null&&(a+=" "+this.newParam)),a},bi.prototype.I=function(a){return a?this.oldValue:this.newValue},bi.prototype.Dz=function(a){return a?this.oldParam:this.newParam},bi.prototype.canUndo=function(){return this.model!==null||this.diagram!==null},bi.prototype.undo=function(){this.canUndo()&&(this.model!==null?this.model.changeState(this,!0):this.diagram!==null&&this.diagram.changeState(this,!0))},bi.prototype.canRedo=function(){return this.model!==null||this.diagram!==null},bi.prototype.redo=function(){this.canRedo()&&(this.model!==null?this.model.changeState(this,!1):this.diagram!==null&&this.diagram.changeState(this,!1))},ve.Object.defineProperties(bi.prototype,{model:{get:function(){return this.cc},set:function(a){this.cc=a}},diagram:{get:function(){return this.H},set:function(a){this.H=a}},change:{get:function(){return this.Fm},set:function(a){this.Fm=a}},modelChange:{get:function(){return this.Qq},set:function(a){this.Qq=a}},propertyName:{get:function(){return this.rf},set:function(a){this.rf=a}},isTransactionFinished:{get:function(){return this.Fm===ho&&(this.rf==="CommittedTransaction"||this.rf==="FinishedUndo"||this.rf==="FinishedRedo")}},object:{get:function(){return this.Qn},set:function(a){this.Qn=a}},oldValue:{get:function(){return this.Sn},set:function(a){this.Sn=a}},oldParam:{get:function(){return this.Rn},set:function(a){this.Rn=a}},newValue:{get:function(){return this.Mn},set:function(a){this.Mn=a}},newParam:{get:function(){return this.Ln},set:function(a){this.Ln=a}}}),bi.prototype.redo=bi.prototype.redo,bi.prototype.canRedo=bi.prototype.canRedo,bi.prototype.undo=bi.prototype.undo,bi.prototype.canUndo=bi.prototype.canUndo,bi.prototype.getParam=bi.prototype.Dz,bi.prototype.getValue=bi.prototype.I,bi.prototype.clear=bi.prototype.clear;var ho=new He(bi,"Transaction",-1),Ir=new He(bi,"Property",0),fo=new He(bi,"Insert",1),Mo=new He(bi,"Remove",2);bi.className="ChangedEvent",bi.Transaction=ho,bi.Property=Ir,bi.Insert=fo,bi.Remove=Mo;function dr(){this.o=new fn().freeze(),this.xa="",this.j=!1}dr.prototype.toString=function(a){var y="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(a!==void 0&&0<a){a=this.changes.count;for(var x=0;x<a;x++){var E=this.changes.M(x);E!==null&&(y+=`
`+E.toString())}}return y},dr.prototype.clear=function(){var a=this.changes;a.ka();for(var y=a.count-1;0<=y;y--){var x=a.M(y);x!==null&&x.clear()}a.clear(),a.freeze()},dr.prototype.canUndo=function(){return this.isComplete},dr.prototype.undo=function(){if(this.canUndo())for(var a=this.changes.count-1;0<=a;a--){var y=this.changes.M(a);y!==null&&y.undo()}},dr.prototype.canRedo=function(){return this.isComplete},dr.prototype.redo=function(){if(this.canRedo())for(var a=this.changes.count,y=0;y<a;y++){var x=this.changes.M(y);x!==null&&x.redo()}},dr.prototype.ak=function(){if(this.isComplete){var a=this.changes;a.ka();for(var y=new Ie,x=0;x<a.count;x++){var E=a.M(x);if(E!==null&&E.change===Ir&&E.object){var b=y.get(E.object);b||(b=new Ie,y.set(E.object,b));var z=b.get(E.propertyName);z===null?b.set(E.propertyName,-1):(0<z&&a.cd(z,null),b.set(E.propertyName,x))}}for(x=y=0;x<a.count;x++)E=a.M(x),E!==null&&(x>y&&a.cd(y,E),y++);for(;a.length>y;)a.pop();a.freeze()}},ve.Object.defineProperties(dr.prototype,{changes:{get:function(){return this.o}},name:{get:function(){return this.xa},set:function(a){this.xa=a}},isComplete:{get:function(){return this.j},set:function(a){this.j=a}}}),dr.prototype.optimize=dr.prototype.ak,dr.prototype.redo=dr.prototype.redo,dr.prototype.canRedo=dr.prototype.canRedo,dr.prototype.undo=dr.prototype.undo,dr.prototype.canUndo=dr.prototype.canUndo,dr.prototype.clear=dr.prototype.clear,dr.className="Transaction";function po(){this.Pt=new pn,this.Jd=!1,this.u=new fn().freeze(),this.Ce=-1,this.o=999,this.Fe=!1,this.Np=null,this.bi=0,this.j=!1,this.Ie=new fn().freeze(),this.hl=new fn,this.tt=!0,this.Dt=this.rq=this.Gt=this.Ft=!1}po.prototype.toString=function(a){var y="UndoManager "+this.historyIndex+"<"+this.history.count+"<="+this.maxHistoryLength;y+="[";for(var x=this.nestedTransactionNames.count,E=0;E<x;E++)0<E&&(y+=" "),y+=this.nestedTransactionNames.M(E);if(y+="]",a!==void 0&&0<a)for(x=this.history.count,E=0;E<x;E++)y+=`
`+this.history.M(E).toString(a-1);return y},po.prototype.clear=function(){var a=this.history;a.ka();for(var y=a.count-1;0<=y;y--){var x=a.M(y);x!==null&&x.clear()}a.clear(),this.Ce=-1,a.freeze(),this.Fe=!1,this.Np=null,this.bi=0,this.Ie.ka(),this.Ie.clear(),this.Ie.freeze(),this.hl.clear(),this.Dt=this.rq=this.Gt=this.Ft=!1},po.prototype.copyProperties=function(a){this.isEnabled=a.isEnabled,this.maxHistoryLength=a.maxHistoryLength,this.checksTransactionLevel=a.checksTransactionLevel},wt=po.prototype,wt.Xw=function(a){this.Pt.add(a)},wt.Rx=function(a){this.Pt.remove(a)},wt.Ea=function(a){if(a===void 0&&(a=""),a===null&&(a=""),this.isUndoingRedoing)return!1;this.tt===!0&&(this.tt=!1,this.bi++,this.isInternalTransaction||this.Ob("StartingFirstTransaction",a,this.currentTransaction),0<this.bi&&this.bi--),this.isEnabled&&(this.Ie.ka(),this.Ie.add(a),this.Ie.freeze(),this.currentTransaction===null?this.hl.add(0):this.hl.add(this.currentTransaction.changes.count)),this.bi++;var y=this.transactionLevel===1;return y&&(this.isInternalTransaction||this.Ob("StartedTransaction",a,this.currentTransaction)),y},wt.eb=function(a){return a===void 0&&(a=""),Za(this,!0,a)},wt.Kf=function(){return Za(this,!1,"")};function Za(a,y,x){if(a.isUndoingRedoing)return!1;a.checksTransactionLevel&&1>a.transactionLevel&&ri("Ending transaction without having started a transaction: "+x);var E=a.transactionLevel===1,b=a.currentTransaction;E&&y&&(a.isInternalTransaction||a.Ob("CommittingTransaction",x,b));var z=0;if(0<a.transactionLevel&&(a.bi--,a.isEnabled)){var tt=a.Ie.count;0<tt&&(x===""&&(x=a.Ie.M(0)),a.Ie.ka(),a.Ie.mb(tt-1),a.Ie.freeze()),tt=a.hl.count,0<tt&&(z=a.hl.M(tt-1),a.hl.mb(tt-1))}if(E){if(y)a.rq=!1,b===null&&x!==""&&(b=a.currentTransaction),a.isEnabled&&b!==null&&(b.isComplete||(b.isComplete=!0,b.name=x),a.lx(),y=a.history,y.ka(),E=a.maxHistoryLength,0<=E&&(E===0?y.clear():y.count>=E&&(z=y.M(0),z!==null&&z.clear(),y.mb(0),a.Ce--)),E===0||y.count!==0&&y.get(y.count-1)===b||(y.add(b),a.Ce++),y.freeze()),a.isInternalTransaction||a.Ob("CommittedTransaction",x,b);else{a.Fe=!0;try{a.isEnabled&&b!==null&&(b.isComplete=!0,b.undo())}finally{a.isInternalTransaction||a.Ob("RolledBackTransaction",x,b),a.Fe=!1}b!==null&&b.clear()}return a.Np=null,a.isPendingClear&&a.clear(),a.isPendingClear=!1,a.isPendingUnmodified=!1,!0}if(a.isEnabled&&!y&&b!==null){for(a=z,x=b.changes,b=x.count-1;b>=a;b--)y=x.M(b),y!==null&&y.undo(),x.ka(),x.mb(b);x.freeze()}return!1}wt.lx=function(){if(!this.isUndoingRedoing&&this.canRedo()){var a=this.history;a.ka();for(var y=a.count-1;y>this.historyIndex;y--){var x=a.M(y);x!==null&&x.clear(),a.mb(y),this.rq=!0}a.freeze()}},po.prototype.canUndo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToUndo;return!!(a!==null&&a.canUndo())},po.prototype.undo=function(){if(this.canUndo()){var a=this.transactionToUndo;try{this.Fe=!0,this.Ob("StartingUndo","Undo",a),this.Ce--,a.undo()}catch(y){ri("undo error: "+y.toString())}finally{this.Ob("FinishedUndo","Undo",a),this.Fe=!1}}},po.prototype.canRedo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToRedo;return!!(a!==null&&a.canRedo())},po.prototype.redo=function(){if(this.canRedo()){var a=this.transactionToRedo;try{this.Fe=!0,this.Ob("StartingRedo","Redo",a),this.Ce++,a.redo()}catch(y){ri("redo error: "+y.toString())}finally{this.Ob("FinishedRedo","Redo",a),this.Fe=!1}}},po.prototype.Ob=function(a,y,x){x===void 0&&(x=null);var E=new bi;for(E.change=ho,E.propertyName=a,E.object=x,E.oldValue=y,a=this.models;a.next();)y=a.value,E.model=y,y.ds(E)},po.prototype.Tu=function(a){if(this.isEnabled&&!this.isUndoingRedoing&&!this.skipsEvent(a)){var y=this.currentTransaction;y===null&&(this.Np=y=new dr);var x=a.copy();y=y.changes,y.ka(),y.add(x),y.freeze(),this.checksTransactionLevel&&0>=this.transactionLevel&&!this.tt&&(a=a.diagram,a!==null&&a.pi===!1||ri("Change not within a transaction: "+x.toString()))}},po.prototype.skipsEvent=function(a){if(a===null||0>a.change.value)return!0;if(a=a.object,a===null)return!1;if(a.layer!==void 0){if(a=a.layer,a!==null&&a.isTemporary)return!0}else if(a.isTemporary)return!0;return!1},ve.Object.defineProperties(po.prototype,{models:{get:function(){return this.Pt.iterator}},isEnabled:{get:function(){return this.Jd},set:function(a){this.Jd=a}},transactionToUndo:{get:function(){return 0<=this.historyIndex&&this.historyIndex<=this.history.count-1?this.history.M(this.historyIndex):null}},transactionToRedo:{get:function(){return this.historyIndex<this.history.count-1?this.history.M(this.historyIndex+1):null}},isUndoingRedoing:{get:function(){return this.Fe}},history:{get:function(){return this.u}},maxHistoryLength:{get:function(){return this.o},set:function(a){this.o=a}},historyIndex:{get:function(){return this.Ce}},currentTransaction:{get:function(){return this.Np}},transactionLevel:{get:function(){return this.bi}},isInTransaction:{get:function(){return 0<this.bi}},checksTransactionLevel:{get:function(){return this.j},set:function(a){this.j=a}},nestedTransactionNames:{get:function(){return this.Ie}},isPendingClear:{get:function(){return this.Ft},set:function(a){this.Ft=a}},isPendingUnmodified:{get:function(){return this.Gt},set:function(a){this.Gt=a}},isInternalTransaction:{get:function(){return this.Dt},set:function(a){this.Dt=a}},isJustDiscarded:{get:function(){return this.rq}}}),po.prototype.handleChanged=po.prototype.Tu,po.prototype.redo=po.prototype.redo,po.prototype.undo=po.prototype.undo,po.prototype.canUndo=po.prototype.canUndo,po.prototype.discardHistoryAfterIndex=po.prototype.lx,po.prototype.rollbackTransaction=po.prototype.Kf,po.prototype.commitTransaction=po.prototype.eb,po.prototype.startTransaction=po.prototype.Ea,po.prototype.removeModel=po.prototype.Rx,po.prototype.addModel=po.prototype.Xw,po.prototype.clear=po.prototype.clear,po.className="UndoManager";function zi(){Di(this),this.H=ju,this.xa="",this.Jd=!0,this.nb=!1,this.wm=null,this.yy=new er,this.Zr=-1}zi.prototype.toString=function(){return this.name!==""?this.name+" Tool":hi(this.constructor)},zi.prototype.updateAdornments=function(){},zi.prototype.canStart=function(){return this.isEnabled},zi.prototype.doStart=function(){},zi.prototype.doActivate=function(){this.isActive=!0},zi.prototype.doDeactivate=function(){this.isActive=!1},zi.prototype.doStop=function(){},zi.prototype.doCancel=function(){this.transactionResult=null,this.stopTool()},zi.prototype.stopTool=function(){var a=this.diagram;a.currentTool===this&&(a.currentTool=null,a.currentCursor="")},zi.prototype.doMouseDown=function(){!this.isActive&&this.canStart()&&this.doActivate()},zi.prototype.doMouseMove=function(){},zi.prototype.doMouseUp=function(){this.stopTool()},zi.prototype.doMouseWheel=function(){},zi.prototype.canStartMultiTouch=function(){return!0},zi.prototype.standardPinchZoomStart=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,At.allocAt(NaN,NaN)),E=y.So(1,At.allocAt(NaN,NaN));if(x.w()&&E.w()&&(this.doCancel(),a.Ql("hasGestureZoom"))){a.Bw=a.scale;var b=E.x-x.x,z=E.y-x.y;a.Jw=Math.sqrt(b*b+z*z),y.bubbles=!1}At.free(x),At.free(E)},zi.prototype.standardPinchZoomMove=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,At.allocAt(NaN,NaN)),E=y.So(1,At.allocAt(NaN,NaN));if(x.w()&&E.w()&&(this.doCancel(),a.Ql("hasGestureZoom"))){var b=E.x-x.x,z=E.y-x.y;z=Math.sqrt(b*b+z*z)/a.Jw,b=new At((Math.min(E.x,x.x)+Math.max(E.x,x.x))/2,(Math.min(E.y,x.y)+Math.max(E.y,x.y))/2),z*=a.Bw;var tt=a.commandHandler;if(z!==a.scale&&tt.canResetZoom(z)){var rt=a.zoomPoint;a.zoomPoint=b,tt.resetZoom(z),a.zoomPoint=rt}y.bubbles=!1}At.free(x),At.free(E)},zi.prototype.doKeyDown=function(){this.diagram.lastInput.key==="Esc"&&this.doCancel()},zi.prototype.doKeyUp=function(){},zi.prototype.Ea=function(a){return a===void 0&&(a=this.name),this.transactionResult=null,this.diagram.Ea(a)},zi.prototype.stopTransaction=function(){var a=this.diagram;return this.transactionResult===null?a.Kf():a.eb(this.transactionResult)},zi.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var y=a.lastInput,x=a.Ol(y.documentPoint,!1);if(x!==null){if(vr?y.meta:y.control){for(a.R("ChangingSelection",a.selection),y=x;y!==null&&!y.canSelect();)y=y.containingGroup;y!==null&&(y.isSelected=!y.isSelected),a.R("ChangedSelection",a.selection)}else if(y.shift){if(!x.isSelected){for(a.R("ChangingSelection",a.selection),y=x;y!==null&&!y.canSelect();)y=y.containingGroup;y!==null&&(y.isSelected=!0),a.R("ChangedSelection",a.selection)}}else if(!x.isSelected){for(y=x;y!==null&&!y.canSelect();)y=y.containingGroup;y!==null&&a.select(y)}}else!y.left||(vr?y.meta:y.control)||y.shift||a.clearSelection()}},zi.prototype.standardMouseClick=function(a,y){a===void 0&&(a=null),y===void 0&&(y=function(b){return!b.layer.isTemporary});var x=this.diagram,E=x.lastInput;return a=x.ic(E.documentPoint,a,y),E.targetObject=a,ta(a,E,x),E.handled};function ta(a,y,x){if(y.handled=!1,a===null||a.If()){var E=0;y.left?E=y.clickCount===1?1:y.clickCount===2?2:1:y.right&&y.clickCount===1&&(E=3);var b="ObjectSingleClicked";if(a!==null){switch(E){case 1:b="ObjectSingleClicked";break;case 2:b="ObjectDoubleClicked";break;case 3:b="ObjectContextClicked"}E!==0&&x.R(b,a)}else{switch(E){case 1:b="BackgroundSingleClicked";break;case 2:b="BackgroundDoubleClicked";break;case 3:b="BackgroundContextClicked"}E!==0&&x.R(b)}if(a!==null)for(;a!==null;){switch(x=null,E){case 1:x=a.click;break;case 2:x=a.doubleClick?a.doubleClick:a.click;break;case 3:x=a.contextClick}if(x!==null&&(x(y,a),y.handled))break;a=a.panel}else{switch(a=null,E){case 1:a=x.click;break;case 2:a=x.doubleClick?x.doubleClick:x.click;break;case 3:a=x.contextClick}a!==null&&a(y)}}}zi.prototype.standardMouseOver=function(){var a=this.diagram,y=a.lastInput;if(a.animationManager.zb!==!0){var x=a.skipsUndoManager;a.skipsUndoManager=!0;var E=a.viewportBounds.ca(y.documentPoint)?a.ic(y.documentPoint,null,null):null;!y.event||y.event.type!=="pointercancel"&&y.event.type!=="pointerout"||(E=null),y.targetObject=E;var b=!1;if(E!==a.Ck){var z=a.Ck,tt=z;for(a.Ck=E,this.doCurrentObjectChanged(z,E),y.handled=!1;z!==null;){var rt=z.mouseLeave;if(rt!==null&&(E===z||E!==null&&E.rg(z)||(rt(y,z,E),b=!0,y.handled)))break;z=z.panel}for(z=tt,y.handled=!1;E!==null&&(tt=E.mouseEnter,!(tt!==null&&(z===E||z!==null&&z.rg(E)||(tt(y,E,z),b=!0,y.handled))));)E=E.panel;E=a.Ck}if(E!==null){for(z=E,tt="";z!==null&&(tt=z.cursor,tt==="");)z=z.panel;for(a.currentCursor=tt,y.handled=!1,z=E;z!==null&&(E=z.mouseOver,!(E!==null&&(E(y,z),b=!0,y.handled)));)z=z.panel}else this.doUpdateCursor(null),E=a.mouseOver,E!==null&&(E(y),b=!0);b&&a.$b(),a.skipsUndoManager=x}},zi.prototype.doUpdateCursor=function(){var a=this.diagram;a&&(a.currentCursor="")},zi.prototype.doCurrentObjectChanged=function(){},zi.prototype.standardMouseWheel=function(){var a=this.diagram,y=a.lastInput,x=y.delta;if(x!==0&&a.documentBounds.w()){var E=a.commandHandler,b=a.toolManager.mouseWheelBehavior;if(E!==null&&(b===cl&&!y.shift||b===Aa&&y.control))(0<x?E.canIncreaseZoom():E.canDecreaseZoom())&&(b=a.zoomPoint,a.zoomPoint=y.viewPoint,0<x?E.increaseZoom():E.decreaseZoom(),a.zoomPoint=b),y.bubbles=!1;else if(b===cl&&y.shift||b===Aa&&!y.control){E=a.position.copy();var z=y.event;b=z.deltaMode;var tt=z.deltaX;z=z.deltaY;var rt="pixel";if(tt===0&&z===0||y.shift)!y.shift&&a.allowVerticalScroll?(x=3*x*a.scrollVerticalLineChange,a.scroll(rt,0<x?"up":"down",Math.abs(x))):y.shift&&a.allowHorizontalScroll&&(x=3*x*a.scrollHorizontalLineChange,a.scroll(rt,0<x?"left":"right",Math.abs(x)));else{switch(b){case 0:rt="pixel";break;case 1:rt="line";break;case 2:rt="page"}tt!==0&&a.allowHorizontalScroll&&(tt*=a.scrollHorizontalLineChange/16,a.scroll(rt,0<tt?"right":"left",Math.abs(tt))),z!==0&&a.allowVerticalScroll&&(z*=a.scrollVerticalLineChange/16,a.scroll(rt,0<z?"down":"up",Math.abs(z)))}this.doWheelChange(a,E,y)}}},zi.prototype.doWheelChange=function(a,y,x){a.position.D(y)&&x.event.wheelDeltaX===0||(x.bubbles=!1)},zi.prototype.standardWaitAfter=function(a,y){y===void 0&&(y=this.diagram.lastInput),this.cancelWaitAfter();var x=this,E=y.clone(this.yy);this.Zr=Pe(function(){x.doWaitAfter(E)},a)},zi.prototype.cancelWaitAfter=function(){this.Zr!==-1&&$e.clearTimeout(this.Zr),this.Zr=-1},zi.prototype.doWaitAfter=function(){},zi.prototype.findToolHandleAt=function(a,y){return a=this.diagram.ic(a,function(x){for(;x!==null&&!(x.panel instanceof Yr);)x=x.panel;return x}),a===null?null:a.part.category===y?a:null},zi.prototype.isBeyondDragSize=function(a,y){var x=this.diagram;a===void 0&&(a=x.firstInput.viewPoint),y===void 0&&(y=x.lastInput.viewPoint);var E=x.toolManager.dragSize,b=E.width;return E=E.height,x.firstInput.isTouchEvent&&(b+=6,E+=6),Math.abs(y.x-a.x)>b||Math.abs(y.y-a.y)>E},ve.Object.defineProperties(zi.prototype,{diagram:{get:function(){return this.H},set:function(a){a instanceof be&&(this.H=a)}},name:{get:function(){return this.xa},set:function(a){this.xa=a}},isEnabled:{get:function(){return this.Jd},set:function(a){this.Jd=a}},isActive:{get:function(){return this.nb},set:function(a){this.nb=a}},transactionResult:{get:function(){return this.wm},set:function(a){this.wm=a}}}),zi.prototype.startTransaction=zi.prototype.Ea,zi.className="Tool";function Nr(){zi.call(this),this.name="ToolManager",this.hb=new fn,this.ob=new fn,this.Hb=new fn,this.F=this.V=850,this.o=new ln(2,2).ja(),this.Ha=5e3,this.ia=Aa,this.u=uu,this.Mp=this.j=null,this.zj=-1}Se(Nr,zi),Nr.prototype.initializeStandardTools=function(){},Nr.prototype.updateAdornments=function(a){var y=this.currentToolTip;if(y instanceof Yr&&this.Mp===a){var x=y.adornedObject;(a!==null?x.part===a:x===null)?this.showToolTip(y,x):this.hideToolTip()}},Nr.prototype.doMouseDown=function(){var a=this.diagram,y=a.lastInput;if(y.isTouchEvent&&this.gestureBehavior===zs&&(y.bubbles=!1),y.isMultiTouch){if(this.cancelWaitAfter(),this.gestureBehavior===Ml){y.bubbles=!0;return}if(this.gestureBehavior===zs)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomStart();return}}for(var x=this.mouseDownTools.length,E=0;E<x;E++){var b=this.mouseDownTools.M(E);if(b.diagram=this.diagram,b.canStart()){a.doFocus(),a.currentTool=b,a.currentTool===b&&(b.isActive||b.doActivate(),b.doMouseDown());return}}a.lastInput.button===1&&(this.mouseWheelBehavior===Aa?this.mouseWheelBehavior=cl:this.mouseWheelBehavior===cl&&(this.mouseWheelBehavior=Aa)),this.doActivate(),this.standardWaitAfter(this.holdDelay,y)},Nr.prototype.doMouseMove=function(){var a=this.diagram,y=a.lastInput;if(y.isMultiTouch){if(this.gestureBehavior===Ml){y.bubbles=!0;return}if(this.gestureBehavior===zs)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomMove();return}}if(this.isActive)for(var x=this.mouseMoveTools.length,E=0;E<x;E++){var b=this.mouseMoveTools.M(E);if(b.diagram=this.diagram,b.canStart()){a.doFocus(),a.currentTool=b,a.currentTool===b&&(b.isActive||b.doActivate(),b.doMouseMove());return}}ra(this,a),a=y.event,a===null||a.type!=="pointermove"&&a.cancelable||(y.bubbles=!0)};function ra(a,y){a.standardMouseOver(),a.isBeyondDragSize()&&a.standardWaitAfter(a.isActive?a.holdDelay:a.hoverDelay,y.lastInput)}Nr.prototype.doCurrentObjectChanged=function(a,y){a=this.currentToolTip,a===null||y!==null&&a instanceof Yr&&(y===a||y.rg(a))||this.hideToolTip()},Nr.prototype.doWaitAfter=function(a){var y=this.diagram;y.ta!==null&&(this.doMouseHover(),this.isActive||this.doToolTip(),a.isTouchEvent&&!y.lastInput.handled&&(a=a.copy(),a.button=2,a.buttons=2,y.lastInput=a,y.qu=!0,y.doMouseUp()))},Nr.prototype.doMouseHover=function(){var a=this.diagram,y=a.lastInput;y.targetObject===null&&(y.targetObject=a.ic(y.documentPoint,null,null));var x=y.targetObject;if(x!==null)for(y.handled=!1;x!==null&&(a=this.isActive?x.mouseHold:x.mouseHover,!(a!==null&&(a(y,x),y.handled)));)x=x.panel;else x=this.isActive?a.mouseHold:a.mouseHover,x!==null&&x(y)},Nr.prototype.doToolTip=function(){var a=this.diagram,y=a.lastInput;if(y.targetObject===null&&(y.targetObject=a.ic(y.documentPoint,null,null)),y=y.targetObject,y!==null){if(a=this.currentToolTip,!(a instanceof Yr)||y!==a&&!y.rg(a)){for(;y!==null;){if(a=y.toolTip,a!==null){this.showToolTip(a,y);return}y=y.panel}this.hideToolTip()}}else y=a.toolTip,y!==null?this.showToolTip(y,null):this.hideToolTip()},Nr.prototype.showToolTip=function(a,y){var x=this.diagram;if(a!==this.currentToolTip&&this.hideToolTip(),a instanceof Yr){a.layerName="Tool",a.selectable=!1,a.scale=1/x.scale,a.category="ToolTip",a.placeholder!==null&&(a.placeholder.scale=x.scale);var E=a.diagram;E!==null&&E!==x&&E.remove(a),x.add(a),y!==null?a.adornedObject=y:a.data=x.model,a.Va(),this.positionToolTip(a,y)}else a instanceof Eu&&a!==this.currentToolTip&&a.show(y,x,this);if(this.currentToolTip=a,this.zj!==-1&&($e.clearTimeout(this.zj),this.zj=-1),a=this.toolTipDuration,0<a&&a!==1/0){var b=this;this.zj=Pe(function(){b.hideToolTip()},a)}},Nr.prototype.positionToolTip=function(a){if(a.placeholder===null){var y=this.diagram,x=y.lastInput.documentPoint.copy(),E=a.measuredBounds,b=y.viewportBounds;y.lastInput.isTouchEvent&&(x.x-=E.width),x.x+E.width>b.right&&(x.x-=E.width+5/y.scale),x.x<b.x&&(x.x=b.x),x.y=x.y+20/y.scale+E.height>b.bottom?x.y-(E.height+5/y.scale):x.y+20/y.scale,x.y<b.y&&(x.y=b.y),a.position=x}},Nr.prototype.hideToolTip=function(){this.zj!==-1&&($e.clearTimeout(this.zj),this.zj=-1);var a=this.diagram,y=this.currentToolTip;y!==null&&(y instanceof Yr?(a.remove(y),this.Mp!==null&&this.Mp.Jf(y.category),y.data=null,y.adornedObject=null):y instanceof Eu&&y.hide!==null&&y.hide(a,this),this.currentToolTip=null)},Nr.prototype.doMouseUp=function(){this.cancelWaitAfter();var a=this.diagram;if(this.isActive)for(var y=this.mouseUpTools.length,x=0;x<y;x++){var E=this.mouseUpTools.M(x);if(E.diagram=this.diagram,E.canStart()){a.doFocus(),a.currentTool=E,a.currentTool===E&&(E.isActive||E.doActivate(),E.doMouseUp());return}}a.doFocus(),this.doDeactivate()},Nr.prototype.doMouseWheel=function(){this.standardMouseWheel()},Nr.prototype.doKeyDown=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyDown()},Nr.prototype.doKeyUp=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyUp()},Nr.prototype.findTool=function(a){for(var y=this.mouseDownTools.length,x=0;x<y;x++){var E=this.mouseDownTools.M(x);if(E.name===a)return E}for(y=this.mouseMoveTools.length,x=0;x<y;x++)if(E=this.mouseMoveTools.M(x),E.name===a)return E;for(y=this.mouseUpTools.length,x=0;x<y;x++)if(E=this.mouseUpTools.M(x),E.name===a)return E;return null},Nr.prototype.replaceTool=function(a,y){y!==null&&(y.diagram=this.diagram);for(var x=this.mouseDownTools.length,E=0;E<x;E++){var b=this.mouseDownTools.M(E);if(b.name===a)return y!==null?this.mouseDownTools.cd(E,y):this.mouseDownTools.mb(E),b}for(x=this.mouseMoveTools.length,E=0;E<x;E++)if(b=this.mouseMoveTools.M(E),b.name===a)return y!==null?this.mouseMoveTools.cd(E,y):this.mouseMoveTools.mb(E),b;for(x=this.mouseUpTools.length,E=0;E<x;E++)if(b=this.mouseUpTools.M(E),b.name===a)return y!==null?this.mouseUpTools.cd(E,y):this.mouseUpTools.mb(E),b;return null},Nr.prototype.gb=function(a,y,x){y!==null&&(y.name=a,y.diagram=this.diagram),this.findTool(a)?this.replaceTool(a,y):y!==null&&x.add(y)},ve.Object.defineProperties(Nr.prototype,{mouseWheelBehavior:{get:function(){return this.ia},set:function(a){this.ia=a}},gestureBehavior:{get:function(){return this.u},set:function(a){this.u=a}},currentToolTip:{get:function(){return this.j},set:function(a){this.j=a,this.Mp=a!==null&&a instanceof Yr?a.adornedPart:null}},mouseDownTools:{get:function(){return this.hb}},mouseMoveTools:{get:function(){return this.ob}},mouseUpTools:{get:function(){return this.Hb}},hoverDelay:{get:function(){return this.V},set:function(a){this.V=a}},holdDelay:{get:function(){return this.F},set:function(a){this.F=a}},dragSize:{get:function(){return this.o},set:function(a){this.o=a.J()}},toolTipDuration:{get:function(){return this.Ha},set:function(a){this.Ha=a}}}),Nr.prototype.replaceStandardTool=Nr.prototype.gb;var Aa=new He(Nr,"WheelScroll",0),cl=new He(Nr,"WheelZoom",1),lu=new He(Nr,"WheelNone",2),uu=new He(Nr,"GestureZoom",3),zs=new He(Nr,"GestureCancel",4),Ml=new He(Nr,"GestureNone",5);Nr.className="ToolManager",Nr.WheelScroll=Aa,Nr.WheelZoom=cl,Nr.WheelNone=lu,Nr.GestureZoom=uu,Nr.GestureCancel=zs,Nr.GestureNone=Ml;function Ro(){zi.call(this),this.name="Dragging",this.u=this.Sw=this.ob=!0,this.o=this.Ha=this.V=this.Oe=null,this.Ym=this.Hb=!1,this.tl=new At(NaN,NaN),this.Fr=new At,this.hb=!0,this.Ik=100,this.Cg=[],this.te=new pn().freeze(),this.ia=new at,this.Bn=null,this.F="copy",this.Oc="",this.Pc="no-drop"}var ds;Se(Ro,zi),Ro.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a.isReadOnly&&!a.allowDragOut||!a.allowMove&&!a.allowCopy&&!a.allowDragOut||!a.allowSelect)return!1;var y=a.lastInput;return!y.left||a.currentTool!==this&&(!this.isBeyondDragSize()||y.isTouchEvent&&y.timestamp-a.firstInput.timestamp<this.Ik)?!1:this.findDraggablePart()!==null},Ro.prototype.findDraggablePart=function(){var a=this.diagram;if(a=a.Ol(a.firstInput.documentPoint,!1),a===null)return null;for(;a!==null&&!a.canSelect();)a=a.containingGroup;return a!==null&&(a.canMove()||a.canCopy())?a:null},Ro.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var y=a.Ol(a.firstInput.documentPoint,!1);if(y!==null){for(;y!==null&&!y.canSelect();)y=y.containingGroup;this.currentPart=y,this.currentPart===null||this.currentPart.isSelected||(a.R("ChangingSelection",a.selection),y=a.lastInput,(vr?y.meta:y.control)||y.shift||a.clearSelection(!0),this.currentPart.isSelected=!0,a.R("ChangedSelection",a.selection))}}},Ro.prototype.doActivate=function(){var a=this.diagram;this.Bn=null,this.currentPart===null&&this.standardMouseSelect();var y=this.currentPart;y!==null&&(y.canMove()||y.canCopy())&&(a.Fu(!0),lo=null,this.isActive=!0,this.tl.set(a.position),hu(this,a.selection),this.Cg.length=0,a.animationManager.Cc(),this.draggedParts=this.computeEffectiveCollection(a.selection,this.dragOptions),this.Sw=this.diagram.layout.isRealtime,this.diagram.layout.isRealtime=!1,a.Ns=!0,a.Gf("temporaryPixelRatio")===!0&&30<a.$w&&As(a),xf(a,this.draggedParts),this.Ea("Drag"),this.startPoint=a.firstInput.documentPoint,a.isMouseCaptured=!0,a.allowDragOut&&(this.isDragOutStarted=!0,this.Ym=!1,lo=this,ea=this.diagram,this.doSimulatedDragOut()))};function hu(a,y){if(a.dragsLink){var x=a.diagram;x.allowRelink&&(x.model.Wj()&&y.count===1&&y.first()instanceof Tn?(a.draggedLink=y.first(),a.draggedLink.canRelinkFrom()&&a.draggedLink.canRelinkTo()&&a.draggedLink.Ej(),a.Oe=x.toolManager.findTool("Relinking"),a.Oe===null&&(a.Oe=new Ua,a.Oe.diagram=x),a.Oe.originalLink=a.draggedLink):(a.draggedLink=null,a.Oe=null))}}Ro.prototype.computeEffectiveCollection=function(a,y){return this.diagram.commandHandler.computeEffectiveCollection(a,y)},Ro.prototype.Pd=function(a){return a===void 0?new lh(Un):this.isGridSnapEnabled?new lh(new At(Math.round(1e3*a.x)/1e3,Math.round(1e3*a.y)/1e3)):new lh(a.copy())},Ro.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;if(this.diagram.layout.isRealtime=this.Sw,a.Fu(!1),a.ug(),Gl(this),hd(a,this.draggedParts),this.draggedParts=this.currentPart=this.Bn=null,this.Ym=this.isDragOutStarted=!1,0<ds.count){for(var y=ds,x=y.length,E=0;E<x;E++){var b=y.M(E);Oo(b),ko(b),Gl(b),b.diagram.ug()}y.clear()}Oo(this),this.tl.h(NaN,NaN),ea!==null&&(ea.currentCursor=""),lo=ea=null,ko(this),a.isMouseCaptured=!1,a.currentCursor="",a.Ns=!1,this.stopTransaction(),kc(a,!0)},Ro.prototype.stopTransaction=function(){var a=this.diagram,y=zi.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y};function Gl(a){var y=a.diagram,x=y.skipsUndoManager;y.skipsUndoManager=!0,Wl(a,y.lastInput,null),y.skipsUndoManager=x,a.Cg.length=0}function Ph(){var a=lo;ko(a),is(a);var y=a.diagram;a.tl.w()&&(y.position=a.tl),y.ug()}Ro.prototype.doCancel=function(){ko(this),is(this);var a=this.diagram;this.tl.w()&&(a.position=this.tl),this.stopTool()},Ro.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput;this.isActive&&(y.key==="Esc"?this.doCancel():y.key!==a.previousInput.key&&this.doMouseMove())},Ro.prototype.doKeyUp=function(){this.isActive&&this.doMouseMove()};function Hl(a,y){if(a.copiedParts===null){var x=a.diagram;if((!y||!x.isReadOnly&&!x.isModelReadOnly)&&a.draggedParts!==null){var E=x.undoManager;for(E.isEnabled&&E.isInTransaction?E.currentTransaction!==null&&0<E.currentTransaction.changes.count&&(x.undoManager.Kf(),x.Ea("Drag")):is(a),x.skipsUndoManager=!y,x.partManager.addsToTemporaryLayer=!y,a.startPoint=x.firstInput.documentPoint,y=a.copiesEffectiveCollection?a.draggedParts.Lf():x.selection,y=x.Kj(y,x,!0),x=new Ie,E=a.draggedParts.iterator;E.next();){var b=E.key;if(b.Zc()&&b.canCopy()){var z=y.I(b);z!==null&&(z.location=b.location,z.Va(),x.add(z,a.Pd(z.location)))}}for(y=y.iterator;y.next();)E=y.value,E instanceof Tn&&E.canCopy()&&x.add(E,a.Pd());a.copiedParts=x,hu(a,x.Lf()),a.draggedLink!==null&&(x=a.draggedLink,y=x.routeBounds,jh(x,a.startPoint.x-(y.x+y.width/2),a.startPoint.y-(y.y+y.height/2))),a.doUpdateCursor(null)}}}function ko(a){var y=a.diagram;if(a.copiedParts!==null){if(y.Is(a.copiedParts.Lf(),!1),a.copiedParts=null,a.draggedParts!==null)for(var x=a.draggedParts.iterator;x.next();)x.key instanceof Tn&&(x.value.point=new At(0,0));a.doUpdateCursor(null)}y.skipsUndoManager=!1,y.partManager.addsToTemporaryLayer=!1,a.startPoint=y.firstInput.documentPoint}function Oo(a){if(a.draggedLink!==null){if(a.dragsLink&&a.Oe!==null){var y=a.Oe;y.diagram.remove(y.temporaryFromNode),y.diagram.remove(y.temporaryToNode),a.Oe.originalLink=null}a.draggedLink=null,a.Oe=null}}function Pa(a,y,x){var E=a.diagram,b=a.startPoint,z=At.alloc();z.assign(E.lastInput.documentPoint),a.moveParts(y,z.re(b),x),At.free(z),E.Gf("temporaryPixelRatio")===!0&&E.Yh===null&&30<E.$w&&(As(E),E.hk())}Ro.prototype.moveParts=function(a,y,x){x===void 0&&(x=!1);var E=this.diagram;E!==null&&ud(E,a,y,this.dragOptions,x)};function is(a){if(a.draggedParts!==null){for(var y=a.diagram,x=a.draggedParts.iterator;x.next();){var E=x.key;E.Zc()&&(E.location=x.value.point)}for(x=a.draggedParts.iterator;x.next();)if(E=x.key,E instanceof Tn&&E.suspendsRouting){var b=x.value.point;a.draggedParts.add(E,a.Pd()),jh(E,-b.x,-b.y)}y.bd()}}function Ja(a,y){var x=a.diagram;a.dragsLink&&(a.draggedLink!==null&&(a.draggedLink.fromNode=null,a.draggedLink.toNode=null),Fn(a,!1));var E=a.findDragOverObject(y),b=x.lastInput;b.targetObject=E,a.doUpdateCursor(E);var z=x.skipsUndoManager,tt=!1;try{if(x.skipsUndoManager=!0,tt=Wl(a,b,E),!a.isActive&&lo===null)return;var rt=E!==null?E.part:null;if(rt===null||x.handlesDragDropForTopLevelParts&&rt.isTopLevel&&!(rt instanceof or)){var ot=x.mouseDragOver;ot!==null&&(ot(b),tt=!0)}if(!a.isActive&&lo===null||(a.doDragOver(y,E),!a.isActive&&lo===null))return}finally{x.skipsUndoManager=z,tt&&x.bd()}a.Bn=E,x.isReadOnly||!x.allowMove&&!x.allowCopy||!x.allowHorizontalScroll&&!x.allowVerticalScroll||x.gs(b.viewPoint)}Ro.prototype.findDragOverObject=function(a){var y=this;return zu(this.diagram,a,null,function(x){return x===null?x=!0:(x=x.part,x=!!(x===null||x instanceof Yr||x.layer.isTemporary||y.draggedParts&&y.draggedParts.contains(x)||y.copiedParts&&y.copiedParts.contains(x))),!x})},Ro.prototype.doUpdateCursor=function(a){var y=this.diagram;(a===null||this.Bn!==a)&&(!this.diagram.currentTool.isActive||this.mayCopy()?y.currentCursor=this.copyCursor:this.mayMove()?y.currentCursor=this.moveCursor:this.mayDragOut()&&(y.currentCursor=this.nodropCursor))};function Wl(a,y,x){var E=!1,b=a.Cg.length,z=0<b?a.Cg[0]:null;if(x===z)return!1;y.handled=!1;for(var tt=0;tt<b;tt++){var rt=a.Cg[tt],ot=rt.mouseDragLeave;if(ot!==null&&(ot(y,rt,x),E=!0,y.handled))break}if(a.Cg.length=0,!a.isActive&&lo===null||x===null)return E;for(y.handled=!1,b=x;b!==null;)a.Cg.push(b),b=kl(b);for(b=a.Cg.length,x=0;x<b&&(tt=a.Cg[x],rt=tt.mouseDragEnter,rt===null||(rt(y,tt,z),E=!0,!y.handled));x++);return E}function kl(a){var y=a.panel;return y!==null?y:a instanceof Ni&&!(a instanceof or)&&(a=a.containingGroup,a!==null&&a.handlesDragDropForMembers)?a:null}function Vl(a,y,x){var E=a.Oe;if(E===null)return null;var b=a.diagram.og(y,E.portGravity,function(lt){return E.findValidLinkablePort(lt,x)});a=At.alloc();var z=1/0,tt=null;for(b=b.iterator;b.next();){var rt=b.value;if(rt.part!==null){var ot=rt.ga(Or,a);ot=y.Bf(ot),ot<z&&(tt=rt,z=ot)}}return At.free(a),tt}function Fn(a,y){var x=a.draggedLink;if(x!==null&&!(2>x.pointsCount)){var E=a.diagram;if(!E.isReadOnly){var b=a.Oe;if(b!==null){var z=null,tt=null;x.fromNode===null&&(z=Vl(a,x.i(0),!1),z!==null&&(tt=z.part));var rt=null,ot=null;x.toNode===null&&(rt=Vl(a,x.i(x.pointsCount-1),!0),rt!==null&&(ot=rt.part)),b.isValidLink(tt,z,ot,rt)?y?(x.defaultFromPoint=x.i(0),x.defaultToPoint=x.i(x.pointsCount-1),x.suspendsRouting=!1,x.fromNode=tt,z!==null&&(x.fromPortId=z.portId),x.toNode=ot,rt!==null&&(x.toPortId=rt.portId),x.fromPort!==E.Mx&&E.R("LinkRelinked",x,E.Mx),x.toPort!==E.Nx&&E.R("LinkRelinked",x,E.Nx)):nh(b,tt,z,ot,rt):nh(b,null,null,null,null)}}}}Ro.prototype.doDragOver=function(){};function sr(a,y){var x=a.diagram;a.dragsLink&&Fn(a,!0),Gl(a);var E=a.findDragOverObject(y),b=x.lastInput;if(b.targetObject=E,E!==null){b.handled=!1;for(var z=E;z!==null;){var tt=z.mouseDrop;if(tt!==null&&(tt(b,z),b.handled))break;jo(a,b,z),z=kl(z)}}else z=x.mouseDrop,z!==null&&z(b);if(a.isActive||lo!==null){for(b=(a.copiedParts||a.draggedParts).iterator;b.next();)z=b.key,z instanceof qn&&z.linksConnected.each(function(rt){rt.suspendsRouting=!1});if(a.doDropOnto(y,E),a.isActive||lo!==null){for(a=Be.alloc(),y=x.selection.iterator;y.next();)E=y.value,E instanceof qn&&Gr(x,E,a);Be.free(a)}}}function jo(a,y,x){a=a.diagram,x=x.part,!a.handlesDragDropForTopLevelParts||!x.isTopLevel||x instanceof or||(x=a.mouseDrop,x!==null&&x(y))}function Gr(a,y,x){var E=!1;if(x=y.getAvoidableRect(x),a.viewportBounds.Re(x)&&(E=!0),a=a.Nu(x,function(b){return b.part},function(b){return b instanceof Tn},!0,function(b){return b instanceof Tn},E),a.count!==0)for(a=a.iterator;a.next();)x=a.value,!x.Td(y)&&x.isAvoiding&&x.bb()}Ro.prototype.doDropOnto=function(){},Ro.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram,y=a.lastInput;this.simulatedMouseMove(y.event,y.documentPoint,y.targetDiagram)||this.currentPart===null||this.draggedParts===null||(this.mayCopy()?(Hl(this,!1),xf(a,this.copiedParts),Pa(this,this.copiedParts,!1),hd(a,this.copiedParts)):this.mayMove()?(ko(this),Pa(this,this.draggedParts,!0)):this.mayDragOut()?(Hl(this,!1),Pa(this,this.copiedParts,!1)):ko(this),Ja(this,a.lastInput.documentPoint))}},Ro.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,y=a.lastInput;if(!this.simulatedMouseUp(y.event,y.documentPoint,y.targetDiagram)){y=!1;var x=this.mayCopy();if(x&&this.copiedParts!==null?(ko(this),Hl(this,!0),xf(a,this.copiedParts),Pa(this,this.copiedParts,!1),hd(a,this.copiedParts),this.copiedParts!==null&&(a.R("ChangingSelection",a.selection),a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(b){b.isSelected=!0}))):(y=!0,ko(this),this.mayMove()&&(Pa(this,this.draggedParts,!0),Ja(this,a.lastInput.documentPoint))),this.Ym=!0,sr(this,a.lastInput.documentPoint),this.isActive){var E=x?this.copiedParts.Lf():this.draggedParts.Lf();this.copiedParts=null,y&&Zi(this),a.Ya(),hd(a,this.draggedParts),this.transactionResult=x?"Copy":"Move",a.R(x?"SelectionCopied":"SelectionMoved",E)}this.stopTool(),x&&a.R("ChangedSelection",a.selection)}}},Ro.prototype.simulatedMouseMove=function(a,y,x){if(lo===null)return!1;var E=lo.diagram;x instanceof be||(x=null);var b=ea;return x!==b&&(b!==null&&b!==E&&(b.ug(),lo.isDragOutStarted=!1,b=b.toolManager.findTool("Dragging"),b!==null&&b.doSimulatedDragLeave()),ea=x,x!==null&&x!==E&&(Ph(),b=x.toolManager.findTool("Dragging"),b!==null&&(ds.contains(b)||ds.add(b),b.doSimulatedDragEnter())),this.doUpdateCursor(null)),x===null||x===E||!x.allowDrop||x.isReadOnly||!x.allowInsert?!1:(E=x.toolManager.findTool("Dragging"),E!==null&&(a!==null&&(a.targetTouches!==void 0&&(0<a.targetTouches.length?a=a.targetTouches[0]:0<a.changedTouches.length&&(a=a.changedTouches[0])),y=x.getMouse(a)),x.lastInput.documentPoint=y,x.lastInput.viewPoint=x.op(y),x.lastInput.down=!1,x.lastInput.up=!1,E.doSimulatedDragOver()),!0)},Ro.prototype.simulatedMouseUp=function(a,y,x){if(lo===null)return!1;var E=ea,b=lo.diagram;if(x===null)return lo.doCancel(),!0;if(x!==E){var z=E.toolManager.findTool("Dragging");if(E!==null&&E!==b&&z!==null)return E.ug(),lo.isDragOutStarted=!1,z.doSimulatedDragLeave(),!1;ea=x,E=x.toolManager.findTool("Dragging"),E!==null&&(Ph(),ds.contains(E)||ds.add(E),E.doSimulatedDragEnter())}return x!==this.diagram?(a!==null?(a.targetTouches!==void 0&&(0<a.targetTouches.length?a=a.targetTouches[0]:0<a.changedTouches.length&&(a=a.changedTouches[0])),y=x.getMouse(a)):y===null&&(y=new At),x.lastInput.documentPoint=y,x.lastInput.viewPoint=x.op(y),x.lastInput.down=!1,x.lastInput.up=!0,a=x.toolManager.findTool("Dragging"),a!==null&&a.doSimulatedDrop(),a=lo,a!==null&&(x=a.mayCopy(),a.transactionResult=x?"Copy":"Move",a.stopTool()),!0):!1};function Zi(a){if(a.draggedParts!==null)for(var y=a.draggedParts.iterator;y.next();){var x=y.key;x instanceof qn&&(x=x.containingGroup,x===null||x.placeholder===null||a.draggedParts.contains(x)||x.placeholder.v())}}Ro.prototype.mayCopy=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowCopy||(vr?!a.lastInput.alt:!a.lastInput.control))return!1;for(a=a.selection.iterator;a.next();)if(a.value.canCopy())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canCopy())},Ro.prototype.mayDragOut=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(!a.allowDragOut||!a.allowCopy||a.allowMove)return!1;for(a=a.selection.iterator;a.next();)if(a.value.canCopy())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canCopy())},Ro.prototype.mayMove=function(){var a=this.diagram;if(a.isReadOnly||!a.allowMove)return!1;for(a=a.selection.iterator;a.next();)if(a.value.canMove())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canMove())},Ro.prototype.computeBorder=function(a,y,x){return this.Ym||this.draggedParts===null||this.draggedParts.contains(a)?null:x.assign(y)},Ro.prototype.Az=function(){return lo},Ro.prototype.mayDragIn=function(){var a=this.diagram;if(!a.allowDrop||a.isReadOnly||a.isModelReadOnly||!a.allowInsert)return!1;var y=lo;return!(y===null||y.diagram.model.dataFormat!==a.model.dataFormat)},Ro.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.diagram;a.animationManager.Cc(),pl(a),a.animationManager.Cc(),a=lo,a!==null&&(a.diagram.Ns=!1),this.doUpdateCursor(null)}},Ro.prototype.doSimulatedDragLeave=function(){var a=lo;a!==null&&a.doSimulatedDragOut(),this.doCancel()},Ro.prototype.doSimulatedDragOver=function(){var a=this.diagram;a.animationManager.Dm=!0;var y=lo;if(y!==null&&y.draggedParts!==null){if(!this.mayDragIn())return;Jo(this,y.draggedParts.Lf(),!1,a.firstInput),Pa(this,this.copiedParts,!1),Ja(this,a.lastInput.documentPoint)}a.animationManager.Dm=!1},Ro.prototype.doSimulatedDrop=function(){var a=this.diagram,y=lo;if(y!==null){var x=y.diagram;if(y.Ym=!0,ko(this),!this.mayDragIn())return;a.animationManager.Dm=!0,a.R("ChangingSelection",a.selection),this.Ea("Drop"),Jo(this,y.draggedParts.Lf(),!0,a.lastInput),Pa(this,this.copiedParts,!1);var E=new pn;this.copiedParts!==null&&(a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(b){b.isSelected=!0,E.add(b)})),sr(this,a.lastInput.documentPoint),a.Ya(),this.copiedParts!==null&&(this.transactionResult="ExternalCopy"),this.copiedParts=null,a.doFocus(),a.R("ExternalObjectsDropped",E,x),this.stopTransaction(),a.R("ChangedSelection",a.selection)}a.animationManager.Dm=!1};function Jo(a,y,x,E){if(a.copiedParts===null){var b=a.diagram;if(!b.isReadOnly&&!b.isModelReadOnly){b.skipsUndoManager=!x,b.partManager.addsToTemporaryLayer=!x,a.startPoint=E.documentPoint,x=b.Kj(y,b,!0);var z=Be.alloc();b=E=1/0;for(var tt=-1/0,rt=-1/0,ot=y.iterator;ot.next();){var lt=ot.value;if(lt.isVisible()){var ut=lt.location;lt=ut.x,ut=ut.y,isNaN(lt)||isNaN(ut)||(lt<E&&(E=lt),ut<b&&(b=ut),lt>tt&&(tt=lt),ut>rt&&(rt=ut))}}for(E===1/0?z.h(0,0,0,0):z.h(E,b,tt-E,rt-b),E=z.x+z.width/2,b=z.y+z.height/2,Be.free(z),z=a.Fr,tt=new Ie,rt=At.alloc(),ot=y.iterator;ot.next();)lt=ot.value,lt instanceof Tn&&lt.canCopy()&&(ut=x.I(lt),ut!==null&&(ut.points=lt.points,jh(ut,z.x-E,z.y-b),ut.suspendsRouting=!0,tt.add(ut,a.Pd())));for(y=y.iterator;y.next();)lt=y.value,lt.Zc()&&lt.canCopy()&&(ot=x.I(lt),ot!==null&&(lt=lt.location,rt.h(z.x-(E-lt.x),z.y-(b-lt.y)),ot.location=rt,ot.Va(),tt.add(ot,a.Pd(rt))));At.free(rt),a.copiedParts=tt,hu(a,tt.Lf()),a.draggedLink!==null&&(x=a.draggedLink,y=x.routeBounds,jh(x,a.startPoint.x-(y.x+y.width/2),a.startPoint.y-(y.y+y.height/2))),a.doUpdateCursor(null)}}}Ro.prototype.doSimulatedDragOut=function(){var a=this.diagram;a.Ns=!1,this.mayCopy()||this.mayMove()?a.currentCursor="":a.currentCursor=this.nodropCursor,this.Bn=null},Ro.prototype.computeMove=function(a,y,x,E){return x=this.diagram,x!==null?x.computeMove(a,y,this.dragOptions,E):new At},ve.Object.defineProperties(Ro.prototype,{isCopyEnabled:{get:function(){return this.ob},set:function(a){this.ob=a}},copiesEffectiveCollection:{get:function(){return this.u},set:function(a){this.u=a}},dragOptions:{get:function(){return this.ia},set:function(a){this.ia=a}},isGridSnapEnabled:{get:function(){return this.dragOptions.isGridSnapEnabled},set:function(a){this.dragOptions.isGridSnapEnabled=a}},isComplexRoutingRealtime:{get:function(){return this.hb},set:function(a){this.hb=a}},isGridSnapRealtime:{get:function(){return this.dragOptions.isGridSnapRealtime},set:function(a){this.dragOptions.isGridSnapRealtime=a}},gridSnapCellSize:{get:function(){return this.dragOptions.gridSnapCellSize},set:function(a){this.dragOptions.gridSnapCellSize.D(a)||(a=a.J(),this.dragOptions.gridSnapCellSize=a)}},gridSnapCellSpot:{get:function(){return this.dragOptions.gridSnapCellSpot},set:function(a){this.dragOptions.gridSnapCellSpot.D(a)||(a=a.J(),this.dragOptions.gridSnapCellSpot=a)}},gridSnapOrigin:{get:function(){return this.dragOptions.gridSnapOrigin},set:function(a){this.dragOptions.gridSnapOrigin.D(a)||(a=a.J(),this.dragOptions.gridSnapOrigin=a)}},dragsLink:{get:function(){return this.dragOptions.dragsLink},set:function(a){this.dragOptions.dragsLink=a}},dragsTree:{get:function(){return this.dragOptions.dragsTree},set:function(a){this.dragOptions.dragsTree=a}},copyCursor:{get:function(){return this.F},set:function(a){this.F=a}},moveCursor:{get:function(){return this.Oc},set:function(a){this.Oc=a}},nodropCursor:{get:function(){return this.Pc},set:function(a){this.Pc=a}},currentPart:{get:function(){return this.V},set:function(a){this.V=a}},copiedParts:{get:function(){return this.o},set:function(a){this.o=a}},draggedParts:{get:function(){return this.Ha},set:function(a){this.Ha=a}},draggingParts:{get:function(){return this.copiedParts!==null?this.copiedParts.Lf():this.draggedParts!==null?this.draggedParts.Lf():this.te}},draggedLink:{get:function(){return this.diagram.draggedLink},set:function(a){this.diagram.draggedLink=a}},isDragOutStarted:{get:function(){return this.Hb},set:function(a){this.Hb=a}},startPoint:{get:function(){return this.Fr},set:function(a){this.Fr.D(a)||this.Fr.assign(a)}},delay:{get:function(){return this.Ik},set:function(a){this.Ik=a}}}),Ro.prototype.getDraggingSource=Ro.prototype.Az;var lo=null,ea=null;Ro.className="DraggingTool",ds=new fn,Ki("draggingTool",function(){return this.findTool("Dragging")},function(a){this.gb("Dragging",a,this.mouseMoveTools)}),Nr.prototype.doCancel=function(){lo!==null&&lo.doCancel(),zi.prototype.doCancel.call(this)};function Cr(){zi.call(this),this.te=100,this.Ha=!1,this.u="pointer";var a=new Tn,y=new cr;y.isPanelMain=!0,y.stroke="blue",a.add(y),y=new cr,y.toArrow="Standard",y.fill="blue",y.stroke="blue",a.add(y),a.layerName="Tool",this.Ci=a,a=new qn,y=new cr,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=qi,a.add(y),a.selectable=!1,a.layerName="Tool",this.Bi=a,this.j=y,a=new qn,y=new cr,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=qi,a.add(y),a.selectable=!1,a.layerName="Tool",this.Di=a,this.o=y,this.Pc=this.Oc=this.ob=this.hb=this.Hb=null,this.ia=!0,this.hy=new Ie,this.Of=this.gj=this.Pf=null}Se(Cr,zi),Cr.prototype.doStop=function(){this.diagram.ug(),this.originalToPort=this.originalToNode=this.originalFromPort=this.originalFromNode=this.originalLink=null,this.validPortsCache.clear(),this.targetPort=null},Cr.prototype.copyPortProperties=function(a,y,x,E,b){if(a!==null&&y!==null&&x!==null&&E!==null){var z=y.Df(),tt=ln.alloc();tt.width=y.naturalBounds.width*z,tt.height=y.naturalBounds.height*z,E.desiredSize=tt,ln.free(tt),b?(E.toSpot=y.toSpot,E.toEndSegmentLength=y.toEndSegmentLength):(E.fromSpot=y.fromSpot,E.fromEndSegmentLength=y.fromEndSegmentLength),x.locationSpot=Or,z=At.alloc(),x.location=y.ga(Or,z),At.free(z),E.angle=y.li(),this.portTargeted!==null&&this.portTargeted(a,y,x,E,b)}},Cr.prototype.setNoTargetPortProperties=function(a,y,x){y!==null&&(y.desiredSize=qi,y.fromSpot=gr,y.toSpot=gr),a!==null&&(a.location=this.diagram.lastInput.documentPoint),this.portTargeted!==null&&this.portTargeted(null,null,a,y,x)},Cr.prototype.doMouseDown=function(){this.isActive&&this.doMouseMove()},Cr.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram;if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null&&this.targetPort.part instanceof qn){var y=this.targetPort.part;this.isForwards?this.copyPortProperties(y,this.targetPort,this.temporaryToNode,this.temporaryToPort,!0):this.copyPortProperties(y,this.targetPort,this.temporaryFromNode,this.temporaryFromPort,!1)}else this.isForwards?this.setNoTargetPortProperties(this.temporaryToNode,this.temporaryToPort,!0):this.setNoTargetPortProperties(this.temporaryFromNode,this.temporaryFromPort,!1);(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.gs(a.lastInput.viewPoint)}},Cr.prototype.findValidLinkablePort=function(a,y){if(a===null)return null;var x=a.part;if(!(x instanceof qn))return null;for(;a!==null;){var E=y?a.toLinkable:a.fromLinkable;if(E===!0&&(a.portId!==null||a instanceof qn)&&(y?this.isValidTo(x,a):this.isValidFrom(x,a)))return a;if(E===!1)break;a=a.panel}return null},Cr.prototype.findTargetPort=function(a){var y=this.diagram,x=y.lastInput.documentPoint,E=this.portGravity;0>=E&&(E=.1);var b=this,z=y.og(x,E,function(ft){return b.findValidLinkablePort(ft,a)},null,!0);for(E=1/0,y=null,z=z.iterator;z.next();){var tt=z.value,rt=tt.part;if(rt instanceof qn){var ot=tt.ga(Or,At.alloc()),lt=x.x-ot.x,ut=x.y-ot.y;At.free(ot),ot=lt*lt+ut*ut,ot<E&&(lt=this.validPortsCache.I(tt),lt!==null?lt&&(y=tt,E=ot):a&&this.isValidLink(this.originalFromNode,this.originalFromPort,rt,tt)||!a&&this.isValidLink(rt,tt,this.originalToNode,this.originalToPort)?(this.validPortsCache.add(tt,!0),y=tt,E=ot):this.validPortsCache.add(tt,!1))}}return y!==null&&(x=y.part,x instanceof qn&&(x.layer===null||x.layer.allowLink))?y:null},Cr.prototype.isValidFrom=function(a,y){if(a===null||y===null)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(a.layer!==null&&!a.layer.allowLink||y.fromLinkable!==!0))return!1;var x=y.fromMaxLinks;if(1/0>x){if(this.originalLink!==null&&a===this.originalFromNode&&y===this.originalFromPort)return!0;if(y=y.portId,y===null&&(y=""),a.Mo(y).count>=x)return!1}return!0},Cr.prototype.isValidTo=function(a,y){if(a===null||y===null)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(a.layer!==null&&!a.layer.allowLink||y.toLinkable!==!0))return!1;var x=y.toMaxLinks;if(1/0>x){if(this.originalLink!==null&&a===this.originalToNode&&y===this.originalToPort)return!0;if(y=y.portId,y===null&&(y=""),a.Sd(y).count>=x)return!1}return!0},Cr.prototype.isInSameNode=function(a,y){return a===null||y===null?!1:a===y?!0:(a=a.part,y=y.part,a!==null&&a===y)},Cr.prototype.isLinked=function(a,y){if(a===null||y===null)return!1;var x=a.part;if(!(x instanceof qn))return!1;a=a.portId,a===null&&(a="");var E=y.part;if(!(E instanceof qn))return!1;for(y=y.portId,y===null&&(y=""),y=E.Sd(y);y.next();)if(E=y.value,E.fromNode===x&&E.fromPortId===a)return!0;return!1},Cr.prototype.isValidLink=function(a,y,x,E){if(!this.isValidFrom(a,y)||!this.isValidTo(x,E)||!(y===null||E===null||(y.fromLinkableSelfNode&&E.toLinkableSelfNode||!this.isInSameNode(y,E))&&(y.fromLinkableDuplicates&&E.toLinkableDuplicates||!this.isLinked(y,E)))||this.originalLink!==null&&(a!==null&&this.isLabelDependentOnLink(a,this.originalLink)||x!==null&&this.isLabelDependentOnLink(x,this.originalLink))||a!==null&&x!==null&&(a.data===null&&x.data!==null||a.data!==null&&x.data===null)||!this.isValidCycle(a,x,this.originalLink))return!1;if(a!==null){var b=a.linkValidation;if(b!==null&&!b(a,y,x,E,this.originalLink))return!1}return x!==null&&(b=x.linkValidation,b!==null&&!b(a,y,x,E,this.originalLink))?!1:(b=this.linkValidation,b!==null?b(a,y,x,E,this.originalLink):!0)},Cr.prototype.isLabelDependentOnLink=function(a,y){if(a===null)return!1;var x=a.labeledLink;if(x===null)return!1;if(x===y)return!0;var E=new pn;return E.add(a),Qo(this,x,y,E)};function Qo(a,y,x,E){if(y===x)return!0;var b=y.fromNode;return b!==null&&b.isLinkLabel&&(E.add(b),Qo(a,b.labeledLink,x,E))?!0:(y=y.toNode,!!(y!==null&&y.isLinkLabel&&(E.add(y),Qo(a,y.labeledLink,x,E))))}Cr.prototype.isValidCycle=function(a,y,x){if(x===void 0&&(x=null),a===null||y===null)return this.isUnconnectedLinkValid;var E=this.diagram.validCycle;if(E!==Tc){if(E===Hg){if(E=x||this.temporaryLink,E!==null&&!E.isTreeLink)return!0;for(E=y.linksConnected;E.next();){var b=E.value;if(b!==x&&b.isTreeLink&&b.toNode===y)return!1}return!Bo(this,a,y,x,!0)}if(E===Wg){if(E=x||this.temporaryLink,E!==null&&!E.isTreeLink)return!0;for(E=a.linksConnected;E.next();)if(b=E.value,b!==x&&b.isTreeLink&&b.fromNode===a)return!1;return!Bo(this,a,y,x,!0)}if(E===zg)return a===y?a=!0:(E=new pn,E.add(y),a=Ta(this,E,a,y,x)),!a;if(E===Zg)return!Bo(this,a,y,x,!1);if(E===Gg)return a===y?a=!0:(E=new pn,E.add(y),a=du(this,E,a,y,x)),!a}return!0};function Bo(a,y,x,E,b){if(y===x)return!0;if(y===null||x===null)return!1;for(var z=y.linksConnected;z.next();){var tt=z.value;if(tt!==E&&(!b||tt.isTreeLink)&&tt.toNode===y&&(tt=tt.fromNode,tt!==y&&Bo(a,tt,x,E,b)))return!0}return!1}function Ta(a,y,x,E,b){if(x===E)return!0;if(x===null||E===null||y.contains(x))return!1;y.add(x);for(var z=x.linksConnected;z.next();){var tt=z.value;if(tt!==b&&tt.toNode===x&&(tt=tt.fromNode,tt!==x&&Ta(a,y,tt,E,b)))return!0}return!1}function du(a,y,x,E,b){if(x===E)return!0;if(x===null||E===null||y.contains(x))return!1;y.add(x);for(var z=x.linksConnected;z.next();){var tt=z.value;if(tt!==b){var rt=tt.fromNode;if(tt=tt.toNode,rt=rt===x?tt:rt,rt!==x&&du(a,y,rt,E,b))return!0}}return!1}ve.Object.defineProperties(Cr.prototype,{portGravity:{get:function(){return this.te},set:function(a){0<=a&&(this.te=a)}},isUnconnectedLinkValid:{get:function(){return this.Ha},set:function(a){this.Ha=a}},linkingCursor:{get:function(){return this.u},set:function(a){this.u=a}},temporaryLink:{get:function(){return this.Ci},set:function(a){this.Ci=a}},temporaryFromNode:{get:function(){return this.Bi},set:function(a){(this.Bi=a)&&(this.j=a.port)}},temporaryFromPort:{get:function(){return this.j},set:function(a){if(this.j!==null){var y=this.j.panel;if(y!==null){var x=y.O.indexOf(this.j);y.mb(x),y.Gb(x,a)}}this.j=a}},temporaryToNode:{get:function(){return this.Di},set:function(a){(this.Di=a)&&(this.o=a.port)}},temporaryToPort:{get:function(){return this.o},set:function(a){if(this.o!==null){var y=this.o.panel;if(y!==null){var x=y.O.indexOf(this.o);y.mb(x),y.Gb(x,a)}}this.o=a}},originalLink:{get:function(){return this.Hb},set:function(a){this.Hb=a}},originalFromNode:{get:function(){return this.hb},set:function(a){this.hb=a}},originalFromPort:{get:function(){return this.ob},set:function(a){this.ob=a}},originalToNode:{get:function(){return this.Oc},set:function(a){this.Oc=a}},originalToPort:{get:function(){return this.Pc},set:function(a){this.Pc=a}},isForwards:{get:function(){return this.ia},set:function(a){this.ia=a}},validPortsCache:{get:function(){return this.hy}},targetPort:{get:function(){return this.Pf},set:function(a){this.Pf=a}},linkValidation:{get:function(){return this.gj},set:function(a){this.gj=a}},portTargeted:{get:function(){return this.Of},set:function(a){this.Of=a}}}),Cr.className="LinkingBaseTool";function Er(){Cr.call(this),this.name="Linking",this.V={},this.F=null,this.K=vs,this.Xd=null}Se(Er,Cr),Er.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return a.isReadOnly||a.isModelReadOnly||!a.allowLink||!a.model.xs()||!a.lastInput.left||a.currentTool!==this&&!this.isBeyondDragSize()?!1:this.findLinkablePort()!==null},Er.prototype.findLinkablePort=function(){var a=this.diagram,y=this.startObject;if(y===null&&(y=a.ic(a.firstInput.documentPoint,null,null)),y===null||(a=y.part,!(a instanceof qn)))return null;var x=this.direction;if(x===vs||x===bl){var E=this.findValidLinkablePort(y,!1);if(E!==null||this.startObject===a&&(E=a.port,this.findValidLinkablePort(E,!1)))return this.isForwards=!0,E}return(x===vs||x===ys)&&(y=this.findValidLinkablePort(y,!0),y!==null||this.startObject===a&&(y=a.port,this.findValidLinkablePort(y,!0)))?(this.isForwards=!1,y):null},Er.prototype.doActivate=function(){var a=this.diagram,y=this.findLinkablePort();y===null?this.stopTool():(this.Ea(this.name),a.isMouseCaptured=!0,a.currentCursor=this.linkingCursor,this.isForwards?(this.temporaryToNode!==null&&(this.temporaryToNode.location=a.lastInput.documentPoint),this.originalFromPort=y,y=this.originalFromPort.part,y instanceof qn&&(this.originalFromNode=y),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1)):(this.temporaryFromNode!==null&&(this.temporaryFromNode.location=a.lastInput.documentPoint),this.originalToPort=y,y=this.originalToPort.part,y instanceof qn&&(this.originalToNode=y),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0)),a.add(this.temporaryFromNode),this.temporaryFromNode&&this.temporaryFromNode.Va(),a.add(this.temporaryToNode),this.temporaryToNode&&this.temporaryToNode.Va(),this.temporaryLink!==null&&(this.temporaryFromNode!==null&&(this.temporaryLink.fromNode=this.temporaryFromNode),this.temporaryToNode!==null&&(this.temporaryLink.toNode=this.temporaryToNode),this.temporaryLink.isTreeLink=this.isNewTreeLink(),this.temporaryLink.bb(),a.add(this.temporaryLink)),this.isActive=!0)},Er.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;a.remove(this.temporaryLink),a.remove(this.temporaryFromNode),a.remove(this.temporaryToNode),a.isMouseCaptured=!1,a.currentCursor="",this.stopTransaction()},Er.prototype.doStop=function(){Cr.prototype.doStop.call(this),this.startObject=null},Er.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,y=this.transactionResult=null,x=null,E=null,b=null,z=null;try{var tt=this.targetPort=this.findTargetPort(this.isForwards);if(tt!==null){var rt=tt.part;rt instanceof qn&&(this.isForwards?(this.originalFromNode!==null&&(y=this.originalFromNode,x=this.originalFromPort),E=rt,b=tt):(y=rt,x=tt,this.originalToNode!==null&&(E=this.originalToNode,b=this.originalToPort)))}else this.isForwards?this.originalFromNode!==null&&this.isUnconnectedLinkValid&&(y=this.originalFromNode,x=this.originalFromPort):this.originalToNode!==null&&this.isUnconnectedLinkValid&&(E=this.originalToNode,b=this.originalToPort);y!==null||E!==null?(z=this.insertLink(y,x,E,b),z!==null?(tt===null&&(this.isForwards?z.defaultToPoint=a.lastInput.documentPoint:z.defaultFromPoint=a.lastInput.documentPoint),a.allowSelect&&(a.R("ChangingSelection",a.selection),a.clearSelection(!0),z.isSelected=!0),this.transactionResult=this.name,a.R("LinkDrawn",z)):this.doNoLink(y,x,E,b)):this.isForwards?this.doNoLink(this.originalFromNode,this.originalFromPort,null,null):this.doNoLink(null,null,this.originalToNode,this.originalToPort)}finally{this.stopTool(),z&&a.allowSelect&&a.R("ChangedSelection",a.selection)}}},Er.prototype.isNewTreeLink=function(){var a=this.archetypeLinkData;if(a===null)return!0;if(a instanceof Tn)return a.isTreeLink;var y=this.diagram;return y===null?!0:(a=y.partManager.getLinkCategoryForData(a),y=y.partManager.findLinkTemplateForCategory(a),y!==null?y.isTreeLink:!0)},Er.prototype.insertLink=function(a,y,x,E){return this.diagram.partManager.insertLink(a,y,x,E)},Er.prototype.doNoLink=function(){},ve.Object.defineProperties(Er.prototype,{archetypeLinkData:{get:function(){return this.V},set:function(a){this.V=a}},archetypeLabelNodeData:{get:function(){return this.F},set:function(a){this.F=a}},direction:{get:function(){return this.K},set:function(a){this.K=a}},startObject:{get:function(){return this.Xd},set:function(a){this.Xd=a}}});var vs=new He(Er,"Either",0),bl=new He(Er,"ForwardsOnly",0),ys=new He(Er,"BackwardsOnly",0);Er.className="LinkingTool",Er.Either=vs,Er.ForwardsOnly=bl,Er.BackwardsOnly=ys;function Ua(){Cr.call(this),this.name="Relinking";var a=new cr;a.figure="Diamond",a.desiredSize=Lr,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=0,this.V=a,a=new cr,a.figure="Diamond",a.desiredSize=Lr,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=-1,this.Xd=a,this.F=null,this.Ew=new Be}Se(Ua,Cr),Ua.prototype.updateAdornments=function(a){if(a!==null&&a instanceof Tn){var y="RelinkFrom",x=null;if(a.isSelected&&!this.diagram.isReadOnly){var E=a.selectionObject;E!==null&&a.canRelinkFrom()&&a.actualBounds.w()&&a.isVisible()&&E.actualBounds.w()&&E.Ed()&&(x=a.Pj(y),x===null&&(x=this.makeAdornment(E,!1),a.bh(y,x)))}x===null&&a.Jf(y),y="RelinkTo",x=null,a.isSelected&&!this.diagram.isReadOnly&&(E=a.selectionObject,E!==null&&a.canRelinkTo()&&a.actualBounds.w()&&a.isVisible()&&E.actualBounds.w()&&E.Ed()&&(x=a.Pj(y),x===null?(x=this.makeAdornment(E,!0),a.bh(y,x)):x.v())),x===null&&a.Jf(y)}},Ua.prototype.makeAdornment=function(a,y){var x=new Yr;return x.type=En.Link,y=y?this.toHandleArchetype:this.fromHandleArchetype,y!==null&&x.add(y.copy()),x.adornedObject=a,x},Ua.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowRelink||!a.model.xs()||!a.lastInput.left)return!1;var y=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkFrom");return y===null&&(y=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkTo")),y!==null},Ua.prototype.doActivate=function(){var a=this.diagram;if(this.originalLink===null){var y=this.handle;if(y===null&&(y=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkFrom"),y===null&&(y=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkTo"))),y===null)return;var x=y.part;if(!(x instanceof Yr&&x.adornedPart instanceof Tn))return;this.handle=y,this.isForwards=x===null||x.category==="RelinkTo",this.originalLink=x.adornedPart}this.Ea(this.name),a.isMouseCaptured=!0,a.currentCursor=this.linkingCursor,this.originalFromPort=this.originalLink.fromPort,this.originalFromNode=this.originalLink.fromNode,this.originalToPort=this.originalLink.toPort,this.originalToNode=this.originalLink.toNode,this.Ew.set(this.originalLink.actualBounds),this.originalLink!==null&&0<this.originalLink.pointsCount&&(this.originalLink.fromNode===null&&(this.temporaryFromPort!==null&&(this.temporaryFromPort.desiredSize=Pi),this.temporaryFromNode!==null&&(this.temporaryFromNode.location=this.originalLink.i(0))),this.originalLink.toNode===null&&(this.temporaryToPort!==null&&(this.temporaryToPort.desiredSize=Pi),this.temporaryToNode!==null&&(this.temporaryToNode.location=this.originalLink.i(this.originalLink.pointsCount-1)))),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0),a.add(this.temporaryFromNode),a.add(this.temporaryToNode),this.temporaryLink!==null&&(this.temporaryFromNode!==null&&(this.temporaryLink.fromNode=this.temporaryFromNode),this.temporaryToNode!==null&&(this.temporaryLink.toNode=this.temporaryToNode),this.copyLinkProperties(this.originalLink,this.temporaryLink),this.temporaryLink.bb(),a.add(this.temporaryLink)),this.isActive=!0},Ua.prototype.copyLinkProperties=function(a,y){if(a!==null&&y!==null){y.adjusting=a.adjusting,y.corner=a.corner;var x=a.curve;(x===Wf||x===zh)&&(x=Ls),y.curve=x,y.curviness=a.curviness,y.isTreeLink=a.isTreeLink,y.points=a.points,y.routing=a.routing,y.smoothness=a.smoothness,y.fromSpot=a.fromSpot,y.fromEndSegmentLength=a.fromEndSegmentLength,y.fromShortLength=a.fromShortLength,y.toSpot=a.toSpot,y.toEndSegmentLength=a.toEndSegmentLength,y.toShortLength=a.toShortLength}},Ua.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;a.remove(this.temporaryLink),a.remove(this.temporaryFromNode),a.remove(this.temporaryToNode),a.isMouseCaptured=!1,a.currentCursor="",this.stopTransaction()},Ua.prototype.doStop=function(){Cr.prototype.doStop.call(this),this.handle=null},Ua.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram;this.transactionResult=null;var y=this.originalFromNode,x=this.originalFromPort,E=this.originalToNode,b=this.originalToPort,z=this.originalLink;try{if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null){var tt=this.targetPort.part;tt instanceof qn&&(this.isForwards?(E=tt,b=this.targetPort):(y=tt,x=this.targetPort))}else this.isUnconnectedLinkValid?this.isForwards?b=E=null:x=y=null:z=null;z!==null?(this.reconnectLink(z,this.isForwards?E:y,this.isForwards?b:x,this.isForwards),this.targetPort===null&&(this.isForwards?z.defaultToPoint=a.lastInput.documentPoint:z.defaultFromPoint=a.lastInput.documentPoint,z.bb()),this.transactionResult=this.name,a.R("LinkRelinked",z,this.isForwards?this.originalToPort:this.originalFromPort)):this.doNoRelink(this.originalLink,this.isForwards),this.originalLink.Xo(this.Ew)}finally{this.stopTool()}}},Ua.prototype.reconnectLink=function(a,y,x,E){return x=x!==null&&x.portId!==null?x.portId:"",E?(a.toNode=y,a.toPortId=x):(a.fromNode=y,a.fromPortId=x),!0},Ua.prototype.doNoRelink=function(){};function nh(a,y,x,E,b){y!==null?(a.copyPortProperties(y,x,a.temporaryFromNode,a.temporaryFromPort,!1),a.diagram.add(a.temporaryFromNode)):a.diagram.remove(a.temporaryFromNode),E!==null?(a.copyPortProperties(E,b,a.temporaryToNode,a.temporaryToPort,!0),a.diagram.add(a.temporaryToNode)):a.diagram.remove(a.temporaryToNode)}ve.Object.defineProperties(Ua.prototype,{fromHandleArchetype:{get:function(){return this.V},set:function(a){this.V=a}},toHandleArchetype:{get:function(){return this.Xd},set:function(a){this.Xd=a}},handle:{get:function(){return this.F},set:function(a){if(a!==null&&!(a.part instanceof Yr))throw Error("new handle is not in an Adornment: "+a);this.F=a}}}),Ua.className="RelinkingTool",Ki("linkingTool",function(){return this.findTool("Linking")},function(a){this.gb("Linking",a,this.mouseMoveTools)}),Ki("relinkingTool",function(){return this.findTool("Relinking")},function(a){this.gb("Relinking",a,this.mouseDownTools)});function $o(){zi.call(this),this.name="LinkReshaping";var a=new cr;a.figure="Rectangle",a.desiredSize=Tr,a.fill="lightblue",a.stroke="dodgerblue",this.o=a,a=new cr,a.figure="Diamond",a.desiredSize=Lr,a.fill="lightblue",a.stroke="dodgerblue",a.cursor="move",this.u=a,this.F=3,this.Ts=this.j=null,this.Fw=new At,this.Yq=new fn}Se($o,zi),$o.prototype.Ru=function(a){return a&&a.reshapingBehavior.value!==0?a.reshapingBehavior:ih},$o.prototype.om=function(a,y){a.reshapingBehavior=y},$o.prototype.updateAdornments=function(a){if(a!==null&&a instanceof Tn){var y=null;if(a.isSelected&&!this.diagram.isReadOnly){var x=a.path;x!==null&&a.canReshape()&&a.actualBounds.w()&&a.isVisible()&&x.actualBounds.w()&&x.Ed()&&(y=a.Pj(this.name),y===null||y.Aw!==a.pointsCount||y.Uw!==a.resegmentable)&&(y=this.makeAdornment(x),y!==null&&(y.Aw=a.pointsCount,y.Uw=a.resegmentable,a.bh(this.name,y)))}y===null&&a.Jf(this.name)}},$o.prototype.makeAdornment=function(a){var y=a.part,x=y.pointsCount,E=y.isOrthogonal,b=null;if(y.points!==null&&1<x){b=new Yr,b.type=En.Link,x=y.firstPickIndex;var z=y.lastPickIndex,tt=E?1:0;if(y.resegmentable&&y.computeCurve()!==ul)for(var rt=x+tt;rt<z-tt;rt++){var ot=this.makeResegmentHandle(a,rt);ot!==null&&(ot.segmentIndex=rt,ot.segmentFraction=.5,ot.fromMaxLinks=999,b.add(ot))}for(tt=x+1;tt<z;tt++)if(rt=this.makeHandle(a,tt),rt!==null){if(rt.segmentIndex=tt,tt!==x)if(tt===x+1&&E){ot=y.i(x);var lt=y.i(x+1);Zt.B(ot.x,lt.x)&&Zt.B(ot.y,lt.y)&&(lt=y.i(x-1)),Zt.B(ot.x,lt.x)?(this.om(rt,Ch),rt.cursor="n-resize"):Zt.B(ot.y,lt.y)&&(this.om(rt,wh),rt.cursor="w-resize")}else tt===z-1&&E?(ot=y.i(z-1),lt=y.i(z),Zt.B(ot.x,lt.x)&&Zt.B(ot.y,lt.y)&&(ot=y.i(z+1)),Zt.B(ot.x,lt.x)?(this.om(rt,Ch),rt.cursor="n-resize"):Zt.B(ot.y,lt.y)&&(this.om(rt,wh),rt.cursor="w-resize")):tt!==z&&(this.om(rt,sf),rt.cursor="move");b.add(rt)}b.adornedObject=a}return b},$o.prototype.makeHandle=function(){var a=this.handleArchetype;return a===null?null:a.copy()},$o.prototype.makeResegmentHandle=function(){var a=this.midHandleArchetype;return a===null?null:a.copy()},$o.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowReshape&&a.lastInput.left?this.findToolHandleAt(a.firstInput.documentPoint,this.name)!==null:!1},$o.prototype.doActivate=function(){var a=this.diagram;if(this.handle===null&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name)),this.handle!==null){var y=this.handle.part.adornedPart;if(y instanceof Tn){if(this.Ts=y,a.isMouseCaptured=!0,this.Ea(this.name),y.resegmentable&&this.handle.fromMaxLinks===999){var x=y.points.copy(),E=this.getResegmentingPoint();if(x.Gb(this.handle.segmentIndex+1,E),y.isOrthogonal&&x.Gb(this.handle.segmentIndex+1,E),y.points=x,y.Wb(),y.updateAdornments(),this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name),this.handle===null){this.doDeactivate();return}}this.Fw=y.i(this.handle.segmentIndex),this.Yq=y.points.copy(),this.isActive=!0}}},$o.prototype.doDeactivate=function(){this.stopTransaction(),this.Ts=this.handle=null,this.isActive=this.diagram.isMouseCaptured=!1},$o.prototype.stopTransaction=function(){var a=this.diagram,y=zi.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},$o.prototype.doCancel=function(){var a=this.adornedLink;a!==null&&(a.points=this.Yq),this.stopTool()},$o.prototype.getResegmentingPoint=function(){return this.handle.ga(Or)},$o.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeReshape(a.lastInput.documentPoint),this.reshape(a))},$o.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var y=this.computeReshape(a.lastInput.documentPoint);if(this.reshape(y),y=this.adornedLink,y!==null&&y.resegmentable){var x=this.handle.segmentIndex,E=y.i(x-1),b=y.i(x),z=y.i(x+1);if(y.isOrthogonal){if(x>y.firstPickIndex+1&&x<y.lastPickIndex-1){var tt=y.i(x-2);if(Math.abs(E.x-b.x)<this.resegmentingDistance&&Math.abs(E.y-b.y)<this.resegmentingDistance&&(Zs(this,tt,E,b,z,!0)||Zs(this,tt,E,b,z,!1))){var rt=y.points.copy();Zs(this,tt,E,b,z,!0)?(rt.cd(x-2,new At(tt.x,(z.y+tt.y)/2)),rt.cd(x+1,new At(z.x,(z.y+tt.y)/2))):(rt.cd(x-2,new At((z.x+tt.x)/2,tt.y)),rt.cd(x+1,new At((z.x+tt.x)/2,z.y))),rt.mb(x),rt.mb(x-1),y.points=rt,y.Wb()}else tt=y.i(x+2),Math.abs(b.x-z.x)<this.resegmentingDistance&&Math.abs(b.y-z.y)<this.resegmentingDistance&&(Zs(this,E,b,z,tt,!0)||Zs(this,E,b,z,tt,!1))&&(rt=y.points.copy(),Zs(this,E,b,z,tt,!0)?(rt.cd(x-1,new At(E.x,(E.y+tt.y)/2)),rt.cd(x+2,new At(tt.x,(E.y+tt.y)/2))):(rt.cd(x-1,new At((E.x+tt.x)/2,E.y)),rt.cd(x+2,new At((E.x+tt.x)/2,tt.y))),rt.mb(x+1),rt.mb(x),y.points=rt,y.Wb())}}else tt=At.alloc(),Zt.qh(E.x,E.y,z.x,z.y,b.x,b.y,tt)&&tt.Bf(b)<this.resegmentingDistance*this.resegmentingDistance&&(E=y.points.copy(),E.mb(x),y.points=E,y.Wb()),At.free(tt)}a.Ya(),this.transactionResult=this.name,a.R("LinkReshaped",this.adornedLink,this.Yq)}this.stopTool()};function Zs(a,y,x,E,b,z){return z?Math.abs(y.y-x.y)<a.resegmentingDistance&&Math.abs(x.y-E.y)<a.resegmentingDistance&&Math.abs(E.y-b.y)<a.resegmentingDistance:Math.abs(y.x-x.x)<a.resegmentingDistance&&Math.abs(x.x-E.x)<a.resegmentingDistance&&Math.abs(E.x-b.x)<a.resegmentingDistance}$o.prototype.reshape=function(a){var y=this.adornedLink;y.uh();var x=this.handle.segmentIndex,E=this.Ru(this.handle);if(y.isOrthogonal)if(x===y.firstPickIndex+1)x=y.firstPickIndex+1,E===Ch?(y.L(x,y.i(x-1).x,a.y),y.L(x+1,y.i(x+2).x,a.y)):E===wh&&(y.L(x,a.x,y.i(x-1).y),y.L(x+1,a.x,y.i(x+2).y));else if(x===y.lastPickIndex-1)x=y.lastPickIndex-1,E===Ch?(y.L(x-1,y.i(x-2).x,a.y),y.L(x,y.i(x+1).x,a.y)):E===wh&&(y.L(x-1,a.x,y.i(x-2).y),y.L(x,a.x,y.i(x+1).y));else{E=x;var b=y.i(E),z=y.i(E-1),tt=y.i(E+1);Zt.B(z.x,b.x)&&Zt.B(b.y,tt.y)?(Zt.B(z.x,y.i(E-2).x)&&!Zt.B(z.y,y.i(E-2).y)?(y.m(E,a.x,z.y),x++,E++):y.L(E-1,a.x,z.y),Zt.B(tt.y,y.i(E+2).y)&&!Zt.B(tt.x,y.i(E+2).x)?y.m(E+1,tt.x,a.y):y.L(E+1,tt.x,a.y)):Zt.B(z.y,b.y)&&Zt.B(b.x,tt.x)?(Zt.B(z.y,y.i(E-2).y)&&!Zt.B(z.x,y.i(E-2).x)?(y.m(E,z.x,a.y),x++,E++):y.L(E-1,z.x,a.y),Zt.B(tt.x,y.i(E+2).x)&&!Zt.B(tt.y,y.i(E+2).y)?y.m(E+1,a.x,tt.y):y.L(E+1,a.x,tt.y)):Zt.B(z.x,b.x)&&Zt.B(b.x,tt.x)?(Zt.B(z.x,y.i(E-2).x)&&!Zt.B(z.y,y.i(E-2).y)?(y.m(E,a.x,z.y),x++,E++):y.L(E-1,a.x,z.y),Zt.B(tt.x,y.i(E+2).x)&&!Zt.B(tt.y,y.i(E+2).y)?y.m(E+1,a.x,tt.y):y.L(E+1,a.x,tt.y)):Zt.B(z.y,b.y)&&Zt.B(b.y,tt.y)&&(Zt.B(z.y,y.i(E-2).y)&&!Zt.B(z.x,y.i(E-2).x)?(y.m(E,z.x,a.y),x++,E++):y.L(E-1,z.x,a.y),Zt.B(tt.y,y.i(E+2).y)&&!Zt.B(tt.x,y.i(E+2).x)?y.m(E+1,tt.x,a.y):y.L(E+1,tt.x,a.y)),y.L(x,a.x,a.y)}else y.L(x,a.x,a.y),E=y.fromNode,b=y.fromPort,E!==null&&(z=E.findVisibleNode(),z!==null&&z!==E&&(E=z,b=E.port)),x===1&&y.computeSpot(!0,b).Mc()&&(z=b.ga(Or,At.alloc()),E=y.getLinkPointFromPoint(E,b,z,a,!0,At.alloc()),y.L(0,E.x,E.y),At.free(z),At.free(E)),E=y.toNode,b=y.toPort,E!==null&&(z=E.findVisibleNode(),z!==null&&z!==E&&(E=z,b=E.port)),x===y.pointsCount-2&&y.computeSpot(!1,b).Mc()&&(x=b.ga(Or,At.alloc()),a=y.getLinkPointFromPoint(E,b,x,a,!1,At.alloc()),y.L(y.pointsCount-1,a.x,a.y),At.free(x),At.free(a));y.zf()},$o.prototype.computeReshape=function(a){var y=this.adornedLink,x=this.handle.segmentIndex;switch(this.Ru(this.handle)){case sf:return a;case Ch:return new At(y.i(x).x,a.y);case wh:return new At(a.x,y.i(x).y);default:case ih:return y.i(x)}},ve.Object.defineProperties($o.prototype,{handleArchetype:{get:function(){return this.o},set:function(a){this.o=a}},midHandleArchetype:{get:function(){return this.u},set:function(a){this.u=a}},handle:{get:function(){return this.j},set:function(a){if(a!==null&&!(a.part instanceof Yr))throw Error("new handle is not in an Adornment: "+a);this.j=a}},adornedLink:{get:function(){return this.Ts}},resegmentingDistance:{get:function(){return this.F},set:function(a){this.F=a}},originalPoint:{get:function(){return this.Fw}},originalPoints:{get:function(){return this.Yq}}}),$o.prototype.setReshapingBehavior=$o.prototype.om,$o.prototype.getReshapingBehavior=$o.prototype.Ru;var ih=new He($o,"None",0),wh=new He($o,"Horizontal",1),Ch=new He($o,"Vertical",2),sf=new He($o,"All",3);$o.className="LinkReshapingTool",$o.None=ih,$o.Horizontal=wh,$o.Vertical=Ch,$o.All=sf,Ki("linkReshapingTool",function(){return this.findTool("LinkReshaping")},function(a){this.gb("LinkReshaping",a,this.mouseDownTools)});function rs(){zi.call(this),this.name="Resizing",this.o=new ln(1,1).freeze(),this.j=new ln(9999,9999).freeze(),this.yg=new ln(NaN,NaN).freeze(),this.V=!1,this.ia=!0,this.ue=null;var a=new cr;a.alignmentFocus=Or,a.figure="Rectangle",a.desiredSize=Tr,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.F=a,this.u=null,this.Xq=new At,this.Dw=new ln,this.Tn=new At,this.rt=new ln(0,0),this.qt=new ln(1/0,1/0),this.pt=new ln(1,1)}Se(rs,zi),rs.prototype.updateAdornments=function(a){if(!(a===null||a instanceof Tn)){if(a.isSelected&&!this.diagram.isReadOnly){var y=a.resizeObject,x=a.Pj(this.name);if(y!==null&&a.canResize()&&a.actualBounds.w()&&a.isVisible()&&y.actualBounds.w()&&y.Ed()&&((x===null||x.adornedObject!==y)&&(x=this.makeAdornment(y)),x!==null)){y=y.li(),md(a)&&this.updateResizeHandles(x,y),a.bh(this.name,x);return}}a.Jf(this.name)}},rs.prototype.makeAdornment=function(a){var y=a.part.resizeAdornmentTemplate;if(y===null){y=new Yr,y.type=En.Spot,y.locationSpot=Or;var x=new Es;x.isPanelMain=!0,y.add(x),y.add(this.makeHandle(a,eo)),y.add(this.makeHandle(a,Va)),y.add(this.makeHandle(a,No)),y.add(this.makeHandle(a,Sa)),y.add(this.makeHandle(a,Xa)),y.add(this.makeHandle(a,Fa)),y.add(this.makeHandle(a,Ma)),y.add(this.makeHandle(a,ns))}else if(Ol(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},rs.prototype.makeHandle=function(a,y){return a=this.handleArchetype,a===null?null:(a=a.copy(),a.alignment=y,a)},rs.prototype.updateResizeHandles=function(a,y){if(a!==null){if(!a.alignment.Xb()&&(a.cursor==="pointer"||0<a.cursor.indexOf("resize")))t:{var x=a.alignment;if(x.Mc()&&(x=Or),0>=x.x)y=0>=x.y?y+225:1<=x.y?y+135:y+180;else if(1<=x.x)0>=x.y?y+=315:1<=x.y&&(y+=45);else if(0>=x.y)y+=270;else if(1<=x.y)y+=90;else break t;0>y?y+=360:360<=y&&(y-=360),a.cursor=22.5>y?"e-resize":67.5>y?"se-resize":112.5>y?"s-resize":157.5>y?"sw-resize":202.5>y?"w-resize":247.5>y?"nw-resize":292.5>y?"n-resize":337.5>y?"ne-resize":"e-resize"}else if(a instanceof En)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,y)}},rs.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowResize&&a.lastInput.left?this.findToolHandleAt(a.firstInput.documentPoint,this.name)!==null:!1},rs.prototype.doActivate=function(){var a=this.diagram;this.handle===null&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name)),this.handle!==null&&(this.adornedObject=this.handle.part.adornedObject,this.adornedObject!==null&&(a.isMouseCaptured=!0,a.animationManager.Cc(),this.Ea(this.name),this.Xq.set(this.adornedObject.ga(this.handle.alignment.gv())),this.Tn.set(this.adornedObject.part.location),this.Dw.set(this.adornedObject.desiredSize),this.pt=this.computeCellSize(),this.rt=this.computeMinSize(),this.qt=this.computeMaxSize(),this.isActive=!0))},rs.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.isActive=a.isMouseCaptured=!1},rs.prototype.stopTransaction=function(){var a=this.diagram,y=zi.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},rs.prototype.doCancel=function(){this.adornedObject!==null&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation),this.stopTool()},rs.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive){var y=this.rt,x=this.qt,E=this.pt,b=this.adornedObject.qs(a.lastInput.documentPoint,At.alloc()),z=this.computeReshape();y=this.computeResize(b,this.handle.alignment,y,x,E,z),this.resize(y),a.bd(),At.free(b)}},rs.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var y=this.rt,x=this.qt,E=this.pt,b=this.adornedObject.qs(a.lastInput.documentPoint,At.alloc()),z=this.computeReshape();y=this.computeResize(b,this.handle.alignment,y,x,E,z),this.resize(y),At.free(b),a.Ya(),this.transactionResult=this.name,a.R("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()},rs.prototype.resize=function(a){var y=this.diagram,x=this.adornedObject;if(x!==null){if(x.desiredSize=a.size,a=x.part,a.Va(),x=x.ga(this.handle.alignment.gv()),a instanceof or){var E=new fn;if(E.add(a),!this.dragsMembers&&a.placeholder===null){var b=new at;b.dragsMembers=!1}y.moveParts(E,this.oppositePoint.copy().re(x),!0,b)}else a.location=a.location.copy().re(x).add(this.oppositePoint);y.bd()}},rs.prototype.computeResize=function(a,y,x,E,b,z){y.Mc()&&(y=Or);var tt=this.adornedObject.naturalBounds,rt=tt.x,ot=tt.y,lt=tt.x+tt.width,ut=tt.y+tt.height,ft=1;if(!z){ft=tt.width;var yt=tt.height;0>=ft&&(ft=1),0>=yt&&(yt=1),ft=yt/ft}return yt=At.alloc(),Zt.No(a.x,a.y,rt,ot,b.width,b.height,yt),a=tt.copy(),0>=y.x?0>=y.y?(a.x=Math.max(yt.x,lt-E.width),a.x=Math.min(a.x,lt-x.width),a.width=Math.max(lt-a.x,x.width),a.y=Math.max(yt.y,ut-E.height),a.y=Math.min(a.y,ut-x.height),a.height=Math.max(ut-a.y,x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ft*a.width,E.height),x.height),a.width=a.height/ft):(a.width=Math.max(Math.min(a.height/ft,E.width),x.width),a.height=ft*a.width),a.x=lt-a.width,a.y=ut-a.height)):1<=y.y?(a.x=Math.max(yt.x,lt-E.width),a.x=Math.min(a.x,lt-x.width),a.width=Math.max(lt-a.x,x.width),a.height=Math.max(Math.min(yt.y-ot,E.height),x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ft*a.width,E.height),x.height),a.width=a.height/ft):(a.width=Math.max(Math.min(a.height/ft,E.width),x.width),a.height=ft*a.width),a.x=lt-a.width)):(a.x=Math.max(yt.x,lt-E.width),a.x=Math.min(a.x,lt-x.width),a.width=lt-a.x,z||(a.height=Math.max(Math.min(ft*a.width,E.height),x.height),a.width=a.height/ft,a.y=ot+.5*(ut-ot-a.height))):1<=y.x?0>=y.y?(a.width=Math.max(Math.min(yt.x-rt,E.width),x.width),a.y=Math.max(yt.y,ut-E.height),a.y=Math.min(a.y,ut-x.height),a.height=Math.max(ut-a.y,x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ft*a.width,E.height),x.height),a.width=a.height/ft):(a.width=Math.max(Math.min(a.height/ft,E.width),x.width),a.height=ft*a.width),a.y=ut-a.height)):1<=y.y?(a.width=Math.max(Math.min(yt.x-rt,E.width),x.width),a.height=Math.max(Math.min(yt.y-ot,E.height),x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ft*a.width,E.height),x.height),a.width=a.height/ft):(a.width=Math.max(Math.min(a.height/ft,E.width),x.width),a.height=ft*a.width))):(a.width=Math.max(Math.min(yt.x-rt,E.width),x.width),z||(a.height=Math.max(Math.min(ft*a.width,E.height),x.height),a.width=a.height/ft,a.y=ot+.5*(ut-ot-a.height))):0>=y.y?(a.y=Math.max(yt.y,ut-E.height),a.y=Math.min(a.y,ut-x.height),a.height=ut-a.y,z||(a.width=Math.max(Math.min(a.height/ft,E.width),x.width),a.height=ft*a.width,a.x=rt+.5*(lt-rt-a.width))):1<=y.y&&(a.height=Math.max(Math.min(yt.y-ot,E.height),x.height),z||(a.width=Math.max(Math.min(a.height/ft,E.width),x.width),a.height=ft*a.width,a.x=rt+.5*(lt-rt-a.width))),At.free(yt),a},rs.prototype.computeReshape=function(){var a=un;return this.adornedObject instanceof cr&&(a=Ev(this.adornedObject)),!(a===wi||this.diagram.lastInput.shift)},rs.prototype.computeMinSize=function(){var a=this.adornedObject.minSize.copy(),y=this.minSize;return!isNaN(y.width)&&y.width>a.width&&(a.width=y.width),!isNaN(y.height)&&y.height>a.height&&(a.height=y.height),a},rs.prototype.computeMaxSize=function(){var a=this.adornedObject.maxSize.copy(),y=this.maxSize;return!isNaN(y.width)&&y.width<a.width&&(a.width=y.width),!isNaN(y.height)&&y.height<a.height&&(a.height=y.height),a},rs.prototype.computeCellSize=function(){var a=new ln(NaN,NaN),y=this.adornedObject.part;return y!==null&&(y=y.resizeCellSize,!isNaN(y.width)&&0<y.width&&(a.width=y.width),!isNaN(y.height)&&0<y.height&&(a.height=y.height)),y=this.cellSize,isNaN(a.width)&&!isNaN(y.width)&&0<y.width&&(a.width=y.width),isNaN(a.height)&&!isNaN(y.height)&&0<y.height&&(a.height=y.height),y=this.diagram,(isNaN(a.width)||isNaN(a.height))&&y&&(y=y.grid,y!==null&&y.visible&&this.isGridSnapEnabled&&(y=y.gridCellSize,isNaN(a.width)&&!isNaN(y.width)&&0<y.width&&(a.width=y.width),isNaN(a.height)&&!isNaN(y.height)&&0<y.height&&(a.height=y.height))),(isNaN(a.width)||a.width===0||a.width===1/0)&&(a.width=1),(isNaN(a.height)||a.height===0||a.height===1/0)&&(a.height=1),a},ve.Object.defineProperties(rs.prototype,{handleArchetype:{get:function(){return this.F},set:function(a){this.F=a}},handle:{get:function(){return this.u},set:function(a){if(a!==null&&!(a.part instanceof Yr))throw Error("new handle is not in an Adornment: "+a);this.u=a}},adornedObject:{get:function(){return this.ue},set:function(a){if(a!==null&&a.part instanceof Yr)throw Error("new handle must not be in an Adornment: "+a);this.ue=a}},minSize:{get:function(){return this.o},set:function(a){if(!this.o.D(a)){var y=a.width;isNaN(y)&&(y=0),a=a.height,isNaN(a)&&(a=0),this.o.h(y,a)}}},maxSize:{get:function(){return this.j},set:function(a){if(!this.j.D(a)){var y=a.width;isNaN(y)&&(y=1/0),a=a.height,isNaN(a)&&(a=1/0),this.j.h(y,a)}}},cellSize:{get:function(){return this.yg},set:function(a){this.yg.D(a)||this.yg.assign(a)}},isGridSnapEnabled:{get:function(){return this.V},set:function(a){this.V=a}},dragsMembers:{get:function(){return this.ia},set:function(a){this.ia=a}},oppositePoint:{get:function(){return this.Xq},set:function(a){this.Xq.D(a)||this.Xq.assign(a)}},originalDesiredSize:{get:function(){return this.Dw}},originalLocation:{get:function(){return this.Tn}}}),rs.className="ResizingTool",Ki("resizingTool",function(){return this.findTool("Resizing")},function(a){this.gb("Resizing",a,this.mouseDownTools)});function Ss(){zi.call(this),this.name="Rotating",this.ia=45,this.V=2,this.Tn=new At,this.ue=null;var a=new cr;a.figure="Ellipse",a.desiredSize=Lr,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.o=a,this.j=null,this.Cw=0,this.kr=new At(NaN,NaN),this.u=0,this.F=50}Se(Ss,zi),Ss.prototype.updateAdornments=function(a){if(a!==null){if(a.ph()){var y=a.rotateObject;if(y===a||y===a.path||y.isPanelMain)return}if(a.isSelected&&!this.diagram.isReadOnly&&(y=a.rotateObject,y!==null&&a.canRotate()&&a.actualBounds.w()&&a.isVisible()&&y.actualBounds.w()&&y.Ed())){var x=a.Pj(this.name);if((x===null||x.adornedObject!==y)&&(x=this.makeAdornment(y)),x!==null){x.angle=y.li(),x.placeholder===null&&(x.location=this.computeAdornmentLocation(y)),a.bh(this.name,x);return}}a.Jf(this.name)}},Ss.prototype.makeAdornment=function(a){var y=a.part.rotateAdornmentTemplate;if(y===null){y=new Yr,y.type=En.Position,y.locationSpot=Or;var x=this.handleArchetype;x!==null&&y.add(x.copy())}else if(Ol(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},Ss.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowRotate&&a.lastInput.left?this.findToolHandleAt(a.firstInput.documentPoint,this.name)!==null:!1},Ss.prototype.doActivate=function(){var a=this.diagram;if(this.adornedObject===null){if(this.handle===null&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name)),this.handle===null)return;this.adornedObject=this.handle.part.adornedObject}this.adornedObject!==null&&(a.isMouseCaptured=!0,a.delaysLayout=!0,this.Ea(this.name),this.Cw=this.adornedObject.angle,this.kr=this.computeRotationPoint(this.adornedObject),this.Tn=this.adornedObject.part.location.copy(),this.isActive=!0)},Ss.prototype.computeRotationPoint=function(a){var y=a.part,x=y.locationObject;return y.rotationSpot.sb()?a.ga(y.rotationSpot):a===y||a===x?x.ga(y.locationSpot):a.ga(Or)},Ss.prototype.computeAdornmentLocation=function(a){var y=this.rotationPoint;y.w()||(y=this.computeRotationPoint(a)),y=a.qs(y);var x=this.handleAngle;0>x?x+=360:360<=x&&(x-=360),x=Math.round(45*Math.round(x/45));var E=this.handleDistance;return x===0?y.x=a.naturalBounds.width+E:x===45?(y.x=a.naturalBounds.width+E,y.y=a.naturalBounds.height+E):x===90?y.y=a.naturalBounds.height+E:x===135?(y.x=-E,y.y=a.naturalBounds.height+E):x===180?y.x=-E:x===225?(y.x=-E,y.y=-E):x===270?y.y=-E:x===315&&(y.x=a.naturalBounds.width+E,y.y=-E),a.ga(y)},Ss.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.kr=new At(NaN,NaN),this.isActive=a.isMouseCaptured=!1},Ss.prototype.stopTransaction=function(){var a=this.diagram,y=zi.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},Ss.prototype.doCancel=function(){this.diagram.delaysLayout=!1,this.rotate(this.originalAngle),this.stopTool()},Ss.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))},Ss.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){a.delaysLayout=!1;var y=this.computeRotate(a.lastInput.documentPoint);this.rotate(y),a.Ya(),this.transactionResult=this.name,a.R("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()},Ss.prototype.rotate=function(a){var y=this.adornedObject;if(y!==null){y.angle=a,y=y.part,y.Va();var x=y.locationObject,E=y.rotateObject;(x===E||x.rg(E))&&(x=this.Tn.copy(),y.location=x.re(this.rotationPoint).rotate(a-this.originalAngle).add(this.rotationPoint)),this.diagram.bd()}},Ss.prototype.computeRotate=function(a){a=this.rotationPoint.ab(a)-this.handleAngle;var y=this.adornedObject.panel;y!==null&&(a-=y.li()),360<=a?a-=360:0>a&&(a+=360),y=Math.min(Math.abs(this.snapAngleMultiple),180);var x=Math.min(Math.abs(this.snapAngleEpsilon),y/2);return!this.diagram.lastInput.shift&&0<y&&0<x&&(a%y<x?a=Math.floor(a/y)*y:a%y>y-x&&(a=(Math.floor(a/y)+1)*y)),360<=a?a-=360:0>a&&(a+=360),a},ve.Object.defineProperties(Ss.prototype,{handleArchetype:{get:function(){return this.o},set:function(a){this.o=a}},handle:{get:function(){return this.j},set:function(a){if(a!==null&&!(a.part instanceof Yr))throw Error("new handle is not in an Adornment: "+a);this.j=a}},adornedObject:{get:function(){return this.ue},set:function(a){if(a!==null&&a.part instanceof Yr)throw Error("new handle must not be in an Adornment: "+a);this.ue=a}},snapAngleMultiple:{get:function(){return this.ia},set:function(a){this.ia=a}},snapAngleEpsilon:{get:function(){return this.V},set:function(a){this.V=a}},originalAngle:{get:function(){return this.Cw}},rotationPoint:{get:function(){return this.kr},set:function(a){this.kr=a.copy()}},handleAngle:{get:function(){return this.u},set:function(a){this.u=a}},handleDistance:{get:function(){return this.F},set:function(a){this.F=a}}}),Ss.className="RotatingTool",Ki("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.gb("Rotating",a,this.mouseDownTools)});function td(){zi.call(this),this.name="ClickSelecting"}Se(td,zi),td.prototype.canStart=function(){return!(!this.isEnabled||this.isBeyondDragSize())},td.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip()),this.stopTool()},td.className="ClickSelectingTool";function Nl(){zi.call(this),this.name="Action",this.pk=null}Se(Nl,zi),Nl.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram,y=a.lastInput,x=a.ic(y.documentPoint,function(E){for(;E.panel!==null&&!E.isActionable;)E=E.panel;return E});return x!==null&&x.isActionable?(this.pk=x,a.Ck=a.ic(y.documentPoint,null,null),!0):!1},Nl.prototype.doMouseDown=function(){if(this.isActive){var a=this.diagram.lastInput,y=this.pk;y!==null&&(a.targetObject=y,y.actionDown!==null&&y.actionDown(a,y))}else this.canStart()&&this.doActivate()},Nl.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram.lastInput,y=this.pk;y!==null&&(a.targetObject=y,y.actionMove!==null&&y.actionMove(a,y))}},Nl.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram.lastInput,y=this.pk;if(y===null)return;a.targetObject=y,y.actionUp!==null&&y.actionUp(a,y),this.standardMouseClick(function(x){for(;x.panel!==null&&(!x.isActionable||x!==y);)x=x.panel;return x},function(x){return x===y})}this.stopTool()},Nl.prototype.doCancel=function(){var a=this.diagram.lastInput,y=this.pk;y!==null&&(a.targetObject=y,y.actionCancel!==null&&y.actionCancel(a,y),this.stopTool())},Nl.prototype.doStop=function(){this.pk=null},Nl.className="ActionTool";function Eh(){zi.call(this),this.name="ClickCreating",this.Ri=null,this.o=!0,this.j=!1,this.mw=new At(0,0)}Se(Eh,zi),Eh.prototype.canStart=function(){if(!this.isEnabled||this.archetypeNodeData===null)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.lastInput.left||this.isBeyondDragSize())return!1;if(this.isDoubleClick){if(a.lastInput.clickCount===1&&(this.mw=a.lastInput.viewPoint.copy()),a.lastInput.clickCount!==2||this.isBeyondDragSize(this.mw))return!1}else if(a.lastInput.clickCount!==1)return!1;return!(a.currentTool!==this&&a.Ol(a.lastInput.documentPoint,!0)!==null)},Eh.prototype.doMouseUp=function(){var a=this.diagram;this.isActive&&this.insertPart(a.lastInput.documentPoint),this.stopTool()},Eh.prototype.insertPart=function(a){var y=this.diagram,x=this.archetypeNodeData;if(x===null)return null;var E=null;try{if(y.R("ChangingSelection",y.selection),this.Ea(this.name),x instanceof Ni)x.Zc()&&(Ol(x),E=x.copy(),E!==null&&y.add(E));else if(x!==null){var b=y.model.copyNodeData(x);We(b)&&(y.model.xf(b),E=y.Lc(b))}if(E!==null){var z=At.allocAt(a.x,a.y);this.isGridSnapEnabled&&Sf(this.diagram,E,a,z),E.location=z,y.allowSelect&&(y.clearSelection(!0),E.isSelected=!0),At.free(z)}y.Ya(),this.transactionResult=this.name,y.R("PartCreated",E)}finally{this.stopTransaction(),y.R("ChangedSelection",y.selection)}return E},ve.Object.defineProperties(Eh.prototype,{archetypeNodeData:{get:function(){return this.Ri},set:function(a){this.Ri=a}},isDoubleClick:{get:function(){return this.o},set:function(a){this.o=a}},isGridSnapEnabled:{get:function(){return this.j},set:function(a){this.j=a}}}),Eh.className="ClickCreatingTool";function fl(){zi.call(this),this.name="DragSelecting",this.Ik=175,this.o=!1;var a=new Ni;a.layerName="Tool",a.selectable=!1;var y=new cr;y.name="SHAPE",y.figure="Rectangle",y.fill=null,y.stroke="magenta",a.add(y),this.j=a}Se(fl,zi),fl.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(!a.allowSelect)return!1;var y=a.lastInput;return!(!y.left||a.currentTool!==this&&(!this.isBeyondDragSize()||y.timestamp-a.firstInput.timestamp<this.delay||a.Ol(y.documentPoint,!0)!==null))},fl.prototype.doActivate=function(){var a=this.diagram;this.isActive=!0,a.isMouseCaptured=!0,a.skipsUndoManager=!0,a.add(this.box),this.doMouseMove()},fl.prototype.doDeactivate=function(){var a=this.diagram;a.ug(),a.remove(this.box),a.skipsUndoManager=!1,this.isActive=a.isMouseCaptured=!1},fl.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive&&this.box!==null){var y=this.computeBoxBounds(),x=this.box.fb("SHAPE");x===null&&(x=this.box.Pb());var E=ln.alloc().h(y.width,y.height);x.desiredSize=E,this.box.mm(y.x,y.y,!1),ln.free(E),(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.gs(a.lastInput.viewPoint)}},fl.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram;a.remove(this.box);try{a.currentCursor="wait",a.R("ChangingSelection",a.selection),this.selectInRect(this.computeBoxBounds()),a.R("ChangedSelection",a.selection)}finally{a.currentCursor=""}}this.stopTool()},fl.prototype.computeBoxBounds=function(){var a=this.diagram;return new Be(a.firstInput.documentPoint,a.lastInput.documentPoint)},fl.prototype.selectInRect=function(a){var y=this.diagram,x=y.lastInput;if(a=y.ux(a,this.isPartialInclusion),vr?x.meta:x.control)if(x.shift)for(a=a.iterator;a.next();)y=a.value,y.isSelected&&(y.isSelected=!1);else for(a=a.iterator;a.next();)y=a.value,y.isSelected=!y.isSelected;else if(x.shift)for(a=a.iterator;a.next();)y=a.value,y.isSelected||(y.isSelected=!0);else{for(x=new fn,y=y.selection.iterator;y.next();){var E=y.value;a.contains(E)||x.add(E)}for(y=x.iterator;y.next();)y.value.isSelected=!1;for(a=a.iterator;a.next();)y=a.value,y.isSelected||(y.isSelected=!0)}},ve.Object.defineProperties(fl.prototype,{delay:{get:function(){return this.Ik},set:function(a){this.Ik=a}},isPartialInclusion:{get:function(){return this.o},set:function(a){this.o=a}},box:{get:function(){return this.j},set:function(a){this.j=a}}}),fl.className="DragSelectingTool";function Qa(){zi.call(this),this.name="Panning",this.Xt=new At,this.xy=new At,this.xg=!1;var a=this;this.Kw=function(){var y=a.diagram;y!==null&&y.removeEventListener($e.document,"scroll",a.Kw,!1),a.stopTool()}}Se(Qa,zi),Qa.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!(!a.allowHorizontalScroll&&!a.allowVerticalScroll||!a.lastInput.left||a.currentTool!==this&&!this.isBeyondDragSize())},Qa.prototype.doActivate=function(){var a=this.diagram;this.xg?(a.lastInput.bubbles=!0,a.addEventListener($e.document,"scroll",this.Kw,!1)):(a.currentCursor="move",a.isMouseCaptured=!0,this.Xt.assign(a.position)),this.isActive=!0},Qa.prototype.doDeactivate=function(){var a=this.diagram;a.currentCursor="",this.isActive=a.isMouseCaptured=!1},Qa.prototype.doCancel=function(){var a=this.diagram;a.position=this.Xt,a.isMouseCaptured=!1,this.stopTool()},Qa.prototype.doMouseMove=function(){this.move()},Qa.prototype.doMouseUp=function(){this.move(),this.stopTool()},Qa.prototype.move=function(){var a=this.diagram;if(this.isActive&&a)if(this.xg)a.lastInput.bubbles=!0;else{var y=a.position,x=a.firstInput.documentPoint,E=a.lastInput.documentPoint,b=y.x+x.x-E.x;x=y.y+x.y-E.y,a.allowHorizontalScroll||(b=y.x),a.allowVerticalScroll||(x=y.y),a.position=this.xy.h(b,x)}},ve.Object.defineProperties(Qa.prototype,{bubbles:{get:function(){return this.xg},set:function(a){this.xg=a}},originalPosition:{get:function(){return this.Xt}}}),Qa.className="PanningTool",Ki("clickCreatingTool",function(){return this.findTool("ClickCreating")},function(a){this.gb("ClickCreating",a,this.mouseUpTools)}),Ki("clickSelectingTool",function(){return this.findTool("ClickSelecting")},function(a){this.gb("ClickSelecting",a,this.mouseUpTools)}),Ki("panningTool",function(){return this.findTool("Panning")},function(a){this.gb("Panning",a,this.mouseMoveTools)}),Ki("dragSelectingTool",function(){return this.findTool("DragSelecting")},function(a){this.gb("DragSelecting",a,this.mouseMoveTools)}),Ki("actionTool",function(){return this.findTool("Action")},function(a){this.gb("Action",a,this.mouseDownTools)});function Eu(){this.F=this.u=this.j=this.o=null}ve.Object.defineProperties(Eu.prototype,{mainElement:{get:function(){return this.u},set:function(a){this.u=a}},show:{get:function(){return this.o},set:function(a){this.o!==a&&(this.o=a)}},hide:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a)}},valueFunction:{get:function(){return this.F},set:function(a){this.F=a}}}),Eu.className="HTMLInfo";function Bl(a,y,x){this.text=a,this.hx=y,this.visible=x}Bl.className="ContextMenuButtonInfo";function xs(){zi.call(this),this.name="ContextMenu",this.o=this.ht=this.j=null,this.yw=new At,this.jt=null,this.Et=!1;var a=this;this.tu=function(){a.stopTool()}}Se(xs,zi);function Kl(a){var y=new Eu;y.show=function(b,z,tt){tt.showDefaultContextMenu()},y.hide=function(b,z){z.hideDefaultContextMenu()},ed=y,a.tu=function(){a.stopTool()},y=Zn("div");var x=Zn("div");y.style.cssText="top: 0px;z-index:10002;position: fixed;display: none;text-align: center;left: 25%;width: 50%;background-color: #F5F5F5;padding: 16px;border: 16px solid #444;border-radius: 10px;margin-top: 10px",x.style.cssText="z-index:10001;position: fixed;display: none;top: 0;left: 0;width: 100%;height: 100%;background-color: black;opacity: 0.8;";var E=Zn("style");$e.document.getElementsByTagName("head")[0].appendChild(E),E.sheet.insertRule(".goCXul { list-style: none; }",0),E.sheet.insertRule(".goCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }",0),E.sheet.insertRule(".goCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }",0),E=a.diagram,E!==null&&(E.addEventListener(y,"contextmenu",la,!1),E.addEventListener(y,"selectstart",la,!1),E.addEventListener(x,"contextmenu",la,!1)),y.className="goCXforeground",x.className="goCXbackground",$e.document.body&&($e.document.body.appendChild(y),$e.document.body.appendChild(x)),vc=y,Id=x,mc=!0}function la(a){return a.preventDefault(),!1}xs.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return this.isBeyondDragSize()||!a.lastInput.right||1<a.lastInput.clickCount?!1:!!(a.lastInput.isTouchEvent&&this.defaultTouchContextMenu!==null||this.findObjectWithContextMenu()!==null)},xs.prototype.doStart=function(){this.yw.set(this.diagram.firstInput.documentPoint)},xs.prototype.doStop=function(){this.hideContextMenu(),this.currentObject=null},xs.prototype.findObjectWithContextMenu=function(a){a===void 0&&(a=null);var y=this.diagram,x=y.lastInput,E=null;if(a instanceof be||(a instanceof de?E=a:E=y.ic(x.documentPoint,null,function(b){return!b.layer.isTemporary})),E!==null){for(a=E;a!==null;){if(a.contextMenu!==null)return a;a=a.panel}if(y.lastInput.isTouchEvent&&this.defaultTouchContextMenu)return E.part}else if(y.contextMenu!==null)return y;return null},xs.prototype.doActivate=function(){},xs.prototype.doMouseDown=function(){if(zi.prototype.doMouseDown.call(this),this.isActive&&this.currentContextMenu instanceof Yr){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.canStart()&&(a.doActivate(),a.doMouseDown(),a.doDeactivate())}this.diagram.toolManager.mouseDownTools.contains(this)&&cu(this)},xs.prototype.doMouseUp=function(){if(this.isActive&&this.currentContextMenu instanceof Yr){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.canStart()&&(a.doActivate(),a.doCancel(),a.doDeactivate())}cu(this)};function cu(a){var y=a.diagram;if(a.isActive){var x=a.currentContextMenu;if(x!==null){var E=null;x instanceof Eu||(E=y.ic(y.lastInput.documentPoint,null,null),E!==null&&E.rg(x)&&a.standardMouseClick(null,null)),a.maybeStopTool(E)}}else a.canStart()&&(rh(a,!0),a.isActive||a.stopTool())}xs.prototype.maybeStopTool=function(){this.stopTool(),this.canStart()&&(this.diagram.currentTool=this,this.doMouseUp())};function rh(a,y,x){if(x===void 0&&(x=null),!a.Et&&(a.Et=!0,y&&a.standardMouseSelect(),y=a.standardMouseClick(),a.Et=!1,!y)){if(a.isActive=!0,y=ed,x===null&&(x=a.findObjectWithContextMenu()),x!==null){var E=x.contextMenu;E!==null?(a.currentObject=x instanceof de?x:null,a.showContextMenu(E,a.currentObject)):y!==null&&a.showContextMenu(y,a.currentObject)}else y!==null&&a.showContextMenu(y,null);a.currentContextMenu instanceof Yr&&!a.currentContextMenu.visible&&a.stopTool()}}xs.prototype.doMouseMove=function(){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.doMouseMove(),this.isActive&&this.diagram.toolManager.doMouseMove()},xs.prototype.showContextMenu=function(a,y){var x=this.diagram;if(a!==this.currentContextMenu&&this.hideContextMenu(),a instanceof Yr){a.layerName="Tool",a.selectable=!1,a.scale=1/x.scale,a.category=this.name,a.placeholder!==null&&(a.placeholder.scale=x.scale);var E=a.diagram;E!==null&&E!==x&&E.remove(a),x.add(a),y!==null?a.adornedObject=y:a.data=x.model,a.Va(),this.positionContextMenu(a,y)}else a instanceof Eu&&a.show(y,x,this);this.currentContextMenu=a},xs.prototype.positionContextMenu=function(a){if(a.placeholder===null){var y=this.diagram,x=y.lastInput.documentPoint.copy(),E=a.measuredBounds,b=y.viewportBounds;y.lastInput.isTouchEvent&&(x.x-=E.width),x.x+E.width>b.right&&(x.x-=E.width+5/y.scale),x.x<b.x&&(x.x=b.x),x.y+E.height>b.bottom&&(x.y-=E.height+5/y.scale),x.y<b.y&&(x.y=b.y),a.position=x}},xs.prototype.hideContextMenu=function(){var a=this.diagram,y=this.currentContextMenu;y!==null&&(y instanceof Yr?(a.remove(y),this.ht!==null&&this.ht.Jf(y.category),y.data=null,y.adornedObject=null):y instanceof Eu&&(y.hide!==null?y.hide(a,this):y.mainElement!==null&&(y.mainElement.style.display="none")),this.currentContextMenu=null,this.standardMouseOver())};function Lh(a){var y=new fn;return y.add(new Bl("Copy",function(x){x.commandHandler.copySelection()},function(x){return x.commandHandler.canCopySelection()})),y.add(new Bl("Cut",function(x){x.commandHandler.cutSelection()},function(x){return x.commandHandler.canCutSelection()})),y.add(new Bl("Delete",function(x){x.commandHandler.deleteSelection()},function(x){return x.commandHandler.canDeleteSelection()})),y.add(new Bl("Paste",function(x){x.commandHandler.pasteSelection(a.mouseDownPoint)},function(x){return x.commandHandler.canPasteSelection(a.mouseDownPoint)})),y.add(new Bl("Select All",function(x){x.commandHandler.selectAll()},function(x){return x.commandHandler.canSelectAll()})),y.add(new Bl("Undo",function(x){x.commandHandler.undo()},function(x){return x.commandHandler.canUndo()})),y.add(new Bl("Redo",function(x){x.commandHandler.redo()},function(x){return x.commandHandler.canRedo()})),y.add(new Bl("Scroll To Part",function(x){x.commandHandler.scrollToPart()},function(x){return x.commandHandler.canScrollToPart()})),y.add(new Bl("Zoom To Fit",function(x){x.commandHandler.zoomToFit()},function(x){return x.commandHandler.canZoomToFit()})),y.add(new Bl("Reset Zoom",function(x){x.commandHandler.resetZoom()},function(x){return x.commandHandler.canResetZoom()})),y.add(new Bl("Group Selection",function(x){x.commandHandler.groupSelection()},function(x){return x.commandHandler.canGroupSelection()})),y.add(new Bl("Ungroup Selection",function(x){x.commandHandler.ungroupSelection()},function(x){return x.commandHandler.canUngroupSelection()})),y.add(new Bl("Edit Text",function(x){x.commandHandler.editTextBlock()},function(x){return x.commandHandler.canEditTextBlock()})),y}xs.prototype.showDefaultContextMenu=function(){var a=this.diagram;this.jt===null&&(this.jt=Lh(this)),vc.innerHTML="",Id.addEventListener("pointerdown",this.tu,!1);var y=this,x=Zn("ul");x.className="goCXul",vc.appendChild(x),x.innerHTML="";for(var E=this.jt.iterator;E.next();){var b=E.value,z=b.visible;if(typeof b.hx=="function"&&(typeof z!="function"||z(a))){z=Zn("li"),z.className="goCXli";var tt=Zn("a");tt.className="goCXa",tt.href="#",tt.ky=b.hx,tt.addEventListener("pointerdown",function(rt){return this.ky(a),y.stopTool(),rt.preventDefault(),!1},!1),tt.textContent=b.text,z.appendChild(tt),x.appendChild(z)}}vc.style.display="block",Id.style.display="block"},xs.prototype.hideDefaultContextMenu=function(){if(this.currentContextMenu!==null&&this.currentContextMenu===ed){vc.style.display="none",Id.style.display="none";var a=this.diagram;a!==null&&a.removeEventListener(Id,"pointerdown",this.tu,!1),this.currentContextMenu=null}},ve.Object.defineProperties(xs.prototype,{currentContextMenu:{get:function(){return this.j},set:function(a){this.j=a,this.ht=a instanceof Yr?a.adornedPart:null}},defaultTouchContextMenu:{get:function(){return mc===!1&&ed===null&&qo&&Kl(this),ed},set:function(a){a===null&&(mc=!0),ed=a}},currentObject:{get:function(){return this.o},set:function(a){this.o=a}},mouseDownPoint:{get:function(){return this.yw}}});var ed=null,mc=!1,Id=null,vc=null;xs.className="ContextMenuTool",Ki("contextMenuTool",function(){return this.findTool("ContextMenu")},function(a){this.gb("ContextMenu",a,this.mouseUpTools)});function Zo(){zi.call(this),this.name="TextEditing",this.Zh=new To,this.ia=null,this.V=_d,this.vj=null,this.qa=Rd,this.u=1,this.F=!0,this.o=null,this.j=new Eu,this.kt=null,yc(this,this.j)}Se(Zo,zi);function yc(a,y){if(qo){var x=Zn("textarea");a.kt=x,x.addEventListener("input",function(){if(a.textBlock!==null){var E=a.Lx(this.value);this.style.width=20+E.measuredBounds.width*this.wA+"px",this.rows=E.lineCount}},!1),x.addEventListener("keydown",function(E){if(!E.isComposing&&a.textBlock!==null){var b=E.key;b==="Enter"?(a.textBlock.isMultiline===!1&&E.preventDefault(),a.acceptText(Sc)):b==="Tab"?(a.acceptText(uf),E.preventDefault()):b==="Escape"&&(a.doCancel(),a.diagram!==null&&a.diagram.doFocus())}},!1),x.addEventListener("focus",function(){if(a.currentTextEditor!==null&&a.state!==Rd){var E=a.kt;a.qa===xc&&(a.qa=Pc),typeof E.select=="function"&&a.selectsTextOnActivate&&(E.select(),E.setSelectionRange(0,9999))}},!1),x.addEventListener("blur",function(){if(a.currentTextEditor!==null&&a.state!==Rd){var E=a.kt;typeof E.focus=="function"&&E.focus(),typeof E.select=="function"&&a.selectsTextOnActivate&&(E.select(),E.setSelectionRange(0,9999))}},!1),y.valueFunction=function(){return x.value},y.mainElement=x,y.show=function(E,b,z){if(E instanceof To&&z instanceof Zo)if(z.state===wc)x.style.border="3px solid red",x.focus();else{var tt=E.ga(Or),rt=b.position,ot=b.scale,lt=E.Df()*ot;lt<z.minimumEditorScale&&(lt=z.minimumEditorScale);var ut=E.naturalBounds.width*lt+6,ft=E.naturalBounds.height*lt+2,yt=(tt.x-rt.x)*ot;tt=(tt.y-rt.y)*ot,rt=E.verticalAlignment,ot=(E.lineHeight+E.spacingAbove+E.spacingBelow)*E.lineCount*lt,ft=rt.y*ft-rt.y*ot+rt.offsetY-(.5*ft-.5*ot)-ot/2,x.value=E.text,b.div.style.font=E.font,x.style.position="absolute",x.style.zIndex="100",x.style.font="inherit",x.style.fontSize=100*lt+"%",x.style.lineHeight="normal",x.style.width=ut+"px",x.style.left=(yt-ut/2|0)-1+"px",x.style.top=(tt+ft|0)-1+"px",x.style.textAlign=E.textAlign,x.style.margin="0",x.style.padding="1px",x.style.border="0",x.style.outline="none",x.style.whiteSpace="pre-wrap",x.style.overflow="hidden",x.rows=E.lineCount,x.wA=lt,x.className="goTXarea",b.div.appendChild(x),x.focus(),z.selectsTextOnActivate&&(x.select(),x.setSelectionRange(0,9999))}},y.hide=function(E){E.div.removeChild(x)}}}Zo.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a===null||a.isReadOnly||Fh&&Fh!==this&&(Fh.acceptText(Lu),Fh&&Fh!==this)||!a.lastInput.left||this.isBeyondDragSize())return!1;var y=a.ic(a.lastInput.documentPoint);return y!==null&&y instanceof To&&y.editable&&y.part.canEdit()?(y=y.part,!(y===null||this.starting===_d&&!y.isSelected||this.starting===hf&&2>a.lastInput.clickCount)):!1},Zo.prototype.doStart=function(){Fh=this,this.textBlock!==null&&this.doActivate()},Zo.prototype.doActivate=function(){if(!this.isActive){var a=this.diagram;if(a!==null){var y=this.textBlock;if(y===null&&(y=a.ic(a.lastInput.documentPoint)),y!==null&&y instanceof To&&(this.textBlock=y,y.part!==null)){a.animationManager.Cc(),this.isActive=!0,this.qa=xc;var x=this.defaultTextEditor;y.textEditor!==null&&(x=y.textEditor),this.Zh=this.textBlock.copy();var E=new Be(this.textBlock.ga(eo),this.textBlock.ga(No));a.tv(E),x.show(y,a,this),this.currentTextEditor=x}}}},Zo.prototype.doCancel=function(){this.stopTool()},Zo.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()},Zo.prototype.doMouseDown=function(){this.isActive&&this.acceptText(Lu)},Zo.prototype.acceptText=function(a){switch(a){case Lu:this.qa===jd?this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus():(this.qa===xc||this.qa===wc||this.qa===Pc)&&(this.qa=pg,gg(this));break;case lf:case Sc:case uf:(Sc!==a||this.textBlock.isMultiline!==!0)&&(this.qa===xc||this.qa===wc||this.qa===Pc)&&(this.qa=pg,gg(this))}};function gg(a){var y=a.textBlock,x=a.diagram,E=a.currentTextEditor;if(y!==null&&E!==null){var b=y.text,z="";E.valueFunction!==null&&(z=E.valueFunction()),a.isValidText(y,b,z)?(a.Ea(a.name),a.qa=jd,a.transactionResult=a.name,y.text=z,a.doSuccess(b,z),x!==null&&x.R("TextEdited",y,b),a.stopTransaction(),a.stopTool(),x!==null&&x.doFocus()):(a.qa=wc,a.doError(b,z))}}Zo.prototype.doError=function(a,y){var x=this.textBlock;x.errorFunction!==null&&x.errorFunction(this,a,y),(a=this.currentTextEditor)&&a.show(x,this.diagram,this)},Zo.prototype.doSuccess=function(a,y){var x=this.textBlock;x.textEdited!==null&&x.textEdited(x,a,y)},Zo.prototype.doDeactivate=function(){var a=this.diagram;a!==null&&(this.qa=Rd,this.currentTextEditor!==null&&this.currentTextEditor.hide(a,this),this.textBlock=null,this.isActive=!1)},Zo.prototype.doStop=function(){Fh=null},Zo.prototype.isValidText=function(a,y,x){var E=this.textValidation;return E!==null&&!E(a,y,x)?!1:(E=a.textValidation,!!(E===null||E(a,y,x)))},Zo.prototype.Lx=function(a){var y=this.Zh;return y.text=a,y.measure(this.textBlock.Ih,1/0),y},ve.Object.defineProperties(Zo.prototype,{textBlock:{get:function(){return this.ia},set:function(a){this.ia=a}},currentTextEditor:{get:function(){return this.o},set:function(a){this.o=a}},defaultTextEditor:{get:function(){return this.j},set:function(a){this.j=a}},starting:{get:function(){return this.V},set:function(a){this.V=a}},textValidation:{get:function(){return this.vj},set:function(a){this.vj=a}},minimumEditorScale:{get:function(){return this.u},set:function(a){this.u=a}},selectsTextOnActivate:{get:function(){return this.F},set:function(a){this.F=a}},state:{get:function(){return this.qa},set:function(a){this.qa!==a&&(this.qa=a)}}}),Zo.prototype.measureTemporaryTextBlock=Zo.prototype.Lx;var lf=new He(Zo,"LostFocus",0),Lu=new He(Zo,"MouseDown",1),uf=new He(Zo,"Tab",2),Sc=new He(Zo,"Enter",3),q0=new He(Zo,"SingleClick",0),_d=new He(Zo,"SingleClickSelected",1),hf=new He(Zo,"DoubleClick",2),Rd=new He(Zo,"StateNone",0),xc=new He(Zo,"StateActive",1),Pc=new He(Zo,"StateEditing",2),pg=new He(Zo,"StateValidating",3),wc=new He(Zo,"StateInvalid",4),jd=new He(Zo,"StateValidated",5),Fh=null;Zo.className="TextEditingTool",Zo.LostFocus=lf,Zo.MouseDown=Lu,Zo.Tab=uf,Zo.Enter=Sc,Zo.SingleClick=q0,Zo.SingleClickSelected=_d,Zo.DoubleClick=hf,Zo.StateNone=Rd,Zo.StateActive=xc,Zo.StateEditing=Pc,Zo.StateValidating=pg,Zo.StateInvalid=wc,Zo.StateValidated=jd,Ki("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.gb("TextEditing",a,this.mouseUpTools)});function Js(a){Ec||(mg(),Ec=!0),this.H=ju,this.Ok=this.zb=this.vq=this.bc=!1,this.Qw=!0,this.Pk=ah,this.Dm=!1,this.Gh=this.Jd=!0,this.Dg=600,this.cw=this.Ow=!1,this.Zd=new pn,this.ce=new $a,this.ce.Yd=this,this.Ei=new pn,this.pu=new pn,this.Sr=new pn,this.pr=new pn,a&&Object.assign(this,a)}Js.prototype.Xe=function(a){this.H=a},Js.prototype.canStart=function(){return!0};function Ru(a,y){a.Jd&&a.canStart(y)&&(a.Zd.add(y),a.defaultAnimation.isAnimating&&a.Cc(),qa(a.H),a.zb=!0)}function df(a){if(a.Jd&&a.zb){var y=a.ce,x=a.H,E=a.Zd.contains("Model");E&&(a.Ok=!0,a.Pk===ah?(y.isViewportUnconstrained=!0,y.vc.clear(),y.add(x,"position",x.position.copy().offset(0,-200),x.position),y.add(x,"opacity",0,1)):a.Pk===vg&&y.vc.clear(),a.Qw=!!(a.Pk===Lc&&x.du.D(x.pa)),x.R("InitialAnimationStarting",a)),E&&!a.Gh||y.vc.count===0?(a.Zd.clear(),a.zb=!1,y.vc.clear(),Fc(y,x),a.Ok=!1,x.N()):(a.Zd.clear(),x.kg=!1,E=y.vc.get(x),x.autoScale!==cs&&E!==null&&(delete E.start.scale,delete E.end.scale),$e.requestAnimationFrame(function(){a.zb===!1||y.bc||(x.Gf("temporaryPixelRatio")&&As(x),wg(x),a.zb=!1,y.start(),y.bc&&(Mh(a),x.Ya(),yg(y,0),pl(x,!0),nd(a),x.R("AnimationStarting",a)))}))}}function oh(a){return a.Zd.contains("Trigger")&&a.Zd.count===1}function cf(a,y,x,E){a.isTicking||oh(a)||y instanceof Tn&&(y.fromNode!==null||y.toNode!==null)||a.ce.add(y,"position",x,E,!1)}wt=Js.prototype,wt.fv=function(a){return this.ce.fv(a)},wt.Xu=function(a){return this.ce.Xu(a)};function ff(a,y){function x(){if(0<b.Sr.count&&(E.addAll(b.Sr),b.Sr.clear(),b.bc=!0),b.bc!==!1&&E.count!==0){b.pu.addAll(E);for(var z=b.pu.iterator;z.next();){var tt=z.value;if(tt.bc!==!1){t:if(0<tt.yl.count)var rt=!0;else{for(rt=tt.vc.iterator;rt.next();){var ot=rt.key;if(ot instanceof de&&ot.diagram!==null||ot instanceof be){rt=!0;break t}}rt=!1}rt?Mc(tt,!1):tt.Xk=!0}}b.pu.clear(),b.bc!==!1&&(Mh(b),pl(b.H),nd(b)),$e.requestAnimationFrame(x)}}var E=a.Ei,b=a;a.bc?a.Sr.add(y):(a.bc=!0,E.add(y),$e.requestAnimationFrame(function(){x()}))}function Hp(a){for(a=a.Ei.iterator;a.next();)a.value.Xk=!1}function Mh(a){if(!a.vq){var y=a.H;a.Ow=y.skipsUndoManager,a.cw=y.skipsModelSourceBindings,y.skipsUndoManager=!0,y.skipsModelSourceBindings=!0,a.vq=!0}}function nd(a){var y=a.H;y.skipsUndoManager=a.Ow,y.skipsModelSourceBindings=a.cw,a.vq=!1}wt.Cc=function(a){var y=this.ce;if(this.zb===!0&&(this.Ok=this.zb=!1,this.Zd.clear(),0<y.vc.count&&this.H.$b()),this.bc){if(y.Ml(!0),y.vc.clear(),Fc(y,null),a===!0)for(a=this.Ei.Fa(),y=0;y<a.length;y++)a[y].Ml(!0)}else y.vc.clear(),Fc(y,this.H)},wt.Ml=function(a){a===this.defaultAnimation&&this.defaultAnimation.vc.clear(),this.Ei.remove(a),this.Ei.count===0&&(this.bc=!1,this.H.$b()),a===this.defaultAnimation&&(this.defaultAnimation.vc.clear(),this.H.R("AnimationFinished",this))},wt.Cj=function(a,y){this.zb&&(this.Zd.contains("Expand Tree")||this.Zd.contains("Expand SubGraph"))&&(this.ce.Cj(a,y),Gs(this,a))},wt.Aj=function(a,y){this.zb&&(this.Zd.contains("Collapse Tree")||this.Zd.contains("Collapse SubGraph"))&&(this.ce.Aj(a,y),kh(this.ce,y,"position",y.position,y.position),Gs(this,a))};function Wp(a,y,x){!a.zb||y.D(x)||oh(a)||(a.H.pi||(y=x.copy()),kh(a.ce,a.H,"position",y,x))}function gf(a,y,x){y.fd&&(y.Tg=x,a.pr.add(y))}function Gs(a,y){for(y=y.findLinksConnected();y.next();){var x=y.value;x.fd&&(x.Tg=x.points.copy(),a.pr.add(x))}}function id(a,y,x,E,b){a===null&&(a=[0,0,0,0]),y===null&&(y=[0,0,0,0]);var z=a[0],tt=a[1],rt=a[2];a=a[3];var ot=y[0],lt=y[1],ut=y[2];return y=y[3],rt===0||rt===100?(z=ot,tt=lt):(ut===0||ut===100)&&(ot=z,lt=tt),180<Math.abs(ot-z)&&(ot>z?z+=360:ot+=360),z=b(x,z,ot-z,E)%360,tt=b(x,tt,lt-tt,E),rt=b(x,rt,ut-rt,E),x=b(x,a,y-a,E),"hsla("+z+", "+tt+"%, "+rt+"%, "+x+")"}function mg(){function a(x,E,b,z,tt,rt){x.position=new At(z(tt,E.x,b.x-E.x,rt),z(tt,E.y,b.y-E.y,rt))}var y=new Ie;y.add("position:diagram",a),y.add("position",a),y.add("position:part",function(x,E,b,z,tt,rt){tt<rt?x.mm(z(tt,E.x,b.x-E.x,rt),z(tt,E.y,b.y-E.y,rt),!1):x.position=new At(z(tt,E.x,b.x-E.x,rt),z(tt,E.y,b.y-E.y,rt))}),y.add("location",function(x,E,b,z,tt,rt){tt<rt?x.mm(z(tt,E.x,b.x-E.x,rt),z(tt,E.y,b.y-E.y,rt),!0):x.location=new At(z(tt,E.x,b.x-E.x,rt),z(tt,E.y,b.y-E.y,rt))}),y.add("position:placeholder",function(x,E,b,z,tt,rt){tt<rt?x.mm(z(tt,E.x,b.x-E.x,rt),z(tt,E.y,b.y-E.y,rt),!1):x.position=new At(z(tt,E.x,b.x-E.x,rt),z(tt,E.y,b.y-E.y,rt))}),y.add("position:nodeCollapse",function(x,E,b,z,tt,rt){var ot=x.actualBounds,lt=b.actualBounds;b=lt.x+lt.width/2-ot.width/2,ot=lt.y+lt.height/2-ot.height/2,tt<rt?x.mm(z(tt,E.x,b-E.x,rt),z(tt,E.y,ot-E.y,rt),!1):x.position=new At(z(tt,E.x,b-E.x,rt),z(tt,E.y,ot-E.y,rt))}),y.add("desiredSize",function(x,E,b,z,tt,rt){x.desiredSize=new Be(z(tt,E.width,b.width-E.width,rt),z(tt,E.height,b.height-E.height,rt))}),y.add("width",function(x,E,b,z,tt,rt){x.width=z(tt,E,b-E,rt)}),y.add("height",function(x,E,b,z,tt,rt){x.height=z(tt,E,b-E,rt)}),y.add("fill",function(x,E,b,z,tt,rt){x.fill=id(E,b,tt,rt,z)}),y.add("stroke",function(x,E,b,z,tt,rt){x.stroke=id(E,b,tt,rt,z)}),y.add("strokeWidth",function(x,E,b,z,tt,rt){x.strokeWidth=z(tt,E,b-E,rt)}),y.add("strokeDashOffset",function(x,E,b,z,tt,rt){x.strokeDashOffset=z(tt,E,b-E,rt)}),y.add("background",function(x,E,b,z,tt,rt){x.background=id(E,b,tt,rt,z)}),y.add("areaBackground",function(x,E,b,z,tt,rt){x.areaBackground=id(E,b,tt,rt,z)}),y.add("opacity",function(x,E,b,z,tt,rt){x.opacity=z(tt,E,b-E,rt)}),y.add("scale",function(x,E,b,z,tt,rt){x.scale=z(tt,E,b-E,rt)}),y.add("angle",function(x,E,b,z,tt,rt){x.angle=z(tt,E,b-E,rt)}),Cc=y}ve.Object.defineProperties(Js.prototype,{animationReasons:{get:function(){return this.Zd}},isEnabled:{get:function(){return this.Jd},set:function(a){(this.Jd=a)&&this.Ei.each(function(y){y.isAnimating||y.runCount!==1/0||y.start()})}},duration:{get:function(){return this.Dg},set:function(a){1>a&&wn(a,">= 1",Js,"duration"),this.Dg=a}},isAnimating:{get:function(){return this.bc}},isTicking:{get:function(){return this.vq}},isInitial:{get:function(){return this.Gh},set:function(a){this.Gh=a}},defaultAnimation:{get:function(){return this.ce}},activeAnimations:{get:function(){return this.Ei}},initialAnimationStyle:{get:function(){return this.Pk},set:function(a){this.Pk=a}}}),Js.prototype.stopAnimation=Js.prototype.Cc;var Cc=null,Ec=!1,ah=new He(Js,"Default",1),Lc=new He(Js,"AnimateLocations",2),vg=new He(Js,"None",3);Js.className="AnimationManager",Js.defineAnimationEffect=function(a,y){Ec||(mg(),Ec=!0),Cc.add(a,y)},Js.Default=ah,Js.AnimateLocations=Lc,Js.None=vg;function $a(a){this.vu=this.Nw=this.Yd=this.H=null,this.Xk=this.bc=this.j=!1,this.cn=this.Qd=0,this.Lp=this.ot=zd,this.Wk=this.ho=!1,this.cu=1,this.au=0,this.Gd=this.Dg=NaN,this.gw=0,this.dn=null,this.o=Un,this.vc=new Ie,this.Tt=new Ie,this.yl=new pn,this.Ut=new pn,this.dw=Bh,a&&Object.assign(this,a)}$a.prototype.suspend=function(){this.Xk=!0},$a.prototype.advanceTo=function(a,y){y&&(this.Xk=!1),this.ho&&a>=this.Gd&&(this.Wk=!0,a-=this.Gd),this.gw=a,Mc(this,!0),Mh(this.Yd),pl(this.H),nd(this.Yd),this.H.redraw()};function Fc(a,y){if(a.Tt.clear(),a.Wk=!1,a.au=0,a.Gd=NaN,0<a.yl.count&&a.yl.clear(),0<a.Ut.count&&a.Ut.clear(),y!==null)for(a=y.links;a.next();)a.value.Tg=null}wt=$a.prototype,wt.start=function(){if(this.vc.count===0||this.bc)return this;for(var a=this.H,y=this.vc.iterator;y.next();){var x=y.key;a===null&&(x instanceof be?a=x:x instanceof de&&(a=x.diagram))}if(a!==null)this.H=a,this.Yd=a.animationManager;else return this;return y=this.Yd,y.isEnabled===!1?this:(this.Gd=isNaN(this.Dg)?y.duration:this.Dg,this.Lp=this.ot,y.Ok&&y.Pk===ah&&this===y.defaultAnimation&&(this.Lp=Vp,this.Gd=isNaN(this.Dg)?y.duration===600?900:y.duration:this.Dg),this.dw=a.scrollMode,this.isViewportUnconstrained&&(a.sj=Dc),Mh(y),this.yl.each(function(E){E.data=null,a.add(E)}),nd(y),this.bc=!0,this.Qd=+new Date,this.cn=this.Qd+this.Gd,ff(y,this),this)},wt.Iy=function(a,y){return a.Zc()?(this.yl.add(a),this.H=y,this):this},wt.add=function(a,y,x,E,b){if(y==="position"&&x.Xa(E))return this;if(this.H===null&&(a instanceof be?this.H=a:a instanceof de&&a.diagram!==null&&(this.H=a.diagram)),a instanceof Ni){if(!a.isAnimated)return this;y==="position"&&(y="position:part")}return kh(this,a,y,x,E,b),this};function kh(a,y,x,E,b,z){var tt=a.vc;if(y instanceof be&&x==="position"&&(x="position:diagram"),(x==="fill"||x==="stroke"||x==="background"||x==="areaBackground")&&(hh(E),av(),E=[ll.j,ll.u,ll.o,ll.F],hh(b),av(),b=[ll.j,ll.u,ll.o,ll.F]),tt.contains(y)){var rt=tt.I(y),ot=rt.start,lt=rt.end;ot[x]===void 0&&(ot[x]=rd(E)),lt[x]=rd(b)}else ot={},lt={},ot[x]=rd(E),lt[x]=rd(b),rt=ot.position,y instanceof de&&rt instanceof At&&!rt.w()&&y.diagram.animationManager.Zd.contains("Expand SubGraph")&&rt.assign(lt.position),rt=new od(ot,lt,z),tt.add(y,rt);tt=ot[x],tt instanceof At&&!tt.w()&&tt.assign(a.o),z&&x.indexOf("position:")===0&&y instanceof Ni?rt.Ku.location=rd(y.location):z&&(rt.Ku[x]=rd(E))}function rd(a){return a instanceof At||a instanceof ln?a.copy():a}wt.fv=function(a){return this.bc?(a=this.vc.I(a),a!==null&&a.nv):!1},wt.Xu=function(a){return this.bc?(a=this.vc.I(a),a!==null&&(a.start.position||a.start.location)):!1};function Mc(a,y){if(!a.Xk||y){var x=a.Yd;if(a.bc!==!1){var E=+new Date,b=E>a.cn?a.Gd:E-a.Qd;y&&(b=a.gw,b<a.Gd?(a.Qd=+new Date-b,a.cn=a.Qd+a.Gd):b=a.Gd),Mh(x),yg(a,b),pl(a.H,!0),nd(x),E>a.cn&&(a.ho&&!a.Wk?(a.Qd=+new Date,a.cn=a.Qd+a.Gd,a.Wk=!0):a.Ml(!1))}}}function yg(a,y){for(var x=a.Gd,E=a.vc.iterator,b=a.Wk;E.next();){var z=E.key;if(!(z instanceof de&&z.diagram===null)){var tt=E.value,rt=b?tt.end:tt.start;tt=b?tt.start:tt.end;var ot=Cc,lt;for(lt in tt)lt==="position"&&(tt["position:placeholder"]||tt["position:nodeCollapse"])||ot.get(lt)===null||ot.get(lt)(z,rt[lt],tt[lt],a.Lp,y,x,a)}}}wt.stop=function(){return this.bc?(this.Ml(!0),this):this},wt.Ml=function(a){if(this.vu!==null&&this.vu.jo.remove(this.Nw),this.bc){var y=this.H,x=this.Yd;this.Xk=this.bc=x.Ok=!1,Mh(x);for(var E=this.vc,b=this.yl.iterator;b.next();)y.remove(b.value);for(b=this.Ut.iterator;b.next();)b.value.v();b=this.ho,E=E.iterator;for(var z=Cc;E.next();){var tt=E.key,rt=E.value,ot=b?rt.end:rt.start,lt=b?rt.start:rt.end,ut=rt.Ku,ft;for(ft in lt)if(z.get(ft)!==null){var yt=ft;!rt.Hu||yt!=="position:nodeCollapse"&&yt!=="position:placeholder"||(yt="position"),z.get(yt)(tt,ot[ft],ut[ft]!==void 0?ut[ft]:rt.Hu?ot[ft]:lt[ft],this.Lp,this.Gd,this.Gd,this)}rt.Hu&&ut.location!==void 0&&tt instanceof Ni&&(tt.location=ut.location),rt.nv&&tt instanceof Ni&&tt.Zb(!1)}if(y.As.clear(),kc(y,!1),y.Ya(),y.N(),pl(y,!0),x.defaultAnimation===this){for(ft=x.pr.iterator;ft.next();)b=ft.value,b.Tg!==null&&(b.points=b.Tg,b.Tg=null);x.pr.clear()}pl(y,!0),this.isViewportUnconstrained&&(y.scrollMode=this.dw),nd(x),this.au++,!a&&this.cu>this.au?(this.Wk=!1,this.start()):(this.dn&&this.dn(this),Fc(this,null),x.Ml(this),y.$b())}},wt.Cj=function(a,y){var x=y.actualBounds,E=null;if(y instanceof or&&(E=y.placeholder),E!==null?(x=E.ga(eo),E=E.padding,x.x+=E.left,x.y+=E.top,this.add(a,"position",x,a.position,!1)):this.add(a,"position",new At(x.x+x.width/2,x.y+x.height/2),a.position,!1),this.add(a,"scale",.01,a.scale,!1),a instanceof or)for(a=a.memberParts;a.next();)E=a.value,E instanceof qn&&this.Cj(E,y)},wt.Aj=function(a,y){if(a.isVisible()){var x=null;if(y instanceof or&&(x=y.placeholder),x!==null){var E=x.ga(eo);x=x.padding,E.x+=x.left,E.y+=x.top,this.add(a,"position:placeholder",a.position,E,!0)}else this.add(a,"position:nodeCollapse",a.position,y,!0);if(this.add(a,"scale",a.scale,.01,!0),E=this.vc,E.contains(a)&&(E.I(a).nv=!0),a instanceof or)for(a=a.memberParts;a.next();)E=a.value,E instanceof qn&&this.Aj(E,y)}},wt.Ez=function(a){var y=this.Tt.get(a);return y===null&&(y={},this.Tt.add(a,y)),y},ve.Object.defineProperties($a.prototype,{duration:{get:function(){return this.Dg},set:function(a){1>a&&wn(a,">= 1",$a,"duration"),this.Dg=a}},reversible:{get:function(){return this.ho},set:function(a){this.ho=a}},runCount:{get:function(){return this.cu},set:function(a){0<a?this.cu=a:$t("Animation.runCount value must be a positive integer.")}},finished:{get:function(){return this.dn},set:function(a){this.dn!==a&&(this.dn=a)}},easing:{get:function(){return this.ot},set:function(a){this.ot=a}},isViewportUnconstrained:{get:function(){return this.j},set:function(a){this.j=a}},isAnimating:{get:function(){return this.bc}}}),$a.prototype.getTemporaryState=$a.prototype.Ez,$a.prototype.stop=$a.prototype.stop,$a.prototype.add=$a.prototype.add,$a.prototype.addTemporaryPart=$a.prototype.Iy;function zd(a,y,x,E){return a/=E/2,1>a?x/2*a*a+y:-x/2*(--a*(a-2)-1)+y}function Vp(a,y,x,E){return a===E?y+x:x*(-Math.pow(2,-10*a/E)+1)+y}$a.className="Animation",$a.EaseLinear=function(a,y,x,E){return x*a/E+y},$a.EaseInOutQuad=zd,$a.EaseInQuad=function(a,y,x,E){return x*(a/=E)*a+y},$a.EaseOutQuad=function(a,y,x,E){return-x*(a/=E)*(a-2)+y},$a.EaseInExpo=function(a,y,x,E){return a===0?y:x*Math.pow(2,10*(a/E-1))+y},$a.EaseOutExpo=Vp;function od(a,y,x){this.start=a,this.end=y,this.Ku={},this.Hu=x,this.nv=!1}od.className="AnimationState";function Ul(a,y,x){this.xd=null,this.rf=a,this.so=x||Sg,this.uk=null,y!==void 0&&(this.uk=y,x===void 0&&(this.so=ad))}Ul.prototype.copy=function(){var a=new Ul(this.rf);a.so=this.so;var y=this.uk;if(y!==null){var x={};y.duration!==void 0&&(x.duration=y.duration),y.finished!==void 0&&(x.finished=y.finished),y.easing!==void 0&&(x.easing=y.easing),a.uk=x}return a};function Kp(a,y){a=a.uk,a!==null&&(a.duration&&(y.duration=a.duration),a.finished&&(y.finished=a.finished),a.easing&&(y.easing=a.easing))}ve.Object.defineProperties(Ul.prototype,{propertyName:{get:function(){return this.rf},set:function(a){this.rf=a}},animationSettings:{get:function(){return this.uk},set:function(a){this.uk=a}},startCondition:{get:function(){return this.so},set:function(a){this.so=a}}});var Sg=new He(Ul,"Default",1),ad=new He(Ul,"Immediate",2),Zd=new He(Ul,"Bundled",3);Ul.className="AnimationTrigger",Ul.Default=Sg,Ul.Immediate=ad,Ul.Bundled=Zd;function _a(a){Di(this),this.H=null,this.Pa=new fn,this.xa="",this.pb=1,this.o=!1,this.j=this.Uh=this.u=this.Oi=this.Ni=this.Mi=this.Li=this.Ji=this.Ki=this.Ii=this.Qi=this.Hi=this.Pi=this.Gi=this.Fi=!0,this.Zq=[],a&&Object.assign(this,a)}wt=_a.prototype,wt.clear=function(){for(var a=this.Pa,y=0;y<a.length;y++){var x=a.s[y];x.Ig=null,ss(x)}a.clear(),this.Zq.length=0},wt.Xe=function(a){this.H=a},wt.toString=function(a){a===void 0&&(a=0);var y='Layer "'+this.name+'"';if(0>=a)return y;for(var x=0,E=0,b=0,z=0,tt=0,rt=this.Pa.iterator;rt.next();){var ot=rt.value;ot instanceof or?b++:ot instanceof qn?E++:ot instanceof Tn?z++:ot instanceof Yr?tt++:x++}if(rt="",0<x&&(rt+=x+" Parts "),0<E&&(rt+=E+" Nodes "),0<b&&(rt+=b+" Groups "),0<z&&(rt+=z+" Links "),0<tt&&(rt+=tt+" Adornments "),1<a)for(a=this.Pa.iterator;a.next();)x=a.value,rt+=`
`+x.toString(),E=x.data,E!==null&&Ai(E)&&(rt+=" #"+Ai(E)),x instanceof qn?rt+=" "+Bi(E):x instanceof Tn&&(rt+=" "+Bi(x.fromNode)+" "+Bi(x.toNode));return y+" "+this.Pa.count+": "+rt},wt.ic=function(a,y,x){if(y===void 0&&(y=null),x===void 0&&(x=null),this.Uh===!1)return null;var E=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(E=!0);for(var b=At.alloc(),z=this.Pa.s,tt=z.length;tt--;){var rt=z[tt];if((E!==!0||md(rt)!==!1)&&rt.isVisible()&&(b.assign(a),ii(b,rt.oe),rt=rt.ic(b,y,x),rt!==null&&(y!==null&&(rt=y(rt)),rt!==null&&(x===null||x(rt)))))return At.free(b),rt}return At.free(b),null},wt.ji=function(a,y,x,E){if(y===void 0&&(y=null),x===void 0&&(x=null),E instanceof fn||E instanceof pn||(E=new pn),this.Uh===!1)return E;var b=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(b=!0);for(var z=At.alloc(),tt=this.Pa.s,rt=tt.length;rt--;){var ot=tt[rt];if((b!==!0||md(ot)!==!1)&&ot.isVisible()){z.assign(a),ii(z,ot.oe);var lt=ot;ot.ji(z,y,x,E)&&(y!==null&&(lt=y(lt)),lt===null||x!==null&&!x(lt)||E.add(lt))}}return At.free(z),E},wt.Cf=function(a,y,x,E,b){if(y===void 0&&(y=null),x===void 0&&(x=null),E===void 0&&(E=!1),b instanceof fn||b instanceof pn||(b=new pn),this.Uh===!1)return b;var z=!1;this.diagram!==null&&this.diagram.viewportBounds.Re(a)&&(z=!0);for(var tt=this.Pa.s,rt=tt.length;rt--;){var ot=tt[rt];if((z!==!0||md(ot)!==!1)&&ot.isVisible()){var lt=ot;ot.Cf(a,y,x,E,b)&&(y!==null&&(lt=y(lt)),lt===null||x!==null&&!x(lt)||b.add(lt))}}return b},wt.Nu=function(a,y,x,E,b,z,tt){if(this.Uh===!1)return b;for(var rt=this.Pa.s,ot=rt.length;ot--;){var lt=rt[ot];if((tt!==!0||md(lt)!==!1)&&z(lt)&&lt.isVisible()){var ut=lt;lt.Cf(a,y,x,E,b)&&(y!==null&&(ut=y(ut)),ut===null||x!==null&&!x(ut)||b.add(ut))}}return b},wt.og=function(a,y,x,E,b,z){if(x===void 0&&(x=null),E===void 0&&(E=null),b===void 0&&(b=!0),b!==!1&&b!==!0&&((b instanceof fn||b instanceof pn)&&(z=b),b=!0),z instanceof fn||z instanceof pn||(z=new pn),this.Uh===!1)return z;var tt=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(tt=!0);for(var rt=At.alloc(),ot=At.alloc(),lt=this.Pa.s,ut=lt.length;ut--;){var ft=lt[ut];if((tt!==!0||md(ft)!==!1)&&ft.isVisible()){rt.assign(a),ii(rt,ft.oe),ot.h(a.x+y,a.y),ii(ot,ft.oe);var yt=ft;ft.og(rt,ot,x,E,b,z)&&(x!==null&&(yt=x(yt)),yt===null||E!==null&&!E(yt)||z.add(yt))}}return At.free(rt),At.free(ot),z},wt.Fd=function(a,y){if(this.visible){var x=this.Pa.s,E=x.length;if(E!==0){a=pi();for(var b=pi(),z=0;z<E;z++){var tt=x[z];if(tt.vw=z,tt instanceof Tn){if(tt.fd===!1)continue}else if(tt instanceof Yr&&tt.adornedPart!==null)continue;var rt=tt.actualBounds;tt.isVisible()&&Eo(rt,y)?(tt.Fd(!0),a.push(tt)):(tt.Fd(!1),tt.adornments!==null&&0<tt.adornments.count&&b.push(tt))}for(y=0;y<a.length;y++)for(x=a[y],Ov(x),x=x.adornments;x.next();)E=x.value,E.measure(1/0,1/0),E.arrange(),E.Fd(!0);for(y=0;y<b.length;y++)Ov(b[y]);oi(a),oi(b)}}};function sh(a,y){var x=1;return a.pb!==1&&(x=y.globalAlpha,y.globalAlpha=x*a.pb),x}wt.gc=function(a,y,x){if(this.visible&&this.pb!==0&&(x===void 0&&(x=!0),x||!this.isTemporary)){x=this.Pa.s;var E=x.length;if(E!==0){if(a.isTemporary)for(var b=0;b<E;b++)x[b].Gj();b=sh(this,a);var z=this.Zq;z.length=0;for(var tt=y.scale,rt=Be.alloc(),ot=0;ot<E;ot++)this.Oj(a,x[ot],y,z,tt,rt,!0);if(Be.free(rt),a.isTemporary)for(y=0;y<E;y++)x[y].Gj();a.globalAlpha=b}}};function Up(a,y,x,E,b){if(a.visible&&a.pb!==0&&(b||!a.isTemporary)){b=a.Pa.s;var z=b.length;if(z!==0){var tt=sh(a,y),rt=a.Zq;rt.length=0;for(var ot=x.scale,lt=Be.alloc(),ut=0;ut<z;ut++){var ft=b[ut];E.contains(ft)&&a.Oj(y,ft,x,rt,ot,lt,!1)}Be.free(lt),y.globalAlpha=tt}}}wt.Oj=function(a,y,x,E,b,z,tt){if(tt&&!md(y))a.Hs(y);else{if(E!==null&&y instanceof Tn&&(y.isOrthogonal&&E.push(y),y.fd===!1)){a.Hs(y);return}for(tt=!1,E=y.containingGroup;E!==null;)tt?E.tb!==null&&z.Ex(E.tb):E.tb!==null&&(tt=!0,z.assign(E.tb)),E=E.containingGroup;var rt=y.actualBounds;if(E=!1,tt&&y.isVisible()){if(!z.Yc(rt)){a.Hs(y);return}E=!z.Re(rt)}E&&(a.save(),a instanceof Qs?a.bk=z.copy():(a.beginPath(),a.rect(z.x,z.y,z.width,z.height),a.clip())),rt.width*b>x.Oq||rt.height*b>x.Oq?y.gc(a,x):(b=y.actualBounds,z=y.naturalBounds,b.width===0||b.height===0||isNaN(b.x)||isNaN(b.y)||!y.isVisible()||(x=y.transform,y.areaBackground!==null&&(na(y,a,y.areaBackground,!0,!0,z,b),a.fillRect(b.x,b.y,b.width,b.height)),y.areaBackground===null&&y.background===null&&(na(y,a,"rgba(0,0,0,0.3)",!0,!1,z,b),a.fillRect(b.x,b.y,b.width,b.height)),y.background!==null&&(a.transform(x.m11,x.m12,x.m21,x.m22,x.dx,x.dy),na(y,a,y.background,!0,!1,z,b),a.fillRect(0,0,z.width/2,z.height/2),x.ws()||(y=1/(x.m11*x.m22-x.m12*x.m21),a.transform(x.m22*y,-x.m12*y,-x.m21*y,x.m11*y,y*(x.m21*x.dy-x.m22*x.dx),y*(x.m12*x.dx-x.m11*x.dy)))))),E&&(a.restore(),a.Vc(!0))}},wt.g=function(a,y,x,E,b){var z=this.diagram;z!==null&&z.cb(Ir,a,this,y,x,E,b)},wt.oi=function(a,y,x){var E=this.Pa;if(y.Ig=this,this===null&&ss(y),a>=E.count)a=E.count;else if(E.M(a)===y)return-1;return E.Gb(a,y),y.Vo(x),E=this.diagram,E!==null&&(x?E.N():E.oi(y)),pf(this,a,y),a},wt.pc=function(a,y,x){if(!x&&y.layer!==this&&y.layer!==null)return y.layer.pc(a,y,x);var E=this.Pa;if(0>a||a>=E.length){if(a=E.indexOf(y),0>a)return-1}else if(E.M(a)!==y&&(a=E.indexOf(y),0>a))return-1;return y.Wo(x),E.mb(a),E=this.diagram,E!==null&&(x?E.N():E.pc(y)),y.Ig=null,ss(y),a};function pf(a,y,x){if(y=Yp(a,y,x),x instanceof or&&x!==null&&isNaN(x.zOrder)){if(x.memberParts.count!==0){for(var E=-1,b=a.Pa.s,z=b.length,tt=0;tt<z;tt++){var rt=b[tt];if(rt===x&&(y=tt,0<=E)||0>E&&rt.containingGroup===x&&(E=tt,0<=y))break}!(0>E)&&E<y&&(b=a.Pa,b.mb(y),b.Gb(E,x))}y=x.containingGroup,y!==null&&pf(a,-1,y)}x.svg!==null&&x.svg.remove()}function Yp(a,y,x){var E=x.zOrder;if(isNaN(E))return y;a=a.Pa;var b=a.count;if(1>=b)return y;if(0>y&&(y=a.indexOf(x)),0>y)return-1;for(var z=y-1,tt=NaN;0<=z&&(tt=a.M(z).zOrder,!!isNaN(tt));)z--;for(var rt=y+1,ot=NaN;rt<b&&(ot=a.M(rt).zOrder,!!isNaN(ot));)rt++;if(!isNaN(tt)&&tt>E)for(;;){if(z===-1||tt<=E){if(z++,z===y)break;return a.mb(y),a.Gb(z,x),z}for(tt=NaN;0<=--z&&(tt=a.M(z).zOrder,isNaN(tt)););}else if(!isNaN(ot)&&ot<E)for(;;){if(rt===b||ot>=E){if(rt--,rt===y)break;return a.mb(y),a.Gb(rt,x),rt}for(ot=NaN;++rt<b&&(ot=a.M(rt).zOrder,isNaN(ot)););}return y}ve.Object.defineProperties(_a.prototype,{parts:{get:function(){return this.Pa.iterator}},partsBackwards:{get:function(){return this.Pa.iteratorBackwards}},diagram:{get:function(){return this.H}},name:{get:function(){return this.xa},set:function(a){var y=this.xa;if(y!==a){var x=this.diagram;if(x!==null)for(y===""&&$t("Cannot rename default Layer to: "+a),x=x.layers;x.next();)x.value.name===a&&$t("Layer.name is already present in this diagram: "+a);for(this.xa=a,this.g("name",y,a),a=this.Pa.iterator;a.next();)a.value.layerName=this.xa}}},opacity:{get:function(){return this.pb},set:function(a){var y=this.pb;y!==a&&((0>a||1<a)&&wn(a,"0 <= value <= 1",_a,"opacity"),this.pb=a,this.g("opacity",y,a),a=this.diagram,a!==null&&a.N())}},isTemporary:{get:function(){return this.o},set:function(a){var y=this.o;y!==a&&((this.o=a)&&(this.isInDocumentBounds=!1),this.g("isTemporary",y,a))}},visible:{get:function(){return this.u},set:function(a){var y=this.u;if(y!==a){for(this.u=a,this.g("visible",y,a),y=this.Pa.iterator;y.next();)y.value.Zb(a);a=this.diagram,a!==null&&a.N()}}},pickable:{get:function(){return this.Uh},set:function(a){var y=this.Uh;y!==a&&(this.Uh=a,this.g("pickable",y,a))}},isInDocumentBounds:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a,this.diagram!==null&&this.diagram.Ya())}},allowCopy:{get:function(){return this.Fi},set:function(a){var y=this.Fi;y!==a&&(this.Fi=a,this.g("allowCopy",y,a))}},allowDelete:{get:function(){return this.Gi},set:function(a){var y=this.Gi;y!==a&&(this.Gi=a,this.g("allowDelete",y,a))}},allowTextEdit:{get:function(){return this.Pi},set:function(a){var y=this.Pi;y!==a&&(this.Pi=a,this.g("allowTextEdit",y,a))}},allowGroup:{get:function(){return this.Hi},set:function(a){var y=this.Hi;y!==a&&(this.Hi=a,this.g("allowGroup",y,a))}},allowUngroup:{get:function(){return this.Qi},set:function(a){var y=this.Qi;y!==a&&(this.Qi=a,this.g("allowUngroup",y,a))}},allowLink:{get:function(){return this.Ii},set:function(a){var y=this.Ii;y!==a&&(this.Ii=a,this.g("allowLink",y,a))}},allowRelink:{get:function(){return this.Ki},set:function(a){var y=this.Ki;y!==a&&(this.Ki=a,this.g("allowRelink",y,a))}},allowMove:{get:function(){return this.Ji},set:function(a){var y=this.Ji;y!==a&&(this.Ji=a,this.g("allowMove",y,a))}},allowReshape:{get:function(){return this.Li},set:function(a){var y=this.Li;y!==a&&(this.Li=a,this.g("allowReshape",y,a))}},allowResize:{get:function(){return this.Mi},set:function(a){var y=this.Mi;y!==a&&(this.Mi=a,this.g("allowResize",y,a))}},allowRotate:{get:function(){return this.Ni},set:function(a){var y=this.Ni;y!==a&&(this.Ni=a,this.g("allowRotate",y,a))}},allowSelect:{get:function(){return this.Oi},set:function(a){var y=this.Oi;y!==a&&(this.Oi=a,this.g("allowSelect",y,a))}}}),_a.prototype.findObjectsNear=_a.prototype.og,_a.prototype.findObjectsIn=_a.prototype.Cf,_a.prototype.findObjectsAt=_a.prototype.ji,_a.prototype.findObjectAt=_a.prototype.ic,_a.className="Layer";function be(a,y){if(lm||(os(),lm=!0),Di(this),ju=this,this.vb=!0,this.Ka=null,this.ya=this.Aa=0,this.ta=null,qo){var x=this,E=function(){x.removeEventListener($e.document,"DOMContentLoaded",E,!1),x.setRTL()};$e.document.body!==null?this.setRTL():x.addEventListener($e.document,"DOMContentLoaded",E,!1)}this.ol=null,Ff.add("Model",yo);var b=this;return this.Hb=function(z){var tt=b.partManager;if(z.model===tt.diagram.model&&tt.diagram.aa){tt.diagram.aa=!1;try{var rt=z.change;z.modelChange===""&&rt===Ir&&tt.updateDataBindings(z.object,z.propertyName)}finally{tt.diagram.aa=!0}}},this.Oc=function(z){b.partManager.doModelChanged(z)},this.hu=this.ku=null,Xp(this),this.model=hy(),this.Wg=!0,Qp(this),this.layout=new Wo,this.Wg=!1,this.ck=this.ek=this.fk=this.dk=this.ui=this.aA=this.$j=this.Ov=null,this.hk=function(){},this.preventDefault=null,this.rn=!1,this.Yf=new um,a!==void 0&&(typeof a=="string"||$e.Element&&a instanceof Element?Pg(this,a):y=a),this.vb=!1,y&&this.nm(y),this}var sd,ju;function Xp(a){a.Yd=new Js,a.Yd.Xe(a),a.Db=17,a.Gw=!1,a.tn=!1,a.bu="default",a.Wa=new fn,a.pj=new Ie,a.nl="default",a.Tx(),a.Sx(),a.pb=1,a.pa=new At(NaN,NaN).freeze(),a.du=new At(NaN,NaN),a.Ca=1,a.Pp=1,a.zt=new At(NaN,NaN).freeze(),a.At=NaN,a.Ot=1e-4,a.Mt=100,a.Ab=new fe,a.zu=new At(NaN,NaN).freeze(),a.ut=new Be(NaN,NaN,NaN,NaN).freeze(),a.rj=new ir(0,0,0,0).freeze(),a.sj=Bh,a.nu=!1,a.Zt=null,a.fu=null,a.yh=cs,a.zk=xa,a.Fg=cs,a.pq=xa,a.yt=eo,a.Bt=eo,a.Fc=!0,a.pn=!1,a.De=new pn,a.Eh=new Ie,a.Xm=!0,a.vp=250,a.vk=-1,a.xp=new ir(16,16,16,16).freeze(),a.kg=!1,a.Jk=!1,a.fn=!0,a.bq=new er,a.bq.diagram=a,a.Qg=new er,a.Qg.diagram=a,a.cj=new er,a.cj.diagram=a,a.zg=null,a.pf=null,a.qu=!1,ev(a),a.ai=new pn,a.Ht=!0,a.uu=Ah,a.pw=!1,a.wu=Tc,a.it="auto",a.Op="auto",a.zh=null,a.Fh=null,a.Bh=null,a.Qh=null,a.Oh=null,a.Nh=null,a.Qt=null,a.Lh=null,a.xt=!1,a.Mh=null,a.Ph=null,a.$h=null,a.Ch=null,a.Rt=!1,a.Yt={},a.oj=[null,null],a.Wg=!1,a.Iw=!1,a.ou=!1,a.lt=!1,a.rw=!0,a.ld=!1,a.$i=!1,a.Tw=!0,a.Ce=-2,a.Og=new Ie,a.Xn=new fn,a.Gg=!1,a.Jd=!0,a.Us=!0,a.Fi=!0,a.Gi=!0,a.Vs=!1,a.Ws=!0,a.Pi=!0,a.Hi=!0,a.Qi=!0,a.Ys=!0,a.Ii=!0,a.Ki=!0,a.Ji=!0,a.Li=!0,a.Mi=!0,a.Ni=!0,a.Oi=!0,a.Zs=!0,a.at=!0,a.qw=!1,a.Vk=!1,a.mn=!0,a.nn=!0,a.Xs=!0,a.$s=!0,a.iu=16,a.mu=16,a.qr=!1,a.gu=!1,a.lu=0,a.ju=0,a.yb=new ir(5).freeze(),a.Hw=new pn().freeze(),a.Nt=999999999,a.nw=new pn().freeze(),a.Zi=!0,a.Ee=!0,a.vd=!0,a.Be=!1,a.gf=!1,a.xh=!0,a.hf=!1,a.sy=new pn,a.ow=new pn,a.Xh=null,a.aw=new ln(8,8),a.bw=999,a.Bw=1,a.Jw=0,a.fc={scale:1,position:new At,bounds:new Be,Py:new ln,bA:new ln,Oz:!1},a.fc.canvasSize=a.fc.Py,a.fc.newCanvasSize=a.fc.bA,a.fc.isScroll=!1,a.Rw=new Be(NaN,NaN,NaN,NaN).freeze(),a.wo=new ln(NaN,NaN).freeze(),a.Sp=new Be(NaN,NaN,NaN,NaN).freeze(),a.It=!1,a.Lg=new Ie;var y=new qn,x=new To;x.bind(new ua("text","",Bi)),y.add(x),a.ny=y,a.Lg.add("",y),y=new qn,x=new To,x.stroke="brown",x.bind(new ua("text","",Bi)),y.add(x),a.Lg.add("Comment",y),y=new qn,y.selectable=!1,y.avoidable=!1,x=new cr,x.figure="Ellipse",x.fill="black",x.stroke=null,x.desiredSize=new ln(3,3).ja(),y.add(x),a.Lg.add("LinkLabel",y),a.Yi=new Ie,y=new or,y.selectionObjectName="GROUPPANEL",y.type=En.Vertical,x=new To,x.font="bold 12pt sans-serif",x.bind(new ua("text","",Bi)),y.add(x),x=new En(En.Auto),x.name="GROUPPANEL";var E=new cr;E.figure="Rectangle",E.fill="rgba(128,128,128,0.2)",E.stroke="black",x.add(E),E=new Es,E.padding=new ir(5,5,5,5).ja(),x.add(E),y.add(x),a.ly=y,a.Yi.add("",y),a.Kh=new Ie,y=new Tn,x=new cr,x.isPanelMain=!0,y.add(x),x=new cr,x.toArrow="Standard",x.fill="black",x.stroke=null,x.strokeWidth=0,y.add(x),a.my=y,a.Kh.add("",y),y=new Tn,x=new cr,x.isPanelMain=!0,x.stroke="brown",y.add(x),a.Kh.add("Comment",y),y=new Yr,y.type=En.Auto,x=new cr,x.fill=null,x.stroke="dodgerblue",x.strokeWidth=3,y.add(x),x=new Es,x.margin=new ir(1.5,1.5,1.5,1.5).ja(),y.add(x),a.St=y,a.wt=y,y=new Yr,y.type=En.Link,x=new cr,x.isPanelMain=!0,x.fill=null,x.stroke="dodgerblue",x.strokeWidth=3,y.add(x),a.Kt=y,a.fe=null,a.mq=!1,a.Ck=null,a.partManager=new yo,a.toolManager=new Nr,a.toolManager.initializeStandardTools(),a.defaultTool=a.toolManager,a.currentTool=a.defaultTool,a.nt=null,a.Wm=new at,a.Vt=null,a.Wt=null,a.Mr=!1,a.commandHandler=Jp(),a.eq=null,a.fq=vi,a.Pw=!1,a.Mb=1,a.Yh=null,a.Oq=1,a.Sq=0,a.zw=[0,0,0,0,0],a.Tq=0,a.yq=1,a.tw=0,a.uw=new At,a.zy=500,a.wp=new At,a.wq=!1}be.prototype.clear=function(){this.animationManager.Cc(),this.model.clear(),Yd=null,cd="",xg(this,!1),this.Xn.clear(),jf(),this.Og.clear(),this.Xh=null,this.Ya(),this.Va(),this.N()};function xg(a,y){a.animationManager.Cc(!0),a.Hw=new pn().freeze(),a.nw=new pn().freeze();var x=a.skipsUndoManager,E=a.cc!==null&&a.cc!==void 0;E&&(a.skipsUndoManager=!0);var b=null;a.fe!==null&&(b=a.fe.part,b!==null&&a.remove(b));var z=[],tt=a.Wa.length;if(y){for(y=0;y<tt;y++)for(var rt=a.Wa.s[y].parts;rt.next();){var ot=rt.value;ot!==b&&ot.data===null&&z.push(ot)}for(y=0;y<z.length;y++)a.remove(z[y])}for(y=0;y<tt;y++)a.Wa.s[y].clear();return a.partManager.clear(),a.De.clear(),a.Eh.clear(),a.ai.clear(),a.Ck=null,a.Xn.clear(),jf(),a.Og.clear(),Xr=[],b!==null&&(a.add(b),a.partManager.parts.remove(b)),E&&(a.skipsUndoManager=x),z}function Jp(){return null}be.prototype.reset=function(){this.clear(),this.vb=!0,Xp(this),Mu(this),this.Wg=!0,Qp(this),this.layout=new Wo,this.Wg=!1,this.model=hy(),this.model.undoManager=new po,this.vb=this.rn=!1,this.N()},be.prototype.setRTL=function(a){a=a===void 0?this.div:a,a===null&&(a=$e.document.body);var y=Zn("div");y.dir="rtl",y.style.cssText="font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;",y.textContent="A",a.appendChild(y);var x="reverse";0<y.scrollLeft?x="default":(y.scrollLeft=1,y.scrollLeft===0&&(x="negative")),a.removeChild(y),this.bu=x},be.prototype.setScrollWidth=function(a){a=a===void 0?this.div:a,a===null&&(a=$e.document.body);var y=0;if(qo){var x=sm;y=sd,x===null&&(x=sm=Zn("p"),x.style.width="100%",x.style.height="200px",x.style.boxSizing="content-box",y=sd=Zn("div"),y.style.position="absolute",y.style.visibility="hidden",y.style.width="200px",y.style.height="150px",y.style.boxSizing="content-box",y.appendChild(x)),y.style.overflow="hidden",a.appendChild(y);var E=x.offsetWidth;y.style.overflow="scroll",x=x.offsetWidth,E===x&&(x=y.clientWidth),a.removeChild(y),y=E-x,y!==0||vr||(y=11)}this.Db=y,this.Gw=!0},be.prototype.qb=function(a){a.classType===be&&(this.autoScale=a)},be.prototype.toString=function(a){a===void 0&&(a=0);var y="";if(this.div&&this.div.id&&(y=this.div.id),y='Diagram "'+y+'"',0>=a)return y;for(var x=this.Wa.iterator;x.next();)y+=`
`+x.value.toString(a-1);return y};function Pg(a,y){if(qo){if(y!=null||$t("Diagram setup requires an argument DIV."),a.Ka!==null&&$t("Diagram has already completed setup."),typeof y=="string"?a.Ka=$e.document.getElementById(y):y instanceof HTMLDivElement?a.Ka=y:$t("No DIV or DIV id supplied: "+y),a.Ka===null&&$t("Invalid DIV id; could not get element with id: "+y),a.Ka.H!==void 0&&$t("Invalid div id; div already has a Diagram associated with it."),!a.ol&&$e.ResizeObserver){var x=Fe(function(){a.$b()},250);a.ol=new $e.ResizeObserver(function(){x()}),a.ol.observe(a.Ka)}$e.getComputedStyle(a.Ka,null).position==="static"&&(a.Ka.style.position="relative"),y=5;var E="rgba(2"+y+"5, 255, 255, 0)";y--,a.Ka.style["-webkit-tap-highlight-color"]=E,a.Ka.innerHTML="",a.Ka.H=a,a.Ka.goDiagram=a,a.Ka.go=$e.go;var b=new Dl(a);if(b.style!==void 0&&(b.style.position="absolute",b.style.top="0px",b.style.left="0px",$e.getComputedStyle(a.Ka,null).getPropertyValue("direction")==="rtl"&&(a.tn=!0),b.style.zIndex="2",b.style.userSelect="none",b.style.MozUserSelect="none",b.style.touchAction="none",b.style.letterSpacing="normal !important",b.style.wordSpacing="normal !important"),a.ta=b,a.ib=b.context,E=a.ib,a.Mb=a.computePixelRatio(),a.viewSize.w()||(a.Aa=a.Ka.clientWidth||1,a.ya=a.Ka.clientHeight||1),bg(a,a.Aa,a.ya),a.Ka.insertBefore(b.Oa,a.Ka.firstChild),b=new Dl(null),b.width=1,b.height=1,a.jw=b,a.oy=b.context,qo){b=Zn("div");var z=Zn("div");b.style.position="absolute",b.style.overflow="auto",b.style.width=a.Aa+"px",b.style.height=a.ya+"px",b.style.zIndex="1",z.style.position="absolute",z.style.width="1px",z.style.height="1px",a.Ka.appendChild(b),b.appendChild(z),b.onscroll=qp,b.addEventListener("pointerdown",tm),b.H=a,b.uy=!0,b.vy=!0,a.ku=b,a.hu=z}a.hk=Fe(function(){a.Yh=null,a.N()},300),a.Ov=Fe(function(){wg(a)},250),a.preventDefault=function(tt){return tt.preventDefault(),!1},a.$j=function(tt){if(a.isEnabled){var rt=gl(a,tt,!0);rt.bubbles=!0;var ot=0,lt=0;rt.delta=0,tt.deltaX!==void 0?(tt.deltaX!==0&&(ot=0<tt.deltaX?1:-1),tt.deltaY!==0&&(lt=0<tt.deltaY?1:-1),rt.delta=Math.abs(tt.deltaX)>Math.abs(tt.deltaY)?-ot:-lt):tt.wheelDeltaX!==void 0?(tt.wheelDeltaX!==0&&(ot=0<tt.wheelDeltaX?-1:1),tt.wheelDeltaY!==0&&(lt=0<tt.wheelDeltaY?-1:1),rt.delta=Math.abs(tt.wheelDeltaX)>Math.abs(tt.wheelDeltaY)?-ot:-lt):tt.wheelDelta!==void 0&&tt.wheelDelta!==0&&(rt.delta=0<tt.wheelDelta?1:-1),a.doMouseWheel(),Yl(rt,tt)}},a.aA=function(tt){a.isEnabled&&(a.Vk=!1,gl(a,tt,!0),tt=a.currentTool,tt.cancelWaitAfter(),tt.standardMouseOver())},a.ui=function(tt){if(a.isEnabled){a.Vk=!0;var rt=a.Yt;rt[tt.pointerId]===void 0&&(rt[tt.pointerId]=tt),rt=a.oj;var ot=!1;if(rt[0]===null||rt[0].pointerId!==tt.pointerId&&rt[0].pointerType===tt.pointerType)if(rt[1]!==null&&rt[1].pointerId===tt.pointerId)rt[1]=tt,ot=!0;else if(rt[0]===null)rt[0]=tt;else if(rt[1]===null)rt[1]=tt,ot=!0;else{tt.preventDefault();return}else rt[0]=tt;(rt=tt.pointerType==="touch"||tt.pointerType==="pen")&&(a.qu=!1,a.wq=!0);var lt=ot;ot=Fg(a,tt,!0,!1,!0,lt),Hd(a,tt,ot),ot.targetDiagram=Lg(tt,tt.target),ot.targetObject=null,lt||ot.clone(a.bq),lt=a.uw,rt=rt?25:10,tt.timeStamp-a.tw<a.zy&&!(Math.abs(lt.x-tt.screenX)>rt||Math.abs(lt.y-tt.screenY)>rt)?a.yq++:a.yq=1,ot.clickCount=a.yq,a.tw=tt.timeStamp,a.uw.sg(tt.screenX,tt.screenY),a.doMouseDown(),tt.button===1?tt.preventDefault():Yl(ot,tt)}},a.dk=function(tt){if(a.isEnabled){a.Vk=!0;var rt=a.oj;if(rt[0]===null||rt[0].pointerId!==tt.pointerId&&rt[0].pointerType===tt.pointerType){if(rt[1]!==null&&rt[1].pointerId===tt.pointerId){rt[1]=tt;return}if(rt[0]===null)rt[0]=tt;else return}else rt[0]=tt;if(rt[0].pointerId===tt.pointerId){rt=Fg(a,tt,!1,!1,!1,rt[1]!==null);var ot=$e.document.elementFromPoint(tt.clientX,tt.clientY)||null;ot!==null&&ot.shadowRoot!==void 0&&ot.shadowRoot!==null&&(ot=ot.shadowRoot.elementFromPoint(tt.clientX,tt.clientY));var lt=a,ut=tt;ot&&ot.H&&(ut=tt,lt=ot.H),rt.targetDiagram=lt,Hd(a,ut,rt),rt.targetObject=null,a.doMouseMove(),Yl(rt,tt)}}},a.fk=function(tt){if(a.isEnabled){a.Vk=!0;var rt=tt.pointerType==="touch"||tt.pointerType==="pen",ot=a.Yt;if(rt&&a.qu)delete ot[tt.pointerId],tt.preventDefault();else if(ot=a.oj,ot[0]===null||ot[0].pointerId!==tt.pointerId&&ot[0].pointerType===tt.pointerType)ot[1]!==null&&ot[1].pointerId===tt.pointerId&&(ot[1]=null);else{ot[0]=null,ot=Fg(a,tt,!1,!0,!0,!1);var lt=$e.document.elementFromPoint(tt.clientX,tt.clientY)||null;lt!==null&&lt.shadowRoot!==void 0&&lt.shadowRoot!==null&&(lt=lt.shadowRoot.elementFromPoint(tt.clientX,tt.clientY)),lt!==null&&lt.H instanceof be&&lt.H!==a&&Hd(lt.H,tt,ot),lt===null&&(lt=tt.target),Hd(a,tt,ot),ot.clickCount=a.yq,ot.targetDiagram=Lg(tt,lt),ot.targetObject=null,a.doMouseUp(),Yl(ot,tt),rt&&(a.wq=!1)}}},a.ek=function(tt){if(a.isEnabled){a.Vk=!1;var rt=a.Yt;rt[tt.pointerId]&&delete rt[tt.pointerId],rt=a.oj,rt[0]!==null&&rt[0].pointerId===tt.pointerId&&(rt[0]=null),rt[1]!==null&&rt[1].pointerId===tt.pointerId&&(rt[1]=null),tt.pointerType!=="touch"&&tt.pointerType!=="pen"&&(tt=a.currentTool,tt.cancelWaitAfter(),tt.standardMouseOver())}},a.ck=function(tt){var rt=a.oj;rt[0]!==null&&rt[0].pointerId===tt.pointerId?(rt[0]=null,a.wq=!1):rt[1]!==null&&rt[1].pointerId===tt.pointerId&&(rt[1]=null)},a.Vp=E.Z["d"+Ic[1]+Ic[2]+"wI"+Jd.slice(1,5)]["b"+Ax.slice(1,y)](E.Z,Oc,y,y),E.Vc(!0),tv(a),a.nl==="svg"&&(y=a.pj.get("svg"),a.Ka.appendChild(y.Oa),a.ib=y.context)}}be.prototype.addEventListener=function(a,y,x,E){a.addEventListener(y,x,{capture:E,passive:!1})},be.prototype.removeEventListener=function(a,y,x,E){a.removeEventListener(y,x,{capture:E})};function tv(a){var y=a.ta.Oa;y instanceof HTMLCanvasElement||(y=a.div),a.addEventListener(y,"pointerdown",a.ui,!1),a.addEventListener(y,"pointermove",a.dk,!1),a.addEventListener(y,"pointerup",a.fk,!1),a.addEventListener(y,"pointerout",a.ek,!1),a.addEventListener(y,"pointercancel",a.ck,!1),a.addEventListener(y,"pointerenter",a.bz,!1),a.addEventListener(y,"pointerleave",a.cz,!1),a.addEventListener(y,"wheel",a.$j,!1),a.addEventListener(y,"keydown",a.Qz,!1),a.addEventListener(y,"keyup",a.Rz,!1),a.addEventListener(y,"blur",a.Ny,!1),a.addEventListener(y,"focus",a.Oy,!1),a.addEventListener(y,"selectstart",function(x){return x.preventDefault(),!1},!1),a.addEventListener(y,"contextmenu",function(x){return x.preventDefault(),!1},!1),a.addEventListener($e,"resize",a.Ov,!1)}function As(a){30<a.Sq&&(a.Yh=1)}function kc(a,y){a.Yh!==null&&(a.Yh=null,y&&a.hk(),Ii&&Ii.nx||(a.Sq=0,a.zw=[0,0,0,0,0],a.Tq=0))}be.prototype.computePixelRatio=function(){return this.Yh!==null?this.Yh:$e.devicePixelRatio||1},be.prototype.doMouseMove=function(){this.currentTool.doMouseMove()},be.prototype.doMouseDown=function(){this.currentTool.doMouseDown()},be.prototype.doMouseUp=function(){this.currentTool.doMouseUp()},be.prototype.doMouseWheel=function(){this.currentTool.doMouseWheel()},be.prototype.doKeyDown=function(){this.currentTool.doKeyDown()},be.prototype.doKeyUp=function(){this.currentTool.doKeyUp()},be.prototype.doFocus=function(){this.focus()},be.prototype.focus=function(){if(this.ta)if(this.scrollsPageOnFocus)this.ta.focus();else{var a=$e.scrollX||$e.pageXOffset,y=$e.scrollY||$e.pageYOffset;this.ta.focus(),$e.scrollTo(a,y)}},be.prototype.Oy=function(){this.H.R("GainedFocus")},be.prototype.Ny=function(){this.H.R("LostFocus")};function wg(a){if(a.ta!==null){var y=a.Ka;if(y!==null&&y.clientWidth!==0&&y.clientHeight!==0){a.Gw||a.setScrollWidth();var x=a.gf?a.Db:0,E=a.Be?a.Db:0,b=a.Mb;a.Mb=a.computePixelRatio(),a.Mb!==b&&(a.pn=!0,a.$b()),(y.clientWidth!==a.Aa+x||y.clientHeight!==a.ya+E)&&(a.Ee=!0,a.Fc=!0,y=a.layout,y!==null&&y.isViewportSized&&a.autoScale===cs&&(a.Jk=!0,y.C()),a.ld||a.$b())}}}function Qp(a){var y=new _a;y.name="Background",a.Al(y),y=new _a,y.name="",a.Al(y),y=new _a,y.name="Foreground",a.Al(y),y=new _a,y.name="Adornment",y.isTemporary=!0,y.isInDocumentBounds=!1,a.Al(y),y=new _a,y.name="Tool",y.isTemporary=!0,y.isInDocumentBounds=!0,a.Al(y),y=new _a,y.name="Grid",y.allowSelect=!1,y.pickable=!1,y.isTemporary=!0,y.isInDocumentBounds=!1,a.Ww(y,a.Qj("Background"))}function $p(a){var y=new En(En.Grid);y.name="GRID";var x=new cr;return x.figure="LineH",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new cr,x.figure="LineH",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new cr,x.figure="LineH",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new cr,x.figure="LineV",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new cr,x.figure="LineV",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new cr,x.figure="LineV",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new Ni,x.add(y),x.layerName="Grid",x.zOrder=0,x.isInDocumentBounds=!1,x.isAnimated=!1,x.pickable=!1,x.locationObjectName="GRID",a.add(x),a.partManager.parts.remove(x),y.visible=!1,y}function qp(){this.H.gu?this.H.gu=!1:this.H.isEnabled?this.H.kx(this):Kd(this.H)}function tm(a){this.H.isEnabled?(this.H.lu=a.target.scrollTop,this.H.ju=a.target.scrollLeft):Kd(this.H)}be.prototype.kx=function(a){if(this.ta!==null){var y=this.ku,x=this.hu;this.qr=!0;var E=this.documentBounds,b=this.viewportBounds,z=this.rj,tt=E.x-z.left,rt=E.y-z.top,ot=E.width+z.left+z.right,lt=E.height+z.top+z.bottom,ut=E.right+z.right;z=E.bottom+z.bottom;var ft=b.x;E=b.y;var yt=b.width,xt=b.height,Ct=b.right,bt=b.bottom;b=this.scale;var Wt=a.scrollLeft;if(this.tn)switch(this.bu){case"negative":Wt=Wt+a.scrollWidth-a.clientWidth;break;case"reverse":Wt=a.scrollWidth-Wt-a.clientWidth}var jt=Wt;yt<ot||xt<lt?(Wt=At.allocAt(this.position.x,this.position.y),this.allowHorizontalScroll&&this.ju!==jt&&(Wt.x=jt/b+tt,this.ju=jt),this.allowVerticalScroll&&this.lu!==a.scrollTop&&(Wt.y=a.scrollTop/b+rt,this.lu=a.scrollTop),this.position=Wt,At.free(Wt),this.Ee=this.qr=!1):(Wt=At.alloc(),a.uy&&this.allowHorizontalScroll&&(tt<ft&&(this.position=Wt.h(jt+tt,this.position.y)),ut>Ct&&(this.position=Wt.h(-(y.scrollWidth-this.Aa)+jt-this.Aa/b+ut,this.position.y))),a.vy&&this.allowVerticalScroll&&(rt<E&&(this.position=Wt.h(this.position.x,a.scrollTop+rt)),z>bt&&(this.position=Wt.h(this.position.x,-(y.scrollHeight-this.ya)+a.scrollTop-this.ya/b+z))),At.free(Wt),this.vd=!0,this.Ee=this.qr=!1,E=this.documentBounds,b=this.viewportBounds,ut=E.right,Ct=b.right,z=E.bottom,bt=b.bottom,tt=E.x,ft=b.x,rt=E.y,E=b.y,yt>=ot&&tt>=ft&&ut<=Ct&&(x.style.width="1px"),xt>=lt&&rt>=E&&z<=bt&&(x.style.height="1px"))}},be.prototype.computeBounds=function(a){return a===void 0&&(a=new Be),qa(this),Cg(this,a)};function Cg(a,y){if(a.fixedBounds.w())return y.assign(a.fixedBounds),y.Co(a.yb),y;for(var x=!0,E=a.Wa.s,b=E.length,z=0;z<b;z++){var tt=E[z];if(tt.visible&&tt.isInDocumentBounds){tt=tt.Pa.s;for(var rt=tt.length,ot=0;ot<rt;ot++){var lt=tt[ot];lt.isInDocumentBounds&&lt.isVisible()&&(lt=lt.actualBounds,lt.w()&&(x?(x=!1,y.assign(lt)):y.ed(lt)))}}}return x&&y.h(0,0,0,0),y.Co(a.yb),y}be.prototype.computePartsBounds=function(a,y){y===void 0&&(y=!1);var x=null;if(je(a))for(var E=0;E<a.length;E++){var b=a[E];!y&&b instanceof Tn||(b.Va(),x===null?x=b.actualBounds.copy():x.ed(b.actualBounds))}else for(a=a.iterator;a.next();)E=a.value,!y&&E instanceof Tn||(E.Va(),x===null?x=E.actualBounds.copy():x.ed(E.actualBounds));return x===null?new Be(NaN,NaN,0,0):x};function Al(a,y){if((y||a.hf)&&!a.vb&&a.ta!==null&&a.documentBounds.w()){if(a.vb=!0,y){var x=a.initialPosition;if(x.w()){a.vb=!1,a.position=x;return}x=At.alloc(),x.xi(a.documentBounds,a.initialDocumentSpot);var E=a.viewportBounds;E=Be.allocAt(0,0,E.width,E.height);var b=At.alloc();b.xi(E,a.initialViewportSpot),b.h(x.x-b.x,x.y-b.y),a.position=b,Be.free(E),At.free(b),At.free(x)}x=a.yh,y&&a.Fg!==cs&&(x=a.Fg);var z=x!==cs?Gd(a,x):a.scale;x=a.pa.x,E=a.pa.y,b=a.Aa/z;var tt=a.ya/z,rt=a.zk,ot=a.pq;y&&!rt.sb()&&(ot.sb()||ot.Xb())&&(rt=ot.Xb()?Or:ot),Eg(a,a.documentBounds,b,tt,rt,y),y=a.scale,a.scale=z,a.vb=!1,z=a.viewportBounds,Zt.B(z.x,x)&&Zt.B(z.y,E)&&Zt.B(z.width,b)&&Zt.B(z.height,tt)||a.onViewportBoundsChanged(new Be(x,E,b,tt),z,y,!1)}}function Gd(a,y){var x=a.Pp;if(a.ta===null)return x;a.Va();var E=a.documentBounds;if(!E.w())return x;var b=E.width;E=E.height;var z=a.Aa+(a.gf?a.Db:0),tt=a.ya+(a.Be?a.Db:0),rt=z/b,ot=tt/E;return y===ol?(y=Math.min(ot,rt),y>x&&(y=x),y<a.minScale&&(y=a.minScale),y>a.maxScale&&(y=a.maxScale),y):y===fd?(y=ot>rt?(tt-a.Db)/E:(z-a.Db)/b,y>x&&(y=x),y<a.minScale&&(y=a.minScale),y>a.maxScale&&(y=a.maxScale),y):a.scale}be.prototype.zoomToFit=function(){var a=this.sj;this.sj=Bh,this.scale=Gd(this,ol),a!==Bh&&(Al(this,!1),Eg(this,this.documentBounds,this.Aa/this.Ca,this.ya/this.Ca,this.zk,!1)),this.sj=a},wt=be.prototype,wt.BA=function(a,y){y===void 0&&(y=ol);var x=a.width,E=a.height;if(!(x===0||E===0||isNaN(x)&&isNaN(E))){var b=1;if(y===ol||y===fd)if(isNaN(x))b=this.viewportBounds.height*this.scale/E;else if(isNaN(E))b=this.viewportBounds.width*this.scale/x;else{b=this.Aa;var z=this.ya;b=y===fd?z/E>b/x?(z-(this.Be?this.Db:0))/E:(b-(this.gf?this.Db:0))/x:Math.min(z/E,b/x)}this.scale=b,this.position=new At(a.x,a.y)}},wt.Jy=function(a,y){this.Va();var x=this.documentBounds,E=this.viewportBounds;this.position=new At(x.x+(a.x*x.width+a.offsetX)-(y.x*E.width-y.offsetX),x.y+(a.y*x.height+a.offsetY)-(y.y*E.height-y.offsetY))},wt.zz=function(a){if(a instanceof de){this.eq=a;var y=At.alloc();this.fq=this.op(a.ga(eo,y)),At.free(y)}else this.eq=null,this.fq=vi};function Eg(a,y,x,E,b,z){var tt=At.allocAt(a.pa.x,a.pa.y),rt=tt.x,ot=tt.y;if(a.eq!==null){var lt=At.alloc();lt=a.eq.ga(eo,lt),rt=lt.x-a.fq.x/a.scale,ot=lt.y-a.fq.y/a.scale,b=gr,At.free(lt)}(z||a.scrollMode===Bh)&&(b.sb()&&(x>y.width&&(rt=y.x+(b.x*y.width+b.offsetX)-(b.x*x-b.offsetX)),E>y.height&&(ot=y.y+(b.y*y.height+b.offsetY)-(b.y*E-b.offsetY))),b=a.rj,z=x-y.width,x<y.width+b.left+b.right?(rt=Math.min(rt+x/2,y.right+Math.max(z,b.right)-x/2),rt=Math.max(rt,y.left-Math.max(z,b.left)+x/2),rt-=x/2):rt>y.left?rt=y.left:rt<y.right-x&&(rt=y.right-x),x=E-y.height,E<y.height+b.top+b.bottom?(ot=Math.min(ot+E/2,y.bottom+Math.max(x,b.bottom)-E/2),ot=Math.max(ot,y.top-Math.max(x,b.top)+E/2),ot-=E/2):ot>y.top?ot=y.top:ot<y.bottom-E&&(ot=y.bottom-E)),tt.x=isFinite(rt)?rt:-a.yb.left,tt.y=isFinite(ot)?ot:-a.yb.top,a.positionComputation!==null&&(y=a.positionComputation(a,tt),tt.x=y.x,tt.y=y.y),Wp(a.Yd,a.pa,tt),a.pa.h(tt.x,tt.y),Mu(a),At.free(tt)}wt.Ol=function(a,y){if(y===void 0&&(y=!0),y){if(a=zu(this,a,function(x){return x.part},function(x){return x.canSelect()}),a instanceof Ni)return a}else if(a=zu(this,a,function(x){return x.part}),a instanceof Ni)return a;return null},wt.ic=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null),qa(this);for(var E=this.Wa.iteratorBackwards;E.next();){var b=E.value;if(b.visible&&(b=b.ic(a,y,x),b!==null))return b}return null};function zu(a,y,x,E){for(x===void 0&&(x=null),E===void 0&&(E=null),qa(a),a=a.Wa.iteratorBackwards;a.next();){var b=a.value;if(b.visible&&!b.isTemporary&&(b=b.ic(y,x,E),b!==null))return b}return null}wt.lz=function(a,y,x){return y===void 0&&(y=!0),bc(this,a,function(E){return E.part},y?function(E){return E instanceof Ni&&E.canSelect()}:null,x)};function bc(a,y,x,E,b){for(x===void 0&&(x=null),E===void 0&&(E=null),b instanceof fn||b instanceof pn||(b=new pn),qa(a),a=a.Wa.iteratorBackwards;a.next();){var z=a.value;z.visible&&!z.isTemporary&&z.ji(y,x,E,b)}return b}wt.ji=function(a,y,x,E){y===void 0&&(y=null),x===void 0&&(x=null),E instanceof fn||E instanceof pn||(E=new pn),qa(this);for(var b=this.Wa.iteratorBackwards;b.next();){var z=b.value;z.visible&&z.ji(a,y,x,E)}return E},wt.ux=function(a,y,x,E){return y===void 0&&(y=!1),x===void 0&&(x=!0),mf(this,a,function(b){return b instanceof Ni&&(!x||b.canSelect())},y,E)},wt.Cf=function(a,y,x,E,b){y===void 0&&(y=null),x===void 0&&(x=null),E===void 0&&(E=!1),b instanceof fn||b instanceof pn||(b=new pn),qa(this);for(var z=this.Wa.iteratorBackwards;z.next();){var tt=z.value;tt.visible&&tt.Cf(a,y,x,E,b)}return b},wt.Nu=function(a,y,x,E,b,z){var tt=new pn;qa(this);for(var rt=this.Wa.iteratorBackwards;rt.next();){var ot=rt.value;ot.visible&&ot.Nu(a,y,x,E,tt,b,z)}return tt};function mf(a,y,x,E,b){var z=null;for(z===void 0&&(z=null),x===void 0&&(x=null),E===void 0&&(E=!1),b instanceof fn||b instanceof pn||(b=new pn),qa(a),a=a.Wa.iteratorBackwards;a.next();){var tt=a.value;tt.visible&&!tt.isTemporary&&tt.Cf(y,z,x,E,b)}return b}wt.mz=function(a,y,x,E,b){return x===void 0&&(x=!0),E===void 0&&(E=!0),Nc(this,a,y,function(z){return z instanceof Ni&&(!E||z.canSelect())},x,b)},wt.og=function(a,y,x,E,b,z){x===void 0&&(x=null),E===void 0&&(E=null),b===void 0&&(b=!0),b!==!1&&b!==!0&&((b instanceof fn||b instanceof pn)&&(z=b),b=!0),z instanceof fn||z instanceof pn||(z=new pn),qa(this);for(var tt=this.Wa.iteratorBackwards;tt.next();){var rt=tt.value;rt.visible&&rt.og(a,y,x,E,b,z)}return z};function Nc(a,y,x,E,b,z){var tt=null;for(tt===void 0&&(tt=null),E===void 0&&(E=null),b===void 0&&(b=!0),b!==!1&&b!==!0&&((b instanceof fn||b instanceof pn)&&(z=b),b=!0),z instanceof fn||z instanceof pn||(z=new pn),qa(a),a=a.Wa.iteratorBackwards;a.next();){var rt=a.value;rt.visible&&!rt.isTemporary&&rt.og(y,x,tt,E,b,z)}return z}be.prototype.acceptEvent=function(a){return gl(this,a,a instanceof MouseEvent)};function gl(a,y,x){var E=a.Qg;return a.Qg=a.cj,a.cj=E,E.diagram=a,E.event=y,x?Hd(a,y,E):(E.viewPoint=a.Qg.viewPoint,E.documentPoint=a.Qg.documentPoint),a=0,y.ctrlKey&&(a+=1),y.altKey&&(a+=2),y.shiftKey&&(a+=4),y.metaKey&&(a+=8),E.modifiers=a,E.button=y.button,y.buttons!==void 0&&(E.buttons=y.buttons),vr&&y.button===0&&y.ctrlKey&&(E.button=2),E.down=!1,E.up=!1,E.clickCount=1,E.delta=0,E.handled=!1,E.bubbles=!1,E.timestamp=y.timeStamp,E.isMultiTouch=!1,E.targetDiagram=Lg(y,y.target),E.targetObject=null,E}function Lg(a,y){return y===null?null:(y=y.H)?y:((y=a.path)||typeof a.composedPath!="function"||(y=a.composedPath()),y&&y[0]&&y[0].H?y[0].H:null)}function Fg(a,y,x,E,b,z){var tt=a.Qg;return a.Qg=a.cj,a.cj=tt,tt.diagram=a,tt.clickCount=1,a=tt.delta=0,y.ctrlKey&&(a+=1),y.altKey&&(a+=2),y.shiftKey&&(a+=4),y.metaKey&&(a+=8),tt.modifiers=a,tt.event=y,tt.timestamp=y.timeStamp,tt.button=y.button,tt.buttons=y.buttons,vr&&y.button===0&&y.ctrlKey&&(tt.button=2),tt.down=x,tt.up=E,tt.handled=!1,tt.bubbles=b,tt.isMultiTouch=z,tt}function Yl(a,y){return a.bubbles?!0:(y.stopPropagation!==void 0&&y.stopPropagation(),y.cancelable!==!1&&y.preventDefault(),y.cancelBubble=!0,!1)}be.prototype.Qz=function(a){var y=this.H;if(!this.H.isEnabled)return!1;var x=gl(y,a,!1);switch(x.key=String.fromCharCode(a.which),x.down=!0,a.which){case 8:x.key="Backspace";break;case 33:x.key="PageUp";break;case 34:x.key="PageDown";break;case 35:x.key="End";break;case 36:x.key="Home";break;case 37:x.key="Left";break;case 38:x.key="Up";break;case 39:x.key="Right";break;case 40:x.key="Down";break;case 45:x.key="Insert";break;case 46:x.key="Del";break;case 48:x.key="0";break;case 187:case 61:case 107:x.key="Add";break;case 189:case 173:case 109:x.key="Subtract";break;case 27:x.key="Esc"}return y.doKeyDown(),Yl(x,a)},be.prototype.Rz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=gl(y,a,!1);switch(x.key=String.fromCharCode(a.which),x.up=!0,a.which){case 8:x.key="Backspace";break;case 33:x.key="PageUp";break;case 34:x.key="PageDown";break;case 35:x.key="End";break;case 36:x.key="Home";break;case 37:x.key="Left";break;case 38:x.key="Up";break;case 39:x.key="Right";break;case 40:x.key="Down";break;case 45:x.key="Insert";break;case 46:x.key="Del"}return y.doKeyUp(),Yl(x,a)},be.prototype.bz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=gl(y,a,!0);return y.mouseEnter!==null&&y.mouseEnter(x),y.currentTool.standardMouseOver(),Yl(x,a)},be.prototype.cz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=gl(y,a,!0);return y.mouseLeave!==null&&y.mouseLeave(x),Yl(x,a)},be.prototype.getMouse=function(a){var y=this.ta;if(y===null)return new At(0,0);var x=y.getBoundingClientRect();return y=a.clientX-this.Aa/x.width*x.left,a=a.clientY-this.ya/x.height*x.top,this.Ab!==null?ii(new At(y,a),this.Ab):new At(y,a)};function Hd(a,y,x){var E=a.ta,b=a.Aa,z=a.ya,tt=0,rt=0;E!==null&&(E=E.getBoundingClientRect(),tt=y.clientX-b/E.width*E.left,rt=y.clientY-z/E.height*E.top),x.viewPoint.h(tt,rt),a.Ab!==null?(y=At.allocAt(tt,rt),a.Ab.Cd(y),x.documentPoint.assign(y),At.free(y)):x.documentPoint.h(tt,rt)}function Mg(a,y,x){if(a.oj[0]!==null){y=a.oj[y];var E=a.ta;E!==null&&(E=E.getBoundingClientRect(),x.h(y.clientX-a.Aa/E.width*E.left,y.clientY-a.ya/E.height*E.top))}}be.prototype.Ya=function(){this.Zi||(this.Zi=!0,this.$b(!1))};function em(a){a.ld||qa(a),a.Va()}be.prototype.redraw=function(){this.vb||this.ld||(this.N(),this.bd())},wt=be.prototype,wt.Pz=function(){return this.kg},wt.Xy=function(a){a===void 0&&(a=null);var y=this.animationManager,x=y.isEnabled;y.Cc(),y.isEnabled=!1,pl(this),this.hf=!1,this.du=new At(NaN,NaN),y.isEnabled=x,this.ld=!0;var E=this;a!==null&&Pe(function(){E.ld=!1,Ru(y,"Model"),a(E)},1)},wt.$b=function(a){if(a===void 0&&(a=!1),this.kg!==!0&&!(this.vb||a===!1&&this.ld)){this.kg=!0;var y=this;$e.requestAnimationFrame(function(){y.kg&&y.bd()})}},wt.bd=function(){(!this.fn||this.kg)&&(this.fn&&(this.fn=!1),pl(this))};function ld(a,y,x){!a.Ee||a.vb||a.animationManager.defaultAnimation.isAnimating||Kd(a)||(y&&qa(a),x&&Al(a,!1))}function pl(a,y){if(!a.ld&&(a.kg=!1,a.Ka!==null||a.wo.w())){a.ld=!0;var x=a.animationManager,E=a.Xn;if(!x.isAnimating&&E.length!==0){for(var b=E.s,z=b.length,tt=0;tt<z;tt++){var rt=b[tt];ma(rt,!1),rt.v()}E.clear()}E=a.ow,0<E.count&&(E.each(function(ot){ot.Nv()}),E.clear()),b=E=!1,x.defaultAnimation.isAnimating&&(b=!0,E=a.skipsUndoManager,a.skipsUndoManager=!0),x.zb||wg(a),ld(a,!1,!0),a.fe!==null&&(a.fe.visible&&!a.mq&&(Fu(a),a.mq=!0),!a.fe.visible&&a.mq&&(a.mq=!1)),qa(a),z=!1,(!a.hf||a.xh)&&(a.hf?_g(a,!a.Jk):(a.Ea("Initial Layout"),x.isEnabled===!1&&x.Cc(),_g(a,!1)),z=!0),a.Jk=!1,qa(a),a.ou||em(a),ld(a,!0,!1),tt=!1,z?(x=Be.alloc(),x.assign(a.viewportBounds),a.hf||(tt=a.hf=!0,a.skipsUndoManager||(a.undoManager.isPendingClear=!0),a.undoManager.isPendingUnmodified=!0,kg(a)),a.R("LayoutCompleted"),ld(a,!0,!1),Be.free(x)):x.Ok&&x.Qw&&(a.Fg!==cs?a.scale=Gd(a,a.Fg):a.yh!==cs?a.scale=Gd(a,a.yh):(x=a.initialScale,isFinite(x)&&0<x&&(a.scale=x)),Al(a,!0)),z&&tt&&a.eb("Initial Layout"),qa(a),y||a.gc(a.ib),b&&(a.skipsUndoManager=E),a.ld=!1}}function kg(a){if(a.Fg!==cs)a.scale=Gd(a,a.Fg);else if(a.yh!==cs)a.scale=Gd(a,a.yh);else{var y=a.initialScale;isFinite(y)&&0<y&&(a.scale=y)}Al(a,!0),y=a.Wa.s,a.Fd(y,y.length,a,a.viewportBounds),a.R("InitialLayoutCompleted"),a.du.assign(a.pa),Fu(a)}function qa(a){if(a.De.count!==0&&(a.ld||!a.animationManager.isTicking)){for(var y=0;23>y;y++){var x=a.De.iterator;if(x===null||a.De.count===0)break;a.De=new pn,a.Nv(x,a.De)}a.nodes.each(function(E){E instanceof or&&E.U&65536&&(E.U=E.U^65536)})}}wt.Nv=function(a,y){for(a.reset();a.next();){var x=a.value;!x.Zc()||x instanceof or||(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))}for(a.reset();a.next();)x=a.value,x instanceof or&&x.isVisible()&&Bc(this,x);for(a.reset();a.next();)x=a.value,x instanceof Tn&&x.isVisible()&&(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x));for(a.reset();a.next();)x=a.value,x instanceof Yr&&x.isVisible()&&(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))};function Bc(a,y){for(var x=pi(),E=pi(),b=y.memberParts;b.next();){var z=b.value;z.isVisible()&&(z instanceof or?(sl(z)||ws(z)||pd(z))&&Bc(a,z):z instanceof Tn?z.fromNode===y||z.toNode===y?E.push(z):x.push(z):(z.measure(1/0,1/0),z.arrange()))}for(a=x.length,b=0;b<a;b++)z=x[b],z.measure(1/0,1/0),z.arrange();for(oi(x),y.measure(1/0,1/0),y.arrange(),a=E.length,y=0;y<a;y++)x=E[y],x.measure(1/0,1/0),x.arrange();oi(E)}wt.Fd=function(a,y,x,E){if(this.vd||this.animationManager.isAnimating)for(var b=0;b<y;b++)a[b].Fd(x,E)},wt.gc=function(a){if(this.Ka!==null){if(this.ta===null&&$t("No canvas specified"),this.nl==="svg"){if(this.Ka!==null){var y=this.animationManager;if(!y.zb&&(!y.isAnimating||y.isTicking)){Vd(this);var x=this.Aa,E=this.ya;if(a.Gv.resize(x,E,x,E),x=this.Wa.s,E=x.length,this.Fd(x,E,this,this.viewportBounds),this.Fc||y.isAnimating){y=this.pa;var b=this.Ca,z=Math.round(y.x*b)/b,tt=Math.round(y.y*b)/b,rt=this.Ab;for(rt.reset(),b!==1&&rt.scale(b),y.x===0&&y.y===0||rt.translate(-z,-tt),a.ti=null,Yy(a,rt.m11,rt.m12,rt.m21,rt.m22,rt.dx,rt.dy),this.pb!==1&&(a.globalAlpha=this.pb),bh(this,a),y=this.Mb,this.ta.context.setTransform(y,0,0,y,0,0),this.ta.context.clearRect(0,0,this.Aa,this.ya),y=0;y<E;y++)x[y].gc(a,this);a=!1,this.Yf?Qd(this.Yf,this)&&(a=this.Vp()):a=!0,a&&(fe.prototype.Cd=fe.prototype.Eu),this.Fc=this.vd=!1}}}}else t:if(z=this.animationManager,!z.zb&&(!z.isAnimating||z.isTicking)&&(x=new Date,Vd(this),this.Ka.style.opacity!=="0")){if(E=a!==this.ib,y=this.Wa.s,b=y.length,this.Fd(y,b,this,this.viewportBounds),E)a.Vc(!0),this.vd=!0;else if(!this.Fc&&!z.isAnimating)break t;z=this.Ab,z.reset(),tt=this.Mb,rt=this.pa;var ot=this.Ca,lt=Math.round(rt.x*ot)/ot,ut=Math.round(rt.y*ot)/ot;for(ot!==1&&z.scale(ot),rt.x===0&&rt.y===0||z.translate(-lt,-ut),a.setTransform(tt,0,0,tt,0,0),a.clearRect(0,0,this.Aa,this.ya),this.pb!==1&&(a.globalAlpha=this.pb),bh(this,a),rt=0;rt<b;rt++)a.setTransform(tt,0,0,tt,0,0),a.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),a.yc(),y[rt].gc(a,this);if(y=!1,this.Yf?Qd(this.Yf,this)&&(y=this.Vp()):y=!0,y&&(fe.prototype.Cd=fe.prototype.Eu),E?(this.ib.Vc(!0),this.vd=!0):this.Fc=this.vd=!1,y=+new Date-+x,E=Ii&&Ii.nx,x=this.zw,E||this.Yh===null){for(x[this.Tq]=y,this.Tq=(this.Tq+1)%x.length,b=y=0;b<x.length;b++)y+=x[b];this.Sq=y/x.length}if(this.pb!==1&&(a.globalAlpha=1),E)for(a.setTransform(1,0,0,1,0,0),E=0;E<x.length;E++)a.fillText(x[E].toString(),20,150+ +(20*E))}}};function vf(a,y,x,E,b,z,tt,rt,ot,lt){if(a.Ka!==null){a.ta===null&&$t("No canvas specified"),tt===void 0&&(tt=null),rt===void 0&&(rt=null),ot===void 0&&(ot=!1),lt===void 0&&(lt=!1),Vd(a),a.ib.Vc(!0),a.vd=!0,a.$i=!0;var ut=a.Ca;a.Ca=b;var ft=a.Wa.s,yt=ft.length;try{var xt=new Be(z.x,z.y,E.width/b,E.height/b),Ct=xt.copy();Ct.Co(x),Fu(a,Ct),qa(a),a.Fd(ft,yt,a,xt),y.setTransform(1,0,0,1,0,0),y.clearRect(0,0,E.width,E.height),rt!==null&&rt!==""&&(y.fillStyle=rt,y.ox(0,0,E.width,E.height));var bt=a.Mb;y.scale(bt,bt);var Wt=fe.alloc();Wt.reset(),Wt.translate(x.left,x.top),Wt.scale(b),z.x===0&&z.y===0||Wt.translate(-z.x,-z.y),y.setTransform(Wt.m11,Wt.m12,Wt.m21,Wt.m22,Wt.dx,Wt.dy),y.yc(),y instanceof Qs&&Yy(y,Wt.m11,Wt.m12,Wt.m21,Wt.m22,Wt.dx,Wt.dy),fe.free(Wt),bh(a,y),y.globalAlpha=a.pb;var jt=a.Qj("Grid");if(tt){var Qt=new pn,te=tt.iterator;for(te.reset();te.next();){var re=te.value;re instanceof Ni&&(lt||re.layer!==jt)&&(re.Gj(),Qt.add(re))}for(lt=0;lt<yt;lt++)Up(ft[lt],y,a,Qt,ot);Qt.each(function(ke){return ke.Gj()})}else for(Qt=0;Qt<yt;Qt++){var he=ft[Qt];he===jt?lt&&he.gc(y,a,!0):he.gc(y,a,ot)}a.$i=!1,a.Yf&&Qd(a.Yf,a)&&a.Vp()}finally{a.Ca=ut,a.ib.Vc(!0),a.vd=!0,a.Fd(ft,yt,a,a.viewportBounds),Fu(a),a.ib instanceof Qs&&(a.ib.Nj.PA(),a.redraw())}}}wt.Gf=function(a){return this.Rg[a]},wt.Xx=function(a,y){a==="minDrawingLength"&&(this.Oq=y),this.Rg[a]=y,this.redraw()},wt.Tx=function(){this.Rg=new Hi,this.Rg.drawShadows=!0,this.Rg.textGreeking=!0,this.Rg.viewportOptimizations=!(vr||no),this.Rg.temporaryPixelRatio=!0,this.Rg.pictureRatioOptimization=!0,this.Oq=this.Rg.minDrawingLength=1};function bh(a,y){a=a.Rg,a!==null&&(a.imageSmoothingEnabled!==void 0&&y.Wx(!!a.imageSmoothingEnabled),a=a.defaultFont,a!=null&&(y.font=a))}wt.Ql=function(a){return this.on[a]},wt.sA=function(a,y){this.on[a]=y},wt.Sx=function(){this.on=new Hi,this.on.extraTouchArea=10,this.on.extraTouchThreshold=10,this.on.hasGestureZoom=!0},wt.set=function(a){return Object.assign(this,a),this},wt.Du=function(a){return this.nm(a)},wt.nm=function(a){return Wd(this,a),this};function Wd(a,y){var x=a instanceof En,E=a instanceof be,b;for(b in y){b===""&&$t("Setting properties requires non-empty property names");var z=a,tt=b;if(x||E){var rt=b.indexOf(".");if(0<rt){var ot=b.substring(0,rt);x?z=a.fb(ot):(z=a[ot],z==null&&(z=a.toolManager[ot])),We(z)?tt=b.substr(rt+1):$t("Unable to find object named: "+ot+" in "+a.toString()+" when trying to set property: "+b)}}if(tt[0]!=="_"&&!_i(z,tt))if(E&&tt==="ModelChanged"){a.Yw(y[tt]);continue}else if(E&&tt==="Changed"){a.Pe(y[tt]);continue}else if(E&&_i(a.toolManager,tt))z=a.toolManager;else if(E&&rm(a,tt)){a.Bj(tt,y[tt]);continue}else if(a instanceof Ci&&tt==="Changed"){a.Pe(y[tt]);continue}else $t('Trying to set undefined property "'+tt+'" on object: '+z.toString());z[tt]=y[b],tt[0]==="_"&&z instanceof de&&z.Vw(tt)}}wt.bx=function(){if(this.Eh.count!==0&&!(1<this.undoManager.transactionLevel)){for(;0<this.Eh.count;){var a=this.Eh;for(this.Eh=new Ie,a=a.iterator;a.next();){var y=a.key;y.Xo(a.value),y.qc()}}this.N()}},wt.N=function(a){if(a===void 0)this.Fc=!0,this.$b();else{var y=this.viewportBounds;a.w()&&y.Yc(a)&&(this.Fc=!0,this.$b())}this.R("InvalidateDraw")},be.prototype.invalidateViewport=function(a,y){if(this.Fc!==!0)if(this.Fc=!0,this.nl==="svg")this.bd();else{var x=this.Gf("temporaryPixelRatio")===!0;if(this.Gf("viewportOptimizations")===!0&&this.scrollMode!==Dc&&this.rj.hi(0,0,0,0)&&y.width===a.width&&y.height===a.height){var E=this.scale,b=Math.max(a.y,y.y),z=Math.min(a.y+a.height,y.y+y.height);if(0<Math.max(0,Math.min(a.x+a.width,y.x+y.width)-Math.max(a.x,y.x))*E&&0<Math.max(0,z-b)*E){if(!(this.ld||(this.kg=!1,this.Ka===null||(this.ld=!0,this.documentBounds.w()||(E=Be.alloc(),Ig(this,this.computeBounds(E)),Be.free(E)),E=this.ta,E===null||E instanceof ku)))){var tt=this.Mb;b=this.Aa*tt;var rt=this.ya*tt,ot=this.scale*tt;z=Math.round(Math.round(y.x*ot)-Math.round(a.x*ot)),y=Math.round(Math.round(y.y*ot)-Math.round(a.y*ot)),ot=this.jw,a=this.oy,ot.width!==b&&(ot.width=b),ot.height!==rt&&(ot.height=rt),a.clearRect(0,0,b,rt),ot=190*tt;var lt=70*tt,ut=Math.max(z,0),ft=Math.max(y,0),yt=Math.floor(b-ut),xt=Math.floor(rt-ft);a.drawImage(E.Oa,ut,ft,yt,xt,0,0,yt,xt),Qd(this.Yf,this)&&a.clearRect(0,0,ot,lt),E=pi(),a=pi(),xt=Math.abs(z),yt=Math.abs(y);var Ct=ut===0?0:b-xt;ut=At.allocAt(Ct,0),xt=At.allocAt(xt+Ct,rt),a.push(new Be(Math.min(ut.x,xt.x),Math.min(ut.y,xt.y),Math.abs(ut.x-xt.x),Math.abs(ut.y-xt.y)));var bt=this.Ab;if(bt.reset(),bt.scale(tt,tt),this.Ca!==1&&bt.scale(this.Ca),tt=this.pa,(tt.x!==0||tt.y!==0)&&isFinite(tt.x)&&isFinite(tt.y)&&bt.translate(-tt.x,-tt.y),ii(ut,bt),ii(xt,bt),E.push(new Be(Math.min(ut.x,xt.x),Math.min(ut.y,xt.y),Math.abs(ut.x-xt.x),Math.abs(ut.y-xt.y))),Ct=ft===0?0:rt-yt,ut.h(0,Ct),xt.h(b,yt+Ct),a.push(new Be(Math.min(ut.x,xt.x),Math.min(ut.y,xt.y),Math.abs(ut.x-xt.x),Math.abs(ut.y-xt.y))),ii(ut,bt),ii(xt,bt),E.push(new Be(Math.min(ut.x,xt.x),Math.min(ut.y,xt.y),Math.abs(ut.x-xt.x),Math.abs(ut.y-xt.y))),Qd(this.Yf,this)&&(b=0<z?0:-z,rt=0<y?0:-y,ut.h(b,rt),xt.h(ot+b,lt+rt),a.push(new Be(Math.min(ut.x,xt.x),Math.min(ut.y,xt.y),Math.abs(ut.x-xt.x),Math.abs(ut.y-xt.y))),ii(ut,bt),ii(xt,bt),E.push(new Be(Math.min(ut.x,xt.x),Math.min(ut.y,xt.y),Math.abs(ut.x-xt.x),Math.abs(ut.y-xt.y)))),At.free(ut),At.free(xt),ld(this,!1,!0),this.Ka===null&&$t("No div specified"),this.ta===null&&$t("No canvas specified"),!this.animationManager.zb&&(b=this.ib,this.Fc)){for(Vd(this),rt=this.Mb,b.setTransform(1,0,0,1,0,0),b.clearRect(0,0,this.Aa*rt,this.ya*rt),b.drawImage(this.jw.Oa,0<z?0:Math.round(-z),0<y?0:Math.round(-y)),z=this.pa,tt=this.Ca,ot=Math.round(z.x*tt)/tt,lt=Math.round(z.y*tt)/tt,y=this.Ab,y.reset(),tt!==1&&y.scale(tt),z.x===0&&z.y===0||y.translate(-ot,-lt),b.save(),b.beginPath(),z=a.length,tt=0;tt<z;tt++)ot=a[tt],ot.width!==0&&ot.height!==0&&b.rect(Math.floor(ot.x),Math.floor(ot.y),Math.ceil(ot.width),Math.ceil(ot.height));for(b.clip(),b.setTransform(rt,0,0,rt,0,0),b.transform(y.m11,y.m12,y.m21,y.m22,y.dx,y.dy),b.yc(),y=this.Wa.s,z=y.length,this.Fd(y,z,this,this.viewportBounds),bh(this,b),b.globalAlpha=this.pb,rt=0;rt<z;rt++)if(tt=y[rt],ot=E,tt.visible&&tt.pb!==0){lt=sh(tt,b),ft=tt.Zq,ft.length=0,ut=this.scale,yt=Be.alloc(),xt=tt.Pa.s,bt=xt.length,Ct=ot.length;for(var Wt=0;Wt<bt;Wt++){var jt=xt[Wt],Qt=rc(jt,jt.actualBounds);t:{for(var te=2/ut,re=4/ut,he=0;he<Ct;he++){var ke=ot[he];if(ke.width!==0&&ke.height!==0&&Qt.Vu(ke.x-te,ke.y-te,ke.width+re,ke.height+re)){Qt=!0;break t}}Qt=!1}Qt&&tt.Oj(b,jt,this,ft,ut,yt,!0)}Be.free(yt),b.globalAlpha=lt}b.restore(),b.Vc(!0),this.Yf&&Qd(this.Yf,this)&&this.Vp(),this.Fc=this.vd=!1,this.hk()}oi(E),oi(a),this.ld=!1}}else this.bd();x&&(As(this),this.bd(),kc(this,!0))}else x?(As(this),this.bd(),kc(this,!0)):this.bd()}};function Vd(a){a.pn!==!1&&(a.pn=!1,bg(a,a.Aa,a.ya))}function bg(a,y,x){Mu(a);var E=a.Mb;a.ta.resize(y*E,x*E,y,x)&&(a.Fc=!0,a.ib.Vc(!0))}function Kd(a){var y=a.ta;if(y===null||a.wo.w())return!0;var x=a.Aa,E=a.ya,b=a.Ka,z=!1,tt=a.gf?a.Db:0,rt=a.Be?a.Db:0,ot=b.clientWidth||x+tt,lt=b.clientHeight||E+rt,ut=a.viewportBounds;b=ut.x;var ft=ut.y,yt=ut.width,xt=ut.height;if((ot!==x+tt||lt!==E+rt)&&(a.gf=!1,a.Be=!1,rt=tt=0,a.Aa=ot,a.ya=lt,z=a.pn=!0,Mu(a)),!a.hf||!a.viewportBounds.w())return!0;var Ct=a.ku,bt=a.hu;if(a.Ee=!1,!(z||a.gf||a.Be||a.mn||a.nn))return!0;var Wt=a.documentBounds,jt=0,Qt=0,te=0,re=0,he=ut.width,ke=ut.height,Jn=a.rj;a.contentAlignment.sb()?(Wt.width>he&&(jt=Jn.left,Qt=Jn.right),Wt.height>ke&&(te=Jn.top,re=Jn.bottom)):(jt=Jn.left,Qt=Jn.right,te=Jn.top,re=Jn.bottom);var fi=Wt.width+jt+Qt,li=Wt.height+te+re;Jn=a.scale;var Bn=fi>ot/Jn,on=li>lt/Jn;if(!(z||a.gf||a.Be||Bn||on))return!0;jt=Wt.x-jt,ot=ut.x,Qt=Wt.right+Qt,lt=ut.right+tt,te=Wt.y-te;var nr=ut.y;Wt=Wt.bottom+re,ut=ut.bottom+rt;var Xi="1px";if(re="1px",a.scrollMode===Bh&&(Bn||on)&&(Bn&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(Bn=1,jt+1<ot&&(Bn=Math.max((ot-jt)*Jn+a.Aa,Bn)),Qt>lt+1&&(Bn=Math.max((Qt-lt)*Jn+a.Aa,Bn)),he+tt+1<fi&&(Bn=Math.max((fi-he)*Jn+a.Aa,Bn)),Xi=Bn.toString()+"px"),on&&a.hasVerticalScrollbar&&a.allowVerticalScroll&&(Bn=1,te+1<nr&&(Bn=Math.max((nr-te)*Jn+a.ya,Bn)),Wt>ut+1&&(Bn=Math.max((Wt-ut)*Jn+a.ya,Bn)),ke+rt+1<li&&(Bn=Math.max((li-ke)*Jn+a.ya,Bn)),re=Bn.toString()+"px")),Bn=Xi!=="1px",on=re!=="1px",Bn&&on||!Bn&&!on||(on&&(lt-=a.Db),Bn&&(ut-=a.Db),fi<he+tt||!a.hasHorizontalScrollbar||!a.allowHorizontalScroll||(tt=1,jt+1<ot&&(tt=Math.max((ot-jt)*Jn+a.Aa,tt)),Qt>lt+1&&(tt=Math.max((Qt-lt)*Jn+a.Aa,tt)),he+1<fi&&(tt=Math.max((fi-he)*Jn+a.Aa,tt)),Xi=tt.toString()+"px"),Bn=Xi!=="1px",tt=a.ya,Bn!==a.Be&&(tt=Bn?a.ya-a.Db:a.ya+a.Db),li<ke+rt||!a.hasVerticalScrollbar||!a.allowVerticalScroll||(rt=1,te+1<nr&&(rt=Math.max((nr-te)*Jn+tt,rt)),Wt>ut+1&&(rt=Math.max((Wt-ut)*Jn+tt,rt)),ke+1<li&&(rt=Math.max((li-ke)*Jn+tt,rt)),re=rt.toString()+"px"),on=re!=="1px"),a.qr&&Bn===a.Be&&on===a.gf)return x===a.Aa&&E===a.ya||a.bd(),!1;if(Bn!==a.Be&&(Xi==="1px"?a.ya=a.ya+a.Db:a.ya=Math.max(a.ya-a.Db,1),z=!0),a.Be=Bn,bt.style.width=Xi,on!==a.gf&&(re==="1px"?a.Aa=a.Aa+a.Db:a.Aa=Math.max(a.Aa-a.Db,1),z=!0,a.tn&&(rt=At.alloc(),on?(y.style.left=a.Db+"px",a.position=rt.h(a.pa.x+a.Db/a.scale,a.pa.y)):(y.style.left="0px",a.position=rt.h(a.pa.x-a.Db/a.scale,a.pa.y)),At.free(rt))),z&&Mu(a),a.gf=on,bt.style.height=re,a.gu=!0,z&&(a.pn=!0),y=Ct.scrollLeft,a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(he+1<fi?y=(a.position.x-jt)*Jn:jt+1<ot?y=Ct.scrollWidth-Ct.clientWidth:Qt>lt+1&&(y=a.position.x*Jn)),a.tn)switch(a.bu){case"negative":y=-(Ct.scrollWidth-y-Ct.clientWidth);break;case"reverse":y=Ct.scrollWidth-y-Ct.clientWidth}return Ct.scrollLeft=y,a.hasVerticalScrollbar&&a.allowVerticalScroll&&(ke+1<li?Ct.scrollTop=(a.position.y-te)*Jn:te+1<nr?Ct.scrollTop=Ct.scrollHeight-Ct.clientHeight:Wt>ut+1&&(Ct.scrollTop=a.position.y*Jn)),ot=a.Aa,lt=a.ya,Ct.style.width=ot+(a.gf?a.Db:0)+"px",Ct.style.height=lt+(a.Be?a.Db:0)+"px",x!==ot||E!==lt||a.animationManager.zb?(x=Be.allocAt(b,ft,yt,xt),a.onViewportBoundsChanged(x,a.viewportBounds,Jn,z),Be.free(x),!1):!0}wt=be.prototype,wt.add=function(a){var y=a.diagram;if(y!==this&&(y!==null&&$t("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+y.toString()),y=this.Qj(a.layerName),y===null&&(y=this.Qj("")),y===null&&$t('Cannot add a Part when unable find a Layer named "'+a.layerName+'" and there is no default Layer'),a.layer!==y)){var x=y.oi(99999999,a,a.diagram===this);0<=x&&this.cb(fo,"parts",y,null,a,null,x),y.isTemporary||this.Ya(),a.C(1),x=a.layerChanged,x!==null&&x(a,null,y)}},wt.oi=function(a){this.partManager.oi(a);var y=this;ec(a,function(x){Ud(y,x)}),(a instanceof Yr||a instanceof or&&a.placeholder!==null)&&a.v(),a.data!==null&&ec(a,function(x){sy(y.partManager,x)}),ws(a)!==!0&&pd(a)!==!0||this.De.add(a),_1(a,!0,this),j1(a)?(a.actualBounds.w()&&this.N(rc(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(rc(a,a.actualBounds)),this.$b()},wt.pc=function(a){a.Ej(),this.partManager.pc(a);var y=this;a.data!==null&&ec(a,function(x){ly(y.partManager,x,y)}),this.De.remove(a),j1(a)?(a.actualBounds.w()&&this.N(rc(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(rc(a,a.actualBounds)),this.$b()},wt.remove=function(a){Ng(this,a,!0)};function Ng(a,y,x){var E=y.layer;E!==null&&E.diagram===a&&(y.isSelected=!1,y.isHighlighted=!1,y.C(2),x&&y.Lj(),x=E.pc(-1,y,!1),0<=x&&a.cb(Mo,"parts",E,y,null,x,null),a=y.layerChanged,a!==null&&a(y,E,null))}wt.Is=function(a,y){if(y===void 0&&(y=!1),je(a))for(var x=a.length,E=0;E<x;E++){var b=a[E];y&&!b.canDelete()||this.remove(b)}else for(x=new pn,x.addAll(a),a=x.iterator;a.next();)x=a.value,y&&!x.canDelete()||this.remove(x)},wt.Kj=function(a,y,x){return x===void 0&&(x=!1),this.partManager.Kj(a,y,x)},be.prototype.moveParts=function(a,y,x,E){if(x===void 0&&(x=!1),E===void 0&&(E=yf(this)),this.toolManager!==null){var b=new Ie;if(a!==null)if(je(a))for(var z=0;z<a.length;z++)Zu(this,b,a[z],x,E);else for(a=a.iterator;a.next();)Zu(this,b,a.value,x,E);else{for(a=this.parts;a.next();)Zu(this,b,a.value,x,E);for(a=this.nodes;a.next();)Zu(this,b,a.value,x,E);for(a=this.links;a.next();)Zu(this,b,a.value,x,E)}ud(this,b,y,E,x)}};function Zu(a,y,x,E,b,z){if(!y.contains(x)&&(z===void 0&&(z=!1),!E||z||x.canMove()||x.canCopy()))if(b===void 0&&(b=yf(a)),x instanceof qn){if(y.add(x,a.Pd(b,x,x.location)),x instanceof or&&(x.placeholder!==null||b.dragsMembers))for(z=x.memberParts;z.next();)Zu(a,y,z.value,E,b,b.groupsAlwaysMove);for(z=x.linksConnected;z.next();){var tt=z.value;if(!y.contains(tt)){var rt=tt.fromNode,ot=tt.toNode;rt!==null&&y.contains(rt)&&ot!==null&&y.contains(ot)&&Zu(a,y,tt,E,b)}}if(b.dragsTree)for(x=x.Ou();x.next();)Zu(a,y,x.value,E,b)}else if(x instanceof Tn)for(y.add(x,a.Pd(b,x)),x=x.labelNodes;x.next();)Zu(a,y,x.value,E,b);else x instanceof Yr||y.add(x,a.Pd(b,x,x.location))}function ud(a,y,x,E,b){if(y!==null&&y.count!==0){var z=At.alloc(),tt=At.alloc();tt.assign(x),isNaN(tt.x)&&(tt.x=0),isNaN(tt.y)&&(tt.y=0),(x=a.Mr)||xf(a,y);for(var rt=pi(),ot=pi(),lt=y.iterator,ut=At.alloc();lt.next();){var ft=lt.key,yt=lt.value;if(ft.Zc()){var xt=Bg(a,ft,y);xt!==null?rt.push(new it(ft,yt,xt)):(!b||ft.canMove())&&(xt=yt.point,z.assign(xt),a.computeMove(ft,z.add(tt),E,ut),ft.location=ut,yt.shifted===void 0&&(yt.shifted=new At),yt.shifted.assign(ut.re(xt)))}else lt.key instanceof Tn&&ot.push(lt.sa)}for(At.free(ut),b=rt.length,lt=0;lt<b;lt++)ft=rt[lt],z.assign(ft.info.point),ft.Su.shifted===void 0&&(ft.Su.shifted=new At),ft.node.location=z.add(ft.Su.shifted);for(b=At.alloc(),lt=At.alloc(),ft=ot.length,yt=0;yt<ft;yt++){var Ct=ot[yt];if(xt=Ct.key,xt instanceof Tn)if(xt.suspendsRouting){xt.Tg=null,ut=xt.fromNode;var bt=xt.toNode;if(a.draggedLink!==null&&E.dragsLink)if(bt=Ct.value.point,xt.dragComputation===null)y.add(xt,a.Pd(E,xt,tt)),jh(xt,tt.x-bt.x,tt.y-bt.y);else{Ct=At.allocAt(0,0),(ut=xt.i(0))&&ut.w()&&Ct.assign(ut);var Wt=ut=At.alloc().assign(Ct).add(tt);E.isGridSnapEnabled&&(E.isGridSnapRealtime||a.lastInput.up)&&(Wt=At.alloc(),Sf(a,xt,ut,Wt,E)),ut.assign(xt.dragComputation(xt,ut,Wt)).re(Ct),y.add(xt,a.Pd(E,xt,ut)),jh(xt,ut.x-bt.x,ut.y-bt.y),At.free(Ct),At.free(ut),Wt!==ut&&At.free(Wt)}else ut!==null&&(b.assign(ut.location),Wt=y.I(ut),Wt!==null&&b.re(Wt.point)),bt!==null&&(lt.assign(bt.location),Wt=y.I(bt),Wt!==null&&lt.re(Wt.point)),ut!==null&&bt!==null?b.Xa(lt)?(ut=Ct.value.point,bt=z,bt.assign(b),bt.re(ut),y.add(xt,a.Pd(E,xt,b)),jh(xt,bt.x,bt.y)):(xt.suspendsRouting=!1,xt.bb()):(Ct=Ct.value.point,ut=ut!==null?b:bt!==null?lt:tt,y.add(xt,a.Pd(E,xt,ut)),jh(xt,ut.x-Ct.x,ut.y-Ct.y))}else(xt.fromNode===null||xt.toNode===null)&&(ut=Ct.value.point,y.add(xt,a.Pd(E,xt,tt)),jh(xt,tt.x-ut.x,tt.y-ut.y))}At.free(z),At.free(tt),At.free(b),At.free(lt),oi(rt),oi(ot),x||(qa(a),hd(a,y))}}be.prototype.computeMove=function(a,y,x,E){if(E===void 0&&(E=new At),E.assign(y),a===null)return E;var b=y,z=x.isGridSnapEnabled;z&&(x.isGridSnapRealtime||this.lastInput.up)&&(b=At.alloc(),Sf(this,a,y,b,x)),x=a.dragComputation!==null?a.dragComputation(a,y,b):b;var tt=a.minLocation,rt=tt.x;isNaN(rt)&&(rt=z?Math.round(1e3*a.location.x)/1e3:a.location.x),tt=tt.y,isNaN(tt)&&(tt=z?Math.round(1e3*a.location.y)/1e3:a.location.y);var ot=a.maxLocation,lt=ot.x;return isNaN(lt)&&(lt=z?Math.round(1e3*a.location.x)/1e3:a.location.x),ot=ot.y,isNaN(ot)&&(ot=z?Math.round(1e3*a.location.y)/1e3:a.location.y),E.h(Math.max(rt,Math.min(x.x,lt)),Math.max(tt,Math.min(x.y,ot))),b!==y&&At.free(b),E};function yf(a){var y=a.toolManager.findTool("Dragging");return y!==null?y.dragOptions:a.Wm}function Sf(a,y,x,E,b){if(b===void 0&&(b=yf(a)),E.assign(x),y!==null){var z=a.grid;y=b.gridSnapCellSize,a=y.width,y=y.height;var tt=b.gridSnapOrigin,rt=tt.x;if(tt=tt.y,b=b.gridSnapCellSpot,z!==null){var ot=z.gridCellSize;isNaN(a)&&(a=ot.width),isNaN(y)&&(y=ot.height),z=z.gridOrigin,isNaN(rt)&&(rt=z.x),isNaN(tt)&&(tt=z.y)}z=At.allocAt(0,0),z.yi(0,0,a,y,b),Zt.No(x.x,x.y,rt+z.x,tt+z.y,a,y,E),At.free(z)}}function xf(a,y){if(y!==null)for(a.Mr=!0,a=y.iterator;a.next();)y=a.key,y instanceof Tn&&(y.suspendsRouting=!0)}function hd(a,y){if(y!==null){for(y=y.iterator;y.next();){var x=y.key;x instanceof Tn&&(x.suspendsRouting=!1,Uv(x)&&x.bb())}a.Mr=!1}}function Bg(a,y,x){return y=y.containingGroup,y!==null&&(a=Bg(a,y,x),a!==null||(a=x.I(y),a!==null))?a:null}wt=be.prototype,wt.Pd=function(a,y,x){if(x===void 0)return new lh(Un);var E=a.isGridSnapEnabled;return a.groupsSnapMembers||y.containingGroup===null||(E=!1),E?new lh(new At(Math.round(1e3*x.x)/1e3,Math.round(1e3*x.y)/1e3)):new lh(x.copy())};function Ag(a,y,x){if(y.diagram!==null&&y.diagram!==a&&$t("Cannot share a Layer with another Diagram: "+y+" of "+y.diagram),x===null?y.diagram!==null&&$t("Cannot add an existing Layer to this Diagram again: "+y):(x.diagram!==a&&$t("Existing Layer must be in this Diagram: "+x+" not in "+x.diagram),y===x&&$t("Cannot move a Layer before or after itself: "+y)),y.diagram!==a){y=y.name,a=a.Wa,x=a.count;for(var E=0;E<x;E++)a.M(E).name===y&&$t("Cannot add Layer with the name '"+y+"'; a Layer with the same name is already present in this Diagram.")}}wt.Al=function(a){Ag(this,a,null),a.Xe(this);var y=this.Wa,x=y.count-1;if(!a.isTemporary)for(;0<=x&&y.M(x).isTemporary;)x--;return y.Gb(x+1,a),this.cc!==null&&this.cb(fo,"layers",this,null,a,null,x+1),this.N(),this.Ya(),this},wt.Ww=function(a,y){Ag(this,a,y),a.Xe(this);var x=this.Wa,E=x.indexOf(a);0<=E&&(x.remove(a),this.cc!==null&&this.cb(Mo,"layers",this,a,null,E,null));var b=x.count,z;for(z=0;z<b;z++)if(x.M(z)===y){x.Gb(z,a);break}return this.cc!==null&&this.cb(fo,"layers",this,null,a,null,z),this.N(),0>E&&this.Ya(),this},wt.Cy=function(a,y){Ag(this,a,y),a.Xe(this);var x=this.Wa,E=x.indexOf(a);0<=E&&(x.remove(a),this.cc!==null&&this.cb(Mo,"layers",this,a,null,E,null));var b=x.count,z;for(z=0;z<b;z++)if(x.M(z)===y){x.Gb(z+1,a);break}return this.cc!==null&&this.cb(fo,"layers",this,null,a,null,z+1),this.N(),0>E&&this.Ya(),this},wt.kA=function(a){if(a.diagram!==this&&$t("Cannot remove a Layer from another Diagram: "+a+" of "+a.diagram),a.name!==""){var y=this.Wa,x=y.indexOf(a);if(y.remove(a)){for(y=a.Pa.copy().iterator;y.next();){var E=y.value,b=E.layerName;b!==a.name?E.layerName=b:E.layerName=""}this.cc!==null&&this.cb(Mo,"layers",this,a,null,x,null),this.N(),this.Ya()}}},wt.Qj=function(a){for(var y=this.layers;y.next();){var x=y.value;if(x.name===a)return x}return null},wt.Yw=function(a){return this.pf===null&&(this.pf=new fn),this.pf.add(a),this.model.Pe(a),this},wt.mA=function(a){this.pf!==null&&(this.pf.remove(a),this.pf.count===0&&(this.pf=null)),this.model.ik(a)},wt.Pe=function(a){return this.zg===null&&(this.zg=new fn),this.zg.add(a),this},wt.ik=function(a){this.zg!==null&&(this.zg.remove(a),this.zg.count===0&&(this.zg=null))},wt.ds=function(a){if(this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.Tu(a),a.change!==ho&&(this.isModified=!0),this.zg!==null)for(var y=this.zg,x=y.length,E=0;E<x;E++)y.M(E)(a)},wt.cb=function(a,y,x,E,b,z,tt){z===void 0&&(z=null),tt===void 0&&(tt=null);var rt=new bi;rt.diagram=this,rt.change=a,rt.propertyName=y,rt.object=x,rt.oldValue=E,rt.oldParam=z,rt.newValue=b,rt.newParam=tt,this.ds(rt)},wt.g=function(a,y,x,E,b){this.cb(Ir,a,this,y,x,E,b)},be.prototype.changeState=function(a,y){if(a!==null&&a.diagram===this){var x=this.skipsModelSourceBindings;try{this.skipsModelSourceBindings=!0;var E=a.change;if(E===Ir){var b=a.object;if(Ho(b,a.propertyName,a.I(y)),b instanceof de){var z=b.part;z!==null&&z.Wb()}this.isModified=!0}else if(E===fo){var tt=a.object,rt=a.newParam,ot=a.newValue;if(tt instanceof En)if(typeof rt=="number"&&ot instanceof de){y?tt.pc(rt):tt.Gb(rt,ot);var lt=tt.part;lt!==null&&lt.Wb()}else typeof rt=="number"&&ot instanceof va&&(ot.isRow?h1(tt,rt,y?void 0:ot):d1(tt,rt,y?void 0:ot));else if(tt instanceof _a){var ut=a.oldParam===!0;typeof rt=="number"&&ot instanceof Ni&&(y?(ot.isSelected=!1,ot.isHighlighted=!1,ot.Wb(),tt.pc(ut?rt:-1,ot,ut)):tt.oi(rt,ot,ut))}else tt instanceof be?typeof rt=="number"&&ot instanceof _a&&(y?this.Wa.mb(rt):(ot.Xe(this),this.Wa.Gb(rt,ot))):$t("unknown ChangedEvent.Insert object: "+a.toString());this.isModified=!0}else if(E===Mo){var ft=a.object,yt=a.oldParam,xt=a.oldValue;if(ft instanceof En)typeof yt=="number"&&xt instanceof de?y?ft.Gb(yt,xt):ft.pc(yt):typeof yt=="number"&&xt instanceof va&&(xt.isRow?h1(ft,yt,y?xt:void 0):d1(ft,yt,y?xt:void 0));else if(ft instanceof _a){var Ct=a.newParam===!0;typeof yt=="number"&&xt instanceof Ni&&(y?0>ft.Pa.indexOf(xt)&&ft.oi(yt,xt,Ct):(xt.isSelected=!1,xt.isHighlighted=!1,xt.Wb(),ft.pc(Ct?yt:-1,xt,Ct)))}else ft instanceof be?typeof yt=="number"&&xt instanceof _a&&(y?(xt.Xe(this),this.Wa.Gb(yt,xt)):this.Wa.mb(yt)):$t("unknown ChangedEvent.Remove object: "+a.toString());this.isModified=!0}else E!==ho&&$t("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings=x}}},be.prototype.Ea=function(a){return this.undoManager.Ea(a)},be.prototype.eb=function(a){return this.undoManager.eb(a)},be.prototype.Kf=function(){return this.undoManager.Kf()},be.prototype.commit=function(a,y){y===void 0&&(y="");var x=this.skipsUndoManager;y===null&&(this.skipsUndoManager=!0,y=""),this.undoManager.Ea(y);var E=!1;try{a(this),E=!0}finally{E?this.undoManager.eb(y):this.undoManager.Kf(),this.skipsUndoManager=x}},be.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)},be.prototype.rp=function(){this.partManager.rp()};function Tg(a,y,x){var E=a.animationManager;if(a.vb||a.ld)a.Ca=x,Mu(a),a.N(),a.Ee=!0,E.zb&&(oh(E)||E.ce.add(E.H,"scale",y,a.Ca));else if(a.ta===null)a.Ca=x,Mu(a);else{a.vb=!0;var b=a.viewportBounds.copy(),z=a.Aa,tt=a.ya,rt=a.zoomPoint.x,ot=a.zoomPoint.y,lt=a.contentAlignment;isNaN(rt)&&(lt.$c()?lt.Hf(us)?rt=0:lt.Hf(Ko)&&(rt=z-1):rt=lt.sb()?lt.x*(z-1):z/2),isNaN(ot)&&(lt.$c()?lt.Hf(Ka)?ot=0:lt.Hf(hs)&&(ot=tt-1):ot=lt.sb()?lt.y*(tt-1):tt/2),a.scaleComputation===null||a.animationManager.defaultAnimation.isAnimating||(x=a.scaleComputation(a,x)),x<a.minScale&&(x=a.minScale),x>a.maxScale&&(x=a.maxScale),z=At.allocAt(a.pa.x+rt/y-rt/x,a.pa.y+ot/y-ot/x),a.position=z,At.free(z),a.Ca=x,Mu(a),a.vb=!1,a.onViewportBoundsChanged(b,a.viewportBounds,y,!1),Al(a,!1),E.zb&&(oh(E)||E.ce.add(E.H,"scale",y,a.Ca))}}be.prototype.onViewportBoundsChanged=function(a,y,x,E){if(!a.D(y)){E===void 0&&(E=!1),E||(this.Ee=!0),this.vd=!0;var b=this.layout;b===null||!b.isViewportSized||this.autoScale!==cs||a.width===y.width&&a.height===y.height||b.C(),b=this.currentTool,this.Vk===!0&&b instanceof Nr&&(this.lastInput.documentPoint=this.Ps(this.lastInput.viewPoint),ra(b,this)),this.vb||this.invalidateViewport(a,y),Fu(this),this.fc.scale=x,this.fc.position.x=a.x,this.fc.position.y=a.y,this.fc.bounds.assign(a),this.fc.canvasSize.width=Math.round(a.width*x),this.fc.canvasSize.height=Math.round(a.height*x),this.fc.newCanvasSize.width=this.Aa,this.fc.newCanvasSize.height=this.ya,this.fc.isScroll=E,this.R("ViewportBoundsChanged",this.fc,a),this.isVirtualized&&this.links.each(function(z){z.isAvoiding&&z.actualBounds.Yc(y)&&z.bb()})}};function Fu(a,y){var x=a.fe;if(x!==null&&x.visible){for(var E=ln.alloc(),b=1,z=1,tt=x.O.s,rt=tt.length,ot=0;ot<rt;ot++){var lt=tt[ot],ut=Math.abs(lt.interval);2>ut||(pv(lt.figure)?z=z*ut/Zt.vx(z,ut):b=b*ut/Zt.vx(b,ut))}if(tt=x.gridCellSize,E.h(z*tt.width,b*tt.height),y!==void 0)b=y.width,z=y.height,a=y.x,tt=y.y;else{if(y=Be.alloc(),a=a.viewportBounds,y.h(a.x,a.y,a.width,a.height),!y.w()){Be.free(y);return}b=y.width,z=y.height,a=y.x,tt=y.y,Be.free(y)}x.width=b+2*E.width,x.height=z+2*E.height,y=At.alloc(),Zt.No(a,tt,0,0,E.width,E.height,y),y.offset(-E.width,-E.height),ln.free(E),x.part.location=y,At.free(y)}}be.prototype.clearSelection=function(a){a===void 0&&(a=!1);var y=this.selection;if(y.count!==0){a||this.R("ChangingSelection",y);for(var x=y.Fa(),E=x.length,b=0;b<E;b++)x[b].isSelected=!1;y.ka(),y.clear(),y.freeze(),a||this.R("ChangedSelection",y)}},be.prototype.select=function(a){a!==null&&a.diagram===this&&(!a.isSelected||1<this.selection.count)&&(this.R("ChangingSelection",this.selection),this.clearSelection(!0),a.isSelected=!0,this.R("ChangedSelection",this.selection))},be.prototype.rA=function(a){if(this.R("ChangingSelection",this.selection),this.clearSelection(!0),je(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];E instanceof Ni||$t("Diagram.selectCollection given something that is not a Part: "+E),E.isSelected=!0}else for(a=a.iterator;a.next();)y=a.value,y instanceof Ni||$t("Diagram.selectCollection given something that is not a Part: "+y),y.isSelected=!0;this.R("ChangedSelection",this.selection)},be.prototype.clearHighlighteds=function(){var a=this.highlighteds;if(0<a.count){for(var y=a.Fa(),x=y.length,E=0;E<x;E++)y[E].isHighlighted=!1;a.ka(),a.clear(),a.freeze()}},wt=be.prototype,wt.Iz=function(a){a!==null&&a.diagram===this&&(!a.isHighlighted||1<this.highlighteds.count)&&(this.clearHighlighteds(),a.isHighlighted=!0)},wt.Jz=function(a){a=new pn().addAll(a);for(var y=this.highlighteds.copy().hp(a).iterator;y.next();)y.value.isHighlighted=!1;for(a=a.iterator;a.next();)y=a.value,y instanceof Ni||$t("Diagram.highlightCollection given something that is not a Part: "+y),y.isHighlighted=!0},wt.scroll=function(a,y,x){x===void 0&&(x=1);var E=y==="up"||y==="down",b=0,z=At.alloc();if(a==="pixel")b=x;else if(a==="line")b=x*(E?this.scrollVerticalLineChange:this.scrollHorizontalLineChange);else if(a==="page")a=E?this.viewportBounds.height:this.viewportBounds.width,a*=this.scale,a!==0&&(b=x*Math.max(a-(E?this.scrollVerticalLineChange:this.scrollHorizontalLineChange),0));else{if(a==="document"){b=this.documentBounds,x=this.viewportBounds,y==="up"?this.position=z.h(x.x,b.y):y==="left"?this.position=z.h(b.x,x.y):y==="down"?this.position=z.h(x.x,b.bottom-x.height):y==="right"&&(this.position=z.h(b.right-x.width,x.y)),At.free(z);return}$t("scrolling unit must be 'pixel', 'line', 'page', or 'document', not: "+a)}b/=this.scale,x=this.position,y==="up"?this.position=z.h(x.x,x.y-b):y==="down"?this.position=z.h(x.x,x.y+b):y==="left"?this.position=z.h(x.x-b,x.y):y==="right"?this.position=z.h(x.x+b,x.y):$t("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+y),At.free(z)},wt.tv=function(a){var y=this.viewportBounds;y.Re(a)||(a=a.center,a.x-=y.width/2,a.y-=y.height/2,this.position=a)},wt.es=function(a){var y=this.viewportBounds;a=a.center,a.x-=y.width/2,a.y-=y.height/2,this.position=a},wt.op=function(a){var y=this.Ab;y.reset(),this.Ca!==1&&y.scale(this.Ca);var x=this.pa;return(x.x!==0||x.y!==0)&&isFinite(x.x)&&isFinite(x.y)&&y.translate(-x.x,-x.y),a.copy().transform(this.Ab)},wt.zA=function(a){var y=this.Ab,x=a.x,E=a.y,b=x+a.width,z=E+a.height,tt=y.m11,rt=y.m12,ot=y.m21,lt=y.m22,ut=y.dx,ft=y.dy,yt=x*tt+E*ot+ut;y=x*rt+E*lt+ft;var xt=b*tt+E*ot+ut;return a=b*rt+E*lt+ft,E=x*tt+z*ot+ut,x=x*rt+z*lt+ft,tt=b*tt+z*ot+ut,b=b*rt+z*lt+ft,z=Math.min(yt,xt),yt=Math.max(yt,xt),xt=Math.min(y,a),y=Math.max(y,a),z=Math.min(z,E),yt=Math.max(yt,E),xt=Math.min(xt,x),y=Math.max(y,x),z=Math.min(z,tt),yt=Math.max(yt,tt),xt=Math.min(xt,b),y=Math.max(y,b),new Be(z,xt,yt-z,y-xt)},wt.Ps=function(a){var y=this.Ab;y.reset(),this.Ca!==1&&y.scale(this.Ca);var x=this.pa;return(x.x!==0||x.y!==0)&&isFinite(x.x)&&isFinite(x.y)&&y.translate(-x.x,-x.y),ii(a.copy(),this.Ab)};function nm(a){var y=a.isModified;a.Tw!==y&&(a.Tw=y,a.R("Modified"))}function Dg(a){return a=Ff.get(a),a!==null?new a:new yo}be.prototype.doModelChanged=function(a){var y=this;if(a.model===this.model){var x=a.change,E=a.propertyName;if(x===ho&&E[0]==="S")if(E==="StartingFirstTransaction"){var b=this;a=this.toolManager,a.mouseDownTools.each(function(ot){return ot.diagram=b}),a.mouseMoveTools.each(function(ot){return ot.diagram=b}),a.mouseUpTools.each(function(ot){return ot.diagram=b}),this.ld||this.hf||(this.Jk=!0,this.fn&&(this.kg=!0))}else E==="StartingUndo"||E==="StartingRedo"?(a=this.animationManager,a.defaultAnimation.isAnimating&&!this.skipsUndoManager&&a.Cc(),this.R("ChangingSelection",this.selection)):E==="StartedTransaction"&&(a=this.animationManager,a.defaultAnimation.isAnimating&&!this.skipsUndoManager&&a.Cc());else if(this.aa){this.aa=!1;try{if(a.modelChange===""&&x===ho){(E==="FinishedUndo"||E==="FinishedRedo")&&(this.R("ChangedSelection",this.selection),qa(this));var z=this.animationManager;E==="RolledBackTransaction"&&z.Cc(),this.bx(),this.Jk=!0,this.bd(),this.undoManager.transactionLevel!==0&&this.undoManager.transactionLevel!==1||df(z),E==="CommittedTransaction"&&this.undoManager.isJustDiscarded&&(this.Ce=Math.min(this.Ce,this.undoManager.historyIndex-1)),E!=="CommittedTransaction"&&E!=="RolledBackTransaction"||!this.undoManager.isPendingUnmodified||setTimeout(function(){y.isModified=!1},1);var tt=a.isTransactionFinished;if(tt&&(nm(this),this.As.clear(),Hp(this.animationManager)),!this.Rt&&tt&&this.lastInput.targetDiagram){this.Rt=!0;var rt=this;Pe(function(){rt.currentTool.standardMouseOver(),rt.Rt=!1},10)}}}finally{this.aa=!0}}}};function Ud(a,y){y=y.O.s;for(var x=y.length,E=0;E<x;E++)dd(a,y[E])}function dd(a,y){if(y instanceof Is){var x=y.element;if(x!==null&&x instanceof HTMLImageElement){x.Bg instanceof pn&&x.Bg.add(a);var E=y.Eg;if(E!==null&&E.sq===!0&&y.diagram!==null&&y.diagram.Xn.add(y),x.hn)if(x=x.getAttribute("src")||"",E=a.Og.I(x),E===null)E=[],E.push(y),a.Og.add(x,E);else{for(a=0;a<E.length;a++)if(E[a]===y)return;E.push(y)}}}}function Og(a,y){if(y instanceof Is){var x=y.element;if(x!==null&&x instanceof HTMLImageElement&&x.hn){var E=x.getAttribute("src")||"",b=a.Og.I(E);if(b!==null){for(var z=0;z<b.length;z++)if(b[z]===y){b.splice(z,1),b.length===0&&(a.Og.remove(E),x.Fq&&x.removeEventListener("load",x.Fq),x.Yp&&x.removeEventListener("error",x.Yp),delete x.Fq,delete x.Yp,x.Bg instanceof pn&&x.Bg.remove(a),jf(E));break}}}}}be.prototype.Wd=function(){this.partManager.Wd()},be.prototype.Aj=function(a,y){this.Yd.Aj(a,y)},be.prototype.Cj=function(a,y){this.Yd.Cj(a,y)},be.prototype.findPartForKey=function(a){return this.partManager.findPartForKey(a)},be.prototype.Vb=function(a){return this.partManager.Vb(a)},be.prototype.findLinkForKey=function(a){return this.partManager.findLinkForKey(a)},wt=be.prototype,wt.Lc=function(a){return this.partManager.Lc(a)},wt.ii=function(a){return this.partManager.ii(a)},wt.Kc=function(a){return this.partManager.Kc(a)},wt.ms=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];return this.partManager.ms.apply(this.partManager,y instanceof Array?y:ki(Wn(y)))},wt.ls=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];return this.partManager.ls.apply(this.partManager,y instanceof Array?y:ki(Wn(y)))};function Mu(a){var y=a.pa,x=a.Ca;a.Rw.h(y.x,y.y,Math.max(a.Aa,0)/x,Math.max(a.ya,0)/x),a.vd=!0}function Ig(a,y){a.Zi=!1;var x=a.Sp;x.D(y)||(x=x.copy(),a.Sp.assign(y),Al(a,!1),a.R("DocumentBoundsChanged",void 0,x),a.Ee=!0,a.N())}wt.Va=function(){if(this.Zi){var a=Be.alloc();Ig(this,this.computeBounds(a)),Be.free(a)}},wt.rz=function(){for(var a=new pn,y=this.nodes;y.next();){var x=y.value;x.isTopLevel&&a.add(x)}for(y=this.links;y.next();)x=y.value,x.isTopLevel&&a.add(x);return a.iterator},wt.qz=function(){return this.ai.iterator},wt.Uz=function(a){qa(this),a&&Pf(this,!0),this.ld?_g(this,!1):(this.Jk=!0,pl(this))};function Pf(a,y){for(var x=a.ai.iterator;x.next();)im(a,x.value,y);a.layout&&(y?a.layout.isValidLayout=!1:a.layout.C())}function im(a,y,x){if(y!==null){for(var E=y.gl.iterator;E.next();)im(a,E.value,x);y.layout!==null&&(x?y.layout.isValidLayout=!1:y.layout.C())}}function _g(a,y){if(a.xh&&!a.lt){var x=a.aa;a.aa=!0;var E=a.undoManager.transactionLevel,b=a.layout,z=a.animationManager;try{E===0&&(a.undoManager.isInternalTransaction=!0,a.Ea("Layout")),1>=E&&!z.defaultAnimation.isAnimating&&!z.zb&&(y||Ru(z,"Layout")),a.xh=!1;for(var tt=a.ai.iterator;tt.next();)Rg(a,tt.value,y,E);b.isValidLayout||(!y||b.isRealtime||b.isRealtime===null||E===0?(b.doLayout(a),qa(a),b.isValidLayout=!0):a.xh=!0)}finally{y=a.undoManager.isInternalTransaction,E===0&&(a.eb("Layout"),a.undoManager.isInternalTransaction=!1),!y||E!==0&&E!==1||df(z),a.aa=x}}}function Rg(a,y,x,E){if(y!==null){for(var b=y.gl.iterator;b.next();)Rg(a,b.value,x,E);b=y.layout,b===null||b.isValidLayout||(!x||b.isRealtime||E===0?(y.rh=!y.location.w(),b.doLayout(y),y.C(32),Bc(a,y),b.isValidLayout=!0):a.xh=!0)}}wt.yz=function(){for(var a=new fn,y=this.nodes;y.next();){var x=y.value;x.isTopLevel&&x.kh()===null&&a.add(x)}return a.iterator};function ev(a){function y(b){var z=b.toLowerCase(),tt=new fn;x.add(b,tt),x.add(z,tt),E.add(b,b),E.add(z,b)}var x=new Ie,E=new Ie;y("InitialAnimationStarting"),y("AnimationStarting"),y("AnimationFinished"),y("BackgroundSingleClicked"),y("BackgroundDoubleClicked"),y("BackgroundContextClicked"),y("ClipboardChanged"),y("ClipboardPasted"),y("DocumentBoundsChanged"),y("ExternalObjectsDropped"),y("GainedFocus"),y("InitialLayoutCompleted"),y("LayoutCompleted"),y("LinkDrawn"),y("LinkRelinked"),y("LinkReshaped"),y("LostFocus"),y("Modified"),y("ObjectSingleClicked"),y("ObjectDoubleClicked"),y("ObjectContextClicked"),y("PartCreated"),y("PartResized"),y("PartRotated"),y("SelectionMoved"),y("SelectionCopied"),y("SelectionDeleting"),y("SelectionDeleted"),y("SelectionGrouped"),y("SelectionUngrouped"),y("ChangingSelection"),y("ChangedSelection"),y("SubGraphCollapsed"),y("SubGraphExpanded"),y("TextEdited"),y("TreeCollapsed"),y("TreeExpanded"),y("ViewportBoundsChanged"),y("InvalidateDraw"),a.iw=x,a.hw=E}function rm(a,y){var x=a.hw.I(y);return x!==null?x:a.hw.I(y.toLowerCase())}function wf(a,y){var x=a.iw.I(y);if(x!==null||(x=a.iw.I(y.toLowerCase()),x!==null))return x;$t("Unknown DiagramEvent name: "+y)}wt.Bj=function(a,y){return a=wf(this,a),a!==null&&a.add(y),this},wt.am=function(a,y){a=wf(this,a),a!==null&&a.remove(y)},wt.R=function(a,y,x){var E=wf(this,a),b=new tr;if(b.diagram=this,a=rm(this,a),a!==null&&(b.name=a),y!==void 0&&(b.subject=y),x!==void 0&&(b.parameter=x),y=E.length,y===1)E.M(0)(b);else if(y!==0)for(E=E.Fa(),x=0;x<y;x++)(0,E[x])(b)};function Cf(a){if(a.animationManager.isTicking)return!1;var y=a.currentTool;return y===a.toolManager.findTool("Dragging")?!a.Mr||y.isComplexRoutingRealtime:!0}wt.Yj=function(a,y){return Ef(this,!1,null,y||null).Yj(a.x,a.y,a.width,a.height)},be.prototype.computeOccupiedArea=function(a){return this.isVirtualized?this.viewportBounds.copy():this.Zi?Cg(this,a):a.assign(this.documentBounds)};function Ef(a,y,x,E){var b=a.Xh;if(b===null&&(a.Xh=b=new fp(a.avoidanceCellSize)),b.vs||b.group!==x||b.Yx!==E){if(b.Hx=Math.max(b.Os+1,Math.floor(a.avoidanceLimit/a.avoidanceCellSize.width)),b.Ix=Math.max(b.Os+1,Math.floor(a.avoidanceLimit/a.avoidanceCellSize.height)),x!==null&&(x=om(a,x)),x===null){y=Be.alloc(),a.computeOccupiedArea(y),y.Bc(100,100),b.initialize(y);for(var z=a.nodes;z.next();){var tt=z.value,rt=tt.layer;rt!==null&&rt.visible&&!rt.isTemporary&&Lf(a,tt,E,y)}Be.free(y)}else{for(0<x.memberParts.count&&(y=a.computePartsBounds(x.memberParts,!1),y.Bc(20,20),b.initialize(y)),y=Be.alloc(),z=x.memberParts;z.next();)tt=z.value,tt instanceof qn&&Lf(a,tt,E,y);Be.free(y)}b.group=x,b.Yx=E,b.vs=!1}else y&&rS(b);return b}function om(a,y){return y.avoidable&&!y.isLinkLabel?y:y.containingGroup!==null?om(a,y.containingGroup):null}function Lf(a,y,x,E){if(y!==x&&y.isVisible()){if(y.avoidable&&!y.isLinkLabel){y=y.getAvoidableRect(E),a=a.Xh;var b=y.x,z=y.y;if(Vf(a,b,z))for(x=(z-a.Od)/a.sc|0,E=Math.min((b+y.width-a.Nd)/a.rc|0,a.di),y=Math.min((z+y.height-a.Od)/a.sc|0,a.ei),b=(b-a.Nd)/a.rc|0;b<=E;b++)if(z=a.ac[b],z.fill)z.fill(Zh,x,y+1);else for(var tt=x;tt<=y;tt++)z[tt]=Zh}else if(y instanceof or)for(y=y.memberParts;y.next();)b=y.value,b instanceof qn&&Lf(a,b,x,E)}}function Nh(a,y){a.Xh===null||a.Xh.vs||y!==void 0&&(!y.avoidable||y.isLinkLabel)||(a.Xh.vs=!0)}be.prototype.gs=function(a){this.wp.assign(a),this.computeAutoScrollPosition(this.wp).Xa(this.position)?this.ug():jg(this)};function jg(a){a.vk===-1&&(a.vk=Pe(function(){if(a.vk!==-1&&(a.ug(),a.lastInput.event!==null)){var y=a.computeAutoScrollPosition(a.wp);y.Xa(a.position)||(a.position=y,a.lastInput.documentPoint=a.Ps(a.wp),a.doMouseMove(),a.Zi=!0,y=Be.alloc(),a.computeBounds(y),y.ed(a.documentBounds),Ig(a,y),Be.free(y),a.Fc=!0,a.bd(),jg(a))}},a.vp))}be.prototype.ug=function(){this.vk!==-1&&($e.clearTimeout(this.vk),this.vk=-1)},be.prototype.computeAutoScrollPosition=function(a){var y=this.position,x=this.xp;if(0>=x.top&&0>=x.left&&0>=x.right&&0>=x.bottom)return y;var E=this.viewportBounds,b=this.scale;E=Be.allocAt(0,0,E.width*b,E.height*b);var z=At.allocAt(0,0);if(a.x>=E.x&&a.x<E.x+x.left&&this.allowHorizontalScroll){var tt=Math.max(this.scrollHorizontalLineChange,1);tt|=0,z.x-=tt,a.x<E.x+x.left/2&&(z.x-=tt),a.x<E.x+x.left/4&&(z.x-=4*tt)}else a.x<=E.x+E.width&&a.x>E.x+E.width-x.right&&this.allowHorizontalScroll&&(tt=Math.max(this.scrollHorizontalLineChange,1),tt|=0,z.x+=tt,a.x>E.x+E.width-x.right/2&&(z.x+=tt),a.x>E.x+E.width-x.right/4&&(z.x+=4*tt));return a.y>=E.y&&a.y<E.y+x.top&&this.allowVerticalScroll?(tt=Math.max(this.scrollVerticalLineChange,1),tt|=0,z.y-=tt,a.y<E.y+x.top/2&&(z.y-=tt),a.y<E.y+x.top/4&&(z.y-=4*tt)):a.y<=E.y+E.height&&a.y>E.y+E.height-x.bottom&&this.allowVerticalScroll&&(tt=Math.max(this.scrollVerticalLineChange,1),tt|=0,z.y+=tt,a.y>E.y+E.height-x.bottom/2&&(z.y+=tt),a.y>E.y+E.height-x.bottom/4&&(z.y+=4*tt)),z.Xa(Un)||(y=new At(y.x+z.x/b,y.y+z.y/b)),Be.free(E),At.free(z),y},wt=be.prototype,wt.Cs=function(){return null},wt.av=function(){return null},wt.bs=function(a,y){this.pj.add(a,y)},wt.Fu=function(a){(this.Pw=a)||this.nodes.each(function(y){y instanceof or&&(y.$p=null)})};function Ac(a,y,x){function E(){var ut=+new Date;for(z=!0,tt.reset();tt.next();)if(!tt.value[0].al){z=!1;break}z||ut-lt>ot?y(x,b,rt):$e.requestAnimationFrame(E)}for(var b=x.callback,z=!0,tt=a.Og.iterator;tt.next();)if(!tt.value[0].al){z=!1;break}if(typeof b!="function"||z)return y(x,b,a);var rt=a,ot=x.callbackTimeout||300,lt=+new Date;return $e.requestAnimationFrame(function(){E()}),null}wt.Wz=function(a){return qo?(a===void 0&&(a={}),a.returnType="Image",this.Jx(a)):null},wt.Jx=function(a){return a===void 0&&(a={}),Ac(this,this.Xz,a)},wt.Xz=function(a,y,x){var E=am(x,a,"canvas",null);if(E===null)return null;x=E.Z.canvas;var b=null;if(x!==null)switch(b=a.returnType,b===void 0?b="string":b=b.toLowerCase(),b){case Jd+"data":b=E.getImageData(0,0,x.width,x.height);break;case Jd:E=(a.document||document).createElement("img"),E.src=x.toDataURL(a.type,a.details),b=E;break;case"blob":return typeof y!="function"&&$t('Error: Diagram.makeImageData called with "returnType: toBlob", but no required "callback" function property defined.'),typeof x.toBlob=="function"?(x.toBlob(y,a.type,a.details),"toBlob"):(y(null),null);default:b=x.toDataURL(a.type,a.details)}return typeof y=="function"?(y(b),null):b};function am(a,y,x,E){if(a.animationManager.Cc(),a.bd(),a.ta===null)return null;typeof y!="object"&&$t("properties argument must be an Object.");var b=y.size||null,z=y.scale||null;y.scale!==void 0&&isNaN(y.scale)&&(z="NaN");var tt=y.maxSize;y.maxSize===void 0&&(tt=x==="SVG"?new ln(1/0,1/0):new ln(2e3,2e3));var rt=y.position||null,ot=y.parts||null,lt=y.padding===void 0?1:y.padding,ut=y.background||null,ft=y.omitTemporary;ft===void 0&&(ft=!0);var yt=y.document||document,xt=y.elementFinished||null,Ct=y.showTemporary;Ct===void 0&&(Ct=!ft),y=y.showGrid,y===void 0&&(y=Ct),b!==null&&isNaN(b.width)&&isNaN(b.height)&&(b=null),typeof lt=="number"?lt=new ir(lt):lt instanceof ir||$t("MakeImage padding must be a Margin or a number."),lt.left=Math.max(lt.left,0),lt.right=Math.max(lt.right,0),lt.top=Math.max(lt.top,0),lt.bottom=Math.max(lt.bottom,0),a.ib.Vc(!0),ft=new Dl(null,yt,void 0,!0);var bt=ft.context;if(!(b||z||ot||rt))return ft.width=a.Aa+Math.ceil(lt.left+lt.right),ft.height=a.ya+Math.ceil(lt.top+lt.bottom),x==="SVG"?E===null?null:(E.resize(ft.width,ft.height,ft.width,ft.height),E.ownerDocument=yt,E.hs=xt,vf(a,E.context,lt,new ln(ft.width,ft.height),a.Ca,a.pa,ot,ut,Ct,y),E.context):(a.Xm=!1,vf(a,bt,lt,new ln(ft.width,ft.height),a.Ca,a.pa,ot,ut,Ct,y),a.Xm=!0,ft.context);var Wt=a.Pp,jt=a.documentBounds.copy();if(jt.Fv(a.yb),Ct)for(var Qt=a.Wa.s,te=Qt.length,re=0;re<te;re++){var he=Qt[re];if(he.visible&&he.isTemporary){he=he.Pa.s;for(var ke=he.length,Jn=0;Jn<ke;Jn++){var fi=he[Jn];fi.isInDocumentBounds&&fi.isVisible()&&(fi=fi.actualBounds,fi.w()&&jt.ed(fi))}}}if(Qt=new At(jt.x,jt.y),ot!==null){for(te=new Be(0,0,0,0),re=!0,he=ot.iterator,he.reset();he.next();)ke=he.value,ke instanceof Ni&&(Jn=ke.layer,Jn!==null&&!Jn.visible||Jn!==null&&!Ct&&Jn.isTemporary||!ke.isVisible()||(ke=ke.actualBounds,ke.w()&&(re?(re=!1,te.assign(ke)):te.ed(ke))));jt.width=te.width,jt.height=te.height,Qt.x=te.x,Qt.y=te.y}return rt!==null&&rt.w()&&(Qt=rt,z||(z=Wt)),te=rt=0,lt!==null&&(rt=lt.left+lt.right,te=lt.top+lt.bottom),re=he=0,b!==null&&(he=b.width,re=b.height,isFinite(he)&&(he=Math.max(0,he-rt)),isFinite(re)&&(re=Math.max(0,re-te))),b!==null&&z!==null?(z==="NaN"&&(z=Wt),b.w()?(b=he,jt=re):isNaN(re)?(b=he,jt=jt.height*z):(b=jt.width*z,jt=re)):b!==null?b.w()?(z=Math.min(he/jt.width,re/jt.height),b=he,jt=re):isNaN(re)?(z=he/jt.width,b=he,jt=jt.height*z):(z=re/jt.height,b=jt.width*z,jt=re):z!==null?z==="NaN"&&tt.w()?(z=Math.min((tt.width-rt)/jt.width,(tt.height-te)/jt.height),z>Wt?(z=Wt,b=jt.width,jt=jt.height):(b=tt.width,jt=tt.height)):(b=jt.width*z,jt=jt.height*z):(z=Wt,b=jt.width,jt=jt.height),lt!==null?(b+=rt,jt+=te):lt=new ir(0),tt!==null&&(Wt=tt.width,tt=tt.height,isNaN(Wt)&&(Wt=2e3),isNaN(tt)&&(tt=2e3),isFinite(Wt)&&(b=Math.min(b,Wt)),isFinite(tt)&&(jt=Math.min(jt,tt))),ft.width=Math.ceil(b),ft.height=Math.ceil(jt),x==="SVG"?E===null?null:(E.resize(ft.width,ft.height,ft.width,ft.height),E.ownerDocument=yt,E.hs=xt,vf(a,E.context,lt,new ln(Math.ceil(b),Math.ceil(jt)),z,Qt,ot,ut,Ct,y),E.context):(a.Xm=!1,vf(a,bt,lt,new ln(Math.ceil(b),Math.ceil(jt)),z,Qt,ot,ut,Ct,y),a.Xm=!0,ft.context)}ve.Object.defineProperties(be.prototype,{renderer:{get:function(){return this.nl},set:function(a){this instanceof mt||(a===""&&(a="default"),a=a.toLowerCase(),a!==this.nl&&(this.nl=a,a==="default"||a==="canvas"?(a=this.pj.get("svg"),a!==null&&a.Oa.remove(),this.ta&&(this.ib=this.ta.context)):a==="svg"?(this.pj.contains("svg")?a=this.pj.get("svg"):(a=new ku(this,$e.document),this.bs("svg",a)),this.div!==null&&this.div.appendChild(a.Oa),this.ib=a.context,this.ta&&(this.ta.context.setTransform(this.Mb,0,0,this.Mb,0,0),this.ta.context.clearRect(0,0,this.Aa,this.ya))):a!=="debug"||this.pj.contains("SVG")||(a=new ku(this,$e.document),this.bs("SVG",a),a.Oa.style.backgroundColor="whitesmoke",this.div!==null&&this.div.after(a.Oa)),this.hk()))}},div:{get:function(){return this.Ka},set:function(a){if(this.Ka!==a){var y=this.Ka;y!==null?(y.H=void 0,y.goDiagram=void 0,y.go=void 0,y.innerHTML="",this.ta!==null&&(y=this.ta.Oa,this.removeEventListener(y,"pointermove",this.dk,!1),this.removeEventListener(y,"pointerdown",this.ui,!1),this.removeEventListener(y,"pointerup",this.fk,!1),this.removeEventListener(y,"pointerout",this.ek,!1),this.removeEventListener(y,"pointercancel",this.ck,!1),this.ta.mx()),this.ol&&(this.ol.disconnect(),this.ol=null),y=this.toolManager,y!==null&&(y.mouseDownTools.each(function(x){x.cancelWaitAfter()}),y.mouseMoveTools.each(function(x){x.cancelWaitAfter()}),y.mouseUpTools.each(function(x){x.cancelWaitAfter()})),y.cancelWaitAfter(),this.currentTool.doCancel(),this.ta=null,this.removeEventListener($e,"resize",this.Ov,!1),this.removeEventListener($e,"wheel",this.$j,!0),ju===this&&(ju=null)):this.ui===null&&(this.hf=!1),this.Ka=null,a!==null&&((y=a.H)&&(y.div=null),Pg(this,a),this.hk())}}},$w:{get:function(){return this.Sq}},pi:{get:function(){return this.hf}},draggedLink:{get:function(){return this.nt},set:function(a){this.nt!==a&&(this.nt=a,a!==null&&(this.Vt=a.fromPort,this.Wt=a.toPort))}},Mx:{get:function(){return this.Vt},set:function(a){this.Vt=a}},Nx:{get:function(){return this.Wt},set:function(a){this.Wt=a}},animationManager:{get:function(){return this.Yd}},undoManager:{get:function(){return this.cc.undoManager}},skipsUndoManager:{get:function(){return this.Wg},set:function(a){this.Wg=a,this.cc.skipsUndoManager=a}},delaysLayout:{get:function(){return this.lt},set:function(a){this.lt=a}},opacity:{get:function(){return this.pb},set:function(a){var y=this.pb;y!==a&&((0>a||1<a)&&wn(a,"0 <= value <= 1",be,"opacity"),this.pb=a,this.g("opacity",y,a),this.N())}},validCycle:{get:function(){return this.wu},set:function(a){var y=this.wu;y!==a&&(this.wu=a,this.g("validCycle",y,a))}},layers:{get:function(){return this.Wa.iterator}},isModelReadOnly:{get:function(){var a=this.cc;return a===null?!1:a.isReadOnly},set:function(a){var y=this.cc;y!==null&&(y.isReadOnly=a)}},isReadOnly:{get:function(){return this.Gg},set:function(a){var y=this.Gg;y!==a&&(this.Gg=a,this.g("isReadOnly",y,a))}},isEnabled:{get:function(){return this.Jd},set:function(a){var y=this.Jd;y!==a&&(this.Jd=a,this.g("isEnabled",y,a))}},allowClipboard:{get:function(){return this.Us},set:function(a){var y=this.Us;y!==a&&(this.Us=a,this.g("allowClipboard",y,a))}},allowCopy:{get:function(){return this.Fi},set:function(a){var y=this.Fi;y!==a&&(this.Fi=a,this.g("allowCopy",y,a))}},allowDelete:{get:function(){return this.Gi},set:function(a){var y=this.Gi;y!==a&&(this.Gi=a,this.g("allowDelete",y,a))}},allowDragOut:{get:function(){return this.Vs},set:function(a){var y=this.Vs;y!==a&&(this.Vs=a,this.g("allowDragOut",y,a))}},allowDrop:{get:function(){return this.Ws},set:function(a){var y=this.Ws;y!==a&&(this.Ws=a,this.g("allowDrop",y,a))}},allowTextEdit:{get:function(){return this.Pi},set:function(a){var y=this.Pi;y!==a&&(this.Pi=a,this.g("allowTextEdit",y,a))}},allowGroup:{get:function(){return this.Hi},set:function(a){var y=this.Hi;y!==a&&(this.Hi=a,this.g("allowGroup",y,a))}},allowUngroup:{get:function(){return this.Qi},set:function(a){var y=this.Qi;y!==a&&(this.Qi=a,this.g("allowUngroup",y,a))}},allowInsert:{get:function(){return this.Ys},set:function(a){var y=this.Ys;y!==a&&(this.Ys=a,this.g("allowInsert",y,a))}},allowLink:{get:function(){return this.Ii},set:function(a){var y=this.Ii;y!==a&&(this.Ii=a,this.g("allowLink",y,a))}},allowRelink:{get:function(){return this.Ki},set:function(a){var y=this.Ki;y!==a&&(this.Ki=a,this.g("allowRelink",y,a))}},allowMove:{get:function(){return this.Ji},set:function(a){var y=this.Ji;y!==a&&(this.Ji=a,this.g("allowMove",y,a))}},allowReshape:{get:function(){return this.Li},set:function(a){var y=this.Li;y!==a&&(this.Li=a,this.g("allowReshape",y,a))}},allowResize:{get:function(){return this.Mi},set:function(a){var y=this.Mi;y!==a&&(this.Mi=a,this.g("allowResize",y,a))}},allowRotate:{get:function(){return this.Ni},set:function(a){var y=this.Ni;y!==a&&(this.Ni=a,this.g("allowRotate",y,a))}},allowSelect:{get:function(){return this.Oi},set:function(a){var y=this.Oi;y!==a&&(this.Oi=a,this.g("allowSelect",y,a))}},allowUndo:{get:function(){return this.Zs},set:function(a){var y=this.Zs;y!==a&&(this.Zs=a,this.g("allowUndo",y,a))}},allowZoom:{get:function(){return this.at},set:function(a){var y=this.at;y!==a&&(this.at=a,this.g("allowZoom",y,a))}},hasVerticalScrollbar:{get:function(){return this.nn},set:function(a){var y=this.nn;y!==a&&(this.nn=a,this.Ee=!0,this.N(),this.g("hasVerticalScrollbar",y,a),Al(this,!1))}},hasHorizontalScrollbar:{get:function(){return this.mn},set:function(a){var y=this.mn;y!==a&&(this.mn=a,this.Ee=!0,this.N(),this.g("hasHorizontalScrollbar",y,a),Al(this,!1))}},allowHorizontalScroll:{get:function(){return this.Xs},set:function(a){var y=this.Xs;y!==a&&(this.Xs=a,this.g("allowHorizontalScroll",y,a),Al(this,!1))}},allowVerticalScroll:{get:function(){return this.$s},set:function(a){var y=this.$s;y!==a&&(this.$s=a,this.g("allowVerticalScroll",y,a),Al(this,!1))}},scrollHorizontalLineChange:{get:function(){return this.iu},set:function(a){var y=this.iu;y!==a&&(0>a&&wn(a,">= 0",be,"scrollHorizontalLineChange"),this.iu=a,this.g("scrollHorizontalLineChange",y,a))}},scrollVerticalLineChange:{get:function(){return this.mu},set:function(a){var y=this.mu;y!==a&&(0>a&&wn(a,">= 0",be,"scrollVerticalLineChange"),this.mu=a,this.g("scrollVerticalLineChange",y,a))}},lastInput:{get:function(){return this.cj},set:function(a){this.cj=a}},previousInput:{get:function(){return this.Qg},set:function(a){this.Qg=a}},firstInput:{get:function(){return this.bq},set:function(a){this.bq=a}},currentCursor:{get:function(){return this.it},set:function(a){if(a===""&&(a=this.Op),this.it!==a){var y=this.ta,x=this.Ka;if(y!==null&&x!==null){this.it=a;var E=y.style.cursor;y.style.cursor=a,x.style.cursor=a,y.style.cursor===E&&(y.style.cursor="-webkit-"+a,x.style.cursor="-webkit-"+a,y.style.cursor===E&&(y.style.cursor="-moz-"+a,x.style.cursor="-moz-"+a,y.style.cursor===E&&(y.style.cursor=a,x.style.cursor=a)))}}}},defaultCursor:{get:function(){return this.Op},set:function(a){a===""&&(a="auto");var y=this.Op;y!==a&&(this.Op=a,this.g("defaultCursor",y,a))}},click:{get:function(){return this.zh},set:function(a){var y=this.zh;y!==a&&(this.zh=a,this.g("click",y,a))}},doubleClick:{get:function(){return this.Fh},set:function(a){var y=this.Fh;y!==a&&(this.Fh=a,this.g("doubleClick",y,a))}},contextClick:{get:function(){return this.Bh},set:function(a){var y=this.Bh;y!==a&&(this.Bh=a,this.g("contextClick",y,a))}},mouseOver:{get:function(){return this.Qh},set:function(a){var y=this.Qh;y!==a&&(this.Qh=a,this.g("mouseOver",y,a))}},mouseHover:{get:function(){return this.Oh},set:function(a){var y=this.Oh;y!==a&&(this.Oh=a,this.g("mouseHover",y,a))}},mouseHold:{get:function(){return this.Nh},set:function(a){var y=this.Nh;y!==a&&(this.Nh=a,this.g("mouseHold",y,a))}},mouseDragOver:{get:function(){return this.Qt},set:function(a){var y=this.Qt;y!==a&&(this.Qt=a,this.g("mouseDragOver",y,a))}},mouseDrop:{get:function(){return this.Lh},set:function(a){var y=this.Lh;y!==a&&(this.Lh=a,this.g("mouseDrop",y,a))}},handlesDragDropForTopLevelParts:{get:function(){return this.xt},set:function(a){var y=this.xt;y!==a&&(this.xt=a,this.g("handlesDragDropForTopLevelParts",y,a))}},mouseEnter:{get:function(){return this.Mh},set:function(a){var y=this.Mh;y!==a&&(this.Mh=a,this.g("mouseEnter",y,a))}},mouseLeave:{get:function(){return this.Ph},set:function(a){var y=this.Ph;y!==a&&(this.Ph=a,this.g("mouseLeave",y,a))}},toolTip:{get:function(){return this.$h},set:function(a){var y=this.$h;y!==a&&(this.$h=a,this.g("toolTip",y,a))}},contextMenu:{get:function(){return this.Ch},set:function(a){var y=this.Ch;y!==a&&(this.Ch=a,this.g("contextMenu",y,a))}},commandHandler:{get:function(){return this.nb},set:function(a){this.nb!==a&&(this.nb=a,a.Xe(this))}},toolManager:{get:function(){return this.te},set:function(a){this.te!==a&&(this.te=a,a.diagram=this)}},defaultTool:{get:function(){return this.ob},set:function(a){var y=this.ob;y!==a&&(this.ob=a,a.diagram=this,this.currentTool===y&&(this.currentTool=a))}},currentTool:{get:function(){return this.hb},set:function(a){var y=this.hb;y&&(y.isActive&&y.doDeactivate(),y.cancelWaitAfter(),y.doStop()),a===null&&(a=this.defaultTool),a!==null&&(this.hb=a,a.diagram=this,a.doStart())}},selection:{get:function(){return this.Hw}},maxSelectionCount:{get:function(){return this.Nt},set:function(a){var y=this.Nt;if(y!==a)if(0<=a&&!isNaN(a)){if(this.Nt=a,this.g("maxSelectionCount",y,a),!this.undoManager.isUndoingRedoing&&(a=this.selection.count-a,0<a)){this.R("ChangingSelection",this.selection),y=this.selection.Fa();for(var x=0;x<a;x++)y[x].isSelected=!1;this.R("ChangedSelection",this.selection)}}else wn(a,">= 0",be,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{get:function(){return this.St},set:function(a){var y=this.St;y!==a&&(this.St=a,this.g("nodeSelectionAdornmentTemplate",y,a))}},groupSelectionAdornmentTemplate:{get:function(){return this.wt},set:function(a){var y=this.wt;y!==a&&(this.wt=a,this.g("groupSelectionAdornmentTemplate",y,a))}},linkSelectionAdornmentTemplate:{get:function(){return this.Kt},set:function(a){var y=this.Kt;y!==a&&(this.Kt=a,this.g("linkSelectionAdornmentTemplate",y,a))}},highlighteds:{get:function(){return this.nw}},isModified:{get:function(){var a=this.undoManager;return a.isEnabled?a.currentTransaction!==null?!0:this.rn&&this.Ce!==a.historyIndex:this.rn},set:function(a){if(this.rn!==a){this.rn=a;var y=this.undoManager;!a&&y.isEnabled&&(this.Ce=y.historyIndex),a||nm(this)}}},model:{get:function(){return this.cc},set:function(a){var y=this.cc;if(y!==a){this.currentTool.doCancel(),y&&y.undoManager!==a.undoManager&&y.undoManager.isInTransaction&&$t("Do not replace a Diagram.model while a transaction is in progress."),this.animationManager.Cc(!0);var x=xg(this,!0);this.hf=!1,this.fn=!0,this.Ce=-2,this.kg=!1;var E=this.vb;this.vb=!0,Ru(this.animationManager,"Model"),y&&(this.pf!==null&&this.pf.each(function(z){return y.ik(z)}),y.ik(this.Oc)),this.cc=a,this.partManager=Dg(this.cc.type);for(var b=0;b<x.length;b++)this.add(x[b]);a.Pe(this.Hb),this.partManager.addAllModeledParts(),a.ik(this.Hb),a.Pe(this.Oc),this.pf!==null&&this.pf.each(function(z){return a.Pe(z)}),this.vb=E,this.Ya(),this.vb||this.N(),y&&a.undoManager.copyProperties(y.undoManager)}}},aa:{get:function(){return this.rw},set:function(a){this.rw=a}},As:{get:function(){return this.sy}},skipsModelSourceBindings:{get:function(){return this.Iw},set:function(a){this.Iw=a}},Ns:{get:function(){return this.ou},set:function(a){this.ou=a}},nodeTemplate:{get:function(){return this.Lg.I("")},set:function(a){var y=this.Lg.I("");y!==a&&(this.Lg.add("",a),this.g("nodeTemplate",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},nodeTemplateMap:{get:function(){return this.Lg},set:function(a){var y=this.Lg;y!==a&&(this.Lg=a,this.g("nodeTemplateMap",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},groupTemplate:{get:function(){return this.Yi.I("")},set:function(a){var y=this.Yi.I("");y!==a&&(this.Yi.add("",a),this.g("groupTemplate",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},groupTemplateMap:{get:function(){return this.Yi},set:function(a){var y=this.Yi;y!==a&&(this.Yi=a,this.g("groupTemplateMap",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},linkTemplate:{get:function(){return this.Kh.I("")},set:function(a){var y=this.Kh.I("");y!==a&&(this.Kh.add("",a),this.g("linkTemplate",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},linkTemplateMap:{get:function(){return this.Kh},set:function(a){var y=this.Kh;y!==a&&(this.Kh=a,this.g("linkTemplateMap",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},isMouseCaptured:{get:function(){return this.qw},set:function(a){var y=this.ta;y!==null&&(y=y.Oa,y instanceof SVGElement||(a?(this.lastInput.bubbles=!1,this.removeEventListener(y,"pointermove",this.dk,!1),this.removeEventListener(y,"pointerdown",this.ui,!1),this.removeEventListener(y,"pointerup",this.fk,!1),this.removeEventListener(y,"pointerout",this.ek,!1),this.removeEventListener(y,"pointercancel",this.ck,!1),this.addEventListener($e,"pointermove",this.dk,!0),this.addEventListener($e,"pointerdown",this.ui,!0),this.addEventListener($e,"pointerup",this.fk,!0),this.addEventListener($e,"pointerout",this.ek,!0),this.addEventListener($e,"pointercancel",this.ck,!0),this.removeEventListener(y,"wheel",this.$j,!1),this.addEventListener($e,"wheel",this.$j,!0),this.addEventListener($e,"selectstart",this.preventDefault,!1)):(this.removeEventListener($e,"pointermove",this.dk,!0),this.removeEventListener($e,"pointerdown",this.ui,!0),this.removeEventListener($e,"pointerup",this.fk,!0),this.removeEventListener($e,"pointerout",this.ek,!0),this.removeEventListener($e,"pointercancel",this.ck,!0),this.addEventListener(y,"pointermove",this.dk,!1),this.addEventListener(y,"pointerdown",this.ui,!1),this.addEventListener(y,"pointerup",this.fk,!1),this.addEventListener(y,"pointerout",this.ek,!1),this.addEventListener(y,"pointercancel",this.ck,!1),this.removeEventListener($e,"wheel",this.$j,!0),this.removeEventListener($e,"selectstart",this.preventDefault,!1),this.addEventListener(y,"wheel",this.$j,!1)),this.qw=a))}},position:{get:function(){return this.pa},set:function(a){var y=At.alloc().assign(this.pa);if(!y.D(a)){var x=this.viewportBounds.copy();this.pa.assign(a),Wp(this.animationManager,y,this.pa),this.vb||this.ta===null&&!this.wo.w()?Mu(this):(this.vb=!0,a=this.scale,Eg(this,this.Sp,this.Aa/a,this.ya/a,this.zk,!1),this.vb=!1),this.vb||this.onViewportBoundsChanged(x,this.viewportBounds,this.Ca,!1)}At.free(y)}},initialPosition:{get:function(){return this.zt},set:function(a){this.zt.D(a)||(this.zt=a.J())}},initialScale:{get:function(){return this.At},set:function(a){this.At!==a&&(this.At=a)}},grid:{get:function(){return this.fe===null&&(this.fe=$p(this)),this.fe},set:function(a){var y=this.fe;if(y!==a){y===null&&(y=this.fe=$p(this)),a.type!==En.Grid&&$t("Diagram.grid must be a Panel of type Panel.Grid");var x=y.panel;x!==null&&x.remove(y),this.fe=a,a.name="GRID",x!==null&&x.add(a),Fu(this),this.N(),this.g("grid",y,a)}}},viewportBounds:{get:function(){return this.Rw}},viewSize:{get:function(){return this.wo},set:function(a){var y=this.viewSize;y.D(a)||(this.wo=a=a.J(),this.ya=this.Aa=0,a.w()?(this.Aa=a.width,this.ya=a.height):this.Ka!==null&&(this.Aa=this.Ka.clientWidth||1,this.ya=this.Ka.clientHeight||1),Mu(this),this.Ya(),this.g("viewSize",y,a),this.redraw())}},fixedBounds:{get:function(){return this.ut},set:function(a){var y=this.ut;y.D(a)||(a.width!==-1/0&&a.height!==1/0&&a.height!==-1/0||$t("fixedBounds width/height must not be Infinity"),this.ut=a=a.J(),this.Ya(),this.g("fixedBounds",y,a))}},scrollMargin:{get:function(){return this.rj},set:function(a){typeof a=="number"&&(a=new ir(a));var y=this.rj;y.D(a)||(this.rj=a=a.J(),this.g("scrollMargin",y,a),this.hk())}},scrollMode:{get:function(){return this.sj},set:function(a){var y=this.sj;y!==a&&(this.sj=a,a===Bh&&Al(this,!1),this.g("scrollMode",y,a),this.Ee=!0,this.N())}},scrollsPageOnFocus:{get:function(){return this.nu},set:function(a){var y=this.nu;y!==a&&(this.nu=a,this.g("scrollsPageOnFocus",y,a))}},positionComputation:{get:function(){return this.Zt},set:function(a){var y=this.Zt;y!==a&&(this.Zt=a,Al(this,!1),this.g("positionComputation",y,a))}},scaleComputation:{get:function(){return this.fu},set:function(a){var y=this.fu;y!==a&&(this.fu=a,Tg(this,this.scale,this.scale),this.g("scaleComputation",y,a))}},documentBounds:{get:function(){return this.Sp}},isVirtualized:{get:function(){return this.It},set:function(a){var y=this.It;y!==a&&(this.It=a,this.g("isVirtualized",y,a))}},scale:{get:function(){return this.Ca},set:function(a){var y=this.Ca;y!==a&&Tg(this,y,a)}},defaultScale:{get:function(){return this.Pp},set:function(a){this.Pp=a}},autoScale:{get:function(){return this.yh},set:function(a){var y=this.yh;y!==a&&(this.yh=a,this.g("autoScale",y,a),a!==cs&&Al(this,!1))}},initialAutoScale:{get:function(){return this.Fg},set:function(a){var y=this.Fg;y!==a&&(this.Fg=a,this.g("initialAutoScale",y,a))}},initialViewportSpot:{get:function(){return this.Bt},set:function(a){var y=this.Bt;y!==a&&(a.sb()||$t("initialViewportSpot must be a specific Spot: "+a),this.Bt=a,this.g("initialViewportSpot",y,a))}},initialDocumentSpot:{get:function(){return this.yt},set:function(a){var y=this.yt;y!==a&&(a.sb()||$t("initialViewportSpot must be a specific Spot: "+a),this.yt=a,this.g("initialDocumentSpot",y,a))}},minScale:{get:function(){return this.Ot},set:function(a){var y=this.Ot;y!==a&&(0<a?(this.Ot=a,this.g("minScale",y,a),a>this.scale&&(this.scale=a)):wn(a,"> 0",be,"minScale"))}},maxScale:{get:function(){return this.Mt},set:function(a){var y=this.Mt;y!==a&&(0<a?(this.Mt=a,this.g("maxScale",y,a),a<this.scale&&(this.scale=a)):wn(a,"> 0",be,"maxScale"))}},zoomPoint:{get:function(){return this.zu},set:function(a){this.zu.D(a)||(this.zu=a=a.J())}},contentAlignment:{get:function(){return this.zk},set:function(a){var y=this.zk;y.D(a)||(this.zk=a=a.J(),this.g("contentAlignment",y,a),Al(this,!1))}},initialContentAlignment:{get:function(){return this.pq},set:function(a){var y=this.pq;y.D(a)||(this.pq=a=a.J(),this.g("initialContentAlignment",y,a))}},padding:{get:function(){return this.yb},set:function(a){typeof a=="number"&&(a=new ir(a));var y=this.yb;y.D(a)||(this.yb=a=a.J(),this.Ya(),this.g("padding",y,a))}},partManager:{get:function(){return this.Pc},set:function(a){var y=this.Pc;y!==a&&(a.diagram!==null&&$t("Cannot share PartManagers between Diagrams: "+a.toString()),y&&y.Xe(null),this.Pc=a,a.Xe(this))}},nodes:{get:function(){return this.partManager.nodes.iterator}},links:{get:function(){return this.partManager.links.iterator}},parts:{get:function(){return this.partManager.parts.iterator}},layout:{get:function(){return this.Sc},set:function(a){var y=this.Sc;y!==a&&(this.Sc=a,a.diagram=this,a.group=null,this.xh=!0,this.g("layout",y,a),this.$b())}},isTreePathToChildren:{get:function(){return this.Ht},set:function(a){var y=this.Ht;if(y!==a&&(this.Ht=a,this.g("isTreePathToChildren",y,a),!this.undoManager.isUndoingRedoing))for(a=this.nodes;a.next();)ip(a.value)}},treeCollapsePolicy:{get:function(){return this.uu},set:function(a){var y=this.uu;y!==a&&(a!==Ah&&a!==pa&&a!==Mf&&$t("Unknown Diagram.treeCollapsePolicy: "+a),this.uu=a,this.g("treeCollapsePolicy",y,a))}},Ue:{get:function(){return this.pw},set:function(a){this.pw=a}},avoidanceCellSize:{get:function(){return this.aw},set:function(a){this.Xh=null,this.aw=new ln(Math.max(1,a.width),Math.max(1,a.height))}},avoidanceLimit:{get:function(){return this.bw},set:function(a){this.bw=Math.max(1,a)}},autoScrollInterval:{get:function(){return this.vp},set:function(a){var y=this.vp;y!==a&&(this.vp=a,this.g("autoScrollInterval",y,a))}},autoScrollRegion:{get:function(){return this.xp},set:function(a){typeof a=="number"&&(a=new ir(a));var y=this.xp;y.D(a)||(this.xp=a=a.J(),this.Ya(),this.g("autoScrollRegion",y,a))}}}),ve.Object.defineProperties(be,{licenseKey:{get:function(){return Vg.jc()},set:function(a){Vg.add(a.replace(/\s/g,""))}},version:{get:function(){return Xd}}}),be.prototype.makeImageData=be.prototype.Jx,be.prototype.makeImage=be.prototype.Wz,be.prototype.cacheGroupExternalLinks=be.prototype.Fu,be.prototype.addRenderer=be.prototype.bs,be.prototype.makeSVG=be.prototype.av,be.prototype.makeSvg=be.prototype.Cs,be.prototype.stopAutoScroll=be.prototype.ug,be.prototype.doAutoScroll=be.prototype.gs,be.prototype.isUnoccupied=be.prototype.Yj,be.prototype.raiseDiagramEvent=be.prototype.R,be.prototype.removeDiagramListener=be.prototype.am,be.prototype.addDiagramListener=be.prototype.Bj,be.prototype.findTreeRoots=be.prototype.yz,be.prototype.layoutDiagram=be.prototype.Uz,be.prototype.findTopLevelGroups=be.prototype.qz,be.prototype.findTopLevelNodesAndLinks=be.prototype.rz,be.prototype.ensureBounds=be.prototype.Va,be.prototype.findLinksByExample=be.prototype.ls,be.prototype.findNodesByExample=be.prototype.ms,be.prototype.findLinkForData=be.prototype.Kc,be.prototype.findNodeForData=be.prototype.ii,be.prototype.findPartForData=be.prototype.Lc,be.prototype.findLinkForKey=be.prototype.findLinkForKey,be.prototype.findNodeForKey=be.prototype.Vb,be.prototype.findPartForKey=be.prototype.findPartForKey,be.prototype.rebuildParts=be.prototype.Wd,be.prototype.transformViewToDoc=be.prototype.Ps,be.prototype.transformRectDocToView=be.prototype.zA,be.prototype.transformDocToView=be.prototype.op,be.prototype.centerRect=be.prototype.es,be.prototype.scrollToRect=be.prototype.tv,be.prototype.scroll=be.prototype.scroll,be.prototype.highlightCollection=be.prototype.Jz,be.prototype.highlight=be.prototype.Iz,be.prototype.selectCollection=be.prototype.rA,be.prototype.select=be.prototype.select,be.prototype.updateAllRelationshipsFromData=be.prototype.rp,be.prototype.updateAllTargetBindings=be.prototype.updateAllTargetBindings,be.prototype.commit=be.prototype.commit,be.prototype.rollbackTransaction=be.prototype.Kf,be.prototype.commitTransaction=be.prototype.eb,be.prototype.startTransaction=be.prototype.Ea,be.prototype.raiseChanged=be.prototype.g,be.prototype.raiseChangedEvent=be.prototype.cb,be.prototype.removeChangedListener=be.prototype.ik,be.prototype.addChangedListener=be.prototype.Pe,be.prototype.removeModelChangedListener=be.prototype.mA,be.prototype.addModelChangedListener=be.prototype.Yw,be.prototype.findLayer=be.prototype.Qj,be.prototype.removeLayer=be.prototype.kA,be.prototype.addLayerAfter=be.prototype.Cy,be.prototype.addLayerBefore=be.prototype.Ww,be.prototype.addLayer=be.prototype.Al,be.prototype.moveParts=be.prototype.moveParts,be.prototype.copyParts=be.prototype.Kj,be.prototype.removeParts=be.prototype.Is,be.prototype.remove=be.prototype.remove,be.prototype.add=be.prototype.add,be.prototype.clearDelayedGeometries=be.prototype.bx,be.prototype.setProperties=be.prototype.nm,be.prototype.attach=be.prototype.Du,be.prototype.set=be.prototype.set,be.prototype.resetInputOptions=be.prototype.Sx,be.prototype.setInputOption=be.prototype.sA,be.prototype.getInputOption=be.prototype.Ql,be.prototype.resetRenderingHints=be.prototype.Tx,be.prototype.setRenderingHint=be.prototype.Xx,be.prototype.getRenderingHint=be.prototype.Gf,be.prototype.maybeUpdate=be.prototype.bd,be.prototype.requestUpdate=be.prototype.$b,be.prototype.delayInitialization=be.prototype.Xy,be.prototype.isUpdateRequested=be.prototype.Pz,be.prototype.invalidateDocumentBounds=be.prototype.Ya,be.prototype.findObjectsNear=be.prototype.og,be.prototype.findPartsNear=be.prototype.mz,be.prototype.findObjectsIn=be.prototype.Cf,be.prototype.findPartsIn=be.prototype.ux,be.prototype.findObjectsAt=be.prototype.ji,be.prototype.findPartsAt=be.prototype.lz,be.prototype.findObjectAt=be.prototype.ic,be.prototype.findPartAt=be.prototype.Ol,be.prototype.focusObject=be.prototype.zz,be.prototype.alignDocument=be.prototype.Jy,be.prototype.zoomToRect=be.prototype.BA,be.prototype.zoomToFit=be.prototype.zoomToFit,be.prototype.diagramScroll=be.prototype.kx,be.prototype.focus=be.prototype.focus;var Ff=new Ie,sm=null,qo=$e.document!==void 0,Yd=null,cd="",cs=new He(be,"None",0),ol=new He(be,"Uniform",1),fd=new He(be,"UniformToFill",2),Tc=new He(be,"CycleAll",10),zg=new He(be,"CycleNotDirected",11),Zg=new He(be,"CycleNotDirectedFast",12),Gg=new He(be,"CycleNotUndirected",13),Hg=new He(be,"CycleDestinationTree",14),Wg=new He(be,"CycleSourceTree",15),Bh=new He(be,"DocumentScroll",1),Dc=new He(be,"InfiniteScroll",2),Ah=new He(be,"TreeParentCollapsed",21),pa=new He(be,"AllParentsCollapsed",22),Mf=new He(be,"AnyParentsCollapsed",23),Vg=new fn,Xd="2.3.10",Jd="image",Oc=null,lm=!1;function os(){if(qo){var a=$e.document.createElement("canvas"),y=a.getContext("2d"),x=en("7ca11abfd022028846");y[x]=en("398c3597c01238");for(var E=["5da73c80a36455d7038e4972187c3cae51fd22",On.Dx+"4ae6247590da4bb21c324ba3a84e385776",fe.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",Zt.za],b=1;5>b;b++)y[en("7ca11abfd7330390")](en(E[b-1]),10,15*b);for(y[x]=en("39f046ebb36e4b"),x=1;5>x;x++)y[en("7ca11abfd7330390")](en(E[x-1]),10,15*x);(E.length!==4||E[0][0]!=="5"||E[3][0]!=="7")&&(fe.prototype.Cd=fe.prototype.Eu),Oc=a}}be.className="Diagram",be.fromDiv=function(a){var y=a;return typeof a=="string"&&(y=$e.document.getElementById(a)),y instanceof HTMLDivElement&&y.H instanceof be?y.H:null},be.inherit=function(a,y){function x(){}if(Object.getPrototypeOf(a).prototype)throw Error(`Used go.Diagram.inherit defining already defined class
`+a);x.prototype=y.prototype,a.prototype=new x,a.prototype.constructor=a},be.useDOM=function(a){qo=a?$e.document!==void 0:!1},be.isUsingDOM=function(){return qo},be.None=cs,be.Uniform=ol,be.UniformToFill=fd,be.CycleAll=Tc,be.CycleNotDirected=zg,be.CycleNotDirectedFast=Zg,be.CycleNotUndirected=Gg,be.CycleDestinationTree=Hg,be.CycleSourceTree=Wg,be.DocumentScroll=Bh,be.InfiniteScroll=Dc,be.TreeParentCollapsed=Ah,be.AllParentsCollapsed=pa,be.AnyParentsCollapsed=Mf;function um(){this.wy=null,this.j="zz@orderNum",this._tk==="63ad05bbe23a1786468a4c741b6d2"?this.Rc=this.j=!0:this.Rc=null}function Qd(a,y){if(y.ib.setTransform(y.Mb,0,0,y.Mb,0,0),y.ib.yc(),a.Rc===null)t:{y="f";var x=$e[en("76a715b2f73f148a")][en("72ba13b5")]||"";if(a.Rc=!0,qo){var E=be[en("76a115b6ed251eaf4692")];if(E)for(var b=Vg.iterator;b.next()&&(E=b.value,E=en(E).split(en("39e9")),!(6>E.length));){var z=en(E[1]).split(".");if(E[4]!=="7da71ca0")break;var tt=en(On[en("6cae19")]).split(".");if(z[0]>tt[0]||z[0]===tt[0]&&z[1]>=tt[1]){var rt=$e[en("74a900bae4370f8b51")][en("6fbb13a1c2311e8a57")].toLowerCase();if(tt=rt[en("73a612b6fb191d")](en("3aad1ab6e022098b4dc4")),z=en(E[2]),-1<tt&&(rt=rt[en("73a612b6fb191d")](z.toLowerCase()+"/"),a.Rc=!(-1<rt&&rt<tt),!a.Rc))break;for(tt=x[en("76ad18b4f73e")],rt=x[en("73a612b6fb191d")](en("35e7"))+2;rt<tt;rt++)y+=x[rt];if(tt=y[en("73a612b6fb191d")](z),0>tt&&z!==en("7da71ca0ad381e90")&&(tt=y[en("73a612b6fb191d")](en("76a715b2ef3e149757"))),0>tt&&(tt=y[en("73a612b6fb191d")](en("76a715b2ef3e149757"))),0>tt&&(tt=y[en("73a612b6fb191d")](en("2bfa41fdb3784bca12"))),0>tt&&(tt=x[en("73a612b6fb191d")](en("7baa19a6f76c1988428554"))),a.Rc=!(0<=tt&&tt<y[en("73a612b6fb191d")](en("35"))||y[en("73a612b6fb191d")](en("35"))===-1),!a.Rc||x[en("73a612b6fb191d")](en("7fb002b6ed25128b4da25b2e"))&&(a.Rc=!(-1<x[en("73a612b6fb191d")](z)),!a.Rc)||(tt=$e[en("76a715b2f73f148a")][en("69ad17a1e03e")],rt=tt[en("73a612b6fb191d")](en("7fb002b6ed25128b4da25b2e")),-1<rt&&(a.Rc=!(tt[en("73a612b6fb191d")](z)>rt),!a.Rc)))break;if(z[0]==="#"){tt=$e.document.createElement("div");for(var ot=E[0].replace(/[A-Za-z]/g,"");4>ot.length;)ot+="9";if(rt=ot,ot=ot.substr(ot.length-4),E="",E+=["gsh","gsf"][parseInt(ot.substr(0,1),10)%2],E+=["Header","Background","Display","Feedback"][parseInt(ot.substr(0,1),10)%4],tt[en("79a417a0f0181a8946")]=E,$e.document[en("78a712aa")]){$e.document[en("78a712aa")][en("7bb806b6ed32388c4a875b")](tt),ot=$e.getComputedStyle(tt).getPropertyValue(en("78a704b7e62456904c9b12701b6532a8"));var lt=$e.getComputedStyle(tt).getPropertyValue(en("75b817b0ea2202"));if($e.document[en("78a712aa")][en("68ad1bbcf533388c4a875b")](tt),ot){if(tt=$e[en("77a902b0eb1b1e804a8a")],lt==="0."+parseInt(rt,10)%100||ot.indexOf(parseInt(z[1]+z[2],16))!==-1&&ot.indexOf(parseInt(z[3]+z[4],16))!==-1){a.Rc=!1;break}else if(tt&&tt(en("32ae19a1e0331fc94084537c067a67fa59f1386b89d006")).matches)for(E="."+E,z=0;z<document.styleSheets.length;z++){tt=document.styleSheets[z].rules||document.styleSheets[z].cssRules;for(var ut in tt)if(E===tt[ut].selectorText){a.Rc=!1;break t}}}}else a.Rc=null,a.Rc=!1}}}else{for(ut=x[en("76ad18b4f73e")],b=x[en("73a612b6fb191d")](en("35e7"))+2;b<ut;b++)y+=x[b];x=y[en("73a612b6fb191d")](en("7da71ca0ad381e90")),a.Rc=!(0<=x&&x<y[en("73a612b6fb191d")](en("35")))}}}return 0<a.Rc&&a!==a.wy}um.className="DiagramHelper";function lh(a){this.j=a===void 0?new At:a,this.o=new At}ve.Object.defineProperties(lh.prototype,{point:{get:function(){return this.j},set:function(a){this.j=a}},shifted:{get:function(){return this.o},set:function(a){this.o=a}}});var Ic="DraggingInfo";lh.className="DraggingInfo";function it(a,y,x){this.node=a,this.info=y,this.Su=x}it.className="DraggingNodeInfoPair";function at(){this.reset()}at.prototype.reset=function(){this.isGridSnapEnabled=!1,this.isGridSnapRealtime=!0,this.gridSnapCellSize=new ln(NaN,NaN).freeze(),this.gridSnapCellSpot=eo,this.gridSnapOrigin=new At(NaN,NaN).freeze(),this.groupsSnapMembers=this.dragsTree=this.dragsLink=!1,this.dragsMembers=this.groupsAlwaysMove=!0},at.className="DraggingOptions";function ct(a,y){if(typeof a=="string"||$e.Element&&a instanceof Element)var x=be.call(this,a)||this;else x=be.call(this)||this,y=a;return dt(x),y&&x.nm(y),x}Se(ct,be);function dt(a){a.allowDragOut=!0,a.allowMove=!1,a.isReadOnly=!0,a.contentAlignment=Vo,a.layout=new Ha}ct.prototype.reset=function(){be.prototype.reset.call(this),dt(this)},ct.className="Palette";function mt(a,y){if(typeof a=="string"||$e.Element&&a instanceof Element)var x=be.call(this,a)||this;else x=be.call(this)||this,y=a;var E=x;x.animationManager.isEnabled=!1,x.vb=!0,x.V=null,x.mn=!1,x.nn=!1,x.F=!0,x.u=!0,x.ia=0,x.o=!1,x.ql=null,x.Xx("drawShadows",!1),a=new Ni;var b=new cr;return b.stroke="magenta",b.strokeWidth=2,b.fill="transparent",b.name="BOXSHAPE",a.selectable=!0,a.selectionAdorned=!1,a.selectionObjectName="BOXSHAPE",a.locationObjectName="BOXSHAPE",a.resizeObjectName="BOXSHAPE",a.cursor="move",a.add(b),x.j=a,x.allowCopy=!1,x.allowDelete=!1,x.allowSelect=!0,x.autoScrollRegion=new ir(0,0,0,0),x.pa.h(0,0),x.toolManager.gb("Dragging",new Vt,x.toolManager.mouseMoveTools),x.click=function(){var z=E.observed;if(z!==null){var tt=z.viewportBounds,rt=E.lastInput.documentPoint;z.position=new At(rt.x-tt.width/2,rt.y-tt.height/2)}},x.Pf=function(){E.Ya(),Ot(E)},x.Xd=function(){E.observed!==null&&(E.Ya(),E.N())},x.Ha=function(){1>E.updateDelay?E.N():E.o||(E.o=!0,setTimeout(function(){return E.redraw()},E.updateDelay))},x.Of=function(){E.observed!==null&&Ot(E)},x.autoScale=ol,x.vb=!1,y&&Object.assign(x,y),x}Se(mt,be),mt.prototype.computePixelRatio=function(){return 1},mt.prototype.redraw=function(){if(this.o&&1<=this.updateDelay){this.o=!1;var a=this.ta,y=this.ib;if(a!==null&&y!==null){if(Vd(this),this.ql===null){var x=new Dl(null);x.width=a.width,x.height=a.height,this.ql=x}try{this.ta=this.ql,this.ib=this.ta.context,this.ib.Vc(!0),this.ib.setTransform(1,0,0,1,0,0),this.ib.clearRect(0,0,this.ta.width,this.ta.height),Ft(this)}finally{this.ta=a,this.ib=y}}}be.prototype.redraw.call(this)},mt.prototype.gc=function(){if(this.Ka===null&&$t("No div specified"),this.ta===null&&$t("No canvas specified"),!(this.ta instanceof ku)&&(Ov(this.box),this.Fc)){var a=this.observed;if(a!==null&&!a.animationManager.defaultAnimation.isAnimating&&a.pi){Vd(this);var y=this.ta;a=this.ib,a.Vc(!0),a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,y.width,y.height),1>this.updateDelay?Ft(this):this.ql!==null&&(a.drawImage(this.ql.Oa,0,0),y=this.Ab,y.reset(),this.scale!==1&&y.scale(this.scale),this.position.x===0&&this.position.y===0||y.translate(-this.position.x,-this.position.y),a.scale(this.Mb,this.Mb),a.transform(y.m11,y.m12,y.m21,y.m22,y.dx,y.dy),a.yc()),y=this.Wa.s;for(var x=y.length,E=0;E<x;E++)y[E].gc(a,this);this.Fc=this.vd=!1}}};function Ft(a){var y=a.observed;if(y!==null){var x=a.drawsTemporaryLayers,E=a.drawsGrid&&x,b=y.grid;E&&b!==null&&b.visible&&!isNaN(b.width)&&!isNaN(b.height)&&(b=Be.alloc().assign(a.viewportBounds).ed(y.viewportBounds),Fu(y,b),Be.free(b),qa(y));var z=a.Ab;z.reset(),a.scale!==1&&z.scale(a.scale),a.position.x===0&&a.position.y===0||z.translate(-a.position.x,-a.position.y),b=a.ib,b.scale(a.Mb,a.Mb),b.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),b.yc(),y=y.Wa.s,z=y.length;for(var tt=0;tt<z;tt++){var rt=y[tt],ot=a;if(rt.visible&&rt.opacity!==0){var lt=rt.diagram.grid.part;if(!x&&rt.isTemporary)E&&lt.layer===rt&&(rt=sh(rt,b),lt.gc(b,ot),b.globalAlpha=rt);else{for(var ut=sh(rt,b),ft=ot.scale,yt=Be.alloc(),xt=rt.Pa.s,Ct=xt.length,bt=0;bt<Ct;bt++){var Wt=xt[bt];(E||Wt!==lt)&&rt.Oj(b,Wt,ot,null,ft,yt,!1)}Be.free(yt),b.globalAlpha=ut}}}}}function Ot(a){var y=a.box;if(y!==null){var x=a.observed;if(x!==null){a.Fc=!0,x=x.viewportBounds;var E=y.selectionObject,b=ln.alloc();b.h(x.width,x.height),E.desiredSize=b,ln.free(b),a=2/a.scale,E instanceof cr&&(E.strokeWidth=a),y.location=new At(x.x-a/2,x.y-a/2),y.isSelected=!0}}}mt.prototype.computeBounds=function(){var a=this.observed;if(a===null)return aa;var y=a.documentBounds.copy();return y.ed(a.viewportBounds),y},mt.prototype.invalidateViewport=function(){this.Fc!==!0&&(this.Fc=!0,this.$b())},mt.prototype.onViewportBoundsChanged=function(a,y,x,E){this.vb||(this.vd=!0,this.N(),this.Ee=!0,this.Ya(),Ot(this),this.fc.scale=x,this.fc.position.x=a.x,this.fc.position.y=a.y,this.fc.bounds.assign(a),this.fc.Oz=E,this.R("ViewportBoundsChanged",this.fc,a))},ve.Object.defineProperties(mt.prototype,{observed:{get:function(){return this.V},set:function(a){var y=this.V;if(a instanceof mt&&$t("Overview.observed Diagram may not be an Overview itself: "+a),y!==a){if(y!==null&&(this.remove(this.box),y.am("ViewportBoundsChanged",this.Pf),y.am("DocumentBoundsChanged",this.Xd),y.am("InvalidateDraw",this.Ha),y.am("AnimationFinished",this.Of)),this.V=a,a!==null&&(a.Bj("ViewportBoundsChanged",this.Pf),a.Bj("DocumentBoundsChanged",this.Xd),a.Bj("InvalidateDraw",this.Ha),a.Bj("AnimationFinished",this.Of),this.add(this.box)),this.Ya(),a===null){this.ql=null;var x=this.ta,E=this.ib;x&&E&&(E.setTransform(1,0,0,1,0,0),E.clearRect(0,0,x.width,x.height))}else this.Ha(null),Ot(this),this.N();this.g("observed",y,a)}}},box:{get:function(){return this.j},set:function(a){var y=this.j;y!==a&&(this.j=a,this.remove(y),this.add(this.j),Ot(this),this.g("box",y,a))}},drawsTemporaryLayers:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a,this.redraw())}},drawsGrid:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a,this.redraw())}},updateDelay:{get:function(){return this.ia},set:function(a){0>a&&(a=0),this.ia!==a&&(this.ia=a)}}}),mt.className="Overview";function Vt(){Ro.call(this),this.j=null}Se(Vt,Ro),Vt.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a===null||!a.allowMove||!a.allowSelect)return!1;var y=a.observed;if(y===null)return!1;var x=a.lastInput;return!x.left||a.currentTool!==this&&(!this.isBeyondDragSize()||x.isTouchEvent&&x.timestamp-a.firstInput.timestamp<this.delay)?!1:(this.findDraggablePart()===null&&(x=y.viewportBounds,this.j=new At(x.width/2,x.height/2),a=a.firstInput.documentPoint,y.position=new At(a.x-this.j.x,a.y-this.j.y)),!0)},Vt.prototype.doActivate=function(){this.j=null,Ro.prototype.doActivate.call(this)},Vt.prototype.doUpdateCursor=function(){var a=this.diagram,y=a.box;y!==null&&y.cursor&&(a.currentCursor=y.cursor)},Vt.prototype.moveParts=function(){var a=this.diagram,y=a.observed;if(y!==null){var x=a.box;if(x!==null){if(this.j===null){var E=a.firstInput.documentPoint;x=x.location,this.j=new At(E.x-x.x,E.y-x.y)}a=a.lastInput.documentPoint,y.position=new At(a.x-this.j.x,a.y-this.j.y)}}},Vt.className="OverviewDraggingTool";function Ht(){Di(this),this.H=ju,this.Ha=this.u=this.o=!0,this.F=this.V=this.nb=this.ia=!1,this.ij=this.j=null,this.Hb=1.05,this.Jt=NaN,this.sw=null,this.Au=NaN,this.yu=aa,this.hb=!0,this.cg=null,this.ob=200}Ht.prototype.toString=function(){return"CommandHandler"},Ht.prototype.Xe=function(a){this.H=a},Ht.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput,x=vr?y.meta:y.control,E=y.shift,b=y.alt,z=y.key;!x||z!=="C"&&z!=="Insert"?x&&z==="X"||E&&z==="Del"?this.canCutSelection()&&this.cutSelection():x&&z==="V"||E&&z==="Insert"?this.canPasteSelection()&&this.pasteSelection():x&&z==="Y"||b&&E&&z==="Backspace"?this.canRedo()&&this.redo():x&&z==="Z"||b&&z==="Backspace"?this.canUndo()&&this.undo():z==="Del"||z==="Backspace"?this.canDeleteSelection()&&this.deleteSelection():x&&z==="A"?this.canSelectAll()&&this.selectAll():z==="Esc"?this.canStopCommand()&&this.stopCommand():z==="Up"?a.allowVerticalScroll&&(x?a.scroll("pixel","up"):a.scroll("line","up")):z==="Down"?a.allowVerticalScroll&&(x?a.scroll("pixel","down"):a.scroll("line","down")):z==="Left"?a.allowHorizontalScroll&&(x?a.scroll("pixel","left"):a.scroll("line","left")):z==="Right"?a.allowHorizontalScroll&&(x?a.scroll("pixel","right"):a.scroll("line","right")):z==="PageUp"?E&&a.allowHorizontalScroll?a.scroll("page","left"):a.allowVerticalScroll&&a.scroll("page","up"):z==="PageDown"?E&&a.allowHorizontalScroll?a.scroll("page","right"):a.allowVerticalScroll&&a.scroll("page","down"):z==="Home"?x&&a.allowVerticalScroll?a.scroll("document","up"):!x&&a.allowHorizontalScroll&&a.scroll("document","left"):z==="End"?x&&a.allowVerticalScroll?a.scroll("document","down"):!x&&a.allowHorizontalScroll&&a.scroll("document","right"):z===" "?this.canScrollToPart()&&this.scrollToPart():z==="Subtract"?this.canDecreaseZoom()&&this.decreaseZoom():z==="Add"?this.canIncreaseZoom()&&this.increaseZoom():x&&z==="0"?this.canResetZoom()&&this.resetZoom():E&&z==="Z"?this.canZoomToFit()&&this.zoomToFit():x&&!E&&z==="G"?this.canGroupSelection()&&this.groupSelection():x&&E&&z==="G"?this.canUngroupSelection()&&this.ungroupSelection():z==="F2"||y.event&&y.event.key==="F2"?this.canEditTextBlock()&&this.editTextBlock():z==="ContextMenu"||y.event&&y.event.key==="ContextMenu"?this.canShowContextMenu()&&this.showContextMenu():y.bubbles=!0:this.canCopySelection()&&this.copySelection()},Ht.prototype.doKeyUp=function(){this.diagram.lastInput.bubbles=!0},Ht.prototype.stopCommand=function(){var a=this.diagram,y=a.currentTool;y instanceof Nr&&a.allowSelect&&a.clearSelection(),y!==null&&y.doCancel()},Ht.prototype.canStopCommand=function(){return!0},Ht.prototype.selectAll=function(){var a=this.diagram;a.N();try{a.currentCursor="wait",a.R("ChangingSelection",a.selection);for(var y=a.parts;y.next();)y.value.isSelected=!0;for(var x=a.nodes;x.next();)x.value.isSelected=!0;for(var E=a.links;E.next();)E.value.isSelected=!0}finally{a.R("ChangedSelection",a.selection),a.currentCursor=""}},Ht.prototype.canSelectAll=function(){return this.diagram.allowSelect},Ht.prototype.deleteSelection=function(){var a=this.diagram;try{a.currentCursor="wait",a.R("ChangingSelection",a.selection),a.Ea("Delete"),a.R("SelectionDeleting",a.selection);for(var y=new pn,x=a.selection.iterator;x.next();)vd(y,x.value,!0,this.deletesTree?1/0:0,this.deletesConnectedLinks?null:!1,function(E){return E.canDelete()});a.Is(y,!0),a.R("SelectionDeleted",y)}finally{a.eb("Delete"),a.R("ChangedSelection",a.selection),a.currentCursor=""}},Ht.prototype.canDeleteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowDelete||a.selection.count===0)},Ht.prototype.copySelection=function(){var a=this.diagram,y=new pn;for(a=a.selection.iterator;a.next();)vd(y,a.value,!0,this.copiesTree?1/0:0,this.copiesConnectedLinks,function(x){return x.canCopy()});this.copyToClipboard(y)},Ht.prototype.canCopySelection=function(){var a=this.diagram;return!!(a.allowCopy&&a.allowClipboard&&a.selection.count!==0)},Ht.prototype.cutSelection=function(){this.copySelection(),this.deleteSelection()},Ht.prototype.canCutSelection=function(){var a=this.diagram;return!!(!a.isReadOnly&&!a.isModelReadOnly&&a.allowCopy&&a.allowDelete&&a.allowClipboard&&a.selection.count!==0)},Ht.prototype.copyToClipboard=function(a){var y=this.diagram,x=null;if(a===null)Yd=null,cd="";else{x=y.model;var E=!1,b=!1,z=null;try{x.Tl()&&(E=x.Jj,x.Jj=this.copiesParentKey),x.Wj()&&(b=x.Ij,x.Ij=this.copiesGroupKey),z=y.Kj(a,null,!0)}finally{x.Tl()&&(x.Jj=E),x.Wj()&&(x.Ij=b),x=new fn,x.addAll(z),Yd=x,cd=y.model.dataFormat}}y.R("ClipboardChanged",x)},Ht.prototype.pasteFromClipboard=function(){var a=new pn,y=Yd;if(y===null)return a;var x=this.diagram;if(cd!==x.model.dataFormat)return a;var E=x.model,b=!1,z=!1,tt=null;try{E.Tl()&&(b=E.Jj,E.Jj=this.copiesParentKey),E.Wj()&&(z=E.Ij,E.Ij=this.copiesGroupKey),tt=x.Kj(y,x,!1)}finally{for(E.Tl()&&(E.Jj=b),E.Wj()&&(E.Ij=z),y=tt.iterator;y.next();)x=y.value,E=y.key,x.location.w()||(E.location.w()?x.location=E.location:!x.position.w()&&E.position.w()&&(x.position=E.position)),a.add(x)}return a},Ht.prototype.pasteSelection=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.currentCursor="wait",y.R("ChangingSelection",y.selection),y.Ea("Paste");var x=this.pasteFromClipboard();0<x.count&&y.clearSelection(!0);for(var E=x.iterator;E.next();)E.value.isSelected=!0;if(a!==null){var b=y.computePartsBounds(y.selection);if(b.w()){var z=this.computeEffectiveCollection(y.selection,y.Wm);ud(y,z,new At(a.x-b.centerX,a.y-b.centerY),y.Wm,!1)}}y.R("ClipboardPasted",x)}finally{y.eb("Paste"),y.R("ChangedSelection",y.selection),y.currentCursor=""}},Ht.prototype.canPasteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowClipboard||Yd===null||Yd.count===0||cd!==a.model.dataFormat)},Ht.prototype.undo=function(){this.diagram.undoManager.undo()},Ht.prototype.canUndo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canUndo()},Ht.prototype.redo=function(){this.diagram.undoManager.redo()},Ht.prototype.canRedo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canRedo()},Ht.prototype.decreaseZoom=function(a){a===void 0&&(a=1/this.zoomFactor);var y=this.diagram;y.autoScale===cs&&(a=y.scale*a,a<y.minScale||a>y.maxScale||(y.scale=a))},Ht.prototype.canDecreaseZoom=function(a){a===void 0&&(a=1/this.zoomFactor);var y=this.diagram;return y.autoScale!==cs?!1:(a=y.scale*a,a<y.minScale||a>y.maxScale?!1:y.allowZoom)},Ht.prototype.increaseZoom=function(a){a===void 0&&(a=this.zoomFactor);var y=this.diagram;y.autoScale===cs&&(a=y.scale*a,a<y.minScale||a>y.maxScale||(y.scale=a))},Ht.prototype.canIncreaseZoom=function(a){a===void 0&&(a=this.zoomFactor);var y=this.diagram;return y.autoScale!==cs?!1:(a=y.scale*a,a<y.minScale||a>y.maxScale?!1:y.allowZoom)},Ht.prototype.resetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;a<y.minScale||a>y.maxScale||(y.scale=a)},Ht.prototype.canResetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;return a<y.minScale||a>y.maxScale?!1:y.allowZoom},Ht.prototype.zoomToFit=function(){var a=this.diagram,y=a.animationManager;y.Cc(),a.redraw();var x=a.position,E=a.scale;Ru(y,"Zoom To Fit"),this.isZoomToFitRestoreEnabled&&E===this.Au&&!isNaN(this.Jt)&&a.documentBounds.D(this.yu)?(a.scale=this.Jt,a.position=this.sw,this.Au=NaN,this.yu=aa):(this.Jt=E,this.sw=x.copy(),a.zoomToFit(),this.Au=a.scale,this.yu=a.documentBounds.copy()),df(y)},Ht.prototype.canZoomToFit=function(){return this.diagram.allowZoom},Ht.prototype.scrollToPart=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.Va(),a===null){try{this.cg!==null&&(this.cg.next()?a=this.cg.value:this.cg=null)}catch(ot){this.cg=null}a===null&&(0<y.highlighteds.count?this.cg=y.highlighteds.iterator:0<y.selection.count&&(this.cg=y.selection.iterator),this.cg!==null&&this.cg.next()&&(a=this.cg.value))}if(a!==null){var x=y.animationManager;Ru(x,"Scroll To Part");var E=this.scrollToPartPause;if(0<E){var b=se(this,a,[a]);if(b.length===1)y.Ea(),y.es(a.actualBounds),y.eb("Scroll To Part");else{var z=function(){y.Ea();for(var ot=b.pop();0<b.length&&ot instanceof qn&&ot.isTreeExpanded&&(!(ot instanceof or)||ot.isSubGraphExpanded);)ot=b.pop();0<b.length?(ot instanceof Ni&&y.tv(ot.actualBounds),ot instanceof qn&&!ot.isTreeExpanded&&(ot.isTreeExpanded=!0),ot instanceof or&&!ot.isSubGraphExpanded&&(ot.isSubGraphExpanded=!0)):(ot instanceof Ni&&y.es(ot.actualBounds),y.am("LayoutCompleted",tt)),y.eb("Scroll To Part")},tt=function(){Pe(z,(x.isEnabled?x.duration:0)+E)};y.Bj("LayoutCompleted",tt),z()}}else{var rt=y.position.copy();y.es(a.actualBounds),rt.Xa(y.position)&&x.Cc()}}};function se(a,y,x){if(y.isVisible())return x;if(y instanceof Yr)se(a,y.adornedPart,x);else if(y instanceof Tn){var E=y.fromNode;E!==null&&se(a,E,x),y=y.toNode,y!==null&&se(a,y,x)}else y instanceof qn&&(E=y.labeledLink,E!==null&&se(a,E,x),E=y.pg(),E!==null&&(E.isTreeExpanded||E.wasTreeExpanded||x.push(E),se(a,E,x))),y=y.containingGroup,y!==null&&(y.isSubGraphExpanded||y.wasSubGraphExpanded||x.push(y),se(a,y,x));return x}Ht.prototype.canScrollToPart=function(a){return a===void 0&&(a=null),a!==null&&!(a instanceof Ni)?!1:(a=this.diagram,a.selection.count===0&&a.highlighteds.count===0?!1:a.allowHorizontalScroll&&a.allowVerticalScroll)},Ht.prototype.collapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse Tree"),Ru(y.animationManager,"Collapse Tree");var x=new fn;if(a!==null&&a.isTreeExpanded)a.collapseTree(),x.add(a);else if(a===null)for(var E=y.selection.iterator;E.next();){var b=E.value;b instanceof qn&&b.isTreeExpanded&&(b.collapseTree(),x.add(b))}y.R("TreeCollapsed",x)}finally{y.eb("Collapse Tree")}},Ht.prototype.canCollapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof qn&&a.isTreeExpanded))return!1;if(0<a.Qo().count)return!0}else for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof qn&&y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Ht.prototype.expandTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand Tree"),Ru(y.animationManager,"Expand Tree");var x=new fn;if(a!==null&&!a.isTreeExpanded)a.expandTree(),x.add(a);else if(a===null)for(var E=y.selection.iterator;E.next();){var b=E.value;b instanceof qn&&!b.isTreeExpanded&&(b.expandTree(),x.add(b))}y.R("TreeExpanded",x)}finally{y.eb("Expand Tree")}},Ht.prototype.canExpandTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof qn)||a.isTreeExpanded)return!1;if(0<a.Qo().count)return!0}else for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof qn&&!y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Ht.prototype.groupSelection=function(){var a=this.diagram,y=a.model;if(y.Xj()){var x=this.archetypeGroupData;if(x!==null){var E=null;try{a.currentCursor="wait",a.R("ChangingSelection",a.selection),a.Ea("Group");for(var b=new fn,z=a.selection.iterator;z.next();){var tt=z.value;tt.Zc()&&tt.canGroup()&&b.add(tt)}for(var rt=new fn,ot=b.iterator;ot.next();){var lt=ot.value;z=!1;for(var ut=b.iterator;ut.next();)if(lt.Td(ut.value)){z=!0;break}z||rt.add(lt)}if(0<rt.count){var ft=rt.first().containingGroup;if(ft!==null)for(;ft!==null;){b=!1;for(var yt=rt.iterator;yt.next();)if(!yt.value.Td(ft)){b=!0;break}if(b)ft=ft.containingGroup;else break}if(x instanceof or)Ol(x),E=x.copy(),E!==null&&a.add(E);else if(y.Yu(x)){var xt=y.copyNodeData(x);We(xt)&&(y.xf(xt),E=a.ii(xt))}if(E!==null){ft!==null&&this.isValidMember(ft,E)&&(E.containingGroup=ft);for(var Ct=rt.iterator;Ct.next();){var bt=Ct.value;this.isValidMember(E,bt)&&(bt.containingGroup=E)}a.clearSelection(!0),E.isSelected=!0}}a.R("SelectionGrouped",E)}finally{a.eb("Group"),a.R("ChangedSelection",a.selection),a.currentCursor=""}}}},Ht.prototype.canGroupSelection=function(){var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowGroup||!a.model.Xj()||this.archetypeGroupData===null)return!1;for(a=a.selection.iterator;a.next();){var y=a.value;if(y.Zc()&&y.canGroup())return!0}return!1};function ze(a){var y=pi();for(a=a.iterator;a.next();){var x=a.value;x instanceof Tn||y.push(x)}a=new pn,x=y.length;for(var E=0;E<x;E++){for(var b=y[E],z=!0,tt=0;tt<x;tt++)if(b.Td(y[tt])){z=!1;break}z&&a.add(b)}return oi(y),a}Ht.prototype.isValidMember=function(a,y){if(y===null||a===y||y instanceof Tn)return!1;if(a!==null){if(a===y||a.Td(y))return!1;var x=a.memberValidation;if(x!==null&&!x(a,y)||a.data===null&&y.data!==null||a.data!==null&&y.data===null)return!1}return x=this.memberValidation,x!==null?x(a,y):!0},Ht.prototype.ungroupSelection=function(a){a===void 0&&(a=null);var y=this.diagram,x=y.model;if(x.Xj())try{y.currentCursor="wait",y.R("ChangingSelection",y.selection),y.Ea("Ungroup");var E=new fn;if(a!==null)E.add(a);else for(var b=y.selection.iterator;b.next();){var z=b.value;z instanceof or&&z.canUngroup()&&E.add(z)}var tt=new fn;if(0<E.count){y.clearSelection(!0);for(var rt=E.iterator;rt.next();){var ot=rt.value;ot.expandSubGraph();var lt=ot.containingGroup,ut=lt!==null&&lt.data!==null?x.wa(lt.data):void 0;tt.addAll(ot.memberParts);for(var ft=tt.iterator;ft.next();){var yt=ft.value;if(yt.isSelected=!0,!(yt instanceof Tn)){var xt=yt.data;xt!==null?x.mp(xt,ut):yt.containingGroup=lt}}y.remove(ot)}}y.R("SelectionUngrouped",E,tt)}finally{y.eb("Ungroup"),y.R("ChangedSelection",y.selection),y.currentCursor=""}},Ht.prototype.canUngroupSelection=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly||y.isModelReadOnly||!y.allowDelete||!y.allowUngroup||!y.model.Xj())return!1;if(a!==null){if(!(a instanceof or))return!1;if(a.canUngroup())return!0}else for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof or&&y.canUngroup())return!0;return!1},Ht.prototype.addTopLevelParts=function(a,y){var x=!0;for(a=ze(a).iterator;a.next();){var E=a.value;E.containingGroup!==null&&(!y||this.isValidMember(null,E)?E.containingGroup=null:x=!1)}return x},Ht.prototype.collapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse SubGraph"),Ru(y.animationManager,"Collapse SubGraph");var x=new fn;if(a!==null&&a.isSubGraphExpanded)a.collapseSubGraph(),x.add(a);else if(a===null)for(var E=y.selection.iterator;E.next();){var b=E.value;b instanceof or&&b.isSubGraphExpanded&&(b.collapseSubGraph(),x.add(b))}y.R("SubGraphCollapsed",x)}finally{y.eb("Collapse SubGraph")}},Ht.prototype.canCollapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return!!(a instanceof or&&a.isSubGraphExpanded);for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof or&&y.isSubGraphExpanded)return!0;return!1},Ht.prototype.expandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand SubGraph"),Ru(y.animationManager,"Expand SubGraph");var x=new fn;if(a!==null&&!a.isSubGraphExpanded)a.expandSubGraph(),x.add(a);else if(a===null)for(var E=y.selection.iterator;E.next();){var b=E.value;b instanceof or&&!b.isSubGraphExpanded&&(b.expandSubGraph(),x.add(b))}y.R("SubGraphExpanded",x)}finally{y.eb("Expand SubGraph")}},Ht.prototype.canExpandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return a instanceof or&&!a.isSubGraphExpanded;for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof or&&!y.isSubGraphExpanded)return!0;return!1},Ht.prototype.editTextBlock=function(a){a===void 0&&(a=null);var y=this.diagram,x=y.toolManager.findTool("TextEditing");if(x!==null){if(a===null){a=null;for(var E=y.selection.iterator;E.next();){var b=E.value;if(b.canEdit()){a=b;break}}if(a===null)return;a=a.Nl(function(z){return z instanceof To&&z.editable})}a!==null&&(y.currentTool=null,x.textBlock=a,y.currentTool=x)}},Ht.prototype.canEditTextBlock=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly||y.isModelReadOnly||!y.allowTextEdit||y.toolManager.findTool("TextEditing")===null)return!1;if(a!==null){if(!(a instanceof To))return!1;if(a=a.part,a!==null&&a.canEdit())return!0}else for(y=y.selection.iterator;y.next();)if(a=y.value,a.canEdit()&&(a=a.Nl(function(x){return x instanceof To&&x.editable}),a!==null))return!0;return!1},Ht.prototype.showContextMenu=function(a){var y=this.diagram,x=y.toolManager.findTool("ContextMenu");if(x!==null&&(a===void 0&&(a=0<y.selection.count?y.selection.first():y),a=x.findObjectWithContextMenu(a),a!==null)){var E=y.lastInput,b=null;a instanceof de?b=a.ga(Or):y.viewportBounds.ca(E.documentPoint)||(b=y.viewportBounds,b=new At(b.x+b.width/2,b.y+b.height/2)),b!==null&&(E.viewPoint=y.op(b),E.documentPoint=b,E.left=!1,E.right=!0,E.up=!0),y.currentTool=x,rh(x,!1,a)}},Ht.prototype.canShowContextMenu=function(a){var y=this.diagram,x=y.toolManager.findTool("ContextMenu");return x===null?!1:(a===void 0&&(a=0<y.selection.count?y.selection.first():y),x.findObjectWithContextMenu(a)!==null)},Ht.prototype.computeEffectiveCollection=function(a,y){var x=this.diagram,E=x.toolManager.findTool("Dragging"),b=x.currentTool===E;if(y===void 0&&(y=b?E.dragOptions:x.Wm),E=new Ie,a===null)return E;for(var z=a.iterator;z.next();)Zu(x,E,z.value,b,y);if(x.draggedLink!==null&&y.dragsLink)return E;for(z=a.iterator;z.next();)a=z.value,a instanceof Tn&&(y=a.fromNode,y===null||E.contains(y)?(y=a.toNode,y===null||E.contains(y)||E.remove(a)):E.remove(a));return E},ve.Object.defineProperties(Ht.prototype,{diagram:{get:function(){return this.H}},copiesClipboardData:{get:function(){return this.o},set:function(a){this.o=a}},copiesConnectedLinks:{get:function(){return this.u},set:function(a){this.u=a}},deletesConnectedLinks:{get:function(){return this.Ha},set:function(a){this.Ha=a}},copiesTree:{get:function(){return this.ia},set:function(a){this.ia=a}},deletesTree:{get:function(){return this.nb},set:function(a){this.nb=a}},copiesParentKey:{get:function(){return this.V},set:function(a){this.V=a}},copiesGroupKey:{get:function(){return this.F},set:function(a){this.F=a}},archetypeGroupData:{get:function(){return this.j},set:function(a){this.j=a}},memberValidation:{get:function(){return this.ij},set:function(a){this.ij=a}},defaultScale:{get:function(){return this.diagram.defaultScale},set:function(a){this.diagram.defaultScale=a}},zoomFactor:{get:function(){return this.Hb},set:function(a){1<a||$t("zoomFactor must be larger than 1.0, not: "+a),this.Hb=a}},isZoomToFitRestoreEnabled:{get:function(){return this.hb},set:function(a){this.hb=a}},scrollToPartPause:{get:function(){return this.ob},set:function(a){this.ob=a}}}),Ht.className="CommandHandler",Jp=function(){return new Ht};function de(){Di(this),this.l=30723,this.pb=1,this.bn="",this.Ma=this.Me=null,this.pa=new At(NaN,NaN).freeze(),this.jd=jr,this.Ab=new fe,this.wh=new fe,this.Lb=null,this.Ca=this.Kk=1,this.Kb=0,this.Kg=ca,this.uc=new Be(NaN,NaN,NaN,NaN).freeze(),this.Ib=new Be(NaN,NaN,NaN,NaN).freeze(),this.dc=new Be(0,0,NaN,NaN).freeze(),this.ba=this.Yn=this.Zn=null,this.sk=this.Jb=xa,this.Ag=this.io=0,this.V=this.tb=this.Dh=this.A=this.Ua=null,this.Uc=!1,this.jo=this.Ng=null}var xn,un,wi,Li,ji,lr,_r,yr,Hr,wo;de.prototype.cloneProtected=function(a){a.l=this.l|6144,a.pb=this.pb,a.bn=this.bn,a.Ma=this.Ma,a.pa.assign(this.pa),a.jd=this.jd.J(),this.Lb!==null?a.Lb=this.Lb.copy():a.Lb=null,a.Ca=this.Ca,a.Kb=this.Kb,a.Kg=this.Kg.J(),a.uc.assign(this.uc),a.Ib.assign(this.Ib),a.dc.assign(this.dc),a.Yn=this.Yn,this.ba!==null&&(a.ba=this.ba.copy()),a.Jb=this.Jb.J(),a.sk=this.sk.J(),a.io=this.io,a.Ag=this.Ag,this.Ua!==null&&(a.Ua=this.Ua.copy()),this.A!==null&&(a.A=this.A.nc?this.A:this.A.copy()),this.Dh!==null&&(a.Dh=Vn(this.Dh)),this.tb!==null&&(a.tb=this.tb.copy())},de.prototype.Vw=function(a){var y=this.Dh;if(je(y)){for(var x=0;x<y.length;x++)if(y[x]===a)return}else this.Dh=y=[];y.push(a)},de.prototype.Af=function(a){a.Zn=null,a.Ng=null,a.v()},de.prototype.clone=function(){var a=new this.constructor;if(this.cloneProtected(a),this.Dh!==null)for(var y=0;y<this.Dh.length;y++){var x=this.Dh[y];a[x]=this[x]}return a},de.prototype.copy=function(){return this.clone()},wt=de.prototype,wt.qb=function(a){a.classType===Tn?a.name.indexOf("Orient")===0?this.segmentOrientation=a:$t("Unknown Link enum value for GraphObject.segmentOrientation property: "+a):a.classType===de&&(this.stretch=a)},wt.toString=function(){return hi(this.constructor)+"#"+Ai(this)},wt.th=function(){this.A!==null&&(this.A.nc=!0)};function mr(a){a.A===null?a.A=new Rc:a.A.nc&&(a.A=a.A.copy())}wt.Xc=function(){if(this.ba===null){var a=new Kg;a.Xi=gr,a.yj=gr,a.Vi=10,a.wj=10,a.Wi=0,a.xj=0,this.ba=a}},wt.cb=function(a,y,x,E,b,z,tt){var rt=this.part;if(rt!==null&&(rt.gk(a,y,x,E,b,z,tt),x===this&&a===Ir&&Ya(this)&&Go(this,rt,y),z=this.diagram,this.animationTriggers===null||z===null||!z.pi||z.undoManager.isUndoingRedoing||z.animationManager.Dm||(a=this.animationTriggers.get(y),a!==null&&z.animationManager.isEnabled&&!z.animationManager.isTicking&&(this.jo===null&&(this.jo=new Ie),tt=z.undoManager.transactionLevel===0,a.startCondition===ad?tt=!0:a.startCondition===Zd&&(tt=!1),tt?(z=new $a,Kp(a,z),tt=this.jo.get(a),tt!==null&&tt.stop(),this.jo.add(a,z),z.vu=this,z.Nw=a,z.add(this,y,E,b),z.start()):(Ru(z.animationManager,"Trigger"),z.animationManager.defaultAnimation.add(this,y,E,b)))),this instanceof En&&x===rt&&(rt.l&16777216)!==0&&rt.data!==null))for(x=this.O.s,E=x.length,b=0;b<E;b++)rt=x[b],rt instanceof En&&ec(rt,function(ot){ot.data!==null&&ot.l&16777216&&ot.La(y)})};function Go(a,y,x){var E=a.ih();if(E!==null)for(var b=a.localBindings.iterator;b.next();){var z=b.value,tt=null;if(z.sourceName!==null){if(tt=FS(z,E,a),tt===null)continue;z.sp(a,tt,x,null)}else if(z.isToModel){var rt=y.diagram;rt===null||rt.skipsModelSourceBindings||z.sp(a,rt.model.modelData,x,E)}else{if(rt=E.data,rt===null)continue;var ot=y.diagram;ot===null||ot.skipsModelSourceBindings||z.sp(a,rt,x,E)}tt===a&&(rt=E.ks(z.Ai),rt!==null&&z.Mv(rt,tt,x))}}wt.ks=function(a){return this.bindingId===a?this:null},wt.g=function(a,y,x){this.cb(Ir,a,this,y,x)},wt.Ge=function(a,y,x,E){var b=this.uc;if(b.h(a,y,x,E),this.Ca!==1||this.Kb!==0){this.Lb===null&&(this.Lb=new fe);var z=this.Lb;z.reset(),this.no(z,a,y,x,E),z.pp(b)}};function ka(a,y,x,E){return a.pickable===!1?!1:(E.multiply(a.transform),x?a.Yc(y,E):a.fh(y,E))}wt.tx=function(a,y,x){if(this.pickable===!1)return!1;var E=this.naturalBounds;return y=a.Bf(y),x?ni(a.x,a.y,0,0,0,E.height)<=y||ni(a.x,a.y,0,E.height,E.width,E.height)<=y||ni(a.x,a.y,E.width,E.height,E.width,0)<=y||ni(a.x,a.y,E.width,0,0,0)<=y:a.zd(0,0)<=y&&a.zd(0,E.height)<=y&&a.zd(E.width,0)<=y&&a.zd(E.width,E.height)<=y},wt.se=function(){return!0},wt.ca=function(a){var y=At.alloc();y.assign(a),this.transform.Ga(y);var x=this.actualBounds;if(!x.w())return At.free(y),!1;var E=this.diagram;if(E!==null&&E.wq){var b=E.Ql("extraTouchThreshold"),z=E.Ql("extraTouchArea"),tt=z/2,rt=this.naturalBounds;E=this.Df()*E.scale;var ot=1/E;if(rt.width*E<b&&rt.height*E<b)return a=Dr(x.x-tt*ot,x.y-tt*ot,x.width+z*ot,x.height+z*ot,y.x,y.y),At.free(y),a}return b=!1,(this instanceof Yr||this instanceof cr?Dr(x.x-5,x.y-5,x.width+10,x.height+10,y.x,y.y):x.ca(y))&&(this.tb&&!this.tb.ca(y)?b=!1:this.areaBackground!==null&&x.ca(y)||this.Ma!==null&&this.dc.ca(a)?b=!0:b=this.gh(a)),At.free(y),b},wt.gh=function(a){var y=this.naturalBounds;return Dr(0,0,y.width,y.height,a.x,a.y)},wt.Re=function(a){if(this.angle===0)return this.actualBounds.Re(a);var y=this.naturalBounds;y=Be.allocAt(0,0,y.width,y.height);var x=this.transform,E=!1,b=At.allocAt(a.x,a.y);return y.ca(x.Cd(b))&&(b.h(a.x,a.bottom),y.ca(x.Cd(b))&&(b.h(a.right,a.bottom),y.ca(x.Cd(b))&&(b.h(a.right,a.y),y.ca(x.Cd(b))&&(E=!0)))),At.free(b),Be.free(y),E},wt.fh=function(a,y){if(y===void 0)return a.Re(this.actualBounds);var x=this.naturalBounds,E=!1,b=At.allocAt(0,0);return a.ca(y.Ga(b))&&(b.h(0,x.height),a.ca(y.Ga(b))&&(b.h(x.width,x.height),a.ca(y.Ga(b))&&(b.h(x.width,0),a.ca(y.Ga(b))&&(E=!0)))),At.free(b),E},wt.Yc=function(a,y){if(y===void 0&&(y=this.transform,this.angle===0))return a.Yc(this.actualBounds);var x=this.naturalBounds,E=At.allocAt(0,0),b=At.allocAt(0,x.height),z=At.allocAt(x.width,x.height),tt=At.allocAt(x.width,0),rt=!1;if(a.ca(y.Ga(E))||a.ca(y.Ga(b))||a.ca(y.Ga(z))||a.ca(y.Ga(tt)))rt=!0;else{x=Be.allocAt(0,0,x.width,x.height);var ot=At.allocAt(a.x,a.y);x.ca(y.Cd(ot))?rt=!0:(ot.h(a.x,a.bottom),x.ca(y.Cd(ot))?rt=!0:(ot.h(a.right,a.bottom),x.ca(y.Cd(ot))?rt=!0:(ot.h(a.right,a.y),x.ca(y.Cd(ot))&&(rt=!0)))),At.free(ot),Be.free(x),!rt&&(Zt.us(a,E,b)||Zt.us(a,b,z)||Zt.us(a,z,tt)||Zt.us(a,tt,E))&&(rt=!0)}return At.free(E),At.free(b),At.free(z),At.free(tt),rt},wt.ga=function(a,y){if(y===void 0&&(y=new At),a instanceof In){var x=this.naturalBounds;y.h(a.x*x.width+a.offsetX,a.y*x.height+a.offsetY)}else y.set(a);return this.oe.Ga(y),y},wt.mi=function(a){a===void 0&&(a=new Be);var y=this.naturalBounds,x=this.oe,E=At.allocAt(0,0).transform(x);return a.h(E.x,E.y,0,0),E.h(y.width,0).transform(x),Jr(a,E.x,E.y,0,0),E.h(y.width,y.height).transform(x),Jr(a,E.x,E.y,0,0),E.h(0,y.height).transform(x),Jr(a,E.x,E.y,0,0),At.free(E),a},wt.li=function(){var a=this.oe;return a.m11===1&&a.m12===0?a=0:(a=180*Math.atan2(a.m12,a.m11)/Math.PI,0>a&&(a+=360)),a},wt.Df=function(){if(!(this.l&4096))return this.Kk;var a=this.Ca;return this.panel!==null?a*this.panel.Df():a},wt.qs=function(a,y){return y===void 0&&(y=new At),y.assign(a),this.oe.Cd(y),y},wt.rs=function(a,y,x){return this.Sj(a.x,a.y,y.x,y.y,x)},wt.Sj=function(a,y,x,E,b){var z=this.transform,tt=1/(z.m11*z.m22-z.m12*z.m21),rt=z.m22*tt,ot=-z.m12*tt,lt=-z.m21*tt,ut=z.m11*tt,ft=tt*(z.m21*z.dy-z.m22*z.dx),yt=tt*(z.m12*z.dx-z.m11*z.dy);return this.areaBackground!==null?(z=this.actualBounds,Zt.Ff(z.left,z.top,z.right,z.bottom,a,y,x,E,b)):(tt=a*rt+y*lt+ft,a=a*ot+y*ut+yt,y=x*rt+E*lt+ft,x=x*ot+E*ut+yt,b.h(0,0),E=this.naturalBounds,x=Zt.Ff(0,0,E.width,E.height,tt,a,y,x,b),b.transform(z),x)},de.prototype.measure=function(a,y,x,E){if(sl(this)!==!1){var b=this.Kg,z=b.right+b.left;b=b.top+b.bottom,a=Math.max(a-z,0),y=Math.max(y-b,0),x=Math.max((x||0)-z,0),E=Math.max((E||0)-b,0),z=this.angle,b=this.desiredSize;var tt=this.kq();z===90||z===270?(a=isFinite(b.height)?b.height+tt:a,y=isFinite(b.width)?b.width+tt:y):(a=isFinite(b.width)?b.width+tt:a,y=isFinite(b.height)?b.height+tt:y),b=x||0,tt=E||0;var rt=this instanceof En;switch(Ds(this,!0)){case un:tt=b=0,rt&&(y=a=1/0);break;case xn:isFinite(a)&&a>x&&(b=a),isFinite(y)&&y>E&&(tt=y);break;case Li:isFinite(a)&&a>x&&(b=a),tt=0,rt&&(y=1/0);break;case ji:isFinite(y)&&y>E&&(tt=y),b=0,rt&&(a=1/0)}rt=this.maxSize;var ot=this.minSize;b>rt.width&&ot.width<rt.width&&(b=rt.width),tt>rt.height&&ot.height<rt.height&&(tt=rt.height),x=Math.max(b,ot.width),E=Math.max(tt,ot.height),rt.width<x&&(x=Math.min(ot.width,x)),rt.height<E&&(E=Math.min(ot.height,E)),a=Math.min(rt.width,a),y=Math.min(rt.height,y),a=Math.max(x,a),y=Math.max(E,y),(z===90||z===270)&&(z=a,a=y,y=z,z=x,x=E,E=z),this.uc.ka(),this.Wl(a,y,x,E),this.uc.freeze(),this.uc.w()||$t("Non-real measuredBounds has been set. Object "+this+", measuredBounds: "+this.uc.toString()),ma(this,!1)}},de.prototype.Wl=function(){},de.prototype.Dd=function(){return!1},de.prototype.arrange=function(a,y,x,E,b){this.Uk();var z=Be.alloc();z.assign(this.Ib),this.Ib.ka(),ws(this)===!1?this.Ib.h(a,y,x,E):this.eh(a,y,x,E),this.Ib.freeze(),b===void 0?this.tb=null:this.tb=b,x=!1,b!==void 0?x=!0:(b=this.panel,b!==null&&Oh(b)&&(b=b.panel),b!==null&&(b=b.dc,E=this.measuredBounds,this.areaBackground!==null&&(E=this.Ib),x=y+E.height,E=a+E.width,x=!(0<=a+.05&&E<=b.width+.05&&0<=y+.05&&x<=b.height+.05),this instanceof To&&(a=this.naturalBounds,this.Lq>a.height||this.Cb>a.width))&&(x=!0)),this.l=x?this.l|256:this.l&-257,this.Ib.w()||$t("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Ib.toString()),this.Xl(z,this.Ib),Gu(this,!1),Be.free(z)},wt=de.prototype,wt.eh=function(){};function fs(a,y,x,E,b){if(a.Ib.h(y,x,E,b),!a.desiredSize.w()){var z=a.uc;x=a.Kg,y=x.right+x.left;var tt=x.top+x.bottom;switch(x=z.width+y,z=z.height+tt,E+=y,b+=tt,y=Ds(a,!0),x===E&&z===b&&(y=un),y){case un:(x>E||z>b)&&(ma(a,!0),a.measure(x>E?E:x,z>b?b:z,0,0));break;case xn:ma(a,!0),a.measure(E,b,0,0);break;case Li:ma(a,!0),a.measure(E,z,0,0);break;case ji:ma(a,!0),a.measure(x,b,0,0)}}}wt.Xl=function(a,y){var x=this.part;x!==null&&x.diagram!==null&&(x.selectionObject!==this&&x.resizeObject!==this&&x.rotateObject!==this||Rv(x,!0),this.N(),Qr(a,y)||(x.oh(),this.Pn(x)))},wt.Pn=function(a){this.portId!==null&&(Rv(a,!0),a instanceof qn&&H1(a,this))},wt.gc=function(a,y){if(!ml(this,a,y)&&this.visible){var x=this.opacity;if(x!==0){var E=1;x!==1&&(E=a.globalAlpha,a.globalAlpha=E*x);var b="";this.filter!==""&&(b=a.filter,a.filter=this.filter);var z=this instanceof En&&Oh(this),tt=this.Ib;if(z){var rt=this.Ib,ot=this.dc,lt=this.areaBackground,ut=this.Ma;lt===null&&ut===null||a.yc(),lt!==null&&(na(this,a,lt,!0,!0,ot,rt),lt instanceof mo&&lt.type===Sl?(a.beginPath(),a.rect(rt.x,rt.y,rt.width,rt.height),a.ng(lt)):a.fillRect(rt.x,rt.y,rt.width,rt.height)),ut!==null&&(na(this,a,ut,!0,!1,ot,rt),ut instanceof mo&&ut.type===Sl?(a.beginPath(),a.rect(rt.x,rt.y,rt.width,rt.height),a.ng(ut)):a.fillRect(rt.x,rt.y,rt.width,rt.height)),this.hh(a,y)}if(!z&&(z||tt.width!==0&&tt.height!==0&&!isNaN(tt.x)&&!isNaN(tt.y))){z=this.transform,rt=this.panel,this.l&4096&&Ga(this),lt=this.part,ot=!1;var ft=0;lt&&y.Gf("drawShadows")&&(ot=lt.isShadowed)&&(ut=lt.shadowOffset,ft=Math.max(ut.y,ut.x)*y.scale*y.Mb),ut=this.Dd();var yt;if(!(yt=y.$i||!ut)){var xt=this.naturalBounds;yt=this.wh;var Ct=yt.m11,bt=yt.m21,Wt=yt.dx,jt=yt.m12,Qt=yt.m22,te=yt.dy,re,he=re=0;yt=re*Ct+he*bt+Wt;var ke=re*jt+he*Qt+te;re=xt.width+ft,he=0;var Jn=re*Ct+he*bt+Wt;re=re*jt+he*Qt+te,he=Math.min(yt,Jn);var fi=Math.min(ke,re),li=Math.max(yt+0,Jn)-he,Bn=Math.max(ke+0,re)-fi;yt=he,ke=fi,re=xt.width+ft,he=xt.height+ft,Jn=re*Ct+he*bt+Wt,re=re*jt+he*Qt+te,he=Math.min(yt,Jn),fi=Math.min(ke,re),li=Math.max(yt+li,Jn)-he,Bn=Math.max(ke+Bn,re)-fi,yt=he,ke=fi,re=0,he=xt.height+ft,Jn=re*Ct+he*bt+Wt,re=re*jt+he*Qt+te,he=Math.min(yt,Jn),fi=Math.min(ke,re),li=Math.max(yt+li,Jn)-he,Bn=Math.max(ke+Bn,re)-fi,yt=he,ke=fi,ft=y.viewportBounds,xt=ft.x,Ct=ft.y,yt=!(yt>ft.width+xt||xt>li+yt||ke>ft.height+Ct||Ct>Bn+ke)}if(yt){if(yt=(this.l&256)!==0,a.clipInsteadOfFill&&(yt=!1),this instanceof To&&(a.font=this.font),yt){if(ke=rt.se()?rt.naturalBounds:rt.actualBounds,li=Math.max(tt.x,ke.x),Bn=Math.max(tt.y,ke.y),ft=Math.min(tt.right,ke.right)-li,xt=Math.min(tt.bottom,ke.bottom)-Bn,Ct=this.tb,Ct!==null&&(li=Ct.x,Bn=Ct.y,ft=Ct.width,xt=Ct.height),li>tt.width+tt.x||tt.x>ke.width+ke.x){x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b);return}a.save(),a.beginPath(),a.rect(li,Bn,ft,xt),a.clip()}if(ut){if(!lt.isVisible()){x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b);return}ot&&(ke=lt.shadowOffset,a.Ev(ke.x*y.scale*this.scale*y.Mb,ke.y*y.scale*this.scale*y.Mb,lt.shadowBlur),uh(a),a.shadowColor=lt.shadowColor)}ot&&this.shadowVisible===!0?uh(a):ot&&this.shadowVisible===!1&&Hu(a),lt=this.naturalBounds,this.areaBackground!==null&&(a.yc(),al(this,a,lt,tt)),a.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),ot&&Ra(this,rt)&&this.shadowVisible===null&&Hu(a),this.Ma!==null&&(a.yc(),Hs(this,a,lt,tt)),ot&&(this.Ma!==null||this.areaBackground!==null||Ra(this,rt))?(Xl(this,!0),this.shadowVisible===null&&Hu(a)):Xl(this,!1),this.hh(a,y),ot&&this.l&512&&uh(a),ut&&ot&&Hu(a),yt&&(a.restore(),a.Vc(this instanceof En)),z.ws()||(y=1/(z.m11*z.m22-z.m12*z.m21),a.transform(z.m22*y,-z.m12*y,-z.m21*y,z.m11*y,y*(z.m21*z.dy-z.m22*z.dx),y*(z.m12*z.dx-z.m11*z.dy)))}}x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b)}}};function Ra(a,y){return y===null?!1:(Oh(y)&&(y=y.panel),(y.l&512)!==0||(y.type===En.Auto||y.type===En.Spot)&&y.Pb()!==a)}wt.Dv=function(){};function al(a,y,x,E){na(a,y,a.areaBackground,!0,!0,x,E),a.areaBackground instanceof mo&&a.areaBackground.type===Sl?(y.beginPath(),y.rect(E.x,E.y,E.width,E.height),y.ng(a.areaBackground)):y.fillRect(E.x,E.y,E.width,E.height)}function Hs(a,y,x,E){var b=a.kq(),z=x.x,tt=x.y,rt=x.width+b,ot=x.height+b;na(a,y,a.Ma,!0,!1,x,E),a.Ma instanceof mo&&a.Ma.type===Sl?(y.beginPath(),y.rect(z-b/2,tt-b/2,rt,ot),y.ng(a.Ma)):y.fillRect(z-b/2,tt-b/2,rt,ot)}function as(a,y,x){for(var E=y.O.s,b=E.length,z=-1,tt=0;tt<b;tt++)if(E[tt]===a){z=tt;break}if(a=z,a!==-1)if(a===0)y.svg.gd?y.svg.gd.after(x):y.svg.Ma?y.svg.Ma.after(x):y.type===En.Table?(y=y.svg.getElementsByClassName("gojs-ts"),y=y.length!==0?y[0]:null,y!==null&&y.after(x)):y.svg.prepend(x);else{for(;a!==0&&!y.M(a-1).Ed();)a--;a===0?y.svg.prepend(x):(a=y.M(a-1).svg,a!==null?a.after(x):y.svg.appendChild(x))}}function ml(a,y,x){if(!(y instanceof Qs))return!1;if(!a.visible||a.opacity===0||a.Dd()&&!a.isVisible())return a.svg!==null&&a.svg.parentNode!==null&&a.svg.remove(),!0;var E=a.panel,b=a.nk(y);if(a.kk(y,x,b))return a.svg.parentElement!==null?(a.Dd()&&(y.ti=a.svg),!0):(a.Dd()?(y.ti!==null?y.ti.after(a.svg):y.Nj.prepend(a.svg),y.ti=a.svg):E&&as(a,E,a.svg),!0);if(a.Dd()&&a.isShadowed){var z=a.shadowOffset;y.Ev(z.x*x.scale*a.scale*x.Mb,z.y*x.scale*a.scale*x.Mb,a.shadowBlur),uh(y),y.shadowColor=a.shadowColor}a instanceof To&&(y.font=a.font),y.yd=null;var tt=a.transform;z=a instanceof En;var rt=a instanceof En?Oh(a):!1;a.l&4096&&Ga(a);var ot=a.Ib;if(y.rb.ha=[1,0,0,1,0,0],y.o=!1,b&&(y.o=!0,z&&rt?(Ug(y,1,0,0,1,0,0),a.svg=y.ad):z?(Ug(y,tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy),a.svg=y.ad):Ug(y,1,0,0,1,0,0)),b=a.naturalBounds,a.areaBackground!==null){var lt=tt.copy().Vj();y.rb.ha=[lt.m11,lt.m12,lt.m21,lt.m22,lt.dx,lt.dy],al(a,y,b,ot),y.rb.ha=[1,0,0,1,0,0],y.yd.gd=y.ad,y.yd.prepend(y.ad)}return z||(y.rb.ha=[tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy]),a.background!==null&&(z?(rt&&(y.rb.ha=[tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy]),Hs(a,y,b,ot),rt&&(y.rb.ha=[1,0,0,1,0,0])):(y.rb.ha=[tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy],Hs(a,y,b,ot)),y.yd.Ma=y.ad,y.yd.prepend(y.ad)),tt=y.yd,b=a.part,rt=!1,b&&x.Gf("drawShadows")&&(rt=b.isShadowed),y.clipInsteadOfFill&&(rt=!1),a.Dd()&&rt&&uh(y),rt&&a.shadowVisible===!0?uh(y):rt&&a.shadowVisible===!1&&Hu(y),b=a.panel,rt&&Ra(a,b)&&a.shadowVisible===null&&Hu(y),y.Il&&(lt=x.computePixelRatio(),lt="drop-shadow("+y.shadowOffsetX/lt+"px "+y.shadowOffsetY/lt+"px "+y.shadowBlur/lt/2+"px "+y.shadowColor+")",a.background!==null&&tt.Ma.setAttributeNS(null,"filter",lt),a.areaBackground!==null&&tt.gd.setAttributeNS(null,"filter",lt)),rt&&(a.Ma!==null||a.areaBackground!==null||Ra(a,b))?(Xl(a,!0),a.shadowVisible===null&&Hu(y)):Xl(a,!1),b=rt,a.hh(y,x),z&&y.nh.pop(),y.o&&y.nh.pop(),tt=y.Gv.hs,rt=z?a.svg:y.yd,lt=a.svg,!z&&lt!==null&&rt!==lt&&lt.parentNode===a.panel.svg?(a.svg.replaceWith(rt),a.svg=rt,rt!==null&&a.$o(y,E,ot,rt),Ts(y,lt),!0):(a.svg=rt,tt!==null&&rt===null&&(dm(y),y.nh.pop()),rt===null||(a.$o(y,E,ot,rt),y.Il&&(x=x.computePixelRatio(),a.Dv(rt,"drop-shadow("+y.shadowOffsetX/x+"px "+y.shadowOffsetY/x+"px "+y.shadowBlur/x/2+"px "+y.shadowColor+")")),b&&a.l&512&&uh(y),a.Dd()&&Hu(y),x=a.Dd()?a.opacity*y.globalAlpha:a.opacity,x!==1&&rt.setAttributeNS(null,"opacity",x.toString()),a.filter!==""&&rt.setAttributeNS(null,"filter",a.filter),a.Dd()?(y.ti?y.ti.after(rt):y.Nj.prepend(rt),y.ti=rt):E!==null&&as(a,E,rt),tt!==null&&tt(a,rt)),!0)}wt.$o=function(a,y,x,E){var b=(this.l&256)!==0;if(a.clipInsteadOfFill&&(b=!1),b){var z=y.se()?y.naturalBounds:y.actualBounds;y=Math.max(x.x,z.x),b=Math.max(x.y,z.y);var tt=Math.min(x.right,z.right)-y;x=Math.min(x.bottom,z.bottom)-b,z=this.tb,z!==null&&(y=z.x,b=z.y,tt=z.width,x=z.height),z=E.getAttribute("clip-path");var rt=null;z!==null&&(rt=a.svg.getElementById(z.split("#")[1].slice(0,-1))),rt===null?(z="CLIP"+bo++,rt=a.Ud("clipPath",{id:z}),y=a.Ud("rect",{x:y,y:b,width:tt,height:x}),this instanceof En&&(b=this.transform.copy().Vj(),y.setAttribute("transform","matrix("+b.m11+", "+b.m12+", "+b.m21+", "+b.m22+", "+b.dx+", "+b.dy+")")),rt.appendChild(y),a.svg.appendChild(rt),E.setAttributeNS(null,"clip-path","url(#"+z+")")):(a=rt.firstElementChild,a.setAttribute("x",y.toString()),a.setAttribute("y",b.toString()),a.setAttribute("width",tt.toString()),a.setAttribute("height",x.toString()))}else E.removeAttributeNS(null,"clip-path"),Ts(a,E)};function Ts(a,y){y=y.getAttribute("clip-path"),y!==null&&(a=a.svg.getElementById(y.split("#")[1].slice(0,-1)),a!==null&&a.remove())}function ss(a){if(a.svg!==null){var y=a.svg.innerHTML.match(/url\(#((CLIP|GRAD).+?)\)/g),x=a.svg.ownerDocument;if(y!==null){y=Wn(y);for(var E=y.next();!E.done;E=y.next())E=x.getElementById(E.value.split("#")[1].slice(0,-1)),E!==null&&E.remove()}a.svg.remove()}}wt.hh=function(){},wt.lv=function(){this.Uc=!0},wt.kk=function(a,y,x){if(this.Uc)return this.lv(),this.Uc=!1;if(y=this.svg,y===null)return!1;if(!this.visible)return y.remove(),!1;if(y.nodeName!=="g"&&x||y.nodeName==="g"&&!x)return!1;var E=this.transform,b=this instanceof En?Oh(this):!1;if(!(this instanceof En&&b))if(this instanceof Is){var z=this.bt;a.rb.ha=[E.m11,E.m12,E.m21,E.m22,E.dx,E.dy],z!==null&&Xy(a,z[0],z[1],z[2],z[3],z[4],z[5],z[6],z[7]),x?y.lastElementChild.setAttributeNS(null,"transform",Jy(a)):y.setAttributeNS(null,"transform",Jy(a))}else if(!x||this instanceof En)y.setAttributeNS(null,"transform","matrix("+E.m11+", "+E.m12+", "+E.m21+", "+E.m22+", "+E.dx+", "+E.dy+")");else if(this instanceof cr){z=y.getElementsByTagName("path");for(var tt=0;tt<z.length;tt++)z[tt].setAttributeNS(null,"transform","matrix("+E.m11+", "+E.m12+", "+E.m21+", "+E.m22+", "+E.dx+", "+E.dy+")")}else y.lastElementChild.setAttributeNS(null,"transform","matrix("+E.m11+", "+E.m12+", "+E.m21+", "+E.m22+", "+E.dx+", "+E.dy+")");return z=this.Dd()?this.opacity*a.globalAlpha:this.opacity,z===1?y.removeAttribute("opacity"):y.setAttributeNS(null,"opacity",z.toString()),a.rb.ha=[1,0,0,1,0,0],(this.areaBackground!==null||y.gd!==void 0)&&(z=y.gd,this.areaBackground===null?(y.gd.remove(),y.gd=void 0):(tt=E.copy().Vj(),a.rb.ha=[tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy],al(this,a,this.naturalBounds,this.actualBounds),a.rb.ha=[1,0,0,1,0,0],y.gd?(tt=y.gd.getAttribute("filter"),tt!==null&&a.ad.setAttribute("filter",tt),y.gd.replaceWith(a.ad)):y.prepend(a.ad),y.gd=a.ad),z&&cm(a,z)),(this.background!==null||y.Ma!==void 0)&&(z=y.Ma,this.background===null?(cm(a,y.Ma),y.Ma.remove(),y.Ma=void 0):((b||x&&!(this instanceof En))&&(a.rb.ha=[E.m11,E.m12,E.m21,E.m22,E.dx,E.dy]),Hs(this,a,this.naturalBounds,this.actualBounds),y.Ma?(cm(a,y.Ma),x=y.Ma.getAttribute("filter"),x!==null&&a.ad.setAttribute("filter",x),y.Ma.replaceWith(a.ad)):y.prepend(a.ad),y.Ma=a.ad),z&&cm(a,z)),this.$o(a,this.panel,this.actualBounds,y),!0},wt.nk=function(a){if(this.background!==null||this.areaBackground!==null)return!0;var y=(this.l&256)!==0;return a.clipInsteadOfFill&&(y=!1),!!y};function na(a,y,x,E,b,z,tt){if(x!==null){var rt=1,ot=1;if(typeof x=="string")E?y.fillStyle=x:y.strokeStyle=x;else if(x.type===Dh)E?y.fillStyle=x.color:y.strokeStyle=x.color;else{var lt=a.kq();if(rt=z.width,ot=z.height,b?(rt=tt.width,ot=tt.height):E||(rt+=lt,ot+=lt),(z=y instanceof tc)&&x.xe&&(x.type===Df||x.yk===rt&&x.ft===ot))var ut=x.xe;else{var ft=0,yt=0,xt=0,Ct=0,bt=0,Wt=0;if(Wt=bt=0,b?(bt=tt.x,Wt=tt.y):E||(bt-=lt/2,Wt-=lt/2),ft=x.start.x*rt+x.start.offsetX,yt=x.start.y*ot+x.start.offsetY,xt=x.end.x*rt+x.end.offsetX,Ct=x.end.y*ot+x.end.offsetY,ft+=bt,xt+=bt,yt+=Wt,Ct+=Wt,x.type===dh)ut=y.createLinearGradient(ft,yt,xt,Ct);else if(x.type===Sl)Wt=isNaN(x.endRadius)?Math.max(rt,ot)/2:x.endRadius,isNaN(x.startRadius)?(bt=0,Wt=Math.max(rt,ot)/2):bt=x.startRadius,ut=y.createRadialGradient(ft,yt,bt,xt,Ct,Wt);else if(x.type===Df)try{ut=y.createPattern(x.pattern,"repeat")}catch(Qt){ut=null}if(x.type!==Df&&(b=x.colorStops,b!==null))for(b=b.iterator;b.next();)ut.addColorStop(b.key,b.value);if(z&&(x.xe=ut,ut!==null&&(x.yk=rt,x.ft=ot),ut===null&&x.type===Df&&x.yk!==-1)){x.yk=-1;var jt=a.diagram;jt!==null&&x.yk===-1&&Pe(function(){jt.redraw()},600)}}E?y.fillStyle=ut:y.strokeStyle=ut}}}wt.rg=function(a){if(a instanceof En)t:{if(this!==a&&a!==null)for(var y=this.panel;y!==null;){if(y===a){a=!0;break t}y=y.panel}a=!1}else a=!1;return a},wt.Ed=function(){if(!this.visible)return!1;var a=this.panel;return a!==null?a.Ed():!0},wt.If=function(){for(var a=this instanceof En?this:this.panel;a!==null&&a.isEnabled;)a=a.panel;return a===null};function Ga(a){if(a.l&2048){var y=a.Ab;if(y.reset(),!a.Ib.w()||!a.uc.w()){Tl(a,!1);return}if(y.translate(a.Ib.x-a.uc.x,a.Ib.y-a.uc.y),a.scale!==1||a.angle!==0){var x=a.naturalBounds;a.no(y,x.x,x.y,x.width,x.height)}Tl(a,!1),vl(a,!0)}a.l&4096&&(y=a.panel,y===null?(a.wh.set(a.Ab),a.Kk=a.scale,vl(a,!1)):y.oe!==null&&(x=a.wh,x.reset(),y.se()?x.multiply(y.wh):y.panel!==null&&x.multiply(y.panel.wh),x.multiply(a.Ab),a.Kk=a.scale*y.Kk,vl(a,!1)))}wt.no=function(a,y,x,E,b){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=At.alloc();z.yi(y,x,E,b,Or),a.rotate(this.Kb,z.x,z.y),At.free(z)}},wt.v=function(a){if(!sl(this)){a===void 0&&(a=!1),ma(this,!0),Gu(this,!0);var y=this.panel;y===null||a||y.v()}},wt.Uj=function(){sl(this)||(ma(this,!0),Gu(this,!0))};function Ps(a){if(!ws(a)){var y=a.panel;y!==null?y.v():a.Dd()&&(y=a.diagram,y!==null&&(y.De.add(a),a instanceof qn&&a.Bd(),y.$b())),Gu(a,!0)}}wt.Uk=function(){!(this.l&2048)&&(Tl(this,!0),vl(this,!0))},wt.Wu=function(){vl(this,!0)},wt.N=function(){var a=this.part;a!==null&&a.N()};function Ds(a,y){var x=a.stretch,E=a.panel;return E!==null&&E.type===En.Table?fu(a,E.Fb(a.row),E.Eb(a.column),y):E!==null&&E.type===En.Auto&&E.Pb()===a?ja(a,xn,y):x===lr?E!==null?E.type===En.Spot&&E.Pb()===a?ja(a,xn,y):(x=E.defaultStretch,x===lr?ja(a,un,y):ja(a,x,y)):ja(a,un,y):ja(a,x,y)}function fu(a,y,x,E){var b=a.stretch;if(b!==lr)return ja(a,b,E);var z=b=null;switch(y.stretch){case ji:z=!0;break;case xn:z=!0}switch(x.stretch){case Li:b=!0;break;case xn:b=!0}return y=a.panel.defaultStretch,b===null&&(b=y===Li||y===xn),z===null&&(z=y===ji||y===xn),b===!0&&z===!0?ja(a,xn,E):b===!0?ja(a,Li,E):z===!0?ja(a,ji,E):ja(a,un,E)}function ja(a,y,x){if(x)return y;if(y===un||(x=a.desiredSize,x.w()))return un;if(a=a.angle,!isNaN(x.width))if(a!==90&&a!==270){if(y===Li)return un;if(y===xn)return ji}else{if(y===ji)return un;if(y===xn)return Li}if(!isNaN(x.height))if(a!==90&&a!==270){if(y===ji)return un;if(y===xn)return Li}else{if(y===Li)return un;if(y===xn)return ji}return y}function Xl(a,y){a.l=y?a.l|512:a.l&-513}function Ya(a){return(a.l&1024)!==0}function _c(a,y){a.l=y?a.l|1024:a.l&-1025}function Tl(a,y){a.l=y?a.l|2048:a.l&-2049}function vl(a,y){a.l=y?a.l|4096:a.l&-4097}function sl(a){return(a.l&8192)!==0}function ma(a,y){a.l=y?a.l|8192:a.l&-8193}function ws(a){return(a.l&16384)!==0}function Gu(a,y){a.l=y?a.l|16384:a.l&-16385}wt.Gj=function(){this.svg=null},wt.wi=function(a){this.Me=a,this.svg!==null&&this.svg.remove()},wt.Av=function(){},wt.zv=function(a){return this.pa=a,Ps(this),!0},wt.mm=function(a,y){(this.pa.x!==a||this.pa.y!==y)&&(this.pa.h(a,y),this.Uk())},wt.kq=function(){return 0};function $d(a){var y=a.part;if(y instanceof qn&&(a.portId!==null||a===y.port)){var x=y.diagram;x===null||x.undoManager.isUndoingRedoing||H1(y,a)}}function Uy(a){var y=a.diagram;y===null||y.undoManager.isUndoingRedoing||(a instanceof En?a instanceof qn?a.Bd():a.qm(a,function(x){$d(x)}):$d(a))}wt.bind=function(a,y,x,E){var b=null;return typeof a=="string"?b=new ua(a,y,x,E):b=a,b.xd=this,a=this.ih(),a!==null&&c1(a)&&$t("Cannot add a Binding to a template that has already been copied: "+b),this.localBindings===null&&(this.localBindings=new fn),this.localBindings.add(b),this},wt.set=function(a){return Object.assign(this,a),this},wt.Du=function(a){return nv(this,a),this},wt.apply=function(a){return a(this),this},wt.nm=function(a){return Wd(this,a),this},wt.pz=function(){return this.ih()},wt.ih=function(){for(var a=this instanceof En?this:this.panel;a!==null;){if(a.allBindings!==null)return a;a=a.panel}return null},wt.Jv=function(a){return a.xd=this,this.animationTriggers===null&&(this.animationTriggers=new Ie),this.animationTriggers.add(a.propertyName,a),this};function yl(a,y){for(var x=1;x<arguments.length;++x);x=arguments;var E=null,b=null;if(typeof a=="function")b=a;else if(typeof a=="string"){var z=kf.I(a);typeof z=="function"?(x=Vn(arguments),E=z(x),We(E)||$t('GraphObject.make invoked object builder "'+a+'", but it did not return an Object')):b=$e.go[a]}if(E===null&&(b!=null&&b.constructor||$t("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+a),E=new b),b=1,E instanceof be&&1<x.length){z=E;var tt=x[1];(typeof tt=="string"||tt instanceof HTMLDivElement)&&(Pg(z,tt),b++)}for(;b<x.length;b++)z=x[b],z===void 0?$t("Undefined value at argument "+b+" for object being constructed by GraphObject.make: "+E):nv(E,z);return E}function nv(a,y){if(typeof y=="string")if(a instanceof To)a.text=y;else if(a instanceof cr)a.figure=y;else if(a instanceof Is)a.source=y;else if(a instanceof En)y=Jl.I(y),y!==null&&(a.type=y);else if(a instanceof mo){var x=Hn(mo,y);x!==null?a.type=x:$t("Unknown Brush type as an argument to GraphObject.make: "+y)}else a instanceof Ye?(y=Hn(Ye,y),y!==null&&(a.type=y)):a instanceof Ri&&(y=Hn(Ri,y),y!==null&&(a.type=y));else if(y instanceof de)a instanceof En||$t("A GraphObject can only be added to a Panel, not to: "+a),a.add(y);else if(y instanceof va){var E;y.isRow&&typeof a.getRowDefinition=="function"?E=a.getRowDefinition(y.index):y.isRow||typeof a.getColumnDefinition!="function"||(E=a.getColumnDefinition(y.index)),E instanceof va?km(E,y):$t("A RowColumnDefinition can only be added to an object that implements getRowDefinition/getColumnDefinition, not to: "+a)}else if(y instanceof He)typeof a.qb=="function"&&a.qb(y);else if(y instanceof wa)a.type=y;else if(y instanceof ua)a instanceof de||a instanceof va?a.bind(y):$t("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+a);else if(y instanceof Ul)a instanceof de?a.Jv(y):$t("An AnimationTrigger can only be applied to a GraphObject, not to: "+a);else if(y instanceof Ur)a instanceof Ye&&a.type===Ye.o?a.figures.add(y):$t("A PathFigure can only be added to a Path Geometry, not to: "+a);else if(y instanceof Ri)a instanceof Ur?a.segments.add(y):$t("A PathSegment can only be added to a PathFigure, not to: "+a);else if(y instanceof Wo)a instanceof be||a instanceof or?a.layout=y:$t("A Layout can only be assigned to a Diagram or a Group, not to: "+a);else if(Array.isArray(y))for(x=0;x<y.length;x++)nv(a,y[x]);else if(typeof y=="object"&&y!==null)if(a instanceof mo){x=new Hi;for(var b in y)E=parseFloat(b),isNaN(E)?x[b]=y[b]:a.addColorStop(E,y[b]);Wd(a,x)}else if(a instanceof va){y.row!==void 0?(b=y.row,(b==null||b===1/0||isNaN(b)||0>b)&&$t("Must specify non-negative integer row for RowColumnDefinition "+y+", not: "+b),a.isRow=!0,a.index=b):y.column!==void 0&&(b=y.column,(b==null||b===1/0||isNaN(b)||0>b)&&$t("Must specify non-negative integer column for RowColumnDefinition "+y+", not: "+b),a.isRow=!1,a.index=b),b=new Hi;for(x in y)x!=="row"&&x!=="column"&&(b[x]=y[x]);Wd(a,b)}else Wd(a,y);else $t('Unknown initializer "'+y+'" for object being constructed by GraphObject.make: '+a)}function Th(a,y){kf.add(a,y)}function hm(a,y,x){x===void 0&&(x=null);var E=a[1];if(typeof x=="function"?x(E):typeof E=="string")return a.splice(1,1),E;if(y===void 0)throw Error("no "+(typeof x=="function"?"satisfactory":"string")+" argument for GraphObject builder "+a[0]);return y}ve.Object.defineProperties(de.prototype,{bindingId:{get:function(){return this.A!==null?this.A.zp:-1},set:function(a){this.bindingId!==a&&(this.A===null&&(this.A=new Rc),this.A.zp=a)}},localBindings:{get:function(){return this.A!==null?this.A.te:null},set:function(a){this.localBindings!==a&&(this.A===null&&(this.A=new Rc),this.A.te=a)}},srcBindings:{get:function(){return this.A!==null?this.A.wm:null},set:function(a){this.srcBindings!==a&&(this.A===null&&(this.A=new Rc),this.A.wm=a)}},shadowVisible:{get:function(){return this.A!==null?this.A.Ci:null},set:function(a){var y=this.shadowVisible;y!==a&&(mr(this),this.A.Ci=a,this.Uc=!0,this.N(),this.g("shadowVisible",y,a))}},enabledChanged:{get:function(){return this.A!==null?this.A.Hb:null},set:function(a){var y=this.enabledChanged;y!==a&&(mr(this),this.A.Hb=a,this.g("enabledChanged",y,a))}},segmentOrientation:{get:function(){return this.Ua!==null?this.Ua.rr:Ls},set:function(a){var y=this.segmentOrientation;y!==a&&(this.Ua===null&&(this.Ua=new gd),this.Ua.rr=a,this.v(),this.g("segmentOrientation",y,a),a===Ls&&(this.angle=0))}},segmentIndex:{get:function(){return this.Ua!==null?this.Ua.u:-1/0},set:function(a){a=Math.round(a);var y=this.segmentIndex;y!==a&&(this.Ua===null&&(this.Ua=new gd),this.Ua.u=a,this.v(),this.g("segmentIndex",y,a))}},segmentFraction:{get:function(){return this.Ua!==null?this.Ua.o:0},set:function(a){isNaN(a)||0>a?a=0:1<a&&(a=1);var y=this.segmentFraction;y!==a&&(this.Ua===null&&(this.Ua=new gd),this.Ua.o=a,this.v(),this.g("segmentFraction",y,a))}},segmentOffset:{get:function(){return this.Ua!==null?this.Ua.F:Un},set:function(a){var y=this.segmentOffset;y.D(a)||(a=a.J(),this.Ua===null&&(this.Ua=new gd),this.Ua.F=a,this.v(),this.g("segmentOffset",y,a))}},stretch:{get:function(){return this.A!==null?this.A.hg:lr},set:function(a){var y=this.stretch;y!==a&&(mr(this),this.A.hg=a,this.v(),this.g("stretch",y,a))}},name:{get:function(){return this.A!==null?this.A.xa:""},set:function(a){var y=this.name;y!==a&&(mr(this),this.A.xa=a,this.part!==null&&(this.part.Rh=null),this.g("name",y,a))}},opacity:{get:function(){return this.pb},set:function(a){var y=this.pb;y!==a&&((0>a||1<a)&&wn(a,"0 <= value <= 1",de,"opacity"),this.pb=a,this.g("opacity",y,a),a=this.diagram,y=this.part,a!==null&&y!==null&&a.N(rc(y,y.actualBounds)))}},filter:{get:function(){return this.bn},set:function(a){var y=this.bn;y!==a&&(this.bn=a,this.Uc=!0,this.g("filter",y,a),a=this.diagram,y=this.part,a!==null&&y!==null&&a.N(rc(y,y.actualBounds)))}},visible:{get:function(){return(this.l&1)!==0},set:function(a){var y=(this.l&1)!==0;y!==a&&(this.l^=1,this.g("visible",y,a),y=this.panel,y!==null?y.v():this.Dd()&&this.Zb(a),this.N(),Uy(this))}},pickable:{get:function(){return(this.l&2)!==0},set:function(a){var y=(this.l&2)!==0;y!==a&&(this.l^=2,this.g("pickable",y,a))}},fromLinkableDuplicates:{get:function(){return(this.l&4)!==0},set:function(a){var y=(this.l&4)!==0;y!==a&&(this.l^=4,this.g("fromLinkableDuplicates",y,a))}},fromLinkableSelfNode:{get:function(){return(this.l&8)!==0},set:function(a){var y=(this.l&8)!==0;y!==a&&(this.l^=8,this.g("fromLinkableSelfNode",y,a))}},toLinkableDuplicates:{get:function(){return(this.l&16)!==0},set:function(a){var y=(this.l&16)!==0;y!==a&&(this.l^=16,this.g("toLinkableDuplicates",y,a))}},toLinkableSelfNode:{get:function(){return(this.l&32)!==0},set:function(a){var y=(this.l&32)!==0;y!==a&&(this.l^=32,this.g("toLinkableSelfNode",y,a))}},isPanelMain:{get:function(){return(this.l&64)!==0},set:function(a){var y=(this.l&64)!==0;y!==a&&(this.l^=64,this.v(),this.g("isPanelMain",y,a))}},isActionable:{get:function(){return(this.l&128)!==0},set:function(a){var y=(this.l&128)!==0;y!==a&&(this.l^=128,this.g("isActionable",y,a))}},areaBackground:{get:function(){return this.A!==null?this.A.gd:null},set:function(a){var y=this.areaBackground;y!==a&&(a!==null&&zc(a,"GraphObject.areaBackground"),a instanceof mo&&a.freeze(),mr(this),this.A.gd=a,this.N(),this.g("areaBackground",y,a))}},background:{get:function(){return this.Ma},set:function(a){var y=this.Ma;y!==a&&(a!==null&&zc(a,"GraphObject.background"),a instanceof mo&&a.freeze(),this.Ma=a,this.N(),this.g("background",y,a))}},part:{get:function(){if(this.Dd())return this;if(this.Ng!==null)return this.Ng;var a;for(a=this.panel;a;){if(a instanceof Ni)return this.Ng=a;a=a.panel}return null}},svg:{get:function(){return this.V},set:function(a){this.V=a}},panel:{get:function(){return this.Me}},layer:{get:function(){var a=this.part;return a!==null?a.layer:null}},diagram:{get:function(){var a=this.part;return a!==null?a.diagram:null}},position:{get:function(){return this.pa},set:function(a){var y=a.x,x=a.y,E=this.pa,b=E.x;E=E.y,(b===y||isNaN(b)&&isNaN(y))&&(E===x||isNaN(E)&&isNaN(x))?this.Av():(a=a.copy(),this.zv(a,b,E)&&this.g("position",new At(b,E),a))}},actualBounds:{get:function(){return this.Ib}},scale:{get:function(){return this.Ca},set:function(a){var y=this.Ca;y!==a&&(0>=a&&$t("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.Ca=a,this.v(),this.g("scale",y,a))}},angle:{get:function(){return this.Kb},set:function(a){var y=this.Kb;y!==a&&(a%=360,0>a&&(a+=360),y!==a&&(this.Kb=a,Uy(this),this.v(),this.g("angle",y,a)))}},desiredSize:{get:function(){return this.jd},set:function(a){var y=a.width,x=a.height,E=this.jd,b=E.width,z=E.height;(b===y||isNaN(b)&&isNaN(y))&&(z===x||isNaN(z)&&isNaN(x))||(this.jd=a=a.J(),this.v(),this instanceof cr&&this.qc(),this.g("desiredSize",E,a),Ya(this)&&(a=this.part,a!==null&&(Go(this,a,"width"),Go(this,a,"height"))))}},width:{get:function(){return this.jd.width},set:function(a){var y=this.jd.width;y===a||isNaN(y)&&isNaN(a)||(y=this.jd,this.jd=a=new ln(a,this.jd.height).freeze(),this.v(),this instanceof cr&&this.qc(),this.g("desiredSize",y,a),Ya(this)&&(a=this.part,a!==null&&Go(this,a,"width")))}},height:{get:function(){return this.jd.height},set:function(a){var y=this.jd.height;y===a||isNaN(y)&&isNaN(a)||(y=this.jd,this.jd=a=new ln(this.jd.width,a).freeze(),this.v(),this instanceof cr&&this.qc(),this.g("desiredSize",y,a),Ya(this)&&(a=this.part,a!==null&&Go(this,a,"height")))}},minSize:{get:function(){return this.A!==null?this.A.u:Pi},set:function(a){var y=this.minSize;y.D(a)||(a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),mr(this),this.A.u=a,this.v(),this.g("minSize",y,a))}},maxSize:{get:function(){return this.A!==null?this.A.o:Zr},set:function(a){var y=this.maxSize;y.D(a)||(a=a.copy(),isNaN(a.width)&&(a.width=1/0),isNaN(a.height)&&(a.height=1/0),a.freeze(),mr(this),this.A.o=a,this.v(),this.g("maxSize",y,a))}},measuredBounds:{get:function(){return this.uc}},naturalBounds:{get:function(){return this.dc}},margin:{get:function(){return this.Kg},set:function(a){typeof a=="number"&&(a=new ir(a));var y=this.Kg;y.D(a)||(this.Kg=a=a.J(),this.v(),this.g("margin",y,a))}},transform:{get:function(){return this.l&2048&&Ga(this),this.Ab}},oe:{get:function(){return this.l&4096&&Ga(this),this.wh}},animationTriggers:{get:function(){return this.A!==null?this.A.hb:null},set:function(a){this.animationTriggers!==a&&(mr(this),this.A.hb=a)}},reshapingBehavior:{get:function(){return this.A!==null?this.A.Pf:un},set:function(a){this.reshapingBehavior!==a&&(mr(this),this.A.Pf=a)}},alignment:{get:function(){return this.Jb},set:function(a){var y=this.Jb;y.D(a)||(a.Mc()&&!a.Xb()&&$t("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.Jb=a=a.J(),Ps(this),this.g("alignment",y,a))}},column:{get:function(){return this.Ag},set:function(a){a=Math.round(a);var y=this.Ag;y!==a&&(0>a&&wn(a,">= 0",de,"column"),this.Ag=a,this.v(),this.g("column",y,a),this.svg!==null&&this.svg.remove())}},columnSpan:{get:function(){return this.A!==null?this.A.ob:1},set:function(a){a=Math.round(a);var y=this.columnSpan;y!==a&&(1>a&&wn(a,">= 1",de,"columnSpan"),mr(this),this.A.ob=a,this.v(),this.g("columnSpan",y,a))}},row:{get:function(){return this.io},set:function(a){a=Math.round(a);var y=this.io;y!==a&&(0>a&&wn(a,">= 0",de,"row"),this.io=a,this.v(),this.g("row",y,a),this.svg!==null&&this.svg.remove())}},rowSpan:{get:function(){return this.A!==null?this.A.Bi:1},set:function(a){a=Math.round(a);var y=this.rowSpan;y!==a&&(1>a&&wn(a,">= 1",de,"rowSpan"),mr(this),this.A.Bi=a,this.v(),this.g("rowSpan",y,a))}},spanAllocation:{get:function(){return this.A!==null?this.A.Di:null},set:function(a){var y=this.spanAllocation;y!==a&&(mr(this),this.A.Di=a,this.v(),this.g("spanAllocation",y,a))}},alignmentFocus:{get:function(){return this.sk},set:function(a){var y=this.sk;y.D(a)||(this.sk=a=a.J(),this.v(),this.g("alignmentFocus",y,a))}},portId:{get:function(){return this.Yn},set:function(a){var y=this.Yn;if(y!==a){var x=this.part;x===null||x instanceof qn||$t("Cannot set portID on a Link: "+a),y!==null&&x!==null&&Gv(x,this),this.Yn=a,a!==null&&x!==null&&(x.Te=!0,K1(x,this)),this.g("portId",y,a)}}},toSpot:{get:function(){return this.ba!==null?this.ba.yj:gr},set:function(a){var y=this.toSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.yj=a,this.g("toSpot",y,a),$d(this))}},toEndSegmentLength:{get:function(){return this.ba!==null?this.ba.wj:10},set:function(a){var y=this.toEndSegmentLength;y!==a&&(0>a&&wn(a,">= 0",de,"toEndSegmentLength"),this.Xc(),this.ba.wj=a,this.g("toEndSegmentLength",y,a),$d(this))}},toShortLength:{get:function(){return this.ba!==null?this.ba.xj:0},set:function(a){var y=this.toShortLength;y!==a&&(this.Xc(),this.ba.xj=a,this.g("toShortLength",y,a),$d(this))}},toLinkable:{get:function(){return this.ba!==null?this.ba.Tr:null},set:function(a){var y=this.toLinkable;y!==a&&(this.Xc(),this.ba.Tr=a,this.g("toLinkable",y,a))}},toMaxLinks:{get:function(){return this.ba!==null?this.ba.Ur:1/0},set:function(a){var y=this.toMaxLinks;y!==a&&(0>a&&wn(a,">= 0",de,"toMaxLinks"),this.Xc(),this.ba.Ur=a,this.g("toMaxLinks",y,a))}},fromSpot:{get:function(){return this.ba!==null?this.ba.Xi:gr},set:function(a){var y=this.fromSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.Xi=a,this.g("fromSpot",y,a),$d(this))}},fromEndSegmentLength:{get:function(){return this.ba!==null?this.ba.Vi:10},set:function(a){var y=this.fromEndSegmentLength;y!==a&&(0>a&&wn(a,">= 0",de,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=a,this.g("fromEndSegmentLength",y,a),$d(this))}},fromShortLength:{get:function(){return this.ba!==null?this.ba.Wi:0},set:function(a){var y=this.fromShortLength;y!==a&&(this.Xc(),this.ba.Wi=a,this.g("fromShortLength",y,a),$d(this))}},fromLinkable:{get:function(){return this.ba!==null?this.ba.hq:null},set:function(a){var y=this.fromLinkable;y!==a&&(this.Xc(),this.ba.hq=a,this.g("fromLinkable",y,a))}},fromMaxLinks:{get:function(){return this.ba!==null?this.ba.iq:1/0},set:function(a){var y=this.fromMaxLinks;y!==a&&(0>a&&wn(a,">= 0",de,"fromMaxLinks"),this.Xc(),this.ba.iq=a,this.g("fromMaxLinks",y,a))}},cursor:{get:function(){return this.A!==null?this.A.j:""},set:function(a){var y=this.cursor;y!==a&&(mr(this),this.A.j=a,this.g("cursor",y,a))}},click:{get:function(){return this.A!==null?this.A.zh:null},set:function(a){var y=this.click;y!==a&&(mr(this),this.A.zh=a,this.g("click",y,a))}},doubleClick:{get:function(){return this.A!==null?this.A.Fh:null},set:function(a){var y=this.doubleClick;y!==a&&(mr(this),this.A.Fh=a,this.g("doubleClick",y,a))}},contextClick:{get:function(){return this.A!==null?this.A.Bh:null},set:function(a){var y=this.contextClick;y!==a&&(mr(this),this.A.Bh=a,this.g("contextClick",y,a))}},mouseEnter:{get:function(){return this.A!==null?this.A.Mh:null},set:function(a){var y=this.mouseEnter;y!==a&&(mr(this),this.A.Mh=a,this.g("mouseEnter",y,a))}},mouseLeave:{get:function(){return this.A!==null?this.A.Ph:null},set:function(a){var y=this.mouseLeave;y!==a&&(mr(this),this.A.Ph=a,this.g("mouseLeave",y,a))}},mouseOver:{get:function(){return this.A!==null?this.A.Qh:null},set:function(a){var y=this.mouseOver;y!==a&&(mr(this),this.A.Qh=a,this.g("mouseOver",y,a))}},mouseHover:{get:function(){return this.A!==null?this.A.Oh:null},set:function(a){var y=this.mouseHover;y!==a&&(mr(this),this.A.Oh=a,this.g("mouseHover",y,a))}},mouseHold:{get:function(){return this.A!==null?this.A.Nh:null},set:function(a){var y=this.mouseHold;y!==a&&(mr(this),this.A.Nh=a,this.g("mouseHold",y,a))}},mouseDragEnter:{get:function(){return this.A!==null?this.A.Of:null},set:function(a){var y=this.mouseDragEnter;y!==a&&(mr(this),this.A.Of=a,this.g("mouseDragEnter",y,a))}},mouseDragLeave:{get:function(){return this.A!==null?this.A.Xd:null},set:function(a){var y=this.mouseDragLeave;y!==a&&(mr(this),this.A.Xd=a,this.g("mouseDragLeave",y,a))}},mouseDrop:{get:function(){return this.A!==null?this.A.Lh:null},set:function(a){var y=this.mouseDrop;y!==a&&(mr(this),this.A.Lh=a,this.g("mouseDrop",y,a))}},actionDown:{get:function(){return this.A!==null?this.A.V:null},set:function(a){var y=this.actionDown;y!==a&&(mr(this),this.A.V=a,this.g("actionDown",y,a))}},actionMove:{get:function(){return this.A!==null?this.A.ia:null},set:function(a){var y=this.actionMove;y!==a&&(mr(this),this.A.ia=a,this.g("actionMove",y,a))}},actionUp:{get:function(){return this.A!==null?this.A.Ha:null},set:function(a){var y=this.actionUp;y!==a&&(mr(this),this.A.Ha=a,this.g("actionUp",y,a))}},actionCancel:{get:function(){return this.A!==null?this.A.F:null},set:function(a){var y=this.actionCancel;y!==a&&(mr(this),this.A.F=a,this.g("actionCancel",y,a))}},toolTip:{get:function(){return this.A!==null?this.A.$h:null},set:function(a){var y=this.toolTip;y!==a&&(mr(this),this.A.$h=a,this.g("toolTip",y,a))}},contextMenu:{get:function(){return this.A!==null?this.A.Ch:null},set:function(a){var y=this.contextMenu;y!==a&&(mr(this),this.A.Ch=a,this.g("contextMenu",y,a))}}}),de.prototype.trigger=de.prototype.Jv,de.prototype.findBindingPanel=de.prototype.ih,de.prototype.findTemplateBinder=de.prototype.pz,de.prototype.setProperties=de.prototype.nm,de.prototype.apply=de.prototype.apply,de.prototype.attach=de.prototype.Du,de.prototype.set=de.prototype.set,de.prototype.isEnabledObject=de.prototype.If,de.prototype.isVisibleObject=de.prototype.Ed,de.prototype.isContainedBy=de.prototype.rg,de.prototype.getNearestIntersectionPoint=de.prototype.rs,de.prototype.getLocalPoint=de.prototype.qs,de.prototype.getDocumentScale=de.prototype.Df,de.prototype.getDocumentAngle=de.prototype.li,de.prototype.getDocumentBounds=de.prototype.mi,de.prototype.getDocumentPoint=de.prototype.ga,de.prototype.intersectsRect=de.prototype.Yc,de.prototype.containedInRect=de.prototype.fh,de.prototype.containsRect=de.prototype.Re,de.prototype.containsPoint=de.prototype.ca,de.prototype.raiseChanged=de.prototype.g,de.prototype.raiseChangedEvent=de.prototype.cb,de.prototype.addCopyProperty=de.prototype.Vw;var kf=null;de.className="GraphObject",kf=new Ie,Th("Button",function(){function a(x,E){return x.diagram.ic(x.documentPoint,function(b){for(;b.panel!==null&&!b.isActionable;)b=b.panel;return b},function(b){return b===E})!==null}var y=yl(En,En.Auto,{isActionable:!0,enabledChanged:function(x,E){if(x instanceof En){var b=x.fb("ButtonBorder");b!==null&&(b.fill=E?x._buttonFillNormal:x._buttonFillDisabled)}},cursor:"pointer",_buttonFillNormal:"#F5F5F5",_buttonStrokeNormal:"#BDBDBD",_buttonFillOver:"#E0E0E0",_buttonStrokeOver:"#9E9E9E",_buttonFillPressed:"#BDBDBD",_buttonStrokePressed:"#9E9E9E",_buttonFillDisabled:"#E5E5E5"},yl(cr,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new In(0,0,2.76142374915397,2.761423749153969),spot2:new In(1,1,-2.76142374915397,-2.761423749153969),parameter1:2,parameter2:2,fill:"#F5F5F5",stroke:"#BDBDBD"}));return y.mouseEnter=function(x,E){if(E.If()&&E instanceof En&&(x=E.fb("ButtonBorder"),x instanceof cr)){var b=E._buttonFillOver;E._buttonFillNormal=x.fill,x.fill=b,b=E._buttonStrokeOver,E._buttonStrokeNormal=x.stroke,x.stroke=b}},y.mouseLeave=function(x,E){E.If()&&E instanceof En&&(x=E.fb("ButtonBorder"),x instanceof cr&&(x.fill=E._buttonFillNormal,x.stroke=E._buttonStrokeNormal))},y.actionDown=function(x,E){if(E.If()&&E instanceof En&&E._buttonFillPressed!==null&&x.button===0){var b=E.fb("ButtonBorder");if(b instanceof cr){x=x.diagram;var z=x.skipsUndoManager;x.skipsUndoManager=!0;var tt=E._buttonFillPressed;E._buttonFillOver=b.fill,b.fill=tt,tt=E._buttonStrokePressed,E._buttonStrokeOver=b.stroke,b.stroke=tt,x.skipsUndoManager=z}}},y.actionUp=function(x,E){if(E.If()&&E instanceof En&&E._buttonFillPressed!==null&&x.button===0){var b=E.fb("ButtonBorder");if(b instanceof cr){var z=x.diagram,tt=z.skipsUndoManager;z.skipsUndoManager=!0,a(x,E)?(b.fill=E._buttonFillOver,b.stroke=E._buttonStrokeOver):(b.fill=E._buttonFillNormal,b.stroke=E._buttonStrokeNormal),z.skipsUndoManager=tt}}},y.actionCancel=function(x,E){if(E.If()&&E instanceof En&&E._buttonFillPressed!==null){var b=E.fb("ButtonBorder");if(b instanceof cr){var z=x.diagram,tt=z.skipsUndoManager;z.skipsUndoManager=!0,a(x,E)?(b.fill=E._buttonFillOver,b.stroke=E._buttonStrokeOver):(b.fill=E._buttonFillNormal,b.stroke=E._buttonStrokeNormal),z.skipsUndoManager=tt}}},y.actionMove=function(x,E){if(E.If()&&E instanceof En&&E._buttonFillPressed!==null){var b=x.diagram;if(b.firstInput.button===0&&(b.currentTool.standardMouseOver(),a(x,E)&&(x=E.fb("ButtonBorder"),x instanceof cr))){var z=b.skipsUndoManager;b.skipsUndoManager=!0;var tt=E._buttonFillPressed;x.fill!==tt&&(x.fill=tt),tt=E._buttonStrokePressed,x.stroke!==tt&&(x.stroke=tt),b.skipsUndoManager=z}}},y}),Th("TreeExpanderButton",function(){var a=yl("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},yl(cr,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Lr},new ua("figure","isTreeExpanded",function(y,x){return x=x.panel,y?x._treeExpandedFigure:x._treeCollapsedFigure}).cp()),{visible:!1},new ua("visible","isTreeLeaf",function(y){return!y}).cp());return a.click=function(y,x){if(x=x.part,x instanceof Yr&&(x=x.adornedPart),x instanceof qn){var E=x.diagram;if(E!==null){if(E=E.commandHandler,x.isTreeExpanded){if(!E.canCollapseTree(x))return}else if(!E.canExpandTree(x))return;y.handled=!0,x.isTreeExpanded?E.collapseTree(x):E.expandTree(x)}}},a}),Th("SubGraphExpanderButton",function(){var a=yl("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},yl(cr,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Lr},new ua("figure","isSubGraphExpanded",function(y,x){return x=x.panel,y?x._subGraphExpandedFigure:x._subGraphCollapsedFigure}).cp()));return a.click=function(y,x){if(x=x.part,x instanceof Yr&&(x=x.adornedPart),x instanceof or){var E=x.diagram;if(E!==null){if(E=E.commandHandler,x.isSubGraphExpanded){if(!E.canCollapseSubGraph(x))return}else if(!E.canExpandSubGraph(x))return;y.handled=!0,x.isSubGraphExpanded?E.collapseSubGraph(x):E.expandSubGraph(x)}}},a}),Th("ToolTip",function(){return yl(Yr,En.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new At(0,3),shadowBlur:5},yl(cr,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new In(0,0,4,6),spot2:new In(1,1,-4,-4)}))}),Th("ContextMenu",function(){return yl(Yr,En.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new At(0,3),shadowBlur:5},new ua("background","",function(a){return a.adornedPart!==null&&a.placeholder!==null?null:"#F5F5F5"}))}),Th("ContextMenuButton",function(){var a=yl("Button");a.stretch=Li;var y=a.fb("ButtonBorder");return y instanceof cr&&(y.figure="Rectangle",y.strokeWidth=0,y.spot1=new In(0,0,2,3),y.spot2=new In(1,1,-2,-2)),a}),Th("PanelExpanderButton",function(a){var y=hm(a,"COLLAPSIBLE"),x=yl("Button",{_buttonExpandedFigure:"M0 0 M0 6 L4 2 8 6 M8 8",_buttonCollapsedFigure:"M0 0 M0 2 L4 6 8 2 M8 8",_buttonFillNormal:"rgba(0, 0, 0, 0)",_buttonStrokeNormal:null,_buttonFillOver:"rgba(0, 0, 0, .2)",_buttonStrokeOver:null,_buttonFillPressed:"rgba(0, 0, 0, .4)",_buttonStrokePressed:null},yl(cr,{name:"ButtonIcon",strokeWidth:2},new ua("geometryString","visible",function(E){return E?x._buttonExpandedFigure:x._buttonCollapsedFigure}).cp(y)));return a=x.fb("ButtonBorder"),a instanceof cr&&(a.stroke=null,a.fill="rgba(0, 0, 0, 0)"),x.click=function(E,b){var z=b.diagram;if(z!==null&&!z.isReadOnly){var tt=b.ih();tt===null&&(tt=b.part),tt!==null&&(b=tt.fb(y),b!==null&&(E.handled=!0,z.Ea("Collapse/Expand Panel"),b.visible=!b.visible,z.eb("Collapse/Expand Panel")))}},x}),Th("CheckBoxButton",function(a){var y=hm(a);return a=yl("Button",{desiredSize:new ln(14,14)},yl(cr,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:xn,geometryStretch:wi,visible:!1},y!==""?new ua("visible",y).Kx():[])),a.click=function(x,E){if(E instanceof En){var b=x.diagram;if(!(b===null||b.isReadOnly||y!==""&&b.model.isReadOnly)){x.handled=!0;var z=E.fb("ButtonIcon");b.Ea("checkbox"),z.visible=!z.visible,typeof E._doClick=="function"&&E._doClick(x,E),b.eb("checkbox")}}},a}),Th("CheckBox",function(a){a=hm(a),a=yl("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new ir(0,1,0,0)});var y=yl(En,"Horizontal",a,{isActionable:!0,cursor:a.cursor,margin:new ir(1),_buttonFillNormal:a._buttonFillNormal,_buttonStrokeNormal:a._buttonStrokeNormal,_buttonFillOver:a._buttonFillOver,_buttonStrokeOver:a._buttonStrokeOver,_buttonFillPressed:a._buttonFillPressed,_buttonStrokePressed:a._buttonStrokePressed,_buttonFillDisabled:a._buttonFillDisabled,mouseEnter:a.mouseEnter,mouseLeave:a.mouseLeave,actionDown:a.actionDown,actionUp:a.actionUp,actionCancel:a.actionCancel,actionMove:a.actionMove,click:a.click,_buttonClick:a.click});return a.mouseEnter=null,a.mouseLeave=null,a.actionDown=null,a.actionUp=null,a.actionCancel=null,a.actionMove=null,a.click=null,y}),de.None=un=new He(de,"None",0),de.Default=lr=new He(de,"Default",0),de.Vertical=ji=new He(de,"Vertical",4),de.Horizontal=Li=new He(de,"Horizontal",5),de.Fill=xn=new He(de,"Fill",3),de.Uniform=wi=new He(de,"Uniform",1),de.UniformToFill=_r=new He(de,"UniformToFill",2),de.FlipVertical=yr=new He(de,"FlipVertical",1),de.FlipHorizontal=Hr=new He(de,"FlipHorizontal",2),de.FlipBoth=wo=new He(de,"FlipBoth",3),de.make=yl,de.getBuilders=function(){var a=new Ie,y;for(y in kf)if(y!==y.toLowerCase()){var x=kf.I(y);typeof x=="function"&&a.add(y,x)}return a.freeze(),a},de.defineBuilder=Th,de.build=function(a,y,x){for(var E=[],b=2;b<arguments.length;++b)E[b-2]=arguments[b];if(b=kf.I(a),typeof b=="function"&&(E=b([a].concat(E)),E instanceof de))return y&&E.set(y),E;$t('GraphObject.build invoked object builder "'+a+'", but it did not return an Object')},de.takeBuilderArgument=hm;function Rc(){this.nc=!1,this.xa="",this.zp=-1,this.nb=this.wm=this.te=null,this.j="",this.hb=this.Di=this.Hb=this.Ch=this.$h=this.F=this.Ha=this.ia=this.V=this.Lh=this.Xd=this.Of=this.Nh=this.Oh=this.Qh=this.Ph=this.Mh=this.Bh=this.Fh=this.zh=null,this.u=Pi,this.o=Zr,this.hg=lr,this.ob=this.Bi=1,this.Pf=un,this.Pc=this.Ci=this.gd=null,this.Oc="category"}Rc.prototype.copy=function(){var a=new Rc;return a.xa=this.xa,a.zp=this.zp,a.te=this.te,a.nb=this.nb,a.j=this.j,a.zh=this.zh,a.Fh=this.Fh,a.Bh=this.Bh,a.Mh=this.Mh,a.Ph=this.Ph,a.Qh=this.Qh,a.Oh=this.Oh,a.Nh=this.Nh,a.Of=this.Of,a.Xd=this.Xd,a.Lh=this.Lh,a.V=this.V,a.ia=this.ia,a.Ha=this.Ha,a.F=this.F,a.$h=this.$h,a.Ch=this.Ch,a.Hb=this.Hb,a.Di=this.Di,a.hb=this.hb,a.u=this.u.J(),a.o=this.o.J(),a.hg=this.hg,a.Bi=this.Bi,a.ob=this.ob,a.Pf=this.Pf,a.gd=this.gd,a.Ci=this.Ci,a.Pc=this.Pc,a.Oc=this.Oc,a};function gd(){this.u=-1/0,this.o=0,this.F=Un,this.rr=Ls,this.j=this.V="None"}gd.prototype.copy=function(){var a=new gd;return a.u=this.u,a.o=this.o,a.F=this.F.J(),a.rr=this.rr,a.V=this.V,a.j=this.j,a},gd.className="LinkElementSettings";function Kg(){this.yj=this.Xi=xa,this.xj=this.Wi=this.wj=this.Vi=NaN,this.Tr=this.hq=null,this.Ur=this.iq=1/0}Kg.prototype.copy=function(){var a=new Kg;return a.Xi=this.Xi.J(),a.yj=this.yj.J(),a.Vi=this.Vi,a.wj=this.wj,a.Wi=this.Wi,a.xj=this.xj,a.hq=this.hq,a.Tr=this.Tr,a.iq=this.iq,a.Ur=this.Ur,a},Kg.className="LinkSettings";function qd(){this.ha=[1,0,0,1,0,0]}qd.prototype.copy=function(){var a=new qd;return a.ha[0]=this.ha[0],a.ha[1]=this.ha[1],a.ha[2]=this.ha[2],a.ha[3]=this.ha[3],a.ha[4]=this.ha[4],a.ha[5]=this.ha[5],a},qd.prototype.translate=function(a,y){this.ha[4]+=this.ha[0]*a+this.ha[2]*y,this.ha[5]+=this.ha[1]*a+this.ha[3]*y},qd.prototype.scale=function(a,y){this.ha[0]*=a,this.ha[1]*=a,this.ha[2]*=y,this.ha[3]*=y},qd.prototype.rotate=function(a,y,x){if(360<=a?a-=360:0>a&&(a+=360),a!==0){if(this.translate(y,x),a===90){a=0;var E=1}else a===180?(a=-1,E=0):a===270?(a=0,E=-1):(E=a*Math.PI/180,a=Math.cos(E),E=Math.sin(E));var b=this.ha[1]*a+this.ha[3]*E,z=this.ha[0]*-E+this.ha[2]*a,tt=this.ha[1]*-E+this.ha[3]*a;this.ha[0]=this.ha[0]*a+this.ha[2]*E,this.ha[1]=b,this.ha[2]=z,this.ha[3]=tt,this.translate(-y,-x)}},qd.className="STransform";function jc(a){this.type=a,this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0,this.gx=[],this.pattern=null}jc.prototype.addColorStop=function(a,y){this.gx.push({offset:a,color:y})},jc.className="SGradient";function ku(a,y,x){this.ownerDocument=a=y===void 0?$e.document:y,this.cA="http://www.w3.org/2000/svg",a!==void 0&&(this.Oa=this.Ud("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.style.display="block",this.style.letterSpacing="normal",this.style.wordSpacing="normal",this.Oa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.Oa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink")),this.hs=null,this.context=new Qs(this,x)}ku.prototype.resize=function(a,y,x,E){return this.width!==a||this.height!==y?(this.width=a,this.height=y,this.style.width=x+"px",this.style.height=E+"px",this.Oa.setAttributeNS(null,"width",x+"px"),this.Oa.setAttributeNS(null,"height",E+"px"),this.Oa.setAttributeNS(null,"viewBox","0 0 "+x+" "+E),this.context.ww.firstElementChild.setAttributeNS(null,"width",x+"px"),this.context.ww.firstElementChild.setAttributeNS(null,"height",E+"px"),!0):!1},ku.prototype.Ud=function(a,y,x){if(a=this.ownerDocument.createElementNS(this.cA,a),We(y))for(var E in y)a.setAttributeNS(E==="href"?"http://www.w3.org/1999/xlink":"",E,y[E]);return x!==void 0&&(a.textContent=x),a},ku.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},ku.prototype.focus=function(){this.Oa.focus()},ku.prototype.mx=function(){this.ownerDocument=null},ve.Object.defineProperties(ku.prototype,{width:{get:function(){return this.Oa.width.baseVal.value},set:function(a){this.Oa.setAttribute("width",a+"px")}},height:{get:function(){return this.Oa.height.baseVal.value},set:function(a){this.Oa.setAttribute("height",a+"px")}},style:{get:function(){return this.Oa.style}}}),ku.className="SVGSurface";function Qs(a,y){this.Gv=a,this.svg=a.Oa,this.stack=[],this.nh=[],this.fillStyle="#000000",this.font="10px sans-serif",this.globalAlpha=1,this.lineCap="butt",this.lineDashOffset=0,this.lineJoin="miter",this.lineWidth=1,this.miterLimit=10,this.shadowBlur=0,this.shadowColor="rgba(0, 0, 0, 0)",this.shadowOffsetY=this.shadowOffsetX=0,this.Il=!1,this.strokeStyle="#000000",this.textAlign="start",this.clipInsteadOfFill=!1,this.Vg=this.Br=this.Ar=0,this.yd=this.ad=null,this.path=[],this.Yl={},this.Ct=!1,this.Yg=null,this.uj=0,this.rb=new qd,this.j=dm(this),this.Nj=dm(this,"gojs-diagram"),this.Hl=this.ti=null;var x=bo++,E=this.Ud("clipPath",{id:"mainClip"+x});E.appendChild(this.Ud("rect",{x:0,y:0,width:a.width,height:a.height})),this.ww=E,this.svg.appendChild(this.j),this.j.appendChild(this.Nj),this.svg.appendChild(E),this.j.setAttributeNS(null,"clip-path","url(#mainClip"+x+")"),this.eA={},this.isTemporary=!!y,this.filter="",this.bk=null}function Yy(a,y,x,E,b,z,tt){a.Nj===void 0?Ug(a,y,x,E,b,z,tt):a.Nj.setAttribute("transform","matrix("+y+", "+x+", "+E+", "+b+", "+z+", "+tt+")")}wt=Qs.prototype,wt.arc=function(a,y,x,E,b,z,tt,rt){var ot=2*Math.PI,lt=ot-1e-6,ut=x*Math.cos(E),ft=x*Math.sin(E),yt=a+ut,xt=y+ft,Ct=z?0:1;E=z?E-b:b-E,(1e-6<Math.abs(tt-yt)||1e-6<Math.abs(rt-xt))&&this.path.push(["L",yt,+xt]),0>E&&(E=E%ot+ot),E>lt?(this.path.push(["A",x,x,0,1,Ct,a-ut,y-ft]),this.path.push(["A",x,x,0,1,Ct,yt,xt])):1e-6<E&&this.path.push(["A",x,x,0,+(E>=Math.PI),Ct,a+x*Math.cos(b),y+x*Math.sin(b)])},wt.beginPath=function(){this.path=[],this.Yl={stroke:"none",fill:"none"}},wt.Se=function(a){this.addPath(this.path,this.rb,a||0)},wt.bezierCurveTo=function(a,y,x,E,b,z){this.path.push(["C",a,y,x,E,b,z])},wt.clearRect=function(){},wt.clip=function(){this.Yl.clipPath=!0},wt.closePath=function(){this.path.push(["z"])},wt.createLinearGradient=function(a,y,x,E){var b=new jc("linear");return b.x1=a,b.y1=y,b.x2=x,b.y2=E,b},wt.createPattern=function(a){var y="";a instanceof HTMLCanvasElement&&(y=a.toDataURL()),a instanceof HTMLImageElement&&(y=a.getAttribute("src"));var x=this.eA;if(x[y])return"url(#"+x[y]+")";var E="PATTERN"+bo++,b={x:0,y:0,width:a.width,height:a.height,href:y};return a=this.Ud("pattern",{width:a.width,height:a.height,id:E,patternUnits:"userSpaceOnUse"}),a.appendChild(this.Ud(Jd,b)),this.svg.appendChild(a),x[y]=E,"url(#"+E+")"},wt.createRadialGradient=function(a,y,x,E,b,z){var tt=new jc("radial");return tt.x1=a,tt.y1=y,tt.r1=x,tt.x2=E,tt.y2=b,tt.r2=z,tt};function Xy(a,y,x,E,b,z,tt,rt,ot){E=rt/E,b=ot/b,z===0&&tt===0||a.rb.translate(z,tt),E===1&&b===1||a.rb.scale(E,b),y===0&&x===0||a.rb.translate(-y,-x)}wt.drawImage=function(a,y,x,E,b,z,tt,rt,ot){var lt="";a instanceof HTMLCanvasElement&&(lt=a.toDataURL()),a instanceof HTMLImageElement&&(lt=a.getAttribute("src"));var ut=a instanceof HTMLImageElement?a.naturalWidth:a.width;a=a instanceof HTMLImageElement?a.naturalHeight:a.height,E===void 0&&(z=y,tt=x,rt=E=ut,ot=b=a),E=E||0,b=b||0,rt=rt||0,ot=ot||0,Xy(this,y,x,E,b,z||0,tt||0,rt,ot),z={x:0,y:0,width:ut||E,height:a||b,href:lt},Zt.$(E,rt)&&Zt.$(b,ot)?lt.toLowerCase().indexOf(".svg")===-1&&lt.toLowerCase().indexOf("data:image/svg")===-1&&(z.preserveAspectRatio="xMidYMid slice"):z.preserveAspectRatio="none",(y!==0||x!==0||E!==ut||b!==a)&&(E+=y,b+=x,z["clip-path"]="path('M "+y+","+x+" L "+E+" "+x+" L "+E+" "+b+" L "+y+" "+b+" z')"),bf(this,Jd,z,this.rb),this.addElement(Jd,z)},wt.fill=function(a){a&&(this.Yl["fill-rule"]="evenodd"),iv(this,this.Yl)},wt.ng=function(a,y){this.clipInsteadOfFill?this.clip():this.fill(y)},wt.fillRect=function(a,y,x,E){a=[a,y,x,E],a={x:a[0],y:a[1],width:a[2],height:a[3]},bf(this,"fill",a,this.rb),this.addElement("rect",a)},wt.ox=function(a,y,x,E){a={x:a,y,width:x,height:E},bf(this,"fill",a,this.rb),iv(this,a),this.svg.prepend(this.Ud("rect",a))},wt.fillText=function(a,y,x){a=[a,y,x],y=this.textAlign,y==="left"?y="start":y==="right"?y="end":y==="center"&&(y="middle"),y={x:a[1],y:a[2],style:"font: "+this.font,"text-anchor":y},bf(this,"fill",y,this.rb),this.addElement("text",y,a[0])},wt.lineTo=function(a,y){this.path.push(["L",a,y])},wt.moveTo=function(a,y){this.path.push(["M",a,y])},wt.quadraticCurveTo=function(a,y,x,E){this.path.push(["Q",a,y,x,E])},wt.rect=function(a,y,x,E){this.path.push(["M",a,y],["L",a+x,y],["L",a+x,y+E],["L",a,y+E],["z"])},wt.restore=function(){this.rb=this.stack.pop(),this.path=this.stack.pop();var a=this.stack.pop();this.fillStyle=a.fillStyle,this.font=a.font,this.globalAlpha=a.globalAlpha,this.lineCap=a.lineCap,this.lineDashOffset=a.lineDashOffset,this.lineJoin=a.lineJoin,this.lineWidth=a.lineWidth,this.miterLimit=a.miterLimit,this.shadowBlur=a.shadowBlur,this.shadowColor=a.shadowColor,this.shadowOffsetX=a.shadowOffsetX,this.shadowOffsetY=a.shadowOffsetY,this.strokeStyle=a.strokeStyle,this.textAlign=a.textAlign,this.bk=a.bk},wt.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,lineDashOffset:this.lineDashOffset,lineJoin:this.lineJoin,lineWidth:this.lineWidth,miterLimit:this.miterLimit,shadowBlur:this.shadowBlur,shadowColor:this.shadowColor,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,strokeStyle:this.strokeStyle,textAlign:this.textAlign,bk:this.bk});for(var a=[],y=0;y<this.path.length;y++)a.push(this.path[y]);this.stack.push(a),this.stack.push(this.rb.copy())},wt.setTransform=function(a,y,x,E,b,z){a===1&&y===0&&x===0&&E===1&&b===0&&z===0||Ug(this,a,y,x,E,b,z)};function Jy(a){return a=a.rb.ha,"matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")"}wt.scale=function(a,y){this.rb.scale(a,y)},wt.translate=function(a,y){this.rb.translate(a,y)},wt.transform=function(){},wt.yc=function(){},wt.stroke=function(){$y(this,this.Yl)},wt.jk=function(){this.clipInsteadOfFill||this.stroke()},wt.Ud=function(a,y,x){return this.Gv.Ud(a,y,x)},wt.addElement=function(a,y,x){return a=this.Ud(a,y,x),this.yd!==null?this.yd.appendChild(a):this.yd=a,this.ad=a};function bf(a,y,x,E){y==="fill"?iv(a,x):y==="stroke"&&$y(a,x),E!==null&&(a=E.ha,x.transform="matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")")}function iv(a,y){a.fillStyle instanceof jc?y.fill=rv(a,a.fillStyle,!0):/^rgba\(/.test(a.fillStyle)?(a=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle),y.fill="rgb("+a[1]+","+a[2]+","+a[3]+")",y["fill-opacity"]=a[4]):y.fill=a.fillStyle}function Qy(a,y,x){x=x?"fill":"stroke",a.fillStyle instanceof jc?y.setAttributeNS(null,"fill",rv(a,a.fillStyle,!0)):/^rgba\(/.test(a.fillStyle)?(a=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle),y.setAttributeNS(null,x,"rgb("+a[1]+","+a[2]+","+a[3]+")"),y.setAttributeNS(null,x+"-opacity",a[4])):y.setAttributeNS(null,x,a.fillStyle)}function $y(a,y){if(a.strokeStyle instanceof jc)y.stroke=rv(a,a.strokeStyle,!1);else if(/^rgba\(/.test(a.strokeStyle)){var x=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.strokeStyle);y.stroke="rgb("+x[1]+","+x[2]+","+x[3]+")",y["stroke-opacity"]=x[4]}else y.stroke=a.strokeStyle;y["stroke-width"]=a.lineWidth,y["stroke-linecap"]=a.lineCap,y["stroke-linejoin"]=a.lineJoin,y["stroke-miterlimit"]=a.miterLimit,a.Ct&&(y["stroke-dasharray"]=a.Yg.toString(),y["stroke-dashoffset"]=a.uj)}function rv(a,y,x){var E="";if(E=a.Hl!==null?a.Hl.getAttribute(x?"fill":"stroke"):null,E!==null&&E.indexOf("GRAD")!==-1?(E=E.split("#")[1].slice(0,-1),x=a.svg.getElementById(E),x!==null&&x.remove()):E="GRAD"+bo++,y.type==="linear")x=a.Ud("linearGradient",{x1:y.x1,x2:y.x2,y1:y.y1,y2:y.y2,id:E,gradientUnits:"userSpaceOnUse"});else if(y.type==="radial")x=a.Ud("radialGradient",{x1:y.x1,x2:y.x2,y1:y.y1,y2:y.y2,r1:y.r1,r2:y.r2,id:E});else throw Error("invalid gradient");var b=y.gx;y=b.length;for(var z=[],tt=0;tt<y;tt++){var rt=b[tt],ot=rt.color;rt={offset:rt.offset,"stop-color":ot},/^rgba\(/.test(ot)&&(ot=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(ot),rt["stop-color"]="rgb("+ot[1]+","+ot[2]+","+ot[3]+")",rt["stop-opacity"]=ot[4]),z.push(rt)}for(z.sort(function(lt,ut){return lt.offset>ut.offset?1:-1}),b=0;b<y;b++)x.appendChild(a.Ud("stop",z[b]));return a.svg.appendChild(x),"url(#"+E+")"}wt.addPath=function(a,y,x){for(var E=[],b=0;b<a.length;b++){var z=Vn(a[b]),tt=[z.shift()];if(tt[0]==="A")tt.push(z.shift()+","+z.shift(),z.shift(),z.shift()+","+z.shift(),z.shift()+","+z.shift());else for(;z.length;)tt.push(z.shift()+","+z.shift());E.push(tt.join(" "))}if(E=E.join(" "),a=this.Yl,a.clipPath)0<this.nh.length&&this.nh[this.nh.length-1].setAttributeNS(null,"clip-path",'path("'+E+'")');else if(a.d=E,bf(this,"",a,y),this.Hl!==null)if(y=this.Hl,y.nodeName!=="g")for(var rt in a)rt!=="transform"&&y.setAttributeNS(null,rt,a[rt]);else{rt=y.getElementsByTagName("path");for(var ot in a)ot!=="transform"&&rt[x].setAttributeNS(null,ot,a[ot])}else this.addElement("path",a)};function Ug(a,y,x,E,b,z,tt){var rt=new qd;rt.ha=[y,x,E,b,z,tt],y={},bf(a,"g",y,rt),rt=a.addElement("g",y),a.nh.push(rt)}function dm(a,y){var x={};return y&&(x.class=y),y=a.addElement("g",x),a.nh.push(y),y}wt.Ev=function(a,y,x){this.Ar=a,this.Br=y,this.Vg=x};function Hu(a){a.Il=!1,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0}function uh(a){a.Il=!0,a.shadowOffsetX=a.Ar,a.shadowOffsetY=a.Br,a.shadowBlur=a.Vg}wt.js=function(a,y){this.Ct=!0,this.Yg=a,this.uj=y},wt.fs=function(){this.Ct=!1},wt.Vc=function(){},wt.Wx=function(){},Qs.prototype.rotate=function(a){this.rb.rotate(57.2958*a,0,0)},Qs.prototype.getImageData=function(){return null},Qs.prototype.measureText=function(){return null};function cm(a,y){y=y.getAttribute("fill"),y!==null&&(y=y.split("#"),y.length!==1&&(y=a.svg.getElementById(y[1].slice(0,-1)),y!==null&&a.svg.innerHTML.match(new RegExp(y.id,"g")).length===1&&y.remove()))}Qs.prototype.Hs=function(a){a.svg!==null&&a.svg.parentNode===this.Nj&&a.svg.remove()},Qs.className="SVGContext",be.prototype.Cs=function(a){this.pj.contains("SVG")||this.bs("SVG",new ku(this,$e.document));var y=new ku(this,$e.document,!0);a===void 0&&(a=new Hi);var x=this;return Ac(this,function(E,b){return E=am(x,E,"SVG",y),E=E!==null?E.svg:null,typeof b=="function"?(b(E),null):E},a)},be.prototype.makeSvg=be.prototype.Cs,be.prototype.av=function(a){return this.Cs(a)},be.prototype.makeSVG=be.prototype.av;function Dl(a,y,x,E){this.ownerDocument=y=y===void 0?$e.document:y,this.hs=null,y=y.createElement("canvas"),y.tabIndex=0,this.Oa=y,this.context=new tc(y,x,E),y.H=a}Dl.prototype.resize=function(a,y,x,E){return this.width!==a||this.height!==y?(this.width=a,this.height=y,this.style.width=x+"px",this.style.height=E+"px",!0):!1},Dl.prototype.toDataURL=function(a,y){return this.Oa.toDataURL(a,y)},Dl.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},Dl.prototype.focus=function(){this.Oa.focus()},Dl.prototype.mx=function(){this.ownerDocument=this.Oa.H=null},ve.Object.defineProperties(Dl.prototype,{width:{get:function(){return this.Oa.width},set:function(a){this.Oa.width=a}},height:{get:function(){return this.Oa.height},set:function(a){this.Oa.height=a}},style:{get:function(){return this.Oa.style}}}),Dl.className="CanvasSurface";function tc(a,y,x){this.Z=a.getContext?a.getContext("2d",y):null,this.Z===null&&$t("Browser does not support HTML Canvas Element"),this.ct=this.et=this.dt="",this.Hm=!1,this.Vg=this.Br=this.Ar=0,this.Il=!1,this.El=new fe,this.isTemporary=!!x}wt=tc.prototype,wt.Wx=function(a){this.Z.imageSmoothingEnabled=a},wt.arc=function(a,y,x,E,b,z){this.Z.arc(a,y,x,E,b,z)},wt.beginPath=function(){this.Z.beginPath()},wt.Se=function(){},wt.bezierCurveTo=function(a,y,x,E,b,z){this.Z.bezierCurveTo(a,y,x,E,b,z)},wt.clearRect=function(a,y,x,E){this.yc(),this.Z.clearRect(a,y,x,E)},wt.clip=function(){this.Z.clip()},wt.closePath=function(){this.Z.closePath()},wt.createLinearGradient=function(a,y,x,E){return this.Z.createLinearGradient(a,y,x,E)},wt.createPattern=function(a,y){return this.Z.createPattern(a,y)},wt.createRadialGradient=function(a,y,x,E,b,z){return this.Z.createRadialGradient(a,y,x,E,b,z)},wt.drawImage=function(a,y,x,E,b,z,tt,rt,ot){E===void 0?this.Z.drawImage(a,y,x):this.Z.drawImage(a,y,x,E,b,z,tt,rt,ot)},wt.fill=function(a){this.Z.fill(a?"evenodd":"nonzero")},wt.fillRect=function(a,y,x,E){this.Z.fillRect(a,y,x,E)},wt.ox=function(a,y,x,E){this.Z.fillRect(a,y,x,E)},wt.fillText=function(a,y,x){this.Z.fillText(a,y,x)},wt.getImageData=function(a,y,x,E){return this.Z.getImageData(a,y,x,E)},wt.lineTo=function(a,y){this.Z.lineTo(a,y)},wt.measureText=function(a){return this.Z.measureText(a)},wt.moveTo=function(a,y){this.Z.moveTo(a,y)},wt.quadraticCurveTo=function(a,y,x,E){this.Z.quadraticCurveTo(a,y,x,E)},wt.rect=function(a,y,x,E){this.Z.rect(a,y,x,E)},wt.restore=function(){this.Z.restore()},wt.save=function(){this.yc(),this.Z.save()},tc.prototype.rotate=function(a){this.El.rotate(57.2958*a,0,0)},wt=tc.prototype,wt.setTransform=function(a,y,x,E,b,z){this.El.setTransform(a,y,x,E,b,z)},wt.scale=function(a,y){this.El.scale(a,y)},wt.translate=function(a,y){this.El.translate(a,y)},wt.stroke=function(){this.Z.stroke()},wt.transform=function(a,y,x,E,b,z){if(a!==1||y!==0||x!==0||E!==1||b!==0||z!==0){var tt=this.El,rt=tt.m11*a+tt.m21*y;a=tt.m12*a+tt.m22*y,y=tt.m11*x+tt.m21*E,x=tt.m12*x+tt.m22*E,tt.dx=tt.m11*b+tt.m21*z+tt.dx,tt.dy=tt.m12*b+tt.m22*z+tt.dy,tt.m11=rt,tt.m12=a,tt.m21=y,tt.m22=x}},wt.yc=function(){var a=this.El;this.Z.setTransform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy)},wt.ng=function(a,y){if(a instanceof mo&&a.type===Sl){var x=a.yk;a=a.ft,a>x?(this.scale(x/a,1),this.translate((a-x)/2,0)):x>a&&(this.scale(1,a/x),this.translate(0,(x-a)/2)),this.Hm?this.clip():this.fill(y),a>x?(this.translate(-(a-x)/2,0),this.scale(1/(x/a),1)):x>a&&(this.translate(0,-(x-a)/2),this.scale(1,1/(a/x)))}else this.Hm?this.clip():this.fill(y)},wt.jk=function(){this.Hm||this.stroke()},wt.Ev=function(a,y,x){this.Ar=a,this.Br=y,this.Vg=x},wt.js=function(a,y){var x=this.Z;x.setLineDash!==void 0&&(x.setLineDash(a),x.lineDashOffset=y)},wt.fs=function(){var a=this.Z;a.setLineDash!==void 0&&(a.setLineDash(mx),a.lineDashOffset=0)},wt.Vc=function(a){a&&(this.dt=""),this.ct=this.et=""},wt.Hs=function(){},ve.Object.defineProperties(tc.prototype,{fillStyle:{get:function(){return this.Z.fillStyle},set:function(a){this.ct!==a&&(this.ct=this.Z.fillStyle=a)}},font:{get:function(){return this.Z.font},set:function(a){this.dt!==a&&(this.dt=this.Z.font=a)}},globalAlpha:{get:function(){return this.Z.globalAlpha},set:function(a){this.Z.globalAlpha=a}},lineCap:{get:function(){return this.Z.lineCap},set:function(a){this.Z.lineCap=a}},lineDashOffset:{get:function(){return this.Z.lineDashOffset},set:function(a){this.Z.lineDashOffset=a}},lineJoin:{get:function(){return this.Z.lineJoin},set:function(a){this.Z.lineJoin=a}},lineWidth:{get:function(){return this.Z.lineWidth},set:function(a){this.Z.lineWidth=a}},miterLimit:{get:function(){return this.Z.miterLimit},set:function(a){this.Z.miterLimit=a}},shadowBlur:{get:function(){return this.Z.shadowBlur},set:function(a){this.Z.shadowBlur=a}},shadowColor:{get:function(){return this.Z.shadowColor},set:function(a){this.Z.shadowColor=a}},shadowOffsetX:{get:function(){return this.Z.shadowOffsetX},set:function(a){this.Z.shadowOffsetX=a}},shadowOffsetY:{get:function(){return this.Z.shadowOffsetY},set:function(a){this.Z.shadowOffsetY=a}},strokeStyle:{get:function(){return this.Z.strokeStyle},set:function(a){this.et!==a&&(this.et=this.Z.strokeStyle=a)}},textAlign:{get:function(){return this.Z.textAlign},set:function(a){this.Z.textAlign=a}},imageSmoothingEnabled:{get:function(){return this.Z.imageSmoothingEnabled},set:function(a){this.Z.imageSmoothingEnabled=a}},filter:{get:function(){return this.Z.filter},set:function(a){this.Z.filter=a===""?"none":a}},clipInsteadOfFill:{get:function(){return this.Hm},set:function(a){this.Hm=a}}});var mx=Object.freeze([]);tc.className="CanvasSurfaceContext";function Yg(){this.F=this.o=this.u=this.j=0}Yg.className="ColorNumbers";function mo(a,y){Tf||(hv(),Tf=!0),Di(this),this._isFrozen=!1,a===void 0?(this.na=Dh,this.xk="black"):typeof a=="string"?(this.na=Dh,this.xk=a):(this.na=a,this.xk="black"),a=this.na,a===dh?(this.Qd=Vo,this.Lk=Yo):this.Lk=a===Sl?this.Qd=Or:this.Qd=gr,this.Gr=0,this.Xp=NaN,this.xe=this.cr=this.we=null,this.ft=this.yk=0,y&&Object.assign(this,y)}mo.prototype.copy=function(){var a=new mo;return a.na=this.na,a.xk=this.xk,a.Qd=this.Qd.J(),a.Lk=this.Lk.J(),a.Gr=this.Gr,a.Xp=this.Xp,this.we!==null&&(a.we=this.we.copy()),a.cr=this.cr,a},wt=mo.prototype,wt.freeze=function(){return this._isFrozen=!0,this.we!==null&&this.we.freeze(),this},wt.ka=function(){return Object.isFrozen(this)&&$t("cannot thaw constant: "+this),this._isFrozen=!1,this.we!==null&&this.we.ka(),this},wt.qb=function(a){a.classType===mo&&(this.type=a)},wt.toString=function(){var a="Brush(";if(this.type===Dh)a+=this.color;else if(a=this.type===dh?a+"Linear ":this.type===Sl?a+"Radial ":this.type===Df?a+"Pattern ":a+"(unknown) ",a+=this.start+" "+this.end,this.colorStops!==null)for(var y=this.colorStops.iterator;y.next();)a+=" "+y.key+":"+y.value;return a+")"},wt.addColorStop=function(a,y){return this._isFrozen&&Ze(this),(typeof a!="number"||!isFinite(a)||1<a||0>a)&&wn(a,"0 <= loc <= 1",mo,"addColorStop:loc"),this.we===null&&(this.we=new Ie),this.we.add(a,y),this.na===Dh&&(this.type=dh),this.xe=null,this},wt.Vz=function(a,y){if(this._isFrozen&&Ze(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?Of:y,this.type===Dh)hh(this.color),this.color=Bf(a,y);else if((this.type===dh||this.type===Sl)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)hh(x.value),this.addColorStop(x.key,Bf(a,y));return this};function qy(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?Of:x,hh(a),Bf(y,x)}wt.Wy=function(a,y){if(this._isFrozen&&Ze(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?Of:y,this.type===Dh)hh(this.color),this.color=Bf(-a,y);else if((this.type===dh||this.type===Sl)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)hh(x.value),this.addColorStop(x.key,Bf(-a,y));return this};function t1(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?Of:x,hh(a),Bf(-y,x)}function ov(a,y,x){hh(a),a=Io.j;var E=Io.u,b=Io.o,z=Io.F;return hh(y),x===void 0&&(x=.5),"rgba("+Math.round((Io.j-a)*x+a)+", "+Math.round((Io.u-E)*x+E)+", "+Math.round((Io.o-b)*x+b)+", "+Math.round((Io.F-z)*x+z)+")"}wt.Gx=function(){if(this.type===Dh)return Nf(this.color);if((this.type===dh||this.type===Sl)&&this.colorStops!==null){var a=this.colorStops;if(this.type===Sl)return Nf(a.first().value);if(a.get(.5)!==null)return Nf(a.get(.5));if(a.count===2)return a=a.Fa(),Nf(ov(a[0].value,a[1].value));for(var y=a.iterator,x=-1,E=-1,b=1,z=1;y.next();){var tt=y.key,rt=Math.abs(.5-y.key);b>z&&rt<b?(x=tt,b=rt):z>=b&&rt<z&&(E=tt,z=rt)}return x>E&&(z=x,x=E,E=z,z=b),b=E-x,Nf(ov(a.get(x),a.get(E),1-z/b))}return!1};function Nf(a){return a?a instanceof mo?a.Gx():(hh(a),128>(299*Io.j+587*Io.u+114*Io.o)/1e3):!1}function Bf(a,y){switch(y){case Of:y=100*sv(Io.j);var x=100*sv(Io.u),E=100*sv(Io.o);return Cs.j=.4124564*y+.3575761*x+.1804375*E,Cs.u=.2126729*y+.7151522*x+.072175*E,Cs.o=.0193339*y+.119192*x+.9503041*E,Cs.F=Io.F,y=uv(Cs.j/Af[0]),x=uv(Cs.u/Af[1]),E=uv(Cs.o/Af[2]),Wu.j=116*x-16,Wu.u=500*(y-x),Wu.o=200*(x-E),Wu.F=Cs.F,Wu.j=Math.min(100,Math.max(0,Wu.j+100*a)),a=(Wu.j+16)/116,y=a-Wu.o/200,Cs.j=Af[0]*e1(Wu.u/500+a),Cs.u=Af[1]*(Wu.j>fm*dv?Math.pow(a,3):Wu.j/fm),Cs.o=Af[2]*e1(y),Cs.F=Wu.F,a=-.969266*Cs.j+1.8760108*Cs.u+.041556*Cs.o,y=.0556434*Cs.j+-.2040259*Cs.u+1.0572252*Cs.o,Io.j=255*lv((3.2404542*Cs.j+-1.5371385*Cs.u+-.4985314*Cs.o)/100),Io.u=255*lv(a/100),Io.o=255*lv(y/100),Io.F=Cs.F,Io.j=Math.round(Io.j),255<Io.j?Io.j=255:0>Io.j&&(Io.j=0),Io.u=Math.round(Io.u),255<Io.u?Io.u=255:0>Io.u&&(Io.u=0),Io.o=Math.round(Io.o),255<Io.o?Io.o=255:0>Io.o&&(Io.o=0),"rgba("+Io.j+", "+Io.u+", "+Io.o+", "+Io.F+")";case n1:return av(),ll.o=Math.min(100,Math.max(0,ll.o+100*a)),"hsla("+ll.j+", "+ll.u+"%, "+ll.o+"%, "+ll.F+")";default:$t("Unknown color space: "+y)}}function hh(a){Tf||(hv(),Tf=!0);var y=cv;if(y!==null){y.clearRect(0,0,1,1),y.fillStyle="#000000";var x=y.fillStyle;y.fillStyle=a,y.fillStyle!==x?(y.fillRect(0,0,1,1),a=y.getImageData(0,0,1,1).data,Io.j=a[0],Io.u=a[1],Io.o=a[2],Io.F=a[3]/255):(y.fillStyle="#FFFFFF",y.fillStyle=a,Io.j=0,Io.u=0,Io.o=0,Io.F=1)}}function av(){var a=Io.j/255,y=Io.u/255,x=Io.o/255,E=Math.max(a,y,x),b=Math.min(a,y,x),z=E-b;if(b=(E+b)/2,z===0)var tt=a=0;else{switch(E){case a:tt=(y-x)/z%6;break;case y:tt=(x-a)/z+2;break;case x:tt=(a-y)/z+4}tt*=60,0>tt&&(tt+=360),a=z/(1-Math.abs(2*b-1))}ll.j=Math.round(tt),ll.u=Math.round(100*a),ll.o=Math.round(100*b),ll.F=Io.F}function sv(a){return a/=255,.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function lv(a){return .0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055}function uv(a){return a>dv?Math.pow(a,1/3):(fm*a+16)/116}function e1(a){var y=a*a*a;return y>dv?y:(116*a-16)/fm}function zc(a,y){typeof a!="string"&&(a instanceof mo||$t("Value for "+y+" must be a color string or a Brush, not "+a))}function hv(){cv=qo?new Dl(null,void 0,{willReadFrequently:!0}).context:null}ve.Object.defineProperties(mo.prototype,{type:{get:function(){return this.na},set:function(a){this._isFrozen&&Ze(this,a),this.na=a,this.start.Mc()&&(a===dh?this.start=Vo:a===Sl&&(this.start=Or)),this.end.Mc()&&(a===dh?this.end=Yo:a===Sl&&(this.end=Or)),this.xe=null}},color:{get:function(){return this.xk},set:function(a){this._isFrozen&&Ze(this,a),this.xk=a,this.xe=null}},start:{get:function(){return this.Qd},set:function(a){this._isFrozen&&Ze(this,a),this.Qd=a.J(),this.xe=null}},end:{get:function(){return this.Lk},set:function(a){this._isFrozen&&Ze(this,a),this.Lk=a.J(),this.xe=null}},startRadius:{get:function(){return this.Gr},set:function(a){this._isFrozen&&Ze(this,a),0>a&&wn(a,">= zero",mo,"startRadius"),this.Gr=a,this.xe=null}},endRadius:{get:function(){return this.Xp},set:function(a){this._isFrozen&&Ze(this,a),0>a&&wn(a,">= zero",mo,"endRadius"),this.Xp=a,this.xe=null}},colorStops:{get:function(){return this.we},set:function(a){this._isFrozen&&Ze(this,a),this.we=a,this.xe=null}},pattern:{get:function(){return this.cr},set:function(a){this._isFrozen&&Ze(this,a),this.cr=a,this.xe=null}}}),mo.prototype.isDark=mo.prototype.Gx,mo.prototype.darkenBy=mo.prototype.Wy,mo.prototype.lightenBy=mo.prototype.Vz,mo.prototype.addColorStop=mo.prototype.addColorStop;var dv=216/24389,fm=24389/27,Af=[95.047,100,108.883],cv=null,Io=new Yg,ll=new Yg,Cs=new Yg,Wu=new Yg,Tf=!1;mo.className="Brush";var Dh;mo.Solid=Dh=new He(mo,"Solid",0);var dh;mo.Linear=dh=new He(mo,"Linear",1);var Sl;mo.Radial=Sl=new He(mo,"Radial",2);var Df;mo.Pattern=Df=new He(mo,"Pattern",4);var Of;mo.Lab=Of=new He(mo,"Lab",5);var n1;mo.HSL=n1=new He(mo,"HSL",6),mo.randomColor=function(a,y){a===void 0&&(a=128),y===void 0&&(y=Math.max(a,255));var x=Math.abs(y-a);y=Math.floor(a+Math.random()*x).toString(16);var E=Math.floor(a+Math.random()*x).toString(16);return a=Math.floor(a+Math.random()*x).toString(16),2>y.length&&(y="0"+y),2>E.length&&(E="0"+E),2>a.length&&(a="0"+a),"#"+y+E+a},mo.isValidColor=function(a){if(a==="black")return!0;if(a==="")return!1;Tf||(hv(),Tf=!0);var y=cv;if(y===null)return!0;y.fillStyle="#000000";var x=y.fillStyle;return y.fillStyle=a,y.fillStyle!==x?!0:(y.fillStyle="#FFFFFF",x=y.fillStyle,y.fillStyle=a,y.fillStyle!==x)},mo.lighten=function(a){return qy(a)},mo.lightenBy=qy,mo.darken=function(a){return t1(a)},mo.darkenBy=t1,mo.mix=ov,mo.isDark=Nf;function wa(){this.xa="Base"}wa.prototype.measure=function(){},wa.prototype.Yz=function(a,y,x,E,b){a.measure(y,x,E,b)},wa.prototype.arrange=function(){},wa.prototype.Ly=function(a,y,x,E,b,z){a.arrange(y,x,E,b,z)},wa.prototype.iA=function(a){a.Uj()},wa.prototype.gc=function(){},ve.Object.defineProperties(wa.prototype,{name:{get:function(){return this.xa},set:function(a){this.xa=a}},classType:{get:function(){return En}}}),wa.prototype.remeasureObject=wa.prototype.iA,wa.prototype.arrangeElement=wa.prototype.Ly,wa.prototype.measureElement=wa.prototype.Yz,wa.className="PanelLayout";function gm(){this.xa="Base"}Se(gm,wa),gm.prototype.measure=function(a,y,x,E,b,z,tt){var rt=E.length;a=ch(a);for(var ot=0;ot<rt;ot++){var lt=E[ot];if(lt.visible||lt===a){var ut=lt.margin,ft=ut.right+ut.left;ut=ut.top+ut.bottom,lt.measure(y,x,z,tt);var yt=lt.measuredBounds;ft=Math.max(yt.width+ft,0),ut=Math.max(yt.height+ut,0),yt=lt.position.x;var xt=lt.position.y;isFinite(yt)||(yt=0),isFinite(xt)||(xt=0),lt instanceof cr&&lt.isGeometryPositioned&&(lt=lt.strokeWidth/2,yt-=lt,xt-=lt),Jr(b,yt,xt,ft,ut)}}},gm.prototype.arrange=function(a,y,x){var E=y.length,b=a.padding;for(a=x.x-b.left,x=x.y-b.top,b=0;b<E;b++){var z=y[b],tt=z.measuredBounds,rt=z.margin,ot=z.position.x,lt=z.position.y;if(ot=isNaN(ot)?-a:ot-a,lt=isNaN(lt)?-x:lt-x,z instanceof cr&&z.isGeometryPositioned){var ut=z.strokeWidth/2;ot-=ut,lt-=ut}z.visible&&z.arrange(ot+rt.left,lt+rt.top,tt.width,tt.height)}};function pm(){this.xa="Base"}Se(pm,wa),pm.prototype.measure=function(a,y,x,E,b,z,tt){var rt=E.length;y=pi(),z=ch(a);for(var ot=0;ot<rt;ot++){var lt=E[ot];if(lt.visible||lt===z){var ut=Ds(lt,!1);if(ut!==un&&ut!==Li)y.push(lt);else{lt.measure(1/0,x,0,tt),ut=lt.margin,lt=lt.measuredBounds;var ft=Math.max(lt.height+ut.top+ut.bottom,0);b.width+=Math.max(lt.width+ut.right+ut.left,0),b.height=Math.max(b.height,ft)}}}for(E=y.length,a.desiredSize.height?x=Math.min(a.desiredSize.height,a.maxSize.height):b.height!==0&&(x=Math.min(b.height,a.maxSize.height)),a=0;a<E;a++)ot=y[a],(ot.visible||ot===z)&&(ut=ot.margin,rt=ut.right+ut.left,ut=ut.top+ut.bottom,ot.measure(1/0,x,0,tt),ot=ot.measuredBounds,ut=Math.max(ot.height+ut,0),b.width+=Math.max(ot.width+rt,0),b.height=Math.max(b.height,ut));oi(y)},pm.prototype.arrange=function(a,y,x){for(var E=y.length,b=a.padding,z=b.top,tt=a.isOpposite,rt=tt?x.width:b.left,ot=0;ot<E;ot++){var lt=z,ut=y[ot];if(ut.visible){var ft=ut.measuredBounds,yt=ut.margin,xt=yt.top+yt.bottom,Ct=z+b.bottom,bt=ft.height,Wt=Ds(ut,!1);(isNaN(ut.desiredSize.height)&&Wt===xn||Wt===ji)&&(bt=Math.max(x.height-xt-Ct,0)),xt=bt+xt+Ct,Ct=ut.alignment,Ct.Xb()&&(Ct=a.defaultAlignment),Ct.sb()||(Ct=Or),tt&&(rt-=ft.width+yt.left+yt.right),ut.arrange(rt+Ct.offsetX+yt.left,lt+Ct.offsetY+yt.top+(x.height*Ct.y-xt*Ct.y),ft.width,bt),tt||(rt+=ft.width+yt.left+yt.right)}}};function mm(){this.xa="Base"}Se(mm,wa),mm.prototype.measure=function(a,y,x,E,b,z){var tt=E.length;x=pi();for(var rt=ch(a),ot=0;ot<tt;ot++){var lt=E[ot];if(lt.visible||lt===rt){var ut=Ds(lt,!1);if(ut!==un&&ut!==ji)x.push(lt);else{var ft=lt.margin;ut=ft.right+ft.left,ft=ft.top+ft.bottom,lt.measure(y,1/0,z,0),lt=lt.measuredBounds,Wr(b,Math.max(b.width,Math.max(lt.width+ut,0)),b.height+Math.max(lt.height+ft,0))}}}if(E=x.length,E!==0){for(a.desiredSize.width?y=Math.min(a.desiredSize.width,a.maxSize.width):b.width!==0&&(y=Math.min(b.width,a.maxSize.width)),a=0;a<E;a++)ot=x[a],(ot.visible||ot===rt)&&(lt=ot.margin,tt=lt.right+lt.left,lt=lt.top+lt.bottom,ot.measure(y,1/0,z,0),ot=ot.measuredBounds,lt=Math.max(ot.height+lt,0),b.width=Math.max(b.width,Math.max(ot.width+tt,0)),b.height+=lt);oi(x)}},mm.prototype.arrange=function(a,y,x){for(var E=y.length,b=a.padding,z=b.left,tt=a.isOpposite,rt=tt?x.height:b.top,ot=0;ot<E;ot++){var lt=z,ut=y[ot];if(ut.visible){var ft=ut.measuredBounds,yt=ut.margin,xt=yt.left+yt.right,Ct=z+b.right,bt=ft.width,Wt=Ds(ut,!1);(isNaN(ut.desiredSize.width)&&Wt===xn||Wt===Li)&&(bt=Math.max(x.width-xt-Ct,0)),xt=bt+xt+Ct,Ct=ut.alignment,Ct.Xb()&&(Ct=a.defaultAlignment),Ct.sb()||(Ct=Or),tt&&(rt-=ft.height+yt.bottom+yt.top),ut.arrange(lt+Ct.offsetX+yt.left+(x.width*Ct.x-xt*Ct.x),rt+Ct.offsetY+yt.top,bt,ft.height),tt||(rt+=ft.height+yt.bottom+yt.top)}}};function vm(){this.xa="Base"}Se(vm,wa),vm.prototype.measure=function(a,y,x,E,b,z,tt){var rt=E.length,ot=a.Pb(),lt=ot.margin,ut=lt.right+lt.left,ft=lt.top+lt.bottom;ot.measure(y,x,z,tt);var yt=ot.measuredBounds;z=yt.width,tt=yt.height;var xt=Math.max(z+ut,0),Ct=Math.max(tt+ft,0),bt=a.isClipping,Wt=Be.allocAt(-lt.left,-lt.top,xt,Ct),jt=Be.allocAt(0,0,z,tt);fv(ot,jt,!0),z=jt.width,tt=jt.height;for(var Qt=!0,te=ch(a),re=0;re<rt;re++){var he=E[re];yt=y;var ke=x;if(he!==ot&&(he.visible||he===te)){lt=he.margin;var Jn=lt.left,fi=lt.top;switch(xt=lt.right+lt.left,Ct=lt.top+lt.bottom,lt=Ds(he,!1),lt){case xn:yt=z,ke=tt,fi=Jn=Ct=xt=0;break;case Li:yt=z,Jn=xt=0;break;case ji:ke=tt,fi=Ct=0}he.measure(yt,ke,0,0),yt=he.measuredBounds,xt=Math.max(yt.width+xt,0),Ct=Math.max(yt.height+Ct,0),lt=he.alignment,lt.Xb()&&(lt=a.defaultAlignment),lt.sb()||(lt=Or);var li=he.alignmentFocus;if(li.Xb()&&(li=Or),ke=null,he instanceof En&&he.$e!==""&&(ke=he.fb(he.$e),ke===he&&(ke=null)),Jn=jt.x-Jn,fi=jt.y-fi,ke!==null){for(he.arrange(0,0,yt.width,yt.height),yt=ke.actualBounds,yt=At.allocAt(yt.x+(li.x*yt.width-li.offsetX),yt.y+(li.y*yt.height-li.offsetY)),ke=ke.panel;ke!==he;)ke.transform.Ga(yt),ke=ke.panel;Jn+=lt.x*z+lt.offsetX-yt.x,fi+=lt.y*tt+lt.offsetY-yt.y,At.free(yt)}else Jn+=lt.x*z+lt.offsetX-(li.x*yt.width+li.offsetX),fi+=lt.y*tt+lt.offsetY-(li.y*yt.height+li.offsetY);Qt?(Qt=!1,b.h(Jn,fi,xt,Ct)):Jr(b,Jn,fi,xt,Ct)}}switch(Qt?b.assign(Wt):bt?b.Uu(jt.x,jt.y,jt.width,jt.height):Jr(b,Wt.x,Wt.y,Wt.width,Wt.height),Be.free(Wt),Be.free(jt),lt=ot.stretch,lt===lr&&(lt=Ds(ot,!1)),lt){case un:return;case xn:if(!isFinite(y)&&!isFinite(x))return;break;case Li:if(!isFinite(y))return;break;case ji:if(!isFinite(x))return}for(yt=ot.measuredBounds,z=yt.width,tt=yt.height,xt=Math.max(z+ut,0),Ct=Math.max(tt+ft,0),lt=ot.margin,jt=Be.allocAt(-lt.left,-lt.top,xt,Ct),fv(ot,jt,!0),z=jt.width,tt=jt.height,y=0;y<rt;y++)x=E[y],x===ot||!x.visible&&x!==te||(lt=x.margin,xt=lt.right+lt.left,Ct=lt.top+lt.bottom,yt=x.measuredBounds,xt=Math.max(yt.width+xt,0),Ct=Math.max(yt.height+Ct,0),ut=x.alignment,ut.Xb()&&(ut=a.defaultAlignment),ut.sb()||(ut=Or),x=x.alignmentFocus,x.Xb()&&(x=Or),Qt?(Qt=!1,b.h(ut.x*z+ut.offsetX-(x.x*yt.width+x.offsetX)-lt.left,ut.y*tt+ut.offsetY-(x.y*yt.height+x.offsetY)-lt.top,xt,Ct)):Jr(b,ut.x*z+ut.offsetX-(x.x*yt.width+x.offsetX)-lt.left,ut.y*tt+ut.offsetY-(x.y*yt.height+x.offsetY)-lt.top,xt,Ct));Qt?b.assign(Wt):bt?b.Uu(jt.x,jt.y,jt.width,jt.height):Jr(b,Wt.x,Wt.y,Wt.width,Wt.height),Be.free(jt)},vm.prototype.arrange=function(a,y,x){var E=y.length,b=a.Pb(),z=b.measuredBounds,tt=z.width,rt=z.height,ot=a.padding;z=ot.left,ot=ot.top;var lt=z-x.x,ut=ot-x.y;for(b.arrange(lt,ut,tt,rt),tt=Be.allocAt(0,0,tt,rt),fv(b,tt,!1),rt=0;rt<E;rt++){var ft=y[rt];if(ft!==b){lt=ft.measuredBounds;var yt=lt.width,xt=lt.height;ut=ft.alignment,ut.Xb()&&(ut=a.defaultAlignment),ut.sb()||(ut=Or);var Ct=ft.alignmentFocus;if(Ct.Xb()&&(Ct=Or),lt=null,ft instanceof En&&ft.$e!==""&&(lt=ft.fb(ft.$e),lt===ft&&(lt=null)),lt!==null){var bt=lt.actualBounds;for(Ct=At.allocAt(bt.x+(Ct.x*bt.width-Ct.offsetX),bt.y+(Ct.y*bt.height-Ct.offsetY)),lt=lt.panel;lt!==ft;)lt.transform.Ga(Ct),lt=lt.panel;lt=ut.x*tt.width+ut.offsetX-Ct.x,ut=ut.y*tt.height+ut.offsetY-Ct.y,At.free(Ct)}else lt=ut.x*tt.width+ut.offsetX-(Ct.x*yt+Ct.offsetX),ut=ut.y*tt.height+ut.offsetY-(Ct.y*xt+Ct.offsetY);lt+=tt.x-x.x,ut+=tt.y-x.y,ft.visible&&ft.arrange(z+lt,ot+ut,yt,xt)}}Be.free(tt)};function fv(a,y,x){var E=null;if(a instanceof En&&a.$e!==""&&(E=a.fb(a.$e),E===a&&(E=null)),E!==null)for(x&&a.arrange(0,0,y.width,y.height),y.assign(E.actualBounds),E=E.panel;E!==a;)E.transform.pp(y),E=E.panel}function ym(){this.xa="Base"}Se(ym,wa),ym.prototype.measure=function(a,y,x,E,b,z,tt){var rt=E.length,ot=a.Pb(),lt=ot.margin,ut=y,ft=x,yt=lt.right+lt.left,xt=lt.top+lt.bottom;ot.measure(y,x,z,tt),lt=ot.measuredBounds;var Ct=0,bt=null;ot instanceof cr&&(bt=ot,Ct=bt.strokeWidth*bt.scale);var Wt=Math.max(lt.width+yt,0);lt=Math.max(lt.height+xt,0);var jt=vv(ot),Qt=jt.x*Wt+jt.offsetX;jt=jt.y*lt+jt.offsetY;var te=yv(ot),re=te.x*Wt+te.offsetX;for(te=te.y*lt+te.offsetY,isFinite(y)&&(ut=Math.max(Math.abs(Qt-re)-Ct,0)),isFinite(x)&&(ft=Math.max(Math.abs(jt-te)-Ct,0)),Ct=ln.alloc(),Ct.h(0,0),a=ch(a),te=0;te<rt;te++)jt=E[te],jt===ot||!jt.visible&&jt!==a||(lt=jt.margin,Wt=lt.right+lt.left,Qt=lt.top+lt.bottom,jt.measure(ut,ft,0,0),lt=jt.measuredBounds,Wt=Math.max(lt.width+Wt,0),lt=Math.max(lt.height+Qt,0),Ct.h(Math.max(Wt,Ct.width),Math.max(lt,Ct.height)));if(rt===1)b.width=Wt,b.height=lt,ln.free(Ct);else{switch(jt=vv(ot),te=yv(ot),rt=E=0,te.x!==jt.x&&te.y!==jt.y&&(E=Ct.width/Math.abs(te.x-jt.x),rt=Ct.height/Math.abs(te.y-jt.y)),ln.free(Ct),Ct=0,bt!==null&&(Ct=bt.strokeWidth*bt.scale,Ev(bt)===wi&&(E=rt=Math.max(E,rt))),E+=Math.abs(jt.offsetX)+Math.abs(te.offsetX)+Ct,rt+=Math.abs(jt.offsetY)+Math.abs(te.offsetY)+Ct,bt=ot.stretch,bt===lr&&(bt=Ds(ot,!1)),bt){case un:tt=z=0;break;case xn:isFinite(y)&&(E=y),isFinite(x)&&(rt=x);break;case Li:isFinite(y)&&(E=y),tt=0;break;case ji:z=0,isFinite(x)&&(rt=x)}ot.Uj(),ot.measure(E,rt,z,tt),b.width=ot.measuredBounds.width+yt,b.height=ot.measuredBounds.height+xt}},ym.prototype.arrange=function(a,y){var x=y.length,E=a.Pb(),b=E.measuredBounds,z=Be.alloc();z.h(0,0,1,1);var tt=E.margin,rt=tt.left;tt=tt.top;var ot=a.padding,lt=ot.left;ot=ot.top,E.arrange(lt+rt,ot+tt,b.width,b.height);var ut=vv(E),ft=yv(E),yt=ut.y*b.height+ut.offsetY,xt=ft.x*b.width+ft.offsetX;for(ft=ft.y*b.height+ft.offsetY,z.x=ut.x*b.width+ut.offsetX,z.y=yt,Jr(z,xt,ft,0,0),z.x+=rt+lt,z.y+=tt+ot,b=0;b<x;b++)rt=y[b],rt!==E&&(lt=rt.measuredBounds,tt=rt.margin,ot=Math.max(lt.width+tt.right+tt.left,0),ut=Math.max(lt.height+tt.top+tt.bottom,0),yt=rt.alignment,yt.Xb()&&(yt=a.defaultAlignment),yt.sb()||(yt=Or),ot=z.width*yt.x+yt.offsetX-ot*yt.x+tt.left+z.x,tt=z.height*yt.y+yt.offsetY-ut*yt.y+tt.top+z.y,rt.visible&&(Dr(z.x,z.y,z.width,z.height,ot,tt,lt.width,lt.height)?rt.arrange(ot,tt,lt.width,lt.height):rt.arrange(ot,tt,lt.width,lt.height,new Be(z.x,z.y,z.width,z.height))));Be.free(z)};function Sm(){this.xa="Base",this.name="Table"}Se(Sm,wa),Sm.prototype.measure=function(a,y,x,E,b){for(var z=E.length,tt=pi(),rt=pi(),ot=0;ot<z;ot++){var lt=E[ot],ut=lt instanceof En?lt:null;if(ut!==null&&Oh(ut)&&lt.visible){rt.push(ut);for(var ft=ut.O.s,yt=ft.length,xt=0;xt<yt;xt++){var Ct=ft[xt];ut.type===En.TableRow?Ct.row=lt.row:ut.type===En.TableColumn&&(Ct.column=lt.column),tt.push(Ct)}}else tt.push(lt)}z=tt.length,z===0&&(a.Fb(0),a.Eb(0));for(var bt=[],Wt=0;Wt<z;Wt++){var jt=tt[Wt];jt.visible&&(ma(jt,!0),Gu(jt,!0),bt[jt.row]||(bt[jt.row]=[]),bt[jt.row][jt.column]||(bt[jt.row][jt.column]=[]),bt[jt.row][jt.column].push(jt))}oi(tt);var Qt=pi(),te=pi(),re=pi(),he={count:0},ke={count:0},Jn=y,fi=x,li=a.rowDefs,Bn=a.colDefs,on=null;z=li.length;for(var nr=0;nr<z;nr++)on=li[nr],on!==void 0&&(on.actual=0);z=Bn.length;for(var Xi=0;Xi<z;Xi++)on=Bn[Xi],on!==void 0&&(on.actual=0);for(var to=bt.length,Ao=0,ba=0;ba<to;ba++)bt[ba]&&(Ao=Math.max(Ao,bt[ba].length));var Oa=Math.min(a.topIndex,to-1),gs=Math.min(a.leftIndex,Ao-1),Na=0;to=bt.length;for(var Vh=ch(a),ha=0;ha<to;ha++)if(bt[ha]){Ao=bt[ha].length;var yu=a.Fb(ha);yu.actual=0;for(var ps=yu.oc=0;ps<Ao;ps++)if(bt[ha][ps]){var Kh=a.Eb(ps);Qt[ps]===void 0&&(Kh.actual=0,Kh.oc=0,Qt[ps]=!0);for(var dl=bt[ha][ps],Rl=dl.length,tl=0;tl<Rl;tl++){var Vs=dl[tl];if(Vs.visible||Vs===Vh){var kd=1<Vs.rowSpan||1<Vs.columnSpan;kd&&(ha<Oa||ps<gs||te.push(Vs));var Su=Vs.margin,rg=Su.right+Su.left,el=Su.top+Su.bottom,ms=fu(Vs,yu,Kh,!1),Op=Vs.desiredSize,$c=!isNaN(Op.height),Bu=!isNaN(Op.width)&&$c;if(kd||ms===un||Bu||ha<Oa||ps<gs||(he[ps]!==void 0||ms!==xn&&ms!==Li||(he[ps]=-1,he.count++),ke[ha]!==void 0||ms!==xn&&ms!==ji||(ke[ha]=-1,ke.count++),re.push(Vs)),Vs.measure(1/0,1/0,0,0),!(ha<Oa||ps<gs)){var Ks=Vs.measuredBounds,uc=Math.max(Ks.width+rg,0),nl=Math.max(Ks.height+el,0);if(Vs.rowSpan===1&&(ms===un||ms===Li)){on=a.Fb(ha);var bd=on.Wc();Na=Math.max(nl-on.actual,0),Na+bd>fi&&(Na=Math.max(fi-bd,0));var G0=on.oa===0;on.oc=on.oc+Na,on.actual=on.oa+Na,fi=Math.max(fi-(Na+(G0?bd:0)),0)}if(Vs.columnSpan===1&&(ms===un||ms===ji)){on=a.Eb(ps);var Ip=on.Wc();Na=Math.max(uc-on.actual,0),Na+Ip>Jn&&(Na=Math.max(Jn-Ip,0));var zy=on.oa===0;on.oc=on.oc+Na,on.actual=on.oa+Na,Jn=Math.max(Jn-(Na+(zy?Ip:0)),0)}kd&&Vs.Uj()}}}}}oi(Qt);var qu=0,ph=0;z=a.columnCount;for(var qc=0;qc<z;qc++){var Nd=Bn[qc];Nd!==void 0&&(qu+=isNaN(Nd.Hc)?Nd.oc:Nd.Hc,Nd.oc!==0&&(qu+=Nd.Wc()))}z=a.rowCount;for(var og=0;og<z;og++){var Bd=li[og];Bd!==void 0&&(ph+=isNaN(Bd.Hc)?Bd.oc:Bd.Hc,Bd.oc!==0&&(ph+=Bd.Wc()))}Jn=Math.max(y-qu,0);var th=fi=Math.max(x-ph,0),Uh=Jn;z=re.length;for(var Us=0;Us<z;Us++){var Au=re[Us],H0=a.Fb(Au.row),mh=a.Eb(Au.column),ag=Au.measuredBounds,xu=Au.margin,hc=xu.right+xu.left,Tu=xu.top+xu.bottom;he[Au.column]=mh.oc===0&&he[Au.column]!==void 0?Math.max(ag.width+hc,he[Au.column]):null,ke[Au.row]=H0.oc===0&&ke[Au.row]!==void 0?Math.max(ag.height+Tu,ke[Au.row]):null}var tf=0,sg=0,nu;for(nu in ke)nu!=="count"&&(tf+=ke[nu]);for(nu in he)nu!=="count"&&(sg+=he[nu]);for(var Wa=ln.alloc(),_p=0;_p<z;_p++){var Ns=re[_p];if(Ns.visible||Ns===Vh){var da=a.Fb(Ns.row),Bs=a.Eb(Ns.column),vh=0;isFinite(Bs.width)?vh=Bs.width:(isFinite(Jn)&&he[Ns.column]!==null?sg===0?vh=Bs.actual+Jn:vh=he[Ns.column]/sg*Uh:he[Ns.column]!==null?vh=Jn:vh=Bs.actual||Jn,vh=Math.max(0,vh-Bs.Wc()));var Yh=0;switch(isFinite(da.height)?Yh=da.height:(isFinite(fi)&&ke[Ns.row]!==null?tf===0?Yh=da.actual+fi:Yh=ke[Ns.row]/tf*th:ke[Ns.row]!==null?Yh=fi:Yh=da.actual||fi,Yh=Math.max(0,Yh-da.Wc())),Wa.h(Math.max(Bs.minimum,Math.min(vh,Bs.maximum)),Math.max(da.minimum,Math.min(Yh,da.maximum))),ms=fu(Ns,da,Bs,!1),ms){case Li:Wa.height=Math.max(Wa.height,da.actual+fi);break;case ji:Wa.width=Math.max(Wa.width,Bs.actual+Jn)}var dc=Ns.margin,Zy=dc.right+dc.left,W0=dc.top+dc.bottom;Ns.Uj(),Ns.measure(Wa.width,Wa.height,Bs.minimum,da.minimum);var lg=Ns.measuredBounds,cc=Math.max(lg.width+Zy,0),ef=Math.max(lg.height+W0,0);isFinite(Jn)&&(cc=Math.min(cc,Wa.width)),isFinite(fi)&&(ef=Math.min(ef,Wa.height));var Ys=0;Ys=da.actual,da.actual=Math.max(da.actual,ef),da.oc=Math.max(da.oc,ef),Na=da.actual-Ys,fi=Math.max(fi-Na,0),ke[Ns.row]===null&&(th=Math.max(th-Na,0)),Ys=Bs.actual,Bs.actual=Math.max(Bs.actual,cc),Bs.oc=Math.max(Bs.oc,cc),Na=Bs.actual-Ys,Jn=Math.max(Jn-Na,0),he[Ns.column]===null&&(Uh=Math.max(Uh-Na,0))}}oi(re);var yh=ln.alloc(),Pu=pi(),El=pi();if(z=te.length,z!==0){for(var Ad=0;Ad<to;Ad++)if(bt[Ad]){Ao=bt[Ad].length;var ug=a.Fb(Ad);Pu[Ad]=ug.actual;for(var Td=0;Td<Ao;Td++)if(bt[Ad][Td]){var V0=a.Eb(Td);El[Td]=V0.actual}}}for(var hg=0;hg<z;hg++){var oa=te[hg];if(oa.visible||oa===Vh){var iu=a.Fb(oa.row),jl=a.Eb(oa.column);switch(Wa.h(Math.max(jl.minimum,Math.min(y,jl.maximum)),Math.max(iu.minimum,Math.min(x,iu.maximum))),ms=fu(oa,iu,jl,!1),ms){case xn:El[jl.index]!==0&&(Wa.width=Math.min(Wa.width,El[jl.index])),Pu[iu.index]!==0&&(Wa.height=Math.min(Wa.height,Pu[iu.index]));break;case Li:El[jl.index]!==0&&(Wa.width=Math.min(Wa.width,El[jl.index]));break;case ji:Pu[iu.index]!==0&&(Wa.height=Math.min(Wa.height,Pu[iu.index]))}isFinite(jl.width)&&(Wa.width=jl.width),isFinite(iu.height)&&(Wa.height=iu.height),yh.h(0,0);for(var K0=jl.minimum,il=iu.minimum,Xh=1;Xh<oa.rowSpan&&!(oa.row+Xh>=a.rowCount);Xh++)on=a.Fb(oa.row+Xh),Na=0,Na=ms===xn||ms===ji?Math.max(on.minimum,Pu[oa.row+Xh]===0?on.maximum:Math.min(Pu[oa.row+Xh],on.maximum)):Math.max(on.minimum,isNaN(on.Hc)?on.maximum:Math.min(on.Hc,on.maximum)),yh.height+=Na,il+=on.minimum;for(var zl=1;zl<oa.columnSpan&&!(oa.column+zl>=a.columnCount);zl++)on=a.Eb(oa.column+zl),Na=0,Na=ms===xn||ms===Li?Math.max(on.minimum,El[oa.column+zl]===0?on.maximum:Math.min(El[oa.column+zl],on.maximum)):Math.max(on.minimum,isNaN(on.Hc)?on.maximum:Math.min(on.Hc,on.maximum)),yh.width+=Na,K0+=on.minimum;Wa.width+=yh.width,Wa.height+=yh.height;var dg=oa.margin,Dd=dg.right+dg.left,Rp=dg.top+dg.bottom;oa.measure(Wa.width,Wa.height,K0,il);for(var cg=oa.measuredBounds,Du=Math.max(cg.width+Dd,0),fc=Math.max(cg.height+Rp,0),Od=0,fg=0;fg<oa.rowSpan&&!(oa.row+fg>=a.rowCount);fg++)on=a.Fb(oa.row+fg),Od+=on.total||0;if(Od<fc){var Jh=fc-Od,eh=fc-Od;if(oa.spanAllocation!==null)for(var Qh=oa.spanAllocation,Sh=0;Sh<oa.rowSpan&&!(0>=Jh)&&!(oa.row+Sh>=a.rowCount);Sh++){on=a.Fb(oa.row+Sh);var $h=on.oa||0,gc=Qh(oa,on,eh);on.actual=Math.min(on.maximum,$h+gc),on.oa!==$h&&(Jh-=on.oa-$h)}for(;0<Jh;){var wu=on.oa||0;if(isNaN(on.height)&&on.maximum>wu&&(on.actual=Math.min(on.maximum,wu+Jh),on.oa!==wu&&(Jh-=on.oa-wu)),on.index===0)break;on=a.Fb(on.index-1)}}for(var nf=0,qh=0;qh<oa.columnSpan&&!(oa.column+qh>=a.columnCount);qh++)on=a.Eb(oa.column+qh),nf+=on.total||0;if(nf<Du){var rf=Du-nf,Gy=Du-nf;if(oa.spanAllocation!==null)for(var xh=oa.spanAllocation,pc=0;pc<oa.columnSpan&&!(0>=rf)&&!(oa.column+pc>=a.columnCount);pc++){on=a.Eb(oa.column+pc);var jp=on.oa||0,Hy=xh(oa,on,Gy);on.actual=Math.min(on.maximum,jp+Hy),on.oa!==jp&&(rf-=on.oa-jp)}for(;0<rf;){var U0=on.oa||0;if(isNaN(on.width)&&on.maximum>U0&&(on.actual=Math.min(on.maximum,U0+rf),on.oa!==U0&&(rf-=on.oa-U0)),on.index===0)break;on=a.Eb(on.index-1)}}}}oi(te),ln.free(yh),ln.free(Wa),Pu!==void 0&&oi(Pu),El!==void 0&&oi(El);var of=0,af=0,Y0=a.desiredSize,gx=a.maxSize;ms=Ds(a,!0);var zp=ph=qu=0,Zp=0;z=a.columnCount;for(var X0=0;X0<z;X0++)Bn[X0]!==void 0&&(on=a.Eb(X0),isFinite(on.width)?(zp+=on.width,zp+=on.Wc()):bm(on)===$g?(zp+=on.oa,zp+=on.Wc()):on.oa!==0&&(qu+=on.oa,qu+=on.Wc()));isFinite(Y0.width)?of=Math.min(Y0.width,gx.width):of=ms!==un&&isFinite(y)?y:qu,of=Math.max(of,a.minSize.width),of=Math.max(of-zp,0);for(var Qx=qu===0?1:Math.max(of/qu,1),J0=0;J0<z;J0++)Bn[J0]!==void 0&&(on=a.Eb(J0),isFinite(on.width)||bm(on)===$g||(on.actual=on.oa*Qx),on.position=b.width,on.oa!==0&&(b.width+=on.oa,b.width+=on.Wc()));z=a.rowCount;for(var Q0=0;Q0<z;Q0++)li[Q0]!==void 0&&(on=a.Fb(Q0),isFinite(on.height)?(Zp+=on.height,Zp+=on.Wc()):bm(on)===$g?(Zp+=on.oa,Zp+=on.Wc()):on.oa!==0&&(ph+=on.oa,ph+=on.Wc()));isFinite(Y0.height)?af=Math.min(Y0.height,gx.height):af=ms!==un&&isFinite(x)?x:ph,af=Math.max(af,a.minSize.height),af=Math.max(af-Zp,0);for(var $x=ph===0?1:Math.max(af/ph,1),$0=0;$0<z;$0++)li[$0]!==void 0&&(on=a.Fb($0),isFinite(on.height)||bm(on)===$g||(on.actual=on.oa*$x),on.position=b.height,on.oa!==0&&(b.height+=on.oa,b.height+=on.Wc()));z=rt.length;for(var Wy=0;Wy<z;Wy++){var Gp=rt[Wy],Vy=0,Ky=0;Gp.type===En.TableRow?(Vy=b.width,on=a.Fb(Gp.row),Ky=on.actual):(on=a.Eb(Gp.column),Vy=on.actual,Ky=b.height),Gp.measuredBounds.h(0,0,Vy,Ky),ma(Gp,!1)}oi(rt),a.inRowsCols=bt},Sm.prototype.arrange=function(a,y,x){var E=y.length,b=a.padding,z=b.left;b=b.top;var tt=a.inRowsCols;if(tt!==null){for(var rt,ot,lt=tt.length,ut=0,ft=0;ft<lt;ft++)tt[ft]&&(ut=Math.max(ut,tt[ft].length));ot=a.rowDefs,rt=a.colDefs;var yt=ft=0,xt=Math.min(a.topIndex,lt-1);if(0<ot.length){for(;xt!==lt&&(ot[xt]===void 0||ot[xt].oa===0);)xt++;xt=Math.max(Math.min(xt,lt-1),0),ft=-ot[xt].position}var Ct=Math.min(a.leftIndex,ut-1);if(0<rt.length){for(;Ct!==ut&&(rt[Ct]===void 0||rt[Ct].oa===0);)Ct++;Ct=Math.max(Math.min(Ct,ut-1),0),yt=-rt[Ct].position}for(var bt=0,Wt=0;bt!==lt&&ot[bt]===void 0;)bt++;for(;Wt!==lt&&rt[Wt]===void 0;)Wt++;ut=a.part,a.Fb(bt),a.Eb(Wt);for(var jt=0;jt<y.length;jt++){var Qt=y[jt];if(Qt instanceof En&&Qt.visible&&Oh(Qt)){if(Qt.type===En.TableRow){rt=a.Fb(Qt.row);var te=a.Eb(Wt)}else rt=a.Fb(bt),te=a.Eb(Qt.column);ot=rt.position+ft+b,rt.oa!==0&&(ot+=rt.Io(Math.max(bt,xt))),rt=te.position+yt+z,te.oa!==0&&(rt+=te.Io(Math.max(Wt,Ct))),te=Qt.measuredBounds,Qt.Uk(),Qt.actualBounds.ka();var re=Qt.actualBounds,he=Be.allocAt(re.x,re.y,re.width,re.height);re.x=Qt.type===En.TableRow?z:rt,re.y=Qt.type===En.TableColumn?b:ot,re.width=te.width,re.height=te.height,Qt.actualBounds.freeze(),Gu(Qt,!1),Qr(he,re)||ut===null||(ut.oh(),Qt.Pn(ut)),Be.free(he)}}for(jt=ln.alloc(),Qt=0;Qt<lt;Qt++)if(tt[Qt]){for(ut=tt[Qt].length,te=a.Fb(Qt),ot=te.position+ft+b,te.oa!==0&&(ot+=te.Io(Math.max(bt,xt))),re=0;re<ut;re++)if(tt[Qt][re]){he=a.Eb(re),rt=he.position+yt+z,he.oa!==0&&(rt+=he.Io(Math.max(Wt,Ct)));for(var ke=tt[Qt][re],Jn=ke.length,fi=0;fi<Jn;fi++){var li=ke[fi],Bn=li.measuredBounds;jt.h(0,0);for(var on=1;on<li.rowSpan&&!(Qt+on>=a.rowCount);on++){var nr=a.Fb(Qt+on);nr.oa!==0&&(jt.height+=nr.total)}for(on=1;on<li.columnSpan&&!(re+on>=a.columnCount);on++)nr=a.Eb(re+on),nr.oa!==0&&(jt.width+=nr.total);var Xi=he.oa+jt.width,to=te.oa+jt.height;on=rt,nr=ot;var Ao=Xi,ba=to,Oa=rt,gs=ot,Na=Xi,Vh=to;rt+Xi>x.width&&(Na=Math.max(x.width-rt,0)),ot+to>x.height&&(Vh=Math.max(x.height-ot,0));var ha=li.alignment;if(ha.Xb()){ha=a.defaultAlignment,ha.sb()||(ha=Or);var yu=ha.x,ps=ha.y,Kh=ha.offsetX;ha=ha.offsetY;var dl=he.alignment,Rl=te.alignment;dl.sb()&&(yu=dl.x,Kh=dl.offsetX),Rl.sb()&&(ps=Rl.y,ha=Rl.offsetY)}else yu=ha.x,ps=ha.y,Kh=ha.offsetX,ha=ha.offsetY;(isNaN(yu)||isNaN(ps))&&(ps=yu=.5,ha=Kh=0),dl=Bn.width,Rl=Bn.height;var tl=li.margin,Vs=tl.left+tl.right,kd=tl.top+tl.bottom,Su=fu(li,te,he,!1);!isNaN(li.desiredSize.width)||Su!==xn&&Su!==Li||(dl=Math.max(Xi-Vs,0)),!isNaN(li.desiredSize.height)||Su!==xn&&Su!==ji||(Rl=Math.max(to-kd,0)),Xi=li.maxSize,to=li.minSize,dl=Math.min(Xi.width,dl),Rl=Math.min(Xi.height,Rl),dl=Math.max(to.width,dl),Rl=Math.max(to.height,Rl),Xi=Rl+kd,on+=Ao*yu-(dl+Vs)*yu+Kh+tl.left,nr+=ba*ps-Xi*ps+ha+tl.top,li.visible&&(Dr(Oa,gs,Na,Vh,on,nr,Bn.width,Bn.height)?li.arrange(on,nr,dl,Rl):li.arrange(on,nr,dl,Rl,new Be(Oa,gs,Na,Vh)))}}}for(ln.free(jt),a=0;a<E;a++)x=y[a],z=x instanceof En?x:null,z!==null&&Oh(z)&&(z=x.actualBounds,x.naturalBounds.ka(),x.naturalBounds.h(0,0,z.width,z.height),x.naturalBounds.freeze())}};function xm(){this.xa="Base"}Se(xm,wa),xm.prototype.measure=function(){},xm.prototype.arrange=function(){};function Pm(){this.xa="Base"}Se(Pm,wa),Pm.prototype.measure=function(){},Pm.prototype.arrange=function(){};function wm(){this.xa="Base"}Se(wm,wa),wm.prototype.measure=function(a,y,x,E,b,z,tt){1<E.length&&$t("Viewbox Panel cannot contain more than one GraphObject."),E=E[0],E.Ca=1,E.Uj(),E.measure(1/0,1/0,z,tt);var rt=E.measuredBounds,ot=E.margin,lt=ot.right+ot.left;if(ot=ot.top+ot.bottom,isFinite(y)||isFinite(x)){var ut=E.scale,ft=rt.width;rt=rt.height;var yt=Math.max(y-lt,0),xt=Math.max(x-ot,0),Ct=1;a.viewboxStretch===wi?ft!==0&&rt!==0&&(Ct=Math.min(yt/ft,xt/rt)):ft!==0&&rt!==0&&(Ct=Math.max(yt/ft,xt/rt)),Ct===0&&(Ct=1e-4),E.Ca*=Ct,ut!==E.scale&&(ma(E,!0),E.measure(1/0,1/0,z,tt))}rt=E.measuredBounds,b.width=isFinite(y)?y:Math.max(rt.width+lt,0),b.height=isFinite(x)?x:Math.max(rt.height+ot,0)},wm.prototype.arrange=function(a,y,x){y=y[0];var E=y.measuredBounds,b=y.margin,z=Math.max(E.width+(b.right+b.left),0);b=Math.max(E.height+(b.top+b.bottom),0);var tt=y.alignment;tt.Xb()&&(tt=a.defaultAlignment),tt.sb()||(tt=Or),y.arrange(x.width*tt.x-z*tt.x+tt.offsetX,x.height*tt.y-b*tt.y+tt.offsetY,E.width,E.height)};function Xg(){this.xa="Base"}Se(Xg,wa),Xg.prototype.measure=function(){},Xg.prototype.arrange=function(){},Xg.prototype.gc=function(a,y,x){x=a.Df()*x.scale,0>=x&&(x=1);var E=a.gridCellSize,b=E.width;E=E.height;var z=a.naturalBounds,tt=a.actualBounds,rt=z.width,ot=z.height,lt=Math.ceil(rt/b),ut=Math.ceil(ot/E),ft=a.gridOrigin,yt=ft.x;ft=ft.y,y.save(),y.beginPath(),y.rect(0,0,rt,ot),y.clip(),y.Se();for(var xt=[],Ct=a.O.s,bt=Ct.length,Wt=0;Wt<bt;Wt++){var jt=Ct[Wt],Qt=[];if(xt.push(Qt),jt.visible){var te=jt.interval;if(!(0>te)){jt=pv(jt.figure);for(var re=0;re<bt;re++)if(re!==Wt){var he=Ct[re];he.visible&&pv(he.figure)===jt&&(he=he.interval,he>te&&Qt.push(he))}}}}for(Ct=a.O.s,bt=Ct.length,Wt=0;Wt<bt;Wt++){var ke=Ct[Wt];if(ke.visible&&(Qt=ke.interval||1,jt=Math.abs(Qt),!(2>b*jt*x))){if(te=ke.segmentIndex,(!isFinite(te)||isNaN(te))&&(te=0),0>te&&(te=jt-Math.min(-te,jt)),te=Math.round(te%jt),jt=ke.opacity,re=1,jt!==1){if(jt===0)continue;re=y.globalAlpha,y.globalAlpha=re*jt}he=xt[Wt];var Jn=!1,fi=ke.strokeDashArray;if(fi!==null&&(Jn=!0,y.js(fi,ke.strokeDashOffset)),ke.figure==="LineV"&&ke.stroke!==null&&0<ke.strokeWidth){for(y.lineWidth=ke.strokeWidth,na(a,y,ke.stroke,!1,!1,z,tt),y.beginPath(),fi=ke=Math.floor((yt-b)/b);fi<=ke+lt;fi++){var li=fi*b+yt;0<=li&&li<=rt&&Cm(fi,Qt,te,he)&&(y.moveTo(li,0),y.lineTo(li,ot))}y.stroke(),y.Se()}else if(ke.figure==="LineH"&&ke.stroke!==null&&0<ke.strokeWidth){for(y.lineWidth=ke.strokeWidth,na(a,y,ke.stroke,!1,!1,z,tt),y.beginPath(),fi=ke=Math.floor((ft-E)/E);fi<=ke+ut;fi++)li=fi*E+ft,0<=li&&li<=ot&&Cm(fi,Qt,te,he)&&(y.moveTo(0,li),y.lineTo(rt,li));y.stroke(),y.Se()}else if(ke.figure==="BarV"&&ke.fill!==null)for(na(a,y,ke.fill,!0,!1,z,tt),ke=ke.width,isNaN(ke)&&(ke=b),li=fi=Math.floor((yt-b)/b);li<=fi+lt;li++){var Bn=li*b+yt;0<=Bn+ke&&Bn<=rt&&Cm(li,Qt,te,he)&&y.fillRect(Bn,0,ke,ot)}else if(ke.figure==="BarH"&&ke.fill!==null)for(na(a,y,ke.fill,!0,!1,z,tt),ke=ke.height,isNaN(ke)&&(ke=E),li=fi=Math.floor((ft-E)/E);li<=fi+ut;li++)Bn=li*E+ft,0<=Bn+ke&&Bn<=ot&&Cm(li,Qt,te,he)&&y.fillRect(0,Bn,rt,ke);Jn&&y.fs(),jt!==1&&(y.globalAlpha=re)}}y.restore(),y.Vc(!1)};function Cm(a,y,x,E){if(0>y)return a%y===x;if(a%y!==x)return!1;y=E.length;for(var b=0;b<y;b++)if(a%E[b]===x)return!1;return!0}function Em(){this.xa="Base"}Se(Em,wa),Em.prototype.measure=function(a,y,x,E,b){var z=E.length;if(a instanceof Yr||a instanceof Tn){var tt=null,rt=null;if(a instanceof Tn&&(tt=a),a instanceof Yr&&(rt=a,tt=rt.adornedPart,a.j===null&&(a.j=[])),tt instanceof Tn){var ot=tt;if(z===0)Wr(a.naturalBounds,0,0),a.measuredBounds.h(0,0,0,0);else{var lt=a instanceof Yr?null:tt.path;y=tt.routeBounds,x=a.jg,x.h(0,0,y.width,y.height);var ut=ot.points,ft=tt.pointsCount;rt!==null?rt.Ul(!1):tt!==null&&tt.Ul(!1),rt=y.width;var yt=y.height,xt=a.j;if(xt.length=0,lt!==null){i1(a,rt,yt,lt);var Ct=lt.measuredBounds;x.ed(Ct),xt.push(Ct)}Ct=fe.alloc();for(var bt=At.alloc(),Wt=At.alloc(),jt=0;jt<z;jt++){var Qt=E[jt];if(Qt!==lt)if(Qt.isPanelMain&&Qt instanceof cr){i1(a,rt,yt,Qt);var te=Qt.measuredBounds;x.ed(te),xt.push(te)}else if(2>ft)Qt.measure(1/0,1/0,0,0),te=Qt.measuredBounds,x.ed(te),xt.push(te);else{var re=Qt.segmentIndex,he=Qt.segmentFraction,ke=Qt.alignmentFocus;ke.Mc()&&(ke=Or);var Jn=Qt.segmentOrientation,fi=Qt.segmentOffset;if(isNaN(re)){var li=ot.ua;te=pi(),li.Qu(he,te);var Bn=At.allocAt(te[0],te[1]);if(Bn.add(ot.i(0)),li.type===Ye.j?Bn.offset(-li.startX,-li.startY):(li=li.figures.first(),li!==null&&Bn.offset(-li.startX,-li.startY)),li=te[2],Jn!==Ls){var on=ot.computeAngle(Qt,Jn,li);Qt.Kb=on}on=Bn.x-y.x;var nr=Bn.y-y.y;At.free(Bn),oi(te)}else if(re<-ft||re>=ft)te=At.alloc(),ot.vg(),ot.computeMidPoint(te),li=ot.midAngle,Jn!==Ls&&(on=ot.computeAngle(Qt,Jn,li),Qt.Kb=on),on=te.x-y.x,nr=te.y-y.y,At.free(te);else{if(on=0,0<=re?(nr=ut.M(re),te=re<ft-1?ut.M(re+1):nr):(on=ft+re,nr=ut.M(on),te=0<on?ut.M(on-1):nr),nr.Xa(te)){0<=re?(li=0<re?ut.M(re-1):nr,on=re<ft-2?ut.M(re+2):te):(li=on<ft-1?ut.M(on+1):nr,on=1<on?ut.M(on-2):te),Bn=li.Bf(nr);var Xi=te.Bf(on);li=Bn>Xi+10?0<=re?li.ab(nr):nr.ab(li):Xi>Bn+10?0<=re?te.ab(on):on.ab(te):0<=re?li.ab(on):on.ab(li)}else li=0<=re?nr.ab(te):te.ab(nr);Jn!==Ls&&(on=ot.computeAngle(Qt,Jn,li),Qt.Kb=on),on=nr.x+(te.x-nr.x)*he-y.x,nr=nr.y+(te.y-nr.y)*he-y.y}Qt.measure(1/0,1/0,0,0),te=Qt.measuredBounds,Bn=Qt.naturalBounds;var to=0;Qt instanceof cr&&(to=Qt.strokeWidth),Xi=Bn.width+to;var Ao=Bn.height+to;Ct.reset(),Ct.translate(-te.x,-te.y),Ct.scale(Qt.scale,Qt.scale),Ct.rotate(Jn===Ls?Qt.angle:li,Xi/2,Ao/2),Jn!==lp&&Jn!==hp||Ct.rotate(90,Xi/2,Ao/2),Jn!==up&&Jn!==dp||Ct.rotate(-90,Xi/2,Ao/2),Jn===t0&&(45<li&&135>li||225<li&&315>li)&&Ct.rotate(-li,Xi/2,Ao/2),Bn=new Be(0,0,Xi,Ao),bt.xi(Bn,ke),Ct.Ga(bt),ke=-bt.x+to/2*Qt.scale,Qt=-bt.y+to/2*Qt.scale,Wt.assign(fi),to=isNaN(fi.x);var ba=isNaN(fi.y);if(to||ba){Xi=Xi/2+3,Ao=Ao/2+3;var Oa=45<=li&&135>=li,gs=225<=li&&315>=li;Jn===Ls&&(Oa||gs)?(Wt.x=ba?Xi:fi.y,Wt.y=to?Ao:fi.x,Oa?0<=re||isNaN(re)&&.5>he||!to||(Wt.y=-Ao):gs&&((0<=re||isNaN(re)&&.5>he)&&to&&(Wt.y=-Ao),ba&&(Wt.x=-Xi))):(to&&(Wt.x=0<=re||isNaN(re)&&.5>he?Xi:-Xi),ba&&(Wt.y=-Ao),Wt.rotate(li))}else Wt.rotate(li);on+=Wt.x,nr+=Wt.y,Bn.set(te),Bn.h(on+ke,nr+Qt,te.width,te.height),xt.push(Bn),x.ed(Bn)}}if(tt!==null)for(E=tt.labelNodes;E.next();)E.value.measure(1/0,1/0);a.jg=x,a.position.h(y.x+x.x,y.y+x.y),Wr(b,x.width||0,x.height||0),fe.free(Ct),At.free(bt),At.free(Wt)}}}},Em.prototype.arrange=function(a,y){var x=y.length;if(a instanceof Yr||a instanceof Tn){var E=a,b=null;a instanceof Yr&&(b=a,E=b.adornedPart);var z=a instanceof Yr?null:E.path,tt=a.j;if(tt.length!==0){var rt=0;if(z!==null&&rt<tt.length){var ot=tt[rt];rt++,z.arrange(ot.x-a.jg.x,ot.y-a.jg.y,ot.width,ot.height)}for(ot=0;ot<x;ot++){var lt=y[ot];if(lt!==z&&rt<tt.length){var ut=tt[rt];rt++,lt.arrange(ut.x-a.jg.x,ut.y-a.jg.y,ut.width,ut.height)}}}if(y=E.points,x=y.count,2<=x&&a instanceof Tn)for(z=a.labelNodes;z.next();){var ft=a;tt=z.value,rt=tt.segmentIndex,ot=tt.segmentFraction;var yt=tt.alignmentFocus;if(lt=tt.segmentOrientation,ut=tt.segmentOffset,isNaN(rt)){var xt=ft.ua,Ct=pi();xt.Qu(ot,Ct);var bt=At.allocAt(Ct[0],Ct[1]);bt.add(ft.i(0)),xt.type===Ye.j||(xt=xt.figures.first()),bt.offset(-xt.startX,-xt.startY),xt=Ct[2],lt!==Ls&&(ft=ft.computeAngle(tt,lt,xt),tt.angle=ft),ft=bt.x;var Wt=bt.y;At.free(bt),oi(Ct)}else if(rt<-x||rt>=x)Ct=At.alloc(),xt=ft,Wt=Ct,xt.vg(),xt.computeMidPoint(Wt),xt=ft.midAngle,lt!==Ls&&(ft=ft.computeAngle(tt,lt,xt),tt.angle=ft),ft=Ct.x,Wt=Ct.y,At.free(Ct);else{if(bt=0,0<=rt?(Ct=y.s[rt],Wt=rt<x-1?y.s[rt+1]:Ct):(bt=x+rt,Ct=y.s[bt],Wt=0<bt?y.s[bt-1]:Ct),Ct.Xa(Wt)){0<=rt?(xt=0<rt?y.s[rt-1]:Ct,bt=rt<x-2?y.s[rt+2]:Wt):(xt=bt<x-1?y.s[bt+1]:Ct,bt=1<bt?y.s[bt-2]:Wt);var jt=xt.Bf(Ct),Qt=Wt.Bf(bt);xt=jt>Qt+10?0<=rt?xt.ab(Ct):Ct.ab(xt):Qt>jt+10?0<=rt?Wt.ab(bt):bt.ab(Wt):0<=rt?xt.ab(bt):bt.ab(xt)}else xt=0<=rt?Ct.ab(Wt):Wt.ab(Ct);lt!==Ls&&(ft=ft.computeAngle(tt,lt,xt),tt.angle=ft),ft=Ct.x+(Wt.x-Ct.x)*ot,Wt=Ct.y+(Wt.y-Ct.y)*ot}if(yt.ys())tt.location=new At(ft,Wt);else{yt.Mc()&&(yt=Or),Ct=fe.alloc(),Ct.reset(),Ct.scale(tt.scale,tt.scale),Ct.rotate(tt.angle,0,0);var te=tt.naturalBounds;bt=Be.allocAt(0,0,te.width,te.height),jt=At.alloc(),jt.xi(bt,yt),Ct.Ga(jt),yt=-jt.x,Qt=-jt.y;var re=te.width,he=te.height;te=At.alloc(),te.assign(ut);var ke=isNaN(ut.x),Jn=isNaN(ut.y);if(ke||Jn){re=re/2+3,he=he/2+3;var fi=45<=xt&&135>=xt,li=225<=xt&&315>=xt;lt===Ls&&(fi||li)?(te.x=Jn?re:ut.y,te.y=ke?he:ut.x,fi?0<=rt||isNaN(rt)&&.5>ot||!ke||(te.y=-he):li&&((0<=rt||isNaN(rt)&&.5>ot)&&ke&&(te.y=-he),Jn&&(te.x=-re))):(ke&&(te.x=0<=rt||isNaN(rt)&&.5>ot?re:-re),Jn&&(te.y=-he),te.rotate(xt))}else te.rotate(xt);ft+=te.x,Wt+=te.y,Ct.pp(bt),yt+=bt.x,Qt+=bt.y,rt=At.allocAt(ft+yt,Wt+Qt),tt.move(rt),At.free(rt),At.free(te),At.free(jt),Be.free(bt),fe.free(Ct)}}b!==null?b.Ul(!1):E.Ul(!1),E=A1(a),a.location.h(a.position.x+E.x,a.position.y+E.y),At.free(E)}};function i1(a,y,x,E){if(sl(E)!==!1){var b=E.strokeWidth;b===0&&a instanceof Yr&&a.type===En.Link&&a.adornedObject instanceof cr&&(b=a.adornedObject.strokeWidth),b*=E.Ca,a instanceof Tn&&a.ua!==null?(a=a.geometry.bounds,E.Ge(a.x-b/2,a.y-b/2,a.width+b,a.height+b)):a instanceof Yr&&a.adornedPart.ua!==null?(a=a.adornedPart.ua.bounds,E.Ge(a.x-b/2,a.y-b/2,a.width+b,a.height+b)):E.Ge(-(b/2),-(b/2),y+b,x+b),b=E.desiredSize,b.w()||E.ua===null?E.dc.h(0,0,b.width,b.height):E.dc.assign(E.ua.bounds),ma(E,!1)}}function Jg(){this.xa="Base"}Se(Jg,wa),Jg.prototype.measure=function(a,y,x,E,b,z,tt){var rt=a.Pb();a.graduatedBounds=[];var ot=rt.margin,lt=ot.right+ot.left,ut=ot.top+ot.bottom;rt.measure(y,x,z,tt);var ft=rt.measuredBounds,yt=new Be(-ot.left,-ot.top,Math.max(ft.width+lt,0),Math.max(ft.height+ut,0));a.graduatedBounds.push(yt),b.assign(yt);for(var xt=rt.geometry,Ct=rt.strokeWidth,bt=xt.flattenedSegments,Wt=xt.flattenedLengths,jt=xt.flattenedTotalLength,Qt=bt.length,te=0,re=0,he=pi(),ke=0;ke<Qt;ke++){var Jn=bt[ke],fi=[];re=te=0;for(var li=Jn.length,Bn=0;Bn<li;Bn+=2){var on=Jn[Bn],nr=Jn[Bn+1];if(Bn!==0){var Xi=180*Math.atan2(nr-re,on-te)/Math.PI;0>Xi&&(Xi+=360),fi.push(Xi)}te=on,re=nr}he.push(fi)}if(a.graduatedIntervals===null){for(var to=[],Ao=a.O.s,ba=Ao.length,Oa=0;Oa<ba;Oa++){var gs=Ao[Oa],Na=[];if(to.push(Na),gs.visible){var Vh=gs.interval;if(!(0>Vh)){for(var ha=0;ha<ba;ha++)if(ha!==Oa){var yu=Ao[ha];if(yu.visible&&gs.constructor===yu.constructor){var ps=yu.interval;ps>Vh&&Na.push(ps)}}}}}a.graduatedIntervals=to}var Kh=a.graduatedIntervals,dl=a.O.s,Rl=dl.length,tl=0,Vs=0,kd=jt;a.graduatedMarks=[];for(var Su,rg=0;rg<Rl;rg++){var el=dl[rg];if(Su=[],el.visible&&el!==rt){var ms=Math.abs(el.interval),Op=a.graduatedTickUnit;if(!(2>Op*ms*jt/a.graduatedRange&&el.graduatedSkip===null)){var $c=Wt[0][0],Bu=0,Ks=0;Vs=jt*el.graduatedStart-1e-4,kd=jt*el.graduatedEnd+1e-4;var uc=Op*ms,nl=a.graduatedTickBase;if(nl<a.graduatedMin){var bd=(a.graduatedMin-nl)/uc;bd=bd%1===0?bd:Math.floor(bd+1),nl+=bd*uc}else nl>a.graduatedMin+uc&&(nl-=Math.floor((nl-a.graduatedMin)/uc)*uc);for(var G0=Kh[rg],Ip=nl,zy=1e-6*a.graduatedMax,qu=1;nl<=a.graduatedMax+zy;qu++){t:{for(var ph=G0.length,qc=0;qc<ph;qc++){var Nd=(nl-a.graduatedTickBase)%(G0[qc]*a.graduatedTickUnit),og=1e-6*a.graduatedTickUnit;if(Nd<og&&Nd>-og){var Bd=!1;break t}}Bd=!0}if(Bd&&(nl>a.graduatedMax&&(nl=a.graduatedMax),el.graduatedSkip===null||el instanceof To&&!el.graduatedSkip(nl,el)||el instanceof cr&&!el.graduatedSkip(nl,el))&&(tl=(nl-a.graduatedMin)*jt/a.graduatedRange,tl>jt&&(tl=jt),Vs<=tl&&tl<=kd)){for(var th=he[Bu][Ks],Uh=Wt[Bu][Ks];Bu<Wt.length;){for(;tl>$c&&Ks<Wt[Bu].length-1;)Ks++,th=he[Bu][Ks],Uh=Wt[Bu][Ks],$c+=Uh;if(tl<=$c)break;Bu++,Ks=0,th=he[Bu][Ks],Uh=Wt[Bu][Ks],$c+=Uh}var Us=bt[Bu],Au=Us[2*Ks],H0=Us[2*Ks+1],mh=(tl-($c-Uh))/Uh,ag=new At(Au+(Us[2*Ks+2]-Au)*mh+Ct/2-xt.bounds.x,H0+(Us[2*Ks+3]-H0)*mh+Ct/2-xt.bounds.y);ag.scale(rt.scale,rt.scale);t:{var xu=th,hc=he[Bu];if(!(.5005>mh&&.4995<mh)){var Tu=xu;if(.5>mh?0<Ks?Tu=hc[Ks-1]:Zt.$(Us[0],Us[Us.length-2])&&Zt.$(Us[1],Us[Us.length-1])&&(Tu=hc[hc.length-1]):.5<mh&&(Ks+1<hc.length?Tu=hc[Ks+1]:Zt.$(Us[0],Us[Us.length-2])&&Zt.$(Us[1],Us[Us.length-1])&&(Tu=hc[0])),xu!==Tu){var tf=Math.abs(xu-Tu);if(180<tf&&(xu<Tu?xu+=360:Tu+=360,tf=Math.abs(xu-Tu)),5e-4>mh||.9995<mh){th=(xu+Tu)/2%360;break t}if(10>tf){var sg=1-Math.abs(.5-mh);th=(xu*sg+Tu*(1-sg))%360;break t}}}th=xu}if(el instanceof To){var nu="";el.graduatedFunction!==null?(nu=el.graduatedFunction(nl,el),nu=nu!=null?nu.toString():""):nu=(+nl.toFixed(2)).toString(),nu!==""&&Su.push({$l:ag,angle:th,text:nu})}else Su.push({$l:ag,angle:th})}nl=Ip+qu*uc}}}a.graduatedMarks.push(Su)}oi(he);var Wa=a.graduatedMarks;if(Wa!==null)for(var _p=E.length,Ns=0;Ns<_p;Ns++){var da=E[Ns],Bs=Wa[Ns];if(da.visible&&da!==rt&&Bs.length!==0){if(da instanceof cr){var vh=a,Yh=b,dc=da.alignmentFocus;dc.Mc()&&(dc=Vo);var Zy=da.angle;da.Kb=0,da.measure(1/0,1/0,0,0),da.Kb=Zy;var W0=da.measuredBounds,lg=W0.width,cc=W0.height,ef=Be.allocAt(0,0,lg,cc),Ys=At.alloc();Ys.xi(ef,dc),Be.free(ef);for(var yh=-Ys.x,Pu=-Ys.y,El=new Be,Ad=Bs.length,ug=0;ug<Ad;ug++)for(var Td=Bs[ug],V0=Td.$l.x,hg=Td.$l.y,oa=Td.angle,iu=0;4>iu;iu++){switch(iu){case 0:Ys.h(yh,Pu);break;case 1:Ys.h(yh+lg,Pu);break;case 2:Ys.h(yh,Pu+cc);break;case 3:Ys.h(yh+lg,Pu+cc)}Ys.rotate(oa+da.angle),Ys.offset(V0,hg),ug===0&&iu===0?El.h(Ys.x,Ys.y,0,0):El.Ye(Ys),Ys.offset(-V0,-hg),Ys.rotate(-oa-da.angle)}At.free(Ys),vh.graduatedBounds!==null&&vh.graduatedBounds.push(El),Jr(Yh,El.x,El.y,El.width,El.height)}else if(da instanceof To){var jl=a,K0=b;jl.temporaryTextBlock===null&&(jl.temporaryTextBlock=new To);var il=jl.temporaryTextBlock;y1(il,da);var Xh=da.alignmentFocus;Xh.Mc()&&(Xh=Vo);for(var zl=da.segmentOrientation,dg=da.segmentOffset,Dd=new Be,Rp=0,cg=0,Du=0,fc=0,Od=0,fg=Bs.length,Jh=0;Jh<fg;Jh++){var eh=Bs[Jh];Rp=eh.$l.x,cg=eh.$l.y,Du=eh.angle,Od=fc=da.angle,zl!==Ls&&(Od=zl===sp||zl===qm?Du+da.angle:Du,fc=Tn.computeAngle(zl,Od)),il.Kb=fc,il.text=eh.text||"",il.measure(1/0,1/0,0,0);var Qh=il.measuredBounds,Sh=il.naturalBounds,$h=Sh.width,gc=Sh.height,wu=fe.alloc();wu.reset(),wu.translate(-Qh.x,-Qh.y),wu.scale(il.scale,il.scale),wu.rotate(Od,$h/2,gc/2),zl!==lp&&zl!==hp||wu.rotate(90,$h/2,gc/2),zl!==up&&zl!==dp||wu.rotate(-90,$h/2,gc/2),zl===t0&&(45<Du&&135>Du||225<Du&&315>Du)&&wu.rotate(-Du,$h/2,gc/2);var nf=Be.allocAt(0,0,$h,gc),qh=At.alloc();qh.xi(nf,Xh),wu.Ga(qh);var rf=-qh.x,Gy=-qh.y,xh=At.alloc();xh.assign(dg),isNaN(xh.x)&&(xh.x=$h/2+3),isNaN(xh.y)&&(xh.y=-(gc/2+3)),xh.rotate(Du),Rp+=xh.x+rf,cg+=xh.y+Gy;var pc=new Be(Rp,cg,Qh.width,Qh.height),jp=new Be(Qh.x,Qh.y,Qh.width,Qh.height),Hy=new Be(Sh.x,Sh.y,Sh.width,Sh.height);eh.Sz=fc,eh.lineCount=il.lineCount,eh.lines=[il.Cb,il.Ih,il.df,il.Le,il.Qc,il.Qb,il.ze],eh.actualBounds=pc,eh.measuredBounds=jp,eh.naturalBounds=Hy,Jh===0?Dd.assign(pc):Dd.ed(pc),At.free(xh),At.free(qh),Be.free(nf),fe.free(wu)}jl.graduatedBounds!==null&&jl.graduatedBounds.push(Dd),Jr(K0,Dd.x,Dd.y,Dd.width,Dd.height)}ma(da,!1)}}},Jg.prototype.arrange=function(a,y,x){if(a.graduatedBounds!==null){var E=a.Pb(),b=a.graduatedMarks;if(b!==null){var z=a.graduatedBounds,tt=0,rt=z[tt];tt++,E!==null&&E.arrange(rt.x-x.x,rt.y-x.y,rt.width,rt.height);for(var ot=y.length,lt=0;lt<ot;lt++){var ut=y[lt];rt=b[lt],ut.visible&&ut!==E&&rt.length!==0&&(rt=z[tt],tt++,ut.arrange(rt.x-x.x,rt.y-x.y,rt.width,rt.height))}a.graduatedBounds=null}}},Jg.prototype.gc=function(a,y,x){var E=x.$i;x.$i=!0;var b=a.naturalBounds,z=b.width,tt=b.height;b=y instanceof Qs,y.save(),y.beginPath(),y.rect(-1,-1,z+1,tt+1),y.clip(),y.Se(),z=a.Pb(),z.gc(y,x),tt=a.Df()*x.scale,0>=tt&&(tt=1);for(var rt=z.actualBounds,ot=a.O.s,lt=a.graduatedMarks,ut=ot.length,ft=0;ft<ut;ft++){var yt=ot[ft],xt=lt[ft],Ct=xt.length;if(yt.visible&&yt!==z&&xt.length!==0){if(yt instanceof cr){if(!(2>a.graduatedTickUnit*yt.interval*z.geometry.flattenedTotalLength/a.graduatedRange*tt&&yt.graduatedSkip===null)){var bt=yt.measuredBounds,Wt=yt.strokeWidth*yt.scale,jt=yt.alignmentFocus;jt.Mc()&&(jt=Vo);for(var Qt=0;Qt<Ct;Qt++){var te=xt[Qt].$l,re=xt[Qt].angle,he=jt,ke=yt.Ab;ke.reset(),ke.translate(te.x+rt.x,te.y+rt.y),ke.rotate(re+yt.angle,0,0),ke.translate(-bt.width*he.x+he.offsetX+Wt/2,-bt.height*he.y+he.offsetY+Wt/2),ke.scale(yt.scale,yt.scale),Tl(yt,!1),yt.wh.set(yt.Ab),yt.Kk=yt.scale,vl(yt,!1),yt.gc(y,x),b&&(a.svg.appendChild(yt.svg),yt.svg=null),yt.Ab.reset()}}}else if(yt instanceof To)for(a.temporaryTextBlock===null&&(a.temporaryTextBlock=new To),bt=a.temporaryTextBlock,y1(bt,yt),Wt=0;Wt<Ct;Wt++)jt=xt[Wt],jt.actualBounds&&jt.measuredBounds&&jt.naturalBounds&&(bt.ec=jt.text||"",bt.Kb=jt.Sz||0,bt.Gc=jt.lineCount||0,Qt=jt.lines,Qt!==void 0&&(bt.Cb=Qt[0],bt.Ih=Qt[1],bt.df=Qt[2],bt.Le=Qt[3],bt.Qc=Qt[4],bt.Qb=Qt[5],bt.ze=Qt[6]),jt.naturalBounds&&(bt.dc=jt.naturalBounds),jt.actualBounds&&(Qt=jt.actualBounds,bt.arrange(Qt.x,Qt.y,Qt.width,Qt.height)),Qt=jt.actualBounds,bt.arrange(Qt.x,Qt.y,Qt.width,Qt.height),te=jt.measuredBounds,jt=jt.naturalBounds,re=bt.Ab,re.reset(),re.translate(Qt.x+rt.x,Qt.y+rt.y),re.translate(-te.x,-te.y),bt.no(re,jt.x,jt.y,jt.width,jt.height),Tl(bt,!1),bt.wh.set(bt.Ab),bt.Kk=bt.scale,vl(bt,!1),bt.Ng=yt.part,bt.Me=yt.panel,bt.gc(y,x),bt.Me=null,bt.Ng=null,b&&(a.svg.appendChild(bt.svg),bt.svg=null))}}x.$i=E,y.restore(),y.Vc(!0)};function En(a,y){if(de.call(this),this.na=null,a===void 0)this.na=En.Position;else if(typeof a=="string"){var x=Jl.I(a);x!==null&&(this.na=x)}else a instanceof wa?this.na=a:a&&(this.na=En.Position,y=a);this.na===null&&$t("Panel type not specified or PanelLayout not loaded: "+a),this.l=this.l|4194304|(this.na===En.Grid?1048576:0),this.O=new fn,this.yb=ca,this.Tm=xa,this.Uf=lr,this.$g=null,this.$e="",this.jg=new Be(NaN,NaN,NaN,NaN),this.T=this.F=null,this.xo=wi,this.jn=Rr,this.kn=Un,this.ub=this.ra=null,this.zn=NaN,this.ge=this.Hh=null,y&&Object.assign(this,y)}Se(En,de),En.prototype.cloneProtected=function(a){de.prototype.cloneProtected.call(this,a),a.na=this.na,a.yb=this.yb.J(),a.Tm=this.Tm.J(),a.Uf=this.Uf,a.$e=this.$e,a.jg.assign(this.jg),this.T!==null&&(a.T=this.T.copy(a)),a.xo=this.xo,a.jn=this.jn.J(),a.kn=this.kn.J(),this.ra!==null&&(a.ra=this.ra.copy()),a.ub=this.ub,a.zn=this.zn,a.Hh=this.Hh},En.prototype.Af=function(a){de.prototype.Af.call(this,a),a.O=this.O;for(var y=a.O.s,x=y.length,E=0;E<x;E++)y[E].Me=a;a.$g=null},En.prototype.copy=function(){var a=de.prototype.copy.call(this);if(a!==null){for(var y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E].copy();b.wi(a),b.Ng=null;var z=a.O,tt=z.count;if(z.Gb(tt,b),z=a.part,z!==null){z.Rh=null,b.portId!==null&&z instanceof qn&&(z.Te=!0);var rt=a.diagram;rt!==null&&rt.undoManager.isUndoingRedoing||z.cb(fo,"elements",a,null,b,null,tt)}}return a}return null},wt=En.prototype,wt.toString=function(){return"Panel("+this.type.name+")#"+Ai(this)},wt.Pn=function(a){de.prototype.Pn.call(this,a);for(var y=this.O.s,x=y.length,E=0;E<x;E++)y[E].Pn(a)},wt.hh=function(a,y){if(this.na===En.Grid)a.yc(),this.na.gc(this,a,y);else if(this.na===En.Graduated)a.yc(),this.na.gc(this,a,y);else{if(this.na===En.Table)if(a.yc(),a instanceof Qs){var x=a.yd;a.yd=dm(a,"gojs-ts"),gv(this,a),a.nh.pop(),a.yd=x}else gv(this,a);(x=this.isClipping&&this.na===En.Spot)&&a.save();for(var E=this.Pb(),b=this.O.s,z=b.length,tt=0;tt<z;tt++){var rt=b[tt];x&&rt===E&&(a.clipInsteadOfFill=!0),rt.gc(a,y),x&&rt===E&&(a.clipInsteadOfFill=!1)}x&&(a.restore(),a.Vc(!0))}};function gv(a,y){y.lineCap="butt";var x=0<a.rowCount?a.rowDefs:null,E=0<a.columnCount?a.colDefs:null;x!==null&&Lm(a,y,!0,x,!0),E!==null&&Lm(a,y,!1,E,!0),x!==null&&r1(a,y,!0,x),E!==null&&r1(a,y,!1,E),x!==null&&Lm(a,y,!0,x,!1),E!==null&&Lm(a,y,!1,E,!1)}function r1(a,y,x,E){for(var b=E.length,z=a.actualBounds,tt=a.naturalBounds,rt=!0,ot=0;ot<b;ot++){var lt=E[ot];if(lt!==void 0&&lt.actual!==0)if(rt)rt=!1;else{if(x){if(lt.position>tt.height)continue}else if(lt.position>tt.width)continue;var ut=lt.separatorStrokeWidth;isNaN(ut)&&(ut=x?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var ft=lt.separatorStroke;if(ft===null&&(ft=x?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke),ut!==0&&ft!==null){na(a,y,ft,!1,!1,tt,z),ft=!1;var yt=lt.separatorDashArray;yt===null&&(yt=x?a.defaultRowSeparatorDashArray:a.defaultColumnSeparatorDashArray),yt!==null&&(ft=!0,y.js(yt,0)),y.beginPath(),yt=lt.position+ut,x?yt>tt.height&&(ut-=yt-tt.height):yt>tt.width&&(ut-=yt-tt.width),lt=lt.position+ut/2,y.lineWidth=ut,ut=a.yb,x?(lt+=ut.top,yt=tt.width-ut.right,y.moveTo(ut.left,lt),y.lineTo(yt,lt)):(lt+=ut.left,yt=tt.height-ut.bottom,y.moveTo(lt,ut.top),y.lineTo(lt,yt)),y.stroke(),y.Se(),ft&&y.fs()}}}}function Lm(a,y,x,E,b){for(var z=E.length,tt=a.actualBounds,rt=a.naturalBounds,ot=o1(a,!0),lt=o1(a,!1),ut=0;ut<z;ut++){var ft=E[ut];if(ft!==void 0&&ft.background!==null&&ft.coversSeparators!==b&&ft.actual!==0){var yt=x?tt.height:tt.width;if(!(ft.position>yt)){var xt=ft.Wc(),Ct=ft.separatorStrokeWidth;isNaN(Ct)&&(Ct=x?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var bt=ft.separatorStroke;bt===null&&(bt=x?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke),(bt===null||ft.index===(x?ot:lt))&&(Ct=0),xt-=Ct,Ct=ft.position+Ct,xt+=ft.actual,Ct+xt>yt&&(xt=yt-Ct),0>=xt||(yt=a.yb,na(a,y,ft.background,!0,!1,rt,tt),x?y.fillRect(yt.left,Ct+yt.top,tt.width-(yt.left+yt.right),xt):y.fillRect(Ct+yt.left,yt.top,xt,tt.height-(yt.top+yt.bottom)))}}}}function o1(a,y){for(var x=y?a.rowCount:a.columnCount,E=0;E<x;E++){var b=y?a.rowDefs[E]:a.colDefs[E];if(b!==void 0)return b.index}return 0}function pv(a){return a==="LineV"||a==="BarV"}wt.lv=function(){for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].lv();this.Uc=!0},wt.kk=function(a,y,x){if(!de.prototype.kk.call(this,a,y,x))return!1;if(this.type===En.Table)x=this.svg.getElementsByClassName("gojs-ts"),x=x.length!==0?x[0]:null,x!==null&&(x.innerHTML=""),a.yd=x,gv(this,a),a.yd=null;else if(this.na===En.Grid||this.na===En.Graduated)return this.svg.innerHTML="",this.svg.remove(),!1;x=this.O.s;for(var E=x.length,b=0;b<E;b++)x[b].gc(a,y);return!0},wt.nk=function(){return!0},wt.$o=function(a,y,x,E){if(!this.isClipping)if(this.Dd()&&a.bk!==null){a=a.bk,y=this.O.s;for(var b=0,z=0,tt=0;tt<y.length;tt++)if(y[tt].Ed()){var rt=y[tt].actualBounds;b=tt===0?rt.x:Math.min(rt.x,b),z=tt===0?rt.y:Math.min(rt.y,z)}E.setAttributeNS(null,"clip-path","path('M "+(a.x-x.x-b)+","+(a.y-x.y-z)+" l "+a.width+" 0 l 0 "+a.height+" l -"+a.width+" 0 z')")}else de.prototype.$o.call(this,a,y,x,E)},wt.Sj=function(a,y,x,E,b){var z=this.se(),tt=this.transform,rt=1/(tt.m11*tt.m22-tt.m12*tt.m21),ot=tt.m22*rt,lt=-tt.m12*rt,ut=-tt.m21*rt,ft=tt.m11*rt,yt=rt*(tt.m21*tt.dy-tt.m22*tt.dx),xt=rt*(tt.m12*tt.dx-tt.m11*tt.dy);if(this.areaBackground!==null)return tt=this.actualBounds,Zt.Ff(tt.left,tt.top,tt.right,tt.bottom,a,y,x,E,b);if(this.background!==null)return z=a*ot+y*ut+yt,rt=a*lt+y*ft+xt,a=x*ot+E*ut+yt,ot=x*lt+E*ft+xt,b.h(0,0),x=this.naturalBounds,z=Zt.Ff(0,0,x.width,x.height,z,rt,a,ot,b),b.transform(tt),z;z||(ot=1,ut=lt=0,ft=1,xt=yt=0),rt=a*ot+y*ut+yt,a=a*lt+y*ft+xt,ot=x*ot+E*ut+yt,x=x*lt+E*ft+xt,b.h(ot,x),E=(ot-rt)*(ot-rt)+(x-a)*(x-a),lt=!1,ft=this.O.s,xt=ft.length,ut=At.alloc(),yt=null,y=1/0;var Ct=null,bt=this.isClipping&&this.na===En.Spot;bt&&(Ct=At.alloc(),yt=this.Pb(),(lt=yt.Sj(rt,a,ot,x,Ct))&&(y=(rt-Ct.x)*(rt-Ct.x)+(a-Ct.y)*(a-Ct.y)));for(var Wt=0;Wt<xt;Wt++){var jt=ft[Wt];jt.visible&&jt!==yt&&jt.Sj(rt,a,ot,x,ut)&&(lt=!0,jt=(rt-ut.x)*(rt-ut.x)+(a-ut.y)*(a-ut.y),jt<E&&(E=jt,b.set(ut)))}return bt&&(y>E&&b.set(Ct),At.free(Ct)),At.free(ut),z&&b.transform(tt),lt},wt.Gj=function(){for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Gj();de.prototype.Gj.call(this)},wt.v=function(a){if(!sl(this)){de.prototype.v.call(this,a),a=null,(this.na===En.Auto||this.na===En.Link)&&(a=this.Pb());for(var y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E];if((b===a||b.isPanelMain)&&b.v(!0),!b.desiredSize.w()){var z=Ds(b,!1);(b instanceof Es||b instanceof En||b instanceof To||z!==un)&&b.v(!0)}}}},wt.Uj=function(){if(!sl(this)){ma(this,!0),Gu(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Uj()}},wt.Uk=function(){if(!(this.l&2048)){Tl(this,!0),vl(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()}},wt.Wu=function(){vl(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()},wt.Wl=function(a,y,x,E){var b=this.jg;b.h(0,0,0,0);var z=this.desiredSize,tt=this.minSize;x===void 0&&(x=tt.width,E=tt.height),x=Math.max(x,tt.width),E=Math.max(E,tt.height);var rt=this.maxSize;isNaN(z.width)||(a=Math.min(z.width,rt.width)),isNaN(z.height)||(y=Math.min(z.height,rt.height)),a=Math.max(x,a),y=Math.max(E,y);var ot=this.yb;a=Math.max(a-ot.left-ot.right,0),y=Math.max(y-ot.top-ot.bottom,0);var lt=this.O.s;lt.length!==0&&this.na.measure(this,a,y,lt,b,x,E),a=b.width+ot.left+ot.right,ot=b.height+ot.top+ot.bottom,isFinite(z.width)&&(a=z.width),isFinite(z.height)&&(ot=z.height),a=Math.min(rt.width,a),ot=Math.min(rt.height,ot),a=Math.max(tt.width,a),ot=Math.max(tt.height,ot),a=Math.max(x,a),ot=Math.max(E,ot),Wr(b,a,ot),Wr(this.naturalBounds,a,ot),this.Ge(0,0,a,ot)},wt.Pb=function(){if(this.$g===null){var a=this.O.s,y=a.length;if(y===0)return null;for(var x=0;x<y;x++){var E=a[x];if(E.isPanelMain===!0)return this.$g=E}this.$g=a[0]}return this.$g};function ch(a){return a.part!==null?a.part.locationObject:null}wt.eh=function(a,y,x,E){var b=this.O.s;if(this.actualBounds.h(a,y,x,E),b.length!==0){if(!this.desiredSize.w()){a=Ds(this,!0);var z=this.measuredBounds;y=z.width,z=z.height;var tt=this.Kg,rt=tt.left+tt.right;switch(tt=tt.top+tt.bottom,y===x&&z===E&&(a=un),a){case un:(y>x||z>E)&&(this.v(),this.measure(y>x?x:y,z>E?E:z,0,0));break;case xn:this.v(!0),this.measure(x+rt,E+tt,0,0);break;case Li:this.v(!0),this.measure(x+rt,z+tt,0,0);break;case ji:this.v(!0),this.measure(y+rt,E+tt,0,0)}}this.na.arrange(this,b,this.jg)}},wt.gh=function(a){var y=this.naturalBounds,x=ch(this);if(Dr(0,0,y.width,y.height,a.x,a.y)){y=this.O.s;for(var E=y.length,b=At.allocAt(0,0);E--;){var z=y[E];if((z.visible||z===x)&&(ii(b.set(a),z.transform),z.ca(b)))return At.free(b),!0}return At.free(b),!(this.Ma===null&&this.areaBackground===null)}return!1},wt.ks=function(a){if(this.bindingId===a)return this;for(var y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E].ks(a);if(b!==null)return b}return null},wt.qm=function(a,y){if(y(this,a),a instanceof En){a=a.O.s;for(var x=a.length,E=0;E<x;E++)this.qm(a[E],y)}};function ec(a,y){a1(a,a,y)}function a1(a,y,x){x(y),y=y.O.s;for(var E=y.length,b=0;b<E;b++){var z=y[b];z instanceof En&&a1(a,z,x)}}function vx(a,y){s1(a,a,y)}function s1(a,y,x){if(x(y),y instanceof En){y=y.O.s;for(var E=y.length,b=0;b<E;b++)s1(a,y[b],x)}}wt.Nl=function(a){return l1(this,this,a)};function l1(a,y,x){if(x(y))return y;if(y instanceof En){y=y.O.s;for(var E=y.length,b=0;b<E;b++){var z=l1(a,y[b],x);if(z!==null)return z}}return null}wt.fb=function(a){if(this.name===a)return this;var y=this.O.s,x=y.length;this.Hh===null&&this.itemTemplateMap===null||(x=Qg(this));for(var E=0;E<x;E++){var b=y[E];if(b instanceof En){var z=b.fb(a);if(z!==null)return z}if(b.name===a)return b}return null};function u1(a){a=a.O.s;for(var y=a.length,x=0,E=0;E<y;E++){var b=a[E];b instanceof En?x=Math.max(x,u1(b)):b instanceof cr&&(x=Math.max(x,b.ig/2*b.strokeMiterLimit*b.Df()))}return x}wt.se=function(){return!(this.type===En.TableRow||this.type===En.TableColumn)};function Oh(a){return a.type===En.TableRow||a.type===En.TableColumn}wt.ic=function(a,y,x){if(this.pickable===!1||(y===void 0&&(y=null),x===void 0&&(x=null),ws(this)))return null;var E=this.naturalBounds,b=1/this.Df(),z=this.se(),tt=z?a:ii(At.allocAt(a.x,a.y),this.transform),rt=this.diagram,ot=10,lt=5;if(rt!==null&&(ot=rt.Ql("extraTouchArea"),lt=ot/2),Dr(-(lt*b),-(lt*b),E.width+ot*b,E.height+ot*b,tt.x,tt.y)){if(!this.isAtomic){b=this.O.s;var ut=b.length;if(rt=At.alloc(),lt=(ot=this.isClipping&&this.na===En.Spot)?this.Pb():null,ot&&(lt.se()?ii(rt.set(a),lt.transform):rt.set(a),!lt.ca(rt)))return At.free(rt),z||At.free(tt),null;for(var ft=ch(this);ut--;){var yt=b[ut];if((yt.visible||yt===ft)&&(yt.se()?ii(rt.set(a),yt.transform):rt.set(a),!ot||yt!==lt)){var xt=null;if(yt instanceof En?xt=yt.ic(rt,y,x):yt.pickable===!0&&yt.ca(rt)&&(xt=yt),xt!==null&&(y!==null&&(xt=y(xt)),xt!==null&&(x===null||x(xt))))return At.free(rt),z||At.free(tt),xt}}At.free(rt)}return this.background===null&&this.areaBackground===null?(z||At.free(tt),null):(a=Dr(0,0,E.width,E.height,tt.x,tt.y)?this:null,z||At.free(tt),a)}return z||At.free(tt),null},wt.ji=function(a,y,x,E){if(this.pickable===!1)return!1;y===void 0&&(y=null),x===void 0&&(x=null);var b=this.naturalBounds,z=this.se(),tt=z?a:ii(At.allocAt(a.x,a.y),this.transform);if(b=Dr(0,0,b.width,b.height,tt.x,tt.y),Oh(this)||b){if(!this.isAtomic){for(var rt=this.O.s,ot=rt.length,lt=At.alloc(),ut=ch(this);ot--;){var ft=rt[ot];if(ft.visible||ft===ut){ft.se()?ii(lt.set(a),ft.transform):lt.set(a);var yt=ft;ft=ft instanceof En?ft:null,(ft!==null?ft.ji(lt,y,x,E):yt.ca(lt))&&yt.pickable!==!1&&(y!==null&&(yt=y(yt)),yt===null||x!==null&&!x(yt)||E.add(yt))}}At.free(lt)}return z||At.free(tt),b&&(this.background!==null||this.areaBackground!==null)}return z||At.free(tt),!1},wt.Cf=function(a,y,x,E,b,z){if(this.pickable===!1)return!1;y===void 0&&(y=null),x===void 0&&(x=null);var tt=z;if(z===void 0&&(tt=fe.alloc(),tt.reset()),tt.multiply(this.transform),this.fh(a,tt))return mv(this,y,x,b),z===void 0&&fe.free(tt),!0;if(this.Yc(a,tt)){if(!this.isAtomic)for(var rt=ch(this),ot=this.O.s,lt=ot.length;lt--;){var ut=ot[lt];if(ut.visible||ut===rt){var ft=ut.actualBounds,yt=this.naturalBounds;ft.x>yt.width||ft.y>yt.height||0>ft.x+ft.width||0>ft.y+ft.height||(ft=ut,ut=ut instanceof En?ut:null,yt=fe.alloc(),yt.set(tt),(ut!==null?ut.Cf(a,y,x,E,b,yt):ka(ft,a,E,yt))&&(y!==null&&(ft=y(ft)),ft===null||x!==null&&!x(ft)||b.add(ft)),fe.free(yt))}}return z===void 0&&fe.free(tt),E}return z===void 0&&fe.free(tt),!1};function mv(a,y,x,E){for(var b=a.O.s,z=b.length;z--;){var tt=b[z];if(tt.visible){var rt=tt.actualBounds,ot=a.naturalBounds;rt.x>ot.width||rt.y>ot.height||0>rt.x+rt.width||0>rt.y+rt.height||(tt instanceof En&&mv(tt,y,x,E),y!==null&&(tt=y(tt)),tt===null||x!==null&&!x(tt)||E.add(tt))}}}wt.og=function(a,y,x,E,b,z){if(this.pickable===!1)return!1;x===void 0&&(x=null),E===void 0&&(E=null);var tt=this.naturalBounds,rt=this.se(),ot=rt?a:ii(At.allocAt(a.x,a.y),this.transform),lt=rt?y:ii(At.allocAt(y.x,y.y),this.transform),ut=ot.Bf(lt),ft=0<ot.x&&ot.x<tt.width&&0<ot.y&&ot.y<tt.height||ni(ot.x,ot.y,0,0,0,tt.height)<=ut||ni(ot.x,ot.y,0,tt.height,tt.width,tt.height)<=ut||ni(ot.x,ot.y,tt.width,tt.height,tt.width,0)<=ut||ni(ot.x,ot.y,tt.width,0,0,0)<=ut;if(tt=ot.zd(0,0)<=ut&&ot.zd(0,tt.height)<=ut&&ot.zd(tt.width,0)<=ut&&ot.zd(tt.width,tt.height)<=ut,rt||(At.free(ot),At.free(lt)),ft){if(!this.isAtomic){ot=At.alloc(),lt=At.alloc(),ut=ch(this);for(var yt=this.O.s,xt=yt.length;xt--;){var Ct=yt[xt];if(Ct.visible||Ct===ut){var bt=Ct.actualBounds,Wt=this.naturalBounds;(!rt||!(bt.x>Wt.width||bt.y>Wt.height||0>bt.x+bt.width||0>bt.y+bt.height))&&(Ct.se()?(bt=Ct.transform,ii(ot.set(a),bt),ii(lt.set(y),bt)):(ot.set(a),lt.set(y)),bt=Ct,Ct=Ct instanceof En?Ct:null,(Ct!==null?Ct.og(ot,lt,x,E,b,z):bt.tx(ot,lt,b))&&(x!==null&&(bt=x(bt)),bt===null||E!==null&&!E(bt)||z.add(bt)))}}At.free(ot),At.free(lt)}return b?ft:tt}return!1};function vv(a){var y=null;return a instanceof cr&&(y=a.spot1,y===xa&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot1)),y===null&&(y=eo),y}function yv(a){var y=null;return a instanceof cr&&(y=a.spot2,y===xa&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot2)),y===null&&(y=No),y}wt.add=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];for(x=0;x<y.length;x++)this.Gb(this.O.count,y[x]);return this},wt.M=function(a){return this.O.M(a)},wt.Gb=function(a,y){y instanceof Ni&&$t("Cannot add a Part to a Panel: "+y+"; use a Panel instead"),(this===y||this.rg(y))&&(this===y&&$t("Cannot make a Panel contain itself: "+this.toString()),$t("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+y.toString()));var x=y.panel;if(x!==null&&x!==this&&$t("Cannot add a GraphObject that already belongs to another Panel to this Panel: "+y.toString()+", already contained by "+x.toString()+", cannot be shared by this Panel: "+this.toString()),this.na!==En.Grid||y instanceof cr||$t("Can only add Shapes to a Grid Panel, not: "+y),this.na!==En.Graduated||y instanceof cr||y instanceof To||$t("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+y),y.wi(this),y.Ng=null,this.itemArray!==null){var E=y.data;E!==null&&typeof E=="object"&&(this.ge===null&&(this.ge=new Ie),this.ge.add(E,y))}var b=this.O;if(E=-1,x===this){for(var z=-1,tt=this.O.s,rt=tt.length,ot=0;ot<rt;ot++)if(tt[ot]===y){z=ot;break}if(z!==-1){if(z===a||z+1>=b.count&&a>=b.count)return;b.mb(z),E=z}else $t("element "+y.toString()+" has panel "+x.toString()+" but is not contained by it.")}(0>a||a>b.count)&&(a=b.count),b.Gb(a,y),(a===0||y.isPanelMain)&&(this.$g=null),sl(this)||this.v(),y.v(!1),y.portId!==null?this.Te=!0:y instanceof En&&y.Te===!0&&(this.Te=!0),this.graduatedIntervals=null,this.If()||Mm(this,y,!1),x=this.part,x!==null&&(x.Rh=null,x.ag=NaN,this.Te&&x instanceof qn&&(x.Te=!0),x.Te&&x instanceof qn&&(x.wc=null),b=this.diagram,b!==null&&b.undoManager.isUndoingRedoing||(E!==-1&&x.cb(Mo,"elements",this,y,null,E,null),x.cb(fo,"elements",this,null,y,null,a)))};function Sv(a,y){a.l=y?a.l|16777216:a.l&-16777217}wt.remove=function(a){for(var y=this.O.s,x=y.length,E=-1,b=0;b<x;b++)if(y[b]===a){E=b;break}E!==-1&&this.pc(E,!0)},wt.mb=function(a){0<=a&&this.pc(a,!0)},wt.pc=function(a,y){var x=this.O,E=x.M(a);if(E.Ng=null,E.wi(null),this.ge!==null){var b=E.data;typeof b=="object"&&this.ge.remove(b)}x.mb(a),ma(this,!1),this.v(),this.$g===E&&(this.$g=null),this.graduatedIntervals=null;var z=this.part;z!==null&&(z.Rh=null,z.ag=NaN,z.Wb(),z instanceof qn&&(E instanceof En?E.qm(E,function(tt,rt){Gv(z,rt,y)}):Gv(z,E,y)),x=this.diagram,x!==null&&x.undoManager.isUndoingRedoing||z.cb(Mo,"elements",this,E,null,a,null))},wt.Fb=function(a){0>a&&wn(a,">= 0",En,"getRowDefinition:idx"),a=Math.round(a);var y=this.rowDefs;if(y[a]===void 0){var x=new va;x.wi(this),x.isRow=!0,x.index=a,y[a]=x,this.cb(fo,"rowdefs",this,null,x,null,a)}return y[a]},wt.oA=function(a){if(0>a&&wn(a,">= 0",En,"removeRowDefinition:idx"),this.rowCount!==0){a=Math.round(a);var y=this.rowDefs,x=y[a];if(x){y[a]=void 0;for(var E=y.length-1;0<=E&&y[E--]===void 0;)y.length--;this.cb(Mo,"rowdefs",this,x,null,a,null),this.v()}}};function h1(a,y,x){var E=a.rowDefs;if(!(0>y)){if(E[y]=x instanceof va?x:void 0,!x)for(y=E.length-1;0<=y&&E[y--]===void 0;)E.length--;a.v()}}wt.Eb=function(a){0>a&&wn(a,">= 0",En,"getColumnDefinition:idx"),a=Math.round(a);var y=this.colDefs;if(y[a]===void 0){var x=new va;x.wi(this),x.isRow=!1,x.index=a,y[a]=x,this.cb(fo,"coldefs",this,null,x,null,a)}return y[a]},wt.jA=function(a){if(0>a&&wn(a,">= 0",En,"removeColumnDefinition:idx"),this.columnCount!==0){a=Math.round(a);var y=this.colDefs,x=y[a];if(x){y[a]=void 0;for(var E=y.length-1;0<=E&&y[E--]===void 0;)y.length--;this.cb(Mo,"coldefs",this,x,null,a,null),this.v()}}};function d1(a,y,x){var E=a.colDefs;if(!(0>y)){if(E[y]=x instanceof va?x:void 0,!x)for(y=E.length-1;0<=y&&E[y--]===void 0;)E.length--;a.v()}}wt.Gy=function(a){var y=null;return a.isRow?y=this.Fb(a.index):a.isRow||(y=this.Eb(a.index)),y&&km(y,a),this},wt.Hy=function(a,y){return(a=this.Fb(a))&&km(a,new va(y)),this},wt.By=function(a,y){return(a=this.Eb(a))&&km(a,new va(y)),this},wt.nz=function(a){if(0>a||this.type!==En.Table||this.rowCount===0)return-1;for(var y=0,x=this.rowDefs,E=x.length,b=this.topIndex;b<E;b++){var z=x[b];if(z!==void 0&&(y+=z.total,a<y))break}return b},wt.fz=function(a){if(0>a||this.type!==En.Table||this.columnCount===0)return-1;for(var y=0,x=this.colDefs,E=x.length,b=this.leftIndex;b<E;b++){var z=x[b];if(z!==void 0&&(y+=z.total,a<y))break}return b},wt.Fz=function(a,y){if(y===void 0&&(y=new At(NaN,NaN)),this.type!==En.Graduated)return y.h(NaN,NaN),y;a=Math.min(Math.max(a,this.graduatedMin),this.graduatedMax);var x=this.Pb();return x.geometry.Pu((a-this.graduatedMin)/this.graduatedRange,y),x.transform.Ga(y)},wt.Gz=function(a){if(this.type!==En.Graduated)return NaN;var y=this.Pb();return y.transform.Cd(a),y.geometry.xx(a)*this.graduatedRange+this.graduatedMin};function c1(a){return a=a.allBindings,a!==null&&a._isFrozen}function Ol(a){var y=a.allBindings;if(y===null)a.data!==null&&$t("Template cannot have .data be non-null: "+a),a.allBindings=y=new fn;else if(y._isFrozen)return;var x=new fn;Sv(a,!1),a.qm(a,function(lt,ut){ut.th();var ft=ut.localBindings;if(ft!==null)for(_c(ut,!1),ft=ft.iterator;ft.next();){var yt=ft.value;yt.mode===Sp&&_c(ut,!0);var xt=yt.sourceName;xt!==null&&(xt==="/"&&Sv(lt,!0),xt=FS(yt,lt,ut),xt!==null&&(x.add(xt),xt.srcBindings===null&&(xt.srcBindings=new fn),xt.srcBindings.add(yt))),y.add(yt)}if(ut instanceof En&&ut.type===En.Table){if(0<ut.rowCount){for(lt=ut.rowDefs,ft=lt.length,yt=0;yt<ft;yt++)if(xt=lt[yt],xt!==void 0&&xt.be!==null)for(var Ct=xt.be.iterator;Ct.next();){var bt=Ct.value;bt.xd=xt,bt.to=2,bt.wl=xt.index,y.add(bt)}}if(0<ut.columnCount){for(ut=ut.colDefs,lt=ut.length,ft=0;ft<lt;ft++)if(yt=ut[ft],yt!==void 0&&yt.be!==null)for(xt=yt.be.iterator;xt.next();)Ct=xt.value,Ct.xd=yt,Ct.to=1,Ct.wl=yt.index,y.add(Ct)}}});for(var E=x.iterator;E.next();){var b=E.value;if(b.srcBindings!==null){_c(b,!0);for(var z=b.srcBindings.iterator;z.next();){var tt=z.value;b.localBindings===null&&(b.localBindings=new fn),b.localBindings.add(tt)}}b.srcBindings=null}for(E=y.iterator;E.next();)if(b=E.value,z=b.xd,z!==null){b.xd=null;var rt=b.targetProperty,ot=rt.indexOf(".");0<ot&&z instanceof En&&(tt=rt.substring(0,ot),rt=rt.substr(ot+1),ot=z.fb(tt),ot!==null?(z=ot,b.targetProperty=rt):ri('Warning: unable to find GraphObject named "'+tt+'" for Binding: '+b.toString())),z instanceof va?(tt=Ai(z.panel),b.Ai=tt===void 0?-1:tt,z.panel.bindingId=b.Ai):z instanceof de?(tt=Ai(z),b.Ai=tt===void 0?-1:tt,z.bindingId=b.Ai):$t("Unknown type of binding target: "+z)}y.freeze(),a instanceof Ni&&a.Zc()&&a.Va()}wt.Uy=function(a){a===void 0&&(a=!1);var y=this.copy();return vx(y,function(x){x instanceof En&&(x.allBindings=null,x.ub=null);var E=x.localBindings;E!==null&&(x.localBindings=null,E.each(function(b){x.bind(b.copy())})),E=x.animationTriggers,E!==null&&(x.animationTriggers=null,E.each(function(b){x.Jv(b.value.copy())}))}),a&&Ol(y),y},wt.La=function(a){var y=this.allBindings;if(y!==null)for(a===void 0&&(a=""),y=y.iterator;y.next();){var x=y.value,E=x.sourceProperty;if((a===""||E===""||E===a)&&(E=x.targetProperty,x.converter!==null||E!=="")){E=this.data;var b=x.sourceName;if(b!==null){if(b==="")E=this;else if(b==="/")E=this;else if(b===".")E=this;else if(b==="..")E=this;else if(E=this.fb(b),E===null)continue}else if(x.isToModel)if(E=this.diagram,E!==null)E=E.model.modelData;else continue;var z=this,tt=x.Ai;if(tt!==-1){if(z=this.ks(tt),z===null)continue}else x.xd!==null&&(z=x.xd);if(b==="/"?E=z.part:b==="."?E=z:b===".."&&(E=z.panel),b=x.to,b!==0){if(!(z instanceof En))continue;b===1?z=z.Eb(x.wl):b===2&&(z=z.Fb(x.wl))}z!==void 0&&x.Mv(z,E)}}},wt.sx=function(a){return a==null||this.ge===null?null:this.ge.I(a)};function yx(a,y){a=a.O.s;for(var x=a.length,E=y.length,b=0,z=null;b<x&&(z=a[b],!(z instanceof En&&z.data!==null));)b++,z=a[b];if(x-b!==E)return!0;if(z===null)return 0<E;for(var tt=0;b<x&&tt<E;){if(z=a[b],!(z instanceof En)||z.data!==y[tt])return!0;b++,tt++}return!1}function Qg(a){if(a.type===En.Spot||a.type===En.Auto)return Math.min(a.O.length,1);if(a.type===En.Link){a=a.O;for(var y=a.length,x=0;x<y;x++){var E=a.M(x);if(!(E instanceof cr&&E.isPanelMain))break}return x}return a.type===En.Table&&0<a.O.length&&(a=a.O.M(0),a.isPanelMain&&a instanceof En&&Oh(a))?1:0}wt.mv=function(){for(var a=Qg(this);this.O.length>a;)this.pc(this.O.length-1,!1);f1(this,this.itemArray)};function f1(a,y){var x=Qg(a);if(y===null||y.length===0)for(;a.O.length>x;)a.pc(a.O.length-1,!1);else if(a.O.length<=x){x=y.length;for(var E=0;E<x;E++)Fm(a,y[E],E,!0)}else{E=x;for(var b=0;b<y.length;b++,E++){var z=y[b],tt=E<a.O.length?a.O.M(E):null;if(tt instanceof En){if(tt.data!==z){var rt=Pv(a,tt.data),ot=Pv(a,z),lt=ot!==rt;lt||(rt=wv(a,rt),lt=wv(a,ot)!==rt),lt?(a.pc(E,!1),Fm(a,z,b,!1)):tt.data=z}}else Fm(a,z,b,!1)}for(;E<a.O.length;)a.pc(E,!1);a.$g=null,xv(a,x,0),sl(a)||a.v(),a.graduatedIntervals=null,a.If()||Mm(a,a,!1),y=a.part,y!==null&&(y.Rh=null,y.ag=NaN,a.Te&&y instanceof qn&&(y.Te=!0),y.Te&&y instanceof qn&&(y.wc=null))}}function Fm(a,y,x,E){if(!(y==null||0>x)){var b=Pv(a,y);if(b=wv(a,b),b!==null){if(Ol(b),b=b.copy(),b.l&16777216){var z=a.ih();z!==null&&Sv(z,!0)}typeof y=="object"&&(a.ge===null&&(a.ge=new Ie),a.ge.add(y,b)),z=x+Qg(a),a.Gb(z,b),E&&(b.ub=y,xv(a,z,x),b.ub=null),b.data=y}}}function xv(a,y,x){for(a=a.O;y<a.length;){var E=a.M(y);if(E instanceof En){var b=y,z=x;E.type===En.TableRow?E.row=b:E.type===En.TableColumn&&(E.column=b),E.itemIndex=z}y++,x++}}function Pv(a,y){if(y===null)return"";if(a=a.itemCategoryProperty,typeof a=="function")a=a(y);else if(typeof a=="string"&&typeof y=="object"){if(a==="")return"";a=sa(y,a)}else return"";if(a===void 0)return"";if(typeof a=="string")return a;$t("Panel.getCategoryForItemData found a non-string category for "+y+": "+a)}function wv(a,y){var x=a.itemTemplateMap,E=null;return x!==null&&(E=x.I(y)),E===null&&(x!==null&&(E=x.I("")),E===null&&(g1||(g1=!0,ri('No item template Panel found for category "'+y+'" on '+a),ri(" Using default item template."),a=new En,y=new To,y.bind(new ua("text","",Bi)),a.add(y),p1=a),E=p1)),E}function Mm(a,y,x){var E=y.enabledChanged;if(E!==null&&E(y,x),y instanceof En){y=y.O.s,E=y.length;for(var b=0;b<E;b++){var z=y[b];x&&z instanceof En&&!z.isEnabled||Mm(a,z,x)}}}function bu(a,y){y.name=a,Jl.add(a,y)}ve.Object.defineProperties(En.prototype,{type:{get:function(){return this.na},set:function(a){var y=this.na;y!==a&&(this.na=a,this.isAtomic=this.na===En.Grid,this.v(),this.g("type",y,a))}},elements:{get:function(){return this.O.iterator}},naturalBounds:{get:function(){return this.dc}},padding:{get:function(){return this.yb},set:function(a){typeof a=="number"?(0>a&&wn(a,">= 0",En,"padding"),a=new ir(a)):(0>a.left&&wn(a.left,">= 0",En,"padding:value.left"),0>a.right&&wn(a.right,">= 0",En,"padding:value.right"),0>a.top&&wn(a.top,">= 0",En,"padding:value.top"),0>a.bottom&&wn(a.bottom,">= 0",En,"padding:value.bottom"));var y=this.yb;y.D(a)||(this.yb=a=a.J(),this.v(),this.g("padding",y,a))}},defaultAlignment:{get:function(){return this.Tm},set:function(a){var y=this.Tm;y.D(a)||(this.Tm=a=a.J(),this.v(),this.g("defaultAlignment",y,a))}},defaultStretch:{get:function(){return this.Uf},set:function(a){var y=this.Uf;y!==a&&(this.Uf=a,this.v(),this.g("defaultStretch",y,a))}},defaultSeparatorPadding:{get:function(){return this.T!==null?this.T.Qp:ca},set:function(a){typeof a=="number"&&(a=new ir(a));var y=this.defaultSeparatorPadding;y.D(a)||(a=a.J(),this.T===null&&(this.T=new xl),this.T.Qp=a,this.v(),this.g("defaultSeparatorPadding",y,a))}},defaultRowSeparatorStroke:{get:function(){return this.T!==null?this.T.ia:null},set:function(a){var y=this.defaultRowSeparatorStroke;y!==a&&(a===null||typeof a=="string"||a instanceof mo)&&(a instanceof mo&&a.freeze(),this.T===null&&(this.T=new xl),this.T.ia=a,this.N(),this.g("defaultRowSeparatorStroke",y,a))}},defaultRowSeparatorStrokeWidth:{get:function(){return this.T!==null?this.T.Ha:1},set:function(a){var y=this.defaultRowSeparatorStrokeWidth;y!==a&&isFinite(a)&&0<=a&&(this.T===null&&(this.T=new xl),this.T.Ha=a,this.v(),this.g("defaultRowSeparatorStrokeWidth",y,a))}},defaultRowSeparatorDashArray:{get:function(){return this.T!==null?this.T.V:null},set:function(a){var y=this.defaultRowSeparatorDashArray;if(y!==a){if(a!==null){for(var x=a.length,E=0,b=0;b<x;b++){var z=a[b];typeof z=="number"&&0<=z&&isFinite(z)||$t("defaultRowSeparatorDashArray value "+z+" at index "+b+" must be a positive number or zero."),E+=z}if(E===0){if(y===null)return;a=null}}this.T===null&&(this.T=new xl),this.T.V=a,this.N(),this.g("defaultRowSeparatorDashArray",y,a)}}},defaultColumnSeparatorStroke:{get:function(){return this.T!==null?this.T.u:null},set:function(a){var y=this.defaultColumnSeparatorStroke;y!==a&&(a===null||typeof a=="string"||a instanceof mo)&&(a instanceof mo&&a.freeze(),this.T===null&&(this.T=new xl),this.T.u=a,this.N(),this.g("defaultColumnSeparatorStroke",y,a))}},defaultColumnSeparatorStrokeWidth:{get:function(){return this.T!==null?this.T.F:1},set:function(a){var y=this.defaultColumnSeparatorStrokeWidth;y!==a&&isFinite(a)&&0<=a&&(this.T===null&&(this.T=new xl),this.T.F=a,this.v(),this.g("defaultColumnSeparatorStrokeWidth",y,a))}},defaultColumnSeparatorDashArray:{get:function(){return this.T!==null?this.T.o:null},set:function(a){var y=this.defaultColumnSeparatorDashArray;if(y!==a){if(a!==null){for(var x=a.length,E=0,b=0;b<x;b++){var z=a[b];typeof z=="number"&&0<=z&&isFinite(z)||$t("defaultColumnSeparatorDashArray value "+z+" at index "+b+" must be a positive number or zero."),E+=z}if(E===0){if(y===null)return;a=null}}this.T===null&&(this.T=new xl),this.T.o=a,this.N(),this.g("defaultColumnSeparatorDashArray",y,a)}}},inRowsCols:{get:function(){return this.T!==null?this.T.nb:null},set:function(a){this.T===null&&(this.T=new xl),this.T.nb=a}},viewboxStretch:{get:function(){return this.xo},set:function(a){var y=this.xo;y!==a&&(this.xo=a,this.v(),this.g("viewboxStretch",y,a))}},gridCellSize:{get:function(){return this.jn},set:function(a){var y=this.jn;if(!y.D(a)){a.w()&&a.width!==0&&a.height!==0||$t("Invalid Panel.gridCellSize: "+a),this.jn=a.J();var x=this.diagram;x!==null&&this===x.grid&&Fu(x),this.N(),this.g("gridCellSize",y,a)}}},gridOrigin:{get:function(){return this.kn},set:function(a){var y=this.kn;if(!y.D(a)){a.w()||$t("Invalid Panel.gridOrigin: "+a),this.kn=a.J();var x=this.diagram;x!==null&&this===x.grid&&Fu(x),this.N(),this.g("gridOrigin",y,a)}}},graduatedMin:{get:function(){return this.ra!==null?this.ra.lq:0},set:function(a){var y=this.graduatedMin;y!==a&&(this.ra===null&&(this.ra=new fh),this.ra.lq=a,this.v(),this.g("graduatedMin",y,a),Ya(this)&&(a=this.part,a!==null&&Go(this,a,"graduatedRange")))}},graduatedMax:{get:function(){return this.ra!==null?this.ra.F:100},set:function(a){var y=this.graduatedMax;y!==a&&(this.ra===null&&(this.ra=new fh),this.ra.F=a,this.v(),this.g("graduatedMax",y,a),Ya(this)&&(a=this.part,a!==null&&Go(this,a,"graduatedRange")))}},graduatedRange:{get:function(){return this.graduatedMax-this.graduatedMin}},graduatedTickUnit:{get:function(){return this.ra!==null?this.ra.ia:10},set:function(a){var y=this.graduatedTickUnit;y!==a&&0<a&&(this.ra===null&&(this.ra=new fh),this.ra.ia=a,this.v(),this.g("graduatedTickUnit",y,a))}},graduatedTickBase:{get:function(){return this.ra!==null?this.ra.V:0},set:function(a){var y=this.graduatedTickBase;y!==a&&(this.ra===null&&(this.ra=new fh),this.ra.V=a,this.v(),this.g("graduatedTickBase",y,a))}},graduatedMarks:{get:function(){return this.ra!==null?this.ra.u:null},set:function(a){this.ra!==null?this.ra.u=a:a!==null&&(this.ra=new fh,this.ra.u=a)}},graduatedBounds:{get:function(){return this.ra!==null?this.ra.j:null},set:function(a){this.ra!==null?this.ra.j=a:a!==null&&(this.ra=new fh,this.ra.j=a)}},graduatedIntervals:{get:function(){return this.ra!==null?this.ra.o:null},set:function(a){this.ra!==null?this.ra.o=a:a!==null&&(this.ra=new fh,this.ra.o=a)}},temporaryTextBlock:{get:function(){return this.ra!==null?this.ra.Zh:null},set:function(a){this.ra!==null?this.ra.Zh=a:a!==null&&(this.ra=new fh,this.ra.Zh=a)}},panelLayoutState:{get:function(){return this.F},set:function(a){this.F=a}},Te:{get:function(){return(this.l&8388608)!==0},set:function(a){(this.l&8388608)!==0!==a&&(this.l^=8388608)}},rowDefs:{get:function(){return this.T===null&&(this.T=new xl),this.T.Pc}},rowCount:{get:function(){return this.T===null?0:this.rowDefs.length}},colDefs:{get:function(){return this.T===null&&(this.T=new xl),this.T.Oc}},columnCount:{get:function(){return this.T===null?0:this.colDefs.length}},rowSizing:{get:function(){return this.T!==null?this.T.ob:Nm},set:function(a){var y=this.rowSizing;y!==a&&(this.T===null&&(this.T=new xl),this.T.ob=a,this.v(),this.g("rowSizing",y,a))}},columnSizing:{get:function(){return this.T!==null?this.T.j:Nm},set:function(a){var y=this.columnSizing;y!==a&&(this.T===null&&(this.T=new xl),this.T.j=a,this.v(),this.g("columnSizing",y,a))}},topIndex:{get:function(){return this.T!==null?this.T.Hb:0},set:function(a){var y=this.topIndex;y!==a&&((!isFinite(a)||0>a)&&$t("Panel.topIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new xl),this.T.Hb=a,this.v(),this.g("topIndex",y,a))}},leftIndex:{get:function(){return this.T!==null?this.T.hb:0},set:function(a){var y=this.leftIndex;y!==a&&((!isFinite(a)||0>a)&&$t("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new xl),this.T.hb=a,this.v(),this.g("leftIndex",y,a))}},data:{get:function(){return this.ub},set:function(a){var y=this.ub;if(y!==a){var x=this instanceof Ni&&!(this instanceof Yr);Ol(this),this.ub=a;var E=this.diagram;E!==null&&(x?(x=E.partManager,this instanceof Tn?(y!==null&&x.bf.remove(y),a!==null&&x.bf.add(a,this)):this instanceof Ni&&(y!==null&&x.cf.remove(y),a!==null&&x.cf.add(a,this))):(x=this.panel,x!==null&&x.ge!==null&&(y!==null&&x.ge.remove(y),a!==null&&x.ge.add(a,this)))),this.g("data",y,a),E!==null&&E.undoManager.isUndoingRedoing||a!==null&&this.La()}}},itemIndex:{get:function(){return this.zn},set:function(a){var y=this.zn;y!==a&&(this.zn=a,this.g("itemIndex",y,a))}},allBindings:{get:function(){return this.A!==null?this.A.nb:null},set:function(a){this.localBindings!==a&&(this.A===null&&(this.A=new Rc),this.A.nb=a)}},itemArray:{get:function(){return this.Hh},set:function(a){var y=this.Hh;if(y!==a||a!==null&&yx(this,a)){var x=this.diagram;y!==a&&(x!==null&&y!==null&&ly(x.partManager,this,x),this.Hh=a,x!==null&&a!==null&&sy(x.partManager,this)),this.g("itemArray",y,a),x!==null&&x.undoManager.isUndoingRedoing||f1(this,a)}}},itemTemplate:{get:function(){return this.itemTemplateMap===null?null:this.itemTemplateMap.I("")},set:function(a){if(this.itemTemplateMap===null){if(a===null)return;this.itemTemplateMap=new Ie}var y=this.itemTemplateMap.I("");y!==a&&((a instanceof Ni||a.isPanelMain)&&$t("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+a),this.itemTemplateMap.add("",a),this.g("itemTemplate",y,a),a=this.diagram,a!==null&&a.undoManager.isUndoingRedoing||this.mv())}},itemTemplateMap:{get:function(){return this.A!==null?this.A.Pc:null},set:function(a){var y=this.itemTemplateMap;if(y!==a){for(var x=a.iterator;x.next(););mr(this),this.A.Pc=a,this.g("itemTemplateMap",y,a),a=this.diagram,a!==null&&a.undoManager.isUndoingRedoing||this.mv()}}},itemCategoryProperty:{get:function(){return this.A!==null?this.A.Oc:"category"},set:function(a){var y=this.itemCategoryProperty;y!==a&&(mr(this),this.A.Oc=a,this.g("itemCategoryProperty",y,a))}},isAtomic:{get:function(){return(this.l&1048576)!==0},set:function(a){var y=(this.l&1048576)!==0;y!==a&&(this.l^=1048576,this.g("isAtomic",y,a))}},isClipping:{get:function(){return(this.l&2097152)!==0},set:function(a){var y=(this.l&2097152)!==0;y!==a&&(this.l^=2097152,this instanceof or&&(this.tb=null),this.v(),this.g("isClipping",y,a))}},isOpposite:{get:function(){return(this.l&33554432)!==0},set:function(a){var y=(this.l&33554432)!==0;y!==a&&(this.l^=33554432,this.v(),this.g("isOpposite",y,a))}},isEnabled:{get:function(){return(this.l&4194304)!==0},set:function(a){var y=(this.l&4194304)!==0;if(y!==a){var x=this.panel===null||this.panel.If();this.l^=4194304,this.g("isEnabled",y,a),y=this.diagram,y!==null&&y.undoManager.isUndoingRedoing||x&&Mm(this,this,a)}}},alignmentFocusName:{get:function(){return this.$e},set:function(a){var y=this.$e;y!==a&&(this.$e=a,this.v(),this.g("alignmentFocusName",y,a))}}}),ve.Object.defineProperties(En,{Position:{get:function(){return Jl.I("Position")}},Horizontal:{get:function(){return Jl.I("Horizontal")}},Vertical:{get:function(){return Jl.I("Vertical")}},Spot:{get:function(){return Jl.I("Spot")}},Auto:{get:function(){return Jl.I("Auto")}},Table:{get:function(){return Jl.I("Table")}},Viewbox:{get:function(){return Jl.I("Viewbox")}},TableRow:{get:function(){return Jl.I("TableRow")}},TableColumn:{get:function(){return Jl.I("TableColumn")}},Link:{get:function(){return Jl.I("Link")}},Grid:{get:function(){return Jl.I("Grid")}},Graduated:{get:function(){return Jl.I("Graduated")}}}),En.prototype.rebuildItemElements=En.prototype.mv,En.prototype.findItemPanelForData=En.prototype.sx,En.prototype.updateTargetBindings=En.prototype.La,En.prototype.copyTemplate=En.prototype.Uy,En.prototype.graduatedValueForPoint=En.prototype.Gz,En.prototype.graduatedPointForValue=En.prototype.Fz,En.prototype.findColumnForLocalX=En.prototype.fz,En.prototype.findRowForLocalY=En.prototype.nz,En.prototype.addColumnDefinition=En.prototype.By,En.prototype.addRowDefinition=En.prototype.Hy,En.prototype.addRowColumnDefinition=En.prototype.Gy,En.prototype.removeColumnDefinition=En.prototype.jA,En.prototype.getColumnDefinition=En.prototype.Eb,En.prototype.removeRowDefinition=En.prototype.oA,En.prototype.getRowDefinition=En.prototype.Fb,En.prototype.removeAt=En.prototype.mb,En.prototype.remove=En.prototype.remove,En.prototype.insertAt=En.prototype.Gb,En.prototype.elt=En.prototype.M,En.prototype.add=En.prototype.add,En.prototype.findObject=En.prototype.fb,En.prototype.findInVisualTree=En.prototype.Nl,En.prototype.walkVisualTreeFrom=En.prototype.qm,En.prototype.findMainElement=En.prototype.Pb;var g1=!1,p1=null,Jl=new Ie;En.className="Panel",En.definePanelLayout=bu,bu("Position",new gm),bu("Vertical",new mm),bu("Auto",new ym),bu("Link",new Em);function fh(){this.lq=0,this.F=100,this.ia=10,this.V=0,this.Zh=this.o=this.j=this.u=null}fh.prototype.copy=function(){var a=new fh;return a.lq=this.lq,a.F=this.F,a.ia=this.ia,a.V=this.V,a.u=this.u,a.j=this.j,a.o=this.o,a.Zh=this.Zh,a},fh.className="GradPanelSettings";function xl(){this.Pc=[],this.Oc=[],this.j=this.ob=Nm,this.hb=this.Hb=0,this.Qp=ca,this.Ha=1,this.V=this.ia=null,this.F=1,this.nb=this.o=this.u=null}xl.prototype.copy=function(a){for(var y=new xl,x=this.Pc,E=x.length,b=y.Pc,z=0;z<E;z++)if(x[z]!==void 0){var tt=x[z].copy();tt.wi(a),b[z]=tt}for(x=this.Oc,E=x.length,b=y.Oc,z=0;z<E;z++)x[z]!==void 0&&(tt=x[z].copy(),tt.wi(a),b[z]=tt);return y.ob=this.ob,y.j=this.j,y.Hb=this.Hb,y.hb=this.hb,y.Qp=this.Qp.J(),y.Ha=this.Ha,y.ia=this.ia,y.V=this.V,y.F=this.F,y.u=this.u,y.o=this.o,y.nb=this.nb,y},xl.className="TablePanelSettings";function va(a){Di(this),this.Me=null,this.uq=!0,this.Za=0,this.Hc=NaN,this.jj=0,this.hj=1/0,this.Jb=xa,this.pa=this.oc=this.oa=0,this.be=null,this.oo=Cv,this.hg=lr,this.lo=this.dg=null,this.mo=NaN,this.Ma=this.tj=null,this.Pm=!1,a&&(Object.assign(this,a),a.column!==void 0?(this.isRow=!1,this.index=a.column):a.row!==void 0&&(this.isRow=!0,this.index=a.row))}va.prototype.copy=function(){var a=new va;return a.uq=this.uq,a.Za=this.Za,a.Hc=this.Hc,a.jj=this.jj,a.hj=this.hj,a.Jb=this.Jb,a.oa=this.oa,a.oc=this.oc,a.pa=this.pa,a.hg=this.hg,a.oo=this.oo,this.dg===null?a.dg=null:a.dg=this.dg.J(),a.lo=this.lo,a.mo=this.mo,a.tj=null,this.tj!==null&&(a.separatorDashArray=Vn(this.separatorDashArray)),a.Ma=this.Ma,a.Pm=this.Pm,a.be=this.be,a};function km(a,y){y.isRow?a.height=y.height:a.width=y.width,a.minimum=y.minimum,a.maximum=y.maximum,a.alignment=y.alignment,a.stretch=y.stretch,a.sizing=y.sizing,a.dg=y.separatorPadding===null?null:y.separatorPadding.J(),a.separatorStroke=y.separatorStroke,a.separatorStrokeWidth=y.separatorStrokeWidth,a.tj=null,y.separatorDashArray&&(a.tj=Vn(y.separatorDashArray)),a.background=y.background,a.coversSeparators=y.coversSeparators,a.be=y.be}wt=va.prototype,wt.qb=function(a){a.classType===va&&(this.sizing=a)},wt.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+Ai(this)},wt.wi=function(a){this.Me=a},wt.Io=function(a){var y=0,x=this.Me;if(this.index!==a&&(a=this.separatorStroke,a===null&&x!==null&&(a=this.isRow?x.defaultRowSeparatorStroke:x.defaultColumnSeparatorStroke),a!==null&&(y=this.separatorStrokeWidth,isNaN(y)&&(x!==null?y=this.isRow?x.defaultRowSeparatorStrokeWidth:x.defaultColumnSeparatorStrokeWidth:y=0))),a=this.dg,a===null)if(x!==null)a=x.defaultSeparatorPadding;else return y;return y+(this.isRow?a.top:a.left)},wt.Wc=function(){var a=0,y=this.Me,x=0,E=this.isRow;if(y!==null&&y.type===En.Table)for(var b=E?y.rowDefs.length:y.colDefs.length,z=0;z<b;z++){var tt=E?y.rowDefs[z]:y.colDefs[z];if(tt!==void 0&&tt.oa!==0){x=tt.index;break}}if(this.index!==x&&(x=this.separatorStroke,x===null&&y!==null&&(x=E?y.defaultRowSeparatorStroke:y.defaultColumnSeparatorStroke),x!==null&&(a=this.separatorStrokeWidth,isNaN(a)&&(y!==null?a=E?y.defaultRowSeparatorStrokeWidth:y.defaultColumnSeparatorStrokeWidth:a=0))),E=this.dg,E===null)if(y!==null)E=y.defaultSeparatorPadding;else return a;return a+(this.isRow?E.top+E.bottom:E.left+E.right)},wt.Ob=function(a,y,x){var E=this.Me;if(E!==null&&(E.cb(Ir,a,this,y,x,void 0,void 0),this.be!==null&&(y=E.diagram,y!==null&&!y.skipsModelSourceBindings&&(E=E.ih(),E!==null&&(y=E.data,y!==null)))))for(x=this.be.iterator;x.next();)x.value.sp(this,y,a,E)};function bm(a){if(a.sizing===Cv){var y=a.Me;return a.isRow?y.rowSizing:y.columnSizing}return a.sizing}wt.bind=function(a,y,x,E){var b=null;return typeof a=="string"?b=new ua(a,y,x,E):b=a,b.xd=this,a=this.panel,a!==null&&(y=a.ih(),y!==null&&c1(y)&&$t("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+b+" on "+a)),this.be===null&&(this.be=new fn),this.be.add(b),this},ve.Object.defineProperties(va.prototype,{panel:{get:function(){return this.Me}},isRow:{get:function(){return this.uq},set:function(a){this.uq=a}},index:{get:function(){return this.Za},set:function(a){this.Za=a}},height:{get:function(){return this.Hc},set:function(a){var y=this.Hc;y!==a&&(0>a&&wn(a,">= 0",va,"height"),this.Hc=a,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("height",y,a))}},width:{get:function(){return this.Hc},set:function(a){var y=this.Hc;y!==a&&(0>a&&wn(a,">= 0",va,"width"),this.Hc=a,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("width",y,a))}},minimum:{get:function(){return this.jj},set:function(a){var y=this.jj;y!==a&&((0>a||!isFinite(a))&&wn(a,">= 0",va,"minimum"),this.jj=a,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("minimum",y,a))}},maximum:{get:function(){return this.hj},set:function(a){var y=this.hj;y!==a&&(0>a&&wn(a,">= 0",va,"maximum"),this.hj=a,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("maximum",y,a))}},alignment:{get:function(){return this.Jb},set:function(a){var y=this.Jb;y.D(a)||(this.Jb=a.J(),this.panel!==null&&this.panel.v(),this.Ob("alignment",y,a))}},stretch:{get:function(){return this.hg},set:function(a){var y=this.hg;y!==a&&(this.hg=a,this.panel!==null&&this.panel.v(),this.Ob("stretch",y,a))}},separatorPadding:{get:function(){return this.dg},set:function(a){typeof a=="number"&&(a=new ir(a));var y=this.dg;a!==null&&y!==null&&y.D(a)||(a!==null&&(a=a.J()),this.dg=a,this.panel!==null&&this.panel.v(),this.Ob("separatorPadding",y,a))}},separatorStroke:{get:function(){return this.lo},set:function(a){var y=this.lo;y!==a&&(a!==null&&zc(a,"RowColumnDefinition.separatorStroke"),a instanceof mo&&a.freeze(),this.lo=a,this.panel!==null&&this.panel.v(),this.Ob("separatorStroke",y,a))}},separatorStrokeWidth:{get:function(){return this.mo},set:function(a){var y=this.mo;y!==a&&(this.mo=a,this.panel!==null&&this.panel.v(),this.Ob("separatorStrokeWidth",y,a))}},separatorDashArray:{get:function(){return this.tj},set:function(a){var y=this.tj;if(y!==a){if(a!==null){for(var x=a.length,E=0,b=0;b<x;b++){var z=a[b];typeof z=="number"&&0<=z&&isFinite(z)||$t("separatorDashArray value "+z+" at index "+b+" must be a positive number or zero."),E+=z}if(E===0){if(y===null)return;a=null}}this.tj=a,this.panel!==null&&this.panel.N(),this.Ob("separatorDashArray",y,a)}}},background:{get:function(){return this.Ma},set:function(a){var y=this.Ma;y!==a&&(a!==null&&zc(a,"RowColumnDefinition.background"),a instanceof mo&&a.freeze(),this.Ma=a,this.panel!==null&&this.panel.N(),this.Ob("background",y,a))}},coversSeparators:{get:function(){return this.Pm},set:function(a){var y=this.Pm;y!==a&&(this.Pm=a,this.panel!==null&&this.panel.N(),this.Ob("coversSeparators",y,a))}},sizing:{get:function(){return this.oo},set:function(a){var y=this.oo;y!==a&&(this.oo=a,this.panel!==null&&this.panel.v(),this.Ob("sizing",y,a))}},actual:{get:function(){return this.oa},set:function(a){this.oa=isNaN(this.Hc)?Math.max(Math.min(this.hj,a),this.jj):Math.max(Math.min(this.hj,this.Hc),this.jj)}},measured:{get:function(){return this.oc},set:function(a){this.oc=a}},total:{get:function(){return this.oa+this.Wc()}},position:{get:function(){return this.pa},set:function(a){this.pa=a}}}),va.prototype.computeEffectiveSpacing=va.prototype.Wc,va.prototype.computeEffectiveSpacingTop=va.prototype.Io;var Cv=new He(va,"Default",0),$g=new He(va,"None",1),Nm=new He(va,"ProportionalExtra",2);va.className="RowColumnDefinition",va.Default=Cv,va.None=$g,va.ProportionalExtra=Nm;function cr(a,y){de.call(this),this.Rd=this.ua=null,this.an="None",this.xc=this.Ui="black",this.ig=1,this.Na=this.Yg=null,this.Vn=this.Un=NaN,this.fa=null,typeof a=="string"?this.figure=a:a&&Object.assign(this,a),y&&Object.assign(this,y)}Se(cr,de),cr.prototype.cloneProtected=function(a){de.prototype.cloneProtected.call(this,a),a.ua=this.ua,a.Rd=this.Rd,a.an=this.an,a.Ui=this.Ui,a.xc=this.xc,a.ig=this.ig,this.Yg!==null&&(a.Yg=Vn(this.Yg)),this.Na!==null&&(a.Na=this.Na.nc?this.Na:this.Na.copy()),a.Un=this.Un,a.Vn=this.Vn,this.fa!==null&&(a.fa=this.fa.copy())};function nc(a){a.Na===null?a.Na=new Fv:a.Na.nc&&(a.Na=a.Na.copy())}wt=cr.prototype,wt.th=function(){de.prototype.th.call(this),this.Na!==null&&(this.Na.nc=!0)},wt.qb=function(a){a===un||a===wi||a===_r||a===lr?this.geometryStretch=a:de.prototype.qb.call(this,a)},wt.toString=function(){return"Shape("+(this.figure!=="None"?this.figure:this.toArrow!=="None"?this.toArrow:this.fromArrow)+")#"+Ai(this)};function If(a,y,x,E){var b=x.length;if(!(4>b)){var z=E.measuredBounds,tt=Math.max(1,z.width);z=z.height;for(var rt=x[0],ot=x[1],lt,ut,ft,yt,xt,Ct,bt=0,Wt=pi(),jt=2;jt<b;jt+=2)lt=x[jt],ut=x[jt+1],ft=lt-rt,rt=ut-ot,ft===0&&(ft=.001),yt=rt/ft,xt=Math.atan2(rt,ft),Ct=Math.sqrt(ft*ft+rt*rt),Wt.push([ft,xt,yt,Ct]),bt+=Ct,rt=lt,ot=ut;rt=x[0],ot=x[1],ft=E.measuredBounds.width,E instanceof cr&&(ft-=E.strokeWidth),1>ft&&(ft=1),b=x=ft,lt=tt/2,ut=lt!==0,jt=0,Ct=Wt[jt],ft=Ct[0],xt=Ct[1],yt=Ct[2],Ct=Ct[3];for(var Qt=0;.1<=bt;){if(Qt===0&&(ut?(b=x,b-=lt,bt-=lt,ut=!1):b=x,b===0&&(b=1)),b>bt){oi(Wt);return}b>Ct?(Qt=b-Ct,b=Ct):Qt=0;var te=Math.sqrt(b*b/(1+yt*yt));if(0>ft&&(te=-te),rt+=te,ot+=yt*te,a.translate(rt,ot),a.rotate(xt),a.translate(-(tt/2),-(z/2)),Qt===0&&E.hh(a,y),a.translate(tt/2,z/2),a.rotate(-xt),a.translate(-rt,-ot),bt-=b,Ct-=b,Qt!==0){if(jt++,jt===Wt.length){oi(Wt);return}Ct=Wt[jt],ft=Ct[0],xt=Ct[1],yt=Ct[2],Ct=Ct[3],b=Qt}}oi(Wt)}}wt.hh=function(a,y){var x=this.xc,E=this.Ui;if(x!==null||E!==null){var b=this.ua;if(b!==null){a.yc();var z=this.actualBounds,tt=this.naturalBounds;E!==null&&na(this,a,E,!0,!1,tt,z);var rt=this.part,ot=this.ig;if(x===null||ot!==0||rt===null||!this.isPanelMain&&rt.Pb()!==this||(ot=rt.type===En.Link&&rt instanceof Yr&&rt.category==="Selection"&&rt.adornedObject instanceof cr&&rt.adornedPart.Pb()===rt.adornedObject?rt.adornedObject.strokeWidth:0),ot===0&&(x=null),x!==null&&ot!==0&&(na(this,a,x,!1,!1,tt,z),a.lineWidth=ot,a.lineJoin=this.strokeJoin,a.lineCap=this.strokeCap,a.miterLimit=this.strokeMiterLimit),z=!1,rt&&y.Gf("drawShadows")&&(z=rt.isShadowed),a.Il===!1&&(z=!1),rt=!0,x===null||E!==null&&E!=="transparent"||(rt=!1),tt=!1,ot=this.strokeDashArray,ot!==null&&(tt=!0,a.js(ot,this.strokeDashOffset)),b.type===Ye.j)a.beginPath(),a.moveTo(b.startX,b.startY),a.lineTo(b.endX,b.endY),x!==null&&a.jk(),a.Se();else if(b.type===Ye.u){var lt=b.startX;ot=b.startY;var ut=b.endX,ft=b.endY;b=Math.min(lt,ut);var yt=Math.min(ot,ft);lt=Math.abs(ut-lt),ot=Math.abs(ft-ot),a.beginPath(),a.rect(b,yt,lt,ot),E!==null&&a.ng(E),x!==null&&(rt&&z&&Hu(a),a.jk(),rt&&z&&uh(a)),a.Se()}else if(b.type===Ye.F)lt=b.startX,ot=b.startY,ut=b.endX,ft=b.endY,b=Math.abs(ut-lt)/2,yt=Math.abs(ft-ot)/2,lt=Math.min(lt,ut)+b,ot=Math.min(ot,ft)+yt,a.beginPath(),a.moveTo(lt,ot-yt),a.bezierCurveTo(lt+Zt.wg*b,ot-yt,lt+b,ot-Zt.wg*yt,lt+b,ot),a.bezierCurveTo(lt+b,ot+Zt.wg*yt,lt+Zt.wg*b,ot+yt,lt,ot+yt),a.bezierCurveTo(lt-Zt.wg*b,ot+yt,lt-b,ot+Zt.wg*yt,lt-b,ot),a.bezierCurveTo(lt-b,ot-Zt.wg*yt,lt-Zt.wg*b,ot-yt,lt,ot-yt),a.closePath(),E!==null&&a.ng(E),x!==null&&(rt&&z&&Hu(a),a.jk(),rt&&z&&uh(a)),a.Se();else if(b.type===Ye.o)for(b=b.figures,ot=b.length,yt=0;yt<ot;yt++){lt=b.s[yt],a.beginPath(),a.moveTo(lt.startX,lt.startY),ut=lt.segments.s,ft=ut.length;for(var xt=null,Ct=0;Ct<ft;Ct++){var bt=ut[Ct];switch(bt.type){case wr:a.moveTo(bt.endX,bt.endY);break;case Qi:a.lineTo(bt.endX,bt.endY);break;case ar:a.bezierCurveTo(bt.point1X,bt.point1Y,bt.point2X,bt.point2Y,bt.endX,bt.endY);break;case so:a.quadraticCurveTo(bt.point1X,bt.point1Y,bt.endX,bt.endY);break;case xr:if(bt.radiusX===bt.radiusY){var Wt=Math.PI/180;a.arc(bt.point1X,bt.point1Y,bt.radiusX,bt.startAngle*Wt,(bt.startAngle+bt.sweepAngle)*Wt,0>bt.sweepAngle,xt!==null?xt.endX:lt.startX,xt!==null?xt.endY:lt.startY)}else if(xt=Gi(bt,lt),Wt=xt.length,Wt===0)a.lineTo(bt.centerX,bt.centerY);else for(var jt=0;jt<Wt;jt++){var Qt=xt[jt];jt===0&&a.lineTo(Qt[0],Qt[1]),a.bezierCurveTo(Qt[2],Qt[3],Qt[4],Qt[5],Qt[6],Qt[7])}break;case Ji:if(jt=Wt=0,xt!==null&&xt.type===xr){if(xt=Gi(xt,lt),Qt=xt.length,Qt===0){a.lineTo(bt.endX,bt.endY);break}xt=xt[Qt-1]||null,xt!==null&&(Wt=xt[6],jt=xt[7])}else Wt=xt!==null?xt.endX:lt.startX,jt=xt!==null?xt.endY:lt.startY;if(xt=kr(bt,lt,Wt,jt),Wt=xt.length,Wt===0){a.lineTo(bt.endX,bt.endY);break}for(jt=0;jt<Wt;jt++)Qt=xt[jt],a.bezierCurveTo(Qt[2],Qt[3],Qt[4],Qt[5],Qt[6],Qt[7]);break;default:$t("Segment not of valid type: "+bt.type)}bt.isClosed&&a.closePath(),xt=bt}ut=lt.isFilled,z?lt.isShadowed?(ut===!0&&E!=="transparent"&&E!==null&&a.ng(E,lt.isEvenOdd),x!==null&&(ut&&rt&&Hu(a),a.jk(),ut&&rt&&uh(a))):(Hu(a),ut&&E!=="transparent"&&E!==null&&a.ng(E,lt.isEvenOdd),x!==null&&a.jk(),uh(a)):(ut&&E!==null&&a.ng(E,lt.isEvenOdd),x!==null&&a.jk()),a.Se(yt)}if(tt&&a.fs(),this.pathPattern!==null){if(x=this.pathPattern,x.measure(1/0,1/0),E=x.measuredBounds,x.arrange(0,0,E.width,E.height),z=this.geometry,a.save(),a.beginPath(),E=pi(),z.type===Ye.j)E.push(z.startX),E.push(z.startY),E.push(z.endX),E.push(z.endY),If(a,y,E,x);else if(z.type===Ye.o)for(z=z.figures.iterator;z.next();){for(rt=z.value,E.length=0,E.push(rt.startX),E.push(rt.startY),tt=rt.startX,b=rt.startY,ot=tt,yt=b,lt=rt.segments.s,ut=lt.length,ft=0;ft<ut;ft++){switch(Ct=lt[ft],Ct.type){case wr:If(a,y,E,x),E.length=0,E.push(Ct.endX),E.push(Ct.endY),tt=Ct.endX,b=Ct.endY,ot=tt,yt=b;break;case Qi:E.push(Ct.endX),E.push(Ct.endY),tt=Ct.endX,b=Ct.endY;break;case ar:Zt.Qe(tt,b,Ct.point1X,Ct.point1Y,Ct.point2X,Ct.point2Y,Ct.endX,Ct.endY,.5,E),tt=Ct.endX,b=Ct.endY;break;case so:Zt.ep(tt,b,Ct.point1X,Ct.point1Y,Ct.endX,Ct.endY,.5,E),tt=Ct.endX,b=Ct.endY;break;case xr:if(bt=Gi(Ct,rt),xt=bt.length,xt===0){E.push(Ct.centerX),E.push(Ct.centerY),tt=Ct.centerX,b=Ct.centerY;break}for(Wt=0;Wt<xt;Wt++)jt=bt[Wt],Zt.Qe(tt,b,jt[2],jt[3],jt[4],jt[5],jt[6],jt[7],.5,E),tt=jt[6],b=jt[7];break;case Ji:if(bt=kr(Ct,rt,tt,b),xt=bt.length,xt===0){E.push(Ct.endX),E.push(Ct.endY),tt=Ct.endX,b=Ct.endY;break}for(Wt=0;Wt<xt;Wt++)jt=bt[Wt],Zt.Qe(tt,b,jt[2],jt[3],jt[4],jt[5],jt[6],jt[7],.5,E),tt=jt[6],b=jt[7];break;default:$t("Segment not of valid type: "+Ct.type)}Ct.isClosed&&(E.push(ot),E.push(yt),If(a,y,E,x))}If(a,y,E,x)}else if(z.type===Ye.u)E.push(z.startX),E.push(z.startY),E.push(z.endX),E.push(z.startY),E.push(z.endX),E.push(z.endY),E.push(z.startX),E.push(z.endY),E.push(z.startX),E.push(z.startY),If(a,y,E,x);else if(z.type===Ye.F){if(b=new Ur,b.startX=z.endX,b.startY=(z.startY+z.endY)/2,tt=new Ri(xr),tt.startAngle=0,tt.sweepAngle=360,tt.centerX=(z.startX+z.endX)/2,tt.centerY=(z.startY+z.endY)/2,tt.radiusX=Math.abs(z.startX-z.endX)/2,tt.radiusY=Math.abs(z.startY-z.endY)/2,b.add(tt),z=Gi(tt,b),rt=z.length,rt===0)E.push(tt.centerX),E.push(tt.centerY);else for(tt=b.startX,b=b.startY,ot=0;ot<rt;ot++)yt=z[ot],Zt.Qe(tt,b,yt[2],yt[3],yt[4],yt[5],yt[6],yt[7],.5,E),tt=yt[6],b=yt[7];If(a,y,E,x)}oi(E),a.restore(),a.Vc(!1)}}}},wt.kk=function(a,y,x){return!de.prototype.kk.call(this,a,y,x)||this.xc===null&&this.Ui===null||this.ua===null||this.pathPattern!==null||this.geometry.figures.length!==this.svg.getElementsByTagName("path").length?!1:(a.Hl=this.svg,this.hh(a,y),a.Hl=null,!0)},wt.nk=function(a){return this.geometry!==null&&1<this.geometry.figures.length||this.pathPattern!==null?!0:de.prototype.nk.call(this,a)},wt.Dv=function(a,y){if(a.nodeName!=="g")a.setAttributeNS(null,"filter",y);else{a=a.getElementsByTagName("path");for(var x=0;x<a.length;x++)a[x].setAttributeNS(null,"filter",y)}},wt.ga=function(a,y){if(y===void 0&&(y=new At),a instanceof In){a.Mc()&&$t("getDocumentPoint Spot must be a real, specific Spot, not: "+a.toString());var x=this.naturalBounds,E=this.strokeWidth;y.h(a.x*(x.width+E)-E/2+x.x+a.offsetX,a.y*(x.height+E)-E/2+x.y+a.offsetY)}else y.set(a);return this.oe.Ga(y),y},wt.mi=function(a){a===void 0&&(a=new Be);var y=this.naturalBounds,x=this.oe;y=Be.allocAt(y.x,y.y,y.width,y.height);var E=this.strokeWidth;return y.Bc(E/2,E/2),E=At.allocAt(y.x,y.y).transform(x),a.h(E.x,E.y,0,0),E.h(y.right,y.y).transform(x),Jr(a,E.x,E.y,0,0),E.h(y.right,y.bottom).transform(x),Jr(a,E.x,E.y,0,0),E.h(y.x,y.bottom).transform(x),Jr(a,E.x,E.y,0,0),Be.free(y),At.free(E),a},wt.gh=function(a,y){var x=this.geometry;if(x===null||this.fill===null&&this.stroke===null)return!1;var E=x.bounds,b=this.strokeWidth/2;x.type!==Ye.j||y||(b+=2);var z=Be.alloc();if(z.assign(E),z.Bc(b+2,b+2),!z.ca(a))return Be.free(z),!1;if(E=b+1e-4,x.type===Ye.j)return this.stroke===null||(E=(x.endX-x.startX)*(a.x-x.startX)+(x.endY-x.startY)*(a.y-x.startY),0>(x.startX-x.endX)*(a.x-x.endX)+(x.startY-x.endY)*(a.y-x.endY)||0>E)?!1:(Be.free(z),Zt.Yb(x.startX,x.startY,x.endX,x.endY,b,a.x,a.y));if(x.type===Ye.u){y=x.startX;var tt=x.startY,rt=x.endX;if(x=x.endY,z.x=Math.min(y,rt),z.y=Math.min(tt,x),z.width=Math.abs(rt-y),z.height=Math.abs(x-tt),this.fill===null){if(z.Bc(-E,-E),z.ca(a))return Be.free(z),!1;z.Bc(E,E)}return this.stroke!==null&&z.Bc(b,b),a=z.ca(a),Be.free(z),a}if(x.type===Ye.F){tt=x.startX,b=x.startY,rt=x.endX;var ot=x.endY;if(x=Math.min(tt,rt),y=Math.min(b,ot),tt=Math.abs(rt-tt)/2,b=Math.abs(ot-b)/2,x=a.x-(x+tt),y=a.y-(y+b),this.fill===null){if(tt-=E,b-=E,0>=tt||0>=b||1>=x*x/(tt*tt)+y*y/(b*b))return Be.free(z),!1;tt+=E,b+=E}return this.stroke!==null&&(tt+=E,b+=E),Be.free(z),0>=tt||0>=b?!1:1>=x*x/(tt*tt)+y*y/(b*b)}if(x.type===Ye.o)return Be.free(z),this.fill===null?xo(x,a.x,a.y,b):rr(x,a,b,1<this.strokeWidth,y);$t("Unknown Geometry type: "+x.type)},wt.Wl=function(a,y,x,E){var b=this.desiredSize,z=this.ig;if(a=Math.max(a,0),y=Math.max(y,0),this.Rd!==null)var tt=this.geometry.bounds;else{var rt=this.figure,ot=Lv[rt];if(ot===void 0){var lt=Zt.Ze[rt];typeof lt=="string"&&(lt=Zt.Ze[lt]),typeof lt=="function"?(ot=lt(null,100,100),Lv[rt]=ot):$t("Unsupported Figure: "+rt)}tt=ot.bounds}rt=tt.width,ot=tt.height,lt=tt.width;var ut=tt.height;switch(Ds(this,!0)){case un:E=x=0;break;case xn:lt=Math.max(a-z,0),ut=Math.max(y-z,0);break;case Li:lt=Math.max(a-z,0),E=0;break;case ji:x=0,ut=Math.max(y-z,0)}isFinite(b.width)&&(lt=b.width),isFinite(b.height)&&(ut=b.height);var ft=this.maxSize,yt=this.minSize;switch(x=Math.max(x-z,yt.width),E=Math.max(E-z,yt.height),lt=Math.min(ft.width,lt),ut=Math.min(ft.height,ut),lt=isFinite(lt)?Math.max(x,lt):Math.max(rt,x),ut=isFinite(ut)?Math.max(E,ut):Math.max(ot,E),x=Ev(this),x){case un:break;case xn:rt=lt,ot=ut;break;case wi:x=Math.min(lt/rt,ut/ot),isFinite(x)||(x=1),rt*=x,ot*=x;break;default:$t(x+" is not a valid geometryStretch.")}this.Rd!==null?(rt===0&&(rt=.001),ot===0&&(ot=.001),x=this.Rd!==null?this.Rd:this.ua,tt=x.bounds,E=rt/tt.width,tt=ot/tt.height,isFinite(E)||(E=1),isFinite(tt)||(tt=1),this.ua=E===1&&tt===1?x:x.copy().scale(E,tt)):this.ua!==null&&Zt.$(this.ua.Sk,a-z)&&Zt.$(this.ua.Rk,y-z)||(this.ua=cr.makeGeometry(this,rt,ot)),tt=this.ua.bounds,a===1/0||y===1/0?this.Ge(tt.x-z/2,tt.y-z/2,a===0&&rt===0?0:tt.width+z,y===0&&ot===0?0:tt.height+z):this.Ge(-(z/2),-(z/2),lt+z,ut+z),b.w()?(lt=b.width,ut=b.height,lt=Math.min(ft.width,lt),ut=Math.min(ft.height,ut),lt=Math.max(yt.width,lt),ut=Math.max(yt.height,ut),this.dc.h(0,0,lt,ut)):this.dc.assign(tt)};function Ev(a){var y=a.geometryStretch;return a.Rd!==null?y===lr?xn:y:y===lr?Lv[a.figure].defaultStretch:y}wt.eh=function(a,y,x,E){fs(this,a,y,x,E)},wt.rs=function(a,y,x){return this.Sj(a.x,a.y,y.x,y.y,x)},wt.Sj=function(a,y,x,E,b){var z=this.transform,tt=1/(z.m11*z.m22-z.m12*z.m21),rt=z.m22*tt,ot=-z.m12*tt,lt=-z.m21*tt,ut=z.m11*tt,ft=tt*(z.m21*z.dy-z.m22*z.dx),yt=tt*(z.m12*z.dx-z.m11*z.dy);z=a*rt+y*lt+ft,tt=a*ot+y*ut+yt,rt=x*rt+E*lt+ft,ot=x*ot+E*ut+yt,ft=this.ig/2,lt=this.ua,lt===null&&(this.measure(1/0,1/0),lt=this.ua);var xt=lt.bounds;if(ut=!1,lt.type===Ye.j)if(1.5>=this.strokeWidth)ut=Zt.Ve(lt.startX,lt.startY,lt.endX,lt.endY,z,tt,rt,ot,b);else{if(lt.startX===lt.endX?(E=ft,ut=0):(y=(lt.endY-lt.startY)/(lt.endX-lt.startX),ut=ft/Math.sqrt(1+y*y),E=ut*y),y=pi(),a=new At,Zt.Ve(lt.startX+E,lt.startY+ut,lt.endX+E,lt.endY+ut,z,tt,rt,ot,a)&&y.push(a),a=new At,Zt.Ve(lt.startX-E,lt.startY-ut,lt.endX-E,lt.endY-ut,z,tt,rt,ot,a)&&y.push(a),a=new At,Zt.Ve(lt.startX+E,lt.startY+ut,lt.startX-E,lt.startY-ut,z,tt,rt,ot,a)&&y.push(a),a=new At,Zt.Ve(lt.endX+E,lt.endY+ut,lt.endX-E,lt.endY-ut,z,tt,rt,ot,a)&&y.push(a),rt=y.length,rt===0)return oi(y),!1;for(ut=!0,ot=1/0,E=0;E<rt;E++)a=y[E],x=(a.x-z)*(a.x-z)+(a.y-tt)*(a.y-tt),x<ot&&(ot=x,b.x=a.x,b.y=a.y);oi(y)}else if(lt.type===Ye.u)ut=Zt.Ff(xt.x-ft,xt.y-ft,xt.x+xt.width+ft,xt.y+xt.height+ft,z,tt,rt,ot,b);else if(lt.type===Ye.F){y=Be.allocAt(xt.x,xt.y,xt.width,xt.height).Bc(ft,ft);t:if(y.width===0)ut=Zt.Ve(y.x,y.y,y.x,y.y+y.height,z,tt,rt,ot,b);else if(y.height===0)ut=Zt.Ve(y.x,y.y,y.x+y.width,y.y,z,tt,rt,ot,b);else{if(a=y.width/2,lt=y.height/2,E=y.x+a,ut=y.y+lt,x=9999,z!==rt&&(x=(tt-ot)/(z-rt)),9999>Math.abs(x)){if(ot=tt-ut-x*(z-E),0>a*a*x*x+lt*lt-ot*ot){b.x=NaN,b.y=NaN,ut=!1;break t}ft=Math.sqrt(a*a*x*x+lt*lt-ot*ot),rt=(-(a*a*x*ot)+a*lt*ft)/(lt*lt+a*a*x*x)+E,a=(-(a*a*x*ot)-a*lt*ft)/(lt*lt+a*a*x*x)+E,lt=x*(rt-E)+ot+ut,ot=x*(a-E)+ot+ut,Math.abs((z-rt)*(z-rt))+Math.abs((tt-lt)*(tt-lt))<Math.abs((z-a)*(z-a))+Math.abs((tt-ot)*(tt-ot))?(b.x=rt,b.y=lt):(b.x=a,b.y=ot)}else{if(rt=lt*lt,ot=z-E,rt-=rt/(a*a)*ot*ot,0>rt){b.x=NaN,b.y=NaN,ut=!1;break t}ot=Math.sqrt(rt),rt=ut+ot,ot=ut-ot,Math.abs(rt-tt)<Math.abs(ot-tt)?(b.x=z,b.y=rt):(b.x=z,b.y=ot)}ut=!0}Be.free(y)}else if(lt.type===Ye.o){yt=At.alloc();var Ct=rt-z,bt=ot-tt,Wt=Ct*Ct+bt*bt,jt=z,Qt=tt;if(0<Wt&&xt.contains(jt,Qt)&&(yt.x=jt,yt.y=Qt,this.ca(yt)))for(Ct!==0&&.5>Math.abs(Ct)?(bt*=.5/Ct,Ct=.5):bt!==0&&.5>Math.abs(bt)&&(Ct*=.5/bt,bt=.5),jt-=Ct,Qt-=bt;xt.contains(jt,Qt);)jt-=Ct,Qt-=bt;for(b.x=rt,b.y=ot,bt=0;bt<lt.figures.count;bt++){var te=lt.figures.s[bt],re=te.isFilled?jt:z,he=te.isFilled?Qt:tt,ke=te.segments;xt=te.startX,Ct=te.startY;for(var Jn=xt,fi=Ct,li=0;li<ke.count;li++){var Bn=ke.s[li],on=Bn.type,nr=Bn.endX,Xi=Bn.endY,to=!1;switch(on){case wr:Jn=nr,fi=Xi;break;case Qi:to=Am(xt,Ct,nr,Xi,re,he,rt,ot,yt);break;case ar:to=Zt.Eo(xt,Ct,Bn.point1X,Bn.point1Y,Bn.point2X,Bn.point2Y,nr,Xi,re,he,rt,ot,.6,yt);break;case so:to=Zt.Eo(xt,Ct,xt+2/3*(Bn.point1X-xt),Ct+2/3*(Bn.point1Y-Ct),nr+2/3*(Bn.point1X-nr),Xi+2/3*(Bn.point1Y-Xi),nr,Xi,re,he,rt,ot,.6,yt);break;case xr:case Ji:on=Bn.type===xr?Gi(Bn,te):kr(Bn,te,xt,Ct);var Ao=on.length;if(Ao===0){to=Am(xt,Ct,Bn.type===xr?Bn.centerX:Bn.endX,Bn.type===xr?Bn.centerY:Bn.endY,re,he,rt,ot,yt);break}for(Xi=null,nr=0;nr<Ao;nr++){if(Xi=on[nr],nr===0&&Am(xt,Ct,Xi[0],Xi[1],re,he,rt,ot,yt)){var ba=Bm(re,he,yt,Wt,b);ba<Wt&&(Wt=ba,ut=!0)}Zt.Eo(Xi[0],Xi[1],Xi[2],Xi[3],Xi[4],Xi[5],Xi[6],Xi[7],re,he,rt,ot,.6,yt)&&(ba=Bm(re,he,yt,Wt,b),ba<Wt&&(Wt=ba,ut=!0))}nr=Xi[6],Xi=Xi[7];break;default:$t("Unknown Segment type: "+on)}xt=nr,Ct=Xi,to&&(to=Bm(re,he,yt,Wt,b),to<Wt&&(Wt=to,ut=!0)),Bn.isClosed&&(nr=Jn,Xi=fi,Am(xt,Ct,nr,Xi,re,he,rt,ot,yt)&&(Bn=Bm(re,he,yt,Wt,b),Bn<Wt&&(Wt=Bn,ut=!0)))}}z=x-a,tt=E-y,rt=Math.sqrt(z*z+tt*tt),rt!==0&&(z/=rt,tt/=rt),b.x-=z*ft,b.y-=tt*ft,At.free(yt)}else $t("Unknown Geometry type: "+lt.type);return ut?(this.transform.Ga(b),!0):!1};function Bm(a,y,x,E,b){return a=x.x-a,y=x.y-y,y=a*a+y*y,y<E?(b.x=x.x,b.y=x.y,y):E}function Am(a,y,x,E,b,z,tt,rt,ot){if(Zt.$(a,x)&&Zt.$(y,E)||Zt.$(b,tt)&&Zt.$(z,rt))return!1;var lt=!1,ut=(b-tt)*(y-E)-(z-rt)*(a-x);return ut===0?!1:(ot.x=((b*rt-z*tt)*(a-x)-(b-tt)*(a*E-y*x))/ut,ot.y=((b*rt-z*tt)*(y-E)-(z-rt)*(a*E-y*x))/ut,(a>x?a-x:x-a)<(y>E?y-E:E-y)?(a=y<E?y:E,y=y<E?E:y,(ot.y>a||Zt.$(ot.y,a))&&(ot.y<y||Zt.$(ot.y,y))&&(lt=!0)):(y=a<x?a:x,a=a<x?x:a,(ot.x>y||Zt.$(ot.x,y))&&(ot.x<a||Zt.$(ot.x,a))&&(lt=!0)),lt)}wt.fh=function(a,y){if(y===void 0)return a.Re(this.actualBounds);var x=this.ua;x===null&&(this.measure(1/0,1/0),x=this.ua),x=x.bounds;var E=this.strokeWidth/2,b=!1,z=At.alloc();return z.h(x.x-E,x.y-E),a.ca(y.Ga(z))&&(z.h(x.x-E,x.bottom+E),a.ca(y.Ga(z))&&(z.h(x.right+E,x.bottom+E),a.ca(y.Ga(z))&&(z.h(x.right+E,x.y-E),a.ca(y.Ga(z))&&(b=!0)))),At.free(z),b},wt.Yc=function(a,y){if(this.fh(a,y)||y===void 0&&(y=this.transform,a.Re(this.actualBounds)))return!0;var x=fe.alloc();x.set(y),x.Vj();var E=a.left,b=a.right,z=a.top;a=a.bottom;var tt=At.alloc();if(tt.h(E,z),x.Ga(tt),this.gh(tt,!0)||(tt.h(b,z),x.Ga(tt),this.gh(tt,!0))||(tt.h(E,a),x.Ga(tt),this.gh(tt,!0))||(tt.h(b,a),x.Ga(tt),this.gh(tt,!0)))return At.free(tt),!0;var rt=At.alloc(),ot=At.alloc();return x.set(y),x.bv(this.transform),x.Vj(),rt.x=b,rt.y=z,rt.transform(x),tt.x=E,tt.y=z,tt.transform(x),y=!1,ic(this,tt,rt,ot)?y=!0:(tt.x=b,tt.y=a,tt.transform(x),ic(this,tt,rt,ot)?y=!0:(rt.x=E,rt.y=a,rt.transform(x),ic(this,tt,rt,ot)?y=!0:(tt.x=E,tt.y=z,tt.transform(x),ic(this,tt,rt,ot)&&(y=!0)))),At.free(tt),fe.free(x),At.free(rt),At.free(ot),y};function ic(a,y,x,E){if(!a.rs(y,x,E))return!1;a=y.x,y=y.y;var b=x.x,z=x.y;return x=E.x,E=E.y,a===b?(y<z?(a=y,y=z):a=z,E>=a&&E<=y):(a<b?(E=a,a=b):E=b,x>=E&&x<=a)}wt.tx=function(a,y,x){function E(Wt,jt){for(var Qt=Wt.length,te=0;te<Qt;te+=2)if(jt.zd(Wt[te],Wt[te+1])>b)return!0;return!1}if(x&&this.fill!==null&&this.gh(a,!0))return!0;var b=a.Bf(y),z=b;if(1.5<this.strokeWidth&&(b=this.strokeWidth/2+Math.sqrt(b),b*=b),y=this.ua,y===null&&(this.measure(1/0,1/0),y=this.ua,y===null))return!1;if(!x){var tt=y.bounds,rt=tt.x,ot=tt.y,lt=tt.x+tt.width;if(tt=tt.y+tt.height,Vi(a.x,a.y,rt,ot)<=b&&Vi(a.x,a.y,lt,ot)<=b&&Vi(a.x,a.y,rt,tt)<=b&&Vi(a.x,a.y,lt,tt)<=b)return!0}if(rt=y.startX,ot=y.startY,lt=y.endX,tt=y.endY,y.type===Ye.j){if(x=(rt-lt)*(a.x-lt)+(ot-tt)*(a.y-tt),ni(a.x,a.y,rt,ot,lt,tt)<=(0<=(lt-rt)*(a.x-rt)+(tt-ot)*(a.y-ot)&&0<=x?b:z))return!0}else{if(y.type===Ye.u)return y=!1,x&&(y=ni(a.x,a.y,rt,ot,rt,tt)<=b||ni(a.x,a.y,rt,ot,lt,ot)<=b||ni(a.x,a.y,lt,ot,lt,tt)<=b||ni(a.x,a.y,rt,tt,lt,tt)<=b),y;if(y.type===Ye.F){y=a.x-(rt+lt)/2,z=a.y-(ot+tt)/2;var ut=Math.abs(lt-rt)/2,ft=Math.abs(tt-ot)/2;if(ut===0||ft===0)return ni(a.x,a.y,rt,ot,lt,tt)<=b;if(x){if(a=Zt.$y(ut,ft,y,z),a*a<=b)return!0}else return!(Vi(y,z,-ut,0)>=b||Vi(y,z,0,-ft)>=b||Vi(y,z,0,ft)>=b||Vi(y,z,ut,0)>=b)}else if(y.type===Ye.o){if(lt=y.bounds,z=lt.x,rt=lt.y,ot=lt.x+lt.width,lt=lt.y+lt.height,a.x>ot&&a.x<z&&a.y>lt&&a.y<rt&&ni(a.x,a.y,z,rt,z,lt)>b&&ni(a.x,a.y,z,rt,ot,rt)>b&&ni(a.x,a.y,ot,lt,z,lt)>b&&ni(a.x,a.y,ot,lt,ot,rt)>b)return!1;if(z=Math.sqrt(b),x){if(this.fill===null?xo(y,a.x,a.y,z):rr(y,a,z,!0,!1))return!0}else{for(x=y.figures,y=0;y<x.count;y++){if(z=x.s[y],tt=z.startX,ut=z.startY,a.zd(tt,ut)>b)return!1;for(rt=z.segments.s,ot=rt.length,lt=0;lt<ot;lt++)switch(ft=rt[lt],ft.type){case wr:case Qi:if(tt=ft.endX,ut=ft.endY,a.zd(tt,ut)>b)return!1;break;case ar:var yt=pi();if(Zt.Qe(tt,ut,ft.point1X,ft.point1Y,ft.point2X,ft.point2Y,ft.endX,ft.endY,.8,yt),tt=E(yt,a),oi(yt),tt||(tt=ft.endX,ut=ft.endY,a.zd(tt,ut)>b))return!1;break;case so:if(yt=pi(),Zt.ep(tt,ut,ft.point1X,ft.point1Y,ft.endX,ft.endY,.8,yt),tt=E(yt,a),oi(yt),tt||(tt=ft.endX,ut=ft.endY,a.zd(tt,ut)>b))return!1;break;case xr:case Ji:yt=ft.type===xr?Gi(ft,z):kr(ft,z,tt,ut);var xt=yt.length;if(xt===0){if(tt=ft.type===xr?ft.centerX:ft.endX,ut=ft.type===xr?ft.centerY:ft.endY,a.zd(tt,ut)>b)return!1;break}ft=null;for(var Ct=pi(),bt=0;bt<xt;bt++)if(ft=yt[bt],Ct.length=0,Zt.Qe(ft[0],ft[1],ft[2],ft[3],ft[4],ft[5],ft[6],ft[7],.8,Ct),E(Ct,a))return oi(Ct),!1;oi(Ct),ft!==null&&(tt=ft[6],ut=ft[7]);break;default:$t("Unknown Segment type: "+ft.type)}}return!0}}}return!1},wt.qc=function(){this.ua=null},wt.kq=function(){return this.ig};function m1(a){var y=a.diagram;y!==null&&y.undoManager.isUndoingRedoing||(a.segmentOrientation=sp,a.toArrow!=="None"?(a.segmentIndex=-1,a.alignmentFocus=Fa):a.fromArrow!=="None"&&(a.segmentIndex=0,a.alignmentFocus=new In(1-Fa.x,Fa.y)))}cr.makeGeometry=function(a,y,x){if(a.toArrow!=="None")var E=Vu[a.toArrow];else a.fromArrow!=="None"?E=Vu[a.fromArrow]:(E=Zt.Ze[a.figure],typeof E=="string"&&(E=Zt.Ze[E]),E===void 0&&$t("Unknown Shape.figure: "+a.figure),E=E(a,y,x),E.Sk=y,E.Rk=x);if(E===null){var b=Zt.Ze.Rectangle;typeof b=="function"&&(E=b(a,y,x))}return E};function v1(a){var y=Vu[a];if(y===void 0){var x=a.toLowerCase();if(x==="none")return"None";if(y=Vu[x],y===void 0){var E=null,b;for(b in Zt.um)if(b.toLowerCase()===x){E=b;break}if(E!==null)return a=Ye.parse(Zt.um[E],!1),Vu[E]=a,x!==E&&(Vu[x]=E),E}}return typeof y=="string"?y:y instanceof Ye?a:null}ve.Object.defineProperties(cr.prototype,{geometry:{get:function(){return this.ua!==null?this.ua:this.Rd},set:function(a){var y=this.ua,x=this.Rd;if(y!==a){a!==null?this.Rd=this.ua=a.freeze():this.Rd=this.ua=null;var E=this.part;E!==null&&(E.ag=NaN),this.v(),this.g("geometry",y||x,a),Ya(this)&&(a=this.part,a!==null&&Go(this,a,"geometryString"))}}},geometryString:{get:function(){return this.geometry===null?"":this.geometry.toString()},set:function(a){a=Ye.parse(a);var y=a.normalize();this.geometry=a,this.position=a=At.allocAt(-y.x,-y.y),At.free(a)}},isGeometryPositioned:{get:function(){return(this.l&1048576)!==0},set:function(a){var y=(this.l&1048576)!==0;y!==a&&(this.l^=1048576,this.v(),this.g("isGeometryPositioned",y,a))}},fill:{get:function(){return this.Ui},set:function(a){var y=this.Ui;y!==a&&(a!==null&&zc(a,"Shape.fill"),a instanceof mo&&a.freeze(),this.Ui=a,this.N(),this.g("fill",y,a))}},stroke:{get:function(){return this.xc},set:function(a){var y=this.xc;y!==a&&(a!==null&&zc(a,"Shape.stroke"),a instanceof mo&&a.freeze(),this.xc=a,this.N(),this.g("stroke",y,a))}},strokeWidth:{get:function(){return this.ig},set:function(a){var y=this.ig;if(y!==a)if(0<=a){this.ig=a,this.v();var x=this.part;x!==null&&(x.ag=NaN),this.g("strokeWidth",y,a)}else wn(a,"value >= 0",cr,"strokeWidth:value")}},strokeCap:{get:function(){return this.Na!==null?this.Na.Hr:"butt"},set:function(a){var y=this.strokeCap;y!==a&&(typeof a!="string"||a!=="butt"&&a!=="round"&&a!=="square"?wn(a,'"butt", "round", or "square"',cr,"strokeCap"):(nc(this),this.Na.Hr=a,this.N(),this.g("strokeCap",y,a)))}},strokeJoin:{get:function(){return this.Na!==null?this.Na.Ir:"miter"},set:function(a){var y=this.strokeJoin;y!==a&&(typeof a!="string"||a!=="miter"&&a!=="bevel"&&a!=="round"?wn(a,'"miter", "bevel", or "round"',cr,"strokeJoin"):(nc(this),this.Na.Ir=a,this.N(),this.g("strokeJoin",y,a)))}},strokeMiterLimit:{get:function(){return this.Na!==null?this.Na.Jr:10},set:function(a){var y=this.strokeMiterLimit;if(y!==a&&1<=a){nc(this),this.Na.Jr=a,this.N();var x=this.part;x!==null&&(x.ag=NaN),this.g("strokeMiterLimit",y,a)}}},strokeDashArray:{get:function(){return this.Yg},set:function(a){var y=this.Yg;if(y!==a){if(a!==null){for(var x=a.length,E=0,b=0;b<x;b++){var z=a[b];0<=z&&isFinite(z)||$t("strokeDashArray:value "+z+" at index "+b+" must be a positive number or zero."),E+=z}if(E===0){if(y===null)return;a=null}}this.Yg=a,this.N(),this.g("strokeDashArray",y,a)}}},strokeDashOffset:{get:function(){return this.Na!==null?this.Na.uj:0},set:function(a){var y=this.strokeDashOffset;y!==a&&0<=a&&(nc(this),this.Na.uj=a,this.N(),this.g("strokeDashOffset",y,a))}},figure:{get:function(){return this.an},set:function(a){var y=this.an;if(y!==a){var x=Zt.Ze[a];typeof x=="function"?x=a:(x=Zt.Ze[a.toLowerCase()])||$t("Unknown Shape.figure: "+a),y!==x&&(a=this.part,a!==null&&(a.ag=NaN),this.an=x,this.Rd=null,this.qc(),this.v(),this.g("figure",y,x))}}},toArrow:{get:function(){return this.Ua!==null?this.Ua.V:"None"},set:function(a){var y=this.toArrow;if(a===!0?a="Standard":a===!1&&(a=""),y!==a){var x=v1(a);x===null?$t("Unknown Shape.toArrow: "+a):y!==x&&(this.Ua===null&&(this.Ua=new gd),this.Ua.V=x,this.Rd=null,this.qc(),this.v(),m1(this),this.g("toArrow",y,x))}}},fromArrow:{get:function(){return this.Ua!==null?this.Ua.j:"None"},set:function(a){var y=this.fromArrow;if(a===!0?a="Standard":a===!1&&(a=""),y!==a){var x=v1(a);x===null?$t("Unknown Shape.fromArrow: "+a):y!==x&&(this.Ua===null&&(this.Ua=new gd),this.Ua.j=x,this.Rd=null,this.qc(),this.v(),m1(this),this.g("fromArrow",y,x))}}},spot1:{get:function(){return this.Na!==null?this.Na.fg:xa},set:function(a){var y=this.spot1;y.D(a)||(a=a.J(),nc(this),this.Na.fg=a,this.v(),this.g("spot1",y,a))}},spot2:{get:function(){return this.Na!==null?this.Na.gg:xa},set:function(a){var y=this.spot2;y.D(a)||(a=a.J(),nc(this),this.Na.gg=a,this.v(),this.g("spot2",y,a))}},parameter1:{get:function(){return this.Un},set:function(a){var y=this.Un;y!==a&&(this.Un=a,this.qc(),this.v(),this.g("parameter1",y,a))}},parameter2:{get:function(){return this.Vn},set:function(a){var y=this.Vn;y!==a&&(this.Vn=a,this.qc(),this.v(),this.g("parameter2",y,a))}},naturalBounds:{get:function(){return this.dc}},pathPattern:{get:function(){return this.Na!==null?this.Na.br:null},set:function(a){var y=this.pathPattern;y!==a&&(nc(this),this.Na.br=a,this.N(),this.g("pathPattern",y,a))}},geometryStretch:{get:function(){return this.Na!==null?this.Na.jq:lr},set:function(a){var y=this.geometryStretch;y!==a&&(nc(this),this.Na.jq=a,this.v(),this.g("geometryStretch",y,a))}},interval:{get:function(){return this.fa!==null?this.fa.Tk:1},set:function(a){var y=this.interval;if(a=Math.round(a),y!==a&&a!==0&&isFinite(a)){this.fa===null&&(this.fa=new Ku),this.fa.Tk=a;var x=this.diagram;x!==null&&this.panel===x.grid&&Fu(x),this.v(),x=this.panel,x!==null&&(x.graduatedIntervals=null),this.g("interval",y,a)}}},graduatedStart:{get:function(){return this.fa!==null?this.fa.u:0},set:function(a){var y=this.graduatedStart;y!==a&&(0>a?a=0:1<a&&(a=1),this.fa===null&&(this.fa=new Ku),this.fa.u=a,this.v(),this.g("graduatedStart",y,a))}},graduatedEnd:{get:function(){return this.fa!==null?this.fa.j:1},set:function(a){var y=this.graduatedEnd;y!==a&&(0>a?a=0:1<a&&(a=1),this.fa===null&&(this.fa=new Ku),this.fa.j=a,this.v(),this.g("graduatedEnd",y,a))}},graduatedSkip:{get:function(){return this.fa!==null?this.fa.o:null},set:function(a){var y=this.graduatedSkip;y!==a&&(this.fa===null&&(this.fa=new Ku),this.fa.o=a,this.v(),this.g("graduatedSkip",y,a))}}}),cr.prototype.intersectsRect=cr.prototype.Yc,cr.prototype.containedInRect=cr.prototype.fh,cr.prototype.getNearestIntersectionPoint=cr.prototype.rs,cr.prototype.getDocumentBounds=cr.prototype.mi,cr.prototype.getDocumentPoint=cr.prototype.ga;var Vu=new Hi,Lv=new Hi;cr.className="Shape",cr.getFigureGenerators=function(){var a=new Ie,y;for(y in Zt.Ze)y!==y.toLowerCase()&&a.add(y,Zt.Ze[y]);return a.freeze(),a},cr.defineFigureGenerator=function(a,y){var x=a.toLowerCase(),E=Zt.Ze;E[a]=y,E[x]=a},cr.getArrowheadGeometries=function(){var a=new Ie;for(E in Zt.um)if(Vu[E]===void 0){var y=Ye.parse(Zt.um[E],!1);Vu[E]=y,y=E.toLowerCase(),y!==E&&(Vu[y]=E)}for(var x in Vu)if(x!==x.toLowerCase()){var E=Vu[x];E instanceof Ye&&a.add(x,E)}return a.freeze(),a},cr.defineArrowheadGeometry=function(a,y){var x=null;typeof y=="string"?x=Ye.parse(y,!1):x=y,y=a.toLowerCase(),y!=="none"&&a!==y||$t("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+a);var E=Vu;E[a]=x,E[y]=a};function Fv(){this.nc=!1,this.Hr="butt",this.Ir="miter",this.Jr=10,this.uj=0,this.br=null,this.jq=lr,this.gg=this.fg=xa}Fv.prototype.copy=function(){var a=new Fv;return a.Hr=this.Hr,a.Ir=this.Ir,a.Jr=this.Jr,a.uj=this.uj,a.br=this.br,a.jq=this.jq,a.fg=this.fg.J(),a.gg=this.gg.J(),a};function To(a,y){return de.call(this),_m||(Os=qo?new Dl(null).context:null,_m=!0),this.l|=2097152,this.ec="",this.xc="black",this.Ae="13px sans-serif",this.Lq=this.Cb=this.Gc=0,this.da=this.fa=this.Gm=null,this.Ih=0,this.df=null,this.Le=0,this.ze=this.Qb=this.Qc=null,typeof a=="string"?this.text=a:a&&Object.assign(this,a),y&&Object.assign(this,y),this}Se(To,de),To.prototype.cloneProtected=function(a){de.prototype.cloneProtected.call(this,a),a.ec=this.ec,a.xc=this.xc,a.Ae=this.Ae,a.Gc=this.Gc,a.Cb=this.Cb,a.Lq=this.Lq,a.Gm=this.Gm,this.fa!==null&&(a.fa=this.fa.copy()),this.da!==null&&(a.da=this.da.nc?this.da:this.da.copy()),a.Ih=this.Ih,a.df=this.df,a.Le=this.Le,a.Qc=this.Qc,a.Qb=this.Qb,a.ze=this.ze};function Nu(a){a.da===null?a.da=new Tv:a.da.nc&&(a.da=a.da.copy())}wt=To.prototype,wt.th=function(){de.prototype.th.call(this),this.da!==null&&(this.da.nc=!0)};function y1(a,y){a.l=y.l|6144,a.pb=y.opacity,a.Ma=y.background,a.areaBackground=y.areaBackground,a.jd=y.desiredSize.J(),a.minSize=y.minSize.J(),a.maxSize=y.maxSize.J(),y.Lb!==null?a.Lb=y.Lb.copy():a.Lb=null,a.Ca=y.scale,a.Kb=y.angle,a.stretch=y.stretch,a.Kg=y.margin.J(),a.Jb=y.alignment.J(),a.sk=y.alignmentFocus.J(),a.segmentFraction=y.segmentFraction,a.segmentOffset=y.segmentOffset.J(),a.segmentOrientation=y.segmentOrientation,y.tb!==null&&(a.tb=y.tb.copy()),a.shadowVisible=y.shadowVisible,a.ec=y.ec,a.xc=y.xc,a.Ae=y.Ae,a.fa!==null&&(a.fa=y.fa.copy()),y.da!==null&&(a.da=y.da.nc?y.da:y.da.copy()),a.Ih=y.Ih}wt.qb=function(a){a.classType===To?this.wrap=a:de.prototype.qb.call(this,a)},wt.toString=function(){return 22<this.ec.length?'TextBlock("'+this.ec.substring(0,20)+'"...)':'TextBlock("'+this.ec+'")'},wt.v=function(){de.prototype.v.call(this)},wt.hh=function(a,y){if(this.xc!==null&&this.ec.length!==0&&this.Ae!==null){var x=this.naturalBounds,E=this.actualBounds,b=x.width,z=x.height,tt=tp(this),rt=a.textAlign=this.textAlign,ot=y.tn;rt==="start"?rt=ot?"right":"left":rt==="end"&&(rt=ot?"left":"right"),ot=this.isUnderline;var lt=this.isStrikethrough;na(this,a,this.xc,!0,!1,x,E),(ot||lt)&&na(this,a,this.xc,!1,!1,x,E),E=0,x=!1;var ut=this.oe,ft=ut.dx-(tt*ut.m21+ut.dx);ut=ut.dy-(tt*ut.m22+ut.dy);var yt=y.scale;switch(8>(ft*ft+ut*ut)*yt*yt&&(x=!0),y.ib!==a&&(x=!1),y.ib instanceof Qs&&(x=!1),y.Gf("textGreeking")===!1&&(x=!1),y=this.spacingAbove,ft=this.spacingBelow,this.flip){case Hr:a.translate(b,0),a.scale(-1,1);break;case yr:a.translate(0,z),a.scale(1,-1);break;case wo:a.translate(b,z),a.scale(-1,-1)}if(a.yc(),ut=this.Gc,yt=(y+tt+ft)*ut,z>yt&&(E=this.verticalAlignment,E=E.y*z-E.y*yt+E.offsetY),ut===1&&this.ze!==null)ft=this.Cb,ft>b&&(ft=b),this.Oj(this.ze,a,0,E+y,b,tt,ft,x,rt,ot,lt);else if(this.Qc!==null&&this.Qb!==null)for(yt=0;yt<ut;yt++){var xt=this.Qc[yt];xt>b&&(xt=b),E+=y,this.Oj(this.Qb[yt],a,0,E,b,tt,xt,x,rt,ot,lt),E+=tt+ft}switch(this.flip){case Hr:a.scale(-1,1),a.translate(-b,0);break;case yr:a.scale(1,-1),a.translate(0,-z);break;case wo:a.scale(-1,-1),a.translate(-b,-z)}}},wt.Oj=function(a,y,x,E,b,z,tt,rt,ot,lt,ut){var ft=0;if(rt)ot==="left"?ft=0:ot==="right"?ft=b-tt:ot==="center"&&(ft=(b-tt)/2),y.fillRect(x+ft,E+.25*z,tt,1);else{if(ot==="left"?ft=0:ot==="right"?ft=b:ot==="center"&&(ft=b/2),b=Tm!==null?Tm(this,z):.75*z,y.fillText(a,x+ft,E+b),a=z/20|0,a===0&&(a=1),ot==="right"?ft-=tt:ot==="center"&&(ft-=tt/2),lt){rt=Dm!==null?Dm(this,z):.8*z,ot=x+ft,lt=E+rt,b=x+ft+tt,rt=E+rt;var yt=a;y.beginPath(),y.lineWidth=yt,y.moveTo(ot,lt),y.lineTo(b,rt),y.stroke(),y.Se(),y instanceof Qs&&y.ad.classList.add("gojs-td")}ut&&(ut=E+z-z/2.2|0,a%2!==0&&(ut+=.5),E=x+ft,z=ut,x=x+ft+tt,tt=ut,ft=a,y.beginPath(),y.lineWidth=ft,y.moveTo(E,z),y.lineTo(x,tt),y.stroke(),y.Se(),y instanceof Qs&&y.ad.classList.add("gojs-td"))}},wt.kk=function(a,y,x){if(!de.prototype.kk.call(this,a,y,x))return!1;if(na(this,a,this.xc,!0,!1,this.naturalBounds,this.actualBounds),x){if(this.svg.getElementsByTagName("text").length===0)return!0;for(y=this.svg.getElementsByClassName("gojs-td"),x=0;x<y.length;x++)Qy(a,y[x],!1)}else y=this.svg,y.innerHTML=this.text,Qy(a,y,!0);return!0},wt.nk=function(a){return 1<this.lineCount||this.isUnderline||this.isStrikethrough?!0:de.prototype.nk.call(this,a)},wt.Dv=function(a,y){if(a.nodeName!=="g")a.setAttributeNS(null,"filter",y);else{a=a.getElementsByTagName("text");for(var x=0;x<a.length;x++)a[x].setAttributeNS(null,"filter",y)}},wt.Wl=function(a,y,x,E){var b=this.Gc;this.Ih=a,this.l&=-16777217;var z=this.Ae;Os!==null&&L1!==z&&(L1=Os.font=z),this.Cb=this.Le=0,this.ze=this.Qb=this.Qc=this.df=null;var tt;if(isNaN(this.desiredSize.width)){if(z=this.ec.replace(/\r\n/g,`
`).replace(/\r/g,`
`),z.length===0)z=8;else if(this.isMultiline){for(var rt=tt=0,ot=!1;!ot;){var lt=z.indexOf(`
`,rt);lt===-1&&(lt=z.length,ot=!0),rt=z.substr(rt,lt-rt),this.formatting===ep&&(rt=rt.trim()),tt=Math.max(tt,Ql(rt)),rt=lt+1}z=tt}else tt=z.indexOf(`
`,0),0<=tt&&(z=z.substr(0,tt)),z=Ql(z);z=Math.min(z,a/this.scale)}else z=this.desiredSize.width;if(this.panel!==null&&(z=Math.min(z,this.panel.maxSize.width)),tt=x1(this,z),isNaN(this.desiredSize.height)?tt=Math.min(tt,y/this.scale):tt=this.desiredSize.height,ot=tt,this.Cb!==0&&this.Qc!==null&&this.Qb!==null&&this.overflow===Om&&(y=this.Ae,y=this.overflow===Om?S1(y):0,lt=this.spacingAbove+this.spacingBelow,lt=Math.max(0,tp(this)+lt),ot=Math.min(this.maxLines-1,Math.max(Math.floor(ot/lt+.01)-1,0)),!(ot+1>=this.Qb.length))){for(this.l|=16777216,lt=this.Qb[ot],y=Math.max(1,a-y);Ql(lt)>y&&1<lt.length;)lt=lt.substr(0,lt.length-1);lt+=np,y=Ql(lt),this.Qb[ot]=lt,this.Qb=this.Qb.slice(0,ot+1),this.Qc[ot]=y,this.Qc=this.Qc.slice(0,ot+1),this.Le=this.Qb.length,this.Cb=Math.max(this.Cb,y),this.Gc=this.Le,this.Gc===1&&(this.ze=this.Qb[0])}(this.wrap===P1||isNaN(this.desiredSize.width))&&(z=isNaN(a)?this.Cb:Math.min(a,this.Cb)),z=Math.max(x,z),tt=Math.max(E,tt),Wr(this.dc,z,tt),this.Ge(0,0,z,tt),this.svg!==null&&b!==this.Gc&&(this.Uc=!0)},wt.eh=function(a,y,x,E){fs(this,a,y,x,E)};function qg(a,y,x){a.ze===null?(a.ze=y,a.Cb=x):((a.Qb===null||a.Qc===null)&&(a.Qb=[],a.Qc=[],a.Qb.push(a.ze),a.Qc.push(a.Cb)),a.Qb.push(y),a.Qc.push(x),a.Qb.length>a.maxLines&&(a.l|=16777216))}function Mv(a,y,x,E){var b=a.formatting===ep;b&&(y=y.trim());var z=0,tt=a.Ae,rt=a.spacingAbove+a.spacingBelow;rt=Math.max(0,tp(a)+rt);var ot=a.overflow===Om?S1(tt):0;if(a.Gc>=a.maxLines)E!==null&&E.h(0,rt);else if(tt=y,a.wrap===kv){a.Le=1;var lt=Ql(y);if(ot===0||lt<=x)a.Cb=Math.max(a.Cb,lt),qg(a,y,a.Cb),E!==null&&E.h(lt,rt);else{for(z=_f(a,tt),tt=tt.substr(z.length),y=_f(a,tt),lt=Ql(z+y);0<y.length&&lt<=x;)z+=y,tt=tt.substr(y.length),y=_f(a,tt),lt=z+y,b&&(lt=lt.trim()),lt=Ql(lt);for(b&&(y=y.trim()),z+=y,x=Math.max(1,x-ot);Ql(z)>x&&1<z.length;)z=z.substr(0,z.length-1);a.l|=16777216,z+=np;var ut=Ql(z);a.Cb=ut,qg(a,z,ut),E!==null&&E.h(ut,rt)}}else{for(ot=0,tt.length===0&&(ot=1,qg(a,tt,0));0<tt.length;){for(y=_f(a,tt),tt=tt.substr(y.length);Ql(y)>x;){var ft=1;for(lt=Ql(y.substr(0,ft)),ut=0;lt<=x;)ft++,ut=lt,lt=Ql(y.substr(0,ft));if(ft===1){var yt=lt;z=Math.max(z,lt)}else yt=ut,z=Math.max(z,ut);if(ft--,1>ft&&(ft=1),qg(a,y.substr(0,ft),yt),ot++,y=y.substr(ft),a.Gc+ot>a.maxLines)break}for(ut=_f(a,tt),lt=Ql(y+ut);0<ut.length&&lt<=x;)y+=ut,tt=tt.substr(ut.length),ut=_f(a,tt),lt=y+ut,b&&(lt=lt.trim()),lt=Ql(lt);if(b&&(y=y.trim()),y!==""&&(y[y.length-1]==="\xAD"&&(y=y.substring(0,y.length-1)+"\u2010"),ut.length===0?(ft=lt,z=Math.max(z,lt)):(ft=ut=Ql(y),z=Math.max(z,ut)),qg(a,y,ft),ot++,a.Gc+ot>a.maxLines))break}a.Le=Math.min(a.maxLines,ot),a.Cb=Math.max(a.Cb,z),E!==null&&E.h(a.Cb,rt*a.Le)}}function _f(a,y){if(a.wrap===w1)return y.substr(0,1);for(var x=y.length,E=0,b=Sx;E<x&&!b.test(y.charAt(E));)E++;for(a.formatting===C1&&(x=Math.min(x,E+1));E<x&&b.test(y.charAt(E));)E++;return E>=y.length?y:y.substr(0,E)}function Ql(a){return Os===null?8*a.length:Os.measureText(a).width}function tp(a){if(a.df!==null)return a.df;var y=a.Ae;if(Os===null){var x=16;return a.df=x}return Bv[y]!==void 0&&5e3>E1?x=Bv[y]:(x=1.3*Os.measureText("M").width,Bv[y]=x,E1++),a.df=x}function S1(a){if(Os===null)return 6;if(Im[a]!==void 0&&5e3>Av)var y=Im[a];else y=Os.measureText(np).width,Im[a]=y,Av++;return y}function x1(a,y){var x=a.ec.replace(/\r\n/g,`
`).replace(/\r/g,`
`),E=a.spacingAbove+a.spacingBelow;if(E=Math.max(0,tp(a)+E),x.length===0)return a.Cb=0,a.Gc=1,E;if(!a.isMultiline){var b=x.indexOf(`
`,0);0<=b&&(x=x.substr(0,b))}b=0;for(var z=a.Gc=0,tt,rt=!1;!rt;){if(tt=x.indexOf(`
`,z),tt===-1&&(tt=x.length,rt=!0),z<=tt){if(z=x.substr(z,tt-z),a.wrap!==kv){a.Le=0;var ot=ln.alloc();Mv(a,z,y,ot),b+=ot.height,ln.free(ot),a.Gc+=a.Le}else Mv(a,z,y,null),b+=E,a.Gc++;a.Gc===a.maxLines&&(rt=!0)}z=tt+1}return a.Lq=b}ve.Object.defineProperties(To.prototype,{font:{get:function(){return this.Ae},set:function(a){var y=this.Ae;y!==a&&(this.Ae=a,this.df=null,this.v(),this.g("font",y,a))}},text:{get:function(){return this.ec},set:function(a){var y=this.ec;a!=null?a=a.toString():a="",y!==a&&(this.ec=a,this.v(),this.g("text",y,a),this.Uc=!0)}},textAlign:{get:function(){return this.da!==null?this.da.Or:"start"},set:function(a){var y=this.textAlign;y===a||a!=="start"&&a!=="end"&&a!=="left"&&a!=="right"&&a!=="center"||(Nu(this),this.da.Or=a,this.N(),this.g("textAlign",y,a))}},flip:{get:function(){return this.da!==null?this.da.Xf:un},set:function(a){var y=this.flip;y!==a&&(Nu(this),this.da.Xf=a,this.N(),this.g("flip",y,a))}},verticalAlignment:{get:function(){return this.da!==null?this.da.Yr:au},set:function(a){var y=this.verticalAlignment;y.D(a)||(a=a.J(),Nu(this),this.da.Yr=a,Ps(this),this.g("verticalAlignment",y,a))}},naturalBounds:{get:function(){if(!this.dc.w()){var a=ln.alloc();Mv(this,this.ec,999999,a);var y=a.width;ln.free(a),a=x1(this,y);var x=this.desiredSize;isNaN(x.width)||(y=x.width),isNaN(x.height)||(a=x.height),Wr(this.dc,y,a)}return this.dc}},isMultiline:{get:function(){return(this.l&2097152)!==0},set:function(a){var y=(this.l&2097152)!==0;y!==a&&(this.l^=2097152,this.v(),this.g("isMultiline",y,a))}},isUnderline:{get:function(){return(this.l&4194304)!==0},set:function(a){var y=(this.l&4194304)!==0;y!==a&&(this.l^=4194304,this.Uc=!0,this.N(),this.g("isUnderline",y,a))}},isStrikethrough:{get:function(){return(this.l&8388608)!==0},set:function(a){var y=(this.l&8388608)!==0;y!==a&&(this.l^=8388608,this.Uc=!0,this.N(),this.g("isStrikethrough",y,a))}},wrap:{get:function(){return this.da!==null?this.da.$r:bv},set:function(a){var y=this.wrap;y!==a&&(Nu(this),this.da.$r=a,this.v(),this.g("wrap",y,a))}},overflow:{get:function(){return this.da!==null?this.da.$q:Nv},set:function(a){var y=this.overflow;y!==a&&(Nu(this),this.da.$q=a,this.v(),this.g("overflow",y,a))}},isOverflowed:{get:function(){return(this.l&16777216)!==0}},stroke:{get:function(){return this.xc},set:function(a){var y=this.xc;y!==a&&(a!==null&&zc(a,"TextBlock.stroke"),a instanceof mo&&a.freeze(),this.xc=a,this.N(),this.g("stroke",y,a))}},lineCount:{get:function(){return this.Gc}},lineHeight:{get:function(){return tp(this)}},editable:{get:function(){return(this.l&1048576)!==0},set:function(a){var y=(this.l&1048576)!==0;y!==a&&(this.l^=1048576,this.g("editable",y,a))}},textEditor:{get:function(){return this.da!==null?this.da.Qr:null},set:function(a){var y=this.textEditor;y!==a&&(Nu(this),this.da.Qr=a,this.g("textEditor",y,a))}},errorFunction:{get:function(){return this.da!==null?this.da.Hd:null},set:function(a){var y=this.errorFunction;y!==a&&(Nu(this),this.da.Hd=a,this.g("errorFunction",y,a))}},interval:{get:function(){return this.fa!==null?this.fa.Tk:1},set:function(a){var y=this.interval;if(a=Math.round(a),y!==a&&a!==0&&isFinite(a)){this.fa===null&&(this.fa=new Ku),this.fa.Tk=a,this.v();var x=this.panel;x!==null&&(x.graduatedIntervals=null),this.g("interval",y,a)}}},graduatedStart:{get:function(){return this.fa!==null?this.fa.u:0},set:function(a){var y=this.graduatedStart;y!==a&&(0>a?a=0:1<a&&(a=1),this.fa===null&&(this.fa=new Ku),this.fa.u=a,this.v(),this.g("graduatedStart",y,a))}},graduatedEnd:{get:function(){return this.fa!==null?this.fa.j:1},set:function(a){var y=this.graduatedEnd;y!==a&&(0>a?a=0:1<a&&(a=1),this.fa===null&&(this.fa=new Ku),this.fa.j=a,this.v(),this.g("graduatedEnd",y,a))}},graduatedFunction:{get:function(){return this.fa!==null?this.fa.F:null},set:function(a){var y=this.graduatedFunction;y!==a&&(this.fa===null&&(this.fa=new Ku),this.fa.F=a,this.v(),this.g("graduatedFunction",y,a))}},graduatedSkip:{get:function(){return this.fa!==null?this.fa.o:null},set:function(a){var y=this.graduatedSkip;y!==a&&(this.fa===null&&(this.fa=new Ku),this.fa.o=a,this.v(),this.g("graduatedSkip",y,a))}},textValidation:{get:function(){return this.da!==null?this.da.vj:null},set:function(a){var y=this.textValidation;y!==a&&(Nu(this),this.da.vj=a,this.g("textValidation",y,a))}},textEdited:{get:function(){return this.da!==null?this.da.Pr:null},set:function(a){var y=this.textEdited;y!==a&&(Nu(this),this.da.Pr=a,this.g("textEdited",y,a))}},spacingAbove:{get:function(){return this.da!==null?this.da.Dr:0},set:function(a){var y=this.spacingAbove;y!==a&&(Nu(this),this.da.Dr=a,this.v(),this.g("spacingAbove",y,a))}},spacingBelow:{get:function(){return this.da!==null?this.da.Er:0},set:function(a){var y=this.spacingBelow;y!==a&&(Nu(this),this.da.Er=a,this.v(),this.g("spacingBelow",y,a))}},formatting:{get:function(){return this.da!==null?this.da.gq:ep},set:function(a){var y=this.formatting;y!==a&&(Nu(this),this.da.gq=a,this.v(),this.g("formatting",y,a))}},maxLines:{get:function(){return this.da!==null?this.da.Jq:1/0},set:function(a){var y=this.maxLines;y!==a&&(a=Math.floor(a),0>=a&&wn(a,"> 0",To,"maxLines"),Nu(this),this.da.Jq=a,this.v(),this.g("maxLines",y,a))}},metrics:{get:function(){return{arrSize:this.Qc!==null?this.Qc:[this.Cb],arrText:this.Qb!==null?this.Qb:[this.ze],maxLineWidth:this.Cb,fontHeight:this.df}}},choices:{get:function(){return this.Gm},set:function(a){var y=this.Gm;y!==a&&(this.Gm=a,this.g("choices",y,a))}}});var Tm=null,Dm=null,kv=new He(To,"None",0),P1=new He(To,"WrapFit",1),bv=new He(To,"WrapDesiredSize",2),w1=new He(To,"WrapBreakAll",3),Nv=new He(To,"OverflowClip",0),Om=new He(To,"OverflowEllipsis",1),ep=new He(To,"FormatTrim",0),C1=new He(To,"FormatNone",0),Sx=/[ \u200b\u00ad]/,Bv=new Hi,E1=0,Im=new Hi,Av=0,np="...",L1="",Os=null,_m=!1;To.className="TextBlock";function Tv(){this.nc=!1,this.Hd=null,this.Xf=un,this.gq=ep,this.Jq=1/0,this.$q=Nv,this.Er=this.Dr=0,this.Or="start",this.vj=this.Qr=this.Pr=null,this.Yr=au,this.$r=bv}Tv.prototype.copy=function(){var a=new Tv;return a.Hd=this.Hd,a.Xf=this.Xf,a.gq=this.gq,a.Jq=this.Jq,a.$q=this.$q,a.Dr=this.Dr,a.Er=this.Er,a.Or=this.Or,a.Pr=this.Pr,a.Qr=this.Qr,a.vj=this.vj,a.Yr=this.Yr,a.$r=this.$r,a},To.getEllipsis=function(){return np},To.setEllipsis=function(a){np=a,Im=new Hi,Av=0},To.getBaseline=function(){return Tm},To.setBaseline=function(a){Tm=a},To.getUnderline=function(){return Dm},To.setUnderline=function(a){Dm=a},To.isValidFont=function(a){if(_m||(Os=qo?new Dl(null).context:null,_m=!0),Os===null)return!0;var y=Os.font;if(a===y||a==="10px sans-serif")return!0;Os.font="10px sans-serif",Os.font=a;var x=Os.font;if(x!=="10px sans-serif")return Os.font=y,!0;Os.font="19px serif";var E=Os.font;return Os.font=a,x=Os.font,Os.font=y,x!==E},To.FormatNone=C1,To.FormatTrim=ep,To.None=kv,To.OverflowClip=Nv,To.OverflowEllipsis=Om,To.WrapBreakAll=w1,To.WrapDesiredSize=bv,To.WrapFit=P1;function Ku(){this.Tk=1,this.u=0,this.j=1,this.o=this.F=null}Ku.prototype.copy=function(){var a=new Ku;return a.Tk=this.Tk,a.u=this.u,a.j=this.j,a.F=this.F,a.o=this.o,a},Ku.className="GradElementSettings";function Is(a,y){de.call(this),this.Eg=null,this.qo="",this.Xg=es,this.Nk=xn,this.Zg=this.Hd=null,this.Mk=Or,this.Xf=un,this.vl=null,this.qn=!1,this.en=!0,this.al=!1,this.bt=this.rl=null,typeof a=="string"?this.source=a:a&&Object.assign(this,a),y&&Object.assign(this,y)}var Rf;Se(Is,de),Is.prototype.cloneProtected=function(a){de.prototype.cloneProtected.call(this,a),a.qo=this.qo,a.element=this.Eg,a.Xg=this.Xg.J(),a.Nk=this.Nk,a.Xf=this.Xf,a.Hd=this.Hd,a.Zg=this.Zg,a.Mk=this.Mk.J(),a.en=this.en,a.rl=this.rl},Is.prototype.qb=function(a){a===un||a===wi||a===_r?this.imageStretch=a:de.prototype.qb.call(this,a)},Is.prototype.toString=function(){return"Picture("+this.source+")#"+Ai(this)};function jf(a){a===void 0&&(a=""),a!==""?Rf[a]&&(delete Rf[a],Rm--):(Rf=new Hi,Rm=0)}function F1(a,y){y.qy||(y.Fq=function(x){y.sq=!0,y.ln=!1;var E=y.Bg.copy();if(E!=null){for(E=E.iterator;E.next();){var b=E.value;b.N();var z=y.getAttribute("src")||"",tt=b.Og.I(z);if(tt!==null)for(var rt=tt.length,ot=0;ot<rt;ot++)z=tt[ot],b.Xn.add(z),z.Uc=!0,b.$b(),y.hn&&(y.eu===void 0&&(y.eu=x),z.Zg!==null&&z.Zg(z,x))}y.Bg.clear()}a.desiredSize.w()||(ma(a,!1),a.v())},y.Yp=function(x){y.ln=x;var E=y.Bg.copy();if(E!=null){for(E=E.iterator;E.next();){var b=E.value,z=y.getAttribute("src")||"",tt=b.Og.I(z);if(tt!==null){b=tt.length,z=pi();for(var rt=0;rt<b;rt++)z.push(tt[rt]);if(y.hn)for(rt=0;rt<b;rt++)tt=z[rt],tt.Hd!==null&&tt.Hd(tt,x);oi(z)}}y.Bg.clear()}},y.addEventListener("load",y.Fq),y.addEventListener("error",y.Yp),y.qy=!0)}Is.prototype.hA=function(){if(this.source!==""){jf(this.source);var a=this.source;this.source="",this.source=a}},Is.prototype.redraw=function(){this.N(),this.Uc=!0},Is.prototype.hh=function(a,y){var x=this.Eg;if(x!==null){var E=x.getAttribute("src");if(!(x instanceof HTMLImageElement&&(E===null||E==="")||x.ln instanceof Event&&a instanceof tc)){var b=a instanceof Qs;E=this.naturalBounds;var z=0,tt=0,rt=this.qn,ot=rt?+x.width:x.naturalWidth;if(rt=rt?+x.height:x.naturalHeight,ot===void 0&&x.videoWidth&&(ot=x.videoWidth),rt===void 0&&x.videoHeight&&(rt=x.videoHeight),ot=ot||E.width,rt=rt||E.height,ot!==0&&rt!==0){var lt=ot,ut=rt;this.sourceRect.w()&&(z=this.Xg.x,tt=this.Xg.y,ot=this.Xg.width,rt=this.Xg.height);var ft=ot,yt=rt,xt=this.Nk,Ct=this.Mk;switch(xt){case un:if(this.sourceRect.w())break;ft>=E.width&&(z=z+Ct.offsetX+(ft*Ct.x-E.width*Ct.x)),yt>=E.height&&(tt=tt+Ct.offsetY+(yt*Ct.y-E.height*Ct.y)),ot=Math.min(E.width,ft),rt=Math.min(E.height,yt);break;case xn:ft=E.width,yt=E.height;break;case wi:case _r:xt===wi?(xt=Math.min(E.height/yt,E.width/ft),ft*=xt,yt*=xt):xt===_r&&(xt=Math.max(E.height/yt,E.width/ft),ft*=xt,yt*=xt,ft>=E.width&&(z=(z+Ct.offsetX+(ft*Ct.x-E.width*Ct.x)/ft)*ot),yt>=E.height&&(tt=(tt+Ct.offsetY+(yt*Ct.y-E.height*Ct.y)/yt)*rt),ot*=1/(ft/E.width),rt*=1/(yt/E.height),ft=E.width,yt=E.height)}xt=this.Df()*y.scale;var bt=ft*xt*yt*xt,Wt=ot*rt/bt,jt=x.__goCache;xt=null;var Qt=xx;if(!b){if(x.sq&&jt!==void 0&&4<bt&&Wt>Qt*Qt)for(jt.gi===null&&(k1(jt,4,lt,ut,x),k1(jt,16,lt,ut,x)),b=jt.gi,lt=b.length,ut=0;ut<lt&&b[ut].ratio*b[ut].ratio<Wt;ut++)xt=b[ut];if(!y.Xm){if(this.vl===null)if(this.Eg===null)this.vl=!1;else{b=new Dl(null).context;try{b.drawImage(this.Eg,0,0)}catch(te){this.en=!1}try{b.getImageData(0,0,1,1).data[3]&&(this.vl=!1),this.vl=!1}catch(te){this.vl=!0}}if(this.vl)return}}switch(b=ft<E.width?Ct.offsetX+(E.width*Ct.x-ft*Ct.x):0,Ct=yt<E.height?Ct.offsetY+(E.height*Ct.y-yt*Ct.y):0,this.flip){case Hr:a.translate(Math.min(E.width,ft),0),a.scale(-1,1);break;case yr:a.translate(0,Math.min(E.height,yt)),a.scale(1,-1);break;case wo:a.translate(Math.min(E.width,ft),Math.min(E.height,yt)),a.scale(-1,-1)}if(a.yc(),y.Gf("pictureRatioOptimization")&&!y.$i&&jt!==void 0&&xt!==null&&xt.ratio!==1){a.save(),y=xt.ratio;try{a.drawImage(xt.source,z/y,tt/y,Math.min(xt.source.width,ot/y),Math.min(xt.source.height,rt/y),b,Ct,Math.min(E.width,ft),Math.min(E.height,yt)),a instanceof Qs&&(this.bt=[z/y,tt/y,Math.min(xt.source.width,ot/y),Math.min(xt.source.height,rt/y),b,Ct,Math.min(E.width,ft),Math.min(E.height,yt)])}catch(te){this.en=!1}a.restore()}else try{a.drawImage(x,z,tt,ot,rt,b,Ct,Math.min(E.width,ft),Math.min(E.height,yt)),a instanceof Qs&&(this.bt=[z,tt,ot,rt,b,Ct,Math.min(E.width,ft),Math.min(E.height,yt)])}catch(te){this.en=!1}switch(this.flip){case Hr:a.scale(-1,1),a.translate(-Math.min(E.width,ft),0);break;case yr:a.scale(1,-1),a.translate(0,-Math.min(E.height,yt));break;case wo:a.scale(-1,-1),a.translate(-Math.min(E.width,ft),-Math.min(E.height,yt))}}}}},Is.prototype.Wl=function(a,y,x,E){var b=this.desiredSize,z=Ds(this,!0),tt=this.Eg,rt=this.qn,ot=0,lt=0;(rt||!this.al&&tt&&tt.complete)&&(this.al=!0),tt===null?(isFinite(b.width)||(a=0),isFinite(b.height)||(y=0)):(ot=rt?+tt.width:tt.naturalWidth,lt=rt?+tt.height:tt.naturalHeight),isFinite(b.width)||z===xn||z===Li?(isFinite(a)||(this.sourceRect.w()?a=this.sourceRect.width:tt!==null&&(a=ot)),x=0):tt!==null&&this.al!==!1&&(a=this.sourceRect.w()?this.sourceRect.width:ot),isFinite(b.height)||z===xn||z===ji?(isFinite(y)||(this.sourceRect.w()?y=this.sourceRect.height:tt!==null&&(y=lt)),E=0):tt!==null&&this.al!==!1&&(y=this.sourceRect.w()?this.sourceRect.height:lt),isFinite(b.width)&&(a=b.width),isFinite(b.height)&&(y=b.height),b=this.maxSize,z=this.minSize,x=Math.max(x||0,z.width),E=Math.max(E||0,z.height),a=Math.min(b.width,a),y=Math.min(b.height,y),a=Math.max(x,a),y=Math.max(E,y),tt===null||tt.complete||(isFinite(a)||(a=0),isFinite(y)||(y=0)),Wr(this.dc,a,y),this.Ge(0,0,a,y)},Is.prototype.eh=function(a,y,x,E){fs(this,a,y,x,E)},ve.Object.defineProperties(Is.prototype,{element:{get:function(){return this.Eg},set:function(a){var y=this.Eg;if(this.Uc=!0,y!==a){this.qn=a instanceof HTMLCanvasElement;var x=a instanceof HTMLImageElement;a===null||x||a instanceof HTMLVideoElement||this.qn||$t("Picture.element must be an instance of Image, Canvas, or Video, not: "+a);var E=this.diagram;E!==null&&Og(E,this),this.Eg=a,a!==null&&x&&a.Bg===void 0&&(a.Bg=new pn),E!==null&&x&&dd(E,this),a!==null&&(this.qn||a.complete===!0?(a.hn&&(a.ln instanceof Event&&this.Hd!==null?this.Hd(this,a.ln):a.sq===!0&&!a.ln&&this.Zg!==null&&a.eu&&this.Zg(this,a.eu)),a.sq=!0,this.desiredSize.w()||(ma(this,!1),this.v())):x&&F1(this,a)),this.g("element",y,a),this.N()}}},source:{get:function(){return this.qo},set:function(a){var y=this.qo;if(y!==a){this.Uc=!0,this.qo=a;var x=Rf;if(qo){var E=null;if(x[a]!==void 0)E=x[a];else if(a!==""){30<Rm&&(jf(),x=Rf),E=Zn("img"),E.hn=!0,F1(this,E);var b=this.rl;b!==null&&(E.crossOrigin=b(this)),E.src=a,x[a]=E,Rm++}this.element=E,E!==null&&E.__goCache===void 0&&(E.__goCache=new M1),this.v(),this.N()}this.g("source",y,a)}}},sourceCrossOrigin:{get:function(){return this.rl},set:function(a){if(this.rl!==a&&(this.rl=a,this.element!==null)){var y=this.element.getAttribute("src");a===null&&typeof y=="string"?this.element.crossOrigin=null:a!==null&&(this.element.crossOrigin=a(this)),this.element.src=y}}},sourceRect:{get:function(){return this.Xg},set:function(a){var y=this.Xg;y.D(a)||(this.Xg=a=a.J(),this.N(),this.g("sourceRect",y,a))}},imageStretch:{get:function(){return this.Nk},set:function(a){var y=this.Nk;y!==a&&(this.Nk=a,this.N(),this.g("imageStretch",y,a))}},flip:{get:function(){return this.Xf},set:function(a){var y=this.Xf;y!==a&&(this.Xf=a,this.N(),this.g("flip",y,a))}},imageAlignment:{get:function(){return this.Mk},set:function(a){var y=this.Mk;y.D(a)||(this.Mk=a=a.J(),this.N(),this.g("imageAlignment",y,a))}},errorFunction:{get:function(){return this.Hd},set:function(a){var y=this.Hd;y!==a&&(this.Hd=a,this.g("errorFunction",y,a))}},successFunction:{get:function(){return this.Zg},set:function(a){var y=this.Zg;y!==a&&(this.Zg=a,this.g("successFunction",y,a))}},naturalBounds:{get:function(){return this.dc}}}),Is.prototype.redraw=Is.prototype.redraw,Is.prototype.reloadSource=Is.prototype.hA;var Rm=0,xx=4;Is.className="Picture",Rf=new Hi,Is.clearCache=jf;function M1(){this.gi=null}function k1(a,y,x,E,b){a.gi===null&&(a.gi=[]);var z=new Dl(null),tt=z.context,rt=1/y;z.width=x/y,z.height=E/y,z.width!==0&&z.height!==0&&(y=new b1(z.Oa,y),x=1,0<a.gi.length&&(x=a.gi[a.gi.length-1],b=x.source,x=x.ratio),tt.setTransform(rt*x,0,0,rt*x,0,0),tt.yc(),tt.drawImage(b,0,0),a.gi.push(y))}M1.className="PictureCacheArray";function b1(a,y){this.source=a,this.ratio=y}b1.className="PictureCacheInstance";function zf(){this.os=new Ye,this.mc=null}zf.prototype.reset=function(a){a!==null?(a.ka(),this.os=a,a.figures.clear()):this.os=new Ye,this.mc=null};function Zf(a,y,x,E,b,z){a.mc=new Ur,a.mc.startX=y,a.mc.startY=x,a.mc.isFilled=E,a.mc.isEvenOdd=z||!1,a.os.figures.add(a.mc),b!==void 0&&(a.mc.isShadowed=b)}function Px(a){var y=a.mc.segments.length;0<y&&a.mc.segments.M(y-1).close()}zf.prototype.moveTo=function(a,y,x){x===void 0&&(x=!1);var E=new Ri(wr);E.endX=a,E.endY=y,x&&E.close(),this.mc.segments.add(E)},zf.prototype.lineTo=function(a,y,x){x===void 0&&(x=!1);var E=new Ri(Qi);E.endX=a,E.endY=y,x&&E.close(),this.mc.segments.add(E)};function Ih(a,y,x,E,b,z,tt){var rt;rt===void 0&&(rt=!1);var ot=new Ri(ar);ot.point1X=y,ot.point1Y=x,ot.point2X=E,ot.point2Y=b,ot.endX=z,ot.endY=tt,rt&&ot.close(),a.mc.segments.add(ot)}function jm(a,y,x,E,b){var z;z===void 0&&(z=!1);var tt=new Ri(so);tt.point1X=y,tt.point1Y=x,tt.endX=E,tt.endY=b,z&&tt.close(),a.mc.segments.add(tt)}zf.prototype.arcTo=function(a,y,x,E,b,z,tt){z===void 0&&(z=0),tt===void 0&&(tt=!1);var rt=new Ri(xr);rt.startAngle=a,rt.sweepAngle=y,rt.centerX=x,rt.centerY=E,rt.radiusX=b,rt.radiusY=z!==0?z:b,tt&&rt.close(),this.mc.segments.add(rt)};function wx(a,y,x,E,b,z,tt,rt){var ot;ot===void 0&&(ot=!1),y=new Ri(Ji,tt,rt,y,x,E,b,z),ot&&y.close(),a.mc.segments.add(y)}function N1(a){var y=zm;return y!==null?(zm=null,y.reset(a),y):(y=new zf,y.reset(a),y)}var zm=null;zf.className="StreamGeometryContext";function ls(a,y){var x=a.toLowerCase(),E=Zt.Ze;E[a]=y,E[x]=a}ls("Rectangle",function(a,y,x){a="r"+y+","+x;var E=Zt.Mf[a];return E!==void 0||(E=new Ye(Ye.u),E.endX=y,E.endY=x,Zt.Nf<Zt.vm&&(Zt.Mf[a]=E,Zt.Nf++)),E}),ls("Square",function(a,y,x){a="s"+y+","+x;var E=Zt.Mf[a];return E!==void 0||(E=new Ye(Ye.u),E.endX=y,E.endY=x,E.defaultStretch=wi,Zt.Nf<Zt.vm&&(Zt.Mf[a]=E,Zt.Nf++)),E}),ls("RoundedRectangle",function(a,y,x){a=a?a.parameter1:NaN,(isNaN(a)||0>a)&&(a=5),a=Math.min(a,y/3),a=Math.min(a,x/3);var E="rr"+y+","+x+","+a,b=Zt.Mf[E];if(b!==void 0)return b;var z=a*Zt.wg;return b=new Ye().add(new Ur(a,0,!0).add(new Ri(Qi,y-a,0)).add(new Ri(ar,y,a,y-z,0,y,z)).add(new Ri(Qi,y,x-a)).add(new Ri(ar,y-a,x,y,x-z,y-z,x)).add(new Ri(Qi,a,x)).add(new Ri(ar,0,x-a,z,x,0,x-z)).add(new Ri(Qi,0,a)).add(new Ri(ar,a,0,0,z,z,0).close())),1<z&&(b.spot1=new In(0,0,z,z),b.spot2=new In(1,1,-z,-z)),Zt.Nf<Zt.vm&&(Zt.Mf[E]=b,Zt.Nf++),b}),ls("Border","RoundedRectangle"),ls("Ellipse",function(a,y,x){a="e"+y+","+x;var E=Zt.Mf[a];return E!==void 0||(E=new Ye(Ye.F),E.endX=y,E.endY=x,E.spot1=Lo,E.spot2=ro,Zt.Nf<Zt.vm&&(Zt.Mf[a]=E,Zt.Nf++)),E}),ls("Circle",function(a,y,x){a="c"+y+","+x;var E=Zt.Mf[a];return E!==void 0||(E=new Ye(Ye.F),E.endX=y,E.endY=x,E.spot1=Lo,E.spot2=ro,E.defaultStretch=wi,Zt.Nf<Zt.vm&&(Zt.Mf[a]=E,Zt.Nf++)),E}),ls("TriangleRight",function(a,y,x){return new Ye().add(new Ur(0,0).add(new Ri(Qi,y,.5*x)).add(new Ri(Qi,0,x).close())).pm(0,.25,.5,.75)}),ls("TriangleDown",function(a,y,x){return new Ye().add(new Ur(0,0).add(new Ri(Qi,y,0)).add(new Ri(Qi,.5*y,x).close())).pm(.25,0,.75,.5)}),ls("TriangleLeft",function(a,y,x){return new Ye().add(new Ur(y,x).add(new Ri(Qi,0,.5*x)).add(new Ri(Qi,y,0).close())).pm(.5,.25,1,.75)}),ls("TriangleUp",function(a,y,x){return new Ye().add(new Ur(y,x).add(new Ri(Qi,0,x)).add(new Ri(Qi,.5*y,0).close())).pm(.25,.5,.75,1)}),ls("Triangle","TriangleUp"),ls("Diamond",function(a,y,x){return new Ye().add(new Ur(.5*y,0).add(new Ri(Qi,0,.5*x)).add(new Ri(Qi,.5*y,x)).add(new Ri(Qi,y,.5*x).close())).pm(.25,.25,.75,.75)}),ls("LineH",function(a,y,x){return a=new Ye(Ye.j),a.startX=0,a.startY=x/2,a.endX=y,a.endY=x/2,a}),ls("LineV",function(a,y,x){return a=new Ye(Ye.j),a.startX=y/2,a.startY=0,a.endX=y/2,a.endY=x,a}),ls("None","Rectangle"),ls("BarH","Rectangle"),ls("BarV","Rectangle"),ls("MinusLine","LineH"),ls("PlusLine",function(a,y,x){return new Ye().add(new Ur(0,x/2,!1).add(new Ri(Qi,y,x/2)).add(new Ri(wr,y/2,0)).add(new Ri(Qi,y/2,x)))}),ls("XLine",function(a,y,x){return new Ye().add(new Ur(0,x,!1).add(new Ri(Qi,y,0)).add(new Ri(wr,0,0)).add(new Ri(Qi,y,x)))}),ls("LineRight",function(a,y,x){return new Ye().add(new Ur(.25*y,0,!1).add(new Ri(Qi,.75*y,.5*x)).add(new Ri(Qi,.25*y,x)))}),ls("LineDown",function(a,y,x){return new Ye().add(new Ur(0,.25*x,!1).add(new Ri(Qi,.5*y,.75*x)).add(new Ri(Qi,y,.25*x)))}),ls("LineLeft",function(a,y,x){return new Ye().add(new Ur(.75*y,0,!1).add(new Ri(Qi,.25*y,.5*x)).add(new Ri(Qi,.75*y,x)))}),ls("LineUp",function(a,y,x){return new Ye().add(new Ur(0,.75*x,!1).add(new Ri(Qi,.5*y,.25*x)).add(new Ri(Qi,y,.75*x)))}),Zt.um={"":"",Standard:"F1 m 0,0 l 8,4 -8,4 2,-4 z",Backward:"F1 m 8,0 l -2,4 2,4 -8,-4 z",Triangle:"F1 m 0,0 l 8,4.62 -8,4.62 z",BackwardTriangle:"F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",Boomerang:"F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",BackwardBoomerang:"F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",SidewaysV:"m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",BackwardV:"m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",OpenTriangle:"m 0,0 l 8,4 -8,4",BackwardOpenTriangle:"m 8,0 l -8,4 8,4",OpenTriangleLine:"m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8",BackwardOpenTriangleLine:"m 8,0 l -8,4 8,4 m -8.5,0 l 0,-8",OpenTriangleTop:"m 0,0 l 8,4 m 0,4",BackwardOpenTriangleTop:"m 8,0 l -8,4 m 0,4",OpenTriangleBottom:"m 0,8 l 8,-4",BackwardOpenTriangleBottom:"m 0,4 l 8,4",HalfTriangleTop:"F1 m 0,0 l 0,4 8,0 z m 0,8",BackwardHalfTriangleTop:"F1 m 8,0 l 0,4 -8,0 z m 0,8",HalfTriangleBottom:"F1 m 0,4 l 0,4 8,-4 z",BackwardHalfTriangleBottom:"F1 m 8,4 l 0,4 -8,-4 z",ForwardSemiCircle:"m 4,0 b 270 180 0 4 4",BackwardSemiCircle:"m 4,8 b 90 180 0 -4 4",Feather:"m 0,0 l 3,4 -3,4",BackwardFeather:"m 3,0 l -3,4 3,4",DoubleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardDoubleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",TripleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardTripleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",ForwardSlash:"m 0,8 l 5,-8",BackSlash:"m 0,0 l 5,8",DoubleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8",DoubleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8",TripleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8",TripleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",Fork:"m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",LineFork:"m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardLineFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",CircleFork:"F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",CircleLineFork:"F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleLineFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3",Circle:"F1 m 8,4 b 0 360 -4 0 4 z",Block:"F1 m 0,0 l 0,8 8,0 0,-8 z",StretchedDiamond:"F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z",Diamond:"F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z",Chevron:"F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z",StretchedChevron:"F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z",NormalArrow:"F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z",X:"m 0,0 l 8,8 m 0,-8 l -8,8",TailedNormalArrow:"F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z",DoubleTriangle:"F1 m 0,0 l 4,4 -4,4 0,-8 z m 4,0 l 4,4 -4,4 0,-8 z",BigEndArrow:"F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z",ConcaveTailArrow:"F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z",RoundedTriangle:"F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z",SimpleArrow:"F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z",AccelerationArrow:"F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z",BoxArrow:"F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z",TriangleLine:"F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",CircleEndedArrow:"F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",DynamicWidthArrow:"F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",EquilibriumArrow:"m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",FastForward:"F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",Kite:"F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",HalfArrowTop:"F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",HalfArrowBottom:"F1 m 0,8 l 4,-4 4,0 -8,4 z",OpposingDirectionDoubleArrow:"F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",PartialDoubleTriangle:"F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",LineCircle:"F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",DoubleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",TripleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",CircleLine:"F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",DiamondCircle:"F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",PlusCircle:"F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8",OpenRightTriangleTop:"m 8,0 l 0,4 -8,0 m 0,4",OpenRightTriangleBottom:"m 8,8 l 0,-4 -8,0",Line:"m 0,0 l 0,8",DoubleLine:"m 0,0 l 0,8 m 2,0 l 0,-8",TripleLine:"m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",PentagonArrow:"F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z"};function Dv(){this.nc=!1,this.tr=this.Kp=this.zq=null,this.vr="",this.fr=this.oq=this.ur=null,this.hr="",this.gr=jr,this.ir=null,this.jr="",this.lr=xa,this.Gq="",this.Hq=eo,this.Pq=Nn,this.Kq=Yn,this.Up=null,this.Cq=127,this.zr=ai,this.yr="gray",this.Vg=4}Dv.prototype.copy=function(){var a=new Dv;return a.zq=this.zq,a.Kp=this.Kp,a.tr=this.tr,a.vr=this.vr,a.ur=this.ur,a.oq=this.oq,a.fr=this.fr,a.hr=this.hr,a.gr=this.gr.J(),a.ir=this.ir,a.jr=this.jr,a.lr=this.lr.J(),a.Gq=this.Gq,a.Hq=this.Hq.J(),a.Pq=this.Pq.J(),a.Kq=this.Kq.J(),a.Up=this.Up,a.Cq=this.Cq,a.zr=this.zr.J(),a.yr=this.yr,a.Vg=this.Vg,a};function Ni(a,y){a===void 0||a instanceof wa||typeof a=="string"?En.call(this,a):(En.call(this),a&&(y=a)),this.G=2408959,this.Tf="",this.P=null,this.Jg="",this.Qf=this.Ug=null,this.ec="",this.Ah=this.Ig=null,this.ke=new At(NaN,NaN).freeze(),this.nf=null,this.Ao=NaN,this.vw=-1,this.py=new Be,this.Rh=null,this.ag=NaN,y&&Object.assign(this,y)}Se(Ni,En),Ni.prototype.cloneProtected=function(a){En.prototype.cloneProtected.call(this,a),a.G=this.G&-4097|49152,a.Tf=this.Tf,this.P!==null&&(a.P=this.P.nc?this.P:this.P.copy()),a.Jg=this.Jg,a.Qf=null,a.ec=this.ec,a.ke.assign(this.ke),a.Ao=this.Ao},wt=Ni.prototype,wt.Af=function(a){En.prototype.Af.call(this,a),a.oh(),a.Ug=null,a.nf=null,a.Rh=null},wt.toString=function(){var a=hi(this.constructor)+"#"+Ai(this);return this.data!==null&&(a+="("+Bi(this.data)+")"),a};function _s(a){a.P===null?a.P=new Dv:a.P.nc&&(a.P=a.P.copy())}wt.th=function(){En.prototype.th.call(this),this.P!==null&&(this.P.nc=!0)},wt.gk=function(a,y,x,E,b,z,tt){var rt=this.diagram;rt!==null&&(a===fo&&y==="elements"?b instanceof En?ec(b,function(ot){sy(rt.partManager,ot),Ud(rt,ot)}):dd(rt,b):a===Mo&&y==="elements"&&(b instanceof En?ec(b,function(ot){ly(rt.partManager,ot,rt)}):Og(rt,b)),rt.cb(a,y,x,E,b,z,tt))},wt.La=function(a){if(En.prototype.La.call(this,a),this.data!==null){for(var y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E];b instanceof En&&ec(b,function(z){z.data!==null&&z.La()})}for(y=this.adornments;y.next();)y.value.La(a)}},Ni.prototype.updateRelationshipsFromData=function(){var a;this.data!==null&&((a=this.diagram)===null||a===void 0||a.partManager.updateRelationshipsFromData(this))},Ni.prototype.Pj=function(a){var y=this.Qf;return y===null?null:y.I(a)},Ni.prototype.bh=function(a,y){if(y!==null){var x=null,E=this.Qf;if(E!==null&&(x=E.I(a)),x!==y){if(x!==null){var b=x.diagram;b!==null&&b.remove(x)}E===null&&(this.Qf=E=new Ie),y.Tf!==a&&(y.category=a),E.add(a,y),a=this.diagram,a!==null&&(a.add(y),a=y.adornedObject,a!==null&&(a=a.ih(),a!==null&&(y.data=a.data)))}}},Ni.prototype.Jf=function(a){var y=this.Qf;if(y!==null){var x=y.I(a);if(x!==null){var E=x.diagram;E!==null&&E.remove(x)}y.remove(a),y.count===0&&(this.Qf=null)}},Ni.prototype.Ej=function(){var a=this.Qf;if(a!==null){var y=pi();for(a=a.iterator;a.next();)y.push(a.key);a=y.length;for(var x=0;x<a;x++)this.Jf(y[x]);oi(y)}},Ni.prototype.updateAdornments=function(){var a=this.diagram;if(a!==null){for(var y=this.adornments;y.next();){var x=y.value;x.v(),x.placeholder&&x.placeholder.v()}t:{if(this.isSelected&&this.selectionAdorned&&(y=this.selectionObject,y!==null&&this.actualBounds.w()&&this.isVisible()&&y.Ed()&&y.actualBounds.w())){if(x=this.Pj("Selection"),x===null){if(x=this.selectionAdornmentTemplate,x===null&&(x=this.ph()?a.linkSelectionAdornmentTemplate:this instanceof or?a.groupSelectionAdornmentTemplate:a.nodeSelectionAdornmentTemplate),!(x instanceof Yr))break t;Ol(x),x=x.copy(),x!==null&&(this.ph()&&this.selectionObject===this.path&&(x.type=En.Link),x.adornedObject=y)}if(x!==null){x.type===En.Link&&x.v(),this.bh("Selection",x);break t}}this.Jf("Selection")}for(Cx(this,a),y=this.adornments;y.next();)y.value.La()}},Ni.prototype.Wb=function(){var a=this.diagram;a!==null&&(a.vd=!0,!(this.G&16384)&&(this.G|=16384))};function Ov(a){a.G&16384&&(a.updateAdornments(),a.G&=-16385)}function Cx(a,y){y.toolManager.mouseDownTools.each(function(x){x.isEnabled&&x.updateAdornments(a)}),y.toolManager.updateAdornments(a)}function Zm(a){if(pd(a)===!1){_v(a,!0),a.Uk();var y=a.diagram;y!==null&&(y.De.add(a),y.$b())}}function B1(a){if(a.G|=2097152,pd(a)!==!1){var y=a.position,x=a.location;x.w()&&y.w()||D1(a,y,x),x=a.Ib;var E=Be.alloc().assign(x);x.ka(),x.x=y.x,x.y=y.y,x.freeze(),a.Xl(E,x),Be.free(E),_v(a,!1)}}Ni.prototype.Ge=function(a,y,x,E){var b=this.uc;b.h(a,y,x,E),this.Lb===null&&(this.Lb=new fe);var z=this.Lb;z.reset(),this.no(z,a,y,x,E),this.Lb=z,z.ws()||z.pp(b)},Ni.prototype.no=function(a,y,x,E,b){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=Or;this.locationSpot.sb()&&(z=this.locationSpot);var tt=At.alloc();if(this.locationObject!==this)for(y=this.locationObject,x=y.naturalBounds,tt.yi(x.x,x.y,x.width,x.height,z),y.Lb!==null&&y.Lb.Ga(tt),tt.offset(-y.measuredBounds.x,-y.measuredBounds.y),z=y.panel;z!==null&&z!==this;)z.Lb!==null&&z.Lb.Ga(tt),tt.offset(-z.measuredBounds.x,-z.measuredBounds.y),z=z.panel;else tt.yi(y,x,E,b,z);a.rotate(this.Kb,tt.x,tt.y),At.free(tt)}},Ni.prototype.move=function(a,y){y===!0?this.location=a:this.position=a},Ni.prototype.moveTo=function(a,y,x){a=At.allocAt(a,y),this.move(a,x),At.free(a)},Ni.prototype.isVisible=function(){if(!this.visible)return!1;var a=this.layer;if(a!==null){if(!a.visible)return!1;if(a=a.diagram,a!==null&&a.animationManager.fv(this))return!0}return a=this.containingGroup,!!(a===null||a.isSubGraphExpanded&&a.isVisible())},Ni.prototype.Zb=function(a){var y=this.diagram;a?(this.C(4),this.Wb(),y!==null&&y.De.add(this)):(this.C(8),this.Ej()),this.oh(),y!==null&&(y.Ya(),y.N())},Ni.prototype.fb=function(a){if(this.name===a)return this;var y=this.Rh;if(y===null&&(this.Rh=y=new Ie),y.I(a)!==null)return y.I(a);var x=En.prototype.fb.call(this,a);return x!==null?(y.set(a,x),x):(y.set(a,null),null)};function _h(a,y,x,E){E===void 0&&(E=new At),x=x.Mc()?Or:x;var b=y.naturalBounds;if(E.h(b.width*x.x+x.offsetX,b.height*x.y+x.offsetY),y===null||y===a)return E;for(y.transform.Ga(E),y=y.panel;y!==null&&y!==a;)y.transform.Ga(E),y=y.panel;return a.Lb!==null&&a.Lb.Ga(E),E.offset(-a.uc.x,-a.uc.y),E}Ni.prototype.mi=function(a){return a===void 0&&(a=new Be),a.assign(this.actualBounds)},Ni.prototype.Va=function(){this.measure(1/0,1/0),this.arrange()};function A1(a){var y=At.alloc(),x=a.locationObject,E=x.naturalBounds,b=x instanceof cr?x.strokeWidth:0;if(y.yi(0,0,E.width+b,E.height+b,a.locationSpot),x!==a)for(y.offset(-b/2,-b/2),x.transform.Ga(y),x=x.panel;x!==null&&x!==a;)x.transform.Ga(y),x=x.panel;return a.Lb!==null&&a.Lb.Ga(y),y.offset(-a.uc.x,-a.uc.y),y}function rc(a,y){var x=a.py;isNaN(a.ag)&&(a.ag=u1(a));var E=a.ag,b=2*E;if(!a.isShadowed)return x.h(y.x-1-E,y.y-1-E,y.width+2+b,y.height+2+b),x;E=y.x,b=y.y;var z=y.width;y=y.height;var tt=a.shadowBlur;return a=a.shadowOffset,z+=tt,y+=tt,E-=tt/2,b-=tt/2,0<a.x?z+=a.x:(E+=a.x,z-=a.x),0<a.y?y+=a.y:(b+=a.y,y-=a.y),x.h(E-1,b-1,z+2,y+2),x}Ni.prototype.arrange=function(){if(ws(this)===!1)B1(this);else{Gu(this,!1);var a=this.Ib,y=Be.alloc();y.assign(a);var x=md(this);this.eh(0,0,this.uc.width,this.uc.height);var E=this.position;D1(this,E,this.location),a.ka(),a.x=E.x,a.y=E.y,a.freeze(),this.Xl(y,a),y.D(a)?this.Fd(x):!this.Zc()||Zt.B(y.width,a.width)&&Zt.B(y.height,a.height)||0<=this.vw&&this.C(16),Be.free(y),_v(this,!1)}},wt=Ni.prototype,wt.Xl=function(a,y){var x=this.diagram;if(x!==null){var E=!1;if(x.Zi===!1&&a.w()){var b=Be.alloc();b.assign(x.documentBounds),b.Fv(x.padding),a.x>b.x&&a.y>b.y&&a.right<b.right&&a.bottom<b.bottom&&y.x>b.x&&y.y>b.y&&y.right<b.right&&y.bottom<b.bottom&&(E=!0),Be.free(b)}!(this.G&65536)&&a.D(y)||_1(this,E,x),x.N(),!a.w()&&!y.w()||Qr(a,y)||(this instanceof qn&&!x.undoManager.isUndoingRedoing&&this.Bd(),this.oh())}},wt.zv=function(a,y,x){if(this.ph()||!a.w())return!1;var E=this.diagram;return E!==null&&T1(this,E,a,y,x),this.pa=a,this.G&=-2097153,!this.ke.w()||E!==null&&!E.animationManager.isTicking&&E.undoManager.isUndoingRedoing||(E=this.ke,this.ke=new At(E.x+(a.x-y),E.y+(a.y-x)),this.g("location",E,this.ke.copy())),pd(this)===!1&&ws(this)===!1&&(Zm(this),B1(this)),!0};function T1(a,y,x,E,b){y===null||a instanceof Yr||(y=y.animationManager,y.zb&&cf(y,a,new At(E,b),x))}wt.mm=function(a,y,x){var E=this.ke,b=this.pa;if(x){if(E.x===a&&E.y===y)return;pd(this)||ws(this)?b.h(NaN,NaN):b.h(b.x+a-E.x,b.y+y-E.y),E.h(a,y)}else{if(b.x===a&&b.y===y)return;E.h(E.x+a-b.x,E.y+y-b.y),b.h(a,y)}Zm(this)},wt.Av=function(){this.G&=-2097153,Zm(this)};function D1(a,y,x){var E=A1(a),b=a.diagram,z=x.w(),tt=y.w();z&&tt?a.G&2097152?O1(a,y,x,b,E):I1(a,y,x,b,E):z?O1(a,y,x,b,E):tt&&I1(a,y,x,b,E),a.G|=2097152,At.free(E),a.Uk()}function O1(a,y,x,E,b){var z=y.x,tt=y.y;y.h(x.x-b.x,x.y-b.y),E!==null&&(x=E.animationManager,(E=x.defaultAnimation.isAnimating)||!x.zb||a instanceof Yr||cf(x,a,new At(z,tt),y),E||y.x===z&&y.y===tt||a.g("position",new At(z,tt),y.copy()))}function I1(a,y,x,E,b){var z=x.copy();x.h(y.x+b.x,y.y+b.y),x.D(z)||E===null||a.g("location",z,x.copy())}function _1(a,y,x){Rv(a,!1),a instanceof qn&&Nh(x,a),a.layer.isTemporary||y||x.Ya(),y=a.Ib;var E=x.viewportBounds;E.w()?md(a)?(Eo(y,E)||a.Fd(!1),a.updateAdornments()):a.isVisible()&&y.Yc(E)?(a.Fd(!0),a.updateAdornments()):a.Wb():x.vd=!0}wt.si=function(){return!0},wt.Zc=function(){return!0},wt.ph=function(){return!1},wt.Dd=function(){return!0};function Iv(a,y,x,E){y.constructor===a.constructor||z1||(z1=!0,ri('Should not change the class of the Part when changing category from "'+x+'" to "'+E+'"'),ri(" Old class: "+hi(a.constructor)+", new class: "+hi(y.constructor)+", part: "+a.toString())),a.Ej();var b=a.data;x=a.layerName;var z=a.isSelected,tt=a.isHighlighted,rt=!0,ot=!0,lt=!1;a instanceof qn&&(rt=a.isTreeLeaf,ot=a.isTreeExpanded,lt=a.wasTreeExpanded),y.Af(a),y.cloneProtected(a),a.Tf=E,a.svg!==null&&(a.svg.remove(),a.svg=null,a.Uc=!0),a.v(),a.N(),y=a.diagram,E=!0,y!==null&&(E=y.skipsUndoManager,y.skipsUndoManager=!0),a.ub=b,a.G=z?a.G|4096:a.G&-4097,a.G=tt?a.G|524288:a.G&-524289,a instanceof qn&&(a.U=rt?a.U|4:a.U&-5,a.U=ot?a.U|1:a.U&-2,a.U=lt?a.U|2:a.U&-3),b!==null&&a.La(),b=a.layerName,b!==x&&(a.Jg=x,a.layerName=b),y!==null&&(y.skipsUndoManager=E),a.Zc()&&a.C(64)}Ni.prototype.canCopy=function(){if(!this.copyable)return!1;var a=this.layer;return a===null?!0:a.allowCopy?(a=a.diagram,a===null?!0:!!a.allowCopy):!1},Ni.prototype.canDelete=function(){if(!this.deletable)return!1;var a=this.layer;return a===null?!0:a.allowDelete?(a=a.diagram,a===null?!0:!!a.allowDelete):!1},Ni.prototype.canEdit=function(){if(!this.textEditable)return!1;var a=this.layer;return a===null?!0:a.allowTextEdit?(a=a.diagram,a===null?!0:!!a.allowTextEdit):!1},Ni.prototype.canGroup=function(){if(!this.groupable)return!1;var a=this.layer;return a===null?!0:a.allowGroup?(a=a.diagram,a===null?!0:!!a.allowGroup):!1},Ni.prototype.canMove=function(){if(!this.movable)return!1;var a=this.layer;return a===null?!0:a.allowMove?(a=a.diagram,a===null?!0:!!a.allowMove):!1},Ni.prototype.canReshape=function(){if(!this.reshapable)return!1;var a=this.layer;return a===null?!0:a.allowReshape?(a=a.diagram,a===null?!0:!!a.allowReshape):!1},Ni.prototype.canResize=function(){if(!this.resizable)return!1;var a=this.layer;return a===null?!0:a.allowResize?(a=a.diagram,a===null?!0:!!a.allowResize):!1},Ni.prototype.canRotate=function(){if(!this.rotatable)return!1;var a=this.layer;return a===null?!0:a.allowRotate?(a=a.diagram,a===null?!0:!!a.allowRotate):!1},Ni.prototype.canSelect=function(){if(!this.selectable)return!1;var a=this.layer;return a===null?!0:a.allowSelect?(a=a.diagram,a===null?!0:!!a.allowSelect):!1};function pd(a){return(a.G&32768)!==0}function _v(a,y){a.G=y?a.G|32768:a.G&-32769}function Rv(a,y){a.G=y?a.G|65536:a.G&-65537}function md(a){return(a.G&131072)!==0}wt=Ni.prototype,wt.Fd=function(a){this.G=a?this.G|131072:this.G&-131073};function Gm(a,y){a.G=y?a.G|1048576:a.G&-1048577}wt.oh=function(){var a=this.containingGroup;a!==null&&(a.v(),a.placeholder!==null&&a.placeholder.v(),a.Bd())},wt.N=function(){var a=this.diagram;a!==null&&!ws(this)&&!pd(this)&&this.isVisible()&&this.Ib.w()&&a.N(rc(this,this.Ib))},wt.v=function(){En.prototype.v.call(this);var a=this.diagram;a!==null&&(a.De.add(this),this instanceof qn&&this.labeledLink!==null&&Ps(this.labeledLink),a.$b(!0))},wt.Vo=function(a){a||(a=this.Ah,a!==null&&Wv(a,this))},wt.Wo=function(a){a||(a=this.Ah,a!==null&&Vv(a,this))},wt.Lj=function(){var a=this.data;if(a!==null){var y=this.diagram;y!==null&&(y=y.model,y!==null&&y.cm(a))}},wt.oz=function(){return jv(this,this)};function jv(a,y){var x=y.containingGroup;return x!==null?1+jv(a,x):y instanceof qn&&(y=y.labeledLink,y!==null)?jv(a,y):0}wt.sz=function(){return R1(this,this)};function R1(a,y){var x=y.containingGroup;return x!==null||y instanceof qn&&(x=y.labeledLink,x!==null)?R1(a,x):y}wt.Td=function(a){return a instanceof or?zv(this,this,a):!1};function zv(a,y,x){if(y===x||x===null)return!1;var E=y.containingGroup;return E===null||E!==x&&!zv(a,E,x)?y instanceof qn&&(y=y.labeledLink,y!==null)?zv(a,y,x):!1:!0}wt.px=function(a){if(a===null)return null;if(this===a)return this.containingGroup;for(var y=this;y!==null;){if(y instanceof or&&Gm(y,!0),y instanceof qn){var x=y.labeledLink;x!==null&&(y=x)}y=y.containingGroup}for(x=null,y=a;y!==null;){if(y.G&1048576){x=y;break}y instanceof qn&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup}for(y=this;y!==null;)y instanceof or&&Gm(y,!1),y instanceof qn&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup;return x},Ni.prototype.canLayout=function(){if(!this.isLayoutPositioned||!this.isVisible())return!1;var a=this.layer;return!(a!==null&&a.isTemporary||this instanceof qn&&this.isLinkLabel)},Ni.prototype.C=function(a){if(a===void 0&&(a=16777215),this.isLayoutPositioned&&a&this.layoutConditions){var y=this.layer;y!==null&&y.isTemporary||this instanceof qn&&this.isLinkLabel?y=!1:(y=this.diagram,y=!(y!==null&&y.undoManager.isUndoingRedoing))}else y=!1;if(y)if(y=this.Ah,y!==null){var x=y.layout;x!==null?x.C():y.C(a)}else a=this.diagram,a!==null&&(a=a.layout,a!==null&&a.C())};function j1(a){return a.isVisible()?(a=a.layer,!(a!==null&&a.isTemporary)):!1}function vd(a,y,x,E,b,z){if(z===void 0&&(z=null),!(a.contains(y)||z!==null&&!z(y)||y instanceof Yr)){if(a.add(y),y instanceof qn){if(x&&y instanceof or)for(var tt=y.memberParts;tt.next();)vd(a,tt.value,x,E,b,z);if(b!==!1)for(tt=y.linksConnected;tt.next();){var rt=tt.value;if(!a.contains(rt)){var ot=rt.fromNode,lt=rt.toNode;ot=ot===null||a.contains(ot),lt=lt===null||a.contains(lt),(b?ot&&lt:ot||lt)&&vd(a,rt,x,E,b,z)}}if(1<E)for(y=y.Ou();y.next();)vd(a,y.value,x,E-1,b,z)}else if(y instanceof Tn)for(y=y.labelNodes;y.next();)vd(a,y.value,x,E,b,z)}}ve.Object.defineProperties(Ni.prototype,{key:{get:function(){var a=this.diagram;if(a!==null)return a.model.wa(this.data)}},adornments:{get:function(){return this.Qf===null?Ar:this.Qf.iteratorValues}},layer:{get:function(){return this.Ig}},diagram:{get:function(){var a=this.Ig;return a==null?null:a.diagram}},layerName:{get:function(){return this.Jg},set:function(a){var y=this.Jg;if(y!==a){var x=this.diagram;if((x===null||x.Qj(a)!==null&&!x.partManager.addsToTemporaryLayer)&&(this.Jg=a,x!==null&&x.Ya(),this.g("layerName",y,a),y=this.layer,y!==null&&y.name!==a&&(x=y.diagram,x!==null&&(a=x.Qj(a),a!==null&&a!==y)))){var E=y.pc(-1,this,!0);if(0<=E&&x.cb(Mo,"parts",y,this,null,E,!0),E=a.oi(99999999,this,!0),y.visible!==a.visible&&this.Zb(a.visible),0<=E&&x.cb(fo,"parts",a,null,this,!0,E),E=this.layerChanged,E!==null){var b=x.aa;x.aa=!0,E(this,y,a),x.aa=b}}}}},layerChanged:{get:function(){return this.P!==null?this.P.zq:null},set:function(a){var y=this.layerChanged;y!==a&&(_s(this),this.P.zq=a,this.g("layerChanged",y,a))}},zOrder:{get:function(){return this.Ao},set:function(a){var y=this.Ao;if(y!==a){this.Ao=a;var x=this.layer;x!==null&&pf(x,-1,this),this.g("zOrder",y,a),a=this.diagram,a!==null&&a.N()}}},locationObject:{get:function(){if(this.nf===null){var a=this.locationObjectName;a!==""?(a=this.fb(a),a!==null?this.nf=a:this.nf=this):this instanceof Yr?this.type!==En.Link&&this.placeholder!==null?this.nf=this.placeholder:this.nf=this:this.nf=this}return this.nf.visible?this.nf:this}},minLocation:{get:function(){return this.P!==null?this.P.Pq:Nn},set:function(a){var y=this.minLocation;y.D(a)||(a=a.J(),_s(this),this.P.Pq=a,this.g("minLocation",y,a))}},maxLocation:{get:function(){return this.P!==null?this.P.Kq:Yn},set:function(a){var y=this.maxLocation;y.D(a)||(a=a.J(),_s(this),this.P.Kq=a,this.g("maxLocation",y,a))}},locationObjectName:{get:function(){return this.P!==null?this.P.Gq:""},set:function(a){var y=this.locationObjectName;y!==a&&(_s(this),this.P.Gq=a,this.nf=null,this.v(),this.g("locationObjectName",y,a))}},locationSpot:{get:function(){return this.P!==null?this.P.Hq:eo},set:function(a){var y=this.locationSpot;y.D(a)||(a=a.J(),_s(this),this.P.Hq=a,this.v(),this.g("locationSpot",y,a))}},location:{get:function(){return this.ke},set:function(a){var y=a.x,x=a.y,E=this.ke;if(!(E.x===y||isNaN(E.x)&&isNaN(y))||!(E.y===x||isNaN(E.y)&&isNaN(x))){if(a=a.copy(),y=a,this.ph())y=!1;else{if(this.ke=y,this.G|=2097152,ws(this)===!1&&(Zm(this),x=this.pa,x.w())){var b=this.diagram;if(b===null||b.animationManager.isTicking||!b.undoManager.isUndoingRedoing){var z=x.copy();x.h(x.x+(y.x-E.x),x.y+(y.y-E.y)),T1(this,b,x,z.x,z.y),this.g("position",z,x.copy())}}y=!0}y&&this.g("location",E,a.copy())}}},category:{get:function(){return this.Tf},set:function(a){var y=this.Tf;if(y!==a){this.svg!==null&&(this.svg.remove(),this.Uc=!0);var x=this.diagram,E=this.data,b=null;if(x!==null&&E!==null&&!(this instanceof Yr)){var z=x.model.undoManager;z.isEnabled&&!z.isUndoingRedoing&&(b=this.clone(),b.O.addAll(this.O))}this.Tf=a,this.g("category",y,a),x===null||E===null||this instanceof Yr?this instanceof Yr&&(b=this.adornedPart,b!==null&&(a=b.Qf,a!==null&&a.remove(y),b.bh(this.category,this))):(z=x.model,z.undoManager.isUndoingRedoing||(this.ph()?(x.partManager.setLinkCategoryForData(E,a),x=x.partManager.findLinkTemplateForCategory(a),x!==null&&(Ol(x),x=x.copy(),x!==null&&Iv(this,x,y,a))):(z!==null&&z.jm(E,a),x=dS(x.partManager,E,a),x!==null&&(Ol(x),x=x.copy(),x===null||x instanceof Tn||(E=this.location.copy(),Iv(this,x,y,a),this.location.w()||(this.location=E)))),b!==null&&(y=this.clone(),y.O.addAll(this.O),this.g("self",b,y))))}}},self:{get:function(){return this},set:function(a){Iv(this,a,this.category,a.category)}},copyable:{get:function(){return(this.G&1)!==0},set:function(a){var y=(this.G&1)!==0;y!==a&&(this.G^=1,this.g("copyable",y,a))}},deletable:{get:function(){return(this.G&2)!==0},set:function(a){var y=(this.G&2)!==0;y!==a&&(this.G^=2,this.g("deletable",y,a))}},textEditable:{get:function(){return(this.G&4)!==0},set:function(a){var y=(this.G&4)!==0;y!==a&&(this.G^=4,this.g("textEditable",y,a),this.Wb())}},groupable:{get:function(){return(this.G&8)!==0},set:function(a){var y=(this.G&8)!==0;y!==a&&(this.G^=8,this.g("groupable",y,a))}},movable:{get:function(){return(this.G&16)!==0},set:function(a){var y=(this.G&16)!==0;y!==a&&(this.G^=16,this.g("movable",y,a))}},selectionAdorned:{get:function(){return(this.G&32)!==0},set:function(a){var y=(this.G&32)!==0;y!==a&&(this.G^=32,this.g("selectionAdorned",y,a),this.Wb())}},isInDocumentBounds:{get:function(){return(this.G&64)!==0},set:function(a){var y=(this.G&64)!==0;if(y!==a){this.G^=64;var x=this.diagram;x!==null&&x.Ya(),this.g("isInDocumentBounds",y,a)}}},isLayoutPositioned:{get:function(){return(this.G&128)!==0},set:function(a){var y=(this.G&128)!==0;y!==a&&(this.G^=128,this.g("isLayoutPositioned",y,a),this.C(a?4:8))}},selectable:{get:function(){return(this.G&256)!==0},set:function(a){var y=(this.G&256)!==0;y!==a&&(this.G^=256,this.g("selectable",y,a),this.Wb())}},reshapable:{get:function(){return(this.G&512)!==0},set:function(a){var y=(this.G&512)!==0;y!==a&&(this.G^=512,this.g("reshapable",y,a),this.Wb())}},resizable:{get:function(){return(this.G&1024)!==0},set:function(a){var y=(this.G&1024)!==0;y!==a&&(this.G^=1024,this.g("resizable",y,a),this.Wb())}},rotatable:{get:function(){return(this.G&2048)!==0},set:function(a){var y=(this.G&2048)!==0;y!==a&&(this.G^=2048,this.g("rotatable",y,a),this.Wb())}},isSelected:{get:function(){return(this.G&4096)!==0},set:function(a){var y=(this.G&4096)!==0;if(y!==a){var x=this.diagram;if(!a||this.canSelect()&&!(x!==null&&x.selection.count>=x.maxSelectionCount)){this.G^=4096;var E=!1;if(x!==null){E=x.skipsUndoManager,x.skipsUndoManager=!0;var b=x.selection;b.ka(),a?b.add(this):b.remove(this),b.freeze()}this.g("isSelected",y,a),this.Wb(),a=this.selectionChanged,a!==null&&a(this),x!==null&&(x.$b(),x.skipsUndoManager=E)}}}},isHighlighted:{get:function(){return(this.G&524288)!==0},set:function(a){var y=(this.G&524288)!==0;if(y!==a){this.G^=524288;var x=this.diagram;x!==null&&(x=x.highlighteds,x.ka(),a?x.add(this):x.remove(this),x.freeze()),this.g("isHighlighted",y,a),this.N(),a=this.highlightedChanged,a!==null&&a(this)}}},isShadowed:{get:function(){return(this.G&8192)!==0},set:function(a){var y=(this.G&8192)!==0;y!==a&&(this.G^=8192,this.Uc=!0,this.g("isShadowed",y,a),this.N())}},isAnimated:{get:function(){return(this.G&262144)!==0},set:function(a){var y=(this.G&262144)!==0;y!==a&&(this.G^=262144,this.g("isAnimated",y,a))}},highlightedChanged:{get:function(){return this.P!==null?this.P.oq:null},set:function(a){var y=this.highlightedChanged;y!==a&&(_s(this),this.P.oq=a,this.g("highlightedChanged",y,a))}},selectionObjectName:{get:function(){return this.P!==null?this.P.vr:""},set:function(a){var y=this.selectionObjectName;y!==a&&(_s(this),this.P.vr=a,this.Ug=null,this.g("selectionObjectName",y,a))}},selectionAdornmentTemplate:{get:function(){return this.P!==null?this.P.tr:null},set:function(a){var y=this.selectionAdornmentTemplate;y!==a&&(_s(this),this.P.tr=a,this.g("selectionAdornmentTemplate",y,a))}},selectionObject:{get:function(){if(this.Ug===null){var a=this.selectionObjectName;a!==null&&a!==""?(a=this.fb(a),a!==null?this.Ug=a:this.Ug=this):this instanceof Tn?(a=this.path,a!==null?this.Ug=a:this.Ug=this):this.Ug=this}return this.Ug}},selectionChanged:{get:function(){return this.P!==null?this.P.ur:null},set:function(a){var y=this.selectionChanged;y!==a&&(_s(this),this.P.ur=a,this.g("selectionChanged",y,a))}},resizeAdornmentTemplate:{get:function(){return this.P!==null?this.P.fr:null},set:function(a){var y=this.resizeAdornmentTemplate;y!==a&&(_s(this),this.P.fr=a,this.g("resizeAdornmentTemplate",y,a))}},resizeObjectName:{get:function(){return this.P!==null?this.P.hr:""},set:function(a){var y=this.resizeObjectName;y!==a&&(_s(this),this.P.hr=a,this.g("resizeObjectName",y,a))}},resizeObject:{get:function(){var a=this.resizeObjectName;return a!==""&&(a=this.fb(a),a!==null)?a:this}},resizeCellSize:{get:function(){return this.P!==null?this.P.gr:jr},set:function(a){var y=this.resizeCellSize;y.D(a)||(a=a.J(),_s(this),this.P.gr=a,this.g("resizeCellSize",y,a))}},rotateAdornmentTemplate:{get:function(){return this.P!==null?this.P.ir:null},set:function(a){var y=this.rotateAdornmentTemplate;y!==a&&(_s(this),this.P.ir=a,this.g("rotateAdornmentTemplate",y,a))}},rotateObjectName:{get:function(){return this.P!==null?this.P.jr:""},set:function(a){var y=this.rotateObjectName;y!==a&&(_s(this),this.P.jr=a,this.g("rotateObjectName",y,a))}},rotateObject:{get:function(){var a=this.rotateObjectName;return a!==""&&(a=this.fb(a),a!==null)?a:this}},rotationSpot:{get:function(){return this.P!==null?this.P.lr:xa},set:function(a){var y=this.rotationSpot;y.D(a)||(a=a.J(),_s(this),this.P.lr=a,this.g("rotationSpot",y,a))}},text:{get:function(){return this.ec},set:function(a){var y=this.ec;y!==a&&(this.ec=a,this.g("text",y,a))}},containingGroup:{get:function(){return this.Ah},set:function(a){if(this.Zc()){var y=this.Ah;if(y!==a){a===null||this!==a&&!a.Td(this)||(this===a&&$t("Cannot make a Group a member of itself: "+this.toString()),$t("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString())),this.C(2);var x=this.diagram;if(y!==null?Vv(y,this):this instanceof or&&x!==null&&x.ai.remove(this),this.Ah=a,a!==null?Wv(a,this):this instanceof or&&x!==null&&x.ai.add(this),this.C(1),x!==null&&x.aa){var E=this.data,b=x.model;if(E!==null&&b.Xj()){var z=b.wa(a!==null?a.data:null);b.mp(E,z)}}if(E=this.containingGroupChanged,E!==null&&(b=!0,x!==null&&(b=x.aa,x.aa=!0),E(this,y,a),x!==null&&(x.aa=b)),this instanceof or){for(x=new pn,vd(x,this,!0,0,!0),x=x.iterator;x.next();)if(E=x.value,E instanceof qn)for(E=E.linksConnected;E.next();)Gf(E.value)}if(this instanceof qn){for(x=this.linksConnected;x.next();)Gf(x.value);x=this.labeledLink,x!==null&&Gf(x)}this.g("containingGroup",y,a),a!==null&&(y=a.layer,y!==null&&pf(y,-1,a))}}else $t("cannot set the Part.containingGroup of a Link or Adornment")}},containingGroupChanged:{get:function(){return this.P!==null?this.P.Kp:null},set:function(a){var y=this.containingGroupChanged;y!==a&&(_s(this),this.P.Kp=a,this.g("containingGroupChanged",y,a))}},isTopLevel:{get:function(){return!(this.containingGroup!==null||this instanceof qn&&this.labeledLink!==null)}},layoutConditions:{get:function(){return this.P!==null?this.P.Cq:127},set:function(a){var y=this.layoutConditions;y!==a&&(_s(this),this.P.Cq=a,this.g("layoutConditions",y,a))}},dragComputation:{get:function(){return this.P!==null?this.P.Up:null},set:function(a){var y=this.dragComputation;y!==a&&(_s(this),this.P.Up=a,this.g("dragComputation",y,a))}},shadowOffset:{get:function(){return this.P!==null?this.P.zr:ai},set:function(a){var y=this.shadowOffset;y.D(a)||(a=a.J(),_s(this),this.P.zr=a,this.N(),this.g("shadowOffset",y,a))}},shadowColor:{get:function(){return this.P!==null?this.P.yr:"gray"},set:function(a){var y=this.shadowColor;y!==a&&(_s(this),this.P.yr=a,this.N(),this.g("shadowColor",y,a))}},shadowBlur:{get:function(){return this.P!==null?this.P.Vg:4},set:function(a){var y=this.shadowBlur;y!==a&&(_s(this),this.P.Vg=a,this.N(),this.g("shadowBlur",y,a))}}}),Ni.prototype.invalidateLayout=Ni.prototype.C,Ni.prototype.findCommonContainingGroup=Ni.prototype.px,Ni.prototype.isMemberOf=Ni.prototype.Td,Ni.prototype.findTopLevelPart=Ni.prototype.sz,Ni.prototype.findSubGraphLevel=Ni.prototype.oz,Ni.prototype.ensureBounds=Ni.prototype.Va,Ni.prototype.getDocumentBounds=Ni.prototype.mi,Ni.prototype.findObject=Ni.prototype.fb,Ni.prototype.moveTo=Ni.prototype.moveTo,Ni.prototype.invalidateAdornments=Ni.prototype.Wb,Ni.prototype.clearAdornments=Ni.prototype.Ej,Ni.prototype.removeAdornment=Ni.prototype.Jf,Ni.prototype.addAdornment=Ni.prototype.bh,Ni.prototype.findAdornment=Ni.prototype.Pj,Ni.prototype.updateTargetBindings=Ni.prototype.La;var z1=!1;Ni.className="Part",Ni.LayoutNone=0,Ni.LayoutAdded=1,Ni.LayoutRemoved=2,Ni.LayoutShown=4,Ni.LayoutHidden=8,Ni.LayoutNodeSized=16,Ni.LayoutGroupLayout=32,Ni.LayoutNodeReplaced=64,Ni.LayoutStandard=127,Ni.LayoutAll=16777215;function Yr(a,y){a===void 0||a instanceof wa||typeof a=="string"?Ni.call(this,a):(Ni.call(this),a&&(y=a)),this.G&=-257,this.Jg="Adornment",this.ue=null,this.Aw=0,this.Uw=!1,this.j=this.$a=null,y&&Object.assign(this,y)}Se(Yr,Ni),Yr.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(a!==null?a.toString():"")},Yr.prototype.updateRelationshipsFromData=function(){},Yr.prototype.Ul=function(a){var y=this.adornedObject,x=y==null?void 0:y.part;if(x instanceof Tn&&y instanceof cr){y=x.path,x.Ul(a),a=y.geometry,x=this.O.s,y=x.length;for(var E=0;E<y;E++){var b=x[E];b.isPanelMain&&b instanceof cr&&(b.ua=a)}}},Yr.prototype.si=function(){var a=this.ue;return a===null?!0:(a=a.part,a===null||!ws(a))},Yr.prototype.Zc=function(){return!1},Yr.prototype.gk=function(a,y,x,E,b,z,tt){if(a===fo&&y==="elements"){if(b instanceof Es)this.$a===null&&(this.$a=b);else if(b instanceof En){var rt=b.Nl(function(ot){return ot instanceof Es});rt instanceof Es&&this.$a===null&&(this.$a=rt)}}else a===Mo&&y==="elements"&&this.$a!==null&&(E===this.$a?this.$a=null:E instanceof En&&this.$a.rg(E)&&(this.$a=null));Ni.prototype.gk.call(this,a,y,x,E,b,z,tt)},Yr.prototype.updateAdornments=function(){},Yr.prototype.Lj=function(){},ve.Object.defineProperties(Yr.prototype,{placeholder:{get:function(){return this.$a}},adornedObject:{get:function(){return this.ue},set:function(a){var y=this.adornedPart,x=null;a!==null&&(x=a.part),y===null||a!==null&&y===x||y.Jf(this.category),this.ue=a,x!==null&&x.bh(this.category,this)}},adornedPart:{get:function(){var a=this.ue;return a!==null?a.part:null}},containingGroup:{get:function(){return null}}}),Yr.className="Adornment";function Zv(){this.nc=!1,this.Vr=this.gj=this.Eq=this.Dq=null,this.yp=$r,this.er=Vm,this.Kr=this.ij=this.Nq=this.Mq=null}Zv.prototype.copy=function(){var a=new Zv;return a.Dq=this.Dq,a.Eq=this.Eq,a.gj=this.gj,a.Vr=this.Vr,a.yp=this.yp.J(),a.er=this.er,a.Mq=this.Mq,a.Nq=this.Nq,a.ij=this.ij,a.Kr=this.Kr,a};function qn(a,y){a===void 0||a instanceof wa||typeof a=="string"?Ni.call(this,a):(Ni.call(this),a&&(y=a)),this.U=13,this.Ba=null,this.jb=new fn,this.wc=this.af=this.Yk=null,this.ci=!1,y&&Object.assign(this,y)}Se(qn,Ni),qn.prototype.cloneProtected=function(a){Ni.prototype.cloneProtected.call(this,a),a.U=this.U,this.Ba!==null&&(a.Ba=this.Ba.nc?this.Ba:this.Ba.copy())},wt=qn.prototype,wt.Af=function(a){Ni.prototype.Af.call(this,a),a.Bd(),a.af=this.af,a.wc=null};function Rh(a){a.Ba===null?a.Ba=new Zv:a.Ba.nc&&(a.Ba=a.Ba.copy())}wt.th=function(){Ni.prototype.th.call(this),this.Ba!==null&&(this.Ba.nc=!0)};function Z1(a,y){y!==null&&(a.af===null&&(a.af=new pn),a.af.add(y))}function G1(a,y,x,E){if(y===null||a.af===null)return null;for(var b=a.af.iterator;b.next();){var z=b.value;if(z.Ds===a&&z.cv===y&&z.Ox===x&&z.Px===E||z.Ds===y&&z.cv===a&&z.Ox===E&&z.Px===x)return z}return null}wt.Lz=function(a,y,x){y==null&&(y=""),x==null&&(x=""),a=G1(this,a,y,x),a!==null&&a.Sl()},wt.gk=function(a,y,x,E,b,z,tt){a===fo&&y==="elements"?this.wc=null:a===Mo&&y==="elements"&&(this.wc=null),Ni.prototype.gk.call(this,a,y,x,E,b,z,tt)},wt.Bd=function(a){for(var y=this.linksConnected;y.next();){var x=y.value;a!==void 0&&a.contains(x)||($s(x.fromPort),$s(x.toPort),x.bb())}};function H1(a,y){for(a=a.linksConnected;a.next();){var x=a.value;(x.fromPort===y||x.toPort===y)&&($s(x.fromPort),$s(x.toPort),x.bb())}}function $s(a){if(a!==null){var y=a.Zn;y!==null&&y.Sl(),a=a.part,y=a.containingGroup,y===null||a.isVisible()||$s(y.port)}}wt.si=function(){return!0},qn.prototype.getAvoidableRect=function(a){return a.set(this.actualBounds),a.Co(this.avoidableMargin),a},qn.prototype.findVisibleNode=function(){for(var a=this;a!==null&&!a.isVisible();)a=a.containingGroup;return a},qn.prototype.isVisible=function(){if(!Ni.prototype.isVisible.call(this))return!1;var a=!0,y=Ah,x=this.diagram;if(x!==null&&(a=x.isTreePathToChildren,y=x.treeCollapsePolicy),y===Ah){if(a=this.pg(),a!==null&&!a.isTreeExpanded)return!1}else if(y===pa){if(a=a?this.Oo():this.Po(),0<a.count&&a.all(function(E){return!E.isTreeExpanded}))return!1}else if(y===Mf&&(a=a?this.Oo():this.Po(),0<a.count&&a.any(function(E){return!E.isTreeExpanded})))return!1;return a=this.labeledLink,a!==null?a.isVisible():!0},qn.prototype.Zb=function(a){Ni.prototype.Zb.call(this,a);for(var y=this.linksConnected;y.next();){var x=y.value;if(a&&this.containingGroup!==null){var E=x.To(this);E===null||E.Td(this.containingGroup)||x.bb()}x.Zb(a)}},qn.prototype.qx=function(){var a=new pn,y=new pn;return W1(this,this,a,y),y.iterator};function W1(a,y,x,E){if(y!==null&&!x.has(y)){x.add(y);var b=!0,z=a.diagram;z!==null&&(b=z.isTreePathToChildren),y.linksConnected.each(function(tt){tt.isTreeLink?(b?tt.fromNode===y:tt.toNode===y)&&W1(a,b?tt.toNode:tt.fromNode,x,E):E.add(tt)})}}qn.prototype.findLinksConnected=function(a){if(a===void 0&&(a=null),a===null)return this.jb.iterator;var y=new Br(this.jb),x=this;return y.predicate=function(E){return E.fromNode===x&&E.fromPortId===a||E.toNode===x&&E.toPortId===a},y},wt=qn.prototype,wt.Mo=function(a){a===void 0&&(a=null);var y=new Br(this.jb),x=this;return y.predicate=function(E){return E.fromNode!==x?!1:a===null?!0:E.fromPortId===a},y},wt.Sd=function(a){a===void 0&&(a=null);var y=new Br(this.jb),x=this;return y.predicate=function(E){return E.toNode!==x?!1:a===null?!0:E.toPortId===a},y},wt.Mu=function(a){a===void 0&&(a=null);for(var y=null,x=null,E=this.jb.iterator;E.next();){var b=E.value;b.fromNode===this?(a===null||b.fromPortId===a)&&(b=b.toNode,y!==null?y.add(b):x!==null&&x!==b?(y=new pn,y.add(x),y.add(b)):x=b):b.toNode!==this||a!==null&&b.toPortId!==a||(b=b.fromNode,y!==null?y.add(b):x!==null&&x!==b?(y=new pn,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new Pr(x):Ar},wt.Po=function(a){a===void 0&&(a=null);for(var y=null,x=null,E=this.jb.iterator;E.next();){var b=E.value;b.fromNode!==this||a!==null&&b.fromPortId!==a||(b=b.toNode,y!==null?y.add(b):x!==null&&x!==b?(y=new pn,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new Pr(x):Ar},wt.Oo=function(a){a===void 0&&(a=null);for(var y=null,x=null,E=this.jb.iterator;E.next();){var b=E.value;b.toNode!==this||a!==null&&b.toPortId!==a||(b=b.fromNode,y!==null?y.add(b):x!==null&&x!==b?(y=new pn,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new Pr(x):Ar},wt.jz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var E=new Br(this.jb),b=this;return E.predicate=function(z){return!((z.fromNode!==b||z.toNode!==a||y!==null&&z.fromPortId!==y||x!==null&&z.toPortId!==x)&&(z.fromNode!==a||z.toNode!==b||x!==null&&z.fromPortId!==x||y!==null&&z.toPortId!==y))},E},wt.kz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var E=new Br(this.jb),b=this;return E.predicate=function(z){return!(z.fromNode!==b||z.toNode!==a||y!==null&&z.fromPortId!==y||x!==null&&z.toPortId!==x)},E};function Hm(a,y,x){$s(x);var E=a.jb.contains(y);if(E||a.jb.add(y),!E||y.fromNode===y.toNode){var b=a.linkConnected;if(b!==null){var z=!0,tt=a.diagram;tt!==null&&(z=tt.aa,tt.aa=!0),b(a,y,x),tt!==null&&(tt.aa=z)}}!E&&y.isTreeLink&&(x=y.fromNode,y=y.toNode,x!==null&&y!==null&&x!==y&&(E=!0,a=a.diagram,a!==null&&(E=a.isTreePathToChildren),b=E?y:x,z=E?x:y,b.ci||(b.ci=z),!z.isTreeLeaf||a!==null&&a.undoManager.isUndoingRedoing||(E?x===z&&(z.isTreeLeaf=!1):y===z&&(z.isTreeLeaf=!1))))}function Wm(a,y,x){$s(x);var E=a.jb.remove(y),b=null;if(E||y.toNode===y.fromNode){var z=a.linkDisconnected;if(b=a.diagram,z!==null){var tt=!0;b!==null&&(tt=b.aa,b.aa=!0),z(a,y,x),b!==null&&(b.aa=tt)}}E&&y.isTreeLink&&(x=!0,b!==null&&(x=b.isTreePathToChildren),a=x?y.toNode:y.fromNode,y=x?y.fromNode:y.toNode,a!==null&&(a.ci=!1),y===null||y.isTreeLeaf||(y.jb.count===0?(y.ci=null,b!==null&&b.undoManager.isUndoingRedoing||(y.isTreeLeaf=!0)):ip(y)))}function ip(a){if(a.ci=!1,a.jb.count!==0){var y=!0,x=a.diagram;if(x===null||!x.undoManager.isUndoingRedoing){for(x!==null&&(y=x.isTreePathToChildren),x=a.jb.iterator;x.next();){var E=x.value;if(E.isTreeLink){if(y){if(E.fromNode===a){a.isTreeLeaf=!1;return}}else if(E.toNode===a){a.isTreeLeaf=!1;return}}}a.isTreeLeaf=!0}}}qn.prototype.updateRelationshipsFromData=function(){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)},wt=qn.prototype,wt.Vo=function(a){Ni.prototype.Vo.call(this,a),a||(ip(this),a=this.Yk,a!==null&&q1(a,this))},wt.Wo=function(a){Ni.prototype.Wo.call(this,a),a||(a=this.Yk,a!==null&&a.wd!==null&&(a.wd.remove(this),a.v()))},wt.Lj=function(){if(0<this.jb.count){var a=this.diagram;if(a!==null)for(var y=a.commandHandler!==null?a.commandHandler.deletesConnectedLinks:!0,x=this.jb.copy().iterator;x.next();){var E=x.value;y?a.remove(E):(E.fromNode===this&&(E.fromNode=null),E.toNode===this&&(E.toNode=null))}}this.labeledLink=null,Ni.prototype.Lj.call(this)},wt.ns=function(a){if(this.wc===null){if(a===""&&this.Te===!1)return this;V1(this)}var y=this.wc.I(a);return y!==null||a!==""&&(y=this.wc.I(""),y!==null)?y:this};function V1(a){a.wc===null?a.wc=new Ie:a.wc.clear(),a.qm(a,function(y,x){K1(y,x)}),a.wc.count===0&&a.wc.add("",a)}function K1(a,y){var x=y.portId;x!==null&&a.wc!==null&&a.wc.add(x,y)}function Gv(a,y,x){var E=y.portId;if(E!==null&&(a.wc!==null&&a.wc.remove(E),y=a.diagram,y!==null&&x)){for(x=null,a=a.findLinksConnected(E);a.next();)E=a.value,x===null&&(x=pi()),x.push(E);if(x!==null){for(a=0;a<x.length;a++)y.remove(x[a]);oi(x)}}}wt.Nz=function(a){if(a===null||a===this)return!1;var y=!0,x=this.diagram;if(x!==null&&(y=x.isTreePathToChildren),x=this,y)for(;x!==a;){y=null;for(var E=x.jb.iterator;E.next();){var b=E.value;if(b.isTreeLink&&(y=b.fromNode,y!==x&&y!==this))break}if(y===this||y===null||y===x)return!1;x=y}else for(;x!==a;){for(y=null,E=x.jb.iterator;E.next()&&(b=E.value,!b.isTreeLink||(y=b.toNode,y===x||y===this)););if(y===this||y===null||y===x)return!1;x=y}return!0},wt.xz=function(){var a=!0,y=this.diagram;if(y!==null&&(a=y.isTreePathToChildren),y=this,a)for(;;){a=null;for(var x=y.jb.iterator;x.next();){var E=x.value;if(E.isTreeLink&&(a=E.fromNode,a!==y&&a!==this))break}if(a===this)return this;if(a===null||a===y)return y;y=a}else for(;;){for(a=null,x=y.jb.iterator;x.next()&&(E=x.value,!E.isTreeLink||(a=E.toNode,a===y||a===this)););if(a===this)return this;if(a===null||a===y)return y;y=a}},wt.gz=function(a){if(a===null)return null;if(this===a)return this;for(var y=this;y!==null;)Gm(y,!0),y=y.pg();var x=null;for(y=a;y!==null;){if(y.G&1048576){x=y;break}y=y.pg()}for(y=this;y!==null;)Gm(y,!1),y=y.pg();return x},wt.kh=function(){var a=!0,y=this.diagram;if(y!==null&&(a=y.isTreePathToChildren),y=this.jb.iterator,a){for(;y.next();)if(a=y.value,a.isTreeLink&&a.fromNode!==this)return a}else for(;y.next();)if(a=y.value,a.isTreeLink&&a.toNode!==this)return a;return null},wt.pg=function(){var a=this.ci;if(a===null)return null;if(a instanceof qn)return a;a=this.diagram,a=a!==null?a.isTreePathToChildren:!0;for(var y=this.jb.iterator;y.next();){var x=y.value;if(x.isTreeLink&&(x=a?x.fromNode:x.toNode,x!==this))return this.ci=x}return this.ci=null},wt.vz=function(){function a(x,E){E.add(x);var b=x.kh();b!==null&&(E.add(b),x=x.pg(),x!==null&&a(x,E))}var y=new pn;return a(this,y),y},wt.uz=function(){return U1(this,this)};function U1(a,y){return y=y.pg(),y===null?0:1+U1(a,y)}wt.Qo=function(){var a=!0,y=this.diagram;y!==null&&(a=y.isTreePathToChildren),y=new Br(this.jb);var x=this;return y.predicate=a?function(E){return!!(E.isTreeLink&&E.fromNode===x)}:function(E){return!!(E.isTreeLink&&E.toNode===x)},y},wt.Ou=function(){var a=!0,y=this.diagram;y!==null&&(a=y.isTreePathToChildren);var x=y=null,E=this.jb.iterator;if(a)for(;E.next();)a=E.value,a.isTreeLink&&a.fromNode===this&&(a=a.toNode,y!==null?y.add(a):x!==null&&x!==a?(y=new fn,y.add(x),y.add(a)):x=a);else for(;E.next();)a=E.value,a.isTreeLink&&a.toNode===this&&(a=a.fromNode,y!==null?y.add(a):x!==null&&x!==a?(y=new fn,y.add(x),y.add(a)):x=a);return y!==null?y.iterator:x!==null?new Pr(x):Ar},wt.wz=function(a){a===void 0&&(a=1/0);var y=new pn;return vd(y,this,!1,a,!0),y},qn.prototype.collapseTree=function(a){a===void 0&&(a=1),1>a&&(a=1);var y=this.diagram;if(y!==null&&!y.Ue){y.Ue=!0;var x=new pn;x.add(this),Y1(this,x,y.isTreePathToChildren,a,y,this,y.treeCollapsePolicy===Ah),y.Ue=!1}};function Y1(a,y,x,E,b,z,tt){if(1<E)for(var rt=x?a.Mo():a.Sd();rt.next();){var ot=rt.value;ot.isTreeLink&&(ot=ot.To(a),ot===null||ot===a||y.contains(ot)||(y.add(ot),Y1(ot,y,x,E-1,b,z,tt)))}else X1(a,y,x,b,z,tt)}function X1(a,y,x,E,b,z){for(var tt=b===a?!0:a.isTreeExpanded,rt=x?a.Mo():a.Sd(),ot={};rt.next();){var lt=rt.value;if(lt.isTreeLink&&(lt=lt.To(a),lt!==null&&lt!==a)){var ut=y.contains(lt);if(ut||y.add(lt),tt){var ft=x?lt.Oo():lt.Po();ot.uv=a,ft.all(function(yt){return function(xt){return xt===yt.uv||!xt.isTreeExpanded}}(ot))&&E.Aj(lt,b),lt.oh(),lt.Zb(!1)}lt.isTreeExpanded&&(lt.wasTreeExpanded=lt.isTreeExpanded,ut||X1(lt,y,x,E,b,z))}ot={uv:ot.uv}}a.isTreeExpanded=!1}qn.prototype.expandTree=function(a){a===void 0&&(a=2),2>a&&(a=2);var y=this.diagram;if(y!==null&&!y.Ue){y.Ue=!0;var x=new pn;x.add(this),J1(this,x,y.isTreePathToChildren,a,y,this,y.treeCollapsePolicy===Ah),y.Ue=!1}};function J1(a,y,x,E,b,z,tt){for(var rt=z===a?!1:a.isTreeExpanded,ot=x?a.Mo():a.Sd(),lt={};ot.next();){var ut=ot.value;if(ut.isTreeLink&&(rt||ut.fd||ut.bb(),ut=ut.To(a),ut!==null&&ut!==a&&!y.contains(ut))){if(y.add(ut),!rt){ut.Zb(!0),ut.oh();var ft=x?ut.Oo():ut.Po();lt.vv=a,ft.all(function(yt){return function(xt){return xt===yt.vv||!xt.isTreeExpanded}}(lt))&&b.Cj(ut,z)}(2<E||ut.wasTreeExpanded)&&(ut.wasTreeExpanded=!1,J1(ut,y,x,E-1,b,z,tt))}lt={vv:lt.vv}}a.isTreeExpanded=!0}ve.Object.defineProperties(qn.prototype,{portSpreading:{get:function(){return this.Ba!==null?this.Ba.er:Vm},set:function(a){var y=this.portSpreading;y!==a&&(Rh(this),this.Ba.er=a,this.g("portSpreading",y,a),a=this.diagram,a!==null&&a.undoManager.isUndoingRedoing||this.Bd())}},avoidable:{get:function(){return(this.U&8)!==0},set:function(a){var y=(this.U&8)!==0;if(y!==a){this.U^=8;var x=this.diagram;x!==null&&Nh(x,this),this.g("avoidable",y,a)}}},avoidableMargin:{get:function(){return this.Ba!==null?this.Ba.yp:$r},set:function(a){typeof a=="number"&&(a=new ir(a));var y=this.avoidableMargin;if(!y.D(a)){a=a.J(),Rh(this),this.Ba.yp=a;var x=this.diagram;x!==null&&Nh(x,this),this.g("avoidableMargin",y,a)}}},linksConnected:{get:function(){return this.jb.iterator}},linkConnected:{get:function(){return this.Ba!==null?this.Ba.Dq:null},set:function(a){var y=this.linkConnected;y!==a&&(Rh(this),this.Ba.Dq=a,this.g("linkConnected",y,a))}},linkDisconnected:{get:function(){return this.Ba!==null?this.Ba.Eq:null},set:function(a){var y=this.linkDisconnected;y!==a&&(Rh(this),this.Ba.Eq=a,this.g("linkDisconnected",y,a))}},linkValidation:{get:function(){return this.Ba!==null?this.Ba.gj:null},set:function(a){var y=this.linkValidation;y!==a&&(Rh(this),this.Ba.gj=a,this.g("linkValidation",y,a))}},isLinkLabel:{get:function(){return this.Yk!==null}},labeledLink:{get:function(){return this.Yk},set:function(a){var y=this.Yk;if(y!==a){var x=this.diagram,E=this.data;if(y!==null){if(y.wd!==null&&(y.wd.remove(this),y.v()),x!==null&&E!==null&&!x.undoManager.isUndoingRedoing){var b=y.data,z=x.model;if(b!==null&&z.ri()){var tt=z.wa(E);tt!==void 0&&z.Qx(b,tt)}}this.containingGroup=null}this.Yk=a,a!==null&&(q1(a,this),x===null||E===null||x.undoManager.isUndoingRedoing||(b=a.data,x=x.model,b!==null&&x.ri()&&(E=x.wa(E),E!==void 0&&x.Bu(b,E))),this.containingGroup=a.containingGroup),Ps(this),this.g("labeledLink",y,a)}}},port:{get:function(){return this.ns("")}},ports:{get:function(){return this.wc===null&&V1(this),this.wc.iteratorValues}},isTreeExpanded:{get:function(){return(this.U&1)!==0},set:function(a){var y=(this.U&1)!==0;if(y!==a){this.U^=1;var x=this.diagram;if(this.g("isTreeExpanded",y,a),y=this.treeExpandedChanged,y!==null){var E=!0;x!==null&&(E=x.aa,x.aa=!0),y(this),x!==null&&(x.aa=E)}x!==null&&x.undoManager.isUndoingRedoing?this.Zb(a):a?this.expandTree():this.collapseTree()}}},wasTreeExpanded:{get:function(){return(this.U&2)!==0},set:function(a){var y=(this.U&2)!==0;y!==a&&(this.U^=2,this.g("wasTreeExpanded",y,a))}},treeExpandedChanged:{get:function(){return this.Ba!==null?this.Ba.Vr:null},set:function(a){var y=this.treeExpandedChanged;y!==a&&(Rh(this),this.Ba.Vr=a,this.g("treeExpandedChanged",y,a))}},isTreeLeaf:{get:function(){return(this.U&4)!==0},set:function(a){var y=(this.U&4)!==0;y!==a&&(this.U^=4,this.g("isTreeLeaf",y,a))}}}),qn.prototype.expandTree=qn.prototype.expandTree,qn.prototype.collapseTree=qn.prototype.collapseTree,qn.prototype.findTreeParts=qn.prototype.wz,qn.prototype.findTreeChildrenNodes=qn.prototype.Ou,qn.prototype.findTreeChildrenLinks=qn.prototype.Qo,qn.prototype.findTreeLevel=qn.prototype.uz,qn.prototype.findTreeParentChain=qn.prototype.vz,qn.prototype.findTreeParentNode=qn.prototype.pg,qn.prototype.findTreeParentLink=qn.prototype.kh,qn.prototype.findCommonTreeParent=qn.prototype.gz,qn.prototype.findTreeRoot=qn.prototype.xz,qn.prototype.isInTreeOf=qn.prototype.Nz,qn.prototype.findPort=qn.prototype.ns,qn.prototype.findLinksTo=qn.prototype.kz,qn.prototype.findLinksBetween=qn.prototype.jz,qn.prototype.findNodesInto=qn.prototype.Oo,qn.prototype.findNodesOutOf=qn.prototype.Po,qn.prototype.findNodesConnected=qn.prototype.Mu,qn.prototype.findLinksInto=qn.prototype.Sd,qn.prototype.findLinksOutOf=qn.prototype.Mo,qn.prototype.findExternalTreeLinksConnected=qn.prototype.qx,qn.prototype.invalidateConnectedLinks=qn.prototype.Bd,qn.prototype.invalidateLinkBundle=qn.prototype.Lz;var Ex=new He(qn,"SpreadingNone",10),Vm=new He(qn,"SpreadingEvenly",11),Hv=new He(qn,"SpreadingPacked",12);qn.className="Node",qn.SpreadingNone=Ex,qn.SpreadingEvenly=Vm,qn.SpreadingPacked=Hv;function or(a,y){a===void 0||a instanceof wa||typeof a=="string"?qn.call(this,a):(qn.call(this),a&&(y=a)),this.U|=4608,this.Gn=new pn,this.$a=null,this.Sc=new Wo,this.Sc.group=this,this.gl=new pn,this.tb=this.$p=null,y&&Object.assign(this,y)}Se(or,qn),or.prototype.cloneProtected=function(a){qn.prototype.cloneProtected.call(this,a),this.U=this.U&-32769;var y=a.Nl(function(x){return x instanceof Es});y instanceof Es?a.$a=y:a.$a=null,this.Sc!==null?(a.Sc=this.Sc.copy(),a.Sc.group=a):(a.Sc!==null&&(a.Sc.group=null),a.Sc=null),this.tb!==null&&(a.tb=this.tb.copy())},wt=or.prototype,wt.Af=function(a){qn.prototype.Af.call(this,a);var y=a.Rj();for(a=a.memberParts;a.next();){var x=a.value;if(x.v(),x.C(8),x.Ej(),x instanceof qn)x.Bd(y);else if(x instanceof Tn)for(x=x.labelNodes;x.next();)x.value.Bd(y)}},wt.gk=function(a,y,x,E,b,z,tt){if(a===fo&&y==="elements"){if(b instanceof Es)this.$a===null?this.$a=b:this.$a!==b&&$t("Cannot insert a second Placeholder into the visual tree of a Group.");else if(b instanceof En){var rt=b.Nl(function(ot){return ot instanceof Es});rt instanceof Es&&(this.$a===null?this.$a=rt:this.$a!==rt&&$t("Cannot insert a second Placeholder into the visual tree of a Group."))}}else a===Mo&&y==="elements"&&this.$a!==null&&(E===this.$a?this.$a=null:E instanceof En&&this.$a.rg(E)&&(this.$a=null));qn.prototype.gk.call(this,a,y,x,E,b,z,tt)},wt.Xl=function(a,y){qn.prototype.Xl.call(this,a,y),this.isClipping&&this.type!==En.Spot&&this.isSubGraphExpanded&&(a=this.resizeObject,a instanceof En&&(a=a.Pb()),this.tb===null&&(this.tb=new Be),a.mi(this.tb),a instanceof cr&&this.tb.Bc(-a.strokeWidth,-a.strokeWidth))},wt.eh=function(a,y,x,E){this.nf=this.$a,qn.prototype.eh.call(this,a,y,x,E)},wt.Va=function(){var a=this;a.isSubGraphExpanded&&this.memberParts.each(function(y){!a.computesBoundsIncludingLinks&&y instanceof Tn||y.Va()}),qn.prototype.Va.call(this)},wt.si=function(){if(!qn.prototype.si.call(this))return!1;for(var a=this.memberParts;a.next();){var y=a.value;if(y instanceof qn){if(y.isVisible()&&ws(y))return!1}else if(y instanceof Tn&&y.isVisible()&&ws(y)&&y.fromNode!==this&&y.toNode!==this)return!1}return!0};function Wv(a,y){if(a.Gn.add(y)){y instanceof or&&a.gl.add(y);var x=a.memberAdded;if(x!==null){var E=!0,b=a.diagram;b!==null&&(E=b.aa,b.aa=!0),x(a,y),b!==null&&(b.aa=E)}a.isVisible()&&a.isSubGraphExpanded||y.Zb(!1)}y instanceof Tn&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}function Vv(a,y){if(a.Gn.remove(y)){y instanceof or&&a.gl.remove(y);var x=a.memberRemoved;if(x!==null){var E=!0,b=a.diagram;b!==null&&(E=b.aa,b.aa=!0),x(a,y),b!==null&&(b.aa=E)}a.isVisible()&&a.isSubGraphExpanded||y.Zb(!0)}y instanceof Tn&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}wt.Lj=function(){if(0<this.Gn.count){var a=this.diagram;if(a!==null)for(var y=this.Gn.copy().iterator;y.next();)a.remove(y.value)}qn.prototype.Lj.call(this)},or.prototype.canAddMembers=function(a){var y=this.diagram;if(y===null)return!1;for(y=y.commandHandler,a=ze(a).iterator;a.next();)if(!y.isValidMember(this,a.value))return!1;return!0},or.prototype.addMembers=function(a,y){var x=this.diagram;if(x===null)return!1;x=x.commandHandler;var E=!0;for(a=ze(a).iterator;a.next();){var b=a.value;!y||x.isValidMember(this,b)?b.containingGroup=this:E=!1}return E},or.prototype.canUngroup=function(){if(!this.ungroupable)return!1;var a=this.layer;return a===null||!a.allowUngroup?!1:(a=a.diagram,!!(a===null||a.allowUngroup))},wt=or.prototype,wt.Bd=function(a){var y=(this.U&65536)!==0;if(qn.prototype.Bd.call(this,a),!y)for(!(this.U&65536)&&(this.U=this.U^65536),y=this.Lu();y.next();){var x=y.value;if(a===void 0||!a.contains(x)){var E=x.fromNode;E!==null&&E!==this&&E.Td(this)&&!E.isVisible()?($s(x.fromPort),$s(x.toPort),x.bb()):(E=x.toNode,E!==null&&E!==this&&E.Td(this)&&!E.isVisible()&&($s(x.fromPort),$s(x.toPort),x.bb()))}}},wt.Lu=function(){var a=this.diagram!==null&&this.diagram.Pw;if(a&&this.$p!==null)return this.$p.iterator;var y=this.Rj();y.add(this);for(var x=new pn,E=y.iterator;E.next();){var b=E.value;if(b instanceof qn)for(b=b.linksConnected;b.next();){var z=b.value;y.contains(z)||x.add(z)}}return a&&(this.$p=x),x.iterator},wt.iz=function(){var a=this.Rj();a.add(this);for(var y=new pn,x=a.iterator;x.next();){var E=x.value;if(E instanceof qn)for(E=E.linksConnected;E.next();){var b=E.value,z=b.fromNode;z===null||a.contains(z)&&z!==this||y.add(z),b=b.toNode,b===null||a.contains(b)&&b!==this||y.add(b)}}return y.iterator},wt.hz=function(){function a(x,E){x!==null&&(E.add(x),a(x.containingGroup,E))}var y=new pn;return a(this,y),y},wt.Rj=function(){var a=new pn;return vd(a,this,!0,0,!0),a.remove(this),a},wt.Zb=function(a){qn.prototype.Zb.call(this,a);for(var y=this.memberParts;y.next();)y.value.Zb(a)},or.prototype.collapseSubGraph=function(){var a=this.diagram;if(a!==null&&!a.Ue){a.Ue=!0;var y=this.Rj();Q1(this,y,a,this),a.Ue=!1}};function Q1(a,y,x,E){for(var b=a.memberParts;b.next();){var z=b.value;if(z.Zb(!1),z instanceof or&&z.isSubGraphExpanded&&(z.wasSubGraphExpanded=z.isSubGraphExpanded,Q1(z,y,x,E)),z instanceof qn)z.Bd(y),x.Aj(z,E);else if(z instanceof Tn)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!1}or.prototype.expandSubGraph=function(){var a=this.diagram;if(a!==null&&!a.Ue){a.Ue=!0;var y=this.Rj();$1(this,y,a,this),a.Ue=!1}};function $1(a,y,x,E){for(var b=a.memberParts;b.next();){var z=b.value;if(z.Zb(!0),z instanceof or&&z.wasSubGraphExpanded&&(z.wasSubGraphExpanded=!1,$1(z,y,x,E)),z instanceof qn)z.Bd(y),x.Cj(z,E);else if(z instanceof Tn)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!0}or.prototype.move=function(a,y){y===void 0&&(y=!1);var x=y?this.location:this.position,E=x.x;x=x.y;var b=a.x,z=a.y;if(!(E===b||isNaN(E)&&isNaN(b))||!(x===z||isNaN(x)&&isNaN(z))){for(E=b-(isNaN(E)?0:E),x=z-(isNaN(x)?0:x),z=At.alloc(),qn.prototype.move.call(this,a,y),a=new pn,y=this.Rj().iterator;y.next();)b=y.value,b instanceof Tn&&(b.suspendsRouting&&a.add(b),b.fd||b.fromNode!==this&&b.toNode!==this)&&(b.suspendsRouting=!0);for(y.reset();y.next();)if(b=y.value,!(b.ph()||b instanceof qn&&b.isLinkLabel)){var tt=b.position,rt=b.location;tt.w()?(z.x=tt.x+E,z.y=tt.y+x,b.position=z):rt.w()&&(z.x=rt.x+E,z.y=rt.y+x,b.location=z)}for(y.reset();y.next();)b=y.value,b instanceof Tn&&(b.suspendsRouting=a.contains(b),b.fd||b.fromNode!==this&&b.toNode!==this)&&(tt=b.position,z.x=tt.x+E,z.y=tt.y+x,z.w()?b.move(z):b.bb(),Uv(b)&&b.bb());At.free(z)}},ve.Object.defineProperties(or.prototype,{placeholder:{get:function(){return this.$a}},computesBoundsAfterDrag:{get:function(){return(this.U&2048)!==0},set:function(a){var y=(this.U&2048)!==0;y!==a&&(this.U^=2048,this.g("computesBoundsAfterDrag",y,a))}},computesBoundsIncludingLinks:{get:function(){return(this.U&4096)!==0},set:function(a){var y=(this.U&4096)!==0;y!==a&&(this.U^=4096,this.g("computesBoundsIncludingLinks",y,a))}},computesBoundsIncludingLocation:{get:function(){return(this.U&8192)!==0},set:function(a){var y=(this.U&8192)!==0;y!==a&&(this.U^=8192,this.g("computesBoundsIncludingLocation",y,a))}},handlesDragDropForMembers:{get:function(){return(this.U&16384)!==0},set:function(a){var y=(this.U&16384)!==0;y!==a&&(this.U^=16384,this.g("handlesDragDropForMembers",y,a))}},memberParts:{get:function(){return this.Gn.iterator}},layout:{get:function(){return this.Sc},set:function(a){var y=this.Sc;if(y!==a){a!==null&&a.diagram!==null&&a.diagram.layout===a&&$t("A layout cannot be both the Diagram.layout and a Group.layout: "+a),y!==null&&(y.diagram=null,y.group=null),this.Sc=a;var x=this.diagram;a!==null&&(a.diagram=x,a.group=this),x!==null&&(x.xh=!0),this.g("layout",y,a),x!==null&&x.$b()}}},memberAdded:{get:function(){return this.Ba!==null?this.Ba.Mq:null},set:function(a){var y=this.memberAdded;y!==a&&(Rh(this),this.Ba.Mq=a,this.g("memberAdded",y,a))}},memberRemoved:{get:function(){return this.Ba!==null?this.Ba.Nq:null},set:function(a){var y=this.memberRemoved;y!==a&&(Rh(this),this.Ba.Nq=a,this.g("memberRemoved",y,a))}},memberValidation:{get:function(){return this.Ba!==null?this.Ba.ij:null},set:function(a){var y=this.memberValidation;y!==a&&(Rh(this),this.Ba.ij=a,this.g("memberValidation",y,a))}},ungroupable:{get:function(){return(this.U&256)!==0},set:function(a){var y=(this.U&256)!==0;y!==a&&(this.U^=256,this.g("ungroupable",y,a))}},isSubGraphExpanded:{get:function(){return(this.U&512)!==0},set:function(a){var y=(this.U&512)!==0;if(y!==a){this.U^=512;var x=this.diagram;if(this.g("isSubGraphExpanded",y,a),y=this.subGraphExpandedChanged,y!==null){var E=!0;x!==null&&(E=x.aa,x.aa=!0),y(this),x!==null&&(x.aa=E)}x!==null&&x.undoManager.isUndoingRedoing?(this.$a!==null&&this.$a.v(),this.memberParts.each(function(b){b.updateAdornments()})):a?this.expandSubGraph():this.collapseSubGraph()}}},wasSubGraphExpanded:{get:function(){return(this.U&1024)!==0},set:function(a){var y=(this.U&1024)!==0;y!==a&&(this.U^=1024,this.g("wasSubGraphExpanded",y,a))}},subGraphExpandedChanged:{get:function(){return this.Ba!==null?this.Ba.Kr:null},set:function(a){var y=this.subGraphExpandedChanged;y!==a&&(Rh(this),this.Ba.Kr=a,this.g("subGraphExpandedChanged",y,a))}},rh:{get:function(){return(this.U&32768)!==0},set:function(a){(this.U&32768)!==0!==a&&(this.U^=32768)}}}),or.prototype.expandSubGraph=or.prototype.expandSubGraph,or.prototype.collapseSubGraph=or.prototype.collapseSubGraph,or.prototype.findSubGraphParts=or.prototype.Rj,or.prototype.findContainingGroupChain=or.prototype.hz,or.prototype.findExternalNodesConnected=or.prototype.iz,or.prototype.findExternalLinksConnected=or.prototype.Lu,or.prototype.ensureBounds=or.prototype.Va,or.className="Group";function Es(a){de.call(this),this.yb=ca,this.ko=new Be(NaN,NaN,NaN,NaN),a&&Object.assign(this,a)}Se(Es,de),Es.prototype.cloneProtected=function(a){de.prototype.cloneProtected.call(this,a),a.yb=this.yb.J(),a.ko=this.ko.copy()},Es.prototype.gh=function(a){if(this.background===null&&this.areaBackground===null)return!1;var y=this.naturalBounds;return Dr(0,0,y.width,y.height,a.x,a.y)},Es.prototype.Wl=function(){var a=this.part;if(a!==null&&(a instanceof or||a instanceof Yr)||$t("Placeholder is not inside a Group or Adornment."),a instanceof or){var y=this.computeBorder(this.ko),x=this.minSize,E=this.dc;for(Wr(E,(isFinite(x.width)?Math.max(x.width,y.width):y.width)||0,(isFinite(x.height)?Math.max(x.height,y.height):y.height)||0),this.Ge(0,0,E.width,E.height),E=a.memberParts,x=!1;E.next();)if(E.value.isVisible()){x=!0;break}E=a.diagram,!x||E===null||E.animationManager.Xu(a)||isNaN(y.x)||isNaN(y.y)||(x=At.alloc(),x.xi(y,a.locationSpot),x.D(a.location)||(a.location=x),At.free(x))}else{y=this.dc,x=this.yb,E=x.left+x.right;var b=x.top+x.bottom,z=a.adornedObject;a.angle=z.li();var tt=0;z instanceof cr&&(tt=z.strokeWidth);var rt=z.Df(),ot=z.naturalBounds,lt=(ot.width+tt)*rt;tt=(ot.height+tt)*rt,a.type!==En.Link&&(rt=z.ga(a.category==="Selection"?eo:a.locationSpot,At.alloc()),a.location=rt,At.free(rt)),isNaN(lt)||isNaN(tt)?(a=z.ga(eo,At.alloc()),lt=Be.allocAt(a.x,a.y,0,0),lt.Ye(z.ga(No,a)),lt.Ye(z.ga(Va,a)),lt.Ye(z.ga(Sa,a)),Wr(y,lt.width+E||0,lt.height+b||0),this.Ge(-x.left,-x.top,y.width,y.height),At.free(a),Be.free(lt)):(Wr(y,lt+E||0,tt+b||0),this.Ge(-x.left,-x.top,y.width,y.height))}},Es.prototype.eh=function(a,y,x,E){this.actualBounds.h(a,y,x,E)},Es.prototype.computeBorder=function(a){var y=this.part,x=y.diagram,E=x===null||!x.animationManager.isAnimating;if(x!==null&&y instanceof or&&!y.layer.isTemporary&&y.computesBoundsAfterDrag&&this.ko.w()){var b=x.toolManager.findTool("Dragging");if(b===x.currentTool&&(x=b.computeBorder(y,this.ko,a),x!==null))return x}x=Be.alloc(),b=this.computeMemberBounds(x);var z=this.yb;return y instanceof or&&!y.isSubGraphExpanded?a.h(b.x-z.left,b.y-z.top,0,0):a.h(b.x-z.left,b.y-z.top,Math.max(b.width+z.left+z.right,0),Math.max(b.height+z.top+z.bottom,0)),Be.free(x),E&&y instanceof or&&y.computesBoundsIncludingLocation&&y.location.w()&&a.Ye(y.location),a},Es.prototype.computeMemberBounds=function(a){if(!(this.part instanceof or))return a.h(0,0,0,0),a;for(var y=this.part,x=1/0,E=1/0,b=-1/0,z=-1/0,tt=y.memberParts;tt.next();){var rt=tt.value;if(rt.isVisible()){if(rt instanceof Tn&&(!y.computesBoundsIncludingLinks||sl(rt)||rt.fromNode===y||rt.toNode===y))continue;rt=rt.actualBounds,rt.left<x&&(x=rt.left),rt.top<E&&(E=rt.top),rt.right>b&&(b=rt.right),rt.bottom>z&&(z=rt.bottom)}}return isFinite(x)&&isFinite(E)?a.h(x,E,b-x,z-E):(y=y.location,a.h(y.x,y.y,0,0)),a},ve.Object.defineProperties(Es.prototype,{padding:{get:function(){return this.yb},set:function(a){typeof a=="number"&&(a=new ir(a));var y=this.yb;y.D(a)||(this.yb=a=a.J(),this.g("padding",y,a),this.v())}}}),Es.className="Placeholder";function Tn(a){Ni.call(this,En.Link),this.Qa=8,this.ef=null,this.ff="",this.uf=this.gn=null,this.vf="",this.uo=null,this.qk=Ls,this.Om=0,this.Qm=Ls,this.Rm=NaN,this.qj=Jv,this.po=.5,this.wd=null,this.Nb=new fn().freeze(),this.Tg=this.Mg=null,this.ml=new Be,this.ua=new Ye,this.u=this.o=this.Sf=this.Wf=null,this.su=new At,this.cq=this.Mw=this.Lw=null,this.vt=NaN,this.ba=null,this.j=[],a&&Object.assign(this,a)}Se(Tn,Ni),Tn.prototype.cloneProtected=function(a){Ni.prototype.cloneProtected.call(this,a),a.Qa=this.Qa&-113,a.ff=this.ff,a.gn=this.gn,a.vf=this.vf,a.uo=this.uo,a.qk=this.qk,a.Om=this.Om,a.Qm=this.Qm,a.Rm=this.Rm,a.qj=this.qj,a.po=this.po,this.ba!==null&&(a.ba=this.ba.copy())},wt=Tn.prototype,wt.Af=function(a){Ni.prototype.Af.call(this,a),this.ff=a.ff,this.vf=a.vf,a.Mg=null,a.bb(),a.Sf=this.Sf;var y=a.fromPort;y!==null&&$s(y),a=a.toPort,a!==null&&$s(a)},wt.qb=function(a){a.classType===Tn?(a.value&2)===2?this.routing=a:a===ul||a===zh||a===Wf?this.curve=a:a===ap||a===Qm||a===$m?this.adjusting=a:a!==Jv&&a!==Ls&&$t("Unknown Link enum value for a Link property: "+a):Ni.prototype.qb.call(this,a)},wt.Xc=function(){this.ba===null&&(this.ba=new Kg)},wt.si=function(){var a=this.fromNode;if(a!==null){var y=a.findVisibleNode();if(y!==null&&(a=y),ws(a)||pd(a))return!1}return a=this.toNode,!(a!==null&&(y=a.findVisibleNode(),y!==null&&(a=y),ws(a)||pd(a)))},wt.zv=function(){return!1},wt.Av=function(){},wt.Zc=function(){return!1},Tn.prototype.computeAngle=function(a,y,x){return Tn.computeAngle(y,x)},Tn.computeAngle=function(a,y){switch(a){default:case Ls:a=0;break;case sp:a=y;break;case lp:a=y+90;break;case up:a=y-90;break;case Qv:a=y+180;break;case qm:a=Zt.bp(y),90<a&&270>a&&(a-=180);break;case hp:a=Zt.bp(y+90),90<a&&270>a&&(a-=180);break;case dp:a=Zt.bp(y-90),90<a&&270>a&&(a-=180);break;case t0:if(a=Zt.bp(y),45<a&&135>a||225<a&&315>a)return 0;90<a&&270>a&&(a-=180)}return Zt.bp(a)};function Gf(a){var y=a.fromNode,x=a.toNode,E=null;if(y!==null?E=x!==null?y.px(x):y.containingGroup:x!==null?E=x.containingGroup:E=null,y=E,x=a.Ah,x!==y){x!==null&&Vv(x,a),a.Ah=y,y!==null&&Wv(y,a);var b=a.containingGroupChanged;if(b!==null){var z=!0,tt=a.diagram;tt!==null&&(z=tt.aa,tt.aa=!0),b(a,x,y),tt!==null&&(tt.aa=z)}!a.fd||a.Lw!==x&&a.Mw!==x||a.bb()}if(a.isLabeledLink)for(a=a.labelNodes;a.next();)a.value.containingGroup=E}wt=Tn.prototype,wt.oh=function(){var a=this.containingGroup;a!==null&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&Ni.prototype.oh.call(this)},wt.To=function(a){var y=this.fromNode;return a===y?this.toNode:y},wt.Cz=function(a){var y=this.fromPort;return a===y?this.toPort:y};function q1(a,y){a.wd===null&&(a.wd=new pn),a.wd.add(y),a.v()}wt.Vo=function(a){if(Ni.prototype.Vo.call(this,a),oc(this)&&this.Xo(this.actualBounds),!a){a=this.ef;var y=null;a!==null&&(y=this.fromPort,Hm(a,this,y));var x=this.uf;if(x!==null){var E=this.toPort;x===a&&E===y||Hm(x,this,E)}rp(this)}},wt.Wo=function(a){if(Ni.prototype.Wo.call(this,a),oc(this)&&this.Xo(this.actualBounds),!a){a=this.ef;var y=null;a!==null&&(y=this.fromPort,Wm(a,this,y));var x=this.uf;if(x!==null){var E=this.toPort;x===a&&E===y||Wm(x,this,E)}op(this)}},wt.Lj=function(){if(this.fd=!0,this.wd!==null){var a=this.diagram;if(a!==null)for(var y=this.wd.copy().iterator;y.next();)a.remove(y.value)}this.data!==null&&(a=this.diagram,a!==null&&a.partManager.removeDataForLink(this))},Tn.prototype.updateRelationshipsFromData=function(){if(this.data!==null){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)}},Tn.prototype.move=function(a,y){var x=y?this.location:this.position,E=x.x;isNaN(E)&&(E=0);var b=x.y;for(isNaN(b)&&(b=0),E=a.x-E,b=a.y-b,y===!0?Ni.prototype.move.call(this,a,!1):(a=At.allocAt(x.x+E,x.y+b),Ni.prototype.move.call(this,a,!1),At.free(a)),jh(this,E,b),a=this.labelNodes;a.next();)y=a.value,x=y.position,y.moveTo(x.x+E,x.y+b)},Tn.prototype.canRelinkFrom=function(){if(!this.relinkableFrom)return!1;var a=this.layer;return a===null?!0:a.allowRelink?(a=a.diagram,!!(a===null||a.allowRelink)):!1},Tn.prototype.canRelinkTo=function(){if(!this.relinkableTo)return!1;var a=this.layer;return a===null?!0:a.allowRelink?(a=a.diagram,!!(a===null||a.allowRelink)):!1},Tn.prototype.computeMidPoint=function(a){var y=this.pointsCount;if(y===0)return a.assign(vi),a;if(y===1)return a.assign(this.i(0)),a;if(y===2){var x=this.i(0),E=this.i(1);return a.h((x.x+E.x)/2,(x.y+E.y)/2),a}if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===ul))return this.ua.Pu(.5,a),a.add(this.i(0)),x=this.ua.figures.first(),a.offset(-x.startX,-x.startY),a;if(this.computeCurve()===ul){if(y===3){x=this.i(0),E=this.i(1);var b=this.i(2);return Zt.ax(x.x,x.y,E.x,E.y,E.x,E.y,b.x,b.y,a),a}if(E=(y-1)/3|0,x=3*(E/2|0),E%2===1){E=this.i(x),b=this.i(x+1);var z=this.i(x+2);x=this.i(x+3),Zt.ax(E.x,E.y,b.x,b.y,z.x,z.y,x.x,x.y,a)}else a.assign(this.i(x));return a}var tt=this.flattenedLengths;for(x=this.flattenedTotalLength,b=z=E=0;E<x/2&&z<y&&(b=tt[z],!(E+b>x/2));)E+=b,z++;return y=this.i(z),z=this.i(z+1),1>Math.abs(y.x-z.x)?y.y>z.y?a.h(y.x,y.y-(x/2-E)):a.h(y.x,y.y+(x/2-E)):1>Math.abs(y.y-z.y)?y.x>z.x?a.h(y.x-(x/2-E),y.y):a.h(y.x+(x/2-E),y.y):(x=(x/2-E)/b,a.h(y.x+x*(z.x-y.x),y.y+x*(z.y-y.y))),a},Tn.prototype.computeMidAngle=function(){var a=this.pointsCount;if(2>a)return NaN;if(a===2)return this.i(0).ab(this.i(1));if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===ul))return this.ua.wx(.5);if(this.computeCurve()===ul&&4<=a){var y=(a-1)/3|0,x=3*(y/2|0);if(y%2===1){x=Math.floor(x),a=this.i(x),y=this.i(x+1);var E=this.i(x+2);return x=this.i(x+3),Zt.My(a.x,a.y,y.x,y.y,E.x,E.y,x.x,x.y)}if(0<x&&x+1<a)return this.i(x-1).ab(this.i(x+1))}y=this.flattenedLengths,E=this.flattenedTotalLength;var b=0;x=0;for(var z;b<E/2&&x<a&&(z=y[x],!(b+z>E/2));)b+=z,x++;if(y=this.i(x),E=this.i(x+1),1>Math.abs(y.x-E.x)&&1>Math.abs(y.y-E.y)){if(0<x&&x+2<a)return this.i(x-1).ab(this.i(x+2))}else{if(1>Math.abs(y.x-E.x))return y.y>E.y?270:90;if(1>Math.abs(y.y-E.y))return y.x>E.x?180:0}return y.ab(E)},wt=Tn.prototype,wt.i=function(a){return this.Nb.s[a]},wt.dd=function(a,y){this.Nb.cd(a,y)},wt.L=function(a,y,x){this.Nb.cd(a,new At(y,x))},wt.Kz=function(a,y){this.Nb.Gb(a,y)},wt.m=function(a,y,x){this.Nb.Gb(a,new At(y,x))},wt.ne=function(a){this.Nb.add(a)},wt.yf=function(a,y){this.Nb.add(new At(a,y))},wt.pv=function(a){this.Nb.mb(a)},wt.Fj=function(){this.Nb.clear()};function jh(a,y,x){if(y!==0||x!==0)if(a.pointsCount===0)a.defaultFromPoint&&a.defaultFromPoint.offset(y,x),a.defaultToPoint&&a.defaultToPoint.offset(y,x);else{for(var E=a.fd,b=new fn,z=a.Nb.iterator;z.next();){var tt=z.value;b.add(new At(tt.x+y,tt.y+x).freeze())}b.freeze(),z=a.Nb,a.Nb=b,tt=a.diagram,isNaN(y)||isNaN(x)||tt!==null&&tt.animationManager.zb?a.v():(a.ke.h(a.ke.x+y,a.ke.y+x),a.pa.h(a.pa.x+y,a.pa.y+x),Ps(a)),E?Km(a):(a.defaultFromPoint&&(a.defaultFromPoint=a.i(0)),a.defaultToPoint&&(a.defaultToPoint=a.i(a.pointsCount-1))),tt!==null&&tt.animationManager.zb&&gf(tt.animationManager,a,b),a.g("points",z,b)}}wt.uh=function(){this.Mg===null&&(this.Mg=this.Nb,this.Nb=this.Nb.copy())},wt.zf=function(){if(this.Mg!==null){for(var a=this.Mg,y=this.Nb,x=1/0,E=1/0,b=a.s,z=b.length,tt=0;tt<z;tt++){var rt=b[tt];x=Math.min(rt.x,x),E=Math.min(rt.y,E)}rt=tt=1/0;for(var ot=y.s,lt=ot.length,ut=0;ut<lt;ut++){var ft=ot[ut];tt=Math.min(ft.x,tt),rt=Math.min(ft.y,rt),ft.freeze()}if(y.freeze(),lt===z){for(z=0;z<lt;z++)if(ut=b[z],ft=ot[z],ut.x-x!==ft.x-tt||ut.y-E!==ft.y-rt){this.qc();break}}else this.qc();this.Mg=null,x=this.diagram,x!==null&&x.animationManager.zb&&gf(x.animationManager,this,y),Km(this),this.g("points",a,y)}},wt.rv=function(){this.Mg!==null&&(this.Nb=this.Mg,this.Mg=null)};function Km(a){a.Nb.count===0?a.fd=!1:(a.fd=!0,a.cq=null,a.vt=NaN,a.defaultFromPoint=a.i(0),a.defaultToPoint=a.i(a.pointsCount-1),Jm(a,!1))}wt.bb=function(){if(!this.suspendsRouting){var a=this.diagram;if(a){if(a.As.contains(this)||a.undoManager.isUndoingRedoing||(a=a.animationManager,a.isTicking&&!a.isAnimating))return;this.Tg===null||a.isTicking||(this.Tg=null)}a=this.path,a!==null&&(this.fd=!1,this.v(),a.v())}},wt.vg=function(){if(!this.fd&&!this.computingPoints){var a=!0;try{this.computingPoints=!0,this.uh(),a=this.computePoints()}catch(y){this.computingPoints=!1,this.rv()}finally{this.computingPoints=!1,a?this.zf():this.rv()}}},Tn.prototype.computePoints=function(){if(this.diagram===null)return!1;var a=this.fromNode,y=null;if(a===null?(Hc||(Hc=new qn,Hc.desiredSize=Pi,Hc.Va()),this.defaultFromPoint&&(Hc.location=this.defaultFromPoint,Hc.Va(),y=a=Hc)):y=this.fromPort,y!==null&&!a.isVisible()){var x=a.findVisibleNode();x!==null&&x!==a?(a=x,y=x.port):a=x}if(this.Lw=a,a===null||!a.location.w())return!1;for(;!(y===null||y.actualBounds.w()&&y.Ed());)y=y.panel;if(y===null)return!1;var E=this.toNode,b=null;if(E===null?(Wc||(Wc=new qn,Wc.desiredSize=Pi,Wc.Va()),this.defaultToPoint&&(Wc.location=this.defaultToPoint,Wc.Va(),b=E=Wc)):b=this.toPort,b===null||E.isVisible()||(x=E.findVisibleNode(),x!==null&&x!==E?(E=x,b=x.port):E=x),this.Mw=E,E===null||!E.location.w())return!1;for(;!(b===null||b.actualBounds.w()&&b.Ed());)b=b.panel;if(b===null)return!1;var z=this.pointsCount,tt=this.computeSpot(!0,y);x=this.computeSpot(!1,b);var rt=Hf(tt),ot=Hf(x),lt=y===b&&y!==null,ut=this.isOrthogonal,ft=this.curve===ul;this.Wf=lt&&!ut?ft=!0:!1;var yt=this.computeAdjusting()===Ls||lt;if(!ut&&!lt&&rt&&ot){if(rt=!1,!yt&&3<=z&&(yt=this.getLinkPoint(a,y,tt,!0,!1,E,b),ot=this.getLinkPoint(E,b,x,!1,!1,a,y),rt=this.adjustPoints(0,yt,z-1,ot))&&(yt=this.getLinkPoint(a,y,tt,!0,!1,E,b),ot=this.getLinkPoint(E,b,x,!1,!1,a,y),this.adjustPoints(0,yt,z-1,ot)),!rt)if(this.Fj(),ft){z=this.getLinkPoint(a,y,tt,!0,!1,E,b),yt=this.getLinkPoint(E,b,x,!1,!1,a,y),rt=yt.x-z.x,ot=yt.y-z.y,lt=this.computeCurviness(),ft=ut=0;var xt=z.x+rt/3,Ct=z.y+ot/3,bt=xt,Wt=Ct;Zt.B(ot,0)?Wt=0<rt?Wt-lt:Wt+lt:(ut=-rt/ot,ft=Math.sqrt(lt*lt/(ut*ut+1)),0>lt&&(ft=-ft),bt=(0>ot?-1:1)*ft+xt,Wt=ut*(bt-xt)+Ct),xt=z.x+2*rt/3,Ct=z.y+2*ot/3;var jt=xt,Qt=Ct;Zt.B(ot,0)?Qt=0<rt?Qt-lt:Qt+lt:(jt=(0>ot?-1:1)*ft+xt,Qt=ut*(jt-xt)+Ct),this.Fj(),this.ne(z),this.yf(bt,Wt),this.yf(jt,Qt),this.ne(yt),this.dd(0,this.getLinkPoint(a,y,tt,!0,!1,E,b)),this.dd(3,this.getLinkPoint(E,b,x,!1,!1,a,y))}else z=E,yt=b,E=this.getLinkPoint(a,y,tt,!0,!1,z,yt),b=this.getLinkPoint(z,yt,x,!1,!1,a,y),this.hasCurviness()?(yt=b.x-E.x,x=b.y-E.y,tt=this.computeCurviness(),a=E.x+yt/2,y=E.y+x/2,z=a,rt=y,Zt.B(x,0)?rt=0<yt?rt-tt:rt+tt:(yt=-yt/x,z=Math.sqrt(tt*tt/(yt*yt+1)),0>tt&&(z=-z),z=(0>x?-1:1)*z+a,rt=yt*(z-a)+y),this.ne(E),this.yf(z,rt),this.ne(b)):(this.ne(E),this.ne(b),rt=Be.alloc(),y.mi(rt),ot=rt.ca(b),yt.mi(rt),lt=rt.ca(E),(ot||lt)&&(tt=y.ga(Ym(tt),new At),this.dd(0,this.getLinkPointFromPoint(a,y,tt,b,!0,tt)),x=yt.ga(Ym(x),new At),this.dd(1,this.getLinkPointFromPoint(z,yt,x,E,!1,x))),Be.free(rt))}else{ft=this.isAvoiding,yt&&(ut&&ft||lt)&&this.Fj();var te=lt?this.computeCurviness():0;ft=this.getLinkPoint(a,y,tt,!0,ut,E,b),xt=bt=Ct=0,(ut||!rt||lt)&&(Wt=this.computeEndSegmentLength(a,y,tt,!0),xt=this.getLinkDirection(a,y,ft,tt,!0,ut,E,b),lt&&(rt||tt.D(x)||!ut&&tt.x+x.x===1&&tt.y+x.y===1)&&(xt-=ut?90:30,0>te&&(xt-=180)),0>xt?xt+=360:360<=xt&&(xt-=360),lt&&(Wt+=Math.abs(te)*(ut?1:2)),xt===0?Ct=Wt:xt===90?bt=Wt:xt===180?Ct=-Wt:xt===270?bt=-Wt:(Ct=Wt*Math.cos(xt*Math.PI/180),bt=Wt*Math.sin(xt*Math.PI/180)),tt.Mc()&&lt&&(Wt=y.ga(Or,At.alloc()),jt=At.allocAt(Wt.x+1e3*Ct,Wt.y+1e3*bt),this.getLinkPointFromPoint(a,y,Wt,jt,!0,ft),At.free(Wt),At.free(jt))),Wt=this.getLinkPoint(E,b,x,!1,ut,a,y);var re=Qt=jt=0;if(ut||!ot||lt){var he=this.computeEndSegmentLength(E,b,x,!1);re=this.getLinkDirection(E,b,Wt,x,!1,ut,a,y),lt&&(ot||tt.D(x)||!ut&&tt.x+x.x===1&&tt.y+x.y===1)&&(re+=ut?0:30,0>te&&(re+=180)),0>re?re+=360:360<=re&&(re-=360),lt&&(he+=Math.abs(te)*(ut?1:2)),re===0?jt=he:re===90?Qt=he:re===180?jt=-he:re===270?Qt=-he:(jt=he*Math.cos(re*Math.PI/180),Qt=he*Math.sin(re*Math.PI/180)),x.Mc()&&lt&&(x=b.ga(Or,At.alloc()),tt=At.allocAt(x.x+1e3*jt,x.y+1e3*Qt),this.getLinkPointFromPoint(E,b,x,tt,!1,Wt),At.free(x),At.free(tt))}x=ft,(ut||!rt||lt)&&(x=new At(ft.x+Ct,ft.y+bt)),tt=Wt,(ut||!ot||lt)&&(tt=new At(Wt.x+jt,Wt.y+Qt)),!yt&&!ut&&rt&&3<z&&this.adjustPoints(0,ft,z-2,tt)?this.dd(z-1,Wt):!yt&&!ut&&ot&&3<z&&this.adjustPoints(1,x,z-1,Wt)?this.dd(0,ft):!yt&&(ut?6<=z:4<z)&&this.adjustPoints(1,x,z-2,tt)?(this.dd(0,ft),this.dd(z-1,Wt)):(this.Fj(),this.ne(ft),(ut||!rt||lt)&&this.ne(x),ut&&this.addOrthoPoints(x,xt,tt,re,a,E),(ut||!ot||lt)&&this.ne(tt),this.ne(Wt))}return!0};function Kv(a,y){return Math.abs(y.x-a.x)>Math.abs(y.y-a.y)?(y.x>=a.x?y.x=a.x+9e9:y.x=a.x-9e9,y.y=a.y):(y.y>=a.y?y.y=a.y+9e9:y.y=a.y-9e9,y.x=a.x),y}Tn.prototype.getLinkPointFromPoint=function(a,y,x,E,b,z){if(z===void 0&&(z=new At),a===null||y===null)return z.assign(x),z;if(a.isVisible()||(b=a.findVisibleNode(),b!==null&&b!==a&&(y=b.port)),a=null,b=y.panel,b===null||b.se()||(b=b.panel),b===null){b=E.x,E=E.y;var tt=x.x;x=x.y}else{a=b.oe,b=1/(a.m11*a.m22-a.m12*a.m21),tt=a.m22*b;var rt=-a.m12*b,ot=-a.m21*b,lt=a.m11*b,ut=b*(a.m21*a.dy-a.m22*a.dx),ft=b*(a.m12*a.dx-a.m11*a.dy);b=E.x*tt+E.y*ot+ut,E=E.x*rt+E.y*lt+ft,tt=x.x*tt+x.y*ot+ut,x=x.x*rt+x.y*lt+ft}return y.Sj(b,E,tt,x,z),a!==null&&z.transform(a),z};function Um(a,y){var x=y.Zn;return x===null&&(x=new Vc,x.port=y,x.node=y.part,y.Zn=x),sS(x,a)}Tn.prototype.getLinkPoint=function(a,y,x,E,b,z,tt,rt){if(rt===void 0&&(rt=new At),x.sb()&&!Hf(x))return y.ga(x,rt),rt;if(x.$c()){var ot=Um(this,y);if(ot!==null){if(rt.assign(ot.Zo),b&&this.routing===eS){var lt=Um(this,tt);if(lt!==null&&ot.Gl<lt.Gl){ot=At.alloc(),lt=At.alloc();var ut=new Be(y.ga(eo,ot),y.ga(No,lt)),ft=this.computeSpot(!E,tt);a=this.getLinkPoint(z,tt,ft,!E,b,a,y,lt),(x.Hf(us)||x.Hf(Ko))&&a.y>=ut.y&&a.y<=ut.y+ut.height?rt.y=a.y:(x.Hf(Ka)||x.Hf(hs))&&a.x>=ut.x&&a.x<=ut.x+ut.width&&(rt.x=a.x),At.free(ot),At.free(lt)}}return rt}}return x=y.ga(Ym(x),At.alloc()),this.pointsCount>(b?6:2)?(tt=E?this.i(1):this.i(this.pointsCount-2),b&&(tt=Kv(x,tt.copy()))):(ot=this.computeSpot(!E,tt),z=At.alloc(),tt=tt.ga(Ym(ot),z),b&&(tt=Kv(x,tt)),At.free(z)),this.getLinkPointFromPoint(a,y,x,tt,E,rt),At.free(x),rt},Tn.prototype.getLinkDirection=function(a,y,x,E,b,z,tt,rt){t:if(E.sb())var ot=E.x>E.y?E.x>1-E.y?0:E.x<1-E.y?270:315:E.x<E.y?E.x>1-E.y?90:E.x<1-E.y?180:135:.5>E.x?225:.5<E.x?45:0;else{if(E.$c()&&(ot=Um(this,y),ot!==null))switch(ot.Nc){case 1:ot=270;break t;case 2:ot=180;break t;default:case 4:ot=0;break t;case 8:ot=90;break t}ot=y.ga(Or,At.alloc()),this.pointsCount>(z?6:2)?(rt=b?this.i(1):this.i(this.pointsCount-2),rt=z?Kv(ot,rt.copy()):x):(x=At.alloc(),rt=rt.ga(Or,x),At.free(x)),x=Math.abs(rt.x-ot.x)>Math.abs(rt.y-ot.y)?rt.x>=ot.x?0:180:rt.y>=ot.y?90:270,At.free(ot),ot=x}return E.Mc()&&tt.Td(a)&&(ot+=180,360<=ot&&(ot-=360)),Hf(E)||(a=y.li(),a===0)||(45<=a&&135>a?ot+=90:135<=a&&225>a?ot+=180:225<=a&&315>a&&(ot+=270),360<=ot&&(ot-=360)),ot},Tn.prototype.computeEndSegmentLength=function(a,y,x,E){return y!==null&&x.$c()&&(a=Um(this,y),a!==null)?a.Ju:(a=E?this.fromEndSegmentLength:this.toEndSegmentLength,y!==null&&isNaN(a)&&(a=E?y.fromEndSegmentLength:y.toEndSegmentLength),isNaN(a)&&(a=10),a)},Tn.prototype.computeSpot=function(a,y){return y===void 0&&(y=null),a?(a=y||this.fromPort,a===null?a=Or:(y=this.fromSpot,y.Xb()&&(y=a.fromSpot),a=y===xa?gr:y)):(a=y||this.toPort,a===null?a=Or:(y=this.toSpot,y.Xb()&&(y=a.toSpot),a=y===xa?gr:y)),a};function Hf(a){return a===gr||a.x===.5&&a.y===.5}function Ym(a){return a.x===.5&&a.y===.5?a:Or}Tn.prototype.computeOtherPoint=function(a,y){return this.computeAdjusting()!==Ls&&4<this.pointsCount?this.computeMidPoint(new At):(a=y.Zn,a=a!==null?sS(a,this):null,a!==null?a.Zo:y.ga(Or))},Tn.prototype.computeShortLength=function(a){if(a){if(a=this.fromShortLength,isNaN(a)){var y=this.fromPort;y!==null&&(a=y.fromShortLength)}return isNaN(a)?0:a}return a=this.toShortLength,isNaN(a)&&(y=this.toPort,y!==null&&(a=y.toShortLength)),isNaN(a)?0:a},Tn.prototype.Cf=function(a,y,x,E,b,z){if(this.pickable===!1)return!1;y===void 0&&(y=null),x===void 0&&(x=null);var tt=z;if(z===void 0&&(tt=fe.alloc(),tt.reset()),tt.multiply(this.transform),this.fh(a,tt))return mv(this,y,x,b),z===void 0&&fe.free(tt),!0;if(this.Yc(a,tt)){var rt=!1;if(!this.isAtomic)for(var ot=this.O.s,lt=ot.length;lt--;){var ut=ot[lt];if(ut.visible||ut===this.locationObject){var ft=ut.actualBounds,yt=this.naturalBounds;if(!(ft.x>yt.width||ft.y>yt.height||0>ft.x+ft.width||0>ft.y+ft.height)){if(ft=fe.alloc(),ft.set(tt),ut instanceof En)rt=ut.Cf(a,y,x,E,b,ft);else if(this.path===ut){if(ut instanceof cr)if(rt=a,yt=E,ut.pickable===!1)rt=!1;else if(ft.multiply(ut.transform),yt)t:{var xt=rt,Ct=ft;if(ut.fh(xt,Ct))rt=!0;else{if(Ct===void 0&&(Ct=ut.transform,xt.Re(ut.actualBounds))){rt=!0;break t}rt=xt.left,yt=xt.right;var bt=xt.top;xt=xt.bottom;var Wt=At.alloc(),jt=At.alloc(),Qt=At.alloc(),te=fe.alloc();te.set(Ct),te.bv(ut.transform),te.Vj(),jt.x=yt,jt.y=bt,jt.transform(te),Wt.x=rt,Wt.y=bt,Wt.transform(te),Ct=!1,ic(ut,Wt,jt,Qt)?Ct=!0:(Wt.x=yt,Wt.y=xt,Wt.transform(te),ic(ut,Wt,jt,Qt)?Ct=!0:(jt.x=rt,jt.y=xt,jt.transform(te),ic(ut,Wt,jt,Qt)?Ct=!0:(Wt.x=rt,Wt.y=bt,Wt.transform(te),ic(ut,Wt,jt,Qt)&&(Ct=!0)))),fe.free(te),At.free(Wt),At.free(jt),At.free(Qt),rt=Ct}}else rt=ut.fh(rt,ft)}else rt=ka(ut,a,E,ft);rt&&(yt=ut,y!==null&&(yt=y(ut)),yt&&(x===null||x(yt))&&b.add(yt)),fe.free(ft)}}}return z===void 0&&fe.free(tt),rt||this.background!==null||this.areaBackground!==null}return z===void 0&&fe.free(tt),!1},Tn.prototype.computeCurve=function(){if(this.Wf===null){var a=this.fromPort,y=this.isOrthogonal;this.Wf=a!==null&&a===this.toPort&&!y}return this.Wf?ul:this.curve},Tn.prototype.computeCorner=function(){if(this.curve===ul)return 0;var a=this.corner;return(isNaN(a)||0>a)&&(a=10),a},Tn.prototype.findMidLabel=function(){for(var a=this.path,y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E];if(b!==a&&!b.isPanelMain&&(b.segmentIndex===-1/0||isNaN(b.segmentIndex)))return b}for(a=this.labelNodes;a.next();)if(y=a.value,y.segmentIndex===-1/0||isNaN(y.segmentIndex))return y;return null},Tn.prototype.computeSpacing=function(){if(!this.isVisible())return 0;var a=iS;a=Math.max(a,this.computeThickness());var y=this.fromPort,x=this.toPort;if(y!==null&&x!==null){var E=this.findMidLabel();if(E!==null){var b=E.naturalBounds,z=E.margin,tt=isNaN(b.width)?30:b.width*E.scale+z.left+z.right;b=isNaN(b.height)?14:b.height*E.scale+z.top+z.bottom,E=E.segmentOrientation,E===sp||E===qm||E===Qv?a=Math.max(a,b):E===up||E===dp||E===lp||E===hp?a=Math.max(a,tt):(y=y.ga(Or).ab(x.ga(Or))/180*Math.PI,a=Math.max(a,Math.abs(Math.sin(y)*tt)+Math.abs(Math.cos(y)*b)+1)),this.curve===ul&&(a*=1.333)}}return a},Tn.prototype.arrangeBundledLinks=function(a,y){if(y)for(y=0;y<a.length;y++){var x=a[y];x.computeAdjusting()===Ls&&x.bb()}},Tn.prototype.computeCurviness=function(){var a=this.curviness;if(isNaN(a)){a=nS;var y=this.Sf;if(y!==null){for(var x=pi(),E=0,b=y.links,z=0;z<b.length;z++){var tt=b[z].computeSpacing();x.push(tt),E+=tt}for(E=-E/2,z=0;z<b.length;z++){if(b[z]===this){a=E+x[z]/2;break}E+=x[z]}y.Ds===this.fromNode&&(a=-a),oi(x)}}return a},Tn.prototype.computeThickness=function(){if(!this.isVisible())return 0;var a=this.path;return a!==null?Math.max(a.strokeWidth,1):1},Tn.prototype.hasCurviness=function(){return!isNaN(this.curviness)||this.Sf!==null},Tn.prototype.adjustPoints=function(a,y,x,E){var b=this.computeAdjusting();if(this.isOrthogonal){if(b===Qm)return!1;b===$m&&(b=ap)}switch(b){case Qm:var z=this.i(a),tt=this.i(x);if(!z.Xa(y)||!tt.Xa(E)){b=z.x,z=z.y;var rt=tt.x-b,ot=tt.y-z,lt=Math.sqrt(rt*rt+ot*ot);if(!Zt.$(lt,0)){if(Zt.$(rt,0))var ut=0>ot?-Math.PI/2:Math.PI/2;else ut=Math.atan(ot/Math.abs(rt)),0>rt&&(ut=Math.PI-ut);tt=y.x;var ft=y.y;rt=E.x-tt;var yt=E.y-ft;for(ot=Math.sqrt(rt*rt+yt*yt),Zt.$(rt,0)?yt=0>yt?-Math.PI/2:Math.PI/2:(yt=Math.atan(yt/Math.abs(rt)),0>rt&&(yt=Math.PI-yt)),lt=ot/lt,ut=yt-ut,this.dd(a,y),a+=1;a<x;a++)y=this.i(a),rt=y.x-b,ot=y.y-z,y=Math.sqrt(rt*rt+ot*ot),Zt.$(y,0)||(Zt.$(rt,0)?ot=0>ot?-Math.PI/2:Math.PI/2:(ot=Math.atan(ot/Math.abs(rt)),0>rt&&(ot=Math.PI-ot)),rt=ot+ut,y*=lt,this.L(a,tt+y*Math.cos(rt),ft+y*Math.sin(rt)));this.dd(x,E)}}return!0;case $m:if(z=this.i(a),ft=this.i(x),!z.Xa(y)||!ft.Xa(E)){b=z.x,z=z.y,tt=ft.x,ft=ft.y,lt=(tt-b)*(tt-b)+(ft-z)*(ft-z),rt=y.x,ut=y.y,ot=E.x,yt=E.y;var xt=1;if(ot-rt!==0){var Ct=(yt-ut)/(ot-rt);xt=Math.sqrt(1+1/(Ct*Ct))}else Ct=9e9;for(this.dd(a,y),a+=1;a<x;a++){y=this.i(a);var bt=y.x,Wt=y.y,jt=.5;lt!==0&&(jt=((b-bt)*(b-tt)+(z-Wt)*(z-ft))/lt);var Qt=b+jt*(tt-b),te=z+jt*(ft-z);y=Math.sqrt((bt-Qt)*(bt-Qt)+(Wt-te)*(Wt-te)),Wt<Ct*(bt-Qt)+te&&(y=-y),0<Ct&&(y=-y),bt=rt+jt*(ot-rt),jt=ut+jt*(yt-ut),Ct!==0?(y=bt+y/xt,this.L(a,y,jt-(y-bt)/Ct)):this.L(a,bt,jt+y)}this.dd(x,E)}return!0;case ap:t:{if(this.isOrthogonal&&(b=this.i(a),z=this.i(a+1),tt=this.i(a+2),rt=z.x,ut=z.y,ft=rt,lt=ut,Zt.B(b.y,z.y)?Zt.B(z.x,tt.x)?ut=y.y:Zt.B(z.y,tt.y)&&(rt=y.x):Zt.B(b.x,z.x)&&(Zt.B(z.y,tt.y)?rt=y.x:Zt.B(z.x,tt.x)&&(ut=y.y)),this.L(a+1,rt,ut),b=this.i(x),z=this.i(x-1),tt=this.i(x-2),rt=z.x,ut=z.y,ot=rt,yt=ut,Zt.B(b.y,z.y)?Zt.B(z.x,tt.x)?ut=E.y:Zt.B(z.y,tt.y)&&(rt=E.x):Zt.B(b.x,z.x)&&(Zt.B(z.y,tt.y)?rt=E.x:Zt.B(z.x,tt.x)&&(ut=E.y)),this.L(x-1,rt,ut),Uv(this))){this.L(a+1,ft,lt),this.L(x-1,ot,yt),x=!1;break t}this.dd(a,y),this.dd(x,E),x=!0}return x;default:return!1}},Tn.prototype.addOrthoPoints=function(a,y,x,E,b,z){0>y?y+=360:360<=y&&(y-=360),0>E?E+=360:360<=E&&(E-=360);var tt=E;y=315<=y||45>y?0:45<=y&&135>y?90:135<=y&&225>y?180:270,E=315<=E||45>E?0:45<=E&&135>E?90:135<=E&&225>E?180:270;var rt=b.actualBounds.copy(),ot=z.actualBounds.copy();if(rt.w()&&ot.w()){rt.Bc(cp,cp),ot.Bc(cp,cp),rt.Ye(a),ot.Ye(x);var lt=At.alloc(),ut=At.alloc();y===0?x.x>a.x||E===270&&x.y<a.y&&ot.right>a.x||E===90&&x.y>a.y&&ot.right>a.x?(lt.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),E===180?(lt.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1),ut.x=lt.x,ut.y=x.y):E===270&&x.y<a.y||E===90&&x.y>a.y?(lt.x=a.x<ot.left?this.computeMidOrthoPosition(a.x,a.y,ot.left,x.y,!1):a.x<ot.right&&(E===270&&a.y<ot.top||E===90&&a.y>ot.bottom)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):ot.right,ut.x=lt.x,ut.y=x.y):E===0&&a.x<ot.left&&a.y>ot.top&&a.y<ot.bottom&&(lt.x=a.x,lt.y=a.y<x.y?Math.min(x.y,ot.top):Math.max(x.y,ot.bottom),ut.y=lt.y)):(lt.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),(E===180||E===90&&x.y<rt.top||E===270&&x.y>rt.bottom)&&(E===180&&(ot.ca(a)||rt.ca(x))?lt.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):x.y<a.y&&(E===180||E===90)?lt.y=this.computeMidOrthoPosition(a.x,rt.top,x.x,Math.max(x.y,ot.bottom),!0):x.y>a.y&&(E===180||E===270)&&(lt.y=this.computeMidOrthoPosition(a.x,rt.bottom,x.x,Math.min(x.y,ot.top),!0)),ut.x=x.x,ut.y=lt.y),lt.y>rt.top&&lt.y<rt.bottom&&(x.x>=rt.left&&x.x<=a.x||a.x<=ot.right&&a.x>=x.x?(E===90||E===270)&&(lt.h(Math.max((a.x+x.x)/2,a.x),a.y),ut.h(lt.x,x.y)):(lt.y=E===270||(E===0||E===180)&&x.y<a.y?Math.min(x.y,E===0?rt.top:Math.min(rt.top,ot.top)):Math.max(x.y,E===0?rt.bottom:Math.max(rt.bottom,ot.bottom)),ut.x=x.x,ut.y=lt.y))):y===180?x.x<a.x||E===270&&x.y<a.y&&ot.left<a.x||E===90&&x.y>a.y&&ot.left<a.x?(lt.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),E===0?(lt.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1),ut.x=lt.x,ut.y=x.y):E===270&&x.y<a.y||E===90&&x.y>a.y?(lt.x=a.x>ot.right?this.computeMidOrthoPosition(a.x,a.y,ot.right,x.y,!1):a.x>ot.left&&(E===270&&a.y<ot.top||E===90&&a.y>ot.bottom)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):ot.left,ut.x=lt.x,ut.y=x.y):E===180&&a.x>ot.right&&a.y>ot.top&&a.y<ot.bottom&&(lt.x=a.x,lt.y=a.y<x.y?Math.min(x.y,ot.top):Math.max(x.y,ot.bottom),ut.y=lt.y)):(lt.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),(E===0||E===90&&x.y<rt.top||E===270&&x.y>rt.bottom)&&(E===0&&(ot.ca(a)||rt.ca(x))?lt.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):x.y<a.y&&(E===0||E===90)?lt.y=this.computeMidOrthoPosition(a.x,rt.top,x.x,Math.max(x.y,ot.bottom),!0):x.y>a.y&&(E===0||E===270)&&(lt.y=this.computeMidOrthoPosition(a.x,rt.bottom,x.x,Math.min(x.y,ot.top),!0)),ut.x=x.x,ut.y=lt.y),lt.y>rt.top&&lt.y<rt.bottom&&(x.x<=rt.right&&x.x>=a.x||a.x>=ot.left&&a.x<=x.x?(E===90||E===270)&&(lt.h(Math.min((a.x+x.x)/2,a.x),a.y),ut.h(lt.x,x.y)):(lt.y=E===270||(E===0||E===180)&&x.y<a.y?Math.min(x.y,E===180?rt.top:Math.min(rt.top,ot.top)):Math.max(x.y,E===180?rt.bottom:Math.max(rt.bottom,ot.bottom)),ut.x=x.x,ut.y=lt.y))):y===90?x.y>a.y||E===180&&x.x<a.x&&ot.bottom>a.y||E===0&&x.x>a.x&&ot.bottom>a.y?(lt.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),E===270?(lt.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0),ut.x=x.x,ut.y=lt.y):E===180&&x.x<a.x||E===0&&x.x>a.x?(lt.y=a.y<ot.top?this.computeMidOrthoPosition(a.x,a.y,x.x,ot.top,!0):a.y<ot.bottom&&(E===180&&a.x<ot.left||E===0&&a.x>ot.right)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):ot.bottom,ut.x=x.x,ut.y=lt.y):E===90&&a.y<ot.top&&a.x>ot.left&&a.x<ot.right&&(lt.x=a.x<x.x?Math.min(x.x,ot.left):Math.max(x.x,ot.right),lt.y=a.y,ut.x=lt.x)):(lt.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),(E===270||E===0&&x.x<rt.left||E===180&&x.x>rt.right)&&(E===270&&(ot.ca(a)||rt.ca(x))?lt.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):x.x<a.x&&(E===270||E===0)?lt.x=this.computeMidOrthoPosition(rt.left,a.y,Math.max(x.x,ot.right),x.y,!1):x.x>a.x&&(E===270||E===180)&&(lt.x=this.computeMidOrthoPosition(rt.right,a.y,Math.min(x.x,ot.left),x.y,!1)),ut.x=lt.x,ut.y=x.y),lt.x>rt.left&&lt.x<rt.right&&(x.y>=rt.top&&x.y<=a.y||a.y<=ot.bottom&&a.y>=x.y?(E===0||E===180)&&(lt.h(a.x,Math.max((a.y+x.y)/2,a.y)),ut.h(x.x,lt.y)):(lt.x=E===180||(E===90||E===270)&&x.x<a.x?Math.min(x.x,E===90?rt.left:Math.min(rt.left,ot.left)):Math.max(x.x,E===90?rt.right:Math.max(rt.right,ot.right)),ut.x=lt.x,ut.y=x.y))):x.y<a.y||E===180&&x.x<a.x&&ot.top<a.y||E===0&&x.x>a.x&&ot.top<a.y?(lt.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),E===90?(lt.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0),ut.x=x.x,ut.y=lt.y):E===180&&x.x<a.x||E===0&&x.x>=a.x?(lt.y=a.y>ot.bottom?this.computeMidOrthoPosition(a.x,a.y,x.x,ot.bottom,!0):a.y>ot.top&&(E===180&&a.x<ot.left||E===0&&a.x>ot.right)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):ot.top,ut.x=x.x,ut.y=lt.y):E===270&&a.y>ot.bottom&&a.x>ot.left&&a.x<ot.right&&(lt.x=a.x<x.x?Math.min(x.x,ot.left):Math.max(x.x,ot.right),lt.y=a.y,ut.x=lt.x)):(lt.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),(E===90||E===0&&x.x<rt.left||E===180&&x.x>rt.right)&&(E===90&&(ot.ca(a)||rt.ca(x))?lt.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):x.x<a.x&&(E===90||E===0)?lt.x=this.computeMidOrthoPosition(rt.left,a.y,Math.max(x.x,ot.right),x.y,!1):x.x>a.x&&(E===90||E===180)&&(lt.x=this.computeMidOrthoPosition(rt.right,a.y,Math.min(x.x,ot.left),x.y,!1)),ut.x=lt.x,ut.y=x.y),lt.x>rt.left&&lt.x<rt.right&&(x.y<=rt.bottom&&x.y>=a.y||a.y>=ot.top&&a.y<=x.y?(E===0||E===180)&&(lt.h(a.x,Math.min((a.y+x.y)/2,a.y)),ut.h(x.x,lt.y)):(lt.x=E===180||(E===90||E===270)&&x.x<a.x?Math.min(x.x,E===270?rt.left:Math.min(rt.left,ot.left)):Math.max(x.x,E===270?rt.right:Math.max(rt.right,ot.right)),ut.x=lt.x,ut.y=x.y)));var ft=x;if(this.isAvoiding){var yt=this.diagram;if(yt===null||b===z||this.layer.isTemporary||!Cf(yt)||rt.ca(ft)&&!z.Td(b)||ot.ca(a)&&!b.Td(z))y=!1;else{var xt=Ef(yt,!0,this.containingGroup,null);if(this.segmentIndex!==17&&xt.Yj(Math.min(a.x,lt.x),Math.min(a.y,lt.y),Math.abs(a.x-lt.x),Math.abs(a.y-lt.y))&&xt.Yj(Math.min(lt.x,ut.x),Math.min(lt.y,ut.y),Math.abs(lt.x-ut.x),Math.abs(lt.y-ut.y))&&xt.Yj(Math.min(ut.x,ft.x),Math.min(ut.y,ft.y),Math.abs(ut.x-ft.x),Math.abs(ut.y-ft.y)))y=!1;else{b=a,z=ft;var Ct=x=null;if(yt.isVirtualized){yt=xt.bounds.copy(),yt.Bc(-xt.Ho,-xt.Go);var bt=At.alloc();Vf(xt,a.x,a.y)||(Zt.Ff(yt.x,yt.y,yt.x+yt.width,yt.y+yt.height,a.x,a.y,lt.x,lt.y,bt)?(x=a=bt.copy(),y=bt.ab(lt)):Zt.Ff(yt.x,yt.y,yt.x+yt.width,yt.y+yt.height,lt.x,lt.y,ut.x,ut.y,bt)?(x=a=bt.copy(),y=bt.ab(ut)):Zt.Ff(yt.x,yt.y,yt.x+yt.width,yt.y+yt.height,ut.x,ut.y,ft.x,ft.y,bt)&&(x=a=bt.copy(),y=bt.ab(ft))),Vf(xt,ft.x,ft.y)||(Zt.Ff(yt.x,yt.y,yt.x+yt.width,yt.y+yt.height,ft.x,ft.y,ut.x,ut.y,bt)?(Ct=ft=bt.copy(),E=ut.ab(bt)):Zt.Ff(yt.x,yt.y,yt.x+yt.width,yt.y+yt.height,ut.x,ut.y,lt.x,lt.y,bt)?(Ct=ft=bt.copy(),E=lt.ab(bt)):Zt.Ff(yt.x,yt.y,yt.x+yt.width,yt.y+yt.height,lt.x,lt.y,a.x,a.y,bt)&&(Ct=ft=bt.copy(),E=a.ab(bt))),At.free(bt)}rt=rt.copy().ed(ot),rt.Bc(xt.Ho*xt.Os,xt.Go*xt.Os),oS(xt,a,y,ft,E,rt,!0),ot=Uu(xt,ft.x,ft.y),!xt.abort&&ot>=Kf&&(rS(xt),rt.Bc(xt.Ho*xt.Hx,xt.Go*xt.Ix),oS(xt,a,y,ft,E,rt,!1),ot=Uu(xt,ft.x,ft.y)),!xt.abort&&ot<Kf&&Uu(xt,ft.x,ft.y)!==Zh?(Yv(this,xt,ft.x,ft.y,E,!0,tt),rt=this.i(2),4>this.pointsCount?(y===0||y===180?(rt.x=a.x,rt.y=ft.y):(rt.x=ft.x,rt.y=a.y),this.L(2,rt.x,rt.y),this.m(3,rt.x,rt.y)):(tt=this.i(3),y===0||y===180?Zt.B(rt.x,tt.x)?(rt=y===0?Math.max(rt.x,a.x):Math.min(rt.x,a.x),this.L(2,rt,a.y),this.L(3,rt,tt.y)):Zt.B(rt.y,tt.y)?(Math.abs(a.y-rt.y)<=xt.Go/2&&(this.L(2,rt.x,a.y),this.L(3,tt.x,a.y)),this.m(2,rt.x,a.y)):this.L(2,a.x,rt.y):(y===90||y===270)&&(Zt.B(rt.y,tt.y)?(rt=y===90?Math.max(rt.y,a.y):Math.min(rt.y,a.y),this.L(2,a.x,rt),this.L(3,tt.x,rt)):Zt.B(rt.x,tt.x)?(Math.abs(a.x-rt.x)<=xt.Ho/2&&(this.L(2,a.x,rt.y),this.L(3,a.x,tt.y)),this.m(2,a.x,rt.y)):this.L(2,rt.x,a.y))),x!==null&&(a=this.i(1),tt=this.i(2),a.x!==tt.x&&a.y!==tt.y?y===0||y===180?this.m(2,a.x,tt.y):this.m(2,tt.x,a.y):y===0||y===180?this.m(2,b.x,x.y):this.m(2,x.x,b.y)),Ct!==null&&(E===0||E===180?this.yf(z.x,Ct.y):this.yf(Ct.x,z.y)),y=!0):y=!1}}}else y=!1;y||(this.ne(lt.copy()),this.ne(ut.copy())),At.free(lt),At.free(ut)}},Tn.prototype.computeMidOrthoPosition=function(a,y,x,E,b){var z=0;return!this.hasCurviness()||this.computeSpot(!0,this.fromPort).$c()||this.computeSpot(!1,this.toPort).$c()||(z=this.computeCurviness()),b?(y+E)/2+z:(a+x)/2+z};function Uv(a){if(a.diagram===null||!a.isAvoiding||!Cf(a.diagram))return!1;var y=a.points.s,x=y.length;if(4>x)return!1;a=Ef(a.diagram,!0,a.containingGroup,null);for(var E=1;E<x-2;E++){var b=y[E],z=y[E+1];if(!a.Yj(Math.min(b.x,z.x),Math.min(b.y,z.y),Math.abs(b.x-z.x),Math.abs(b.y-z.y)))return!0}return!1}function Yv(a,y,x,E,b,z,tt){var rt=y.Ho,ot=y.Go,lt=Uu(y,x,E),ut=x,ft=E;for(b===0?ut+=rt:b===90?ft+=ot:b===180?ut-=rt:ft-=ot,b!==tt&&lt>ac&&Uu(y,ut,ft)!==lt-1&&(Uu(y,x-rt,E)===lt-1?(b=180,ut=x-rt,ft=E):Uu(y,x+rt,E)===lt-1?(b=0,ut=x+rt,ft=E):Uu(y,x,E-ot)===lt-1?(b=270,ut=x,ft=E-ot):Uu(y,x,E+ot)===lt-1&&(b=90,ut=x,ft=E+ot));lt>ac&&Uu(y,ut,ft)===lt-1;)x=ut,E=ft,b===0?ut+=rt:b===90?ft+=ot:b===180?ut-=rt:ft-=ot,--lt;z?lt>ac&&(b===180||b===0?x=Math.floor(x/rt)*rt+rt/2:(b===90||b===270)&&(E=Math.floor(E/ot)*ot+ot/2)):(x=Math.floor(x/rt)*rt+rt/2,E=Math.floor(E/ot)*ot+ot/2),lt>ac&&(z=b,tt=x,ut=E,b===0?(z=90,ut+=ot):b===90?(z=180,tt-=rt):b===180?(z=270,ut-=ot):b===270&&(z=0,tt+=rt),Uu(y,tt,ut)===lt-1?Yv(a,y,tt,ut,z,!1,z):(tt=x,ut=E,b===0?(z=270,ut-=ot):b===90?(z=0,tt+=rt):b===180?(z=90,ut+=ot):b===270&&(z=180,tt-=rt),Uu(y,tt,ut)===lt-1&&Yv(a,y,tt,ut,z,!1,z))),a.yf(x,E)}Tn.prototype.ez=function(a){var y=a.x;a=a.y;for(var x=this.i(0),E=this.i(1),b=ni(y,a,x.x,x.y,E.x,E.y),z=0,tt=1;tt<this.pointsCount-1;tt++){x=this.i(tt+1);var rt=ni(y,a,E.x,E.y,x.x,x.y);E=x,rt<b&&(z=tt,b=rt)}return z},Tn.prototype.qc=function(){this.lk=!1,this.v()},Tn.prototype.Ul=function(a){if(!(!a&&(this.fd===!1||(a=this.Pb(),this.lk&&(a===null||a.geometry!==null))))&&(2>this.pointsCount?this.lk=!0:this.ua=this.makeGeometry(),a=this.path,a!==null)){a.ua=this.ua;for(var y=this.O.s,x=y.length,E=0;E<x;E++){var b=y[E];b!==a&&b.isPanelMain&&b instanceof cr&&(b.ua=this.ua)}}},Tn.prototype.makeGeometry=function(){var a=this.ua,y=this.pointsCount,x=!1,E=this.diagram;E!==null&&oc(this)&&E.Eh.contains(this)&&(this.ml.width!==0||this.ml.height!==0)&&(E.animationManager.isAnimating||E.currentTool!==E.toolManager)&&(x=!0);var b=this.i(0).copy(),z=b.copy();E=this.Nb.s;var tt=this.computeCurve();if(tt===ul&&3<=y&&!Zt.$(this.smoothness,0))if(y===3){var rt=this.i(1);E=Math.min(b.x,rt.x);var ot=Math.min(b.y,rt.y);rt=this.i(2),E=Math.min(E,rt.x),ot=Math.min(ot,rt.y)}else{if(this.isOrthogonal)for(ot=0;ot<y;ot++)rt=E[ot],z.x=Math.min(rt.x,z.x),z.y=Math.min(rt.y,z.y);else for(E=3;E<y;E+=3)E+3>=y&&(E=y-1),ot=this.i(E),z.x=Math.min(ot.x,z.x),z.y=Math.min(ot.y,z.y);E=z.x,ot=z.y}else{for(ot=0;ot<y;ot++)rt=E[ot],z.x=Math.min(rt.x,z.x),z.y=Math.min(rt.y,z.y);E=z.x,ot=z.y}if(E-=this.su.x,ot-=this.su.y,b.x-=E,b.y-=ot,y!==2||oc(this)){if(a.type=Ye.o,rt=N1(a),this.computeShortLength(!0)!==0&&(b=Zc(this,b,!0,z)),Zf(rt,b.x,b.y,!1),tt===ul&&3<=y&&!Zt.$(this.smoothness,0))if(y===3)x=this.i(1),y=x.x-E,x=x.y-ot,b=this.i(2).copy(),b.x-=E,b.y-=ot,this.computeShortLength(!1)!==0&&(b=Zc(this,b,!1,z)),Ih(rt,y,x,y,x,b.x,b.y);else if(this.isOrthogonal){y=At.allocAt(E,ot),x=At.alloc(),x.assign(this.i(1)),z=At.allocAt(E,ot),b=At.allocAt(E,ot),tt=this.i(0);for(var lt,ut=this.smoothness/3,ft=1;ft<this.pointsCount-1;ft++){lt=this.i(ft);var yt=tt,xt=lt,Ct=this.i(Xv(this,lt,ft,!1));if((!Zt.$(yt.x,xt.x)||!Zt.$(xt.x,Ct.x))&&(!Zt.$(yt.y,xt.y)||!Zt.$(xt.y,Ct.y))){var bt=ut;isNaN(bt)&&(bt=this.smoothness/3);var Wt=yt.x;yt=yt.y;var jt=xt.x;xt=xt.y;var Qt=Ct.x;Ct=Ct.y;var te=bt*Xm(Wt,yt,jt,xt);bt*=Xm(jt,xt,Qt,Ct),Zt.$(yt,xt)&&Zt.$(jt,Qt)&&(jt>Wt?Ct>xt?(z.x=jt-te,z.y=xt-te,b.x=jt+bt,b.y=xt+bt):(z.x=jt-te,z.y=xt+te,b.x=jt+bt,b.y=xt-bt):Ct>xt?(z.x=jt+te,z.y=xt-te,b.x=jt-bt,b.y=xt+bt):(z.x=jt+te,z.y=xt+te,b.x=jt-bt,b.y=xt-bt)),Zt.$(Wt,jt)&&Zt.$(xt,Ct)&&(xt>yt?(Qt>jt?(z.x=jt-te,z.y=xt-te,b.x=jt+bt):(z.x=jt+te,z.y=xt-te,b.x=jt-bt),b.y=xt+bt):(Qt>jt?(z.x=jt-te,z.y=xt+te,b.x=jt+bt):(z.x=jt+te,z.y=xt+te,b.x=jt-bt),b.y=xt-bt)),(Zt.$(Wt,jt)&&Zt.$(jt,Qt)||Zt.$(yt,xt)&&Zt.$(xt,Ct))&&(Wt=.5*(Wt+Qt),yt=.5*(yt+Ct),z.x=Wt,z.y=yt,b.x=Wt,b.y=yt),(ft===1||ft===2&&Zt.$(tt.x,this.i(0).x)&&Zt.$(tt.y,this.i(0).y))&&(x.x=.5*(tt.x+lt.x),x.y=.5*(tt.y+lt.y)),Ih(rt,x.x-E,x.y-ot,z.x-E,z.y-ot,lt.x-E,lt.y-ot),y.set(z),x.set(b),tt=lt}}lt=tt.x,tt=tt.y,ut=this.i(this.pointsCount-1),this.computeShortLength(!1)!==0&&(ut=Zc(this,ut.copy(),!1,Un)),lt=.5*(lt+ut.x),tt=.5*(tt+ut.y),Ih(rt,b.x-E,b.y-ot,lt-E,tt-ot,ut.x-E,ut.y-ot),At.free(y),At.free(x),At.free(z),At.free(b)}else for(x=3;x<y;x+=3)z=this.i(x-2),x+3>=y&&(x=y-1),b=this.i(x-1),tt=this.i(x),x===y-1&&this.computeShortLength(!1)!==0&&(tt=Zc(this,tt.copy(),!1,Un)),Ih(rt,z.x-E,z.y-ot,b.x-E,b.y-ot,tt.x-E,tt.y-ot);else{for(z=At.alloc(),z.assign(this.i(0)),b=At.alloc(),b.assign(z),tt=this.computeCorner(),ft=1,lt=0;ft<y;){if(ft=Xv(this,z,ft,1<ft),ut=this.i(ft),ft>=y-1){if(!z.D(ut))this.computeShortLength(!1)!==0&&(ut=Zc(this,ut.copy(),!1,Un)),Gc(this,rt,-E,-ot,z,ut,x);else if(lt===0)for(ft=1;ft<y;)b.assign(z),ut=this.i(ft++),Gc(this,rt,-E,-ot,z,ut,x),z.assign(ut);break}if(lt=Xv(this,ut,ft+1,ft<y-3),ft=-E,Wt=-ot,yt=ut,jt=this.i(lt),bt=x,Zt.B(z.y,yt.y)&&Zt.B(yt.x,jt.x))if(Ct=Math.min(tt,Math.abs(yt.x-b.x)/2),Ct=te=Math.min(Ct,Math.abs(jt.y-yt.y)/2),Zt.B(Ct,0))Gc(this,rt,ft,Wt,z,yt,bt),z.assign(yt);else{var re=yt.x,he=yt.y;xt=re,Qt=he,yt.x>z.x?re=yt.x-Ct:re=yt.x+Ct,jt.y>yt.y?Qt=yt.y+te:Qt=yt.y-te,jt=At.allocAt(re,he),Gc(this,rt,ft,Wt,z,jt,bt),At.free(jt),jm(rt,yt.x+ft,yt.y+Wt,xt+ft,Qt+Wt),z.h(xt,Qt)}else Zt.B(z.x,yt.x)&&Zt.B(yt.y,jt.y)?(Ct=Math.min(tt,Math.abs(yt.y-b.y)/2),Ct=te=Math.min(Ct,Math.abs(jt.x-yt.x)/2),Zt.B(te,0)?(Gc(this,rt,ft,Wt,z,yt,bt),z.assign(yt)):(re=yt.x,he=yt.y,xt=re,Qt=he,yt.y>z.y?he=yt.y-Ct:he=yt.y+Ct,jt.x>yt.x?xt=yt.x+te:xt=yt.x-te,jt=At.allocAt(re,he),Gc(this,rt,ft,Wt,z,jt,bt),At.free(jt),jm(rt,yt.x+ft,yt.y+Wt,xt+ft,Qt+Wt),z.h(xt,Qt))):(Gc(this,rt,ft,Wt,z,yt,bt),z.assign(yt));b.assign(ut),ft=lt}At.free(z)}zm=rt}else rt=this.i(1).copy(),rt.x-=E,rt.y-=ot,this.computeShortLength(!0)!==0&&(b=Zc(this,b,!0,z)),this.computeShortLength(!1)!==0&&(rt=Zc(this,rt,!1,z)),a.type=Ye.j,a.startX=b.x,a.startY=b.y,a.endX=rt.x,a.endY=rt.y;return this.lk=!0,a};function Xm(a,y,x,E){return a=x-a,isNaN(a)||a===1/0||a===-1/0?NaN:(0>a&&(a=-a),y=E-y,isNaN(y)||y===1/0||y===-1/0?NaN:(0>y&&(y=-y),Zt.$(a,0)?y:Zt.$(y,0)?a:Math.sqrt(a*a+y*y)))}function Zc(a,y,x,E){var b=a.pointsCount;if(2>b)return y;if(x){var z=a.i(1);if(x=z.x-E.x,z=z.y-E.y,E=Xm(y.x,y.y,x,z),E===0)return y;b=b===2?.5*E:E,a=a.computeShortLength(!0),a>b&&(a=b),b=a*(z-y.y)/E,y.x+=a*(x-y.x)/E,y.y+=b}else{if(z=a.i(b-2),x=z.x-E.x,z=z.y-E.y,E=Xm(y.x,y.y,x,z),E===0)return y;b=b===2?.5*E:E,a=a.computeShortLength(!1),a>b&&(a=b),b=a*(y.y-z)/E,y.x-=a*(y.x-x)/E,y.y-=b}return y}function Xv(a,y,x,E){for(var b=a.pointsCount,z=y;Zt.$(y.x,z.x)&&Zt.$(y.y,z.y);){if(x>=b)return b-1;z=a.i(x++)}if(!Zt.$(y.x,z.x)&&!Zt.$(y.y,z.y))return x-1;for(var tt=z;Zt.$(y.x,z.x)&&Zt.$(z.x,tt.x)&&(!E||(y.y>=z.y?z.y>=tt.y:z.y<=tt.y))||Zt.$(y.y,z.y)&&Zt.$(z.y,tt.y)&&(!E||(y.x>=z.x?z.x>=tt.x:z.x<=tt.x));){if(x>=b)return b-1;tt=a.i(x++)}return x-2}Tn.prototype.computeJumpLength=function(){return 10};function Gc(a,y,x,E,b,z,tt){if(!tt&&oc(a)){tt=a.computeJumpLength();var rt=tt/2,ot=[],lt=0;if(a.isVisible()&&(lt=Lx(a,b,z,ot)),0<lt){if(Zt.B(b.y,z.y))if(b.x<z.x)for(var ut=0;ut<lt;){var ft=Math.max(b.x,Math.min(ot[ut++]-rt,z.x-tt));y.lineTo(ft+x,z.y+E);for(var yt=ft+x,xt=Math.min(ft+tt,z.x);ut<lt&&(ft=ot[ut],ft<xt+tt);)ut++,xt=Math.min(ft+rt,z.x);ft=z.y-tt+E,xt+=x;var Ct=z.y+E;a.curve===zh?Zf(y,xt,Ct,!1):Ih(y,yt,ft,xt,ft,xt,Ct)}else for(--lt;0<=lt;){for(ut=Math.min(b.x,Math.max(ot[lt--]+rt,z.x+tt)),y.lineTo(ut+x,z.y+E),yt=ut+x,ft=Math.max(ut-tt,z.x);0<=lt&&(ut=ot[lt],ut>ft-tt);)lt--,ft=Math.max(ut-rt,z.x);ut=z.y-tt+E,ft+=x,xt=z.y+E,a.curve===zh?Zf(y,ft,xt,!1):Ih(y,yt,ut,ft,ut,ft,xt)}else if(Zt.B(b.x,z.x))if(b.y<z.y)for(ut=0;ut<lt;){for(ft=Math.max(b.y,Math.min(ot[ut++]-rt,z.y-tt)),y.lineTo(z.x+x,ft+E),yt=ft+E,ft=Math.min(ft+tt,z.y);ut<lt&&(xt=ot[ut],xt<ft+tt);)ut++,ft=Math.min(xt+rt,z.y);xt=z.x-tt+x,Ct=z.x+x,ft+=E,a.curve===zh?Zf(y,Ct,ft,!1):Ih(y,xt,yt,xt,ft,Ct,ft)}else for(--lt;0<=lt;){for(ut=Math.min(b.y,Math.max(ot[lt--]+rt,z.y+tt)),y.lineTo(z.x+x,ut+E),yt=ut+E,ut=Math.max(ut-tt,z.y);0<=lt&&(ft=ot[lt],ft>ut-tt);)lt--,ut=Math.max(ft-rt,z.y);ft=z.x-tt+x,xt=z.x+x,ut+=E,a.curve===zh?Zf(y,xt,ut,!1):Ih(y,ft,yt,ft,ut,xt,ut)}}}y.lineTo(z.x+x,z.y+E)}function Lx(a,y,x,E){var b=a.diagram;if(b===null||y.D(x))return 0;for(b=b.layers;b.next();){var z=b.value;if(z!==null&&z.visible){z=z.Pa.s;for(var tt=z.length,rt=0;rt<tt;rt++){var ot=z[rt];if(ot instanceof Tn){if(ot===a)return 0<E.length&&E.sort(function(ut,ft){return ut-ft}),E.length;if(ot.isVisible()&&oc(ot)){var lt=ot.routeBounds;lt.w()&&a.routeBounds.Yc(lt)&&!a.usesSamePort(ot)&&(lt=ot.path,lt!==null&&lt.Ed()&&Fx(y,x,E,ot))}}}}}return 0<E.length&&E.sort(function(ut,ft){return ut-ft}),E.length}function Fx(a,y,x,E){for(var b=Zt.B(a.y,y.y),z=E.pointsCount,tt=E.i(0),rt=At.alloc(),ot=1;ot<z;ot++){var lt=E.i(ot);if(ot<z-1){var ut=E.i(ot+1);if(tt.y===lt.y&&lt.y===ut.y){if(lt.x>tt.x&&ut.x>=lt.x||lt.x<tt.x&&ut.x<=lt.x)continue}else if(tt.x===lt.x&&lt.x===ut.x&&(lt.y>tt.y&&ut.y>=lt.y||lt.y<tt.y&&ut.y<=lt.y))continue}t:{ut=a.x;var ft=a.y,yt=y.x,xt=y.y,Ct=tt.x;tt=tt.y;var bt=lt.x,Wt=lt.y;if(Zt.B(ut,yt)){if(!Zt.B(ft,xt)&&Zt.B(tt,Wt)&&Math.min(ft,xt)<tt&&Math.max(ft,xt)>tt&&Math.min(Ct,bt)<ut&&Math.max(Ct,bt)>ut&&!Zt.B(Ct,bt)){rt.x=ut,rt.y=tt,ut=!0;break t}}else if(Zt.B(ft,xt)&&Zt.B(Ct,bt)&&Math.min(ut,yt)<Ct&&Math.max(ut,yt)>Ct&&Math.min(tt,Wt)<ft&&Math.max(tt,Wt)>ft&&!Zt.B(tt,Wt)){rt.x=Ct,rt.y=ft,ut=!0;break t}rt.x=0,rt.y=0,ut=!1}ut&&(b?x.push(rt.x):x.push(rt.y)),tt=lt}At.free(rt)}function oc(a){return a=a.curve,a===Wf||a===zh}function Jm(a,y){(y||oc(a))&&(y=a.diagram,y===null||y.animationManager.isTicking||y.Eh.contains(a)||a.ml.width===0&&a.ml.height===0||y.Eh.add(a,a.ml.copy()))}Tn.prototype.Xo=function(a){var y=this.layer;if(y!==null&&y.visible&&!y.isTemporary){var x=y.diagram;if(x!==null&&!x.animationManager.isTicking){var E=!1;for(x=x.layers;x.next();){var b=x.value;if(b.visible){if(b===y){E=!0;var z=!1;b=b.Pa.s;for(var tt=b.length,rt=0;rt<tt;rt++){var ot=b[rt];ot instanceof Tn&&(ot===this?z=!0:z&&tS(this,ot,a))}}else if(E)for(z=b.Pa.s,b=z.length,tt=0;tt<b;tt++)rt=z[tt],rt instanceof Tn&&tS(this,rt,a)}}}}};function tS(a,y,x){if(y!==null&&y.lk&&y.fd&&oc(y)){var E=y.routeBounds;E.w()&&(a.routeBounds.Yc(E)||x.Yc(E))&&(a.usesSamePort(y)||y.qc())}}Tn.prototype.usesSamePort=function(a){var y=this.pointsCount,x=a.pointsCount;if(0<y&&0<x){var E=this.i(0),b=a.i(0);if(E.Xa(b)||(y=this.i(y-1),a=a.i(x-1),y.Xa(a)||E.Xa(a)||y.Xa(b)))return!0}else if(this.fromNode===a.fromNode||this.toNode===a.toNode||this.fromNode===a.toNode||this.toNode===a.fromNode)return!0;return!1},Tn.prototype.isVisible=function(){if(!Ni.prototype.isVisible.call(this))return!1;var a=this.containingGroup,y=!0,x=this.diagram;if(x!==null&&(y=x.isTreePathToChildren),x=this.fromNode,x!==null){if(this.isTreeLink&&y&&!x.isTreeExpanded)return!1;if(x===a)return!0;for(var E=x;E!==null;){if(E.labeledLink===this)return!0;E=E.containingGroup}if(x=x.findVisibleNode(),x===null||x===a)return!1}if(x=this.toNode,x!==null){if(this.isTreeLink&&!y&&!x.isTreeExpanded)return!1;if(x===a)return!0;for(y=x;y!==null;){if(y.labeledLink===this)return!0;y=y.containingGroup}if(y=x.findVisibleNode(),y===null||y===a)return!1}return!0},Tn.prototype.Zb=function(a){if(Ni.prototype.Zb.call(this,a),a&&Jm(this,!1),this.Sf!==null&&this.Sf.Sl(),this.wd!==null)for(var y=this.wd.iterator;y.next();)y.value.Zb(a)},Tn.prototype.computeAdjusting=function(){return this.isAvoiding&&this.diagram!==null&&this.diagram.animationManager.defaultAnimation.isAnimating?ap:this.qk};function rp(a){var y=a.ef;if(y!==null){var x=a.uf;if(x!==null&&isNaN(a.curviness)){for(var E=a.ff,b=a.vf,z=a=null,tt=y.jb.s,rt=tt.length,ot=0;ot<rt;ot++){var lt=tt[ot];(lt.ef===y&&lt.ff===E&&lt.uf===x&&lt.vf===b||lt.ef===x&&lt.ff===b&&lt.uf===y&&lt.vf===E)&&(z===null?z=lt:(a===null&&(a=[],a.push(z)),a.push(lt)))}if(a!==null){for(z=G1(y,x,E,b),z===null&&(z=new e0(y,E,x,b),Z1(y,z),Z1(x,z)),z.links=a,y=0;y<a.length;y++)a[y].Sf=z;z.Sl()}}}}function op(a){var y=a.Sf;y!==null&&isNaN(a.curviness)&&(a.Sf=null,a=y.links.indexOf(a),0<=a&&(Mi(y.links,a),y.Sl()))}Tn.prototype.ph=function(){return!0},ve.Object.defineProperties(Tn.prototype,{fromNode:{get:function(){return this.ef},set:function(a){var y=this.ef;if(y!==a){var x=this.fromPort;y!==null&&(this.uf!==y&&Wm(y,this,x),op(this),this.C(2)),this.ef=a,a!==null&&this.Zb(a.isVisible()),this.Wf=null,this.bb();var E=this.diagram;E!==null&&E.aa&&E.partManager.setFromNodeForLink(this,a,y);var b=this.fromPort,z=this.fromPortChanged;if(z!==null){var tt=!0;E!==null&&(tt=E.aa,E.aa=!0),z(this,x,b),E!==null&&(E.aa=tt)}a!==null&&(this.uf!==a&&Hm(a,this,b),rp(this),this.C(1)),this.g("fromNode",y,a),Gf(this)}}},fromPortId:{get:function(){return this.ff},set:function(a){var y=this.ff;if(y!==a){var x=this.fromPort;x!==null&&$s(x),op(this),this.ff=a;var E=this.fromPort;E!==null&&$s(E);var b=this.diagram;if(b!==null){var z=this.data,tt=b.model;z!==null&&tt.ri()&&tt.xv(z,a)}x!==E&&(this.Wf=null,this.bb(),z=this.fromPortChanged,z!==null&&(tt=!0,b!==null&&(tt=b.aa,b.aa=!0),z(this,x,E),b!==null&&(b.aa=tt))),rp(this),this.g("fromPortId",y,a)}}},fromPort:{get:function(){var a=this.ef;return a===null?null:a.ns(this.ff)}},fromPortChanged:{get:function(){return this.gn},set:function(a){var y=this.gn;y!==a&&(this.gn=a,this.g("fromPortChanged",y,a))}},toNode:{get:function(){return this.uf},set:function(a){var y=this.uf;if(y!==a){var x=this.toPort;y!==null&&(this.ef!==y&&Wm(y,this,x),op(this),this.C(2)),this.uf=a,a!==null&&this.Zb(a.isVisible()),this.Wf=null,this.bb();var E=this.diagram;E!==null&&E.aa&&E.partManager.setToNodeForLink(this,a,y);var b=this.toPort,z=this.toPortChanged;if(z!==null){var tt=!0;E!==null&&(tt=E.aa,E.aa=!0),z(this,x,b),E!==null&&(E.aa=tt)}a!==null&&(this.ef!==a&&Hm(a,this,b),rp(this),this.C(1)),this.g("toNode",y,a),Gf(this)}}},toPortId:{get:function(){return this.vf},set:function(a){var y=this.vf;if(y!==a){var x=this.toPort;x!==null&&$s(x),op(this),this.vf=a;var E=this.toPort;E!==null&&$s(E);var b=this.diagram;if(b!==null){var z=this.data,tt=b.model;z!==null&&tt.ri()&&tt.Cv(z,a)}x!==E&&(this.Wf=null,this.bb(),z=this.toPortChanged,z!==null&&(tt=!0,b!==null&&(tt=b.aa,b.aa=!0),z(this,x,E),b!==null&&(b.aa=tt))),rp(this),this.g("toPortId",y,a)}}},toPort:{get:function(){var a=this.uf;return a===null?null:a.ns(this.vf)}},toPortChanged:{get:function(){return this.uo},set:function(a){var y=this.uo;y!==a&&(this.uo=a,this.g("toPortChanged",y,a))}},fromSpot:{get:function(){return this.ba!==null?this.ba.Xi:xa},set:function(a){var y=this.fromSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.Xi=a,this.g("fromSpot",y,a),(y.$c()||a.$c())&&this.fromNode!==null&&$s(this.fromPort),this.bb())}},fromEndSegmentLength:{get:function(){return this.ba!==null?this.ba.Vi:NaN},set:function(a){var y=this.fromEndSegmentLength;y!==a&&(0>a&&wn(a,">= 0",Tn,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=a,this.g("fromEndSegmentLength",y,a),this.bb())}},fromShortLength:{get:function(){return this.ba!==null?this.ba.Wi:NaN},set:function(a){var y=this.fromShortLength;y!==a&&(this.Xc(),this.ba.Wi=a,this.qc(),this.g("fromShortLength",y,a))}},toSpot:{get:function(){return this.ba!==null?this.ba.yj:xa},set:function(a){var y=this.toSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.yj=a,this.g("toSpot",y,a),(y.$c()||a.$c())&&this.toNode!==null&&$s(this.toPort),this.bb())}},toEndSegmentLength:{get:function(){return this.ba!==null?this.ba.wj:NaN},set:function(a){var y=this.toEndSegmentLength;y!==a&&(0>a&&wn(a,">= 0",Tn,"toEndSegmentLength"),this.Xc(),this.ba.wj=a,this.g("toEndSegmentLength",y,a),this.bb())}},toShortLength:{get:function(){return this.ba!==null?this.ba.xj:NaN},set:function(a){var y=this.toShortLength;y!==a&&(this.Xc(),this.ba.xj=a,this.qc(),this.g("toShortLength",y,a))}},isLabeledLink:{get:function(){return this.wd===null?!1:0<this.wd.count}},labelNodes:{get:function(){return this.wd===null?Ar:this.wd.iterator}},relinkableFrom:{get:function(){return(this.Qa&1)!==0},set:function(a){var y=(this.Qa&1)!==0;y!==a&&(this.Qa^=1,this.g("relinkableFrom",y,a),this.Wb())}},relinkableTo:{get:function(){return(this.Qa&2)!==0},set:function(a){var y=(this.Qa&2)!==0;y!==a&&(this.Qa^=2,this.g("relinkableTo",y,a),this.Wb())}},resegmentable:{get:function(){return(this.Qa&4)!==0},set:function(a){var y=(this.Qa&4)!==0;y!==a&&(this.Qa^=4,this.g("resegmentable",y,a),this.Wb())}},isTreeLink:{get:function(){return(this.Qa&8)!==0},set:function(a){var y=(this.Qa&8)!==0;y!==a&&(this.Qa^=8,this.g("isTreeLink",y,a),this.fromNode!==null&&ip(this.fromNode),this.toNode!==null&&ip(this.toNode))}},path:{get:function(){var a=this.Pb();return a instanceof cr?a:null}},routeBounds:{get:function(){this.vg();var a=this.ml,y=1/0,x=1/0,E=this.pointsCount;if(E===0)a.h(NaN,NaN,0,0);else{if(E===1)E=this.i(0),y=Math.min(E.x,y),x=Math.min(E.y,x),a.h(E.x,E.y,0,0);else if(E===2){E=this.i(0);var b=this.i(1);y=Math.min(E.x,b.x),x=Math.min(E.y,b.y),a.h(E.x,E.y,0,0),a.Ye(b)}else if(this.computeCurve()===ul&&3<=E&&!this.isOrthogonal)if(b=this.i(0),y=b.x,x=b.y,a.h(y,x,0,0),E===3){E=this.i(1),y=Math.min(E.x,y),x=Math.min(E.y,x);var z=this.i(2);y=Math.min(z.x,y),x=Math.min(z.y,x),Zt.Dl(b.x,b.y,E.x,E.y,E.x,E.y,z.x,z.y,.5,a)}else for(z=3;z<E;z+=3){var tt=this.i(z-2);z+3>=E&&(z=E-1);var rt=this.i(z-1),ot=this.i(z);Zt.Dl(b.x,b.y,tt.x,tt.y,rt.x,rt.y,ot.x,ot.y,.5,a),y=Math.min(ot.x,y),x=Math.min(ot.y,x),b=ot}else for(b=this.i(0),z=this.i(1),y=Math.min(b.x,z.x),x=Math.min(b.y,z.y),a.h(b.x,b.y,0,0),a.Ye(z),b=2;b<E;b++)z=this.i(b),y=Math.min(z.x,y),x=Math.min(z.y,x),a.Ye(z);this.su.h(y-a.x,x-a.y)}return a}},midPoint:{get:function(){return this.vg(),this.computeMidPoint(new At)}},midAngle:{get:function(){return this.vg(),this.computeMidAngle()}},flattenedLengths:{get:function(){if(this.cq===null){this.fd||Km(this);for(var a=this.cq=[],y=this.pointsCount,x=0;x<y-1;x++){var E=this.i(x),b=this.i(x+1);Zt.$(E.x,b.x)?(E=b.y-E.y,0>E&&(E=-E)):Zt.$(E.y,b.y)?(E=b.x-E.x,0>E&&(E=-E)):E=Math.sqrt(E.Bf(b)),a.push(E)}}return this.cq}},flattenedTotalLength:{get:function(){var a=this.vt;if(isNaN(a)){for(var y=this.flattenedLengths,x=y.length,E=a=0;E<x;E++)a+=y[E];this.vt=a}return a}},points:{get:function(){return this.Nb},set:function(a){var y=this.Nb;if(y!==a){var x=null;if(Array.isArray(a)){var E=a.length%2===0;if(E){for(var b=0;b<a.length;b++)if(typeof a[b]!="number"||isNaN(a[b])){E=!1;break}}if(E)for(x=new fn,E=0;E<a.length/2;E++)b=new At(a[2*E],a[2*E+1]).freeze(),x.add(b);else{for(E=!0,b=0;b<a.length;b++){var z=a[b];if(!We(z)||typeof z.x!="number"||isNaN(z.x)||typeof z.y!="number"||isNaN(z.y)){E=!1;break}}if(E)for(x=new fn,E=0;E<a.length;E++)b=a[E],x.add(new At(b.x,b.y).freeze())}}else if(a instanceof fn)for(x=a.copy(),a=x.iterator;a.next();)a.value.freeze();else $t("Link.points value is not an instance of List or Array: "+a);x.freeze(),this.Nb=x,this.qc(),Km(this),a=this.diagram,a!==null&&(a.pi||a.undoManager.isUndoingRedoing||a.As.add(this),a.animationManager.zb&&gf(a.animationManager,this,x)),this.g("points",y,x)}}},pointsCount:{get:function(){return this.Nb.count}},fd:{get:function(){return(this.Qa&16)!==0},set:function(a){(this.Qa&16)!==0!==a&&(this.Qa^=16)}},suspendsRouting:{get:function(){return(this.Qa&32)!==0},set:function(a){(this.Qa&32)!==0!==a&&(this.Qa^=32)}},computingPoints:{get:function(){return(this.Qa&64)!==0},set:function(a){(this.Qa&64)!==0!==a&&(this.Qa^=64)}},defaultFromPoint:{get:function(){return this.o},set:function(a){this.o=a.copy()}},defaultToPoint:{get:function(){return this.u},set:function(a){this.u=a.copy()}},isOrthogonal:{get:function(){return(this.qj.value&2)===2}},isAvoiding:{get:function(){return(this.qj.value&4)===4}},lk:{get:function(){return(this.Qa&128)!==0},set:function(a){(this.Qa&128)!==0!==a&&(this.Qa^=128)}},geometry:{get:function(){if(!this.lk){if(this.vg(),2>this.pointsCount)return this.lk=!0,this.ua;this.ua=this.makeGeometry()}return this.ua}},firstPickIndex:{get:function(){return 2>=this.pointsCount?0:this.isOrthogonal||!Hf(this.computeSpot(!0))?1:0}},lastPickIndex:{get:function(){var a=this.pointsCount;return a===0?0:2>=a?a-1:this.isOrthogonal||!Hf(this.computeSpot(!1))?a-2:a-1}},adjusting:{get:function(){return this.qk},set:function(a){var y=this.qk;y!==a&&(this.qk=a,this.g("adjusting",y,a))}},corner:{get:function(){return this.Om},set:function(a){var y=this.Om;y!==a&&(this.Om=a,this.qc(),this.g("corner",y,a))}},curve:{get:function(){return this.Qm},set:function(a){var y=this.Qm;y!==a&&(this.Qm=a,this.bb(),this.qc(),Jm(this,y===zh||y===Wf||a===zh||a===Wf),this.g("curve",y,a))}},curviness:{get:function(){return this.Rm},set:function(a){var y=this.Rm;y!==a&&(this.Rm=a,this.bb(),this.qc(),this.g("curviness",y,a))}},routing:{get:function(){return this.qj},set:function(a){var y=this.qj;y!==a&&(this.qj=a,this.Wf=null,this.bb(),Jm(this,(y.value&2)===2||(a.value&2)===2),this.g("routing",y,a))}},smoothness:{get:function(){return this.po},set:function(a){var y=this.po;y!==a&&(this.po=a,this.qc(),this.g("smoothness",y,a))}},key:{get:function(){var a=this.diagram;if(a!==null&&a.model.ri())return a.model.Ac(this.data)}}}),Tn.prototype.invalidateOtherJumpOvers=Tn.prototype.Xo,Tn.prototype.findClosestSegment=Tn.prototype.ez,Tn.prototype.updateRoute=Tn.prototype.vg,Tn.prototype.invalidateRoute=Tn.prototype.bb,Tn.prototype.rollbackRoute=Tn.prototype.rv,Tn.prototype.commitRoute=Tn.prototype.zf,Tn.prototype.startRoute=Tn.prototype.uh,Tn.prototype.clearPoints=Tn.prototype.Fj,Tn.prototype.removePoint=Tn.prototype.pv,Tn.prototype.addPointAt=Tn.prototype.yf,Tn.prototype.addPoint=Tn.prototype.ne,Tn.prototype.insertPointAt=Tn.prototype.m,Tn.prototype.insertPoint=Tn.prototype.Kz,Tn.prototype.setPointAt=Tn.prototype.L,Tn.prototype.setPoint=Tn.prototype.dd,Tn.prototype.getPoint=Tn.prototype.i,Tn.prototype.getOtherPort=Tn.prototype.Cz,Tn.prototype.getOtherNode=Tn.prototype.To;var Hc=null,Wc=null,Jv=new He(Tn,"Normal",1),Mx=new He(Tn,"Orthogonal",2),kx=new He(Tn,"AvoidsNodes",6),eS=new He(Tn,"AvoidsNodesStraight",7),Ls=new He(Tn,"None",0),ul=new He(Tn,"Bezier",9),zh=new He(Tn,"JumpGap",10),Wf=new He(Tn,"JumpOver",11),ap=new He(Tn,"End",17),Qm=new He(Tn,"Scale",18),$m=new He(Tn,"Stretch",19),sp=new He(Tn,"OrientAlong",21),lp=new He(Tn,"OrientPlus90",22),up=new He(Tn,"OrientMinus90",23),Qv=new He(Tn,"OrientOpposite",24),qm=new He(Tn,"OrientUpright",25),hp=new He(Tn,"OrientPlus90Upright",26),dp=new He(Tn,"OrientMinus90Upright",27),t0=new He(Tn,"OrientUpright45",28),nS=16,iS=14,cp=8;Tn.className="Link",Tn.Normal=Jv,Tn.Orthogonal=Mx,Tn.AvoidsNodes=kx,Tn.AvoidsNodesStraight=eS,Tn.None=Ls,Tn.Bezier=ul,Tn.JumpGap=zh,Tn.JumpOver=Wf,Tn.End=ap,Tn.Scale=Qm,Tn.Stretch=$m,Tn.OrientAlong=sp,Tn.OrientPlus90=lp,Tn.OrientMinus90=up,Tn.OrientOpposite=Qv,Tn.OrientUpright=qm,Tn.OrientPlus90Upright=hp,Tn.OrientMinus90Upright=dp,Tn.OrientUpright45=t0,Tn.EndSegmentStep=8,Tn.CurvinessStart=nS,Tn.SpacingMin=iS,Tn.OrthoShortCut=cp;function e0(a,y,x,E){Di(this),this.Fe=this.qq=!1,this.Ds=a,this.Ox=y,this.cv=x,this.Px=E,this.links=[]}e0.prototype.Sl=function(){if(!this.qq){var a=this.links;0<a.length&&(a=a[0].diagram,a!==null&&(a.ow.add(this),this.Fe=a.undoManager.isUndoingRedoing))}this.qq=!0},e0.prototype.Nv=function(){if(this.qq){this.qq=!1;var a=this.links;if(0<a.length){var y=a[0],x=y.diagram;x=x===null||x.pi&&!this.Fe,this.Fe=!1,y.arrangeBundledLinks(a,x),a.length===1&&(y.Sf=null,a.length=0)}a.length===0&&(a=this.Ds,this!==null&&a.af!==null&&a.af.remove(this),a=this.cv,this!==null&&a.af!==null&&a.af.remove(this))}},e0.className="LinkBundle";function fp(a){Di(this),this.Yx=this.group=null,this.vs=!0,this.abort=!1,this.Od=this.Nd=1,this.Fn=this.En=-1,this.rc=a.width,this.sc=a.height,this.ac=null,this.ei=this.di=0,this.Os=11,this.Ix=this.Hx=22}fp.prototype.initialize=function(a){if(!(0>=a.width||0>=a.height)){var y=a.y,x=a.x+a.width,E=a.y+a.height;if(this.Nd=Math.floor((a.x-this.rc)/this.rc)*this.rc,this.Od=Math.floor((y-this.sc)/this.sc)*this.sc,this.En=Math.ceil((x+2*this.rc)/this.rc)*this.rc,this.Fn=Math.ceil((E+2*this.sc)/this.sc)*this.sc,a=1+(Math.ceil((this.En-this.Nd)/this.rc)|0),y=1+(Math.ceil((this.Fn-this.Od)/this.sc)|0),this.ac===null||this.di<a-1||this.ei<y-1){for(x=[],E=0;E<=a;E++)x[E]=new Uint32Array(y);this.ac=x,this.di=a-1,this.ei=y-1}if(a=$v,this.ac!==null)for(y=0;y<=this.di;y++)if(x=this.ac[y],x.fill)x.fill(a);else for(E=0;E<=this.ei;E++)x[E]=a}};function Vf(a,y,x){return a.Nd<=y&&y<=a.En&&a.Od<=x&&x<=a.Fn}function Uu(a,y,x){return Vf(a,y,x)?(y-=a.Nd,y/=a.rc,x-=a.Od,x/=a.sc,a.ac[y|0][x|0]):$v}function rS(a){if(a.ac!==null)for(var y=0;y<=a.di;y++)for(var x=a.ac[y],E=0;E<=a.ei;E++)x[E]>=ac&&(x[E]=$v)}fp.prototype.Yj=function(a,y,x,E){if(a>this.En||a+x<this.Nd||y>this.Fn||y+E<this.Od)return!0;a=(a-this.Nd)/this.rc|0,y=(y-this.Od)/this.sc|0,x=Math.max(0,x)/this.rc+1|0;var b=Math.max(0,E)/this.sc+1|0;if(0>a&&(x+=a,a=0),0>y&&(b+=y,y=0),0>x||0>b)return!0;for(E=Math.min(a+x-1,this.di)|0,x=Math.min(y+b-1,this.ei)|0;a<=E;a++){b=this.ac[a];for(var z=y;z<=x;z++)if(b[z]===Zh)return!1}return!0};function Yu(a,y,x,E,b,z,tt,rt,ot){if(!(y<z||y>tt||x<rt||x>ot)){var lt=y|0,ut=x|0,ft=a.ac[lt][ut];if(ft>=ac&&ft<Kf)for(b?ut+=E:lt+=E,ft+=1;z<=lt&&lt<=tt&&rt<=ut&&ut<=ot&&!(ft>=a.ac[lt][ut]);)a.ac[lt][ut]=ft,ft+=1,b?ut+=E:lt+=E;if(lt=b?ut:lt,b)if(0<E)for(x+=E;x<lt;x+=E)Yu(a,y,x,1,!b,z,tt,rt,ot),Yu(a,y,x,-1,!b,z,tt,rt,ot);else for(x+=E;x>lt;x+=E)Yu(a,y,x,1,!b,z,tt,rt,ot),Yu(a,y,x,-1,!b,z,tt,rt,ot);else if(0<E)for(y+=E;y<lt;y+=E)Yu(a,y,x,1,!b,z,tt,rt,ot),Yu(a,y,x,-1,!b,z,tt,rt,ot);else for(y+=E;y>lt;y+=E)Yu(a,y,x,1,!b,z,tt,rt,ot),Yu(a,y,x,-1,!b,z,tt,rt,ot)}}function n0(a,y,x,E,b,z,tt,rt,ot){y|=0,x|=0;var lt=Zh,ut=ac;for(a.ac[y][x]=ut;lt===Zh&&y>z&&y<tt&&x>rt&&x<ot;)ut+=1,a.ac[y][x]=ut,b?x+=E:y+=E,lt=a.ac[y][x]}function i0(a,y,x,E,b,z,tt,rt,ot){y|=0,x|=0;var lt=Zh,ut=Kf;for(a.ac[y][x]=ut;lt===Zh&&y>z&&y<tt&&x>rt&&x<ot;)a.ac[y][x]=ut,b?x+=E:y+=E,lt=a.ac[y][x]}function oS(a,y,x,E,b,z,tt){if(a.ac!==null){a.abort=!1;var rt=y.x,ot=y.y;if(Vf(a,rt,ot)){rt-=a.Nd,rt/=a.rc,ot-=a.Od,ot/=a.sc;var lt=E.x,ut=E.y;if(Vf(a,lt,ut))if(lt-=a.Nd,lt/=a.rc,ut-=a.Od,ut/=a.sc,1>=Math.abs(rt-lt)&&1>=Math.abs(ot-ut))a.abort=!0;else{var ft=z.x;E=z.y,y=z.x+z.width;var yt=z.y+z.height;ft-=a.Nd,ft/=a.rc,E-=a.Od,E/=a.sc,y-=a.Nd,y/=a.rc,yt-=a.Od,yt/=a.sc,z=Math.max(0,Math.min(a.di,ft|0)),y=Math.min(a.di,Math.max(0,y|0)),ft=Math.max(0,Math.min(a.ei,E|0)),yt=Math.min(a.ei,Math.max(0,yt|0)),E=a.ac,rt|=0,ot|=0,lt|=0,ut|=0;var xt=x===0||x===90?1:-1;if(x=x===90||x===270,E[rt][ot]===Zh?(n0(a,rt,ot,xt,x,z,y,ft,yt),n0(a,rt,ot,1,!x,z,y,ft,yt),n0(a,rt,ot,-1,!x,z,y,ft,yt)):n0(a,rt,ot,xt,x,rt,ot,rt,ot),E[lt][ut]===Zh?(i0(a,lt,ut,b===0||b===90?1:-1,b===90||b===270,z,y,ft,yt),i0(a,lt,ut,1,!(b===90||b===270),z,y,ft,yt),i0(a,lt,ut,-1,!(b===90||b===270),z,y,ft,yt)):i0(a,lt,ut,xt,x,lt,ut,lt,ut),x=pi(),tt&&aS(a,lt,ut,b,rt,ot,x))for((x[0]!==lt||x[1]!==ut)&&(x.unshift(ut),x.unshift(lt)),(x[x.length-2]!==rt||x[x.length-1]!==ot)&&(x.push(rt),x.push(ot)),a=ac,b=x[x.length-2],tt=x[x.length-1],E[b][tt]=a++,z=x.length-4;0<=z;z-=2)for(b=x[z+2],tt=x[z+3],y=x[z],lt=x[z+1];y>b?b++:y<b?b--:lt>tt?tt++:lt<tt&&tt--,E[b][tt]=a++,b!==y||tt!==lt;);else Yu(a,rt,ot,1,!1,z,y,ft,yt),Yu(a,rt,ot,-1,!1,z,y,ft,yt),Yu(a,rt,ot,1,!0,z,y,ft,yt),Yu(a,rt,ot,-1,!0,z,y,ft,yt);oi(x)}}}}function aS(a,y,x,E,b,z,tt){for(var rt=a.ac,ot=y,lt=x;;){if(ot===b&&lt===z)return!0;var ut=ot,ft=lt;if(E===0)if(ut<b)ut++;else break;else if(E===90)if(ft<z)ft++;else break;else if(E===180)if(ut>b)ut--;else break;else if(ft>z)ft--;else break;var yt=rt[ut][ft];if(yt===0||yt===qv)break;ot=ut,lt=ft}for(;;){if(ut=E,ft=ot,yt=lt,E===0?yt<z?(ut=90,yt++):yt>z&&(ut=270,yt--):E===90?ft<b?(ut=0,ft++):ft>b&&(ut=180,ft--):E===180?yt<z?(ut=90,yt++):yt>z&&(ut=270,yt--):ft<b?(ut=0,ft++):ft>b&&(ut=180,ft--),ft=rt[ft][yt],ut!==E&&ft!==0&&ft!==qv){if(tt.push(ot),tt.push(lt),aS(a,ot,lt,ut,b,z,tt))return!0;tt.pop(),tt.pop()}if(rt[ot][lt]=qv,E===0){if(ot===y)return!1;ot--}else if(E===90){if(lt===x)return!1;lt--}else if(E===180){if(ot===y)return!1;ot++}else{if(lt===x)return!1;lt++}}}ve.Object.defineProperties(fp.prototype,{bounds:{get:function(){return new Be(this.Nd,this.Od,this.En-this.Nd,this.Fn-this.Od)}},Ho:{get:function(){return this.rc},set:function(a){0<a&&a!==this.rc&&(this.rc=a,this.initialize(this.bounds))}},Go:{get:function(){return this.sc},set:function(a){0<a&&a!==this.sc&&(this.sc=a,this.initialize(this.bounds))}}});var Zh=0,ac=1,Kf=999999,$v=Kf+1,qv=Kf+2;fp.className="PositionArray";function Vc(){Di(this),this.port=this.node=null,this.pe=[],this.ap=!1}Vc.prototype.toString=function(){for(var a=this.pe,y=this.node.toString()+" "+a.length.toString()+":",x=0;x<a.length;x++){var E=a[x];E!==null&&(y+=`
`+E.toString())}return y};function bx(a,y,x,E){switch(y=y.offsetY,y){case 8:return 90;case 2:return 180;case 1:return 270;case 4:return 0}switch(y){case 9:return 180<x?270:90;case 6:return 90<x&&270>=x?180:0}switch(a=180*Math.atan2(a.height,a.width)/Math.PI,y){case 3:return x>a&&x<=180+a?180:270;case 5:return x>180-a&&x<=360-a?270:0;case 12:return x>a&&x<=180+a?90:0;case 10:return x>180-a&&x<=360-a?180:90;case 7:return 90<x&&x<=180+a?180:x>180+a&&x<=360-a?270:0;case 13:return 180<x&&x<=360-a?270:x>a&&180>=x?90:0;case 14:return x>a&&x<=180-a?90:x>180-a&&270>=x?180:0;case 11:return x>180-a&&x<=180+a?180:x>180+a?270:90}return E&&y!==15&&(x-=15,0>x&&(x+=360)),x>a&&x<180-a?90:x>=180-a&&x<=180+a?180:x>180+a&&x<360-a?270:0}Vc.prototype.Sl=function(){this.pe.length=0};function sS(a,y){var x=a.pe;if(x.length===0){t:if(!a.ap){x=a.ap,a.ap=!0;var E=null,b=a.node,z=b instanceof or?b:null;if(z===null||z.isSubGraphExpanded)var tt=b.isTreeExpanded?b.findLinksConnected(a.port.portId):b.qx();else{if(!z.actualBounds.w()){a.ap=x;break t}E=z,tt=E.Lu()}z=a.pe.length=0;var rt=a.port.ga(eo,At.alloc()),ot=a.port.ga(No,At.alloc());for(b=Be.allocAt(rt.x,rt.y,0,0),b.Ye(ot),At.free(rt),At.free(ot),rt=At.allocAt(b.x+b.width/2,b.y+b.height/2),ot=a.port.li(),tt=tt.iterator;tt.next();){var lt=tt.value;if(lt.isVisible()&&lt.fromPort!==lt.toPort){var ut=lt.fromPort===a.port||lt.fromNode!==null&&lt.fromNode.Td(E),ft=lt.computeSpot(ut,a.port);if(ft.$c()&&(ut=ut?lt.toPort:lt.fromPort,ut!==null)){var yt=ut.part;if(yt!==null){var xt=yt.findVisibleNode();xt!==null&&xt!==yt&&(yt=xt,ut=yt.port),ut=lt.computeOtherPoint(yt,ut),yt=rt.ab(ut),yt-=ot,0>yt?yt+=360:360<=yt&&(yt-=360),ft=bx(b,ft,yt,lt.isOrthogonal),ft===0?(ft=4,180<yt&&(yt-=360)):ft===90?(ft=8,270<yt&&(yt-=360)):ft===180?ft=2:(ft=1,90>yt&&(yt+=360)),xt=a.pe[z],xt===void 0?(xt=new ty(lt,yt,ft),a.pe[z]=xt):(xt.link=lt,xt.angle=yt,xt.Nc=ft),xt.hv.set(ut),z++}}}}for(At.free(rt),a.pe.sort(Vc.prototype.j),ot=a.pe.length,E=-1,z=rt=0;z<ot;z++)tt=a.pe[z],tt!==void 0&&(tt.Nc!==E&&(E=tt.Nc,rt=0),tt.Uo=rt,rt++);for(E=-1,rt=0,z=ot-1;0<=z;z--)ot=a.pe[z],ot!==void 0&&(ot.Nc!==E&&(E=ot.Nc,rt=ot.Uo+1),ot.Gl=rt);if(z=a.pe,ft=a.port,E=a.node.portSpreading,rt=At.alloc(),ot=At.alloc(),tt=At.alloc(),lt=At.alloc(),ft.ga(eo,rt),ft.ga(Va,ot),ft.ga(No,tt),ft.ga(Sa,lt),xt=yt=ut=ft=0,E===Hv)for(var Ct=0;Ct<z.length;Ct++){var bt=z[Ct];if(bt!==null){var Wt=bt.link.computeThickness();switch(bt.Nc){case 8:yt+=Wt;break;case 2:xt+=Wt;break;case 1:ft+=Wt;break;default:case 4:ut+=Wt}}}var jt=Ct=0,Qt=1,te=bt=0;for(Wt=0;Wt<z.length;Wt++){var re=z[Wt];if(re!==null){if(Ct!==re.Nc){switch(Ct=re.Nc,Ct){case 8:var he=tt;jt=lt;break;case 2:he=lt,jt=rt;break;case 1:he=rt,jt=ot;break;default:case 4:he=ot,jt=tt}switch(bt=jt.x-he.x,te=jt.y-he.y,Ct){case 8:yt>Math.abs(bt)?(Qt=Math.abs(bt)/yt,yt=Math.abs(bt)):Qt=1;break;case 2:xt>Math.abs(te)?(Qt=Math.abs(te)/xt,xt=Math.abs(te)):Qt=1;break;case 1:ft>Math.abs(bt)?(Qt=Math.abs(bt)/ft,ft=Math.abs(bt)):Qt=1;break;default:case 4:ut>Math.abs(te)?(Qt=Math.abs(te)/ut,ut=Math.abs(te)):Qt=1}jt=0}var ke=re.Zo;if(E===Hv){switch(re=re.link.computeThickness(),re*=Qt,ke.set(he),Ct){case 8:ke.x=he.x+bt/2+yt/2-jt-re/2;break;case 2:ke.y=he.y+te/2+xt/2-jt-re/2;break;case 1:ke.x=he.x+bt/2-ft/2+jt+re/2;break;default:case 4:ke.y=he.y+te/2-ut/2+jt+re/2}jt+=re}else{var Jn=.5;E===Vm&&(Jn=(re.Uo+1)/(re.Gl+1)),ke.x=he.x+bt*Jn,ke.y=he.y+te*Jn}}}for(At.free(rt),At.free(ot),At.free(tt),At.free(lt),he=a.pe,z=0;z<he.length;z++)E=he[z],E!==null&&(E.Ju=a.computeEndSegmentLength(E));a.ap=x,Be.free(b)}x=a.pe}for(a=0;a<x.length;a++)if(b=x[a],b!==null&&b.link===y)return b;return null}Vc.prototype.j=function(a,y){return a===y?0:a===null?-1:y===null?1:a.Nc<y.Nc?-1:a.Nc>y.Nc?1:a.angle<y.angle?-1:a.angle>y.angle?1:0},Vc.prototype.computeEndSegmentLength=function(a){var y=a.link,x=y.computeEndSegmentLength(this.node,this.port,gr,y.fromPort===this.port),E=a.Uo;if(0>E)return x;var b=a.Gl;if(1>=b||!y.isOrthogonal)return x;y=a.hv;var z=a.Zo;return(a.Nc===2||a.Nc===8)&&(E=b-1-E),((a=a.Nc===2||a.Nc===4)?y.y<z.y:y.x<z.x)?x+8*E:(a?y.y===z.y:y.x===z.x)?x:x+8*(b-1-E)},Vc.className="Knot";function ty(a,y,x){this.link=a,this.angle=y,this.Nc=x,this.hv=new At,this.Gl=this.Uo=0,this.Zo=new At,this.Ju=0}ty.prototype.toString=function(){return this.link.toString()+" "+this.angle.toString()+" "+this.Nc.toString()+":"+this.Uo.toString()+"/"+this.Gl.toString()+" "+this.Zo.toString()+" "+this.Ju.toString()+" "+this.hv.toString()},ty.className="LinkInfo";function Wo(a){Di(this),this.o=this.H=null,this.Gh=this.sn=!0,this.yn=!1,this.Am=new At(0,0).freeze(),this.vn=!0,this.Em=this.un=null,this.xn=!1,this.j=null,a&&Object.assign(this,a)}Wo.prototype.cloneProtected=function(a){a.sn=this.sn,a.Gh=this.Gh,a.yn=this.yn,a.Am.assign(this.Am),a.vn=this.vn,a.un=this.un,a.Em=this.Em,a.xn=!0},Wo.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},Wo.prototype.qb=function(){},Wo.prototype.toString=function(){var a=hi(this.constructor);return a+="(",this.group!==null&&(a+=" in "+this.group),this.diagram!==null&&(a+=" for "+this.diagram),a+")"},Wo.prototype.C=function(){if(this.isValidLayout){var a=this.diagram;if(a!==null&&!a.undoManager.isUndoingRedoing){var y=a.animationManager;!y.isTicking&&(y.defaultAnimation.isAnimating&&y.Cc(),this.isOngoing&&a.pi||this.isInitial&&!a.pi)&&(this.isValidLayout=!1,a.$b())}}},Wo.prototype.createNetwork=function(){return new Do(this)},Wo.prototype.makeNetwork=function(a){var y=this.createNetwork();return a instanceof be?(y.lg(a.nodes,!0),y.lg(a.links,!0)):a instanceof or?y.lg(a.memberParts):y.lg(a.iterator),y},Wo.prototype.updateParts=function(){this.isValidLayout=!0;var a=this.diagram;if(a===null&&this.network!==null)for(var y=this.network.vertexes.iterator;y.next();){var x=y.value.node;if(x!==null&&(a=x.diagram,a!==null))break}try{a!==null&&a.Ea("Layout"),this.commitLayout()}finally{a!==null&&a.eb("Layout")}},Wo.prototype.commitLayout=function(){if(this.network!==null){for(var a=this.network.vertexes.iterator;a.next();)a.value.commit();if(this.isRouting)for(a=this.network.edges.iterator;a.next();)a.value.commit()}},Wo.prototype.doLayout=function(a){var y=new pn;a instanceof be?(yd(this,y,a.nodes,!0,this.rh,!0,!1,!0),yd(this,y,a.parts,!0,this.rh,!0,!1,!0)):a instanceof or?yd(this,y,a.memberParts,!1,this.rh,!0,!1,!0):y.addAll(a.iterator),0<y.count&&(a=this.diagram,a!==null&&a.Ea("Layout"),this.doMinimalNoNetworkLayout(y),a!==null&&a.eb("Layout")),this.isValidLayout=!0},Wo.prototype.doMinimalNoNetworkLayout=function(a){var y=Math.ceil(Math.sqrt(a.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);var x=this.arrangementOrigin.x,E=x,b=this.arrangementOrigin.y,z=0,tt=0;for(a=a.iterator;a.next();){var rt=a.value;gp(rt);var ot=rt.measuredBounds,lt=ot.width;ot=ot.height,rt.moveTo(E,b),rt instanceof or&&(rt.rh=!1),E+=Math.max(lt,50)+20,tt=Math.max(tt,Math.max(ot,50)),z>=y-1?(z=0,E=x,b+=tt+20,tt=0):z++}},Wo.prototype.doMinimalNetworkLayout=function(){var a=Math.ceil(Math.sqrt(this.network.vertexes.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);for(var y=this.arrangementOrigin.x,x=y,E=this.arrangementOrigin.y,b=0,z=0,tt=this.network.vertexes.iterator;tt.next();){var rt=tt.value.node;if(!(rt===null||rt instanceof Tn)&&(gp(rt),this.rh(rt))){var ot=rt.measuredBounds,lt=ot.width;ot=ot.height,rt.moveTo(x,E),rt instanceof or&&(rt.rh=!1),x+=Math.max(lt,50)+20,z=Math.max(z,Math.max(ot,50)),b>=a-1?(b=0,x=y,E+=z+20,z=0):b++}}},Wo.prototype.rh=function(a){return!!(!a.location.w()||a instanceof or&&a.rh)};function yd(a,y,x,E,b,z,tt,rt){for(x=x.iterator;x.next();){var ot=x.value;E&&!ot.isTopLevel||b!==null&&!b(ot)||!ot.canLayout()||(z&&ot instanceof qn?ot.isLinkLabel||(ot instanceof or&&ot.layout===null?yd(a,y,ot.memberParts,!1,b,z,tt,rt):(gp(ot),y.add(ot))):tt&&ot instanceof Tn?y.add(ot):!rt||!ot.Zc()||ot instanceof qn||(gp(ot),y.add(ot)))}}function gp(a){var y=a.actualBounds;(y.width===0||y.height===0||isNaN(y.width)||isNaN(y.height))&&a.Va()}Wo.prototype.ni=function(a,y){var x=this.boundsComputation;return x!==null?(y||(y=new Be),x(a,this,y)):y?(y.set(a.actualBounds),y):a.actualBounds},Wo.prototype.ex=function(a){var y=new pn;return a instanceof be?(yd(this,y,a.nodes,!0,null,!0,!0,!0),yd(this,y,a.links,!0,null,!0,!0,!0),yd(this,y,a.parts,!0,null,!0,!0,!0)):a instanceof or?yd(this,y,a.memberParts,!1,null,!0,!0,!0):yd(this,y,a.iterator,!1,null,!0,!0,!0),y},Wo.prototype.initialOrigin=function(a){var y=this.group;if(y!==null){var x=y.position.copy();return(isNaN(x.x)||isNaN(x.y))&&x.set(a),y=y.placeholder,y!==null&&(x=y.ga(eo),(isNaN(x.x)||isNaN(x.y))&&x.set(a),a=y.padding,x.x+=a.left,x.y+=a.top),x}return a},ve.Object.defineProperties(Wo.prototype,{diagram:{get:function(){return this.H},set:function(a){this.H=a}},group:{get:function(){return this.o},set:function(a){this.o!==a&&(this.o=a,a!==null&&(this.H=a.diagram))}},isOngoing:{get:function(){return this.sn},set:function(a){this.sn!==a&&(this.sn=a)}},isInitial:{get:function(){return this.Gh},set:function(a){this.Gh=a,a||(this.xn=!0)}},isViewportSized:{get:function(){return this.yn},set:function(a){this.yn!==a&&(this.yn=a)&&this.C()}},isRouting:{get:function(){return this.vn},set:function(a){this.vn!==a&&(this.vn=a)}},isRealtime:{get:function(){return this.un},set:function(a){this.un!==a&&(this.un=a)}},isValidLayout:{get:function(){return this.xn},set:function(a){this.xn!==a&&(this.xn=a,a||(a=this.diagram,a!==null&&(a.xh=!0)))}},network:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a,a!==null&&(a.layout=this))}},boundsComputation:{get:function(){return this.Em},set:function(a){this.Em!==a&&(this.Em=a,this.C())}},arrangementOrigin:{get:function(){return this.Am},set:function(a){this.Am.D(a)||(this.Am.assign(a),this.C())}}}),Wo.prototype.collectParts=Wo.prototype.ex,Wo.prototype.getLayoutBounds=Wo.prototype.ni,Wo.prototype.invalidateLayout=Wo.prototype.C,Wo.className="Layout";function Do(a){Di(this),this.Sc=a,this.wf=new pn,this.ye=new pn,this.Es=new Ie,this.zs=new Ie}Do.prototype.clear=function(){if(this.wf)for(var a=this.wf.iterator;a.next();)a.value.clear();if(this.ye)for(a=this.ye.iterator;a.next();)a.value.clear();this.wf=new pn,this.ye=new pn,this.Es=new Ie,this.zs=new Ie},Do.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutNetwork"+(this.layout!==null?"("+this.layout.toString()+")":"");if(0>=a)return y;if(y+=" vertexes: "+this.wf.count+" edges: "+this.ye.count,1<a){for(var x=this.wf.iterator;x.next();)y+=`
`+x.value.toString(a-1);for(x=this.ye.iterator;x.next();)y+=`
`+x.value.toString(a-1)}return y},Do.prototype.createVertex=function(){return new Ca(this)},Do.prototype.createEdge=function(){return new qs(this)},Do.prototype.lg=function(a,y,x){if(a!==null){for(y===void 0&&(y=!1),x===void 0&&(x=null),x===null&&(x=function(tt){if(tt instanceof qn)return!tt.isLinkLabel;if(tt instanceof Tn){var rt=tt.fromNode;return rt===null||rt.isLinkLabel?!1:(tt=tt.toNode,!(tt===null||tt.isLinkLabel))}return!1}),a=a.iterator;a.next();){var E=a.value;if(E instanceof qn&&(!y||E.isTopLevel)&&E.canLayout()&&x(E)){if(E instanceof or&&E.layout===null)this.lg(E.memberParts,!1);else if(this.ki(E)===null){var b=this.createVertex();b.node=E,this.dh(b)}}}for(a.reset();a.next();)if(E=a.value,E instanceof Tn&&(!y||E.isTopLevel)&&E.canLayout()&&x(E)&&this.Lo(E)===null){var z=E.fromNode;b=E.toNode,z!==null&&b!==null&&z!==b&&(z=this.findGroupVertex(z),b=this.findGroupVertex(b),z!==null&&b!==null&&this.Zj(z,b,E))}}},Do.prototype.findGroupVertex=function(a){if(a===null)return null;var y=a.findVisibleNode();if(y===null)return null;if(a=this.ki(y),a!==null)return a;for(y=y.containingGroup;y!==null;){if(a=this.ki(y),a!==null)return a;y=y.containingGroup}return null},wt=Do.prototype,wt.dh=function(a){if(a!==null){this.wf.add(a);var y=a.node;y!==null&&this.Es.add(y,a),a.network=this}},wt.Bl=function(a){if(a===null)return null;var y=this.ki(a);return y===null&&(y=this.createVertex(),y.node=a,this.dh(y)),y},wt.Iu=function(a){if(a!==null&&lS(this,a)){for(var y=a.tg,x=y.count-1;0<=x;x--){var E=y.M(x);this.Mj(E)}for(y=a.mg,a=y.count-1;0<=a;a--)x=y.M(a),this.Mj(x)}};function lS(a,y){if(y===null)return!1;var x=a.wf.remove(y);return x&&(y=y.node,y!==null&&a.Es.remove(y)),x}wt.Zy=function(a){a!==null&&(a=this.ki(a),a!==null&&this.Iu(a))},wt.ki=function(a){return a===null?null:this.Es.I(a)},wt.Bo=function(a){if(a!==null){ey(this,a);var y=a.toVertex;y!==null&&y.Cl(a),y=a.fromVertex,y!==null&&y.zl(a)}};function ey(a,y){if(y!==null){a.ye.add(y);var x=y.link;x!==null&&a.Lo(x)===null&&a.zs.add(x,y),y.network=a}}wt.Dy=function(a){if(a===null)return null;var y=a.fromNode,x=a.toNode,E=this.Lo(a);return E===null?(E=this.createEdge(),E.link=a,y!==null&&(E.fromVertex=this.Bl(y)),x!==null&&(E.toVertex=this.Bl(x)),this.Bo(E)):(y!==null?E.fromVertex=this.Bl(y):E.fromVertex=null,x!==null?E.toVertex=this.Bl(x):E.toVertex=null),E},wt.Mj=function(a){if(a!==null){var y=a.toVertex;y!==null&&y.Kl(a),y=a.fromVertex,y!==null&&y.Jl(a),ny(this,a)}};function ny(a,y){y!==null&&a.ye.remove(y)&&(y=y.link,y!==null&&a.zs.remove(y))}wt.Yy=function(a){a!==null&&(a=this.Lo(a),a!==null&&this.Mj(a))},wt.Lo=function(a){return a===null?null:this.zs.I(a)},wt.Zj=function(a,y,x){if(a===null||y===null)return null;if(a.network===this&&y.network===this){var E=this.createEdge();return E.link=x,E.fromVertex=a,E.toVertex=y,this.Bo(E),E}return null},wt.gm=function(a){if(a!==null){var y=a.fromVertex,x=a.toVertex;y!==null&&x!==null&&(y.Jl(a),x.Kl(a),a.gm(),y.Cl(a),x.zl(a))}},wt.Ko=function(){for(var a=pi(),y=this.ye.iterator;y.next();){var x=y.value;x.fromVertex===x.toVertex&&a.push(x)}for(y=a.length,x=0;x<y;x++)this.Mj(a[x]);oi(a)},Do.prototype.deleteArtificialVertexes=function(){for(var a=pi(),y=this.wf.iterator;y.next();){var x=y.value;x.node===null&&x.data===null&&a.push(x)}for(x=a.length,y=0;y<x;y++)this.Iu(a[y]);for(y=pi(),x=this.ye.iterator;x.next();){var E=x.value;E.link===null&&E.data===null&&y.push(E)}for(x=y.length,E=0;E<x;E++)this.Mj(y[E]);oi(a),oi(y)};function Nx(a){for(var y=pi(),x=a.ye.iterator;x.next();){var E=x.value;E.fromVertex!==null&&E.toVertex!==null||y.push(E)}for(x=y.length,E=0;E<x;E++)a.Mj(y[E]);oi(y)}Do.prototype.Zx=function(a){a===void 0&&(a=!0),a&&(this.deleteArtificialVertexes(),Nx(this),this.Ko()),a=new fn;for(var y=!0;y;){y=!1;for(var x=this.wf.iterator;x.next();){var E=x.value;if(0<E.tg.count||0<E.mg.count){y=this.layout.createNetwork(),a.add(y),iy(this,y,E),y=!0;break}}}return a.sort(function(b,z){return b===null||z===null||b===z?0:z.vertexes.count-b.vertexes.count}),a};function iy(a,y,x){if(x!==null&&x.network!==y){lS(a,x),y.dh(x);for(var E=x.sourceEdges;E.next();){var b=E.value;b.network!==y&&(ny(a,b),ey(y,b),iy(a,y,b.fromVertex))}for(E=x.destinationEdges;E.next();)x=E.value,x.network!==y&&(ny(a,x),ey(y,x),iy(a,y,x.toVertex))}}Do.prototype.dz=function(){for(var a=new pn,y=this.wf.iterator;y.next();)a.add(y.value.node);for(y=this.ye.iterator;y.next();)a.add(y.value.link);return a},ve.Object.defineProperties(Do.prototype,{layout:{get:function(){return this.Sc},set:function(a){a!==null&&(this.Sc=a)}},vertexes:{get:function(){return this.wf}},edges:{get:function(){return this.ye}}}),Do.prototype.findAllParts=Do.prototype.dz,Do.prototype.splitIntoSubNetworks=Do.prototype.Zx,Do.prototype.deleteSelfEdges=Do.prototype.Ko,Do.prototype.reverseEdge=Do.prototype.gm,Do.prototype.linkVertexes=Do.prototype.Zj,Do.prototype.findEdge=Do.prototype.Lo,Do.prototype.deleteLink=Do.prototype.Yy,Do.prototype.deleteEdge=Do.prototype.Mj,Do.prototype.addLink=Do.prototype.Dy,Do.prototype.addEdge=Do.prototype.Bo,Do.prototype.findVertex=Do.prototype.ki,Do.prototype.deleteNode=Do.prototype.Zy,Do.prototype.deleteVertex=Do.prototype.Iu,Do.prototype.addNode=Do.prototype.Bl,Do.prototype.addVertex=Do.prototype.dh,Do.prototype.addParts=Do.prototype.lg,Do.className="LayoutNetwork";function Ca(a){Di(this),this.ob=a,this.j=new Be(0,0,10,10).freeze(),this.o=new At(5,5).freeze(),this.Sh=this.ub=null,this.tg=new fn,this.mg=new fn}Ca.prototype.clear=function(){this.Sh=this.ub=null,this.tg=new fn,this.mg=new fn},Ca.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutVertex#"+Ai(this);if(0<a&&(y+=this.node!==null?"("+this.node.toString()+")":"",1<a)){a="";for(var x=!0,E=this.tg.iterator;E.next();){var b=E.value;x?x=!1:a+=",",a+=b.toString(0)}for(b="",x=!0,E=this.mg.iterator;E.next();){var z=E.value;x?x=!1:b+=",",b+=z.toString(0)}y+=" sources: "+a+" destinations: "+b}return y},Ca.prototype.commit=function(){var a=this.ub;if(a!==null){var y=this.bounds,x=a.bounds;We(x)?(x.x=y.x,x.y=y.y,x.width=y.width,x.height=y.height):a.bounds=y.copy()}else if(a=this.node,a!==null){if(y=this.bounds,!(a instanceof or)){x=Be.alloc(),a.Va();var E=this.network.layout.ni(a,x),b=a.locationObject.ga(Or);if(E.w()&&b.w()){a.moveTo(y.x+this.focusX-(b.x-E.x),y.y+this.focusY-(b.y-E.y)),Be.free(x);return}Be.free(x)}a.moveTo(y.x,y.y)}},Ca.prototype.Cl=function(a){a!==null&&(this.tg.contains(a)||this.tg.add(a))},Ca.prototype.Kl=function(a){a!==null&&this.tg.remove(a)},Ca.prototype.zl=function(a){a!==null&&(this.mg.contains(a)||this.mg.add(a))},Ca.prototype.Jl=function(a){a!==null&&this.mg.remove(a)};function ry(a,y){return a=a.Sh,y=y.Sh,a?y?(a=a.text,y=y.text,a<y?-1:a>y?1:0):1:y!==null?-1:0}ve.Object.defineProperties(Ca.prototype,{sourceEdgesArrayAccess:{get:function(){return this.tg._dataArray}},destinationEdgesArrayAccess:{get:function(){return this.mg._dataArray}},data:{get:function(){return this.ub},set:function(a){if(this.ub=a,a!==null&&a.bounds){var y=a.bounds;a=y.x;var x=y.y,E=y.width;y=y.height,this.o.h(E/2,y/2),this.j.h(a,x,E,y)}}},node:{get:function(){return this.Sh},set:function(a){if(this.Sh!==a){this.Sh=a,a.Va();var y=this.network.layout,x=Be.alloc(),E=y.ni(a,x);y=E.x;var b=E.y,z=E.width;if(E=E.height,isNaN(y)&&(y=0),isNaN(b)&&(b=0),this.j.h(y,b,z,E),Be.free(x),!(a instanceof or)&&(a=a.locationObject.ga(Or),a.w())){this.o.h(a.x-y,a.y-b);return}this.o.h(z/2,E/2)}}},bounds:{get:function(){return this.j},set:function(a){this.j.D(a)||this.j.assign(a)}},focus:{get:function(){return this.o},set:function(a){this.o.D(a)||this.o.assign(a)}},centerX:{get:function(){return this.j.x+this.o.x},set:function(a){var y=this.j;y.x+this.o.x!==a&&(y.ka(),y.x=a-this.o.x,y.freeze())}},centerY:{get:function(){return this.j.y+this.o.y},set:function(a){var y=this.j;y.y+this.o.y!==a&&(y.ka(),y.y=a-this.o.y,y.freeze())}},focusX:{get:function(){return this.o.x},set:function(a){var y=this.o;y.x!==a&&(y.ka(),y.x=a,y.freeze())}},focusY:{get:function(){return this.o.y},set:function(a){var y=this.o;y.y!==a&&(y.ka(),y.y=a,y.freeze())}},x:{get:function(){return this.j.x},set:function(a){var y=this.j;y.x!==a&&(y.ka(),y.x=a,y.freeze())}},y:{get:function(){return this.j.y},set:function(a){var y=this.j;y.y!==a&&(y.ka(),y.y=a,y.freeze())}},width:{get:function(){return this.j.width},set:function(a){var y=this.j;y.width!==a&&(y.ka(),y.width=a,y.freeze())}},height:{get:function(){return this.j.height},set:function(a){var y=this.j;y.height!==a&&(y.ka(),y.height=a,y.freeze())}},network:{get:function(){return this.ob},set:function(a){this.ob=a}},sourceVertexes:{get:function(){for(var a=new pn,y=this.sourceEdges;y.next();)a.add(y.value.fromVertex);return a.iterator}},destinationVertexes:{get:function(){for(var a=new pn,y=this.destinationEdges;y.next();)a.add(y.value.toVertex);return a.iterator}},vertexes:{get:function(){for(var a=new pn,y=this.sourceEdges;y.next();)a.add(y.value.fromVertex);for(y=this.destinationEdges;y.next();)a.add(y.value.toVertex);return a.iterator}},sourceEdges:{get:function(){return this.tg.iterator}},destinationEdges:{get:function(){return this.mg.iterator}},edges:{get:function(){for(var a=new fn,y=this.sourceEdges;y.next();)a.add(y.value);for(y=this.destinationEdges;y.next();)a.add(y.value);return a.iterator}},edgesCount:{get:function(){return this.tg.count+this.mg.count}}}),Ca.prototype.deleteDestinationEdge=Ca.prototype.Jl,Ca.prototype.addDestinationEdge=Ca.prototype.zl,Ca.prototype.deleteSourceEdge=Ca.prototype.Kl,Ca.prototype.addSourceEdge=Ca.prototype.Cl,Ca.className="LayoutVertex",Ca.standardComparer=ry,Ca.smartComparer=function(a,y){if(a!==null){if(y!==null){a=a.Sh;var x=y.Sh;if(a!==null){if(x!==null){for(y=a.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),a=x.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),x=0;x<y.length;x++)if(a[x]!==""&&a[x]!==void 0){var E=parseFloat(y[x]),b=parseFloat(a[x]);if(isNaN(E))if(isNaN(b)){if(y[x].localeCompare(a[x])!==0)return y[x].localeCompare(a[x])}else return 1;else{if(isNaN(b))return-1;if(E-b!==0)return E-b}}else if(y[x]!=="")return 1;return a[x]!==""&&a[x]!==void 0?-1:0}return 1}return x!==null?-1:0}return 1}return y!==null?-1:0};function qs(a){Di(this),this.nb=a,this.qd=this.kd=this.$k=this.ub=null}qs.prototype.clear=function(){this.qd=this.kd=this.$k=this.ub=null},qs.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutEdge#"+Ai(this);return 0<a&&(y+=this.$k!==null?"("+this.$k.toString()+")":"",1<a&&(y+=" "+(this.kd?this.kd.toString():"null")+" --> "+(this.qd?this.qd.toString():"null"))),y},qs.prototype.gm=function(){var a=this.kd;this.kd=this.qd,this.qd=a},qs.prototype.commit=function(){},qs.prototype.Ax=function(a){return this.qd===a?this.kd:this.kd===a?this.qd:null},ve.Object.defineProperties(qs.prototype,{network:{get:function(){return this.nb},set:function(a){this.nb=a}},data:{get:function(){return this.ub},set:function(a){this.ub!==a&&(this.ub=a)}},link:{get:function(){return this.$k},set:function(a){this.$k!==a&&(this.$k=a)}},fromVertex:{get:function(){return this.kd},set:function(a){this.kd!==a&&(this.kd=a)}},toVertex:{get:function(){return this.qd},set:function(a){this.qd!==a&&(this.qd=a)}}}),qs.prototype.getOtherVertex=qs.prototype.Ax,qs.className="LayoutEdge";function Ha(a){Wo.call(this),this.isViewportSized=!0,this.yo=this.zo=NaN,this.yg=new ln(NaN,NaN).freeze(),this.tf=new ln(10,10).freeze(),this.Jb=pp,this.Rb=o0,this.nd=mp,this.hd=uS,a&&Object.assign(this,a)}Se(Ha,Wo),Ha.prototype.cloneProtected=function(a){Wo.prototype.cloneProtected.call(this,a),a.zo=this.zo,a.yo=this.yo,a.yg.assign(this.yg),a.tf.assign(this.tf),a.Jb=this.Jb,a.Rb=this.Rb,a.nd=this.nd,a.hd=this.hd},Ha.prototype.qb=function(a){a.classType===Ha?a===mp||a===s0||a===oy||a===a0?this.sorting=a:a===o0||a===gu?this.arrangement=a:a===pp||a===r0?this.alignment=a:$t("Unknown enum value: "+a):Wo.prototype.qb.call(this,a)},Ha.prototype.doLayout=function(a){this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);var y=this.ex(a);a=this.diagram;for(var x=y.copy().iterator;x.next();){var E=x.value;if(!E.ph()||E.fromNode===null&&E.toNode===null){if(E.Va(),E instanceof or)for(E=E.memberParts;E.next();)y.remove(E.value)}else y.remove(E)}var b=y.Fa();if(b.length!==0){switch(this.sorting){case a0:b.reverse();break;case mp:b.sort(this.comparer);break;case s0:b.sort(this.comparer),b.reverse()}var z=this.wrappingColumn;isNaN(z)&&(z=0);var tt=this.wrappingWidth;switch(isNaN(tt)&&a!==null?(y=a.padding,tt=Math.max(a.viewportBounds.width-y.left-y.right,0)):tt=Math.max(this.wrappingWidth,0),0>=z&&0>=tt&&(z=1),y=this.spacing.width,isFinite(y)||(y=0),x=this.spacing.height,isFinite(x)||(x=0),a!==null&&a.Ea("Layout"),E=[],this.alignment){case r0:var rt=y,ot=x,lt=Be.alloc(),ut=Math.max(this.cellSize.width,1);if(!isFinite(ut))for(var ft=ut=0;ft<b.length;ft++){var yt=this.ni(b[ft],lt);ut=Math.max(ut,yt.width)}if(ut=Math.max(ut+rt,1),ft=Math.max(this.cellSize.height,1),!isFinite(ft))for(yt=ft=0;yt<b.length;yt++){var xt=this.ni(b[yt],lt);ft=Math.max(ft,xt.height)}ft=Math.max(ft+ot,1),yt=this.arrangement;for(var Ct=xt=this.arrangementOrigin.x,bt=this.arrangementOrigin.y,Wt=0,jt=0,Qt=0;Qt<b.length;Qt++){var te=b[Qt],re=this.ni(te,lt),he=Math.ceil((re.width+rt)/ut)*ut,ke=Math.ceil((re.height+ot)/ft)*ft;switch(yt){case gu:var Jn=Math.abs(Ct-re.width);break;default:Jn=Ct+re.width}switch((0<z&&Wt>z-1||0<tt&&0<Wt&&Jn-xt>tt)&&(E.push(new Be(0,bt,tt+rt,jt)),Wt=0,Ct=xt,bt+=jt,jt=0),jt=Math.max(jt,ke),yt){case gu:re=-re.width;break;default:re=0}switch(te.moveTo(Ct+re,bt),yt){case gu:Ct-=he;break;default:Ct+=he}Wt++}E.push(new Be(0,bt,tt+rt,jt)),Be.free(lt);break;case pp:for(ot=tt,ut=z,ft=y,yt=x,tt=Be.alloc(),xt=Math.max(this.cellSize.width,1),z=bt=lt=0,rt=At.alloc(),Ct=0;Ct<b.length;Ct++)jt=b[Ct],Wt=this.ni(jt,tt),jt=_h(jt,jt.locationObject,jt.locationSpot,rt),lt=Math.max(lt,jt.x),bt=Math.max(bt,Wt.width-jt.x),z=Math.max(z,jt.y);switch(Ct=this.arrangement,Ct){case gu:lt+=ft;break;default:bt+=ft}xt=isFinite(xt)?Math.max(xt+ft,1):Math.max(lt+bt,1);var fi=jt=this.arrangementOrigin.x;for(Qt=this.arrangementOrigin.y,bt=0,ot>=lt&&(ot-=lt),lt=te=0,he=Math.max(this.cellSize.height,1),re=z=0,ke=!0,Wt=At.alloc(),Jn=0;Jn<b.length;Jn++){var li=b[Jn],Bn=this.ni(li,tt),on=_h(li,li.locationObject,li.locationSpot,rt);if(0<bt)switch(Ct){case gu:fi=(fi-jt-(Bn.width-on.x))/xt,fi=Zt.$(Math.round(fi),fi)?Math.round(fi):Math.floor(fi),fi=fi*xt+jt;break;default:fi=(fi-jt+on.x)/xt,fi=Zt.$(Math.round(fi),fi)?Math.round(fi):Math.ceil(fi),fi=fi*xt+jt}else switch(Ct){case gu:te=fi+on.x+Bn.width;break;default:te=fi-on.x}switch(Ct){case gu:var nr=-(fi+on.x)+te;break;default:nr=fi+Bn.width-on.x-te}if(0<ut&&bt>ut-1||0<ot&&0<bt&&nr>ot){for(E.push(new Be(0,ke?Qt-z:Qt,ot+ft,re+z+yt)),fi=0;fi<bt&&Jn!==bt;fi++){nr=b[Jn-bt+fi];var Xi=_h(nr,nr.locationObject,nr.locationSpot,Wt);nr.moveTo(nr.position.x,nr.position.y+z-Xi.y)}re+=yt,Qt=ke?Qt+re:Qt+(re+z),bt=re=z=0,fi=jt,ke=!1}switch(fi===jt&&(lt=Ct===gu?Math.max(lt,Bn.width-on.x):Math.min(lt,-on.x)),z=Math.max(z,on.y),re=Math.max(re,Bn.height-on.y),isFinite(he)&&(re=Math.max(re,Math.max(Bn.height,he)-on.y)),ke?li.moveTo(fi-on.x,Qt-on.y):li.moveTo(fi-on.x,Qt),Ct){case gu:fi-=on.x+ft;break;default:fi+=Bn.width-on.x+ft}bt++}if(E.push(new Be(0,Qt,ot+ft,(ke?re:re+z)+yt)),b.length!==bt)for(ot=0;ot<bt;ot++)ut=b[b.length-bt+ot],ft=_h(ut,ut.locationObject,ut.locationSpot,rt),ut.moveTo(ut.position.x,ut.position.y+z-ft.y);if(At.free(rt),At.free(Wt),Ct===gu)for(b=0;b<E.length;b++)z=E[b],z.width+=lt,z.x-=lt;else for(b=0;b<E.length;b++)z=E[b],z.x>lt&&(z.width+=z.x-lt,z.x=lt);Be.free(tt)}for(rt=z=tt=b=0;rt<E.length;rt++)ot=E[rt],b=Math.min(b,ot.x),tt=Math.min(tt,ot.y),z=Math.max(z,ot.x+ot.width);this.arrangement===gu?this.commitLayers(E,new At(b+y/2-(z+b),tt-x/2)):this.commitLayers(E,new At(b-y/2,tt-x/2)),a!==null&&a.eb("Layout"),this.isValidLayout=!0}},Ha.prototype.commitLayers=function(){};function uS(a,y){return a=a.text,y=y.text,a<y?-1:a>y?1:0}ve.Object.defineProperties(Ha.prototype,{wrappingWidth:{get:function(){return this.zo},set:function(a){this.zo!==a&&(0<a||isNaN(a))&&(this.zo=a,this.isViewportSized=isNaN(a),this.C())}},wrappingColumn:{get:function(){return this.yo},set:function(a){this.yo!==a&&(0<a||isNaN(a))&&(this.yo=a,this.C())}},cellSize:{get:function(){return this.yg},set:function(a){this.yg.D(a)||(this.yg.assign(a),this.C())}},spacing:{get:function(){return this.tf},set:function(a){this.tf.D(a)||(this.tf.assign(a),this.C())}},alignment:{get:function(){return this.Jb},set:function(a){this.Jb===a||a!==pp&&a!==r0||(this.Jb=a,this.C())}},arrangement:{get:function(){return this.Rb},set:function(a){this.Rb===a||a!==o0&&a!==gu||(this.Rb=a,this.C())}},sorting:{get:function(){return this.nd},set:function(a){this.nd===a||a!==oy&&a!==a0&&a!==mp&&a!==s0||(this.nd=a,this.C())}},comparer:{get:function(){return this.hd},set:function(a){this.hd!==a&&(this.hd=a,this.C())}}});var r0=new He(Ha,"Position",0),pp=new He(Ha,"Location",1),o0=new He(Ha,"LeftToRight",2),gu=new He(Ha,"RightToLeft",3),oy=new He(Ha,"Forward",4),a0=new He(Ha,"Reverse",5),mp=new He(Ha,"Ascending",6),s0=new He(Ha,"Descending",7);Ha.className="GridLayout",Ha.standardComparer=uS,Ha.smartComparer=function(a,y){if(a!==null){if(y!==null){a=a.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),y=y.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/);for(var x=0;x<a.length;x++)if(y[x]!==""&&y[x]!==void 0){var E=parseFloat(a[x]),b=parseFloat(y[x]);if(isNaN(E))if(isNaN(b)){if(a[x].localeCompare(y[x])!==0)return a[x].localeCompare(y[x])}else return 1;else{if(isNaN(b))return-1;if(E-b!==0)return E-b}}else if(a[x]!=="")return 1;return y[x]!==""&&y[x]!==void 0?-1:0}return 1}return y!==null?-1:0},Ha.Position=r0,Ha.Location=pp,Ha.LeftToRight=o0,Ha.RightToLeft=gu,Ha.Forward=oy,Ha.Reverse=a0,Ha.Ascending=mp,Ha.Descending=s0;function yo(){this.On=new pn,this.Dn=new pn,this.Pa=new pn,this.cf=new Ie,this.bf=new Ie,this.aj=new Ie,this.H=null,this.tp=!1}wt=yo.prototype,wt.clear=function(){this.On.clear(),this.Dn.clear(),this.Pa.clear(),this.cf.clear(),this.bf.clear(),this.aj.clear()},wt.Xe=function(a){this.H=a},wt.oi=function(a){if(a instanceof qn){if(this.On.add(a),a instanceof or){var y=a.containingGroup;y===null?this.H.ai.add(a):y.gl.add(a),y=a.layout,y!==null&&(y.diagram=this.H)}}else a instanceof Tn?this.Dn.add(a):a instanceof Yr||this.Pa.add(a);y=a.data,y===null||a instanceof Yr||(a instanceof Tn?this.bf.add(y,a):this.cf.add(y,a))},wt.pc=function(a){if(a.Ej(),a instanceof qn){if(this.On.remove(a),a instanceof or){var y=a.containingGroup;y===null?this.H.ai.remove(a):y.gl.remove(a),y=a.layout,y!==null&&(y.diagram=null)}}else a instanceof Tn?this.Dn.remove(a):a instanceof Yr||this.Pa.remove(a);y=a.data,y===null||a instanceof Yr||(a instanceof Tn?this.bf.remove(y):this.cf.remove(y))},wt.Wd=function(){var a=this.H;if(a!==null){for(var y=a.nodeTemplateMap.iterator;y.next();){var x=y.value,E=y.key;(!x.Zc()||x instanceof or)&&$t('Invalid node template in Diagram.nodeTemplateMap: template for "'+E+'" must be a Node or a simple Part, not a Group or Link: '+x)}for(y=a.groupTemplateMap.iterator;y.next();)x=y.value,E=y.key,x instanceof or||$t('Invalid group template in Diagram.groupTemplateMap: template for "'+E+'" must be a Group, not a normal Node or Link: '+x);for(y=a.linkTemplateMap.iterator;y.next();)x=y.value,E=y.key,x instanceof Tn||$t('Invalid link template in Diagram.linkTemplateMap: template for "'+E+'" must be a Link, not a normal Node or simple Part: '+x);for(y=pi(),x=a.selection.iterator;x.next();)(E=x.value.data)&&y.push(E);for(x=pi(),a=a.highlighteds.iterator;a.next();)(E=a.value.data)&&x.push(E);for(a=pi(),E=this.nodes.iterator;E.next();){var b=E.value;b.data!==null&&(a.push(b.data),a.push(b.location))}for(E=this.links.iterator;E.next();)b=E.value,b.data!==null&&(a.push(b.data),a.push(b.location));for(E=this.parts.iterator;E.next();)b=E.value,b.data!==null&&(a.push(b.data),a.push(b.location));for(this.removeAllModeledParts(),this.addAllModeledParts(),E=0;E<y.length;E++)b=this.Lc(y[E]),b!==null&&(b.isSelected=!0);for(E=0;E<x.length;E++)b=this.Lc(x[E]),b!==null&&(b.isHighlighted=!0);for(E=0;E<a.length;E+=2)b=this.Lc(a[E]),b!==null&&(b.location=a[E+1]);oi(y),oi(x),oi(a)}},yo.prototype.addAllModeledParts=function(){this.addModeledParts(this.diagram.model.nodeDataArray)},yo.prototype.addModeledParts=function(a,y){var x=this,E=this.diagram.model;a.forEach(function(b){E.lb(b)&&hS(x,b,!1)}),a.forEach(function(b){E.lb(b)&&x.resolveReferencesForData(b)}),y!==!1&&Pf(this.diagram,!1)};function hS(a,y,x){if(y!=null&&!a.diagram.undoManager.isUndoingRedoing&&!a.cf.contains(y)){x===void 0&&(x=!0);t:{if(y!=null&&!a.H.undoManager.isUndoingRedoing&&!a.cf.contains(y)){var E=a.Ro(y),b=dS(a,y,E);if(b!==null&&(Ol(b),b=b.copy(),b!==null)){var z=a.diagram.skipsModelSourceBindings;a.diagram.skipsModelSourceBindings=!0,b.Tf=E,b.ub=y,a.tp&&(b.Jg="Tool"),a.diagram.add(b),b.ub=null,b.data=y,a.diagram.skipsModelSourceBindings=z,E=b;break t}}E=null}E!==null&&x&&a.resolveReferencesForData(y)}}yo.prototype.insertLink=function(){return null},yo.prototype.resolveReferencesForData=function(){},yo.prototype.Ro=function(a){return this.H.model.Ro(a)};function dS(a,y,x){a=a.H;var E=a.model;return E.Xj()&&E.Yu(y)?(y=a.groupTemplateMap.I(x),y===null&&(y=a.groupTemplateMap.I(""),y===null&&(gS||(gS=!0,ri('No Group template found for category "'+x+'"'),ri(" Using default group template")),y=a.ly))):(y=a.nodeTemplateMap.I(x),y===null&&(y=a.nodeTemplateMap.I(""),y===null&&(fS||(fS=!0,ri('No Node template found for category "'+x+'"'),ri(" Using default node template")),y=a.ny))),y}yo.prototype.getLinkCategoryForData=function(){return""},yo.prototype.setLinkCategoryForData=function(){},yo.prototype.setFromNodeForLink=function(){},yo.prototype.setToNodeForLink=function(){},yo.prototype.findLinkTemplateForCategory=function(a){var y=this.H,x=y.linkTemplateMap.I(a);return x===null&&(x=y.linkTemplateMap.I(""),x===null&&(pS||(pS=!0,ri('No Link template found for category "'+a+'"'),ri(" Using default link template")),x=y.my)),x},yo.prototype.removeAllModeledParts=function(){this.Gs(this.diagram.model.nodeDataArray)},yo.prototype.Gs=function(a){var y=this;a.forEach(function(x){y.ip(x)})},yo.prototype.ip=function(a){a=this.Lc(a),a!==null&&(Ng(this.diagram,a,!1),this.unresolveReferencesForPart(a))},yo.prototype.unresolveReferencesForPart=function(){},yo.prototype.removeDataForLink=function(){},yo.prototype.findPartForKey=function(a){return a==null?null:(a=this.H.model.hc(a),a!==null?this.cf.I(a):null)},yo.prototype.Vb=function(a){return a==null||(a=this.H.model.hc(a),a===null)?null:(a=this.cf.I(a),a instanceof qn?a:null)},yo.prototype.findLinkForKey=function(){return null},wt=yo.prototype,wt.Lc=function(a){if(a===null)return null;var y=this.cf.I(a);return y!==null?y:y=this.bf.I(a)},wt.ii=function(a){return a===null?null:(a=this.cf.I(a),a instanceof qn?a:null)},wt.Kc=function(a){return a===null?null:this.bf.I(a)},wt.ms=function(a){for(var y=0;y<arguments.length;++y);y=new pn;for(var x=this.On.iterator;x.next();){var E=x.value,b=E.data;if(b!==null)for(var z=0;z<arguments.length;z++){var tt=arguments[z];if(We(tt)&&ay(this,b,tt)){y.add(E);break}}}return y.iterator},wt.ls=function(a){for(var y=0;y<arguments.length;++y);y=new pn;for(var x=this.Dn.iterator;x.next();){var E=x.value,b=E.data;if(b!==null)for(var z=0;z<arguments.length;z++){var tt=arguments[z];if(We(tt)&&ay(this,b,tt)){y.add(E);break}}}return y.iterator};function ay(a,y,x){for(var E in x){var b=y[E],z=x[E];if(je(z)){if(!je(b)||b.length<z.length)return!1;for(var tt=0;tt<b.length;tt++){var rt=z[tt];if(rt!==void 0&&!cS(a,b[tt],rt))return!1}}else if(!cS(a,b,z))return!1}return!0}function cS(a,y,x){if(typeof x=="function"){if(!x(y))return!1}else if(x instanceof RegExp){if(!y||!x.test(y.toString()))return!1}else if(We(y)&&We(x)){if(!ay(a,y,x))return!1}else if(y!==x)return!1;return!0}yo.prototype.doModelChanged=function(a){if(this.H){var y=this.H;if(a.model===y.model){var x=a.change;if(y.doModelChanged(a),y.aa){y.aa=!1;try{var E=a.modelChange;if(E!=="")if(x===Ir){if(E==="nodeCategory"){var b=this.Lc(a.object),z=a.newValue;b!==null&&typeof z=="string"&&(b.category=z)}else E==="nodeDataArray"&&(this.Gs(a.oldValue),this.addModeledParts(a.newValue));y.isModified=!0}else if(x===fo){var tt=a.newValue;E==="nodeDataArray"&&We(tt)&&hS(this,tt),y.isModified=!0}else if(x===Mo){var rt=a.oldValue;E==="nodeDataArray"&&We(rt)&&this.ip(rt),y.isModified=!0}else x===ho&&(E==="SourceChanged"?a.object!==null?this.updateDataBindings(a.object,a.propertyName):(this.rp(),this.updateAllTargetBindings()):E==="ModelDisplaced"&&this.Wd());else if(x===Ir){var ot=a.propertyName,lt=a.object;lt===y.model?(ot==="nodeKeyProperty"||ot==="nodeCategoryProperty")&&(y.undoManager.isUndoingRedoing||this.Wd()):this.updateDataBindings(lt,ot),y.isModified=!0}else if(x===fo||x===Mo){var ut=a.change===fo,ft=ut?a.newParam:a.oldParam,yt=ut?a.newValue:a.oldValue,xt=this.aj.I(a.object);if(Array.isArray(xt))for(a=0;a<xt.length;a++){var Ct=xt[a];if(ut)Fm(Ct,yt,ft,!0);else if(!(0>ft)){var bt=ft+Qg(Ct);Ct.pc(bt,!0),xv(Ct,bt,ft)}}y.isModified=!0}}finally{y.aa=!0}}}}},yo.prototype.updateAllTargetBindings=function(a){a===void 0&&(a="");for(var y=this.parts.iterator;y.next();)y.value.La(a);for(y=this.nodes.iterator;y.next();)y.value.La(a);for(y=this.links.iterator;y.next();)y.value.La(a)},yo.prototype.rp=function(){for(var a=this.H.model,y=new pn,x=a.nodeDataArray,E=0;E<x.length;E++)y.add(x[E]);var b=[];for(this.nodes.each(function(tt){tt.data===null||y.contains(tt.data)||b.push(tt.data)}),this.parts.each(function(tt){tt.data===null||y.contains(tt.data)||b.push(tt.data)}),b.forEach(function(tt){ES(a,tt,!1)}),E=0;E<x.length;E++){var z=x[E];this.Lc(z)===null&&CS(a,z,!1)}for(this.refreshDataBoundLinks(),x=this.parts.iterator;x.next();)x.value.updateRelationshipsFromData();for(x=this.nodes.iterator;x.next();)x.value.updateRelationshipsFromData();for(x=this.links.iterator;x.next();)x.value.updateRelationshipsFromData()},yo.prototype.refreshDataBoundLinks=function(){},yo.prototype.updateRelationshipsFromData=function(){},yo.prototype.updateDataBindings=function(a,y){if(typeof y=="string"){var x=this.Lc(a);if(x!==null)x.La(y);else{x=null;for(var E=this.aj.iterator;E.next();){for(var b=E.value,z=0;z<b.length;z++){var tt=b[z].sx(a);tt!==null&&(x===null&&(x=pi()),x.push(tt))}if(x!==null)break}if(x!==null){for(E=0;E<x.length;E++)x[E].La(y);oi(x)}}a===this.diagram.model.modelData&&this.updateAllTargetBindings(y)}};function sy(a,y){var x=y.Hh;if(je(x)){var E=a.aj.I(x);if(E===null)E=[],E.push(y),a.aj.add(x,E);else{for(a=0;a<E.length;a++)if(E[a]===y)return;E.push(y)}}}function ly(a,y,x){ec(y,function(tt){tt=tt.O.s;for(var rt=tt.length,ot=0;ot<rt;ot++)Og(x,tt[ot])});var E=y.Hh;if(je(E)){var b=a.aj.I(E);if(b!==null){for(var z=0;z<b.length;z++)if(b[z]===y){b.splice(z,1),b.length===0&&a.aj.remove(E);break}}}}yo.prototype.Kj=function(a,y,x){x===void 0&&(x=!1);var E=new Ie;if(je(a))for(var b=0;b<a.length;b++)l0(this,a[b],y,E,x);else for(a=a.iterator;a.next();)l0(this,a.value,y,E,x);if(y!==null){x=y.model,a=y.toolManager.findTool("Dragging"),a=a!==null?a.dragOptions.dragsLink:y.Wm.dragsLink,b=new pn;for(var z=new Ie,tt=E.iterator;tt.next();){var rt=tt.value;if(rt instanceof Tn)a||rt.fromNode!==null&&rt.toNode!==null||b.add(rt);else if(rt instanceof qn&&rt.data!==null&&x.Tl()){var ot=rt;rt=tt.key;var lt=rt.pg();lt!==null&&(lt=E.I(lt),lt!==null?(x.qe(ot.data,x.wa(lt.data)),ot=y.Kc(ot.data),rt=rt.kh(),rt!==null&&ot!==null&&z.add(rt,ot)):x.qe(ot.data,void 0))}}if(0<b.count&&y.Is(b,!1),0<z.count)for(x=z.iterator;x.next();)E.add(x.key,x.value)}if(y!==null&&this.H!==null&&(y=y.model,x=y.afterCopyFunction,x!==null)){var ut=new Ie;E.each(function(ft){ft.key.data!==null&&ut.add(ft.key.data,ft.value.data)}),x(ut,y,this.H.model)}for(y=E.iterator;y.next();)y.value.La();return E};function l0(a,y,x,E,b){if(y===null||b&&!y.canCopy())return null;if(E.contains(y))return E.I(y);var z=a.copyPartData(y,x);if(!(z instanceof Ni))return null;if(z.isSelected=!1,z.isHighlighted=!1,E.add(y,z),y instanceof qn){for(var tt=y.linksConnected;tt.next();){var rt=tt.value;if(rt.fromNode===y){var ot=E.I(rt);ot!==null&&(ot.fromNode=z)}rt.toNode===y&&(rt=E.I(rt),rt!==null&&(rt.toNode=z))}if(y instanceof or&&z instanceof or)for(y=y.memberParts;y.next();)tt=l0(a,y.value,x,E,b),tt instanceof Tn||tt===null||(tt.containingGroup=z)}else if(y instanceof Tn&&z instanceof Tn)for(tt=y.fromNode,tt!==null&&(tt=E.I(tt),tt!==null&&(z.fromNode=tt)),tt=y.toNode,tt!==null&&(tt=E.I(tt),tt!==null&&(z.toNode=tt)),y=y.labelNodes;y.next();)tt=l0(a,y.value,x,E,b),tt!==null&&tt instanceof qn&&(tt.labeledLink=z);return z}yo.prototype.copyPartData=function(a,y){var x=null,E=a.data;if(E!==null&&y!==null){var b=y.model;a instanceof Tn||(E=b.copyNodeData(E),We(E)&&(b.xf(E),x=y.Lc(E)))}else Ol(a),x=a.copy(),x!==null&&(b=this.H,y!==null?y.add(x):E!==null&&b!==null&&b.commandHandler!==null&&b.commandHandler.copiesClipboardData&&(y=b.model,b=null,x instanceof Tn||(b=y.copyNodeData(E)),We(b)&&(x.data=b)));return x},ve.Object.defineProperties(yo.prototype,{nodes:{get:function(){return this.On}},links:{get:function(){return this.Dn}},parts:{get:function(){return this.Pa}},diagram:{get:function(){return this.H}},addsToTemporaryLayer:{get:function(){return this.tp},set:function(a){this.tp=a}}}),yo.prototype.updateAllRelationshipsFromData=yo.prototype.rp,yo.prototype.findLinksByExample=yo.prototype.ls,yo.prototype.findNodesByExample=yo.prototype.ms,yo.prototype.findLinkForData=yo.prototype.Kc,yo.prototype.findNodeForData=yo.prototype.ii,yo.prototype.findPartForData=yo.prototype.Lc,yo.prototype.findNodeForKey=yo.prototype.Vb,yo.prototype.removeModeledPart=yo.prototype.ip,yo.prototype.removeModeledParts=yo.prototype.Gs,yo.prototype.rebuildParts=yo.prototype.Wd;var fS=!1,gS=!1,pS=!1;yo.className="PartManager";function Da(a){yo.apply(this,arguments)}Se(Da,yo),Da.prototype.addAllModeledParts=function(){var a=this.diagram.model;this.addModeledParts(a.nodeDataArray),mS(this,a.linkDataArray)},Da.prototype.addModeledParts=function(a){for(yo.prototype.addModeledParts.call(this,a,!1),a=this.links.iterator;a.next();)Gf(a.value);Pf(this.diagram,!1)};function mS(a,y){y.forEach(function(x){vS(a,x)}),Pf(a.diagram,!1)}function vS(a,y){if(y!=null&&!a.diagram.undoManager.isUndoingRedoing&&!a.bf.contains(y)){var x=a.getLinkCategoryForData(y),E=a.findLinkTemplateForCategory(x);if(E!==null){Ol(E);var b=E.copy();if(b!==null){E=a.diagram.skipsModelSourceBindings,a.diagram.skipsModelSourceBindings=!0,b.Tf=x,b.ub=y,x=a.diagram.model;var z=c0(x,y,!0);z!==""&&(b.fromPortId=z),z=hl(x,y,!0),z!==void 0&&(z=a.Vb(z),z instanceof qn&&(b.fromNode=z)),z=c0(x,y,!1),z!==""&&(b.toPortId=z),z=hl(x,y,!1),z!==void 0&&(z=a.Vb(z),z instanceof qn&&(b.toNode=z)),x=x.Ef(y),Array.isArray(x)&&x.forEach(function(tt){tt=a.Vb(tt),tt!==null&&(tt.labeledLink=b)}),a.tp&&(b.Jg="Tool"),a.diagram.add(b),b.ub=null,b.data=y,a.diagram.skipsModelSourceBindings=E}}}}Da.prototype.removeAllModeledParts=function(){var a=this.diagram.model;yS(this,a.linkDataArray),this.Gs(a.nodeDataArray)};function yS(a,y){y.forEach(function(x){a.ip(x)})}Da.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ps(a)},Da.prototype.setLinkCategoryForData=function(a,y){return this.diagram.model.lp(a,y)},Da.prototype.setFromNodeForLink=function(a,y){var x=this.diagram.model;x.wv(a.data,x.wa(y!==null?y.data:null))},Da.prototype.setToNodeForLink=function(a,y){var x=this.diagram.model;x.Bv(a.data,x.wa(y!==null?y.data:null))},Da.prototype.removeDataForLink=function(a){this.diagram.model.bm(a.data)},Da.prototype.findPartForKey=function(a){var y=yo.prototype.findPartForKey.call(this,a);return y===null&&(a=this.diagram.model.jh(a),a!==null)?this.bf.I(a):y},Da.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.jh(a),a!==null?this.bf.I(a):null)},Da.prototype.doModelChanged=function(a){var y=this;if(yo.prototype.doModelChanged.call(this,a),this.diagram){var x=this.diagram;if(a.model===x.model){var E=a.change;if(x.aa){x.aa=!1;try{var b=a.modelChange;if(b!==""){if(E===Ir){if(b==="linkFromKey"){var z=this.Kc(a.object);if(z!==null){var tt=this.Vb(a.newValue);z.fromNode=tt}}else if(b==="linkToKey"){var rt=this.Kc(a.object);if(rt!==null){var ot=this.Vb(a.newValue);rt.toNode=ot}}else if(b==="linkFromPortId"){var lt=this.Kc(a.object);if(lt!==null){var ut=a.newValue;typeof ut=="string"&&(lt.fromPortId=ut)}}else if(b==="linkToPortId"){var ft=this.Kc(a.object);if(ft!==null){var yt=a.newValue;typeof yt=="string"&&(ft.toPortId=yt)}}else if(b==="nodeGroupKey"){var xt=this.Lc(a.object);if(xt!==null){var Ct=a.newValue;if(Ct!==void 0){var bt=this.Vb(Ct);bt instanceof or?xt.containingGroup=bt:xt.containingGroup=null}else xt.containingGroup=null}}else if(b==="linkLabelKeys"){var Wt=this.Kc(a.object);if(Wt!==null){var jt=a.oldValue,Qt=a.newValue;Array.isArray(jt)&&jt.forEach(function(on){0<=Qt.indexOf(on)||(on=y.Vb(on),on!==null&&(on.labeledLink=null))}),Array.isArray(Qt)&&Qt.forEach(function(on){on=y.Vb(on),on!==null&&(on.labeledLink=Wt)})}}else if(b==="linkCategory"){var te=this.Kc(a.object),re=a.newValue;te!==null&&typeof re=="string"&&(te.category=re)}else b==="linkDataArray"&&(yS(this,a.oldValue),mS(this,a.newValue));x.isModified=!0}else if(E===fo){var he=a.newValue;if(b==="linkDataArray"&&typeof he=="object"&&he!==null)vS(this,he);else if(b==="linkLabelKeys"&&xd(he)){var ke=this.Kc(a.object),Jn=this.Vb(he);ke!==null&&Jn!==null&&(Jn.labeledLink=ke)}x.isModified=!0}else if(E===Mo){var fi=a.oldValue;if(b==="linkDataArray"&&typeof fi=="object"&&fi!==null)this.ip(fi);else if(b==="linkLabelKeys"&&xd(fi)){var li=this.Vb(fi);li!==null&&(li.labeledLink=null)}x.isModified=!0}}else if(E===Ir){var Bn=a.propertyName;a.object!==x.model||Bn!=="linkFromKeyProperty"&&Bn!=="linkToKeyProperty"&&Bn!=="linkFromPortIdProperty"&&Bn!=="linkToPortIdProperty"&&Bn!=="linkLabelKeysProperty"&&Bn!=="nodeIsGroupProperty"&&Bn!=="nodeGroupKeyProperty"&&Bn!=="linkCategoryProperty"||x.undoManager.isUndoingRedoing||this.Wd(),x.isModified=!0}}finally{x.aa=!0}}}}},Da.prototype.refreshDataBoundLinks=function(){var a=this,y=this.diagram.model,x=new pn,E=y.linkDataArray;E.forEach(function(z){x.add(z)});var b=[];this.links.each(function(z){z.data===null||x.contains(z.data)||b.push(z.data)}),b.forEach(function(z){NS(y,z,!1)}),E.forEach(function(z){a.Kc(z)===null&&bS(y,z,!1)})},Da.prototype.updateRelationshipsFromData=function(a){var y=a.data;if(y!==null){var x=a.diagram;if(x!==null){var E=x.model;if(a instanceof Tn){var b=hl(E,y,!0);if(b=x.Vb(b),a.fromNode=b,b=hl(E,y,!1),b=x.Vb(b),a.toNode=b,y=E.Ef(y),0<y.length||0<a.labelNodes.count){if(y.length===1&&a.labelNodes.count===1){b=y[0];var z=a.labelNodes.first();if(E.wa(z.data)===b)return}b=new pn().addAll(y);var tt=new pn;a.labelNodes.each(function(rt){rt.data!==null&&(rt=E.wa(rt.data),rt!==void 0&&tt.add(rt))}),y=tt.copy(),y.hp(b),b=b.copy(),b.hp(tt),(0<y.count||0<b.count)&&(y.each(function(rt){rt=x.Vb(rt),rt!==null&&rt.labeledLink===a&&(rt.labeledLink=null)}),b.each(function(rt){rt=x.Vb(rt),rt!==null&&rt.labeledLink!==a&&(rt.labeledLink=a)}))}}else!(a instanceof Yr)&&(y=E.lh(y),y=x.findPartForKey(y),y===null||y instanceof or)&&(a.containingGroup=y)}}},Da.prototype.resolveReferencesForData=function(a){var y=this.diagram.model,x=y.wa(a);if(x!==void 0){var E=vp(y,x),b=this.Lc(a);if(E!==null&&b!==null){E=E.iterator;for(var z={};E.next();){var tt=E.value;y.lb(tt)?b instanceof or&&y.lh(tt)===x&&(tt=this.Lc(tt),tt!==null&&(tt.containingGroup=b)):(z.link=this.Kc(tt),z.link!==null&&b instanceof qn&&(hl(y,tt,!0)===x&&(z.link.fromNode=b),hl(y,tt,!1)===x&&(z.link.toNode=b),tt=y.Ef(tt),Array.isArray(tt)&&tt.some(function(rt){return function(ot){return ot===x?(b.labeledLink=rt.link,!0):!1}}(z)))),z={link:z.link}}mu(y,x)}a=y.lh(a),a!==void 0&&(a=this.Vb(a),a instanceof or&&(b.containingGroup=a))}},Da.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof qn){var x=y.wa(a.data);if(x!==void 0){for(var E=a.linksConnected;E.next();)pu(y,x,E.value.data);if(a.isLinkLabel&&(E=a.labeledLink,E!==null&&pu(y,x,E.data)),a instanceof or)for(a=a.memberParts;a.next();)E=a.value.data,y.lb(E)&&pu(y,x,E)}}},Da.prototype.copyPartData=function(a,y){var x=yo.prototype.copyPartData.call(this,a,y);if(a instanceof Tn)if(a=a.data,a!==null&&y!==null){var E=y.model;a=E.Jo(a),typeof a=="object"&&a!==null&&(E.fi(a),x=y.Kc(a))}else x!==null&&(y=this.diagram,a!==null&&y!==null&&y.commandHandler!==null&&y.commandHandler.copiesClipboardData&&(y=y.model.Jo(a),typeof y=="object"&&y!==null&&(x.data=y)));return x},Da.prototype.insertLink=function(a,y,x,E){var b=this.diagram,z=b.model,tt=b.toolManager.findTool("Linking"),rt="";if(a!==null&&(y===null&&(y=a),rt=y.portId,rt===null&&(rt="")),y="",x!==null&&(E===null&&(E=x),y=E.portId,y===null&&(y="")),E=tt.archetypeLinkData,E instanceof Tn){if(Ol(E),z=E.copy(),z!==null)return z.fromNode=a,z.fromPortId=rt,z.toNode=x,z.toPortId=y,b.add(z),a=tt.archetypeLabelNodeData,a instanceof qn&&(Ol(a),a=a.copy(),a!==null&&(a.labeledLink=z,b.add(a))),z}else if(E!==null&&(E=z.Jo(E),typeof E=="object"&&E!==null))return a!==null&&Yf(z,E,z.wa(a.data),!0),Xf(z,E,rt,!0),x!==null&&Yf(z,E,z.wa(x.data),!1),Xf(z,E,y,!1),z.fi(E),a=tt.archetypeLabelNodeData,a===null||a instanceof qn||(a=z.copyNodeData(a),typeof a=="object"&&a!==null&&(z.xf(a),a=z.wa(a),a!==void 0&&z.Bu(E,a))),b.Kc(E);return null},Da.prototype.findLinkForKey=Da.prototype.findLinkForKey,Da.prototype.findPartForKey=Da.prototype.findPartForKey,Da.prototype.removeAllModeledParts=Da.prototype.removeAllModeledParts,Da.prototype.addModeledParts=Da.prototype.addModeledParts,Da.prototype.addAllModeledParts=Da.prototype.addAllModeledParts,Da.className="GraphLinksPartManager";function Pl(){yo.apply(this,arguments),this.Sg=null}Se(Pl,yo);function u0(a,y,x){if(y!==null&&x!==null&&x.kh()===null){var E=a.diagram.toolManager.findTool("Linking"),b=y,z=x;if(a.diagram.isTreePathToChildren||(b=x,z=y),(E===null||!Bo(E,b,z,null,!0))&&(y=a.getLinkCategoryForData(x.data),E=a.findLinkTemplateForCategory(y),E!==null&&(Ol(E),E=E.copy(),E!==null))){var tt=a.diagram.skipsModelSourceBindings;a.diagram.skipsModelSourceBindings=!0,E.Tf=y,E.ub=x.data,E.fromNode=b,E.toNode=z,a.diagram.add(E),E.ub=null,E.data=x.data,a.diagram.skipsModelSourceBindings=tt}}}Pl.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ss(a)},Pl.prototype.setLinkCategoryForData=function(a,y){this.diagram.model.Ms(a,y)},Pl.prototype.setFromNodeForLink=function(a,y,x){var E=this.diagram.model;if(x===void 0&&(x=null),y=y!==null?y.data:null,this.diagram.isTreePathToChildren)E.qe(a.data,E.wa(y));else{var b=this.Sg;this.Sg=a,x!==null&&E.qe(x.data,void 0),E.qe(y,E.wa(a.toNode!==null?a.toNode.data:null)),this.Sg=b}},Pl.prototype.setToNodeForLink=function(a,y,x){var E=this.diagram.model;if(x===void 0&&(x=null),y=y!==null?y.data:null,this.diagram.isTreePathToChildren){var b=this.Sg;this.Sg=a,x!==null&&E.qe(x.data,void 0),E.qe(y,E.wa(a.fromNode!==null?a.fromNode.data:null)),this.Sg=b}else E.qe(a.data,E.wa(y))},Pl.prototype.removeDataForLink=function(a){this.diagram.model.qe(a.data,void 0)},Pl.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.hc(a),a!==null?this.bf.I(a):null)},Pl.prototype.doModelChanged=function(a){if(yo.prototype.doModelChanged.call(this,a),this.diagram){var y=this.diagram;if(a.model===y.model){var x=a.change;if(y.aa){y.aa=!1;try{var E=a.modelChange;if(E!==""){if(x===Ir){if(E==="nodeParentKey"){var b=a.object,z=this.Vb(a.newValue),tt=this.ii(b);if(this.Sg!==null)z!==null&&(this.Sg.data=b,this.Sg.category=this.getLinkCategoryForData(b));else if(tt!==null){var rt=tt.kh();rt!==null?z===null?y.remove(rt):y.isTreePathToChildren?rt.fromNode=z:rt.toNode=z:u0(this,z,tt)}}else if(E==="parentLinkCategory"){var ot=this.ii(a.object),lt=a.newValue;if(ot!==null&&typeof lt=="string"){var ut=ot.kh();ut!==null&&(ut.category=lt)}}y.isModified=!0}}else if(x===Ir){var ft=a.propertyName;a.object===y.model&&ft==="nodeParentKeyProperty"&&(y.undoManager.isUndoingRedoing||this.Wd()),y.isModified=!0}}finally{y.aa=!0}}}}},Pl.prototype.updateRelationshipsFromData=function(a){var y=a.data;if(y!==null){var x=a.diagram;if(x!==null){var E=x.model;a instanceof qn&&(y=E.mh(y),y=x.Vb(y),E=a.pg(),y!==E&&(E=a.kh(),y!==null?E!==null?x.isTreePathToChildren?E.fromNode=y:E.toNode=y:u0(this,y,a):E!==null&&Ng(x,E,!1)))}}},Pl.prototype.updateDataBindings=function(a,y){yo.prototype.updateDataBindings.call(this,a,y),typeof y=="string"&&this.Lc(a)!==null&&(a=this.Kc(a),a!==null&&a.La(y))},Pl.prototype.resolveReferencesForData=function(a){var y=this.diagram.model,x=y.wa(a);if(x!==void 0){var E=vp(y,x),b=this.Lc(a);if(E!==null&&b!==null){for(E=E.iterator;E.next();){var z=E.value;y.lb(z)&&b instanceof qn&&y.mh(z)===x&&u0(this,b,this.ii(z))}mu(y,x)}a=y.mh(a),a!==void 0&&b instanceof qn&&(a=this.Vb(a),u0(this,a,b))}},Pl.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof qn){var x=y.wa(a.data),E=this.Kc(a.data);if(E!==null){E.isSelected=!1,E.isHighlighted=!1;var b=E.layer;if(b!==null){var z=b.pc(-1,E,!1);0<=z&&this.diagram.cb(Mo,"parts",b,E,null,z,null),z=E.layerChanged,z!==null&&z(E,b,null)}}for(E=this.diagram.isTreePathToChildren,a=a.linksConnected;a.next();)b=a.value,b=(E?b.toNode:b.fromNode).data,y.lb(b)&&pu(y,x,b)}},Pl.prototype.insertLink=function(a,y,x){y=this.diagram.model;var E=a,b=x;return this.diagram.isTreePathToChildren||(E=x,b=a),E!==null&&b!==null?(y.qe(b.data,y.wa(E.data)),b.kh()):null},Pl.prototype.findLinkForKey=Pl.prototype.findLinkForKey,Pl.className="TreePartManager";function Ci(a,y){this.kl=new pn,this.il=new pn,this.Wv=`,
"insertedNodeKeys": `,this.jy=`,
"modifiedNodeData": `,this.Yv=`,
"removedNodeKeys": `,this.vh=null,Di(this),this.Sm=this.xa="",this.Gg=!1,this.j={},this.Tc=[],this.kb=new Ie,this.Th="key",this.Bk=this.bl=null,this.Jm=this.Km=!1,this.Mm=!0,this.xm=null,this.lj="category",this.Vf=new Ie,this.Lt=new fn,this.Wg=!1,this.o=null,this.undoManager=new po,a!==void 0&&(je(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}Ci.prototype.cloneProtected=function(a){a.xa=this.xa,a.Sm=this.Sm,a.Gg=this.Gg,a.Th=this.Th,a.bl=this.bl,a.Bk=this.Bk,a.Km=this.Km,a.Jm=this.Jm,a.Mm=this.Mm,a.xm=this.xm,a.lj=this.lj},Ci.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},Ci.prototype.clear=function(){this.Tc=[],this.kb.clear(),this.Vf.clear(),this.undoManager.clear()},Ci.prototype.toString=function(a){if(a===void 0&&(a=0),1<a)return this.np();var y=(this.name!==""?this.name:"")+" Model";if(0<a){y+=`
node data:`,a=this.nodeDataArray;for(var x=a.length,E=0;E<x;E++){var b=a[E];y+=" "+this.wa(b)+":"+Bi(b)}}return y},Ci.prototype.xA=function(a){a.change!==ho&&$t("Model.toIncrementalData argument is not a Transaction ChangedEvent:"+a.toString());var y=a.object;return a.isTransactionFinished&&y instanceof dr?(xS(this,y),a=this.Qv(y,a.propertyName==="FinishedUndo"),this.vh=null,a):null},Ci.prototype.Qv=function(a,y){var x=this,E=!1,b=new pn,z=new pn,tt=new pn,rt=this.vh;a.changes.each(function(ft){ft.model===x&&(ft.modelChange==="nodeDataArray"?ft.change===fo?b.add(ft.newValue):ft.change===Mo&&tt.add(ft.oldValue):x.lb(ft.object)?z.add(ft.object):ft.change!==Ir||x.modelData!==ft.object&&ft.propertyName!=="modelData"?ft.object!==null&&(rt&&rt.contains(ft.object)?rt.get(ft.object).each(function(yt){x.lb(yt)&&z.add(yt)}):ft.object instanceof Ci||x.ri()&&x.Jc(ft.object)||PS(x,ft.object).each(function(yt){z.add(yt)})):E=!0)});var ot=this.il;ot.clear(),b.each(function(ft){ot.add(x.wa(ft)),y||z.add(ft)});var lt=this.kl;lt.clear(),tt.each(function(ft){lt.add(x.wa(ft)),y&&z.add(ft)}),a=x.cloneDeep(z.Fa());var ut=null;return E&&(ut===null&&(ut={}),ut.modelData=this.cloneDeep(this.modelData)),0<ot.count&&(ut===null&&(ut={}),y?ut.removedNodeKeys=ot.Fa():ut.insertedNodeKeys=ot.Fa()),0<a.length&&(ut===null&&(ut={}),ut.modifiedNodeData=a),0<lt.count&&(ut===null&&(ut={}),y?ut.insertedNodeKeys=lt.Fa():ut.removedNodeKeys=lt.Fa()),lt.clear(),ot.clear(),ut},Ci.prototype.cloneDeep=function(a){return Uf(this,a,!0)};function Uf(a,y,x,E,b,z){function tt(ft,yt){rt?(ft.__gohashid===void 0&&z.push(ft),E.set(ft,yt)):(ft=bo++,E.set(ft,yt),b.set(ft,y))}if(!We(y))return y;z||(z=[]);var rt=Object.isExtensible(y);if(E||(E=new Ie),rt){var ot=E.get(y);if(ot)return ot}else for(b||(b=new Ie),ot=b.iterator;ot.next();){var lt=ot.key;if(ot.value===y&&(lt=E.get(lt)))return lt}if(Array.isArray(y)){ot=[],tt(y,ot);for(var ut=0;ut<y.length;ut++)ot.push(Uf(a,y[ut],!1,E,b,z))}else if(y instanceof At||y instanceof ln||y instanceof Be||y instanceof ir||y instanceof In)ot=y.copy(),tt(y,ot);else{if(y instanceof mo||y instanceof Ye||y instanceof He)return y;if(y instanceof fn)ot=new fn().addAll(Uf(a,y.Fa(),!1,E,b,z)),tt(y,ot);else if(y instanceof pn)ot=new pn().addAll(Uf(a,y.Fa(),!1,E,b,z)),tt(y,ot);else if(y instanceof Ie)ot=new Ie().addAll(Uf(a,y.Fa(),!1,E,b,z)),tt(y,ot);else if(y instanceof Date)ot=new Date(y.getTime()),tt(y,ot);else if(y instanceof RegExp)ot=new RegExp(y),tt(y,ot),ot.lastIndex=y.lastIndex;else if(typeof y.copy=="function")ot=y.copy(),tt(y,ot);else for(ut in ot={},tt(y,ot),y)ut!=="__gohashid"&&(ot[ut]=Uf(a,y[ut],!1,E,b,z))}return x&&z.forEach(function(ft){delete ft.__gohashid}),ot}wt=Ci.prototype,wt.quote=function(a){return JSON.stringify(a).replace(/[\u007F-\uFFFF]/g,function(y){return"\\u"+("0000"+y.charCodeAt(0).toString(16)).substr(-4)})},wt.rm=function(){var a="";return this.name!==""&&(a+=`,
"name": `+this.quote(this.name)),this.dataFormat!==""&&(a+=`,
"dataFormat": `+this.quote(this.dataFormat)),this.isReadOnly&&(a+=`,
"isReadOnly": `+this.isReadOnly),this.nodeKeyProperty!=="key"&&typeof this.nodeKeyProperty=="string"&&(a+=`,
"nodeKeyProperty": `+this.quote(this.nodeKeyProperty)),this.copiesArrays&&(a+=`,
"copiesArrays": true`),this.copiesArrayObjects&&(a+=`,
"copiesArrayObjects": true`),this.copiesKey||(a+=`,
"copiesKey": false`),this.nodeCategoryProperty!=="category"&&typeof this.nodeCategoryProperty=="string"&&(a+=`,
"nodeCategoryProperty": `+this.quote(this.nodeCategoryProperty)),a},wt.gp=function(a){a.name&&(this.name=a.name),a.dataFormat&&(this.dataFormat=a.dataFormat),a.isReadOnly&&(this.isReadOnly=!0),a.nodeKeyProperty&&(this.nodeKeyProperty=a.nodeKeyProperty),a.copiesArrays&&(this.copiesArrays=!0),a.copiesArrayObjects&&(this.copiesArrayObjects=!0),a.copiesKey===!1&&(this.copiesKey=!1),a.nodeCategoryProperty&&(this.nodeCategoryProperty=a.nodeCategoryProperty)};function SS(a,y){y=y.modelData,We(y)&&(a.dm(y),a.modelData=y)}wt.Rv=function(){var a=this.modelData,y=!1,x;for(x in a)if(!wS(x,a[x])){y=!0;break}return a="",y&&(a=`,
"modelData": `+uy(this,this.modelData)),a+`,
"nodeDataArray": `+Sd(this,this.nodeDataArray,!0)},wt.kv=function(a){SS(this,a),a=a.nodeDataArray,je(a)&&(this.dm(a),this.nodeDataArray=a)};function xS(a,y){function x(b,z){if((z=z.part)&&(z=z.data,b!==z)){var tt=E.get(b);tt===null?(tt=new pn,tt.add(z),E.add(b,tt)):tt.add(z)}}var E=a.vh;E===null&&(E=new Ie,y.changes.each(function(b){if(b.diagram!==null){var z=b.change;z===Ir?(b=b.object.panel)&&(z=b.data)&&x(z,b):(z===fo||z===Mo)&&(b=b.object,(z=b.itemArray)&&x(z,b))}}),a.vh=E)}function PS(a,y){for(var x=new pn,E=0;E<a.nodeDataArray.length;E++){var b=a.nodeDataArray[E];h0(a,y,b,b,x)}return x}function h0(a,y,x,E,b){if(Array.isArray(x))for(var z=0;z<x.length;z++){var tt=x[z];if(tt===y)return b.add(E),!0;if(h0(a,y,tt,E,b))return!0}else if(We(x)&&Object.getPrototypeOf(x)===Object.prototype)for(z in x){if(tt=x[z],tt===y)return b.add(E),!0;if(h0(a,y,tt,E,b))return!0}return!1}wt.Pv=function(a,y){var x=this,E=!1,b=new pn,z=new pn,tt=new pn,rt=this.vh;a.changes.each(function(ut){ut.model===x&&(ut.modelChange==="nodeDataArray"?ut.change===fo?b.add(ut.newValue):ut.change===Mo&&tt.add(ut.oldValue):x.lb(ut.object)?z.add(ut.object):ut.change!==Ir||x.modelData!==ut.object&&ut.propertyName!=="modelData"?ut.object!==null&&(rt&&rt.contains(ut.object)?rt.get(ut.object).each(function(ft){x.lb(ft)&&z.add(ft)}):ut.object instanceof Ci||x.ri()&&x.Jc(ut.object)||PS(x,ut.object).each(function(ft){z.add(ft)})):E=!0)});var ot=this.il;ot.clear(),b.each(function(ut){ot.add(x.wa(ut)),y||z.add(ut)});var lt=this.kl;return lt.clear(),tt.each(function(ut){lt.add(x.wa(ut)),y&&z.add(ut)}),a="",E&&(a+=`,
"modelData": `+uy(this,this.modelData)),0<ot.count&&(a+=(y?this.Yv:this.Wv)+Sd(this,ot.Fa(),!0)),0<z.count&&(a+=this.jy+Sd(this,z.Fa(),!0)),0<lt.count&&(a+=(y?this.Wv:this.Yv)+Sd(this,lt.Fa(),!0)),lt.clear(),ot.clear(),a},wt.fp=function(a){(a.name!==void 0&&a.name!==this.name||a.dataFormat!==void 0&&a.dataFormat!==this.dataFormat||a.isReadOnly!==void 0&&a.isReadOnly!==this.isReadOnly||a.nodeKeyProperty!==void 0&&a.nodeKeyProperty!==this.nodeKeyProperty||a.copiesArrays!==void 0&&a.copiesArrays!==this.copiesArrays||a.copiesArrayObjects!==void 0&&a.copiesArrayObjects!==this.copiesArrayObjects||a.copiesKey!==void 0&&a.copiesKey!==this.copiesKey||a.nodeCategoryProperty!==void 0&&a.nodeCategoryProperty!==this.nodeCategoryProperty)&&$t("applyIncrementalJson cannot change Model properties"),SS(this,a);var y=a.insertedNodeKeys,x=a.modifiedNodeData,E=new Ie;if(Array.isArray(x))for(var b=0;b<x.length;b++){var z=x[b],tt=this.wa(z);tt!=null&&E.set(tt,z)}if(Array.isArray(y))for(b=y.length,z=0;z<b;z++){tt=y[z];var rt=this.hc(tt);rt===null&&(rt=(rt=E.get(tt))?rt:this.copyNodeData({}),this.km(rt,tt),this.xf(rt))}if(Array.isArray(x)){for(y=x.length,E=0;E<y;E++)if(b=x[E],z=this.wa(b),z=this.hc(z),z!==null){for(var ot in b)ot==="__gohashid"||ot===this.nodeKeyProperty||this.Wj()&&ot===this.nodeIsGroupProperty||this.setDataProperty(z,ot,b[ot]);this.lm(b,z)}}if(a=a.removedNodeKeys,Array.isArray(a))for(x=a.length,ot=0;ot<x;ot++)y=this.hc(a[ot]),y!==null&&this.cm(y)},wt.$x=function(a,y){a.change!==ho&&$t("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+a.toString());var x=a.object;return a.isTransactionFinished&&x instanceof dr?(y===void 0&&(y=yp(this,this)),xS(this,x),a=this.Pv(x,a.propertyName==="FinishedUndo"),this.vh=null,y==="2"?'{ "incremental": 2'+a+"}":'{ "class": '+this.quote(y)+', "incremental": 1'+this.rm()+a+"}"):'{ "incremental": 0 }'},wt.yA=function(a,y){return this.$x(a,y)},wt.np=function(a){return a===void 0&&(a=yp(this,this)),'{ "class": '+this.quote(a)+this.rm()+this.Rv()+"}"},wt.toJSON=function(a){return this.np(a)},wt.Zw=function(a){var y=null;if(typeof a=="string")try{y=$e.JSON.parse(a)}catch(E){}else typeof a=="object"?y=a:$t("Unable to modify a Model from: "+a);var x=y.incremental;typeof x!="number"&&$t("Unable to apply non-incremental changes to Model: "+a),x!==0&&(this.Ea("applyIncrementalJson"),this.fp(y),this.eb("applyIncrementalJson"))},wt.Ky=function(a){return this.Zw(a)},Ci.constructGraphLinksModel=function(){return new Ci},wt=Ci.prototype,wt.dm=function(a){if(je(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];if(We(E)){var b=x;E=this.dm(E),Array.isArray(a)?a[b]=E:$t("Cannot replace an object in an HTMLCollection or NodeList at "+b)}}else if(We(a)){for(y in a)if(x=a[y],We(x)&&(x=this.dm(x),a[y]=x,y==="points"&&Array.isArray(x))){for(b=x.length%2===0,E=0;E<x.length;E++)if(typeof x[E]!="number"){b=!1;break}if(b){for(b=new fn,E=0;E<x.length/2;E++)b.add(new At(x[2*E],x[2*E+1]));b.freeze(),a[y]=b}}return Bx(a)}return a},wt.sm=function(a){return a===void 0?"undefined":a===null?"null":a===!0?"true":a===!1?"false":typeof a=="string"?this.quote(a):typeof a=="number"?a===1/0?"9e9999":a===-1/0?"-9e9999":isNaN(a)?'{"class":"NaN"}':a.toString():a instanceof Date?'{"class":"Date", "value":"'+a.toJSON()+'"}':a instanceof Number?this.sm(a.valueOf()):je(a)?Sd(this,a):We(a)?uy(this,a):typeof a=="function"?"null":a.toString()};function Sd(a,y,x){x===void 0&&(x=!1);var E=y.length;if(0>=E)return"[]";var b=new Fi;b.add("["),x&&1<E&&b.add(`
`);for(var z=0;z<E;z++){var tt=y[z];tt!==void 0&&(0<z&&(b.add(","),x&&b.add(`
`)),b.add(a.sm(tt)))}return x&&1<E&&b.add(`
`),b.add("]"),b.toString()}function wS(a,y){return y===void 0||a==="__gohashid"||a[0]==="_"||typeof y=="function"}function Fs(a){return isNaN(a)?"NaN":a===1/0?"9e9999":a===-1/0?"-9e9999":a}function uy(a,y){var x=y;if(x instanceof At)y={class:"go.Point",x:Fs(x.x),y:Fs(x.y)};else if(x instanceof ln)y={class:"go.Size",width:Fs(x.width),height:Fs(x.height)};else if(x instanceof Be)y={class:"go.Rect",x:Fs(x.x),y:Fs(x.y),width:Fs(x.width),height:Fs(x.height)};else if(x instanceof ir)y={class:"go.Margin",top:Fs(x.top),right:Fs(x.right),bottom:Fs(x.bottom),left:Fs(x.left)};else if(x instanceof In)x.sb()?y={class:"go.Spot",x:Fs(x.x),y:Fs(x.y),offsetX:Fs(x.offsetX),offsetY:Fs(x.offsetY)}:y={class:"go.Spot",enum:x.toString()};else if(x instanceof mo){if(y={class:"go.Brush",type:x.type.name},x.type===Dh?y.color=x.color:(x.type===dh||x.type===Sl)&&(y.start=x.start,y.end=x.end,x.type===Sl&&(x.startRadius!==0&&(y.startRadius=Fs(x.startRadius)),isNaN(x.endRadius)||(y.endRadius=Fs(x.endRadius)))),x.colorStops!==null){var E={};for(x=x.colorStops.iterator;x.next();)E[x.key]=x.value;y.colorStops=E}}else x instanceof Ye?(y={class:"go.Geometry",type:x.type.name},x.startX!==0&&(y.startX=Fs(x.startX)),x.startY!==0&&(y.startY=Fs(x.startY)),x.endX!==0&&(y.endX=Fs(x.endX)),x.endY!==0&&(y.endY=Fs(x.endY)),x.spot1.D(eo)||(y.spot1=x.spot1),x.spot2.D(No)||(y.spot2=x.spot2),x.type===Ye.o&&(y.path=Ye.ia(x))):x instanceof He&&(y={class:"go.EnumValue",classType:yp(a,x.classType),name:x.name});E="{",x=!0;for(var b in y){var z=sa(y,b);if(!wS(b,z))if(x?x=!1:E+=",",E+=a.quote(b)+":",b==="points"&&z instanceof fn){var tt="[";for(z=z.iterator;z.next();){var rt=z.value;1<tt.length&&(tt+=","),tt+=a.sm(rt.x),tt+=",",tt+=a.sm(rt.y)}tt+="]",E+=tt}else E+=a.sm(z)}return E+"}"}function Ms(a){return typeof a=="number"?a:a==="NaN"?NaN:a==="9e9999"?1/0:a==="-9e9999"?-1/0:parseFloat(a)}function Bx(a){if(typeof a!="object")return a;var y=a.class||"";if(y==="NaN")return NaN;if(y==="Date")return new Date(a.value);if(y.indexOf("go.")!==0)return a;y=y.substr(3);var x=a;if(y==="Point")x=new At(Ms(a.x),Ms(a.y));else if(y==="Size")x=new ln(Ms(a.width),Ms(a.height));else if(y==="Rect")x=new Be(Ms(a.x),Ms(a.y),Ms(a.width),Ms(a.height));else if(y==="Margin")x=new ir(Ms(a.top),Ms(a.right),Ms(a.bottom),Ms(a.left));else if(y==="Spot")typeof a.enum=="string"?x=Ia(a.enum):x=new In(Ms(a.x),Ms(a.y),Ms(a.offsetX),Ms(a.offsetY));else if(y==="Brush"){if(x=new mo,x.type=Hn(mo,a.type),typeof a.color=="string"&&(x.color=a.color),a.start instanceof In&&(x.start=a.start),a.end instanceof In&&(x.end=a.end),typeof a.startRadius=="number"&&(x.startRadius=Ms(a.startRadius)),typeof a.endRadius=="number"&&(x.endRadius=Ms(a.endRadius)),a=a.colorStops,We(a))for(var E in a)x.addColorStop(parseFloat(E),a[E])}else y==="Geometry"?(x=null,typeof a.path=="string"?x=Ye.parse(a.path):x=new Ye,x.type=Hn(Ye,a.type),typeof a.startX=="number"&&(x.startX=Ms(a.startX)),typeof a.startY=="number"&&(x.startY=Ms(a.startY)),typeof a.endX=="number"&&(x.endX=Ms(a.endX)),typeof a.endY=="number"&&(x.endY=Ms(a.endY)),a.spot1 instanceof In&&(x.spot1=a.spot1),a.spot2 instanceof In&&(x.spot2=a.spot2)):y==="EnumValue"&&(E=a.classType,E.indexOf("go.")===0&&(E=E.substr(3)),E=dy(E),typeof E=="function"&&(x=Hn(E,a.name)));return x}wt.Pe=function(a){return this.Lt.add(a),this},wt.ik=function(a){this.Lt.remove(a)},wt.ds=function(a){this.skipsUndoManager||this.undoManager.Tu(a);for(var y=this.Lt,x=y.length,E=0;E<x;E++)y.M(E)(a)},wt.cb=function(a,y,x,E,b,z,tt){ya(this,"",a,y,x,E,b,z,tt)},wt.g=function(a,y,x,E,b){ya(this,"",Ir,a,this,y,x,E,b)},wt.Fs=function(a,y,x,E,b,z){ya(this,"",Ir,y,a,x,E,b,z)};function ya(a,y,x,E,b,z,tt,rt,ot){rt===void 0&&(rt=null),ot===void 0&&(ot=null);var lt=new bi;lt.model=a,lt.change=x,lt.modelChange=y,lt.propertyName=E,lt.object=b,lt.oldValue=z,lt.oldParam=rt,lt.newValue=tt,lt.newParam=ot,a.ds(lt)}Ci.prototype.changeState=function(a,y){if(a!==null&&a.model===this)if(a.change===Ir){var x=a.object,E=a.propertyName,b=a.I(y);E===this.nodeKeyProperty&&this.lb(x)&&(y=a.I(!y),y!==void 0&&this.kb.remove(y),b!==void 0&&this.kb.add(b,x)),Ho(x,E,b)}else a.change===fo?(x=a.newParam,a.modelChange==="nodeDataArray"?(a=a.newValue,We(a)&&typeof x=="number"&&(E=this.wa(a),y?(this.Tc[x]===a&&Mi(this.Tc,x),E!==void 0&&this.kb.remove(E)):(this.Tc[x]!==a&&ci(this.Tc,x,a),E!==void 0&&this.kb.add(E,a)))):a.modelChange===""?((E=a.object)&&!je(E)&&a.propertyName&&(E=sa(a.object,a.propertyName)),je(E)&&typeof x=="number"&&(a=a.newValue,y?Mi(E,x):ci(E,x,a))):$t("unknown ChangedEvent.Insert modelChange: "+a.toString())):a.change===Mo?(x=a.oldParam,a.modelChange==="nodeDataArray"?(a=a.oldValue,We(a)&&typeof x=="number"&&(E=this.wa(a),y?(this.Tc[x]!==a&&ci(this.Tc,x,a),E!==void 0&&this.kb.add(E,a)):(this.Tc[x]===a&&Mi(this.Tc,x),E!==void 0&&this.kb.remove(E)))):a.modelChange===""?((E=a.object)&&!je(E)&&a.propertyName&&(E=sa(a.object,a.propertyName)),je(E)&&typeof x=="number"&&(a=a.oldValue,y?ci(E,x,a):Mi(E,x))):$t("unknown ChangedEvent.Remove modelChange: "+a.toString())):a.change!==ho&&$t("unknown ChangedEvent: "+a.toString())},Ci.prototype.Ea=function(a){return this.undoManager.Ea(a)},Ci.prototype.eb=function(a){return this.undoManager.eb(a)},Ci.prototype.Kf=function(){return this.undoManager.Kf()},Ci.prototype.commit=function(a,y){y===void 0&&(y="");var x=this.skipsUndoManager;y===null&&(this.skipsUndoManager=!0,y=""),this.undoManager.Ea(y);var E=!1;try{a(this),E=!0}finally{E?this.undoManager.eb(y):this.undoManager.Kf(),this.skipsUndoManager=x}},wt=Ci.prototype,wt.La=function(a,y){y===void 0&&(y=""),ya(this,"SourceChanged",ho,y,a,null,null)},wt.wa=function(a){if(a!==null){var y=this.Th;if(y!==""&&(y=sa(a,y),y!==void 0)){if(xd(y))return y;$t("Key value for node data "+a+" is not a number or a string: "+y)}}},wt.km=function(a,y){if(a!==null){var x=this.Th;if(x!=="")if(this.lb(a)){var E=sa(a,x);E!==y&&this.hc(y)===null&&(Ho(a,x,y),E!==void 0&&this.kb.remove(E),this.kb.add(y,a),ya(this,"nodeKey",Ir,x,a,E,y),typeof x=="string"&&this.La(a,x),this.jp(E,y))}else Ho(a,x,y)}};function xd(a){return typeof a=="number"||typeof a=="string"}wt.lb=function(a){var y=this.wa(a);return y===void 0?!1:this.kb.I(y)===a},wt.hc=function(a){return a===null&&$t("Model.findNodeDataForKey:key must not be null"),a!==void 0&&xd(a)?this.kb.I(a):null},wt.$u=function(a){if(a!==null){var y=this.Th;if(y!==""){var x=this.wa(a);if(x===void 0||this.kb.contains(x)){var E=this.bl;if(E!==null&&(x=E(this,a),x!=null&&!this.kb.contains(x))){Ho(a,y,x);return}if(typeof x=="string"){for(E=2;this.kb.contains(x+E);)E++;Ho(a,y,x+E)}else if(x===void 0||typeof x=="number"){for(x=-this.kb.count-1;this.kb.contains(x);)x--;Ho(a,y,x)}}}}},wt.xf=function(a){a!==null&&($i(a),this.lb(a)||CS(this,a,!0))};function CS(a,y,x){var E=a.wa(y);(E===void 0||a.kb.I(E)!==y)&&(a.$u(y),E=a.wa(y),E===void 0&&$t("Model.makeNodeDataKeyUnique failed on "+y+". Data not added to Model."),a.kb.add(E,y),E=null,x&&(E=a.Tc.length,ci(a.Tc,E,y)),ya(a,"nodeDataArray",fo,"nodeDataArray",a,null,y,null,E),a.fm(y),a.em(y))}wt.Fy=function(a){if(je(a))for(var y=a.length,x=0;x<y;x++)this.xf(a[x]);else for(a=a.iterator;a.next();)this.xf(a.value)},wt.cm=function(a){a!==null&&ES(this,a,!0)};function ES(a,y,x){var E=a.wa(y);if(E!==void 0&&a.kb.remove(E),E=null,x){t:if(x=a.Tc,Array.isArray(x))E=x.indexOf(y);else{E=x.length;for(var b=0;b<E;b++)if(x[b]===y){E=b;break t}E=-1}if(0>E)return;Mi(a.Tc,E)}ya(a,"nodeDataArray",Mo,"nodeDataArray",a,y,null,E,null),a.qp(y)}wt.nA=function(a){if(je(a))for(var y=a.length,x=0;x<y;x++)this.cm(a[x]);else for(a=a.iterator;a.next();)this.cm(a.value)},wt.$z=function(a){if(a!==this.nodeDataArray&&je(a)){var y=this.kl;y.clear(),y.addAll(this.kb.iteratorKeys);var x=this.il;x.clear();for(var E=a.length,b=0;b<E;b++){var z=a[b],tt=this.wa(z);if(tt!==void 0){x.add(tt);var rt=this.hc(tt);rt!==z&&(rt!==null?(this.Do(rt,z),this.lm(z,rt)):(z=this.cloneDeep(z),this.km(z,tt),this.xf(z)))}else tt=this.cloneDeep(z),this.xf(tt),x.add(this.wa(tt))}for(a=y.iterator;a.next();)E=a.value,x.contains(E)||(E=this.hc(E))&&this.cm(E);y.clear(),x.clear()}},wt.jp=function(a,y){y!==void 0&&(a=vp(this,a),a instanceof pn&&this.Vf.add(y,a))},wt.Lv=function(){},wt.fm=function(){},wt.em=function(){},wt.qp=function(){};function pu(a,y,x){if(y!==void 0){var E=a.Vf.I(y);E===null&&(E=new pn,a.Vf.add(y,E)),E.add(x)}}function mu(a,y,x){if(y!==void 0){var E=a.Vf.I(y);E instanceof pn&&(x==null?a.Vf.remove(y):(E.remove(x),E.count===0&&a.Vf.remove(y)))}}function vp(a,y){return y===void 0?null:(a=a.Vf.I(y),a instanceof pn?a:null)}wt.Qy=function(a){a===void 0?this.Vf.clear():this.Vf.remove(a)},Ci.prototype.copyNodeData=function(a){if(a===null)return null;var y=this.Bk;return a=y!==null?y(a,this):d0(this,a,!0),We(a)&&Di(a),a};function d0(a,y,x){if(a.copiesArrays&&Array.isArray(y)){var E=[];for(x=0;x<y.length;x++){var b=d0(a,y[x],a.copiesArrayObjects);E.push(b)}return Di(E),E}if(x&&We(y)){x=(x=y.constructor)?new x:{},b=a.copiesKey||typeof a.nodeKeyProperty!="string"?null:a.nodeKeyProperty;for(E in y)if(E==="__gohashid")x.__gohashid=void 0;else if(E===b)x[b]=void 0;else{var z=sa(y,E),tt=yp(a,z);tt==="GraphObject"||tt==="Diagram"||tt==="Layer"||tt==="RowColumnDefinition"||tt==="AnimationManager"||tt==="Tool"||tt==="CommandHandler"||tt==="Layout"||tt==="InputEvent"||tt==="DiagramEvent"||z instanceof Ci||z instanceof po||z instanceof dr||z instanceof bi||(z=d0(a,z,!1)),Ho(x,E,z)}return Di(x),x}return y instanceof At||y instanceof ln||y instanceof Be||y instanceof In||y instanceof ir?y.copy():y}Ci.prototype.setDataProperty=function(a,y,x){if(this.lb(a)){if(y===this.nodeKeyProperty){this.km(a,x);return}if(y===this.nodeCategoryProperty){this.jm(a,x);return}}else!LS&&a instanceof de&&(LS=!0,ri('Model.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),ri(" Is that really your intent?"));var E=sa(a,y);E!==x&&(Ho(a,y,x),this.Fs(a,y,E,x))},wt=Ci.prototype,wt.set=function(a,y,x){this.setDataProperty(a,y,x)},wt.Do=function(a,y){if(y){var x=this.lb(a),E;for(E in y)E==="__gohashid"||x&&E===this.nodeKeyProperty||this.setDataProperty(a,E,y[E])}},wt.Ay=function(a,y){this.ts(a,-1,y)},wt.ts=function(a,y,x){0>y&&(y=a.length),ci(a,y,x),ya(this,"",fo,"",a,null,x,null,y)},wt.ov=function(a,y){y===void 0&&(y=-1),a===this.Tc&&$t("Model.removeArrayItem should not be called on the Model.nodeDataArray"),y===-1&&(y=a.length-1);var x=a[y];Mi(a,y),ya(this,"",Mo,"",a,x,null,y,null)},wt.Ro=function(a){if(a===null)return"";var y=this.lj;if(y===""||(y=sa(a,y),y===void 0))return"";if(typeof y=="string")return y;$t("getCategoryForNodeData found a non-string category for "+a+": "+y)},wt.jm=function(a,y){if(a!==null){var x=this.lj;if(x!=="")if(this.lb(a)){var E=sa(a,x);E===void 0&&(E=""),E!==y&&(Ho(a,x,y),ya(this,"nodeCategory",Ir,x,a,E,y))}else Ho(a,x,y)}},wt.lm=function(a,y){this.jm(y,this.Ro(a))},wt.Tl=function(){return!1},wt.Wj=function(){return!1},wt.ri=function(){return!1},wt.xs=function(){return!1},wt.Xj=function(){return!1};function hy(){return new Ci}function yp(a,y){if(typeof y=="function"){if(y.className)return y.className;if(y.name)return y.name}else if(typeof y=="object"&&y!==null&&y.constructor)return yp(a,y.constructor);return typeof y}function dy(a){return $l[a]?$l[a]:$e.go!==void 0&&$e.go[a]?$e.go[a]:null}function sa(a,y){if(!a||!y)return null;try{if(typeof y=="function")var x=y(a);else typeof a.getAttribute=="function"?(x=a.getAttribute(y),x===null&&(x=void 0)):x=a[y]}catch(E){}return x}function Ho(a,y,x){if(a&&y)try{typeof y=="function"?y(a,x):typeof a.setAttribute=="function"?a.setAttribute(y,x):a[y]=x}catch(E){}}ve.Object.defineProperties(Ci.prototype,{name:{get:function(){return this.xa},set:function(a){var y=this.xa;y!==a&&(this.xa=a,this.g("name",y,a))}},dataFormat:{get:function(){return this.Sm},set:function(a){var y=this.Sm;y!==a&&(this.Sm=a,this.g("dataFormat",y,a))}},isReadOnly:{get:function(){return this.Gg},set:function(a){var y=this.Gg;y!==a&&(this.Gg=a,this.g("isReadOnly",y,a))}},modelData:{get:function(){return this.j},set:function(a){var y=this.j;y!==a&&(this.j=a,this.g("modelData",y,a),this.La(a))}},undoManager:{get:function(){return this.o},set:function(a){var y=this.o;y!==a&&(y!==null&&y.Rx(this),this.o=a,a!==null&&a.Xw(this))}},skipsUndoManager:{get:function(){return this.Wg},set:function(a){this.Wg=a}},nodeKeyProperty:{get:function(){return this.Th},set:function(a){var y=this.Th;y!==a&&(a===""&&$t("Model.nodeKeyProperty may not be the empty string"),0<this.kb.count&&$t("Cannot set Model.nodeKeyProperty when there is existing node data"),this.Th=a,this.g("nodeKeyProperty",y,a))}},makeUniqueKeyFunction:{get:function(){return this.bl},set:function(a){var y=this.bl;y!==a&&(this.bl=a,this.g("makeUniqueKeyFunction",y,a))}},nodeDataArray:{get:function(){return this.Tc},set:function(a){var y=this.Tc;if(y!==a){this.kb.clear(),this.Lv();for(var x=a.length,E=0;E<x;E++){var b=a[E];We(b)||$t("Model.nodeDataArray must only contain Objects, not: "+b),$i(b)}for(this.Tc=a,E=new fn,b=0;b<x;b++){var z=a[b],tt=this.wa(z);tt===void 0||this.kb.I(tt)!==null?E.add(z):this.kb.add(tt,z)}for(E=E.iterator;E.next();)b=E.value,this.$u(b),z=this.wa(b),z!==void 0&&this.kb.add(z,b);for(ya(this,"nodeDataArray",Ir,"nodeDataArray",this,y,a),y=0;y<x;y++)E=a[y],this.fm(E),this.em(E);Array.isArray(a)||(this.isReadOnly=!0)}}},copyNodeDataFunction:{get:function(){return this.Bk},set:function(a){var y=this.Bk;y!==a&&(this.Bk=a,this.g("copyNodeDataFunction",y,a))}},copiesArrays:{get:function(){return this.Km},set:function(a){var y=this.Km;y!==a&&(this.Km=a,this.g("copiesArrays",y,a))}},copiesArrayObjects:{get:function(){return this.Jm},set:function(a){var y=this.Jm;y!==a&&(this.Jm=a,this.g("copiesArrayObjects",y,a))}},copiesKey:{get:function(){return this.Mm},set:function(a){var y=this.Mm;y!==a&&(this.Mm=a,this.g("copiesKey",y,a))}},afterCopyFunction:{get:function(){return this.xm},set:function(a){var y=this.xm;y!==a&&(this.xm=a,this.g("afterCopyFunction",y,a))}},nodeCategoryProperty:{get:function(){return this.lj},set:function(a){var y=this.lj;y!==a&&(this.lj=a,this.g("nodeCategoryProperty",y,a))}},type:{get:function(){return"Model"}}}),Ci.prototype.setCategoryForNodeData=Ci.prototype.jm,Ci.prototype.getCategoryForNodeData=Ci.prototype.Ro,Ci.prototype.removeArrayItem=Ci.prototype.ov,Ci.prototype.insertArrayItem=Ci.prototype.ts,Ci.prototype.addArrayItem=Ci.prototype.Ay,Ci.prototype.assignAllDataProperties=Ci.prototype.Do,Ci.prototype.set=Ci.prototype.set,Ci.prototype.clearUnresolvedReferences=Ci.prototype.Qy,Ci.prototype.mergeNodeDataArray=Ci.prototype.$z,Ci.prototype.removeNodeDataCollection=Ci.prototype.nA,Ci.prototype.removeNodeData=Ci.prototype.cm,Ci.prototype.addNodeDataCollection=Ci.prototype.Fy,Ci.prototype.addNodeData=Ci.prototype.xf,Ci.prototype.makeNodeDataKeyUnique=Ci.prototype.$u,Ci.prototype.findNodeDataForKey=Ci.prototype.hc,Ci.prototype.containsNodeData=Ci.prototype.lb,Ci.prototype.setKeyForNodeData=Ci.prototype.km,Ci.prototype.getKeyForNodeData=Ci.prototype.wa,Ci.prototype.updateTargetBindings=Ci.prototype.La,Ci.prototype.commit=Ci.prototype.commit,Ci.prototype.rollbackTransaction=Ci.prototype.Kf,Ci.prototype.commitTransaction=Ci.prototype.eb,Ci.prototype.startTransaction=Ci.prototype.Ea,Ci.prototype.raiseDataChanged=Ci.prototype.Fs,Ci.prototype.raiseChanged=Ci.prototype.g,Ci.prototype.raiseChangedEvent=Ci.prototype.cb,Ci.prototype.removeChangedListener=Ci.prototype.ik,Ci.prototype.addChangedListener=Ci.prototype.Pe,Ci.prototype.writeJsonValue=Ci.prototype.sm,Ci.prototype.replaceJsonObjects=Ci.prototype.dm,Ci.prototype.applyIncrementalJSON=Ci.prototype.Ky,Ci.prototype.applyIncrementalJson=Ci.prototype.Zw,Ci.prototype.toJSON=Ci.prototype.toJSON,Ci.prototype.toJson=Ci.prototype.np,Ci.prototype.toIncrementalJSON=Ci.prototype.yA,Ci.prototype.toIncrementalJson=Ci.prototype.$x,Ci.prototype.toIncrementalData=Ci.prototype.xA,Ci.prototype.clear=Ci.prototype.clear;var LS=!1,$l={};Ci.className="Model",Ci.fromJSON=Ci.fromJson=function(a,y){y===void 0&&(y=null);var x=null;if(typeof a=="string")try{x=$e.JSON.parse(a)}catch(z){}else typeof a=="object"?x=a:$t("Unable to construct a Model from: "+a);if(y===null){a=null;var E=x.class;if(typeof E=="string")try{var b=null;E.indexOf("go.")===0?(E=E.substr(3),b=dy(E)):(b=dy(E),b===null&&(b=$e[E])),typeof b=="function"&&(a=new b)}catch(z){}a===null||a instanceof Ci?y=a:$t("Unable to construct a Model of declared class: "+x.class)}return y===null&&(y=Ci.constructGraphLinksModel()),y.gp(x),y.kv(x),y},Ci.safePropertyValue=sa,Ci.safePropertySet=Ho,$l.Brush=mo,$l.ChangedEvent=bi,$l.Geometry=Ye,$l.Margin=ir,$l.Panel=En,$l.Point=At,$l.Rect=Be,$l.Size=ln,$l.Spot=In,$l.Transaction=dr,$l.UndoManager=po;function ua(a,y,x,E){Di(this),this._isFrozen=!1,a===void 0&&(a=""),y===void 0&&(y=a),x===void 0&&(x=null),this.j=-1,this.xd=null,this.xl=a,this.wl=this.to=0,this.Cr=null,this.wn=!1,this.sl=y,this.Im=x,E===void 0?(this.el=MS,this.wk=null):(this.el=Sp,this.wk=E),this.st=new pn}ua.prototype.copy=function(){var a=new ua;return a.xl=this.xl,a.to=this.to,a.wl=this.wl,a.Cr=this.Cr,a.wn=this.wn,a.sl=this.sl,a.Im=this.Im,a.el=this.el,a.wk=this.wk,a},wt=ua.prototype,wt.qb=function(a){a.classType===ua&&(this.mode=a)},wt.toString=function(){return"Binding("+this.targetProperty+":"+this.sourceProperty+(this.Ai!==-1?" "+this.Ai:"")+" "+this.mode.name+")"},wt.freeze=function(){return this._isFrozen=!0,this},wt.ka=function(){return this._isFrozen=!1,this},wt.Kx=function(a){return a===void 0&&(a=null),this.mode=Sp,this.backConverter=a,this},wt.cp=function(a){return a===void 0&&(a=""),this.sourceName=a,this.isToModel=!1,this},wt.dA=function(){return this.sourceName=null,this.isToModel=!0,this};function FS(a,y,x){return a=a.sourceName,a===null||a===""?y:a==="/"?x.part:a==="."?x:a===".."?x.panel:y.fb(a)}wt.Mv=function(a,y,x){var E=this.sl;if(x===void 0||E===""||E===x){x=this.xl;var b=this.Im;if(b===null&&x==="")ri("Binding error: target property is the empty string: "+this.toString());else{var z=y;if(E!==""&&(z=sa(y,E)),z!==void 0)if(b===null)x!==""&&Ho(a,x,z);else try{if(x!==""){var tt=b(z,a);Ho(a,x,tt)}else b(z,a)}catch(rt){}}}},wt.sp=function(a,y,x,E){if(this.el===Sp){var b=this.xl;if(x===void 0||b===x){x=this.sl;var z=this.wk,tt=a;if(b!==""&&(tt=sa(a,b)),tt!==void 0&&!this.st.contains(a))try{this.st.add(a);var rt=E!==null?E.diagram:null,ot=rt!==null?rt.model:null;if(z===null){if(x!=="")ot!==null?ot.setDataProperty(y,x,tt):Ho(y,x,tt);else if(ot!==null&&E!==null&&0<=E.itemIndex&&E.panel!==null&&Array.isArray(E.panel.itemArray)){var lt=E.itemIndex,ut=E.panel.itemArray;ot.ov(ut,lt),ot.ts(ut,lt,tt)}}else try{if(x!==""){var ft=z(tt,y,ot);ot!==null?ot.setDataProperty(y,x,ft):Ho(y,x,ft)}else{var yt=z(tt,y,ot);if(yt!==void 0&&ot!==null&&E!==null&&0<=E.itemIndex&&E.panel!==null&&Array.isArray(E.panel.itemArray)){var xt=E.itemIndex,Ct=E.panel.itemArray;ot.ov(Ct,xt),ot.ts(Ct,xt,yt)}}}catch(bt){}}finally{this.st.remove(a)}}}},ve.Object.defineProperties(ua.prototype,{Ai:{get:function(){return this.j},set:function(a){this._isFrozen&&Ze(this),this.j=a}},targetProperty:{get:function(){return this.xl},set:function(a){this._isFrozen&&Ze(this),this.xl=a}},sourceName:{get:function(){return this.Cr},set:function(a){this._isFrozen&&Ze(this),this.Cr=a,a!==null&&(this.wn=!1)}},isToModel:{get:function(){return this.wn},set:function(a){this._isFrozen&&Ze(this),this.wn=a}},sourceProperty:{get:function(){return this.sl},set:function(a){this._isFrozen&&Ze(this),this.sl=a}},converter:{get:function(){return this.Im},set:function(a){this._isFrozen&&Ze(this),this.Im=a}},backConverter:{get:function(){return this.wk},set:function(a){this._isFrozen&&Ze(this),this.wk=a}},mode:{get:function(){return this.el},set:function(a){this._isFrozen&&Ze(this),this.el=a}}}),ua.prototype.updateSource=ua.prototype.sp,ua.prototype.updateTarget=ua.prototype.Mv,ua.prototype.ofModel=ua.prototype.dA,ua.prototype.ofObject=ua.prototype.cp,ua.prototype.makeTwoWay=ua.prototype.Kx;var Ax="Binding",MS=new He(ua,"OneWay",1),Sp=new He(ua,"TwoWay",2);ua.className="Binding",ua.parseEnum=function(a,y){return function(x){return x=Hn(a,x),x===null?y:x}},ua.toString=Bi,ua.OneWay=MS,ua.TwoWay=Sp;function zr(a,y,x){Ci.call(this),this.Vv=`,
"insertedLinkKeys": `,this.iy=`,
"modifiedLinkData": `,this.Xv=`,
"removedLinkKeys": `,this.md=[],this.$f=new pn,this.wb=new Ie,this.Jh="",this.Ri=this.Ak=this.cl=null,this.lf="from",this.mf="to",this.fj=this.ej="",this.dj="category",this.je="",this.jl="isGroup",this.Je="group",this.Lm=!1,y!==void 0&&(this.linkDataArray=y),a!==void 0&&(je(a)?this.nodeDataArray=a:x=a),x&&(Object.assign(this,x),a=x.Changed)&&(delete this.Changed,this.Pe(a))}Se(zr,Ci),zr.constructGraphLinksModel=Ci.constructGraphLinksModel,zr.prototype.cloneProtected=function(a){Ci.prototype.cloneProtected.call(this,a),a.Jh=this.Jh,a.cl=this.cl,a.Ak=this.Ak,a.lf=this.lf,a.mf=this.mf,a.ej=this.ej,a.fj=this.fj,a.dj=this.dj,a.je=this.je,a.jl=this.jl,a.Je=this.Je,a.Lm=this.Lm},wt=zr.prototype,wt.clear=function(){Ci.prototype.clear.call(this),this.md=[],this.wb.clear(),this.$f.clear()},wt.toString=function(a){if(a===void 0&&(a=0),2<=a)return this.np();var y=(this.name!==""?this.name:"")+" GraphLinksModel";if(0<a){y+=`
node data:`,a=this.nodeDataArray;var x=a.length,E;for(E=0;E<x;E++){var b=a[E];y+=" "+this.wa(b)+":"+Bi(b)}for(y+=`
link data:`,a=this.linkDataArray,x=a.length,E=0;E<x;E++)b=a[E],y+=" "+hl(this,b,!0)+"-->"+hl(this,b,!1)}return y},wt.Qv=function(a,y){this.linkKeyProperty===""&&$t("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalData() to succeed.");var x=Ci.prototype.Qv.call(this,a,y),E=this,b=new pn,z=new pn,tt=new pn,rt=this.vh;a.changes.each(function(ut){ut.model===E&&(ut.modelChange==="linkDataArray"?ut.change===fo?b.add(ut.newValue):ut.change===Mo&&tt.add(ut.oldValue):E.Jc(ut.object)?z.add(ut.object):ut.object!==null&&(ut.object!==null&&rt&&rt.contains(ut.object)?rt.get(ut.object).each(function(ft){E.Jc(ft)&&z.add(ft)}):ut.object instanceof Ci||E.lb(ut.object)||kS(E,ut.object).each(function(ft){z.add(ft)})))});var ot=this.il;ot.clear(),b.each(function(ut){ot.add(E.Ac(ut)),y||z.add(ut)});var lt=this.kl;return lt.clear(),tt.each(function(ut){lt.add(E.Ac(ut)),y&&z.add(ut)}),a=E.cloneDeep(z.Fa()),0<ot.count&&(x===null&&(x={}),y?x.removedLinkKeys=ot.Fa():x.insertedLinkKeys=ot.Fa()),0<a.length&&(x===null&&(x={}),x.modifiedLinkData=a),0<lt.count&&(x===null&&(x={}),y?x.insertedLinkKeys=lt.Fa():x.removedLinkKeys=lt.Fa()),lt.clear(),ot.clear(),x},wt.rm=function(){var a=Ci.prototype.rm.call(this),y="";return this.linkCategoryProperty!=="category"&&typeof this.linkCategoryProperty=="string"&&(y+=`,
"linkCategoryProperty": `+this.quote(this.linkCategoryProperty)),this.linkKeyProperty!==""&&typeof this.linkKeyProperty=="string"&&(y+=`,
"linkKeyProperty": `+this.quote(this.linkKeyProperty)),this.linkFromKeyProperty!=="from"&&typeof this.linkFromKeyProperty=="string"&&(y+=`,
"linkFromKeyProperty": `+this.quote(this.linkFromKeyProperty)),this.linkToKeyProperty!=="to"&&typeof this.linkToKeyProperty=="string"&&(y+=`,
"linkToKeyProperty": `+this.quote(this.linkToKeyProperty)),this.linkFromPortIdProperty!==""&&typeof this.linkFromPortIdProperty=="string"&&(y+=`,
"linkFromPortIdProperty": `+this.quote(this.linkFromPortIdProperty)),this.linkToPortIdProperty!==""&&typeof this.linkToPortIdProperty=="string"&&(y+=`,
"linkToPortIdProperty": `+this.quote(this.linkToPortIdProperty)),this.linkLabelKeysProperty!==""&&typeof this.linkLabelKeysProperty=="string"&&(y+=`,
"linkLabelKeysProperty": `+this.quote(this.linkLabelKeysProperty)),this.nodeIsGroupProperty!=="isGroup"&&typeof this.nodeIsGroupProperty=="string"&&(y+=`,
"nodeIsGroupProperty": `+this.quote(this.nodeIsGroupProperty)),this.nodeGroupKeyProperty!=="group"&&typeof this.nodeGroupKeyProperty=="string"&&(y+=`,
"nodeGroupKeyProperty": `+this.quote(this.nodeGroupKeyProperty)),a+y},wt.gp=function(a){Ci.prototype.gp.call(this,a),a.linkKeyProperty&&(this.linkKeyProperty=a.linkKeyProperty),a.linkFromKeyProperty&&(this.linkFromKeyProperty=a.linkFromKeyProperty),a.linkToKeyProperty&&(this.linkToKeyProperty=a.linkToKeyProperty),a.linkFromPortIdProperty&&(this.linkFromPortIdProperty=a.linkFromPortIdProperty),a.linkToPortIdProperty&&(this.linkToPortIdProperty=a.linkToPortIdProperty),a.linkCategoryProperty&&(this.linkCategoryProperty=a.linkCategoryProperty),a.linkLabelKeysProperty&&(this.linkLabelKeysProperty=a.linkLabelKeysProperty),a.nodeIsGroupProperty&&(this.nodeIsGroupProperty=a.nodeIsGroupProperty),a.nodeGroupKeyProperty&&(this.nodeGroupKeyProperty=a.nodeGroupKeyProperty)},wt.Rv=function(){var a=Ci.prototype.Rv.call(this),y=`,
"linkDataArray": `+Sd(this,this.linkDataArray,!0);return a+y},wt.kv=function(a){Ci.prototype.kv.call(this,a),a=a.linkDataArray,Array.isArray(a)&&(this.dm(a),this.linkDataArray=a)};function kS(a,y){for(var x=new pn,E=0;E<a.linkDataArray.length;E++){var b=a.linkDataArray[E];h0(a,y,b,b,x)}return x}wt.Pv=function(a,y){this.linkKeyProperty===""&&$t("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var x=Ci.prototype.Pv.call(this,a,y),E=this,b=new pn,z=new pn,tt=new pn,rt=this.vh;a.changes.each(function(ut){ut.model===E&&(ut.modelChange==="linkDataArray"?ut.change===fo?b.add(ut.newValue):ut.change===Mo&&tt.add(ut.oldValue):E.Jc(ut.object)?z.add(ut.object):ut.object!==null&&(ut.object!==null&&rt&&rt.contains(ut.object)?rt.get(ut.object).each(function(ft){E.Jc(ft)&&z.add(ft)}):ut.object instanceof Ci||E.lb(ut.object)||kS(E,ut.object).each(function(ft){z.add(ft)})))});var ot=this.il;ot.clear(),b.each(function(ut){ot.add(E.Ac(ut)),y||z.add(ut)});var lt=this.kl;return lt.clear(),tt.each(function(ut){lt.add(E.Ac(ut)),y&&z.add(ut)}),a=x,0<ot.count&&(a+=(y?this.Xv:this.Vv)+Sd(this,ot.Fa(),!0)),0<z.count&&(a+=this.iy+Sd(this,z.Fa(),!0)),0<lt.count&&(a+=(y?this.Vv:this.Xv)+Sd(this,lt.Fa(),!0)),lt.clear(),ot.clear(),a},wt.fp=function(a){(a.linkCategoryProperty!==void 0&&a.linkCategoryProperty!==this.linkCategoryProperty||a.linkKeyProperty!==void 0&&a.linkKeyProperty!==this.linkKeyProperty||a.linkFromKeyProperty!==void 0&&a.linkFromKeyProperty!==this.linkFromKeyProperty||a.linkToKeyProperty!==void 0&&a.linkToKeyProperty!==this.linkToKeyProperty||a.linkFromPortIdProperty!==void 0&&a.linkFromPortIdProperty!==this.linkFromPortIdProperty||a.linkToPortIdProperty!==void 0&&a.linkToPortIdProperty!==this.linkToPortIdProperty||a.linkLabelKeysProperty!==void 0&&a.linkLabelKeysProperty!==this.linkLabelKeysProperty||a.nodeIsGroupProperty!==void 0&&a.nodeIsGroupProperty!==this.nodeIsGroupProperty||a.nodeGroupKeyProperty!==void 0&&a.nodeGroupKeyProperty!==this.nodeGroupKeyProperty)&&$t("applyIncrementalJson cannot change Model properties"),Ci.prototype.fp.call(this,a);var y=a.insertedLinkKeys;if(Array.isArray(y))for(var x=y.length,E=0;E<x;E++){var b=y[E],z=this.jh(b);z===null&&(z=this.Jo({}),this.Ks(z,b),this.fi(z))}if(y=a.modifiedLinkData,Array.isArray(y)){for(x=y.length,E=0;E<x;E++)if(b=y[E],z=this.Ac(b),z=this.jh(z),z!==null){for(var tt in b)tt!=="__gohashid"&&tt!==this.linkKeyProperty&&this.setDataProperty(z,tt,b[tt]);BS(this,b,z)}}if(a=a.removedLinkKeys,Array.isArray(a))for(tt=a.length,y=0;y<tt;y++)x=this.jh(a[y]),x!==null&&this.bm(x)},zr.prototype.changeState=function(a,y){if(a!==null&&a.model===this){if(a.change===Ir){var x=a.object,E=a.propertyName;if(E===this.linkKeyProperty&&this.Jc(x)){var b=a.I(y);y=a.I(!y),y!==void 0&&this.wb.remove(y),b!==void 0&&this.wb.add(b,x),Ho(x,E,b);return}}else if(a.change===fo){if(x=a.newParam,a.modelChange==="linkDataArray"){a=a.newValue,We(a)&&typeof x=="number"&&(E=this.Ac(a),y?(this.$f.remove(a),this.md[x]===a&&this.md.splice(x,1),E!==void 0&&this.wb.remove(E)):(this.$f.add(a),this.md[x]!==a&&this.md.splice(x,0,a),E!==void 0&&this.wb.add(E,a)));return}if(a.modelChange==="linkLabelKeys"){E=this.Ef(a.object),Array.isArray(E)&&typeof x=="number"&&(y?(x=E.indexOf(a.newValue),0<=x&&E.splice(x,1)):0>E.indexOf(a.newValue)&&E.splice(x,0,a.newValue));return}}else if(a.change===Mo){if(x=a.oldParam,a.modelChange==="linkDataArray"){a=a.oldValue,We(a)&&typeof x=="number"&&(E=this.Ac(a),y?(this.$f.add(a),this.md[x]!==a&&this.md.splice(x,0,a),E!==void 0&&this.wb.add(E,a)):(this.$f.remove(a),this.md[x]===a&&this.md.splice(x,1),E!==void 0&&this.wb.remove(E)));return}if(a.modelChange==="linkLabelKeys"){E=this.Ef(a.object),Array.isArray(E)&&typeof x=="number"&&(y?0>E.indexOf(a.newValue)&&E.splice(x,0,a.newValue):(x=E.indexOf(a.newValue),0<=x&&E.splice(x,1)));return}}Ci.prototype.changeState.call(this,a,y)}},wt=zr.prototype,wt.Vl=function(a){if(a!==void 0){var y=this.Ri;if(y!==null){var x=this.hc(a);x===null&&(x=this.copyNodeData(y),Ho(x,this.nodeKeyProperty,a),this.xf(x))}return a}},wt.yx=function(a){return hl(this,a,!0)},wt.wv=function(a,y){Yf(this,a,y,!0)},wt.Bx=function(a){return hl(this,a,!1)},wt.Bv=function(a,y){Yf(this,a,y,!1)};function hl(a,y,x){if(y!==null&&(a=x?a.lf:a.mf,a!==""&&(a=sa(y,a),a!==void 0))){if(xd(a))return a;$t((x?"FromKey":"ToKey")+" value for link data "+y+" is not a number or a string: "+a)}}function Yf(a,y,x,E){if(x===null&&(x=void 0),y!==null){var b=E?a.lf:a.mf;if(b!=="")if(x=a.Vl(x),a.Jc(y)){var z=sa(y,b);z!==x&&(mu(a,z,y),Ho(y,b,x),a.hc(x)===null&&pu(a,x,y),ya(a,E?"linkFromKey":"linkToKey",Ir,b,y,z,x),typeof b=="string"&&a.La(y,b))}else Ho(y,b,x)}}wt.zx=function(a){return c0(this,a,!0)},wt.xv=function(a,y){Xf(this,a,y,!0)},wt.Cx=function(a){return c0(this,a,!1)},wt.Cv=function(a,y){Xf(this,a,y,!1)};function c0(a,y,x){return y===null||(a=x?a.ej:a.fj,a==="")?"":(y=sa(y,a),y===void 0?"":y)}function Xf(a,y,x,E){if(y!==null){var b=E?a.ej:a.fj;if(b!=="")if(a.Jc(y)){var z=sa(y,b);z===void 0&&(z=""),z!==x&&(Ho(y,b,x),ya(a,E?"linkFromPortId":"linkToPortId",Ir,b,y,z,x),typeof b=="string"&&a.La(y,b))}else Ho(y,b,x)}}wt.Ef=function(a){if(a===null)return f0;var y=this.je;return y===""?f0:(a=sa(a,y),a===void 0?f0:a)},wt.Ls=function(a,y){if(a!==null){var x=this.je;if(x!=="")if(this.Jc(a)){var E=sa(a,x);if(E===void 0&&(E=f0),E!==y){if(Array.isArray(E))for(var b=E.length,z=0;z<b;z++)mu(this,E[z],a);for(Ho(a,x,y),b=y.length,z=0;z<b;z++){var tt=y[z];this.hc(tt)===null&&pu(this,tt,a)}ya(this,"linkLabelKeys",Ir,x,a,E,y),typeof x=="string"&&this.La(a,x)}}else Ho(a,x,y)}},wt.Bu=function(a,y){if(y!=null&&a!==null){var x=this.je;if(x!==""){var E=sa(a,x);if(E===void 0)x=[],x.push(y),this.Ls(a,x);else if(Array.isArray(E)){var b=E.indexOf(y);0<=b||(b=E.length,E.push(y),this.Jc(a)&&(this.hc(y)===null&&pu(this,y,a),ya(this,"linkLabelKeys",fo,x,a,null,y,null,b)))}else $t(x+" property is not an Array; cannot addLabelKeyForLinkData: "+a)}}},wt.Qx=function(a,y){if(y!=null&&a!==null){var x=this.je;if(x!==""){var E=sa(a,x);if(Array.isArray(E)){var b=E.indexOf(y);0>b||(E.splice(b,1),this.Jc(a)&&(mu(this,y,a),ya(this,"linkLabelKeys",Mo,x,a,y,null,b,null)))}else E!==void 0&&$t(x+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}},wt.Ac=function(a){if(a!==null){var y=this.Jh;if(y!==""&&(y=sa(a,y),y!==void 0)){if(xd(y))return y;$t("Key value for link data "+a+" is not a number or a string: "+y)}}},wt.Ks=function(a,y){if(a!==null){var x=this.Jh;if(x!=="")if(this.Jc(a)){var E=sa(a,x);E!==y&&this.jh(y)===null&&(Ho(a,x,y),E!==void 0&&this.wb.remove(E),this.wb.add(y,a),ya(this,"linkKey",Ir,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Ho(a,x,y)}},wt.jh=function(a){return a===null&&$t("GraphLinksModel.findLinkDataForKey:key must not be null"),a!==void 0&&xd(a)?this.wb.I(a):null},wt.Bs=function(a){if(a!==null){var y=this.Jh;if(y!==""){var x=this.Ac(a);if(x===void 0||this.wb.contains(x)){var E=this.cl;if(E!==null&&(x=E(this,a),x!=null&&!this.wb.contains(x))){Ho(a,y,x);return}if(typeof x=="string"){for(E=2;this.wb.contains(x+E);)E++;Ho(a,y,x+E)}else if(x===void 0||typeof x=="number"){for(x=-this.wb.count-1;this.wb.contains(x);)x--;Ho(a,y,x)}}}}},wt.Jc=function(a){return a===null?!1:this.$f.contains(a)},wt.fi=function(a){a!==null&&($i(a),this.Jc(a)||bS(this,a,!0))};function bS(a,y,x){if(a.linkKeyProperty!==""){var E=a.Ac(y);if(E!==void 0&&a.wb.I(E)===y)return;a.Bs(y),E=a.Ac(y),E===void 0&&$t("GraphLinksModel.makeLinkDataKeyUnique failed on "+y+". Data not added to model."),a.wb.add(E,y)}a.$f.add(y),E=null,x&&(E=a.md.length,a.md.splice(E,0,y)),ya(a,"linkDataArray",fo,"linkDataArray",a,null,y,null,E),cy(a,y)}wt.Ey=function(a){if(Array.isArray(a))for(var y=a.length,x=0;x<y;x++)this.fi(a[x]);else for(a=a.iterator;a.next();)this.fi(a.value)},wt.bm=function(a){a!==null&&NS(this,a,!0)};function NS(a,y,x){a.$f.remove(y);var E=a.Ac(y);if(E!==void 0&&a.wb.remove(E),E=null,x){if(E=a.md.indexOf(y),0>E)return;a.md.splice(E,1)}if(ya(a,"linkDataArray",Mo,"linkDataArray",a,y,null,E,null),x=hl(a,y,!0),mu(a,x,y),x=hl(a,y,!1),mu(a,x,y),E=a.Ef(y),Array.isArray(E))for(var b=E.length,z=0;z<b;z++)x=E[z],mu(a,x,y)}wt.lA=function(a){if(Array.isArray(a))for(var y=a.length,x=0;x<y;x++)this.bm(a[x]);else for(a=a.iterator;a.next();)this.bm(a.value)},wt.Zz=function(a){if(this.linkKeyProperty===""&&$t("GraphLinksModel.linkKeyProperty must not be an empty string for .mergeLinkDataArray() to succeed."),a!==this.linkDataArray&&je(a)){var y=this.kl;y.clear(),y.addAll(this.wb.iteratorKeys);var x=this.il;x.clear();for(var E=a.length,b=0;b<E;b++){var z=a[b],tt=this.Ac(z);if(tt!==void 0){x.add(tt);var rt=this.jh(tt);rt!==z&&(rt!==null?(this.Do(rt,z),BS(this,z,rt)):(z=this.cloneDeep(z),this.Ks(z,tt),this.fi(z)))}else tt=this.cloneDeep(z),this.fi(tt),x.add(this.Ac(tt))}for(a=y.iterator;a.next();)E=a.value,x.contains(E)||(E=this.jh(E))&&this.bm(E);y.clear(),x.clear()}};function cy(a,y){var x=hl(a,y,!0);x=a.Vl(x),a.hc(x)===null&&pu(a,x,y),x=hl(a,y,!1),x=a.Vl(x),a.hc(x)===null&&pu(a,x,y);var E=a.Ef(y);if(Array.isArray(E))for(var b=E.length,z=0;z<b;z++)x=E[z],a.hc(x)===null&&pu(a,x,y)}wt.Jo=function(a){if(a===null)return null;var y=this.Ak;return a=y!==null?y(a,this):d0(this,a,!0),We(a)&&(Di(a),this.lf!==""&&Ho(a,this.lf,void 0),this.mf!==""&&Ho(a,this.mf,void 0),this.je!==""&&Ho(a,this.je,[])),a},wt.Yu=function(a){if(a===null)return!1;var y=this.jl;return y===""?!1:!!sa(a,y)},wt.lh=function(a){if(a!==null){var y=this.Je;if(y!==""&&(y=sa(a,y),y!==void 0)){if(xd(y))return y;$t("GroupKey value for node data "+a+" is not a number or a string: "+y)}}},wt.mp=function(a,y){if(y===null&&(y=void 0),a!==null){var x=this.Je;if(x!=="")if(this.lb(a)){var E=sa(a,x);E!==y&&(mu(this,E,a),Ho(a,x,y),this.hc(y)===null&&pu(this,y,a),ya(this,"nodeGroupKey",Ir,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Ho(a,x,y)}},zr.prototype.copyNodeData=function(a){return a===null?null:(a=Ci.prototype.copyNodeData.call(this,a),this.Ij||this.Je===""||sa(a,this.Je)===void 0||Ho(a,this.Je,void 0),a)},zr.prototype.setDataProperty=function(a,y,x){if(this.lb(a)){if(y===this.nodeKeyProperty){this.km(a,x);return}if(y===this.nodeCategoryProperty){this.jm(a,x);return}if(y===this.nodeGroupKeyProperty){this.mp(a,x);return}}else if(this.Jc(a)){if(y===this.linkFromKeyProperty){Yf(this,a,x,!0);return}if(y===this.linkToKeyProperty){Yf(this,a,x,!1);return}if(y===this.linkFromPortIdProperty){Xf(this,a,x,!0);return}if(y===this.linkToPortIdProperty){Xf(this,a,x,!1);return}if(y===this.linkKeyProperty){this.Ks(a,x);return}if(y===this.linkCategoryProperty){this.lp(a,x);return}if(y===this.linkLabelKeysProperty){this.Ls(a,x);return}}var E=sa(a,y);E!==x&&(Ho(a,y,x),this.Fs(a,y,E,x))},wt=zr.prototype,wt.Do=function(a,y){if(y){var x=this.lb(a),E=this.Jc(a),b;for(b in y)b==="__gohashid"||x&&b===this.nodeKeyProperty||x&&b===this.nodeIsGroupProperty&&sa(a,b)===y[b]||E&&b===this.linkKeyProperty||this.setDataProperty(a,b,y[b])}},wt.jp=function(a,y){Ci.prototype.jp.call(this,a,y);for(var x=this.kb.iterator;x.next();)this.qv(x.value,a,y);for(x=this.$f.iterator;x.next();){var E=x.value,b=a,z=y;if(hl(this,E,!0)===b){var tt=this.lf;Ho(E,tt,z),ya(this,"linkFromKey",Ir,tt,E,b,z),typeof tt=="string"&&this.La(E,tt)}if(hl(this,E,!1)===b&&(tt=this.mf,Ho(E,tt,z),ya(this,"linkToKey",Ir,tt,E,b,z),typeof tt=="string"&&this.La(E,tt)),tt=this.Ef(E),Array.isArray(tt))for(var rt=tt.length,ot=this.je,lt=0;lt<rt;lt++)tt[lt]===b&&(tt[lt]=z,ya(this,"linkLabelKeys",fo,ot,E,b,z,lt,lt))}},wt.qv=function(a,y,x){if(this.lh(a)===y){var E=this.Je;Ho(a,E,x),ya(this,"nodeGroupKey",Ir,E,a,y,x),typeof E=="string"&&this.La(a,E)}},wt.Lv=function(){Ci.prototype.Lv.call(this);for(var a=this.linkDataArray,y=a.length,x=0;x<y;x++)cy(this,a[x])},wt.fm=function(a){Ci.prototype.fm.call(this,a),a=this.wa(a);var y=vp(this,a);if(y!==null){var x=pi();for(y=y.iterator;y.next();){var E=y.value;if(this.lb(E)){if(this.lh(E)===a){var b=this.Je;ya(this,"nodeGroupKey",Ir,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)}}else if(hl(this,E,!0)===a&&(b=this.lf,ya(this,"linkFromKey",Ir,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)),hl(this,E,!1)===a&&(b=this.mf,ya(this,"linkToKey",Ir,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)),b=this.Ef(E),Array.isArray(b))for(var z=b.length,tt=this.je,rt=0;rt<z;rt++)b[rt]===a&&(ya(this,"linkLabelKeys",fo,tt,E,a,a,rt,rt),x.push(E))}for(y=0;y<x.length;y++)mu(this,a,x[y]);oi(x)}},wt.em=function(a){Ci.prototype.em.call(this,a);var y=this.lh(a);this.hc(y)===null&&pu(this,y,a)},wt.qp=function(a){Ci.prototype.qp.call(this,a);var y=this.lh(a);mu(this,y,a)},wt.ps=function(a){if(a===null)return"";var y=this.dj;if(y===""||(y=sa(a,y),y===void 0))return"";if(typeof y=="string")return y;$t("getCategoryForLinkData found a non-string category for "+a+": "+y)},zr.prototype.getLinkCategoryForData=function(a){return this.ps(a)},zr.prototype.lp=function(a,y){if(a!==null){var x=this.dj;if(x!=="")if(this.Jc(a)){var E=sa(a,x);E===void 0&&(E=""),E!==y&&(Ho(a,x,y),ya(this,"linkCategory",Ir,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Ho(a,x,y)}},zr.prototype.setLinkCategoryForData=function(a,y){this.lp(a,y)},wt=zr.prototype,wt.lm=function(a,y){Ci.prototype.lm.call(this,a,y),this.mp(y,this.lh(a))};function BS(a,y,x){a.lp(x,a.ps(y)),a.wv(x,a.yx(y)),a.Bv(x,a.Bx(y)),a.Ls(x,a.Ef(y)),a.xv(x,a.zx(y)),a.Cv(x,a.Cx(y))}wt.Wj=function(){return!0},wt.ri=function(){return!0},wt.xs=function(){return!0},wt.Xj=function(){return!0},ve.Object.defineProperties(zr.prototype,{archetypeNodeData:{get:function(){return this.Ri},set:function(a){var y=this.Ri;y!==a&&(this.Ri=a,this.g("archetypeNodeData",y,a))}},linkFromKeyProperty:{get:function(){return this.lf},set:function(a){var y=this.lf;y!==a&&(this.lf=a,this.g("linkFromKeyProperty",y,a))}},linkToKeyProperty:{get:function(){return this.mf},set:function(a){var y=this.mf;y!==a&&(this.mf=a,this.g("linkToKeyProperty",y,a))}},linkFromPortIdProperty:{get:function(){return this.ej},set:function(a){var y=this.ej;y!==a&&(this.ej=a,this.g("linkFromPortIdProperty",y,a))}},linkToPortIdProperty:{get:function(){return this.fj},set:function(a){var y=this.fj;y!==a&&(this.fj=a,this.g("linkToPortIdProperty",y,a))}},linkLabelKeysProperty:{get:function(){return this.je},set:function(a){var y=this.je;y!==a&&(this.je=a,this.g("linkLabelKeysProperty",y,a))}},linkDataArray:{get:function(){return this.md},set:function(a){var y=this.md;if(y!==a){this.wb.clear();for(var x=a.length,E=0;E<x;E++){var b=a[E];We(b)||$t("GraphLinksModel.linkDataArray must only contain Objects, not: "+b),$i(b)}if(this.md=a,this.linkKeyProperty!==""){for(E=new fn,b=0;b<x;b++){var z=a[b],tt=this.Ac(z);tt===void 0||this.wb.I(tt)!==null?E.add(z):this.wb.add(tt,z)}for(E=E.iterator;E.next();)b=E.value,this.Bs(b),z=this.Ac(b),z!==void 0&&this.wb.add(z,b)}for(E=new pn,b=0;b<x;b++)E.add(a[b]);for(this.$f=E,ya(this,"linkDataArray",Ir,"linkDataArray",this,y,a),y=0;y<x;y++)cy(this,a[y])}}},linkKeyProperty:{get:function(){return this.Jh},set:function(a){var y=this.Jh;if(y!==a){this.Jh=a,this.wb.clear();for(var x=this.linkDataArray.length,E=0;E<x;E++){var b=this.linkDataArray[E],z=this.Ac(b);z===void 0&&(this.Bs(b),z=this.Ac(b)),z!==void 0&&this.wb.add(z,b)}this.g("linkKeyProperty",y,a)}}},makeUniqueLinkKeyFunction:{get:function(){return this.cl},set:function(a){var y=this.cl;y!==a&&(this.cl=a,this.g("makeUniqueLinkKeyFunction",y,a))}},copyLinkDataFunction:{get:function(){return this.Ak},set:function(a){var y=this.Ak;y!==a&&(this.Ak=a,this.g("copyLinkDataFunction",y,a))}},nodeIsGroupProperty:{get:function(){return this.jl},set:function(a){var y=this.jl;y!==a&&(this.jl=a,this.g("nodeIsGroupProperty",y,a))}},nodeGroupKeyProperty:{get:function(){return this.Je},set:function(a){var y=this.Je;y!==a&&(this.Je=a,this.g("nodeGroupKeyProperty",y,a))}},Ij:{get:function(){return this.Lm},set:function(a){this.Lm!==a&&(this.Lm=a)}},linkCategoryProperty:{get:function(){return this.dj},set:function(a){var y=this.dj;y!==a&&(this.dj=a,this.g("linkCategoryProperty",y,a))}},type:{get:function(){return"GraphLinksModel"}}}),zr.prototype.setCategoryForLinkData=zr.prototype.lp,zr.prototype.getCategoryForLinkData=zr.prototype.ps,zr.prototype.assignAllDataProperties=zr.prototype.Do,zr.prototype.setGroupKeyForNodeData=zr.prototype.mp,zr.prototype.getGroupKeyForNodeData=zr.prototype.lh,zr.prototype.isGroupForNodeData=zr.prototype.Yu,zr.prototype.copyLinkData=zr.prototype.Jo,zr.prototype.mergeLinkDataArray=zr.prototype.Zz,zr.prototype.removeLinkDataCollection=zr.prototype.lA,zr.prototype.removeLinkData=zr.prototype.bm,zr.prototype.addLinkDataCollection=zr.prototype.Ey,zr.prototype.addLinkData=zr.prototype.fi,zr.prototype.containsLinkData=zr.prototype.Jc,zr.prototype.makeLinkDataKeyUnique=zr.prototype.Bs,zr.prototype.findLinkDataForKey=zr.prototype.jh,zr.prototype.setKeyForLinkData=zr.prototype.Ks,zr.prototype.getKeyForLinkData=zr.prototype.Ac,zr.prototype.removeLabelKeyForLinkData=zr.prototype.Qx,zr.prototype.addLabelKeyForLinkData=zr.prototype.Bu,zr.prototype.setLabelKeysForLinkData=zr.prototype.Ls,zr.prototype.getLabelKeysForLinkData=zr.prototype.Ef,zr.prototype.setToPortIdForLinkData=zr.prototype.Cv,zr.prototype.getToPortIdForLinkData=zr.prototype.Cx,zr.prototype.setFromPortIdForLinkData=zr.prototype.xv,zr.prototype.getFromPortIdForLinkData=zr.prototype.zx,zr.prototype.setToKeyForLinkData=zr.prototype.Bv,zr.prototype.getToKeyForLinkData=zr.prototype.Bx,zr.prototype.setFromKeyForLinkData=zr.prototype.wv,zr.prototype.getFromKeyForLinkData=zr.prototype.yx,zr.prototype.clear=zr.prototype.clear;var f0=Object.freeze([]);zr.className="GraphLinksModel",$l.GraphLinksModel=zr,Ci.constructGraphLinksModel=Ci.constructGraphLinksModel=function(){return new zr},Ci.initDiagramModel=hy=function(){return new zr};function ks(a,y){Ci.call(this),this.Ke="parent",this.Nm=!1,this.nj="parentLinkCategory",a!==void 0&&(je(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}Se(ks,Ci),ks.constructGraphLinksModel=Ci.constructGraphLinksModel,ks.prototype.cloneProtected=function(a){Ci.prototype.cloneProtected.call(this,a),a.Ke=this.Ke,a.Nm=this.Nm,a.nj=this.nj},wt=ks.prototype,wt.toString=function(a){if(a===void 0&&(a=0),2<=a)return this.np();var y=(this.name!==""?this.name:"")+" TreeModel";if(0<a){y+=`
node data:`,a=this.nodeDataArray;for(var x=a.length,E=0;E<x;E++){var b=a[E];y+=" "+this.wa(b)+":"+Bi(b)}}return y},wt.rm=function(){var a=Ci.prototype.rm.call(this),y="";return this.nodeParentKeyProperty!=="parent"&&typeof this.nodeParentKeyProperty=="string"&&(y+=`,
"nodeParentKeyProperty": `+this.quote(this.nodeParentKeyProperty)),a+y},wt.gp=function(a){Ci.prototype.gp.call(this,a),a.nodeParentKeyProperty&&(this.nodeParentKeyProperty=a.nodeParentKeyProperty)},wt.fp=function(a){a.nodeParentKeyProperty!==void 0&&a.nodeParentKeyProperty!==this.nodeParentKeyProperty&&$t("applyIncrementalJson cannot change Model properties"),Ci.prototype.fp.call(this,a)},wt.Vl=function(a){return a},wt.mh=function(a){if(a!==null){var y=this.Ke;if(y!==""&&(y=sa(a,y),y!==void 0)){if(xd(y))return y;$t("ParentKey value for node data "+a+" is not a number or a string: "+y)}}},wt.qe=function(a,y){if(y===null&&(y=void 0),a!==null){var x=this.Ke;if(x!=="")if(y=this.Vl(y),this.lb(a)){var E=sa(a,x);E!==y&&(mu(this,E,a),Ho(a,x,y),this.hc(y)===null&&pu(this,y,a),ya(this,"nodeParentKey",Ir,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Ho(a,x,y)}},wt.ss=function(a){if(a===null)return"";var y=this.nj;return y===""||(y=sa(a,y),y===void 0)?"":typeof y=="string"?y:($t("getParentLinkCategoryForNodeData found a non-string category for "+a+": "+y),"")},ks.prototype.getLinkCategoryForData=function(a){return this.ss(a)},ks.prototype.Ms=function(a,y){if(a!==null){var x=this.nj;if(x!=="")if(this.lb(a)){var E=sa(a,x);E===void 0&&(E=""),E!==y&&(Ho(a,x,y),ya(this,"parentLinkCategory",Ir,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Ho(a,x,y)}},ks.prototype.setLinkCategoryForData=function(a,y){this.Ms(a,y)},ks.prototype.copyNodeData=function(a){return a===null?null:(a=Ci.prototype.copyNodeData.call(this,a),this.Jj||this.Ke===""||sa(a,this.Ke)===void 0||Ho(a,this.Ke,void 0),a)},ks.prototype.setDataProperty=function(a,y,x){if(this.lb(a)){if(y===this.nodeKeyProperty){this.km(a,x);return}if(y===this.nodeCategoryProperty){this.jm(a,x);return}if(y===this.nodeParentKeyProperty){this.qe(a,x);return}}var E=sa(a,y);E!==x&&(Ho(a,y,x),this.Fs(a,y,E,x))},wt=ks.prototype,wt.jp=function(a,y){Ci.prototype.jp.call(this,a,y);for(var x=this.kb.iterator;x.next();)this.qv(x.value,a,y)},wt.qv=function(a,y,x){if(this.mh(a)===y){var E=this.Ke;Ho(a,E,x),ya(this,"nodeParentKey",Ir,E,a,y,x),typeof E=="string"&&this.La(a,E)}},wt.fm=function(a){Ci.prototype.fm.call(this,a),a=this.wa(a);var y=vp(this,a);if(y!==null){var x=pi();for(y=y.iterator;y.next();){var E=y.value;if(this.lb(E)&&this.mh(E)===a){var b=this.Ke;ya(this,"nodeParentKey",Ir,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)}}for(y=0;y<x.length;y++)mu(this,a,x[y]);oi(x)}},wt.em=function(a){Ci.prototype.em.call(this,a);var y=this.mh(a);y=this.Vl(y),this.hc(y)===null&&pu(this,y,a)},wt.qp=function(a){Ci.prototype.qp.call(this,a);var y=this.mh(a);mu(this,y,a)},wt.lm=function(a,y){Ci.prototype.lm.call(this,a,y),this.Ms(y,this.ss(a)),this.qe(y,this.mh(a))},wt.Tl=function(){return!0},wt.xs=function(){return!0},ve.Object.defineProperties(ks.prototype,{nodeParentKeyProperty:{get:function(){return this.Ke},set:function(a){var y=this.Ke;y!==a&&(this.Ke=a,this.g("nodeParentKeyProperty",y,a))}},Jj:{get:function(){return this.Nm},set:function(a){this.Nm!==a&&(this.Nm=a)}},parentLinkCategoryProperty:{get:function(){return this.nj},set:function(a){var y=this.nj;y!==a&&(this.nj=a,this.g("parentLinkCategoryProperty",y,a))}},linkCategoryProperty:{get:function(){return this.parentLinkCategoryProperty},set:function(a){this.parentLinkCategoryProperty=a}},type:{get:function(){return"TreeModel"}}}),ks.prototype.setParentLinkCategoryForNodeData=ks.prototype.Ms,ks.prototype.getParentLinkCategoryForNodeData=ks.prototype.ss,ks.prototype.setParentKeyForNodeData=ks.prototype.qe,ks.prototype.getParentKeyForNodeData=ks.prototype.mh,ks.className="TreeModel",$l.TreeModel=ks;function Xo(a){Wo.call(this),this.lw=this.Zm=this.lc=0,this.Wp=360,this.kw=ql,this.Ti=0,this.Zv=new At,this.Jp=this.me=0,this.Xr=new Cp,this.gt=this.mj=0,this.ty=600,this.eo=NaN,this.Cm=1,this.ro=0,this.ul=360,this.Rb=ql,this.K=bs,this.nd=Qf,this.hd=ry,this.tf=6,this.Nn=x0,a&&Object.assign(this,a)}Se(Xo,Wo),Xo.prototype.cloneProtected=function(a){Wo.prototype.cloneProtected.call(this,a),a.eo=this.eo,a.Cm=this.Cm,a.ro=this.ro,a.ul=this.ul,a.Rb=this.Rb,a.K=this.K,a.nd=this.nd,a.hd=this.hd,a.tf=this.tf,a.Nn=this.Nn},Xo.prototype.qb=function(a){a.classType===Xo?a===y0||a===S0||a===m0||a===v0||a===Qf?this.sorting=a:a===sc||a===Jf||a===bs||a===wd?this.direction=a:a===Gh||a===Pd||a===ql||a===tu?this.arrangement=a:(a===Kc||a===x0)&&(this.nodeDiameterFormula=a):Wo.prototype.qb.call(this,a)},Xo.prototype.createNetwork=function(){return new $f(this)},Xo.prototype.doLayout=function(a){if(this.network===null&&(this.network=this.makeNetwork(a)),this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin),a=this.network.vertexes,1>=a.count)a.count===1&&(a=a.first(),a.centerX=0,a.centerY=0);else{var y=new fn;y.addAll(a.iterator),a=new fn;var x=new fn,E=this.sort(y),b,z,tt=this.Jp,rt=this.arrangement,ot=this.nodeDiameterFormula,lt=this.radius;(!isFinite(lt)||0>=lt)&&(lt=NaN);var ut=this.aspectRatio;(!isFinite(ut)||0>=ut)&&(ut=1);var ft=this.startAngle;isFinite(ft)||(ft=0);var yt=this.sweepAngle;if((!isFinite(yt)||360<yt||1>yt)&&(yt=360),y=this.spacing,isFinite(y)||(y=NaN),rt===tu&&ot===Kc?rt=ql:rt===tu&&ot!==Kc&&(rt=this.arrangement),(this.direction===sc||this.direction===Jf)&&this.sorting!==Qf){for(ot=0;!(ot>=E.length)&&(a.add(E.M(ot)),!(ot+1>=E.length));ot+=2)x.add(E.M(ot+1));this.direction===sc?(this.arrangement===tu&&a.reverse(),E=new fn,E.addAll(a),E.addAll(x)):(this.arrangement===tu&&x.reverse(),E=new fn,E.addAll(x),E.addAll(a))}ot=E.length;for(var xt=z=b=0;xt<E.length;xt++){var Ct=ft+yt*z*(this.direction===bs?1:-1)/ot,bt=E.M(xt).diameter;isNaN(bt)&&(bt=Cd(E.M(xt),Ct)),360>yt&&(xt===0||xt===E.length-1)&&(bt/=2),b+=bt,z++}if(isNaN(lt)||rt===tu){if(isNaN(y)&&(y=6),rt!==ql&&rt!==tu){for(z=-1/0,tt=0;tt<ot;tt++)xt=E.M(tt),b=E.M(tt===ot-1?0:tt+1),isNaN(xt.diameter)&&Cd(xt,0),isNaN(b.diameter)&&Cd(b,0),z=Math.max(z,(xt.diameter+b.diameter)/2);tt=z+y,rt===Gh?lt=(z+y)/(2*Math.PI/ot):lt=g0(this,tt*(360<=yt?ot:ot-1),ut,ft*Math.PI/180,yt*Math.PI/180)}else lt=g0(this,b+(360<=yt?ot:ot-1)*(rt!==tu?y:1.6*y),ut,ft*Math.PI/180,yt*Math.PI/180);z=lt*ut}else if(z=lt*ut,xt=fy(this,lt,z,ft*Math.PI/180,yt*Math.PI/180),isNaN(y))(rt===ql||rt===tu)&&(y=(xt-b)/(360<=yt?ot:ot-1));else if(rt===ql||rt===tu)xt=(xt-b)/(360<=yt?ot:ot-1),xt<y?(lt=g0(this,b+y*(360<=yt?ot:ot-1),ut,ft*Math.PI/180,yt*Math.PI/180),z=lt*ut):y=xt;else{for(tt=-1/0,b=0;b<ot;b++)Ct=E.M(b),bt=E.M(b===ot-1?0:b+1),isNaN(Ct.diameter)&&Cd(Ct,0),isNaN(bt.diameter)&&Cd(bt,0),tt=Math.max(tt,(Ct.diameter+bt.diameter)/2);tt+=y,b=g0(this,tt*(360<=yt?ot:ot-1),ut,ft*Math.PI/180,yt*Math.PI/180),b>lt?(lt=b,z=lt*ut):tt=xt/(360<=yt?ot:ot-1)}if(this.kw=rt,this.lc=lt,this.Zm=ut,this.lw=ft,this.Wp=yt,this.Ti=y,this.me=z,this.Jp=tt,y=E,E=this.kw,rt=this.lc,lt=this.lw,ut=this.Wp,ft=this.Ti,yt=this.me,ot=this.Jp,this.direction!==sc&&this.direction!==Jf||E!==tu)if(this.direction===sc||this.direction===Jf){switch(tt=0,E){case Pd:tt=180*p0(this,rt,yt,lt,ot)/Math.PI;break;case ql:ot=y=0,tt=a.first(),tt!==null&&(y=Cd(tt,Math.PI/2)),tt=x.first(),tt!==null&&(ot=Cd(tt,Math.PI/2)),tt=180*p0(this,rt,yt,lt,ft+(y+ot)/2)/Math.PI;break;case Gh:tt=ut/y.length}if(this.direction===sc){switch(E){case Pd:wp(this,a,lt,wd);break;case ql:Pp(this,a,lt,wd);break;case Gh:xp(this,a,ut/2,lt,wd)}switch(E){case Pd:wp(this,x,lt+tt,bs);break;case ql:Pp(this,x,lt+tt,bs);break;case Gh:xp(this,x,ut/2,lt+tt,bs)}}else{switch(E){case Pd:wp(this,x,lt,wd);break;case ql:Pp(this,x,lt,wd);break;case Gh:xp(this,x,ut/2,lt,wd)}switch(E){case Pd:wp(this,a,lt+tt,bs);break;case ql:Pp(this,a,lt+tt,bs);break;case Gh:xp(this,a,ut/2,lt+tt,bs)}}}else switch(E){case Pd:wp(this,y,lt,this.direction);break;case ql:Pp(this,y,lt,this.direction);break;case Gh:xp(this,y,ut,lt,this.direction);break;case tu:AS(this,y,ut,lt,this.direction)}else AS(this,y,ut,lt-ut/2,bs)}this.updateParts(),this.network=null,this.isValidLayout=!0};function xp(a,y,x,E,b){var z=a.Wp,tt=a.lc;a=a.me,E=E*Math.PI/180,x=x*Math.PI/180;for(var rt=y.length,ot=0;ot<rt;ot++){var lt=E+(b===bs?ot*x/(360<=z?rt:rt-1):-(ot*x)/rt),ut=y.M(ot),ft=tt*Math.tan(lt)/a;ft=Math.sqrt((tt*tt+a*a*ft*ft)/(1+ft*ft)),ut.centerX=ft*Math.cos(lt),ut.centerY=ft*Math.sin(lt),ut.actualAngle=180*lt/Math.PI}}function Pp(a,y,x,E){var b=a.lc,z=a.me,tt=a.Ti;x=x*Math.PI/180;for(var rt=y.length,ot=0;ot<rt;ot++){var lt=y.M(ot),ut=y.M(ot===rt-1?0:ot+1),ft=z*Math.sin(x);lt.centerX=b*Math.cos(x),lt.centerY=ft,lt.actualAngle=180*x/Math.PI,isNaN(lt.diameter)&&Cd(lt,0),isNaN(ut.diameter)&&Cd(ut,0),lt=p0(a,b,z,E===bs?x:-x,(lt.diameter+ut.diameter)/2+tt),x+=E===bs?lt:-lt}}function wp(a,y,x,E){var b=a.lc,z=a.me,tt=a.Jp;x=x*Math.PI/180;for(var rt=y.length,ot=0;ot<rt;ot++){var lt=y.M(ot);lt.centerX=b*Math.cos(x),lt.centerY=z*Math.sin(x),lt.actualAngle=180*x/Math.PI,lt=p0(a,b,z,E===bs?x:-x,tt),x+=E===bs?lt:-lt}}function AS(a,y,x,E,b){var z=a.Wp;if(a.mj=0,a.Xr=new Cp,360>x){for(z=E+(b===bs?z:-z);0>z;)z+=360;z%=360,180<z&&(z-=360),z*=Math.PI/180,a.gt=z,DS(a,y,x,E,b)}else TS(a,y,x,E,b);a.Xr.commit(y)}function TS(a,y,x,E,b){var z=a.lc,tt=a.Ti,rt=a.Zm,ot=z*Math.cos(E*Math.PI/180),lt=a.me*Math.sin(E*Math.PI/180),ut=y.Fa();if(ut.length===3)ut[0].centerX=z,ut[0].centerY=0,ut[1].centerX=ut[0].centerX-ut[0].width/2-ut[1].width/2-tt,ut[1].y=ut[0].y,ut[2].centerX=(ut[0].centerX+ut[1].centerX)/2,ut[2].y=ut[0].y-ut[2].height-tt;else if(ut.length===4)ut[0].centerX=z,ut[0].centerY=0,ut[2].centerX=-ut[0].centerX,ut[2].centerY=ut[0].centerY,ut[1].centerX=0,ut[1].y=Math.min(ut[0].y,ut[2].y)-ut[1].height-tt,ut[3].centerX=0,ut[3].y=Math.max(ut[0].y+ut[0].height+tt,ut[2].y+ut[2].height+tt);else{z=At.alloc();for(var ft=0;ft<ut.length&&(ut[ft].centerX=ot,ut[ft].centerY=lt,!(ft>=ut.length-1));ft++)OS(a,ot,lt,ut,ft,b,z)||IS(a,ot,lt,ut,ft,b,z),ot=z.x,lt=z.y;if(At.free(z),a.mj++,!(23<a.mj)){ot=ut[0].centerX,lt=ut[0].centerY,z=ut[ut.length-1].centerX,ft=ut[ut.length-1].centerY;var yt=Math.abs(ot-z)-((ut[0].width+ut[ut.length-1].width)/2+tt),xt=Math.abs(lt-ft)-((ut[0].height+ut[ut.length-1].height)/2+tt);tt=0,1>Math.abs(xt)?Math.abs(ot-z)<(ut[0].width+ut[ut.length-1].width)/2&&(tt=0):tt=0<xt?xt:1>Math.abs(yt)?0:yt,ot=Math.abs(z)>Math.abs(ft)?0<z!=lt>ft:0<ft!=ot<z,(ot=b===bs?ot:!ot)&&(tt=-Math.abs(tt),tt=Math.min(tt,-ut[ut.length-1].width),tt=Math.min(tt,-ut[ut.length-1].height)),a.Xr.compare(tt,ut),1<Math.abs(tt)&&(a.lc=8>a.mj?a.lc-tt/(2*Math.PI):5>ut.length&&10<tt?a.lc/2:a.lc-(0<tt?1.7:-2.3),a.me=a.lc*rt,TS(a,y,x,E,b))}}}function DS(a,y,x,E,b){for(var z=a.lc,tt=a.me,rt=a.Zm,ot=z*Math.cos(E*Math.PI/180),lt=tt*Math.sin(E*Math.PI/180),ut=At.alloc(),ft=y.Fa(),yt=0;yt<ft.length&&(ft[yt].centerX=ot,ft[yt].centerY=lt,!(yt>=ft.length-1));yt++)OS(a,ot,lt,ft,yt,b,ut)||IS(a,ot,lt,ft,yt,b,ut),ot=ut.x,lt=ut.y;if(At.free(ut),a.mj++,!(23<a.mj)){if(ot=Math.atan2(lt,ot),ot=b===bs?a.gt-ot:ot-a.gt,ot=Math.abs(ot)<Math.abs(ot-2*Math.PI)?ot:ot-2*Math.PI,z=ot*(z+tt)/2,tt=a.Xr,Math.abs(z)<Math.abs(tt.Pl))for(tt.Pl=z,tt.mk=[],tt.tm=[],ot=0;ot<ft.length;ot++)tt.mk[ot]=ft[ot].bounds.x,tt.tm[ot]=ft[ot].bounds.y;1<Math.abs(z)&&(a.lc=8>a.mj?a.lc-z/(2*Math.PI):a.lc-(0<z?1.7:-2.3),a.me=a.lc*rt,DS(a,y,x,E,b))}}function OS(a,y,x,E,b,z,tt){var rt=a.lc,ot=a.me,lt=0;a=(E[b].width+E[b+1].width)/2+a.Ti;var ut=!1;if(0<=x!=(z===bs)){if(z=y+a,z>rt){if(z=y-a,z<-rt)return tt.x=z,tt.y=lt,!1;ut=!0}}else if(z=y-a,z<-rt){if(z=y+a,z>rt)return tt.x=z,tt.y=lt,!1;ut=!0}return lt=Math.sqrt(1-Math.min(1,z*z/(rt*rt)))*ot,0>x!==ut&&(lt=-lt),Math.abs(x-lt)>(E[b].height+E[b+1].height)/2?(tt.x=z,tt.y=lt,!1):(tt.x=z,tt.y=lt,!0)}function IS(a,y,x,E,b,z,tt){var rt=a.lc,ot=a.me,lt=0;if(a=(E[b].height+E[b+1].height)/2+a.Ti,E=!1,0<=y!=(z===bs)){if(z=x-a,z<-ot){if(z=x+a,z>ot){tt.x=lt,tt.y=z;return}E=!0}}else if(z=x+a,z>ot){if(z=x-a,z<-ot){tt.x=lt,tt.y=z;return}E=!0}lt=Math.sqrt(1-Math.min(1,z*z/(ot*ot)))*rt,0>y!==E&&(lt=-lt),tt.x=lt,tt.y=z}Xo.prototype.commitLayout=function(){this.commitNodes(),this.isRouting&&this.commitLinks()},Xo.prototype.commitNodes=function(){var a=this.group!==null&&this.group.placeholder!==null&&this.group.isSubGraphExpanded,y=a?this.group.location.copy():null,x=this.actualCenter;a?x=new At(0,0):(x.x=this.arrangementOrigin.x+this.lc,x.y=this.arrangementOrigin.y+this.me);for(var E=this.network.vertexes.iterator;E.next();){var b=E.value;b.x+=x.x,b.y+=x.y,b.commit()}a&&(this.group.Va(),a=this.group.position.copy(),x=this.group.location.copy(),y=y.re(x.re(a)),this.group.move(y),this.Zv=y.re(a))},Xo.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};function fy(a,y,x,E,b){var z=a.ty;if(.001>Math.abs(a.Zm-1))return E!==void 0&&b!==void 0?b*y:2*Math.PI*y;a=y>x?Math.sqrt(y*y-x*x)/y:Math.sqrt(x*x-y*y)/x;for(var tt=0,rt=E!==void 0&&b!==void 0?b/(z+1):Math.PI/(2*(z+1)),ot=0,lt=0;lt<=z;lt++){E!==void 0&&b!==void 0?ot=E+lt*b/z:ot=lt*Math.PI/(2*z);var ut=Math.sin(ot);tt+=Math.sqrt(1-a*a*ut*ut)*rt}return E!==void 0&&b!==void 0?(y>x?y:x)*tt:4*(y>x?y:x)*tt}function g0(a,y,x,E,b){return y/(E!==void 0&&b!==void 0?fy(a,1,x,E,b):fy(a,1,x))}function p0(a,y,x,E,b){if(.001>Math.abs(a.Zm-1))return b/y;var z=y>x?Math.sqrt(y*y-x*x)/y:Math.sqrt(x*x-y*y)/x,tt=0;a=2*Math.PI/(700*a.network.vertexes.count),y>x&&(E+=Math.PI/2);for(var rt=0;;rt++){var ot=Math.sin(E+rt*a);if(tt+=(y>x?y:x)*Math.sqrt(1-z*z*ot*ot)*a,tt>=b)return rt*a}}Xo.prototype.sort=function(a){switch(this.sorting){case m0:break;case v0:a.reverse();break;case y0:a.sort(this.comparer);break;case S0:a.sort(this.comparer),a.reverse();break;case Qf:return this.ak(Tx(a));default:$t("Invalid sorting type.")}return a};function Tx(a){for(var y=[],x=0;x<a.length;x++)y.push(0);x=new fn;for(var E=0;E<a.length;E++){var b=-1,z=-1;if(E===0)for(var tt=0;tt<a.length;tt++){var rt=a.M(tt).edgesCount;rt>b&&(b=rt,z=tt)}else for(tt=0;tt<a.length;tt++)rt=y[tt],rt>b&&(b=rt,z=tt);for(x.add(a.M(z)),y[z]=-1,z=a.M(z),tt=z.sourceEdges;tt.next();)b=a.indexOf(tt.value.fromVertex),0>b||0<=y[b]&&y[b]++;for(z=z.destinationEdges;z.next();)b=a.indexOf(z.value.toVertex),0>b||0<=y[b]&&y[b]++}return x}Xo.prototype.ak=function(a){for(var y=[],x=0;x<a.length;x++){var E=a.M(x);y[x]=[];for(var b,z=E.destinationEdges;z.next();)b=a.indexOf(z.value.toVertex),b!==x&&0>y[x].indexOf(b)&&y[x].push(b);for(E=E.sourceEdges;E.next();)b=a.indexOf(E.value.fromVertex),b!==x&&0>y[x].indexOf(b)&&y[x].push(b)}for(z=[],x=0;x<y.length;x++)z[x]=0;x=[];var tt=[],rt=[];E=[],b=new fn;for(var ot=0,lt=0;lt<y.length;lt++){var ut=y[lt].length;if(ut===1)E.push(lt);else if(ut===0)b.add(a.M(lt));else{if(ot===0)x.push(lt);else{for(var ft=ut=1/0,yt=-1,xt=[],Ct=0;Ct<x.length;Ct++)0>y[x[Ct]].indexOf(x[Ct===x.length-1?0:Ct+1])&&xt.push(Ct===x.length-1?0:Ct+1);if(xt.length===0)for(Ct=0;Ct<x.length;Ct++)xt.push(Ct);for(Ct=0;Ct<xt.length;Ct++){for(var bt=xt[Ct],Wt=y[lt],jt=0,Qt=0;Qt<tt.length;Qt++){var te=z[tt[Qt]],re=z[rt[Qt]];if(te<re){var he=te;te=re}else he=re;if(he<bt&&bt<=te)for(re=0;re<Wt.length;re++){var ke=Wt[re];0>x.indexOf(ke)||he<z[ke]&&z[ke]<te||he===z[ke]||te===z[ke]||jt++}else for(re=0;re<Wt.length;re++)ke=Wt[re],0>x.indexOf(ke)||he<z[ke]&&z[ke]<te&&he!==z[ke]&&te!==z[ke]&&jt++}for(Wt=jt,Qt=jt=0;Qt<y[lt].length;Qt++)he=x.indexOf(y[lt][Qt]),0<=he&&(he=Math.abs(bt-(he>=bt?he+1:he)),jt+=he<x.length+1-he?he:x.length+1-he);for(Qt=0;Qt<tt.length;Qt++)he=z[tt[Qt]],te=z[rt[Qt]],he>=bt&&he++,te>=bt&&te++,he>te&&(re=te,te=he,he=re),te-he<(x.length+2)/2==(he<bt&&bt<=te)&&jt++;(Wt<ut||Wt===ut&&jt<ft)&&(ut=Wt,ft=jt,yt=bt)}for(x.splice(yt,0,lt),ut=0;ut<x.length;ut++)z[x[ut]]=ut;for(ut=0;ut<y[lt].length;ut++)ft=y[lt][ut],0<=x.indexOf(ft)&&(tt.push(lt),rt.push(ft))}ot++}}for(tt=x.length;;){for(z=!0,rt=0;rt<E.length;rt++)if(ot=E[rt],lt=y[ot][0],ut=x.indexOf(lt),0<=ut){for(yt=ft=0;yt<y[lt].length;yt++)xt=x.indexOf(y[lt][yt]),0>xt||xt===ut||(Ct=xt>ut?xt-ut:ut-xt,ft+=xt<ut!=Ct>tt-Ct?1:-1);x.splice(0>ft?ut:ut+1,0,ot),E.splice(rt,1),rt--}else z=!1;if(z)break;x.push(E[0]),E.splice(0,1)}for(y=0;y<x.length;y++)b.add(a.M(x[y]));return b},ve.Object.defineProperties(Xo.prototype,{radius:{get:function(){return this.eo},set:function(a){this.eo!==a&&(0<a||isNaN(a))&&(this.eo=a,this.C())}},aspectRatio:{get:function(){return this.Cm},set:function(a){this.Cm!==a&&0<a&&(this.Cm=a,this.C())}},startAngle:{get:function(){return this.ro},set:function(a){this.ro!==a&&(this.ro=a,this.C())}},sweepAngle:{get:function(){return this.ul},set:function(a){this.ul!==a&&(0<a&&360>=a?this.ul=a:this.ul=360,this.C())}},arrangement:{get:function(){return this.Rb},set:function(a){this.Rb===a||a!==tu&&a!==ql&&a!==Pd&&a!==Gh||(this.Rb=a,this.C())}},direction:{get:function(){return this.K},set:function(a){this.K===a||a!==bs&&a!==wd&&a!==sc&&a!==Jf||(this.K=a,this.C())}},sorting:{get:function(){return this.nd},set:function(a){this.nd===a||a!==m0&&a!==v0&&a!==y0&&!S0&&a!==Qf||(this.nd=a,this.C())}},comparer:{get:function(){return this.hd},set:function(a){this.hd!==a&&(this.hd=a,this.C())}},spacing:{get:function(){return this.tf},set:function(a){this.tf!==a&&(this.tf=a,this.C())}},nodeDiameterFormula:{get:function(){return this.Nn},set:function(a){this.Nn===a||a!==x0&&a!==Kc||(this.Nn=a,this.C())}},actualXRadius:{get:function(){return this.lc}},actualYRadius:{get:function(){return this.me}},actualSpacing:{get:function(){return this.Ti}},actualCenter:{get:function(){return this.Zv}}});var ql=new He(Xo,"ConstantSpacing",0),Pd=new He(Xo,"ConstantDistance",1),Gh=new He(Xo,"ConstantAngle",2),tu=new He(Xo,"Packed",3),bs=new He(Xo,"Clockwise",4),wd=new He(Xo,"Counterclockwise",5),sc=new He(Xo,"BidirectionalLeft",6),Jf=new He(Xo,"BidirectionalRight",7),m0=new He(Xo,"Forwards",8),v0=new He(Xo,"Reverse",9),y0=new He(Xo,"Ascending",10),S0=new He(Xo,"Descending",11),Qf=new He(Xo,"Optimized",12),x0=new He(Xo,"Pythagorean",13),Kc=new He(Xo,"Circular",14);Xo.className="CircularLayout",Xo.ConstantSpacing=ql,Xo.ConstantDistance=Pd,Xo.ConstantAngle=Gh,Xo.Packed=tu,Xo.Clockwise=bs,Xo.Counterclockwise=wd,Xo.BidirectionalLeft=sc,Xo.BidirectionalRight=Jf,Xo.Forwards=m0,Xo.Reverse=v0,Xo.Ascending=y0,Xo.Descending=S0,Xo.Optimized=Qf,Xo.Pythagorean=x0,Xo.Circular=Kc;function Cp(){this.Pl=-1/0,this.tm=this.mk=null}Cp.prototype.compare=function(a,y){if(0<a&&0>this.Pl||Math.abs(a)<Math.abs(this.Pl)&&!(0>a&&0<this.Pl))for(this.Pl=a,this.mk=[],this.tm=[],a=0;a<y.length;a++)this.mk[a]=y[a].bounds.x,this.tm[a]=y[a].bounds.y},Cp.prototype.commit=function(a){if(this.mk!==null&&this.tm!==null)for(var y=0;y<this.mk.length;y++){var x=a.M(y);x.x=this.mk[y],x.y=this.tm[y]}},Cp.className="VertexArrangement";function $f(a){Do.call(this,a)}Se($f,Do),$f.prototype.createVertex=function(){return new Ep(this)},$f.prototype.createEdge=function(){return new P0(this)},$f.className="CircularNetwork";function Ep(a){Ca.call(this,a),this.u=this.Si=NaN}Se(Ep,Ca);function Cd(a,y){var x=a.network;if(x===null)return NaN;if(x=x.layout,x===null)return NaN;if(x.arrangement===tu)if(x.nodeDiameterFormula===Kc)a.Si=Math.max(a.width,a.height);else{if(x=Math.abs(Math.sin(y)),y=Math.abs(Math.cos(y)),x===0)return a.width;if(y===0)return a.height;a.Si=Math.min(a.height/x,a.width/y)}else a.Si=x.nodeDiameterFormula===Kc?Math.max(a.width,a.height):Math.sqrt(a.width*a.width+a.height*a.height);return a.Si}ve.Object.defineProperties(Ep.prototype,{diameter:{get:function(){return this.Si},set:function(a){this.Si!==a&&(this.Si=a)}},actualAngle:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}}}),Ep.className="CircularVertex";function P0(a){qs.call(this,a)}Se(P0,qs),P0.className="CircularEdge";function ts(a){Wo.call(this),this.ah=null,this.An=0,this.$d=new ln(100,100).freeze(),this.Bm=!1,this.sf=!0,this.td=!1,this.dl=100,this.$m=1,this.Zf=1e3,this.In=10,this.fo=Math,this.Hk=.05,this.Gk=50,this.Ek=150,this.Fk=0,this.Vm=10,this.Um=5,a&&Object.assign(this,a)}Se(ts,Wo),ts.prototype.cloneProtected=function(a){Wo.prototype.cloneProtected.call(this,a),a.$d.assign(this.$d),a.Bm=this.Bm,a.sf=this.sf,a.td=this.td,a.dl=this.dl,a.$m=this.$m,a.Zf=this.Zf,a.In=this.In,a.fo=this.fo,a.Hk=this.Hk,a.Gk=this.Gk,a.Ek=this.Ek,a.Fk=this.Fk,a.Vm=this.Vm,a.Um=this.Um},ts.prototype.createNetwork=function(){return new Uc(this)},ts.prototype.doLayout=function(a){if(this.network===null&&(this.network=this.makeNetwork(a)),a=this.maxIterations,0<this.network.vertexes.count){this.network.Ko();for(var y=this.network.vertexes.iterator;y.next();){var x=y.value;x.charge=this.electricalCharge(x),x.mass=this.gravitationalMass(x)}for(y=this.network.edges.iterator;y.next();)x=y.value,x.stiffness=this.springStiffness(x),x.length=this.springLength(x);if(this.Cu(),this.An=0,this.needsClusterLayout()){y=this.network,x=y.Zx();for(var E=x.iterator;E.next();){this.network=E.value;for(var b=this.network.vertexes.iterator;b.next();){var z=b.value;z.Vd=z.vertexes.count,z.sh=1,z.Hj=null,z.We=null}_S(this,0,a)}this.network=y;var tt=E=x.iterator;E=this.arrangementSpacing;var rt=tt.count,ot=!0;z=b=0;for(var lt=pi(),ut=0;ut<rt+y.vertexes.count+2;ut++)lt[ut]=null;rt=0,tt.reset();for(var ft=Be.alloc();tt.next();)if(ut=tt.value,this.computeBounds(ut,ft),ot)ot=!1,b=ft.x+ft.width/2,z=ft.y+ft.height/2,lt[0]=new At(ft.x+ft.width+E.width,ft.y),lt[1]=new At(ft.x,ft.y+ft.height+E.height),rt=2;else{var yt=RS(lt,rt,b,z,ft.width,ft.height,E),xt=lt[yt],Ct=new At(xt.x+ft.width+E.width,xt.y),bt=new At(xt.x,xt.y+ft.height+E.height);for(yt+1<rt&&lt.splice(yt+1,0,null),lt[yt]=Ct,lt[yt+1]=bt,rt++,yt=xt.x-ft.x,xt=xt.y-ft.y,ut=ut.vertexes.iterator;ut.next();)Ct=ut.value,Ct.centerX+=yt,Ct.centerY+=xt}for(Be.free(ft),ut=y.vertexes.iterator;ut.next();)tt=ut.value,yt=tt.bounds,2>rt?(b=yt.x+yt.width/2,z=yt.y+yt.height/2,lt[0]=new At(yt.x+yt.width+E.width,yt.y),lt[1]=new At(yt.x,yt.y+yt.height+E.height),rt=2):(ot=RS(lt,rt,b,z,yt.width,yt.height,E),ft=lt[ot],xt=new At(ft.x+yt.width+E.width,ft.y),yt=new At(ft.x,ft.y+yt.height+E.height),ot+1<rt&&lt.splice(ot+1,0,null),lt[ot]=xt,lt[ot+1]=yt,rt++,tt.centerX=ft.x+tt.width/2,tt.centerY=ft.y+tt.height/2);for(oi(lt),E=x.iterator;E.next();){for(x=E.value,b=x.vertexes.iterator;b.next();)y.dh(b.value);for(x=x.edges.iterator;x.next();)y.Bo(x.value)}}zS(this,a),this.updateParts()}this.dl=a,this.network=null,this.isValidLayout=!0},ts.prototype.needsClusterLayout=function(){if(3>this.network.vertexes.count)return!1;for(var a=0,y=0,x=this.network.vertexes.first().bounds,E=this.network.vertexes.iterator;E.next();){if(E.value.bounds.Yc(x)&&(a++,2<a))return!0;if(10<y)break;y++}return!1},ts.prototype.computeBounds=function(a,y){var x=!0;for(a=a.vertexes.iterator;a.next();){var E=a.value;x?(x=!1,y.set(E.bounds)):y.ed(E.bounds)}return y};function _S(a,y,x){if(Dx(a,y)){var E=a.Zf;a.Zf*=1+1/(y+1);var b=Ox(a,y),z=Math.max(0,Math.max(Math.min(a.network.vertexes.count,x*(y+1)/11),10));for(a.maxIterations+=z,_S(a,y+1,x),zS(a,z),Ix(a,b),y=b.vertexes.Fa(),y.sort(function(tt,rt){return tt===null||rt===null||tt===rt?0:rt.Vd-tt.Vd}),x=0;x<y.length;x++)_x(a,y[x]);a.Zf=E}}function Dx(a,y){if(10<y||3>a.network.vertexes.count)return!1;for(a.ah=a.network.vertexes.Fa(),a=a.ah,a.sort(function(x,E){return x===null||E===null||x===E?0:E.Vd-x.Vd}),y=a.length-1;0<=y&&1>=a[y].Vd;)y--;return 1<a.length-y}function Ox(a,y){for(var x=a.network,E=new Uc(a),b=0;b<a.ah.length;b++){var z=a.ah[b];if(1<z.Vd){E.dh(z);var tt=new ZS;tt.Rs=z.Vd,tt.Ss=z.width,tt.Qs=z.height,tt.Sv=z.focus.x,tt.Tv=z.focus.y,z.We===null&&(z.We=new fn),z.We.add(tt),z.sv=z.We.count-1}else break}for(z=x.edges.iterator;z.next();){var rt=z.value;b=rt.fromVertex,tt=rt.toVertex,b.network===E&&tt.network===E?E.Bo(rt):b.network===E?(rt=b.Hj,rt===null&&(rt=new fn,b.Hj=rt),rt.add(tt),b.Vd--,b.sh+=tt.sh):tt.network===E&&(rt=tt.Hj,rt===null&&(rt=new fn,tt.Hj=rt),rt.add(b),tt.Vd--,tt.sh+=b.sh)}for(b=E.edges.iterator;b.next();)z=b.value,z.length*=Math.max(1,Zt.sqrt((z.fromVertex.sh+z.toVertex.sh)/(4*y+1)));for(y=E.vertexes.iterator;y.next();){b=y.value;var ot=b.Hj;if(ot!==null&&0<ot.count&&(tt=b.We.M(b.We.count-1).Rs-b.Vd,!(0>=tt))){for(var lt=rt=0,ut=ot.count-tt;ut<ot.count;ut++){var ft=ot.M(ut),yt=null;for(z=ft.edges.iterator;z.next();){var xt=z.value;if(xt.Ax(ft)===b){yt=xt;break}}yt!==null&&(lt+=yt.length,rt+=ft.width*ft.height)}z=b.centerX,ot=b.centerY,ut=b.width,ft=b.height,yt=b.focus,xt=ut*ft,1>xt&&(xt=1),rt=Zt.sqrt((rt+xt+lt*lt*4/(tt*tt))/xt),tt=(rt-1)*ut/2,rt=(rt-1)*ft/2,b.bounds=new Be(z-yt.x-tt,ot-yt.y-rt,ut+2*tt,ft+2*rt),b.focus=new At(yt.x+tt,yt.y+rt)}}return a.network=E,x}function Ix(a,y){for(var x=a.network.vertexes.iterator;x.next();){var E=x.value;if(E.network=y,E.We!==null){var b=E.We.M(E.sv);E.Vd=b.Rs;var z=b.Sv,tt=b.Tv;E.bounds=new Be(E.centerX-z,E.centerY-tt,b.Ss,b.Qs),E.focus=new At(z,tt),E.sv--}}for(x=a.network.edges.iterator;x.next();)x.value.network=y;a.network=y}function _x(a,y){var x=y.Hj;if(x!==null&&x.count!==0){var E=y.centerX,b=y.centerY,z=y.width,tt=y.height;y.We!==null&&0<y.We.count&&(tt=y.We.M(0),z=tt.Ss,tt=tt.Qs),z=Zt.sqrt(z*z+tt*tt)/2;for(var rt=!1,ot=tt=0,lt=0,ut=y.vertexes.iterator;ut.next();){var ft=ut.value;1>=ft.Vd?ot++:(rt=!0,lt++,tt+=Math.atan2(y.centerY-ft.centerY,y.centerX-ft.centerX))}if(ot!==0){for(0<lt&&(tt/=lt),lt=y=0,y=rt?2*Math.PI/(ot+1):2*Math.PI/ot,ot%2===0&&(lt=y/2),1<x.count&&x.sort(function(xt,Ct){return xt===null||Ct===null||xt===Ct?0:Ct.width*Ct.height-xt.width*xt.height}),rt=ot%2===0?0:1,x=x.iterator;x.next();)if(ot=x.value,!(1<ot.Vd||a.isFixed(ot))){for(ut=null,ft=ot.edges.iterator;ft.next();){ut=ft.value;break}ft=ot.width;var yt=ot.height;ft=Zt.sqrt(ft*ft+yt*yt)/2,ut=z+ut.length+ft,ft=tt+(y*(rt/2>>1)+lt)*(rt%2===0?1:-1),ot.centerX=E+ut*Math.cos(ft),ot.centerY=b+ut*Math.sin(ft),rt++}}}}function RS(a,y,x,E,b,z,tt){var rt=9e19,ot=-1,lt=0;t:for(;lt<y;lt++){var ut=a[lt],ft=ut.x-x,yt=ut.y-E;if(ft=ft*ft+yt*yt,ft<rt){for(yt=lt-1;0<=yt;yt--)if(a[yt].y>ut.y&&a[yt].x-ut.x<b+tt.width)continue t;for(yt=lt+1;yt<y;yt++)if(a[yt].x>ut.x&&a[yt].y-ut.y<z+tt.height)continue t;ot=lt,rt=ft}}return ot}ts.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},ts.prototype.addComments=function(a){var y=a.node;if(y!==null)for(y=y.Mu();y.next();){var x=y.value;if(x.category==="Comment"&&x.isVisible()){var E=this.network.ki(x);E===null&&(E=this.network.Bl(x)),E.charge=this.defaultCommentElectricalCharge,x=null;for(var b=E.destinationEdges;b.next();){var z=b.value;if(z.toVertex===a){x=z;break}}if(x===null){for(b=E.sourceEdges;b.next();)if(z=b.value,z.fromVertex===a){x=z;break}}x===null&&(x=this.network.Zj(a,E,null)),x.length=this.defaultCommentSpringLength}}};function jS(a,y){var x=a.bounds,E=x.x;a=x.y;var b=x.width;x=x.height;var z=y.bounds,tt=z.x;y=z.y;var rt=z.width;return z=z.height,E+b<tt?a>y+z?(x=E+b-tt,a=a-y-z,Zt.sqrt(x*x+a*a)):a+x<y?(E=E+b-tt,a=a+x-y,Zt.sqrt(E*E+a*a)):tt-(E+b):E>tt+rt?a>y+z?(x=E-tt-rt,a=a-y-z,Zt.sqrt(x*x+a*a)):a+x<y?(E=E-tt-rt,a=a+x-y,Zt.sqrt(E*E+a*a)):E-(tt+rt):a>y+z?a-(y+z):a+x<y?y-(a+x):.1}function zS(a,y){for(a.ah=null,y=a.An+y;a.An<y&&(a.An++,Rx(a)););a.ah=null}function Rx(a){a.ah===null&&(a.ah=a.network.vertexes.Fa());var y=a.ah;if(0>=y.length)return!1;var x=y[0];x.forceX=0,x.forceY=0;for(var E=x.centerX,b=E,z=x=x.centerY,tt=1;tt<y.length;tt++){var rt=y[tt];rt.forceX=0,rt.forceY=0;var ot=rt.centerX;rt=rt.centerY,E=Math.min(E,ot),b=Math.max(b,ot),x=Math.min(x,rt),z=Math.max(z,rt)}(b=b-E>z-x)?y.sort(function(bt,Wt){return bt===null||Wt===null||bt===Wt?0:bt.centerX-Wt.centerX}):y.sort(function(bt,Wt){return bt===null||Wt===null||bt===Wt?0:bt.centerY-Wt.centerY}),x=a.Zf;var lt=E=rt=0;for(z=0;z<y.length;z++){tt=y[z],E=tt.bounds,rt=tt.focus,ot=E.x+rt.x;var ut=E.y+rt.y;E=tt.charge*a.electricalFieldX(ot,ut),lt=tt.charge*a.electricalFieldY(ot,ut),E+=tt.mass*a.gravitationalFieldX(ot,ut),lt+=tt.mass*a.gravitationalFieldY(ot,ut),tt.forceX+=E,tt.forceY+=lt;for(var ft=z+1;ft<y.length;ft++){var yt=y[ft];if(yt!==tt){E=yt.bounds,rt=yt.focus,lt=E.x+rt.x;var xt=E.y+rt.y;if(ot-lt>x||lt-ot>x){if(b)break}else if(ut-xt>x||xt-ut>x){if(!b)break}else{var Ct=jS(tt,yt);1>Ct?(E=a.randomNumberGenerator,E===null&&(a.randomNumberGenerator=E=new w0),Ct=E.random(),rt=E.random(),ot>lt?(E=Math.abs(yt.bounds.right-tt.bounds.x),E=(1+E)*Ct):ot<lt?(E=Math.abs(yt.bounds.x-tt.bounds.right),E=-(1+E)*Ct):(E=Math.max(yt.width,tt.width),E=(1+E)*Ct-E/2),ut>xt?(lt=Math.abs(yt.bounds.bottom-tt.bounds.y),lt=(1+lt)*rt):ot<lt?(lt=Math.abs(yt.bounds.y-tt.bounds.bottom),lt=-(1+lt)*rt):(lt=Math.max(yt.height,tt.height),lt=(1+lt)*rt-lt/2)):(rt=-(tt.charge*yt.charge)/(Ct*Ct),E=(lt-ot)/Ct*rt,lt=(xt-ut)/Ct*rt),tt.forceX+=E,tt.forceY+=lt,yt.forceX-=E,yt.forceY-=lt}}}}for(b=a.network.edges.iterator;b.next();)rt=b.value,x=rt.fromVertex,z=rt.toVertex,tt=x.bounds,ot=x.focus,E=tt.x+ot.x,tt=tt.y+ot.y,ut=z.bounds,ft=z.focus,ot=ut.x+ft.x,ut=ut.y+ft.y,ft=jS(x,z),1>ft?(ft=a.randomNumberGenerator,ft===null&&(a.randomNumberGenerator=ft=new w0),rt=ft.random(),ft=ft.random(),E=(E>ot?1:-1)*(1+(z.width>x.width?z.width:x.width))*rt,lt=(tt>ut?1:-1)*(1+(z.height>x.height?z.height:x.height))*ft):(rt=rt.stiffness*(ft-rt.length),E=(ot-E)/ft*rt,lt=(ut-tt)/ft*rt),x.forceX+=E,x.forceY+=lt,z.forceX-=E,z.forceY-=lt;for(b=E=0;b<y.length;b++)x=y[b],a.isFixed(x)?a.moveFixedVertex(x):E=Math.max(E,a.moveVertex(x)||0);return E>a.epsilonDistance*a.epsilonDistance}ts.prototype.moveVertex=function(a){var y=a.forceX,x=a.forceY,E=this.moveLimit;return y<-E?y=-E:y>E&&(y=E),x<-E?x=-E:x>E&&(x=E),a.centerX+=y,a.centerY+=x,y*y+x*x},ts.prototype.moveFixedVertex=function(){},ts.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.isRouting&&this.commitLinks()},ts.prototype.yv=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var y=a.value.link;y!==null&&(y.fromSpot=xa,y.toSpot=xa)}},ts.prototype.commitNodes=function(){var a=0,y=0;if(this.arrangesToOrigin){var x=Be.alloc();this.computeBounds(this.network,x),y=this.arrangementOrigin,a=y.x-x.x,y=y.y-x.y,Be.free(x)}x=Be.alloc();for(var E=this.network.vertexes.iterator;E.next();){var b=E.value;(a!==0||y!==0)&&(x.assign(b.bounds),x.x+=a,x.y+=y,b.bounds=x),b.commit()}Be.free(x)},ts.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},ts.prototype.springStiffness=function(a){return a=a.stiffness,isNaN(a)?this.Hk:a},ts.prototype.springLength=function(a){return a=a.length,isNaN(a)?this.Gk:a},ts.prototype.electricalCharge=function(a){return a=a.charge,isNaN(a)?this.Ek:a},ts.prototype.electricalFieldX=function(){return 0},ts.prototype.electricalFieldY=function(){return 0},ts.prototype.gravitationalMass=function(a){return a=a.mass,isNaN(a)?this.Fk:a},ts.prototype.gravitationalFieldX=function(){return 0},ts.prototype.gravitationalFieldY=function(){return 0},ts.prototype.isFixed=function(a){return a.isFixed},ve.Object.defineProperties(ts.prototype,{currentIteration:{get:function(){return this.An}},arrangementSpacing:{get:function(){return this.$d},set:function(a){this.$d.D(a)||(this.$d.assign(a),this.C())}},arrangesToOrigin:{get:function(){return this.Bm},set:function(a){this.Bm!==a&&(this.Bm=a,this.C())}},setsPortSpots:{get:function(){return this.sf},set:function(a){this.sf!==a&&(this.sf=a,this.C())}},comments:{get:function(){return this.td},set:function(a){this.td!==a&&(this.td=a,this.C())}},maxIterations:{get:function(){return this.dl},set:function(a){this.dl!==a&&0<=a&&(this.dl=a,this.C())}},epsilonDistance:{get:function(){return this.$m},set:function(a){this.$m!==a&&0<a&&(this.$m=a,this.C())}},infinityDistance:{get:function(){return this.Zf},set:function(a){this.Zf!==a&&1<a&&(this.Zf=a,this.C())}},moveLimit:{get:function(){return this.In},set:function(a){this.In!==a&&1<a&&(this.In=a,this.C())}},randomNumberGenerator:{get:function(){return this.fo},set:function(a){this.fo!==a&&(a!==null&&typeof a.random!="function"&&$t('ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: '+a),this.fo=a)}},defaultSpringStiffness:{get:function(){return this.Hk},set:function(a){this.Hk!==a&&(this.Hk=a,this.C())}},defaultSpringLength:{get:function(){return this.Gk},set:function(a){this.Gk!==a&&(this.Gk=a,this.C())}},defaultElectricalCharge:{get:function(){return this.Ek},set:function(a){this.Ek!==a&&(this.Ek=a,this.C())}},defaultGravitationalMass:{get:function(){return this.Fk},set:function(a){this.Fk!==a&&(this.Fk=a,this.C())}},defaultCommentSpringLength:{get:function(){return this.Vm},set:function(a){this.Vm!==a&&(this.Vm=a,this.C())}},defaultCommentElectricalCharge:{get:function(){return this.Um},set:function(a){this.Um!==a&&(this.Um=a,this.C())}}}),ts.className="ForceDirectedLayout";function ZS(){this.Tv=this.Sv=this.Qs=this.Ss=this.Rs=0}ZS.className="ForceDirectedSubnet";function Uc(a){Do.call(this,a)}Se(Uc,Do),Uc.prototype.createVertex=function(){return new Lp(this)},Uc.prototype.createEdge=function(){return new Fp(this)},Uc.className="ForceDirectedNetwork";function Lp(a){Ca.call(this,a),this.ia=!1,this.Ha=this.u=NaN,this.sh=this.Vd=this.V=this.F=0,this.We=this.Hj=null,this.sv=0}Se(Lp,Ca),ve.Object.defineProperties(Lp.prototype,{isFixed:{get:function(){return this.ia},set:function(a){this.ia!==a&&(this.ia=a)}},charge:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}},mass:{get:function(){return this.Ha},set:function(a){this.Ha!==a&&(this.Ha=a)}},forceX:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a)}},forceY:{get:function(){return this.V},set:function(a){this.V!==a&&(this.V=a)}}}),Lp.className="ForceDirectedVertex";function Fp(a){qs.call(this,a),this.j=this.o=NaN}Se(Fp,qs),ve.Object.defineProperties(Fp.prototype,{stiffness:{get:function(){return this.o},set:function(a){this.o!==a&&(this.o=a)}},length:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a)}}}),Fp.className="ForceDirectedEdge";function w0(){var a=0;a===void 0&&(a=42),this.seed=a,this.ay=48271,this.ey=2147483647,this.Q=44488.07041494893,this.gy=3399,this.by=1/2147483647,this.random()}w0.prototype.random=function(){var a=this.seed%this.Q*this.ay-this.seed/this.Q*this.gy;return 0<a?this.seed=a:this.seed=a+this.ey,this.seed*this.by},w0.className="RandomNumberGenerator";function So(a){Wo.call(this),this.kc=this.ie=25,this.K=0,this.Dk=M0,this.Zk=k0,this.Qk=b0,this.bj=4,this.rk=N0,this.bg=15,this.sf=!0,this.Cn=4,this.Ra=this.Iq=this.Ia=-1,this.Md=this.Hn=0,this.Ta=this.Kd=this.Ld=this.he=this.tc=null,this.Kn=0,this.Jn=this.kj=null,this.le=0,this.fl=null,this.Rf=new At,this.He=[],this.He.length=100,this.xw=this.ve=0,a&&Object.assign(this,a)}Se(So,Wo),So.prototype.cloneProtected=function(a){Wo.prototype.cloneProtected.call(this,a),a.ie=this.ie,a.kc=this.kc,a.K=this.K,a.Dk=this.Dk,a.Zk=this.Zk,a.Qk=this.Qk,a.bj=this.bj,a.rk=this.rk,a.bg=this.bg,a.sf=this.sf,a.Cn=this.Cn,a.ve=this.ve},So.prototype.qb=function(a){a.classType===So?a.name.indexOf("Aggressive")===0?this.aggressiveOption=a:a.name.indexOf("Cycle")===0?this.cycleRemoveOption=a:a.name.indexOf("Init")===0?this.initializeOption=a:a.name.indexOf("Layer")===0?this.layeringOption=a:$t("Unknown enum value: "+a):Wo.prototype.qb.call(this,a)},So.prototype.createNetwork=function(){return new tg(this)},So.prototype.doLayout=function(a){for(this.network===null&&(this.network=this.makeNetwork(a)),this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin),this.Iq=-1,this.Md=this.Hn=0,this.fl=this.Jn=this.kj=null,a=0;a<this.He.length;a++)this.He[a]=null;if(0<this.network.vertexes.count){for(this.network.Ko(),this.cycleRemoveOption!==kp&&this.removeCycles(),a=this.network.vertexes.iterator;a.next();)a.value.layer=-1;for(this.Ia=-1,this.assignLayers(),a.reset();a.next();)this.Ia=Math.max(this.Ia,a.value.layer);this.cycleRemoveOption===kp&&this.removeCycles(),a=this.network;for(var y=[],x=a.edges.iterator;x.next();){var E=x.value;E.valid=!1,y.push(E)}for(x=0;x<y.length;x++){E=y[x];var b=E.fromVertex,z=E.toVertex;if(!(E.valid||(b.node===null&&b.data===null||z.node===null&&z.data===null)&&b.layer===z.layer)){var tt=0,rt=0,ot=0,lt=0;if(E.link!==null){if(rt=E.link,rt===null)continue;var ut=b.node;if(tt=z.node,ut===null||tt===null)continue;var ft=rt.fromNode;ot=rt.toNode;for(var yt=rt.fromPort;yt!==null&&!yt.Ed();)yt=yt.panel;for(rt=rt.toPort;rt!==null&&!rt.Ed();)rt=rt.panel;if(E.rev){lt=ft;var xt=yt;ft=ot,yt=rt,ot=lt,rt=xt}var Ct=b.focus;lt=z.focus;var bt=E.rev?z.bounds:b.bounds;xt=At.alloc(),ut!==ft?bt.w()&&ft.isVisible()?ft.actualBounds.w()?(_h(ft,yt,Or,xt),xt.x+=ft.actualBounds.x-bt.x,xt.y+=ft.actualBounds.y-bt.y):(_h(ft,yt,Or,xt),xt.w()||xt.assign(Ct)):xt.assign(Ct):bt.w()?(_h(ft,yt,Or,xt),xt.w()||xt.assign(Ct)):xt.assign(Ct),ft=E.rev?b.bounds:z.bounds,ut=At.alloc(),tt!==ot?ft.w()&&ot.isVisible()?ot.actualBounds.w()?(_h(ot,rt,Or,ut),ut.x+=ot.actualBounds.x-ft.x,ut.y+=ot.actualBounds.y-ft.y):(_h(ot,rt,Or,ut),ut.w()||ut.assign(lt)):ut.assign(lt):ft.w()?(_h(ot,rt,Or,ut),ut.w()||ut.assign(lt)):ut.assign(lt),this.K===90||this.K===270?(tt=Math.round((xt.x-Ct.x)/this.kc),ot=xt.x,rt=Math.round((ut.x-lt.x)/this.kc),lt=ut.x):(tt=Math.round((xt.y-Ct.y)/this.kc),ot=xt.y,rt=Math.round((ut.y-lt.y)/this.kc),lt=ut.y),At.free(xt),At.free(ut),E.portFromColOffset=tt,E.portFromPos=ot,E.portToColOffset=rt,E.portToPos=lt}else E.portFromColOffset=0,E.portFromPos=0,E.portToColOffset=0,E.portToPos=0;if(xt=b.layer,ut=z.layer,ft=0,bt=E.link,bt!==null){var Wt=bt.fromPort,jt=bt.toPort;if(Wt!==null&&jt!==null){var Qt=bt.fromNode;if(yt=bt.toNode,Qt!==null&&yt!==null){var te=F0(this,!0),re=F0(this,!1),he=this.setsPortSpots?te:bt.computeSpot(!0,Wt);Ct=this.setsPortSpots?re:bt.computeSpot(!1,jt);var ke=bt.isOrthogonal;he.$c()&&he.Hf(re)&&Ct.$c()&&Ct.Hf(te)?ft=0:(te=bt.getLinkPoint(Qt,Wt,he,!0,ke,yt,jt,At.alloc()),re=bt.getLinkDirection(Qt,Wt,te,he,!0,ke,yt,jt),At.free(te),he.ys()||re!==JS(this,E,!0)?this.setsPortSpots&&Qt!==null&&Qt.ports.count===1&&E.rev&&(ft+=1):ft+=1,he=bt.getLinkPoint(yt,jt,Ct,!1,ke,Qt,Wt,At.alloc()),bt=bt.getLinkDirection(yt,jt,he,Ct,!1,ke,Qt,Wt),At.free(he),Ct.ys()||bt!==JS(this,E,!1)?this.setsPortSpots&&yt!==null&&yt.ports.count===1&&E.rev&&(ft+=2):ft+=2)}}}if(yt=ft,ft=yt===1||yt===3,(yt=yt===2||yt===3)&&(Ct=a.createVertex(),Ct.node=null,Ct.Dj=1,Ct.layer=xt,Ct.near=b,a.dh(Ct),b=a.Zj(b,Ct,E.link),b.valid=!1,b.rev=E.rev,b.portFromColOffset=tt,b.portToColOffset=0,b.portFromPos=ot,b.portToPos=0,b=Ct),bt=1,ft&&bt--,xt-ut>bt&&0<xt){for(E.valid=!1,Ct=a.createVertex(),Ct.node=null,Ct.Dj=2,Ct.layer=xt-1,a.dh(Ct),b=a.Zj(b,Ct,E.link),b.valid=!0,b.rev=E.rev,b.portFromColOffset=yt?0:tt,b.portToColOffset=0,b.portFromPos=yt?0:ot,b.portToPos=0,b=Ct,xt--;xt-ut>bt&&0<xt;)Ct=a.createVertex(),Ct.node=null,Ct.Dj=3,Ct.layer=xt-1,a.dh(Ct),b=a.Zj(b,Ct,E.link),b.valid=!0,b.rev=E.rev,b.portFromColOffset=0,b.portToColOffset=0,b.portFromPos=0,b.portToPos=0,b=Ct,xt--;b=a.Zj(Ct,z,E.link),b.valid=!ft,ft&&(Ct.near=z),b.rev=E.rev,b.portFromColOffset=0,b.portToColOffset=rt,b.portFromPos=0,b.portToPos=lt}else E.valid=!0}}for(a=this.tc=[],y=0;y<=this.Ia;y++)a[y]=0;for(y=this.network.vertexes.iterator;y.next();)y.value.index=-1;for(this.initializeIndices(),this.Iq=-1,x=this.Md=this.Hn=0;x<=this.Ia;x++)a[x]>a[this.Md]&&(this.Iq=a[x]-1,this.Md=x),a[x]<a[this.Hn]&&(this.Hn=x);for(this.fl=[],x=0;x<a.length;x++)this.fl[x]=[];for(y.reset();y.next();)a=y.value,this.fl[a.layer][a.index]=a;for(this.Ra=-1,a=0;a<=this.Ia;a++){for(y=Ed(this,a),x=0,E=this.tc[a],z=0;z<E;z++)b=y[z],x+=this.nodeMinColumnSpace(b,!0),b.column=x,x+=1,x+=this.nodeMinColumnSpace(b,!1);this.Ra=Math.max(this.Ra,x-1),Ld(this,a,y)}this.reduceCrossings(),this.straightenAndPack(),this.updateParts()}this.network=null,this.isValidLayout=!0},So.prototype.linkMinLength=function(){return 1};function gy(a){var y=a.fromVertex.node||a.fromVertex.data;return a=a.toVertex.node||a.toVertex.data,y===null&&a===null?8:y===null||a===null?4:1}So.prototype.nodeMinLayerSpace=function(a,y){return a.node===null&&a.data===null?0:this.K===90||this.K===270?y?a.focus.y+10:a.bounds.height-a.focus.y+10:y?a.focus.x+10:a.bounds.width-a.focus.x+10},So.prototype.nodeMinColumnSpace=function(a,y){if(a.node===null&&a.data===null)return 0;var x=y?a.ev:a.dv;return x!==null?x:(x=this.K,x===90||x===270?y?a.ev=a.focus.x/this.kc+1|0:a.dv=(a.bounds.width-a.focus.x)/this.kc+1|0:y?a.ev=a.focus.y/this.kc+1|0:a.dv=(a.bounds.height-a.focus.y)/this.kc+1|0)};function Rs(a){a.kj===null&&(a.kj=[]);for(var y=0,x=a.network.vertexes.iterator;x.next();){var E=x.value;a.kj[y]=E.layer,y++,a.kj[y]=E.column,y++,a.kj[y]=E.index,y++}return a.kj}function wl(a,y){var x=0;for(a=a.network.vertexes.iterator;a.next();){var E=a.value;E.layer=y[x],x++,E.column=y[x],x++,E.index=y[x],x++}}function GS(a,y,x){var E=Ed(a,y),b=a.tc[y];(a.Jn===null||a.Jn.length<b*b)&&(a.Jn=[]);for(var z=a.Jn,tt=0;tt<b;tt++){var rt=0,ot=E[tt],lt=ot.near;if(lt!==null&&lt.layer===ot.layer)if(ot=lt.index,ot>tt)for(var ut=tt+1;ut<ot;ut++){var ft=E[ut];ft.near===lt&&ft.Dj===lt.Dj||rt++}else for(ut=tt-1;ut>ot;ut--)ft=E[ut],ft.near===lt&&ft.Dj===lt.Dj||rt++;var yt;if(0<=x)for(ot=E[tt].sourceEdgesArrayAccess,lt=0;lt<ot.length;lt++){var xt=ot[lt];if(xt.valid&&xt.fromVertex.layer!==y)for(ft=xt.fromVertex.index,ut=xt.portToPos,xt=xt.portFromPos,yt=lt+1;yt<ot.length;yt++){var Ct=ot[yt];if(Ct.valid&&Ct.fromVertex.layer!==y){var bt=Ct.fromVertex.index,Wt=Ct.portToPos;Ct=Ct.portFromPos,ut<Wt&&(ft>bt||ft===bt&&xt>Ct)&&rt++,Wt<ut&&(bt>ft||bt===ft&&Ct>xt)&&rt++}}}if(0>=x){for(ot=E[tt].destinationEdgesArrayAccess,lt=0;lt<ot.length;lt++)if(xt=ot[lt],xt.valid&&xt.toVertex.layer!==y)for(ft=xt.toVertex.index,ut=xt.portToPos,xt=xt.portFromPos,yt=lt+1;yt<ot.length;yt++)Ct=ot[yt],Ct.valid&&Ct.toVertex.layer!==y&&(bt=Ct.toVertex.index,Wt=Ct.portToPos,Ct=Ct.portFromPos,xt<Ct&&(ft>bt||ft===bt&&ut>Wt)&&rt++,Ct<xt&&(bt>ft||bt===ft&&Wt>ut)&&rt++)}for(z[tt*b+tt]=rt,ot=tt+1;ot<b;ot++){var jt=0,Qt=0;if(0<=x){rt=E[tt].sourceEdgesArrayAccess;var te=E[ot].sourceEdgesArrayAccess;for(lt=0;lt<rt.length;lt++)if(xt=rt[lt],xt.valid&&xt.fromVertex.layer!==y)for(ft=xt.fromVertex.index,xt=xt.portFromPos,yt=0;yt<te.length;yt++)Ct=te[yt],Ct.valid&&Ct.fromVertex.layer!==y&&(bt=Ct.fromVertex.index,Ct=Ct.portFromPos,(ft<bt||ft===bt&&xt<Ct)&&Qt++,(bt<ft||bt===ft&&Ct<xt)&&jt++)}if(0>=x){for(rt=E[tt].destinationEdgesArrayAccess,te=E[ot].destinationEdgesArrayAccess,lt=0;lt<rt.length;lt++)if(xt=rt[lt],xt.valid&&xt.toVertex.layer!==y)for(ft=xt.toVertex.index,ut=xt.portToPos,yt=0;yt<te.length;yt++)Ct=te[yt],Ct.valid&&Ct.toVertex.layer!==y&&(bt=Ct.toVertex.index,Wt=Ct.portToPos,(ft<bt||ft===bt&&ut<Wt)&&Qt++,(bt<ft||bt===ft&&Wt<ut)&&jt++)}z[tt*b+ot]=jt,z[ot*b+tt]=Qt}}return Ld(a,y,E),z}So.prototype.countCrossings=function(){for(var a=0,y=0;y<=this.Ia;y++)for(var x=GS(this,y,1),E=this.tc[y],b=0;b<E;b++)for(var z=b;z<E;z++)a+=x[b*E+z];return a};function C0(a){for(var y=0,x=0;x<=a.Ia;x++){for(var E=a,b=x,z=Ed(E,b),tt=E.tc[b],rt=0,ot=0;ot<tt;ot++){var lt=z[ot].destinationEdgesArrayAccess;if(lt!==null)for(var ut=0;ut<lt.length;ut++){var ft=lt[ut];if(ft.valid&&ft.toVertex.layer!==b){var yt=ft.fromVertex.column+ft.portFromColOffset,xt=ft.toVertex.column+ft.portToColOffset;rt+=(Math.abs(yt-xt)+1)*gy(ft)}}}Ld(E,b,z),y+=rt}return y}So.prototype.normalize=function(){var a=1/0;this.Ra=-1;for(var y=this.network.vertexes.iterator;y.next();){var x=y.value;a=Math.min(a,x.column-this.nodeMinColumnSpace(x,!0)),this.Ra=Math.max(this.Ra,x.column+this.nodeMinColumnSpace(x,!1))}for(y.reset();y.next();)y.value.column-=a;this.Ra-=a};function py(a,y,x){for(var E=Ed(a,y),b=a.tc[y],z=[],tt=0;tt<b;tt++){var rt=E[tt],ot=null;0>=x&&(ot=rt.sourceEdgesArrayAccess);var lt=null;0<=x&&(lt=rt.destinationEdgesArrayAccess);var ut=0,ft=0,yt=rt.near;if(yt!==null&&yt.layer===rt.layer&&(ut+=yt.column-1,ft++),ot!==null)for(yt=0;yt<ot.length;yt++){rt=ot[yt];var xt=rt.fromVertex;rt.valid&&!rt.rev&&xt.layer!==y&&(ut+=xt.column,ft++)}if(lt!==null)for(ot=0;ot<lt.length;ot++)rt=lt[ot],yt=rt.toVertex,rt.valid&&!rt.rev&&yt.layer!==y&&(ut+=yt.column,ft++);z[tt]=ft===0?-1:ut/ft}return Ld(a,y,E),z}function HS(a,y,x){for(var E=Ed(a,y),b=a.tc[y],z=[],tt=0;tt<b;tt++){var rt=E[tt],ot=null;0>=x&&(ot=rt.sourceEdgesArrayAccess);var lt=null;0<=x&&(lt=rt.destinationEdgesArrayAccess);var ut=0,ft=[],yt=rt.near;if(yt!==null&&yt.layer===rt.layer&&(ft[ut]=yt.column-1,ut++),rt=void 0,ot!==null)for(yt=0;yt<ot.length;yt++){rt=ot[yt];var xt=rt.fromVertex;rt.valid&&!rt.rev&&xt.layer!==y&&(ft[ut]=xt.column+rt.portFromColOffset,ut++)}if(lt!==null)for(ot=0;ot<lt.length;ot++)rt=lt[ot],yt=rt.toVertex,rt.valid&&!rt.rev&&yt.layer!==y&&(ft[ut]=yt.column+rt.portToColOffset,ut++);ut===0?z[tt]=-1:(ft.sort(function(Ct,bt){return Ct-bt}),lt=ut>>1,z[tt]=ut&1?ft[lt]:ft[lt-1]+ft[lt]>>1)}return Ld(a,y,E),z}function Mp(a,y,x,E,b,z){if(y.component===E){if(y.component=x,b)for(var tt=y.destinationEdges;tt.next();){var rt=tt.value,ot=rt.toVertex,lt=y.layer-ot.layer;rt=a.linkMinLength(rt),lt===rt&&Mp(a,ot,x,E,b,z)}if(z)for(tt=y.sourceEdges;tt.next();)rt=tt.value,ot=rt.fromVertex,lt=ot.layer-y.layer,rt=a.linkMinLength(rt),lt===rt&&Mp(a,ot,x,E,b,z)}}function my(a,y,x,E,b,z){if(y.component===E){if(y.component=x,b)for(var tt=y.destinationEdges;tt.next();)my(a,tt.value.toVertex,x,E,b,z);if(z)for(y=y.sourceEdges;y.next();)my(a,y.value.fromVertex,x,E,b,z)}}So.prototype.removeCycles=function(){for(var a=this.network.edges.iterator;a.next();)a.value.rev=!1;switch(this.Dk){default:case Sy:a=this.network;var y=0,x=a.vertexes.count-1,E=[];E.length=x+1;for(var b=a.vertexes.iterator;b.next();)b.value.valid=!0;for(;jx(a)!==null;){for(b=WS(a);b!==null;)E[x]=b,x--,b.valid=!1,b=WS(a);for(b=VS(a);b!==null;)E[y]=b,y++,b.valid=!1,b=VS(a);b=null;for(var z=0,tt=this.network.vertexes.iterator;tt.next();){var rt=tt.value;if(rt.valid){for(var ot=0,lt=rt.destinationEdges;lt.next();)lt.value.toVertex.valid&&ot++;lt=0;for(var ut=rt.sourceEdges;ut.next();)ut.value.fromVertex.valid&&lt++;(b===null||z<ot-lt)&&(b=rt,z=ot-lt)}}b!==null&&(E[y]=b,y++,b.valid=!1)}for(y=0;y<a.vertexes.count;y++)E[y].index=y;for(E=a.edges.iterator;E.next();)y=E.value,y.fromVertex.index>y.toVertex.index&&(a.gm(y),y.rev=!0);break;case M0:for(E=this.network.vertexes.iterator;E.next();)a=E.value,a.Ll=-1,a.finish=-1;for(a=this.network.edges.iterator;a.next();)a.value.forest=!1;for(this.Kn=0,E.reset();E.next();)y=E.value,y.sourceEdges.count===0&&vy(this,y);for(E.reset();E.next();)y=E.value,y.Ll===-1&&vy(this,y);for(a.reset();a.next();)E=a.value,E.forest||(y=E.fromVertex,x=y.finish,b=E.toVertex,z=b.finish,b.Ll<y.Ll&&x<z&&(this.network.gm(E),E.rev=!0));break;case kp:for(a=this.network,y=a.vertexes.iterator,E=1/0;y.next();)E=Math.min(E,y.value.layer);if(1/0>E){if(0>E)for(y.reset();y.next();)y.value.layer-=E;for(E=[],y.reset();y.next();)x=y.value,b=E[x.layer],b===void 0?E[x.layer]=[x]:b.push(x);for(x=y=0;x<E.length;x++)if(b=E[x],!b||b.length===0)y++;else if(0<x)for(z=0;z<b.length;z++)b[z].layer-=y;for(E=a.edges.iterator;E.next();)y=E.value,y.fromVertex.layer<y.toVertex.layer&&(a.gm(y),y.rev=!0)}}};function jx(a){for(a=a.vertexes.iterator;a.next();){var y=a.value;if(y.valid)return y}return null}function WS(a){for(a=a.vertexes.iterator;a.next();){var y=a.value;if(y.valid){for(var x=!0,E=y.destinationEdges;E.next();)if(E.value.toVertex.valid){x=!1;break}if(x)return y}}return null}function VS(a){for(a=a.vertexes.iterator;a.next();){var y=a.value;if(y.valid){for(var x=!0,E=y.sourceEdges;E.next();)if(E.value.fromVertex.valid){x=!1;break}if(x)return y}}return null}function vy(a,y){y.Ll=a.Kn,a.Kn++;for(var x=y.destinationEdges;x.next();){var E=x.value,b=E.toVertex;b.Ll===-1&&(E.forest=!0,vy(a,b))}y.finish=a.Kn,a.Kn++}So.prototype.assignLayers=function(){switch(this.Zk){case xy:KS(this);break;case Py:for(var a,y=this.network.vertexes.iterator;y.next();)a=YS(this,y.value),this.Ia=Math.max(a,this.Ia);for(y.reset();y.next();)a=y.value,a.layer=this.Ia-a.layer;break;default:case k0:for(KS(this),y=this.network.vertexes.iterator;y.next();)y.value.valid=!1;for(y.reset();y.next();)a=y.value,a.sourceEdges.count===0&&XS(this,a);for(a=1/0,y.reset();y.next();)a=Math.min(a,y.value.layer);for(this.Ia=-1,y.reset();y.next();){var x=y.value;x.layer-=a,this.Ia=Math.max(this.Ia,x.layer)}}};function KS(a){for(var y=a.network.vertexes.iterator;y.next();){var x=US(a,y.value);a.Ia=Math.max(x,a.Ia)}}function US(a,y){var x=0;if(y.layer===-1){for(var E=y.destinationEdges;E.next();){var b=E.value,z=b.toVertex;b=a.linkMinLength(b),x=Math.max(x,US(a,z)+b)}y.layer=x}else x=y.layer;return x}function YS(a,y){var x=0;if(y.layer===-1){for(var E=y.sourceEdges;E.next();){var b=E.value,z=b.fromVertex;b=a.linkMinLength(b),x=Math.max(x,YS(a,z)+b)}y.layer=x}else x=y.layer;return x}function XS(a,y){if(!y.valid){y.valid=!0;for(var x=y.destinationEdges;x.next();)XS(a,x.value.toVertex);for(x=a.network.vertexes.iterator;x.next();)x.value.component=-1;for(var E=y.sourceEdgesArrayAccess,b=E.length,z=0;z<b;z++){var tt=E[z],rt=tt.fromVertex,ot=tt.toVertex;tt=a.linkMinLength(tt),rt.layer-ot.layer>tt&&Mp(a,rt,0,-1,!0,!1)}for(Mp(a,y,1,-1,!0,!0);y.component!==0;){for(z=0,E=1/0,rt=0,ot=null,tt=a.network.vertexes.iterator;tt.next();){var lt=tt.value;if(lt.component===1){var ut=0,ft=!1,yt=lt.sourceEdgesArrayAccess;b=yt.length;for(var xt=0;xt<b;xt++){var Ct=yt[xt],bt=Ct.fromVertex;ut+=1,bt.component!==1&&(z+=1,bt=bt.layer-lt.layer,Ct=a.linkMinLength(Ct),E=Math.min(E,bt-Ct))}for(yt=lt.destinationEdgesArrayAccess,b=yt.length,xt=0;xt<b;xt++)Ct=yt[xt].toVertex,--ut,Ct.component!==1?--z:ft=!0;(ot===null||ut<rt)&&!ft&&(ot=lt,rt=ut)}}if(0<z){for(x.reset();x.next();)b=x.value,b.component===1&&(b.layer+=E);y.component=0}else ot.component=0}for(x=a.network.vertexes.iterator;x.next();)x.value.component=-1;for(Mp(a,y,1,-1,!0,!1);y.component!==0;){for(E=0,b=1/0,z=0,rt=null,ot=a.network.vertexes.iterator;ot.next();)if(tt=ot.value,tt.component===1){for(lt=0,ut=!1,yt=tt.sourceEdgesArrayAccess,ft=yt.length,xt=0;xt<ft;xt++)Ct=yt[xt].fromVertex,lt+=1,Ct.component!==1?E+=1:ut=!0;for(yt=tt.destinationEdgesArrayAccess,ft=yt.length,xt=0;xt<ft;xt++)Ct=yt[xt],bt=Ct.toVertex,--lt,bt.component!==1&&(--E,bt=tt.layer-bt.layer,Ct=a.linkMinLength(Ct),b=Math.min(b,bt-Ct));(rt===null||lt>z)&&!ut&&(rt=tt,z=lt)}if(0>E){for(x.reset();x.next();)E=x.value,E.component===1&&(E.layer-=b);y.component=0}else rt.component=0}}}function JS(a,y,x){return a.K===90?x&&!y.rev||!x&&y.rev?270:90:a.K===180?x&&!y.rev||!x&&y.rev?0:180:a.K===270?x&&!y.rev||!x&&y.rev?90:270:x&&!y.rev||!x&&y.rev?180:0}So.prototype.initializeIndices=function(){switch(this.Qk){default:case Cy:for(var a=this.network.vertexes.iterator;a.next();){var y=a.value,x=y.layer;y.index=this.tc[x],this.tc[x]++}break;case b0:for(a=this.network.vertexes.iterator,y=this.Ia;0<=y;y--)for(a.reset();a.next();)x=a.value,x.layer===y&&x.index===-1&&QS(this,x);break;case wy:for(a=this.network.vertexes.iterator,y=0;y<=this.Ia;y++)for(a.reset();a.next();)x=a.value,x.layer===y&&x.index===-1&&$S(this,x)}};function QS(a,y){var x=y.layer;for(y.index=a.tc[x],a.tc[x]++,y=y.destinationEdgesArrayAccess,x=!0;x;){x=!1;for(var E=0;E<y.length-1;E++){var b=y[E],z=y[E+1];b.portFromColOffset>z.portFromColOffset&&(x=!0,y[E]=z,y[E+1]=b)}}for(x=0;x<y.length;x++)E=y[x],E.valid&&(E=E.toVertex,E.index===-1&&QS(a,E))}function $S(a,y){var x=y.layer;y.index=a.tc[x],a.tc[x]++,y=y.sourceEdgesArrayAccess;for(var E=!0;E;)for(E=!1,x=0;x<y.length-1;x++){var b=y[x],z=y[x+1];b.portToColOffset>z.portToColOffset&&(E=!0,y[x]=z,y[x+1]=b)}for(x=0;x<y.length;x++)E=y[x],E.valid&&(E=E.fromVertex,E.index===-1&&$S(a,E))}So.prototype.reduceCrossings=function(){var a=this.countCrossings(),y=Rs(this),x,E;for(x=0;x<this.bj;x++){for(E=0;E<=this.Ia;E++)E0(this,E,1),Il(this,E,1);var b=this.countCrossings();for(b<a&&(a=b,y=Rs(this)),E=this.Ia;0<=E;E--)E0(this,E,-1),Il(this,E,-1);b=this.countCrossings(),b<a&&(a=b,y=Rs(this))}for(wl(this,y),x=0;x<this.bj;x++){for(E=0;E<=this.Ia;E++)E0(this,E,0),Il(this,E,0);for(b=this.countCrossings(),b<a&&(a=b,y=Rs(this)),E=this.Ia;0<=E;E--)E0(this,E,0),Il(this,E,0);b=this.countCrossings(),b<a&&(a=b,y=Rs(this))}wl(this,y);var z,tt,rt;switch(this.rk){case Ey:break;case Ly:for(rt=a+1;(E=this.countCrossings())<rt;)for(rt=E,x=this.Ia;0<=x;x--)for(tt=0;tt<=x;tt++){for(z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=Il(this,E,-1)||z;for(b=this.countCrossings(),b>=a?wl(this,y):(a=b,y=Rs(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=Il(this,E,1)||z;for(b=this.countCrossings(),b>=a?wl(this,y):(a=b,y=Rs(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=Il(this,E,1)||z;for(b>=a?wl(this,y):(a=b,y=Rs(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=Il(this,E,-1)||z;for(b>=a?wl(this,y):(a=b,y=Rs(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=Il(this,E,0)||z;for(b>=a?wl(this,y):(a=b,y=Rs(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=Il(this,E,0)||z;b>=a?wl(this,y):(a=b,y=Rs(this))}break;default:case N0:for(x=this.Ia,tt=0,rt=a+1;(E=this.countCrossings())<rt;){for(rt=E,z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=Il(this,E,-1)||z;for(b=this.countCrossings(),b>=a?wl(this,y):(a=b,y=Rs(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=Il(this,E,1)||z;for(b=this.countCrossings(),b>=a?wl(this,y):(a=b,y=Rs(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=Il(this,E,1)||z;for(b>=a?wl(this,y):(a=b,y=Rs(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=Il(this,E,-1)||z;for(b>=a?wl(this,y):(a=b,y=Rs(this)),z=!0;z;)for(z=!1,E=x;E>=tt;E--)z=Il(this,E,0)||z;for(b>=a?wl(this,y):(a=b,y=Rs(this)),z=!0;z;)for(z=!1,E=tt;E<=x;E++)z=Il(this,E,0)||z;b>=a?wl(this,y):(a=b,y=Rs(this))}}wl(this,y)};function E0(a,y,x){var E=Ed(a,y),b=a.tc[y],z=HS(a,y,x),tt=py(a,y,x);for(x=0;x<b;x++)tt[x]===-1&&(tt[x]=E[x].column),z[x]===-1&&(z[x]=E[x].column);for(var rt=!0,ot;rt;)for(rt=!1,x=0;x<b-1;x++)(z[x+1]<z[x]||z[x+1]===z[x]&&tt[x+1]<tt[x])&&(rt=!0,ot=z[x],z[x]=z[x+1],z[x+1]=ot,ot=tt[x],tt[x]=tt[x+1],tt[x+1]=ot,ot=E[x],E[x]=E[x+1],E[x+1]=ot);for(x=z=0;x<b;x++)ot=E[x],ot.index=x,z+=a.nodeMinColumnSpace(ot,!0),ot.column=z,z+=1,z+=a.nodeMinColumnSpace(ot,!1);Ld(a,y,E)}function Il(a,y,x){var E=Ed(a,y),b=a.tc[y];x=GS(a,y,x);var z,tt=[];for(z=0;z<b;z++)tt[z]=-1;var rt=[];for(z=0;z<b;z++)rt[z]=-1;for(var ot=!1,lt=!0;lt;)for(lt=!1,z=0;z<b-1;z++){var ut=x[E[z].index*b+E[z+1].index],ft=x[E[z+1].index*b+E[z].index],yt=0,xt=0,Ct=E[z].column,bt=E[z+1].column,Wt=a.nodeMinColumnSpace(E[z],!0),jt=a.nodeMinColumnSpace(E[z],!1),Qt=a.nodeMinColumnSpace(E[z+1],!0),te=a.nodeMinColumnSpace(E[z+1],!1);Wt=Ct-Wt+Qt,jt=bt-jt+te;var re=E[z].sourceEdges.iterator;for(re.reset();re.next();)if(Qt=re.value,te=Qt.fromVertex,Qt.valid&&te.layer===y){for(Qt=0;E[Qt]!==te;)Qt++;Qt<z&&(yt+=2*(z-Qt),xt+=2*(z+1-Qt)),Qt===z+1&&(yt+=1),Qt>z+1&&(yt+=4*(Qt-z),xt+=4*(Qt-(z+1)))}for(re=E[z].destinationEdges.iterator,re.reset();re.next();)if(Qt=re.value,te=Qt.toVertex,Qt.valid&&te.layer===y){for(Qt=0;E[Qt]!==te;)Qt++;Qt===z+1&&(xt+=1)}for(re=E[z+1].sourceEdges.iterator,re.reset();re.next();)if(Qt=re.value,te=Qt.fromVertex,Qt.valid&&te.layer===y){for(Qt=0;E[Qt]!==te;)Qt++;Qt<z&&(yt+=2*(z+1-Qt),xt+=2*(z-Qt)),Qt===z&&(xt+=1),Qt>z+1&&(yt+=4*(Qt-(z+1)),xt+=4*(Qt-z))}for(re=E[z+1].destinationEdges.iterator,re.reset();re.next();)if(Qt=re.value,te=Qt.toVertex,Qt.valid&&te.layer===y){for(Qt=0;E[Qt]!==te;)Qt++;Qt===z&&(yt+=1)}Qt=te=0,re=tt[E[z].index];var he=rt[E[z].index],ke=tt[E[z+1].index],Jn=rt[E[z+1].index];re!==-1&&(te+=Math.abs(re-Ct),Qt+=Math.abs(re-jt)),he!==-1&&(te+=Math.abs(he-Ct),Qt+=Math.abs(he-jt)),ke!==-1&&(te+=Math.abs(ke-bt),Qt+=Math.abs(ke-Wt)),Jn!==-1&&(te+=Math.abs(Jn-bt),Qt+=Math.abs(Jn-Wt)),(xt<yt-.5||xt===yt&&ft<ut-.5||xt===yt&&ft===ut&&Qt<te-.5)&&(lt=ot=!0,E[z].column=jt,E[z+1].column=Wt,ut=E[z],E[z]=E[z+1],E[z+1]=ut)}for(z=0;z<b;z++)E[z].index=z;return Ld(a,y,E),ot}So.prototype.straightenAndPack=function(){if(this.ve===0){var a=(this.bg&1)!==0,y=(this.bg&Ux)!==0;if(1e3<this.network.edges.count&&y&&(a=!1),a){var x=[];for(y=0;y<=this.Ia;y++)x[y]=0;for(var E,b=this.network.vertexes.iterator;b.next();){var z=b.value;y=z.layer,E=z.column,z=this.nodeMinColumnSpace(z,!1),x[y]=Math.max(x[y],E+z)}for(b.reset();b.next();)z=b.value,y=z.layer,E=z.column,z.column=(8*(this.Ra-x[y])>>1)+8*E;this.Ra*=8}if(this.bg&2)for(x=!0;x;){for(x=!1,y=this.Md+1;y<=this.Ia;y++)x=qf(this,y,1)||x;for(y=this.Md-1;0<=y;y--)x=qf(this,y,-1)||x;x=qf(this,this.Md,0)||x}if(this.bg&4){for(y=this.Md+1;y<=this.Ia;y++)yy(this,y,1);for(y=this.Md-1;0<=y;y--)yy(this,y,-1);yy(this,this.Md,0)}if(a&&(qS(this,-1),qS(this,1)),this.bg&2)for(x=!0;x;){for(x=!1,x=qf(this,this.Md,0)||x,y=this.Md+1;y<=this.Ia;y++)x=qf(this,y,0)||x;for(y=this.Md-1;0<=y;y--)x=qf(this,y,0)||x}}else Hx(this)};function qf(a,y,x){for(var E=!1;zx(a,y,x);)E=!0;return E}function zx(a,y,x){var E,b=Ed(a,y),z=a.tc[y],tt=py(a,y,-1);if(0<x)for(E=0;E<z;E++)tt[E]=-1;var rt=py(a,y,1);if(0>x)for(E=0;E<z;E++)rt[E]=-1;for(var ot=!1,lt=!0;lt;)for(lt=!1,E=0;E<z;E++){var ut=b[E].column,ft=a.nodeMinColumnSpace(b[E],!0),yt=a.nodeMinColumnSpace(b[E],!1),xt=0;0>E-1||ut-b[E-1].column-1>ft+a.nodeMinColumnSpace(b[E-1],!1)?xt=ut-1:xt=ut,ft=E+1>=z||b[E+1].column-ut-1>yt+a.nodeMinColumnSpace(b[E+1],!0)?ut+1:ut;var Ct=yt=0,bt=0;if(0>=x)for(var Wt=b[E].sourceEdges.iterator;Wt.next();){var jt=Wt.value,Qt=jt.fromVertex;if(jt.valid&&Qt.layer!==y){var te=gy(jt),re=jt.portFromColOffset;jt=jt.portToColOffset,Qt=Qt.column,yt+=(Math.abs(ut+jt-(Qt+re))+1)*te,Ct+=(Math.abs(xt+jt-(Qt+re))+1)*te,bt+=(Math.abs(ft+jt-(Qt+re))+1)*te}}if(0<=x)for(Wt=b[E].destinationEdges.iterator;Wt.next();)jt=Wt.value,Qt=jt.toVertex,jt.valid&&Qt.layer!==y&&(te=gy(jt),re=jt.portFromColOffset,jt=jt.portToColOffset,Qt=Qt.column,yt+=(Math.abs(ut+re-(Qt+jt))+1)*te,Ct+=(Math.abs(xt+re-(Qt+jt))+1)*te,bt+=(Math.abs(ft+re-(Qt+jt))+1)*te);jt=re=te=0,Wt=tt[b[E].index],Qt=rt[b[E].index],Wt!==-1&&(te+=Math.abs(Wt-ut),re+=Math.abs(Wt-xt),jt+=Math.abs(Wt-ft)),Qt!==-1&&(te+=Math.abs(Qt-ut),re+=Math.abs(Qt-xt),jt+=Math.abs(Qt-ft)),Ct<yt||Ct===yt&&re<te?(lt=ot=!0,b[E].column=xt):(bt<yt||bt===yt&&jt<te)&&(lt=ot=!0,b[E].column=ft)}return Ld(a,y,b),a.normalize(),ot}function yy(a,y,x){var E=Ed(a,y),b=a.tc[y],z=HS(a,y,x),tt=[];for(x=0;x<b;x++)tt[x]=z[x];for(z=!0;z;)for(z=!1,x=0;x<b;x++){var rt=E[x].column,ot=a.nodeMinColumnSpace(E[x],!0),lt=a.nodeMinColumnSpace(E[x],!1),ut=0;if(tt[x]===-1)if(x===0&&x===b-1)ut=rt;else if(x===0){var ft=E[x+1].column;ft-rt===lt+a.nodeMinColumnSpace(E[x+1],!0)?ut=rt-1:ut=rt}else x===b-1?(ft=E[x-1].column,ut=rt-ft===ot+a.nodeMinColumnSpace(E[x-1],!1)?rt+1:rt):(ft=E[x-1].column,ot=ft+a.nodeMinColumnSpace(E[x-1],!1)+ot+1,ft=E[x+1].column,lt=ft-a.nodeMinColumnSpace(E[x+1],!0)-lt-1,ut=(ot+lt)/2|0);else x===0&&x===b-1?ut=tt[x]:x===0?(ft=E[x+1].column,lt=ft-a.nodeMinColumnSpace(E[x+1],!0)-lt-1,ut=Math.min(tt[x],lt)):x===b-1?(ft=E[x-1].column,ot=ft+a.nodeMinColumnSpace(E[x-1],!1)+ot+1,ut=Math.max(tt[x],ot)):(ft=E[x-1].column,ot=ft+a.nodeMinColumnSpace(E[x-1],!1)+ot+1,ft=E[x+1].column,lt=ft-a.nodeMinColumnSpace(E[x+1],!0)-lt-1,ot<tt[x]&&tt[x]<lt?ut=tt[x]:ot>=tt[x]?ut=ot:lt<=tt[x]&&(ut=lt));ut!==rt&&(z=!0,E[x].column=ut)}Ld(a,y,E),a.normalize()}function Zx(a,y){for(var x=!0,E=a.network.vertexes.iterator;E.next();){var b=E.value,z=a.nodeMinColumnSpace(b,!0),tt=a.nodeMinColumnSpace(b,!1);if(b.column-z<=y&&b.column+tt>=y){x=!1;break}}if(a=!1,x)for(E.reset();E.next();)x=E.value,x.column>y&&(--x.column,a=!0);return a}function Gx(a,y){var x=y+1,E,b=[],z=[];for(E=0;E<=a.Ia;E++)b[E]=!1,z[E]=!1;for(var tt=a.network.vertexes.iterator;tt.next();){E=tt.value;var rt=E.column-a.nodeMinColumnSpace(E,!0),ot=E.column+a.nodeMinColumnSpace(E,!1);rt<=y&&ot>=y&&(b[E.layer]=!0),rt<=x&&ot>=x&&(z[E.layer]=!0)}for(rt=!0,x=!1,E=0;E<=a.Ia;E++)rt=rt&&!(b[E]&&z[E]);if(rt)for(tt.reset();tt.next();)a=tt.value,a.column>y&&(--a.column,x=!0);return x}function qS(a,y){for(var x=0;x<=a.Ra;x++)for(;Zx(a,x););for(a.normalize(),x=0;x<a.Ra;x++)for(;Gx(a,x););a.normalize();var E;if(0<y)for(x=0;x<=a.Ra;x++){var b=Rs(a),z=C0(a);for(E=z+1;z<E;){E=z,tx(a,x,1);var tt=C0(a);tt>z?wl(a,b):tt<z&&(z=tt,b=Rs(a))}}if(0>y)for(x=a.Ra;0<=x;x--)for(b=Rs(a),z=C0(a),E=z+1;z<E;)E=z,tx(a,x,-1),tt=C0(a),tt>z?wl(a,b):tt<z&&(z=tt,b=Rs(a));a.normalize()}function tx(a,y,x){a.le=0;for(var E=a.network.vertexes.iterator;E.next();)E.value.component=-1;if(0<x)for(E.reset();E.next();){var b=E.value;b.column-a.nodeMinColumnSpace(b,!0)<=y&&(b.component=a.le)}if(0>x)for(E.reset();E.next();)b=E.value,b.column+a.nodeMinColumnSpace(b,!1)>=y&&(b.component=a.le);for(a.le++,E.reset();E.next();)y=E.value,y.component===-1&&(my(a,y,a.le,-1,!0,!0),a.le++);var z;for(y=[],z=0;z<a.le*a.le;z++)y[z]=!1;for(b=[],z=0;z<(a.Ia+1)*(a.Ra+1);z++)b[z]=-1;for(E.reset();E.next();){z=E.value;for(var tt=z.layer,rt=Math.max(0,z.column-a.nodeMinColumnSpace(z,!0)),ot=Math.min(a.Ra,z.column+a.nodeMinColumnSpace(z,!1));rt<=ot;rt++)b[tt*(a.Ra+1)+rt]=z.component}for(z=0;z<=a.Ia;z++){if(0<x)for(tt=0;tt<a.Ra;tt++)b[z*(a.Ra+1)+tt]!==-1&&b[z*(a.Ra+1)+tt+1]!==-1&&b[z*(a.Ra+1)+tt]!==b[z*(a.Ra+1)+tt+1]&&(y[b[z*(a.Ra+1)+tt]*a.le+b[z*(a.Ra+1)+tt+1]]=!0);if(0>x)for(tt=a.Ra;0<tt;tt--)b[z*(a.Ra+1)+tt]!==-1&&b[z*(a.Ra+1)+tt-1]!==-1&&b[z*(a.Ra+1)+tt]!==b[z*(a.Ra+1)+tt-1]&&(y[b[z*(a.Ra+1)+tt]*a.le+b[z*(a.Ra+1)+tt-1]]=!0)}for(b=[],z=0;z<a.le;z++)b[z]=!0;for(tt=[],tt.push(0);tt.length!==0;)if(ot=tt[tt.length-1],tt.pop(),b[ot])for(b[ot]=!1,z=0;z<a.le;z++)y[ot*a.le+z]&&tt.splice(0,0,z);if(0<x)for(E.reset();E.next();)a=E.value,b[a.component]&&--a.column;if(0>x)for(E.reset();E.next();)x=E.value,b[x.component]&&(x.column+=1)}function Hx(a){for(var y=pi(),x=a.fl.length,E=0;E<=x;E++)y[E]=[];for(E=a.network.vertexes.iterator;E.next();){var b=E.value;y[x-b.layer][b.index]=b}x=new pn,Wx(y,x);var z=null,tt=null,rt=null,ot=null,lt=(a.ve&1)!==0,ut=(a.ve&2)!==0,ft=(a.ve&4)!==0,yt=(a.ve&8)!==0;for(lt&&(a.verticalAlignment(y,x,!0),z=L0(a,y,!0,!1)),y.reverse(),ft&&(a.verticalAlignment(y,x,!1),rt=L0(a,y,!1,!1)),E=Wn(y),b=E.next();!b.done;b=E.next())b.value.reverse();yt&&(a.verticalAlignment(y,x,!1),ot=L0(a,y,!1,!0)),y.reverse(),ut&&(a.verticalAlignment(y,x,!0),tt=L0(a,y,!0,!0)),oi(y),a.u(z,tt,rt,ot),a.network.vertexes.each(function(xt){var Ct=pi();lt&&Ct.push(z.get(xt)),ut&&Ct.push(tt.get(xt)),ft&&Ct.push(rt.get(xt)),yt&&Ct.push(ot.get(xt)),Ct.sort(function(Wt,jt){return Wt-jt});var bt=Ct.length;bt=(Ct[Math.floor((bt-1)/2)]+Ct[Math.ceil((bt-1)/2)])/2,oi(Ct),xt.zc=bt})}function Wx(a,y){for(var x=a.length,E=1;E<x-1;E++)for(var b=0,z=0,tt=a[E],rt=a[E+1],ot=0;z<rt.length;ot++){var lt=rt[ot];t:{if(lt.node===null){var ut=Fy(lt);if(0<ut.length){ut=ut[0].node===null;break t}}ut=!1}var ft=ut;if(ot===rt.length-1||ft){for(ut=tt.length-1,ft&&(ut=Fy(lt)[0].index);z<=ot;){if(lt=rt[z],!lt.bo){ft=[];for(var yt=Wn(lt.sourceEdgesArrayAccess),xt=yt.next();!xt.done;xt=yt.next())xt=xt.value,xt.valid&&ft.push(xt);lt.bo=ft}for(lt=Wn(lt.bo),ft=lt.next();!ft.done;ft=lt.next())ft=ft.value,yt=ft.fromVertex.index,(yt<b||yt>ut)&&y.add(ft);z++}b=ut}}}So.prototype.verticalAlignment=function(a,y,x){Vx(a),a=Wn(a);for(var E=a.next();!E.done;E=a.next()){var b=-1;E=Wn(E.value);for(var z=E.next();!z.done;z=E.next()){z=z.value;var tt=x?Fy(z):Yx(z),rt=tt.length;if(0<rt){tt.sort(function(ft,yt){return ft.vi-yt.vi});var ot=(rt-1)/2;for(rt=Math.floor(ot),ot=Math.ceil(ot);rt<=ot;rt++)if(z.align===z){var lt=tt[rt],ut=void 0;ut=x?B0(lt,z):B0(z,lt),!y.contains(ut)&&b<lt.vi&&(lt.align=z,z.root=lt.root,z.align=lt.root,b=lt.vi)}}}}};function Vx(a){for(var y=0;y<a.length;y++)for(var x=a[y],E=0;E<x.length;E++){var b=x[E];b.root=b,b.align=b,b.Tz=y,b.vi=E}}function L0(a,y,x,E){for(var b=a.K===90||a.K===270,z=Wn(y),tt=z.next();!tt.done;tt=z.next()){var rt=Wn(tt.value);for(tt=rt.next();!tt.done;tt=rt.next())tt=tt.value,tt.sd=tt,tt.shift=1/0,tt.zc=NaN,tt.qg=0}for(tt=a.K===90||a.K===270,z=Wn(y),rt=z.next();!rt.done;rt=z.next()){rt=Wn(rt.value);for(var ot=rt.next();!ot.done;ot=rt.next())if(ot=ot.value,ot.root===ot){for(var lt=0,ut=ot;ut.align!==ot;){var ft=ut.align,yt=tt?ut.width:ut.height,xt=tt?ft.width:ft.height;if(x){var Ct=B0(ut,ft),bt=Ct.portFromPos,Wt=Ct.portToPos;Ct.link!==null&&(ut.node&&ut.node!==Ct.link.fromNode&&(bt=tt?ut.focusX:ut.focusY),ft.node&&ft.node!==Ct.link.toNode&&(Wt=tt?ft.focusX:ft.focusY))}else Ct=B0(ft,ut),bt=Ct.portToPos,Wt=Ct.portFromPos,Ct.link!==null&&(ut.node&&ut.node!==Ct.link.toNode&&(bt=tt?ut.focusX:ut.focusY),ft.node&&ft.node!==Ct.link.fromNode&&(Wt=tt?ft.focusX:ft.focusY));yt=E?ut.qg+(yt-bt)-(xt-Wt):ut.qg+bt-Wt,ft.qg=yt,lt=Math.min(lt,yt),ut=ut.align}ut=ot;do ut.qg=ut.qg-lt,ut=ut.align;while(ut!==ot)}}for(x=Wn(y),tt=x.next();!tt.done;tt=x.next())for(z=Wn(tt.value),tt=z.next();!tt.done;tt=z.next())tt=tt.value,tt.root===tt&&ex(a,tt,y);for(x=0;x<y.length;x++)if(!(0>=y[x].length)&&(tt=y[x][0],tt.sd===tt)){tt.sd.shift===1/0&&(tt.sd.shift=0),tt=x,rt=0;do{for(z=y[tt][rt];z.align!==z.root;)z=z.align,tt++,0<z.vi&&(rt=nx(z,y),rt.sd.shift=Math.min(rt.sd.shift,z.sd.shift+z.zc+z.qg-(rt.zc+rt.qg+(b?rt.width:rt.height)+a.columnSpacing)));rt=z.vi+1}while(tt<y.length&&rt<y[tt].length&&z.sd===y[tt][rt].sd)}for(a=new Ie,y=Wn(y),tt=y.next();!tt.done;tt=y.next())for(x=Wn(tt.value),tt=x.next();!tt.done;tt=x.next())tt=tt.value,tt.zc=tt.zc+tt.sd.shift+tt.qg,z=b?tt.width:tt.height,a.add(tt,E?-tt.zc-z:tt.zc);return a}function ex(a,y,x){if(isNaN(y.zc)){y.zc=0;var E=y;do{if(0<E.vi){var b=nx(E,x),z=b.root;ex(a,z,x),y.sd===y&&(y.sd=z.sd);var tt=a.K===90||a.K===270?b.width:b.height;y.sd===z.sd&&(y.zc=Math.max(y.zc,z.zc+b.qg+tt-E.qg+a.columnSpacing))}E=E.align}while(E!==y);for(;E.align!==y;)E=E.align,E.zc=y.zc,E.sd=y.sd}}function nx(a,y){var x=a.Tz;return a=a.vi,1>a&&$t("Could not determine previous vertex in layer"),y[x][a-1]}So.prototype.u=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];x=-1;for(var E=pi(),b=pi(),z=1/0,tt=0;4>tt;tt++)if(y[tt]){var rt=Kx(this,y[tt],E,b,tt);rt<z&&(x=tt,z=rt)}for(z={},tt=0;4>tt;z={delta:z.delta},tt++)y[tt]&&(z.delta=tt===0||tt===2?E[x]-E[tt]:b[x]-b[tt],z.delta!==0&&y[tt].each(function(ot){return function(lt){lt.value+=ot.delta}}(z)));oi(E),oi(b)};function Kx(a,y,x,E,b){if(!y||y.count===0)return x[b]=0,E[b]=0,1/0;var z=1/0,tt=-1/0;return y.each(function(rt){var ot=rt.key;rt=rt.value,ot=a.K===90||a.K===270?ot.width:ot.height,rt<z&&(z=rt),rt+ot>tt&&(tt=rt+ot)}),x[b]=z,E[b]=tt,tt-z}So.prototype.commitLayout=function(){if(this.setsPortSpots)for(var a=F0(this,!0),y=F0(this,!1),x=this.network.edges.iterator;x.next();){var E=x.value.link;E!==null&&(E.fromSpot=a,E.toSpot=y)}this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()};function F0(a,y){return a.K===270?y?Xa:Ma:a.K===90?y?Ma:Xa:a.K===180?y?ns:Fa:y?Fa:ns}So.prototype.commitNodes=function(){this.he=[],this.Ld=[],this.Kd=[],this.Ta=[];for(var a=0;a<=this.Ia;a++)this.he[a]=0,this.Ld[a]=0,this.Kd[a]=0,this.Ta[a]=0;for(a=this.network.vertexes.iterator;a.next();){var y=a.value,x=y.layer;this.he[x]=Math.max(this.he[x],this.nodeMinLayerSpace(y,!0)),this.Ld[x]=Math.max(this.Ld[x],this.nodeMinLayerSpace(y,!1))}y=0,x=this.ie;for(var E=0;E<=this.Ia;E++){var b=x;0>=this.he[E]+this.Ld[E]&&(b=0),0<E&&(y+=b/2),this.K===90||this.K===0?(y+=this.Ld[E],this.Kd[E]=y,y+=this.he[E]):(y+=this.he[E],this.Kd[E]=y,y+=this.Ld[E]),E<this.Ia&&(y+=b/2),this.Ta[E]=y}for(x=y,y=this.arrangementOrigin,E=0;E<=this.Ia;E++)this.K===270?this.Kd[E]=y.y+this.Kd[E]:this.K===90?(this.Kd[E]=y.y+x-this.Kd[E],this.Ta[E]=x-this.Ta[E]):this.K===180?this.Kd[E]=y.x+this.Kd[E]:(this.Kd[E]=y.x+x-this.Kd[E],this.Ta[E]=x-this.Ta[E]);x=this.ve!==0,a.reset(),E=this.K===270||this.K===90;for(var z=1/0,tt=b=1/0,rt=-1/0;a.next();){var ot=a.value,lt=ot.layer,ut=ot.column|0;E?(tt=y.x+this.kc*ut,lt=this.Kd[lt]):(tt=this.Kd[lt],lt=y.y+this.kc*ut),ot.centerX=tt,ot.centerY=lt,x&&isFinite(ot.zc)&&(E?ot.node?ot.x=y.x+ot.zc:ot.centerX=y.x+ot.zc:ot.node?ot.y=y.y+ot.zc:ot.centerY=y.y+ot.zc),z=Math.min(ot.x,z),b=Math.min(ot.y,b),E?(tt=z,rt=Math.max(rt,ot.bounds.right)):(tt=b,rt=Math.max(rt,ot.bounds.bottom))}for(this.xw=rt-tt,z=y.x-z,y=y.y-b,this.Rf=new At(x&&E?0:z,x&&!E?0:y),a.reset();a.next();)x=a.value,x.x+=z,x.y+=y,x.commit()},So.prototype.Gu=function(){for(var a=0,y=this.ie,x=0;x<=this.Ia;x++)a+=this.he[x],a+=this.Ld[x];a+=this.Ia*y,y=[],x=this.ve!==0?this.xw:this.kc*this.Ra;for(var E=this.maxLayer;0<=E;E--)this.K===270?E===0?y.push(new Be(0,0,x,Math.abs(this.Ta[0]))):y.push(new Be(0,this.Ta[E-1],x,Math.abs(this.Ta[E-1]-this.Ta[E]))):this.K===90?E===0?y.push(new Be(0,this.Ta[0],x,Math.abs(this.Ta[0]-a))):y.push(new Be(0,this.Ta[E],x,Math.abs(this.Ta[E-1]-this.Ta[E]))):this.K===180?E===0?y.push(new Be(0,0,Math.abs(this.Ta[0]),x)):y.push(new Be(this.Ta[E-1],0,Math.abs(this.Ta[E-1]-this.Ta[E]),x)):E===0?y.push(new Be(this.Ta[0],0,Math.abs(this.Ta[0]-a),x)):y.push(new Be(this.Ta[E],0,Math.abs(this.Ta[E-1]-this.Ta[E]),x));this.commitLayers(y,this.Rf)},So.prototype.commitLayers=function(){},So.prototype.commitLinks=function(){for(var a=this.network.edges.iterator,y;a.next();)y=a.value.link,y!==null&&(y.uh(),y.Fj(),y.zf());for(a.reset();a.next();)y=a.value.link,y!==null&&y.vg();for(a.reset();a.next();){var x=a.value;if(y=x.link,y!==null){y.uh();var E=y,b=E.fromNode,z=E.toNode,tt=E.fromPort,rt=E.toPort;if(b!==null){var ot=b.findVisibleNode();ot!==null&&ot!==b&&(b=ot,tt=ot.port)}z!==null&&(ot=z.findVisibleNode(),ot!==null&&ot!==z&&(z=ot,rt=ot.port));var lt=y.computeSpot(!0,tt);ot=y.computeSpot(!1,rt);var ut=x.fromVertex,ft=x.toVertex;if(x.valid)y.curve===ul&&y.pointsCount===4&&(ut.column===ft.column&&this.alignOption===0?(x=y.getLinkPoint(b,tt,lt,!0,!1,z,rt),rt=y.getLinkPoint(z,rt,ot,!1,!1,b,tt),x.w()||x.set(b.actualBounds.center),rt.w()||rt.set(z.actualBounds.center),y.Fj(),y.yf(x.x,x.y),y.yf((2*x.x+rt.x)/3,(2*x.y+rt.y)/3),y.yf((x.x+2*rt.x)/3,(x.y+2*rt.y)/3),y.yf(rt.x,rt.y)):(x=E=!1,tt!==null&&lt===gr&&(E=!0),rt!==null&&ot===gr&&(x=!0),(E||x)&&(ot=null,E&&(ot=y.getLinkPointFromPoint(b,tt,tt.ga(Or),y.i(3),!0),ot.w()||ot.set(b.actualBounds.center),y.L(0,ot.x,ot.y)),b=null,x&&(b=y.getLinkPointFromPoint(z,rt,rt.ga(Or),y.i(0),!1),b.w()||b.set(z.actualBounds.center),y.L(3,b.x,b.y)),ot&&(z=y.i(2),y.L(1,(2*ot.x+z.x)/3,(2*ot.y+z.y)/3)),b&&(z=y.i(1),y.L(2,(2*b.x+z.x)/3,(2*b.y+z.y)/3))))),y.zf();else if(ut.layer===ft.layer)y.zf();else{var yt=!1,xt=!1,Ct=this.ie,bt=y.firstPickIndex+1;if(y.isOrthogonal){xt=!0;var Wt=y.pointsCount;4<Wt&&y.points.removeRange(2,Wt-3)}else if(y.curve===ul)yt=!0,Wt=y.pointsCount,4<Wt&&y.points.removeRange(2,Wt-3),Wt===4&&(bt=2);else{Wt=y.pointsCount;var jt=lt===gr,Qt=ot===gr;2<Wt&&jt&&Qt?y.points.removeRange(1,Wt-2):3<Wt&&jt&&!Qt?y.points.removeRange(1,Wt-3):3<Wt&&!jt&&Qt?y.points.removeRange(2,Wt-2):4<Wt&&!jt&&!Qt&&y.points.removeRange(2,Wt-3)}if(x.rev){for(;ft!==null&&ut!==ft;){var te=Wt=null;for(jt=ft.sourceEdges.iterator;jt.next()&&(Qt=jt.value,Qt.link!==x.link||(Wt=Qt.fromVertex,te=Qt.toVertex,Wt.node!==null)););if(Wt===null)break;if(Wt!==ut){jt=y.i(bt-1).x,Qt=y.i(bt-1).y;var re=Wt.centerX,he=Wt.centerY;if(xt)this.K===180||this.K===0?bt===y.firstPickIndex+1?(y.m(bt++,jt,Qt),y.m(bt++,jt,he)):(te!==null?te.centerY:Qt)!==he&&(te=this.Ta[Wt.layer-1]+this.Rf.x,y.m(bt++,te,Qt),y.m(bt++,te,he)):bt===y.firstPickIndex+1?(y.m(bt++,jt,Qt),y.m(bt++,re,Qt)):(te!==null?te.centerX:jt)!==re&&(te=this.Ta[Wt.layer-1]+this.Rf.y,y.m(bt++,jt,te),y.m(bt++,re,te));else if(bt===y.firstPickIndex+1){te=Math.max(10,this.he[ft.layer]);var ke=Math.max(10,this.Ld[ft.layer]);if(yt)this.K===180?re<=ft.bounds.x?(ft=ft.bounds.x,y.m(bt++,ft-te,he),y.m(bt++,ft,he),y.m(bt++,ft+ke,he)):(y.m(bt++,re-te,he),y.m(bt++,re,he),y.m(bt++,re+ke,he)):this.K===90?he>=ft.bounds.bottom?(ft=ft.bounds.y+ft.bounds.height,y.m(bt++,re,ft+ke),y.m(bt++,re,ft),y.m(bt++,re,ft-te)):(y.m(bt++,re,he+ke),y.m(bt++,re,he),y.m(bt++,re,he-te)):this.K===270?he<=ft.bounds.y?(ft=ft.bounds.y,y.m(bt++,re,ft-te),y.m(bt++,re,ft),y.m(bt++,re,ft+ke)):(y.m(bt++,re,he-te),y.m(bt++,re,he),y.m(bt++,re,he+ke)):this.K===0&&(re>=ft.bounds.right?(ft=ft.bounds.x+ft.bounds.width,y.m(bt++,ft+ke,he),y.m(bt++,ft,he),y.m(bt++,ft-te,he)):(y.m(bt++,re+ke,he),y.m(bt++,re,he),y.m(bt++,re-te,he)));else{y.m(bt++,jt,Qt);var Jn=0;this.K===180||this.K===0?((this.K===180?re>=ft.bounds.right:re<=ft.bounds.x)&&(Jn=(this.K===0?-te:ke)/2),y.m(bt++,jt+Jn,he)):((this.K===270?he>=ft.bounds.bottom:he<=ft.bounds.y)&&(Jn=(this.K===90?-te:ke)/2),y.m(bt++,re,Qt+Jn)),y.m(bt++,re,he)}}else te=Math.max(10,this.he[Wt.layer]),ke=Math.max(10,this.Ld[Wt.layer]),yt?this.K===180?(y.m(bt++,re-te-Ct,he),y.m(bt++,Math.min(re-te+Ct/2,re),he),y.m(bt++,re,he),y.m(bt++,re,he),y.m(bt++,Math.max(re+ke-Ct/2,re),he),y.m(bt++,re+ke+Ct,he)):this.K===90?(y.m(bt++,re,he+ke+Ct),y.m(bt++,re,Math.max(he+ke-Ct/2,he)),y.m(bt++,re,he),y.m(bt++,re,he),y.m(bt++,re,Math.min(he-te+Ct/2,he)),y.m(bt++,re,he-te-Ct)):this.K===270?(y.m(bt++,re,he-te-Ct),y.m(bt++,re,Math.min(he-te+Ct/2,he)),y.m(bt++,re,he),y.m(bt++,re,he),y.m(bt++,re,Math.max(he+ke-Ct/2,he)),y.m(bt++,re,he+ke+Ct)):(y.m(bt++,re+ke+Ct,he),y.m(bt++,Math.max(re+ke-Ct/2,re),he),y.m(bt++,re,he),y.m(bt++,re,he),y.m(bt++,Math.min(re-te+Ct/2,re),he),y.m(bt++,re-te-Ct,he)):y.m(bt++,re,he)}ft=Wt}(rt===null||lt!==gr||xt)&&(jt=y.i(bt-1).x,Qt=y.i(bt-1).y,re=y.i(bt).x,he=y.i(bt).y,xt?(Ct=this.Ld[ut.layer],this.K===180||this.K===0?(xt=Qt,xt>=ut.bounds.y&&xt<=ut.bounds.bottom&&(this.K===180?re>=ut.bounds.x:re<=ut.bounds.right)&&(ft=ut.centerX+(this.K===180?-Ct:Ct),xt<ut.bounds.y+ut.bounds.height/2?xt=ut.bounds.y-this.kc/2:xt=ut.bounds.bottom+this.kc/2,y.m(bt++,ft,Qt),y.m(bt++,ft,xt)),y.m(bt++,re,xt)):(xt=jt,xt>=ut.bounds.x&&xt<=ut.bounds.right&&(this.K===270?he>=ut.bounds.y:he<=ut.bounds.bottom)&&(ft=ut.centerY+(this.K===270?-Ct:Ct),xt<ut.bounds.x+ut.bounds.width/2?xt=ut.bounds.x-this.kc/2:xt=ut.bounds.right+this.kc/2,y.m(bt++,jt,ft),y.m(bt++,xt,ft)),y.m(bt++,xt,he)),y.m(bt++,re,he)):yt?(te=Math.max(10,this.he[ut.layer]),ke=Math.max(10,this.Ld[ut.layer]),this.K===180&&re>=ut.bounds.x?(ft=ut.bounds.x+ut.bounds.width,y.L(bt-2,ft,Qt),y.L(bt-1,ft+ke,Qt)):this.K===90&&he<=ut.bounds.bottom?(ft=ut.bounds.y,y.L(bt-2,jt,ft),y.L(bt-1,jt,ft-te)):this.K===270&&he>=ut.bounds.y?(ft=ut.bounds.y+ut.bounds.height,y.L(bt-2,jt,ft),y.L(bt-1,jt,ft+ke)):this.K===0&&re<=ut.bounds.right&&(ft=ut.bounds.x,y.L(bt-2,ft,Qt),y.L(bt-1,ft-te,Qt))):(te=Math.max(10,this.he[ut.layer]),ke=Math.max(10,this.Ld[ut.layer]),xt=0,this.K===180||this.K===0?((this.K===180?re<=ut.bounds.x:re>=ut.bounds.right)&&(xt=(this.K===0?ke:-te)/2),y.m(bt++,re+xt,Qt)):((this.K===270?he<=ut.bounds.y:he>=ut.bounds.bottom)&&(xt=(this.K===90?ke:-te)/2),y.m(bt++,jt,he+xt)),y.m(bt++,re,he)))}else{for(;ut!==null&&ut!==ft;){for(te=Wt=null,ut=ut.destinationEdges.iterator;ut.next()&&(jt=ut.value,jt.link!==x.link||(Wt=jt.toVertex,te=jt.fromVertex,te.node!==null&&(te=null),Wt.node!==null)););if(Wt===null)break;Wt!==ft&&(jt=y.i(bt-1).x,Qt=y.i(bt-1).y,re=Wt.centerX,he=Wt.centerY,xt?this.K===180||this.K===0?(te!==null?te.centerY:Qt)!==he&&(te=this.Ta[Wt.layer]+this.Rf.x,bt===y.firstPickIndex+1&&(te=this.K===0?Math.max(te,jt):Math.min(te,jt)),y.m(bt++,te,Qt),y.m(bt++,te,he)):(te!==null?te.centerX:jt)!==re&&(te=this.Ta[Wt.layer]+this.Rf.y,bt===y.firstPickIndex+1&&(te=this.K===90?Math.max(te,Qt):Math.min(te,Qt)),y.m(bt++,jt,te),y.m(bt++,re,te)):(te=Math.max(10,this.he[Wt.layer]),ke=Math.max(10,this.Ld[Wt.layer]),yt?this.K===180?(y.m(bt++,re+ke+Ct,he),y.m(bt++,Math.max(re+ke-Ct/2,re),he),y.m(bt++,re,he),y.m(bt++,re,he),y.m(bt++,Math.min(re-te+Ct/2,re),he),y.m(bt++,re-te-Ct,he)):this.K===90?(y.m(bt++,re,he-te-Ct),y.m(bt++,re,Math.min(he-te+Ct/2,he)),y.m(bt++,re,he),y.m(bt++,re,he),y.m(bt++,re,Math.max(he+ke-Ct/2,he)),y.m(bt++,re,he+ke+Ct)):this.K===270?(y.m(bt++,re,he+ke+Ct),y.m(bt++,re,Math.max(he+ke-Ct/2,he)),y.m(bt++,re,he),y.m(bt++,re,he),y.m(bt++,re,Math.min(he-te+Ct/2,he)),y.m(bt++,re,he-te-Ct)):(y.m(bt++,re-te-Ct,he),y.m(bt++,Math.min(re-te+Ct/2,re),he),y.m(bt++,re,he),y.m(bt++,re,he),y.m(bt++,Math.max(re+ke-Ct/2,re),he),y.m(bt++,re+ke+Ct,he)):this.K===180?(y.m(bt++,re+ke,he),y.m(bt++,re-te,he)):this.K===90?(y.m(bt++,re,he-te),y.m(bt++,re,he+ke)):this.K===270?(y.m(bt++,re,he+ke),y.m(bt++,re,he-te)):(y.m(bt++,re-te,he),y.m(bt++,re+ke,he)))),ut=Wt}xt&&(jt=y.i(bt-1).x,Qt=y.i(bt-1).y,re=y.i(bt).x,he=y.i(bt).y,this.K===180||this.K===0?Qt!==he&&(te=this.K===0?Math.min(Math.max((re+jt)/2,this.Ta[ft.layer]+this.Rf.x),re):Math.max(Math.min((re+jt)/2,this.Ta[ft.layer]+this.Rf.x),re),y.m(bt++,te,Qt),y.m(bt++,te,he)):jt!==re&&(te=this.K===90?Math.min(Math.max((he+Qt)/2,this.Ta[ft.layer]+this.Rf.y),he):Math.max(Math.min((he+Qt)/2,this.Ta[ft.layer]+this.Rf.y),he),y.m(bt++,jt,te),y.m(bt++,re,te)))}E!==null&&yt&&4<=y.pointsCount&&(tt!==null&&(tt=lt===gr?y.getLinkPointFromPoint(b,tt,tt.ga(Or),y.i(3),!0):y.i(0),lt===gr&&(lt=y.i(2),E=y.i(3),this.direction===90||this.direction===270?(y.L(1,(tt.x+lt.x)/2,lt.y),y.L(2,E.x,(lt.y+E.y)/2)):(y.L(1,lt.x,(tt.y+lt.y)/2),y.L(2,(lt.x+E.x)/2,E.y))),tt.w()||tt.set(b.actualBounds.center),y.L(0,tt.x,tt.y)),rt!==null&&(b=ot===gr?y.getLinkPointFromPoint(z,rt,rt.ga(Or),y.i(y.pointsCount-4),!1):y.i(y.pointsCount-1),ot===gr&&(rt=y.i(y.pointsCount-3),ot=y.i(y.pointsCount-4),this.direction===90||this.direction===270?(y.L(y.pointsCount-2,(b.x+rt.x)/2,rt.y),y.L(y.pointsCount-2,ot.x,(rt.y+ot.y)/2)):(y.L(y.pointsCount-2,rt.x,(b.y+rt.y)/2),y.L(y.pointsCount-3,(rt.x+ot.x)/2,ot.y))),b.w()||b.set(z.actualBounds.center),y.L(y.pointsCount-1,b.x,b.y))),y.zf(),x.commit()}}}this.avoidOrthogonalOverlaps()},So.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var a=new fn,y=this.network.edges.iterator;y.next();){var x=y.value.link;x!==null&&x.isOrthogonal&&!a.contains(x)&&a.add(x)}if(0<a.count)if(this.K===90||this.K===270){for(y=0,x=[],a=a.iterator;a.next();){var E=a.value;if(E!==null&&E.isOrthogonal)for(var b=2;b<E.pointsCount-3;b++){var z=E.i(b),tt=E.i(b+1);if(this.B(z.y,tt.y)&&!this.B(z.x,tt.x)){var rt=new Fd;rt.layer=Math.floor(z.y/2);var ot=E.i(0),lt=E.i(E.pointsCount-1);if(rt.first=ot.x*ot.x+ot.y,rt.jc=lt.x*lt.x+lt.y,rt.rd=Math.min(z.x,tt.x),rt.Ic=Math.max(z.x,tt.x),rt.index=b,rt.link=E,b+2<E.pointsCount){ot=E.i(b-1),lt=E.i(b+2);var ut=0;ot.y<z.y?ut=lt.y<z.y?3:z.x<tt.x?2:1:ot.y>z.y&&(ut=lt.y>z.y?0:tt.x<z.x?2:1),rt.j=ut}x.push(rt)}}}if(1<x.length)for(x.sort(this.Vx),a=0;a<x.length;){for(z=x[a].layer,E=a+1;E<x.length&&x[E].layer===z;)E++;if(1<E-a)for(z=a;z<E;){for(tt=x[z].Ic,b=a+1;b<E&&x[b].rd<tt;)tt=Math.max(tt,x[b].Ic),b++;if(tt=b-z,1<tt){for(this.zi(x,this.Js,z,z+tt),ut=1,rt=x[z].jc,ot=z;ot<b;ot++)lt=x[ot],lt.jc!==rt&&(ut++,rt=lt.jc);this.zi(x,this.Ux,z,z+tt);var ft=1;for(rt=x[z].first,ot=z;ot<b;ot++)lt=x[ot],lt.first!==rt&&(ft++,rt=lt.first);for(ot=!0,lt=ft,ut<ft?(ot=!1,lt=ut,rt=x[z].jc,this.zi(x,this.Js,z,z+tt)):rt=x[z].first,ut=0,ft=z;ft<b;ft++){var yt=x[ft];(ot?yt.first:yt.jc)!==rt&&(ut++,rt=ot?yt.first:yt.jc);var xt=yt.link;z=xt.i(yt.index),tt=xt.i(yt.index+1);var Ct=this.linkSpacing*(ut-(lt-1)/2);y++,xt.uh(),xt.L(yt.index,z.x,z.y+Ct),xt.L(yt.index+1,tt.x,tt.y+Ct),xt.zf()}}z=b}a=E}}else{for(y=0,x=[],a=a.iterator;a.next();)if(E=a.value,E!==null&&E.isOrthogonal)for(b=2;b<E.pointsCount-3;b++)z=E.i(b),tt=E.i(b+1),this.B(z.x,tt.x)&&!this.B(z.y,tt.y)&&(rt=new Fd,rt.layer=Math.floor(z.x/2),ot=E.i(0),lt=E.i(E.pointsCount-1),rt.first=ot.x+ot.y*ot.y,rt.jc=lt.x+lt.y*lt.y,rt.rd=Math.min(z.y,tt.y),rt.Ic=Math.max(z.y,tt.y),rt.index=b,rt.link=E,b+2<E.pointsCount&&(ot=E.i(b-1),lt=E.i(b+2),ut=0,ot.x<z.x?ut=lt.x<z.x?3:z.y<tt.y?2:1:ot.x>z.x&&(ut=lt.x>z.x?0:tt.y<z.y?2:1),rt.j=ut),x.push(rt));if(1<x.length)for(x.sort(this.Vx),a=0;a<x.length;){for(z=x[a].layer,E=a+1;E<x.length&&x[E].layer===z;)E++;if(1<E-a)for(z=a;z<E;){for(tt=x[z].Ic,b=a+1;b<E&&x[b].rd<tt;)tt=Math.max(tt,x[b].Ic),b++;if(tt=b-z,1<tt){for(this.zi(x,this.Js,z,z+tt),ut=1,rt=x[z].jc,ot=z;ot<b;ot++)lt=x[ot],lt.jc!==rt&&(ut++,rt=lt.jc);for(this.zi(x,this.Ux,z,z+tt),ft=1,rt=x[z].first,ot=z;ot<b;ot++)lt=x[ot],lt.first!==rt&&(ft++,rt=lt.first);for(ot=!0,lt=ft,ut<ft?(ot=!1,lt=ut,rt=x[z].jc,this.zi(x,this.Js,z,z+tt)):rt=x[z].first,ut=0,ft=z;ft<b;ft++)yt=x[ft],(ot?yt.first:yt.jc)!==rt&&(ut++,rt=ot?yt.first:yt.jc),xt=yt.link,z=xt.i(yt.index),tt=xt.i(yt.index+1),Ct=this.linkSpacing*(ut-(lt-1)/2),y++,xt.uh(),xt.L(yt.index,z.x+Ct,z.y),xt.L(yt.index+1,tt.x+Ct,tt.y),xt.zf()}z=b}a=E}}}},wt=So.prototype,wt.Vx=function(a,y){return a instanceof Fd&&y instanceof Fd&&a!==y?a.layer<y.layer?-1:a.layer>y.layer?1:a.rd<y.rd?-1:a.rd>y.rd?1:a.Ic<y.Ic?-1:a.Ic>y.Ic?1:0:0},wt.Ux=function(a,y){return a instanceof Fd&&y instanceof Fd&&a!==y?a.first<y.first?-1:a.first>y.first||a.j<y.j?1:a.j>y.j||a.rd<y.rd?-1:a.rd>y.rd?1:a.Ic<y.Ic?-1:a.Ic>y.Ic?1:0:0},wt.Js=function(a,y){return a instanceof Fd&&y instanceof Fd&&a!==y?a.jc<y.jc?-1:a.jc>y.jc||a.j<y.j?1:a.j>y.j||a.rd<y.rd?-1:a.rd>y.rd?1:a.Ic<y.Ic?-1:a.Ic>y.Ic?1:0:0},wt.B=function(a,y){return a-=y,-1<a&&1>a},wt.zi=function(a,y,x,E){var b=a.length,z=E-x;if(!(1>=z))if((0>x||x>=b-1)&&$t("not in range 0 <= from < length: "+x),z===2)E=a[x],b=a[x+1],0<y(E,b)&&(a[x]=b,a[x+1]=E);else if(x===0)if(E>=b)a.sort(y);else for(x=a.slice(0,E),x.sort(y),y=0;y<E;y++)a[y]=x[y];else if(E>=b)for(E=a.slice(x),E.sort(y),y=x;y<b;y++)a[y]=E[y-x];else for(b=a.slice(x,E),b.sort(y),y=x;y<E;y++)a[y]=b[y-x]};function Ed(a,y){var x=a.tc[y];if(x>=a.He.length){for(var E=[],b=0;b<a.He.length;b++)E[b]=a.He[b];a.He=E}for(a.He[x]===void 0||a.He[x]===null?E=[]:(E=a.He[x],a.He[x]=null),a=a.fl[y],y=0;y<a.length;y++)x=a[y],E[x.index]=x;return E}function Ld(a,y,x){a.He[a.tc[y]]=x}ve.Object.defineProperties(So.prototype,{layerSpacing:{get:function(){return this.ie},set:function(a){this.ie!==a&&0<=a&&(this.ie=a,this.C())}},columnSpacing:{get:function(){return this.kc},set:function(a){this.kc!==a&&0<a&&(this.kc=a,this.C())}},direction:{get:function(){return this.K},set:function(a){this.K!==a&&(a===0||a===90||a===180||a===270?(this.K=a,this.C()):$t("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))}},cycleRemoveOption:{get:function(){return this.Dk},set:function(a){this.Dk===a||a!==Sy&&a!==M0&&a!==kp||(this.Dk=a,this.C())}},layeringOption:{get:function(){return this.Zk},set:function(a){this.Zk===a||a!==k0&&a!==xy&&a!==Py||(this.Zk=a,this.C())}},initializeOption:{get:function(){return this.Qk},set:function(a){this.Qk===a||a!==b0&&a!==wy&&a!==Cy||(this.Qk=a,this.C())}},iterations:{get:function(){return this.bj},set:function(a){this.bj!==a&&0<=a&&(this.bj=a,this.C())}},aggressiveOption:{get:function(){return this.rk},set:function(a){this.rk===a||a!==Ey&&a!==N0&&a!==Ly||(this.rk=a,this.C())}},packOption:{get:function(){return this.bg},set:function(a){this.bg!==a&&0<=a&&8>a&&(this.bg=a,this.C())}},alignOption:{get:function(){return this.ve},set:function(a){this.ve!==a&&0<=a&&16>a&&(this.ve=a,this.C())}},setsPortSpots:{get:function(){return this.sf},set:function(a){this.sf!==a&&(this.sf=a,this.C())}},linkSpacing:{get:function(){return this.Cn},set:function(a){this.Cn!==a&&0<=a&&(this.Cn=a,this.C())}},maxLayer:{get:function(){return this.Ia}},maxIndex:{get:function(){return this.Iq}},maxColumn:{get:function(){return this.Ra}},minIndexLayer:{get:function(){return this.Hn}},maxIndexLayer:{get:function(){return this.Md}}});var M0=new He(So,"CycleDepthFirst",0),Sy=new He(So,"CycleGreedy",1),kp=new He(So,"CycleFromLayers",2),k0=new He(So,"LayerOptimalLinkLength",0),xy=new He(So,"LayerLongestPathSink",1),Py=new He(So,"LayerLongestPathSource",2),b0=new He(So,"InitDepthFirstOut",0),wy=new He(So,"InitDepthFirstIn",1),Cy=new He(So,"InitNaive",2),Ey=new He(So,"AggressiveNone",0),N0=new He(So,"AggressiveLess",1),Ly=new He(So,"AggressiveMore",2),Ux=8;So.className="LayeredDigraphLayout",So.CycleDepthFirst=M0,So.CycleGreedy=Sy,So.CycleFromLayers=kp,So.LayerOptimalLinkLength=k0,So.LayerLongestPathSink=xy,So.LayerLongestPathSource=Py,So.InitDepthFirstOut=b0,So.InitDepthFirstIn=wy,So.InitNaive=Cy,So.AggressiveNone=Ey,So.AggressiveLess=N0,So.AggressiveMore=Ly,So.PackNone=0,So.PackExpand=1,So.PackStraighten=2,So.PackMedian=4,So.PackAll=15,So.AlignNone=0,So.AlignUpperLeft=1,So.AlignUpperRight=2,So.AlignLowerLeft=4,So.AlignLowerRight=8,So.AlignAll=15;function Fd(){this.index=this.Ic=this.rd=this.jc=this.first=this.layer=0,this.link=null,this.j=0}Fd.className="SegInfo";function tg(a){Do.call(this,a)}Se(tg,Do),tg.prototype.createVertex=function(){return new Cl(this)},tg.prototype.createEdge=function(){return new bp(this)},tg.className="LayeredDigraphNetwork";function Cl(a){Ca.call(this,a),this.$n=this.bo=this.ao=this.co=null,this.Za=this.Ag=this.Ig=-1,this.u=NaN,this.F=null,this.valid=!1,this.finish=this.Ll=NaN,this.Dj=0,this.dv=this.ev=null}Se(Cl,Ca);function ix(a,y){return a.index-y.index}function B0(a,y){if(!a.$n){for(var x=[],E=Wn(a.destinationEdgesArrayAccess),b=E.next();!b.done;b=E.next())b=b.value,b.valid&&x.push(b);a.$n=x}for(a=Wn(a.$n),x=a.next();!x.done;x=a.next())if(x=x.value,x.toVertex===y)return x;$t("Unable to find destination edge to given vertex")}function Fy(a){if(!a.co){for(var y=[],x=Wn(a.sourceEdgesArrayAccess),E=x.next();!E.done;E=x.next())E=E.value,E.valid&&y.push(E.fromVertex);y.sort(ix),a.co=y}return a.co}function Yx(a){if(!a.ao){for(var y=[],x=Wn(a.destinationEdgesArrayAccess),E=x.next();!E.done;E=x.next())E=E.value,E.valid&&y.push(E.toVertex);y.sort(ix),a.ao=y}return a.ao}Cl.prototype.Cl=function(a){Ca.prototype.Cl.call(this,a),this.bo=this.co=null},Cl.prototype.Kl=function(a){Ca.prototype.Kl.call(this,a),this.bo=this.co=null},Cl.prototype.zl=function(a){Ca.prototype.zl.call(this,a),this.$n=this.ao=null},Cl.prototype.Jl=function(a){Ca.prototype.Jl.call(this,a),this.$n=this.ao=null},ve.Object.defineProperties(Cl.prototype,{layer:{get:function(){return this.Ig},set:function(a){this.Ig!==a&&(this.Ig=a)}},column:{get:function(){return this.Ag},set:function(a){this.Ag!==a&&(this.Ag=a)}},index:{get:function(){return this.Za},set:function(a){this.Za!==a&&(this.Za=a)}},component:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}},near:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a)}}}),Cl.prototype.deleteDestinationEdge=Cl.prototype.Jl,Cl.prototype.addDestinationEdge=Cl.prototype.zl,Cl.prototype.deleteSourceEdge=Cl.prototype.Kl,Cl.prototype.addSourceEdge=Cl.prototype.Cl,Cl.className="LayeredDigraphVertex";function bp(a){qs.call(this,a),this.j=this.ia=this.Ha=!1,this.V=this.u=NaN,this.F=this.o=0}Se(bp,qs),ve.Object.defineProperties(bp.prototype,{fromVertex:{get:function(){return this.kd},set:function(a){this.kd!==a&&(this.kd=a)}},toVertex:{get:function(){return this.qd},set:function(a){this.qd!==a&&(this.qd=a)}},valid:{get:function(){return this.Ha},set:function(a){this.Ha!==a&&(this.Ha=a)}},rev:{get:function(){return this.ia},set:function(a){this.ia!==a&&(this.ia=a)}},forest:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a)}},portFromPos:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}},portToPos:{get:function(){return this.V},set:function(a){this.V!==a&&(this.V=a)}},portFromColOffset:{get:function(){return this.o},set:function(a){this.o!==a&&(this.o=a)}},portToColOffset:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a)}}}),bp.className="LayeredDigraphEdge";function br(a){Wo.call(this),this.Ub=new pn,this.Wn=O0,this.ud=Xu,this.vo=_0,this.Bq=_y,this.$v=[],this.td=!0,this.Rb=R0,this.$d=new ln(10,10).freeze();var y=new Qc(this);this.W=new _l(y),this.Y=new _l(y),this.ru=[],a&&Object.assign(this,a)}Se(br,Wo),br.prototype.cloneProtected=function(a){Wo.prototype.cloneProtected.call(this,a),a.Wn=this.Wn,a.vo=this.vo,a.Bq=this.Bq,a.td=this.td,a.Rb=this.Rb,a.$d.assign(this.$d),a.W.copyInheritedPropertiesFrom(this.W),a.Y.copyInheritedPropertiesFrom(this.Y)},br.prototype.qb=function(a){a.classType===br?a.name.indexOf("Alignment")===0?this.alignment=a:a.name.indexOf("Arrangement")===0?this.arrangement=a:a.name.indexOf("Compaction")===0?this.compaction=a:a.name.indexOf("Path")===0?this.path=a:a.name.indexOf("Sorting")===0?this.sorting=a:a.name.indexOf("Style")===0?this.treeStyle=a:$t("Unknown enum value: "+a):Wo.prototype.qb.call(this,a)},br.prototype.createNetwork=function(){return new Qc(this)},br.prototype.makeNetwork=function(a){function y(E){if(E instanceof qn)return!E.isLinkLabel&&E.category!=="Comment";if(E instanceof Tn){var b=E.fromNode;return b===null||b.isLinkLabel||b.category==="Comment"?!1:(E=E.toNode,!(E===null||E.isLinkLabel||E.category==="Comment"))}return!1}var x=this.createNetwork();return a instanceof be?(x.lg(a.nodes,!0,y),x.lg(a.links,!0,y)):a instanceof or?x.lg(a.memberParts,!1,y):x.lg(a.iterator,!1,y),x},br.prototype.doLayout=function(a){this.network===null&&(this.network=this.makeNetwork(a)),this.arrangement!==j0&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var y=this.diagram;if(y===null&&a instanceof be&&(y=a),this.path===O0&&y!==null?this.ud=y.isTreePathToChildren?Xu:Xc:this.ud=this.path===O0?Xu:this.path,0<this.network.vertexes.count){for(this.network.Ko(),a=this.network.vertexes.iterator;a.next();)y=a.value,y.initialized=!1,y.level=0,y.parent=null,y.children=[];if(0<this.Ub.count){for(a=new pn,y=this.Ub.iterator;y.next();){var x=y.value;x instanceof qn?(x=this.network.ki(x),x!==null&&a.add(x)):x instanceof _l&&a.add(x)}this.Ub=a}for(this.Ub.count===0&&this.findRoots(),a=this.Ub.copy().iterator;a.next();)y=a.value,y.initialized||(y.initialized=!0,My(this,y));for(y=this.network.vertexes,a=null;a=Xx(y),0<a.count;)y=rx(this,a),y!==null&&this.Ub.add(y),y.initialized=!0,My(this,y),y=a;for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof _l&&ax(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof _l&&sx(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof _l&&lx(this,y);if(this.Cu(),this.layerStyle===z0){for(a=[],y=this.network.vertexes.iterator;y.next();){x=y.value;var E=x.parent;E===null&&(E=x),E=E.angle===0||E.angle===180;var b=a[x.level];b===void 0&&(b=0),a[x.level]=Math.max(b,E?x.width:x.height)}for(y=0;y<a.length;y++)a[y]===void 0&&(a[y]=0);for(this.$v=a,y=this.network.vertexes.iterator;y.next();)x=y.value,E=x.parent,E===null&&(E=x),E.angle===0||E.angle===180?(E.angle===180&&(x.focusX+=a[x.level]-x.width),x.width=a[x.level]):(E.angle===270&&(x.focusY+=a[x.level]-x.height),x.height=a[x.level])}else if(this.layerStyle===Ry)for(a=this.network.vertexes.iterator;a.next();){for(y=a.value,x=y.angle===0||y.angle===180,E=-1,b=0;b<y.children.length;b++){var z=y.children[b];E=Math.max(E,x?z.width:z.height)}if(0<=E)for(b=0;b<y.children.length;b++)z=y.children[b],x?(y.angle===180&&(z.focusX+=E-z.width),z.width=E):(y.angle===270&&(z.focusY+=E-z.height),z.height=E)}for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof _l&&this.layoutTree(y);this.arrangeTrees(),this.updateParts()}this.network=null,this.Ub=new pn,this.isValidLayout=!0};function Xx(a){var y=new pn;for(a=a.iterator;a.next();){var x=a.value;x.initialized||y.add(x)}return y}br.prototype.findRoots=function(){for(var a=this.network.vertexes,y=a.iterator;y.next();){var x=y.value;switch(this.ud){case Xu:x.sourceEdges.count===0&&this.Ub.add(x);break;case Xc:x.destinationEdges.count===0&&this.Ub.add(x);break;default:$t("Unhandled path value "+this.ud.toString())}}this.Ub.count===0&&(a=rx(this,a),a!==null&&this.Ub.add(a))};function rx(a,y){var x=999999,E=null;for(y=y.iterator;y.next();){var b=y.value;switch(a.ud){case Xu:b.sourceEdges.count<x&&(x=b.sourceEdges.count,E=b);break;case Xc:b.destinationEdges.count<x&&(x=b.destinationEdges.count,E=b);break;default:$t("Unhandled path value "+a.ud.toString())}}return E}function My(a,y){if(y!==null){switch(a.ud){case Xu:if(0<y.destinationEdges.count){for(var x=new fn,E=y.destinationVertexes;E.next();){var b=E.value;ox(a,y,b)&&x.add(b)}0<x.count&&(y.children=x.Fa())}break;case Xc:if(0<y.sourceEdges.count){for(x=new fn,E=y.sourceVertexes;E.next();)b=E.value,ox(a,y,b)&&x.add(b);0<x.count&&(y.children=x.Fa())}break;default:$t("Unhandled path value"+a.ud.toString())}for(x=y.children,E=x.length,b=0;b<E;b++){var z=x[b];z.initialized=!0,z.level=y.level+1,z.parent=y,a.Ub.remove(z)}for(y=0;y<E;y++)My(a,x[y])}}function ox(a,y,x){if(x.initialized){if(y===null)var E=!1;else{for(E=y.parent;E!==null&&E!==x;)E=E.parent;E=E===x}if(E||x.level>y.level)return!1;a.removeChild(x.parent,x)}return!0}br.prototype.removeChild=function(a,y){if(a!==null&&y!==null){for(var x=a.children,E=0,b=0;b<x.length;b++)x[b]===y&&E++;if(0<E){E=Array(x.length-E);for(var z=b=0;z<x.length;z++)x[z]!==y&&(E[b++]=x[z]);a.children=E}}};function ax(a,y){if(y!==null){a.initializeTreeVertexValues(y),y.alignment===$u&&a.sortTreeVertexChildren(y);for(var x=0,E=y.childrenCount,b=0,z=y.children,tt=z.length,rt=0;rt<tt;rt++){var ot=z[rt];ax(a,ot),x+=ot.descendantCount+1,E=Math.max(E,ot.maxChildrenCount),b=Math.max(b,ot.maxGenerationCount)}y.descendantCount=x,y.maxChildrenCount=E,y.maxGenerationCount=0<E?b+1:0}}function Jx(a,y){switch(a.vo){default:case _0:return y.parent!==null?y.parent:a.W;case Oy:return y.parent===null?a.W:y.parent.parent===null?a.Y:y.parent;case Dy:return y.parent!==null?y.parent.parent!==null?y.parent.parent:a.Y:a.W;case Ty:var x=!0;if(y.childrenCount===0)x=!1;else for(var E=y.children,b=E.length,z=0;z<b;z++)if(0<E[z].childrenCount){x=!1;break}return x&&y.parent!==null?a.Y:y.parent!==null?y.parent:a.W}}br.prototype.initializeTreeVertexValues=function(a){if(a.copyInheritedPropertiesFrom(Jx(this,a)),a.parent!==null&&a.parent.alignment===$u){for(var y=a.angle,x=a.parent.children,E=0;E<x.length&&a!==x[E];)E++;E%2===0?E!==x.length-1&&(y=y===90?180:y===180?270:y===270?180:270):y=y===90?0:y===180?90:y===270?0:90,a.angle=y}a.initialized=!0};function sx(a,y){if(y!==null){a.assignTreeVertexValues(y),y=y.children;for(var x=y.length,E=0;E<x;E++)sx(a,y[E])}}br.prototype.assignTreeVertexValues=function(){};function lx(a,y){if(y!==null){y.alignment!==$u&&a.sortTreeVertexChildren(y),y=y.children;for(var x=y.length,E=0;E<x;E++)lx(a,y[E])}}br.prototype.sortTreeVertexChildren=function(a){switch(a.sorting){case eg:break;case Bp:a.children.reverse();break;case Ap:a.children.sort(a.comparer);break;case Tp:a.children.sort(a.comparer),a.children.reverse();break;default:$t("Unhandled sorting value "+a.sorting.toString())}},br.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},br.prototype.addComments=function(a){var y=a.angle,x=a.parent,E=0,b=!1;x!==null&&(E=x.angle,b=x.alignment,b=Md(b)),y=y===90||y===270,E=E===90||E===270,x=a.childrenCount===0;var z=0,tt=0,rt=0,ot=a.commentSpacing;if(a.node!==null)for(var lt=a.node.Mu();lt.next();){var ut=lt.value;ut.category==="Comment"&&ut.canLayout()&&(a.comments===null&&(a.comments=[]),a.comments.push(ut),ut.Va(),ut=ut.measuredBounds,y&&!x||!b&&!E&&x||b&&E&&x?(z=Math.max(z,ut.width),tt+=ut.height+Math.abs(rt)):(z+=ut.width+Math.abs(rt),tt=Math.max(tt,ut.height)),rt=ot)}a.comments!==null&&(y&&!x||!b&&!E&&x||b&&E&&x?(z+=Math.abs(a.commentMargin),tt=Math.max(0,tt-a.height)):(tt+=Math.abs(a.commentMargin),z=Math.max(0,z-a.width)),b=Be.allocAt(0,0,a.bounds.width+z,a.bounds.height+tt),a.bounds=b,Be.free(b))};function Md(a){return a===Hh||a===$u||a===Wh||a===gh}function Np(a){return a===Hh||a===$u}function ky(a){var y=a.parent;if(y!==null){var x=y.alignment;if(Md(x)){if(Np(x)){for(y=y.children,x=0;x<y.length&&a!==y[x];)x++;return x%2===0}if(x===Wh)return!0}}return!1}br.prototype.layoutComments=function(a){if(a.comments!==null){var y=a.node.measuredBounds,x=a.parent,E=a.angle,b=0,z=!1;x!==null&&(b=x.angle,z=x.alignment,z=Md(z)),E=E===90||E===270,x=b===90||b===270;for(var tt=a.childrenCount===0,rt=ky(a),ot=0,lt=a.comments,ut=lt.length,ft=At.alloc(),yt=0;yt<ut;yt++){var xt=lt[yt],Ct=xt.measuredBounds;if(E&&!tt||!z&&!x&&tt||z&&x&&tt){if(135<b&&!z||x&&rt)if(0<=a.commentMargin)for(ft.h(a.bounds.x-a.commentMargin-Ct.width,a.bounds.y+ot),xt.move(ft),xt=xt.Sd();xt.next();){var bt=xt.value;bt.fromSpot=ns,bt.toSpot=Fa}else for(ft.h(a.bounds.x+2*a.focus.x-a.commentMargin,a.bounds.y+ot),xt.move(ft),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Fa,bt.toSpot=ns;else if(0<=a.commentMargin)for(ft.h(a.bounds.x+2*a.focus.x+a.commentMargin,a.bounds.y+ot),xt.move(ft),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Fa,bt.toSpot=ns;else for(ft.h(a.bounds.x+a.commentMargin-Ct.width,a.bounds.y+ot),xt.move(ft),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=ns,bt.toSpot=Fa;ot=0<=a.commentSpacing?ot+(Ct.height+a.commentSpacing):ot+(a.commentSpacing-Ct.height)}else{if(135<b&&!z||!x&&rt)if(0<=a.commentMargin)for(ft.h(a.bounds.x+ot,a.bounds.y-a.commentMargin-Ct.height),xt.move(ft),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Xa,bt.toSpot=Ma;else for(ft.h(a.bounds.x+ot,a.bounds.y+2*a.focus.y-a.commentMargin),xt.move(ft),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Ma,bt.toSpot=Xa;else if(0<=a.commentMargin)for(ft.h(a.bounds.x+ot,a.bounds.y+2*a.focus.y+a.commentMargin),xt.move(ft),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Ma,bt.toSpot=Xa;else for(ft.h(a.bounds.x+ot,a.bounds.y+a.commentMargin-Ct.height),xt.move(ft),xt=xt.Sd();xt.next();)bt=xt.value,bt.fromSpot=Xa,bt.toSpot=Ma;ot=0<=a.commentSpacing?ot+(Ct.width+a.commentSpacing):ot+(a.commentSpacing-Ct.width)}}if(At.free(ft),y=ot-a.commentSpacing-(E?y.height:y.width),this.ud===Xu)for(a=a.destinationEdges;a.next();)b=a.value.link,b===null||b.isAvoiding||(b.fromEndSegmentLength=0<y?y:NaN);else for(a=a.sourceEdges;a.next();)b=a.value.link,b===null||b.isAvoiding||(b.toEndSegmentLength=0<y?y:NaN)}},br.prototype.layoutTree=function(a){if(a!==null){for(var y=a.children,x=y.length,E=0;E<x;E++)this.layoutTree(y[E]);switch(a.compaction){case I0:ux(this,a);break;case Dp:if(a.alignment===$u)ux(this,a);else if(a.childrenCount===0)E=a.parent,x=!1,y=0,E!==null&&(y=E.angle,x=E.alignment,x=Md(x)),E=ky(a),a.S.h(0,0),a.Da.h(a.width,a.height),a.parent===null||a.comments===null||(y!==180&&y!==270||x)&&!E?a.la.h(0,0):y===180&&!x||(y===90||y===270)&&E?a.la.h(a.width-2*a.focus.x,0):a.la.h(0,a.height-2*a.focus.y),a.Yo=null,a.kp=null;else{var b=eu(a);y=b===90||b===270;var z=0,tt=a.children,rt=tt.length;for(x=0;x<rt;x++)E=tt[x],z=Math.max(z,y?E.Da.width:E.Da.height);var ot=a.alignment;E=ot===Ju;var lt=ot===Qu,ut=Md(ot),ft=Math.max(0,a.breadthLimit);x=this.computeLayerSpacing(a);var yt=a.nodeSpacing,xt=this.computeNodeIndent(a),Ct=a.rowSpacing,bt=0;(E||lt||a.hm||a.im&&a.maxGenerationCount===1)&&(bt=Math.max(0,a.rowIndent)),E=a.width;var Wt=a.height,jt=0,Qt=0,te=0,re=null,he=null,ke=0,Jn=0,fi=0,li=0,Bn=0,on=0,nr=0,Xi=0;if(ut&&!Np(ot)&&135<b&&tt.reverse(),Np(ot))if(1<rt)for(var to=0;to<rt;to++)to%2===0&&to!==rt-1&&(Xi=Math.max(Xi,y?tt[to].Da.width:tt[to].Da.height));else rt===1&&(Xi=y?tt[0].Da.width:tt[0].Da.height);if(ut){switch(ot){case Hh:Qt=135>b?hx(this,a,tt,Xi,jt,Qt):dx(this,a,tt,Xi,jt,Qt),Xi=Qt.x,jt=Qt.width,Qt=Qt.height;break;case Wh:for(re=0;re<rt;re++)he=tt[re],ft=he.Da,te=on===0?0:Ct,y?(he.S.h(z-ft.width,li+te),jt=Math.max(jt,ft.width),Qt=Math.max(Qt,li+te+ft.height),li+=te+ft.height):(he.S.h(fi+te,z-ft.height),jt=Math.max(jt,fi+te+ft.width),Qt=Math.max(Qt,ft.height),fi+=te+ft.width),on++;break;case gh:for(re=0;re<rt;re++)he=tt[re],z=he.Da,ft=on===0?0:Ct,y?(he.S.h(yt/2+a.focus.x,li+ft),jt=Math.max(jt,z.width),Qt=Math.max(Qt,li+ft+z.height),li+=ft+z.height):(he.S.h(fi+ft,yt/2+a.focus.y),jt=Math.max(jt,fi+ft+z.width),Qt=Math.max(Qt,z.height),fi+=ft+z.width),on++}re=Ws(this,2),he=Ws(this,2),y?(re[0].h(0,0),re[1].h(0,Qt),he[0].h(jt,0)):(re[0].h(0,0),re[1].h(jt,0),he[0].h(0,Qt)),he[1].h(jt,Qt)}else for(to=0;to<rt;to++){var Ao=tt[to],ba=Ao.Da;if(y){0<ft&&0<on&&fi+yt+ba.width>ft&&(fi<z&&lc(a,ot,z-fi,0,nr,to-1),Bn++,on=0,nr=to,te=Qt,fi=0,li=135<b?-Qt-Ct:Qt+Ct),T0(this,Ao,0,li);var Oa=0;if(on===0)re=Ao.Yo,he=Ao.kp,ke=ba.width,Jn=ba.height,(re===null||he===null||b!==eu(Ao))&&(re=Ws(this,2),he=Ws(this,2),re[0].h(0,0),re[1].h(0,Jn),he[0].h(ke,0),he[1].h(ke,Jn));else{var gs=pi();Jn=cx(this,a,Ao,re,he,ke,Jn,gs),Oa=Jn.x,re=gs[0],he=gs[1],ke=Jn.width,Jn=Jn.height,oi(gs),fi<ba.width&&0>Oa&&(Yc(a,-Oa,0,nr,to-1),D0(re,-Oa,0),D0(he,-Oa,0),Oa=0)}Ao.S.h(Oa,li),jt=Math.max(jt,ke),Qt=Math.max(Qt,te+(Bn===0?0:Ct)+ba.height),fi=ke}else 0<ft&&0<on&&li+yt+ba.height>ft&&(li<z&&lc(a,ot,0,z-li,nr,to-1),Bn++,on=0,nr=to,te=jt,li=0,fi=135<b?-jt-Ct:jt+Ct),T0(this,Ao,fi,0),Oa=0,on===0?(re=Ao.Yo,he=Ao.kp,ke=ba.width,Jn=ba.height,(re===null||he===null||b!==eu(Ao))&&(re=Ws(this,2),he=Ws(this,2),re[0].h(0,0),re[1].h(ke,0),he[0].h(0,Jn),he[1].h(ke,Jn))):(gs=pi(),Jn=cx(this,a,Ao,re,he,ke,Jn,gs),Oa=Jn.x,re=gs[0],he=gs[1],ke=Jn.width,Jn=Jn.height,oi(gs),li<ba.height&&0>Oa&&(Yc(a,0,-Oa,nr,to-1),D0(re,0,-Oa),D0(he,0,-Oa),Oa=0)),Ao.S.h(fi,Oa),Qt=Math.max(Qt,Jn),jt=Math.max(jt,te+(Bn===0?0:Ct)+ba.width),li=Jn;on++}switch(0<Bn&&(y?(Qt+=Math.max(0,x),fi<jt&&lc(a,ot,jt-fi,0,nr,rt-1),0<bt&&(lt||Yc(a,bt,0,0,rt-1),jt+=bt)):(jt+=Math.max(0,x),li<Qt&&lc(a,ot,0,Qt-li,nr,rt-1),0<bt&&(lt||Yc(a,0,bt,0,rt-1),Qt+=bt))),bt=lt=0,ot){case ng:y?lt+=jt/2-a.focus.x-xt/2:bt+=Qt/2-a.focus.y-xt/2;break;case Jc:0<Bn?y?lt+=jt/2-a.focus.x-xt/2:bt+=Qt/2-a.focus.y-xt/2:y?(Xi=tt[0].S.x+tt[0].la.x,lt+=Xi+(tt[rt-1].S.x+tt[rt-1].la.x+2*tt[rt-1].focus.x-Xi)/2-a.focus.x-xt/2):(Xi=tt[0].S.y+tt[0].la.y,bt+=Xi+(tt[rt-1].S.y+tt[rt-1].la.y+2*tt[rt-1].focus.y-Xi)/2-a.focus.y-xt/2);break;case Ju:y?(lt-=xt,jt+=xt):(bt-=xt,Qt+=xt);break;case Qu:y?(lt+=jt-a.width+xt,jt+=xt):(bt+=Qt-a.height+xt,Qt+=xt);break;case Hh:y?1<rt?lt+=Xi+yt/2-a.focus.x:lt+=tt[0].focus.x-a.focus.x+tt[0].la.x:1<rt?bt+=Xi+yt/2-a.focus.y:bt+=tt[0].focus.y-a.focus.y+tt[0].la.y;break;case Wh:y?lt+=jt+yt/2-a.focus.x:bt+=Qt+yt/2-a.focus.y;break;case gh:break;default:Qt=this.customAlignment(a,lt,bt,jt,Qt),lt=Qt[0],bt=Qt[1],jt=Qt[2],Qt=Qt[3]}for(xt=0;xt<rt;xt++)Xi=tt[xt],y?Xi.S.h(Xi.S.x+Xi.la.x-lt,Xi.S.y+(135<b?(ut?-Qt:-Xi.Da.height)+Xi.la.y-x:Wt+x+Xi.la.y)):Xi.S.h(Xi.S.x+(135<b?(ut?-jt:-Xi.Da.width)+Xi.la.x-x:E+x+Xi.la.x),Xi.S.y+Xi.la.y-bt);if(rt=tt=0,ut?y?(jt=by(a,jt,lt),0>lt&&(lt=0),135<b&&(bt+=Qt+x),Qt+=Wt+x,ot===gh&&(tt+=yt/2+a.focus.x),rt+=Wt+x):(135<b&&(lt+=jt+x),jt+=E+x,Qt=Ny(a,Qt,bt),0>bt&&(bt=0),ot===gh&&(rt+=yt/2+a.focus.y),tt+=E+x):y?(a.comments===null?E>jt&&(jt=By(ot,E-jt,0),tt=jt.x,rt=jt.y,jt=E,lt=0):jt=by(a,jt,lt),0>lt&&(tt-=lt,lt=0),135<b&&(bt+=Qt+x),Qt=Math.max(Math.max(Qt,Wt),Qt+Wt+x),rt+=Wt+x):(135<b&&(lt+=jt+x),jt=Math.max(Math.max(jt,E),jt+E+x),a.comments===null?Wt>Qt&&(Qt=By(ot,0,Wt-Qt),tt=Qt.x,rt=Qt.y,Qt=Wt,bt=0):Qt=Ny(a,Qt,bt),0>bt&&(rt-=bt,bt=0),tt+=E+x),0<Bn)b=Ws(this,4),Bn=Ws(this,4),y?(b[2].h(0,Wt+x),b[3].h(b[2].x,Qt),Bn[2].h(jt,b[2].y),Bn[3].h(Bn[2].x,b[3].y)):(b[2].h(E+x,0),b[3].h(jt,b[2].y),Bn[2].h(b[2].x,Qt),Bn[3].h(b[3].x,Bn[2].y));else{for(b=Ws(this,re.length+2),Bn=Ws(this,he.length+2),ot=0;ot<re.length;ot++)ut=re[ot],b[ot+2].h(ut.x+tt,ut.y+rt);for(ot=0;ot<he.length;ot++)ut=he[ot],Bn[ot+2].h(ut.x+tt,ut.y+rt)}y?(b[0].h(lt,0),b[1].h(b[0].x,Wt),b[2].y<b[1].y&&(b[2].x>b[0].x?b[2].assign(b[1]):b[1].assign(b[2])),b[3].y<b[2].y&&(b[3].x>b[0].x?b[3].assign(b[2]):b[2].assign(b[3])),Bn[0].h(lt+E,0),Bn[1].h(Bn[0].x,Wt),Bn[2].y<Bn[1].y&&(Bn[2].x<Bn[0].x?Bn[2].assign(Bn[1]):Bn[1].assign(Bn[2])),Bn[3].y<Bn[2].y&&(Bn[3].x<Bn[0].x?Bn[3].assign(Bn[2]):Bn[2].assign(Bn[3])),b[2].y-=x/2,Bn[2].y-=x/2):(b[0].h(0,bt),b[1].h(E,b[0].y),b[2].x<b[1].x&&(b[2].y>b[0].y?b[2].assign(b[1]):b[1].assign(b[2])),b[3].x<b[2].x&&(b[3].y>b[0].y?b[3].assign(b[2]):b[2].assign(b[3])),Bn[0].h(0,bt+Wt),Bn[1].h(E,Bn[0].y),Bn[2].x<Bn[1].x&&(Bn[2].y<Bn[0].y?Bn[2].assign(Bn[1]):Bn[1].assign(Bn[2])),Bn[3].x<Bn[2].x&&(Bn[3].y<Bn[0].y?Bn[3].assign(Bn[2]):Bn[2].assign(Bn[3])),b[2].x-=x/2,Bn[2].x-=x/2),vu(this,re),vu(this,he),a.Yo=b,a.kp=Bn,a.la.h(lt,bt),a.Da.h(jt,Qt)}break;default:$t("Unhandled compaction value "+a.compaction.toString())}}};function ux(a,y){if(y.childrenCount===0){var x=!1,E=0;y.parent!==null&&(E=y.parent.angle,x=y.parent.alignment,x=Md(x));var b=ky(y);y.S.h(0,0),y.Da.h(y.width,y.height),y.parent===null||y.comments===null||(E!==180&&E!==270||x)&&!b?y.la.h(0,0):E===180&&!x||(E===90||E===270)&&b?y.la.h(y.width-2*y.focus.x,0):y.la.h(0,y.height-2*y.focus.y)}else{E=eu(y),x=E===90||E===270;var z=0;b=y.children;for(var tt=b.length,rt=0;rt<tt;rt++){var ot=b[rt];z=Math.max(z,x?ot.Da.width:ot.Da.height)}var lt=y.alignment,ut=lt===Ju,ft=lt===Qu;rt=Md(lt);var yt=Math.max(0,y.breadthLimit);ot=a.computeLayerSpacing(y);var xt=y.nodeSpacing,Ct=a.computeNodeIndent(y),bt=ut||ft?0:Ct/2,Wt=y.rowSpacing,jt=0;(ut||ft||y.hm||y.im&&y.maxGenerationCount===1)&&(jt=Math.max(0,y.rowIndent)),ut=y.width;var Qt=y.height,te=0,re=0,he=0,ke=0,Jn=0,fi=0,li=0,Bn=0,on=0,nr=0;if(rt&&!Np(lt)&&135<E&&b.reverse(),Np(lt))if(1<tt)for(var Xi=0;Xi<tt;Xi++){var to=b[Xi],Ao=to.Da;Xi%2===0&&Xi!==tt-1?on=Math.max(on,(x?Ao.width:Ao.height)+a.computeBusNodeSpacing(to)-xt):Xi%2!==0&&(nr=Math.max(nr,(x?Ao.width:Ao.height)+a.computeBusNodeSpacing(to)-xt))}else tt===1&&(on=x?b[0].Da.width:b[0].Da.height);if(rt)switch(lt){case Hh:case $u:re=135>E?hx(a,y,b,on,te,re):dx(a,y,b,on,te,re),on=re.x,te=re.width,re=re.height;break;case Wh:for(yt=0;yt<tt;yt++)bt=b[yt],he=bt.Da,nr=li===0?0:Wt,x?(bt.S.h(z-he.width,Jn+nr),te=Math.max(te,he.width),re=Math.max(re,Jn+nr+he.height),Jn+=nr+he.height):(bt.S.h(ke+nr,z-he.height),te=Math.max(te,ke+nr+he.width),re=Math.max(re,he.height),ke+=nr+he.width),li++;break;case gh:for(z=0;z<tt;z++)yt=b[z],bt=yt.Da,he=li===0?0:Wt,x?(yt.S.h(xt/2+y.focus.x,Jn+he),te=Math.max(te,bt.width),re=Math.max(re,Jn+he+bt.height),Jn+=he+bt.height):(yt.S.h(ke+he,xt/2+y.focus.y),te=Math.max(te,ke+he+bt.width),re=Math.max(re,bt.height),ke+=he+bt.width),li++}else for(nr=0;nr<tt;nr++)Xi=b[nr],to=Xi.Da,x?(0<yt&&0<li&&ke+xt+to.width>yt&&(ke<z&&lc(y,lt,z-ke,0,Bn,nr-1),fi++,li=0,Bn=nr,he=re,ke=0,Jn=135<E?-re-Wt:re+Wt),Ao=li===0?bt:xt,T0(a,Xi,0,Jn),Xi.S.h(ke+Ao,Jn),te=Math.max(te,ke+Ao+to.width),re=Math.max(re,he+(fi===0?0:Wt)+to.height),ke+=Ao+to.width):(0<yt&&0<li&&Jn+xt+to.height>yt&&(Jn<z&&lc(y,lt,0,z-Jn,Bn,nr-1),fi++,li=0,Bn=nr,he=te,Jn=0,ke=135<E?-te-Wt:te+Wt),Ao=li===0?bt:xt,T0(a,Xi,ke,0),Xi.S.h(ke,Jn+Ao),re=Math.max(re,Jn+Ao+to.height),te=Math.max(te,he+(fi===0?0:Wt)+to.width),Jn+=Ao+to.height),li++;switch(0<fi&&(x?(re+=Math.max(0,ot),ke<te&&lc(y,lt,te-ke,0,Bn,tt-1),0<jt&&(ft||Yc(y,jt,0,0,tt-1),te+=jt)):(te+=Math.max(0,ot),Jn<re&&lc(y,lt,0,re-Jn,Bn,tt-1),0<jt&&(ft||Yc(y,0,jt,0,tt-1),re+=jt))),jt=ft=0,lt){case ng:x?ft+=te/2-y.focus.x-Ct/2:jt+=re/2-y.focus.y-Ct/2;break;case Jc:0<fi?x?ft+=te/2-y.focus.x-Ct/2:jt+=re/2-y.focus.y-Ct/2:x?(a=b[0].S.x+b[0].la.x,ft+=a+(b[tt-1].S.x+b[tt-1].la.x+2*b[tt-1].focus.x-a)/2-y.focus.x-Ct/2):(a=b[0].S.y+b[0].la.y,jt+=a+(b[tt-1].S.y+b[tt-1].la.y+2*b[tt-1].focus.y-a)/2-y.focus.y-Ct/2);break;case Ju:x?(ft-=Ct,te+=Ct):(jt-=Ct,re+=Ct);break;case Qu:x?(ft+=te-y.width+Ct,te+=Ct):(jt+=re-y.height+Ct,re+=Ct);break;case Hh:case $u:x?1<tt?ft+=on+xt/2-y.focus.x:ft+=b[0].focus.x-y.focus.x+b[0].la.x:1<tt?jt+=on+xt/2-y.focus.y:jt+=b[0].focus.y-y.focus.y+b[0].la.y;break;case Wh:x?ft+=te+xt/2-y.focus.x:jt+=re+xt/2-y.focus.y;break;case gh:break;default:a=a.customAlignment(y,ft,jt,te,re),ft=a[0],jt=a[1],te=a[2],re=a[3]}for(a=0;a<tt;a++)Ct=b[a],x?Ct.S.h(Ct.S.x+Ct.la.x-ft,Ct.S.y+(135<E?(rt?-re:-Ct.Da.height)+Ct.la.y-ot:Qt+ot+Ct.la.y)):Ct.S.h(Ct.S.x+(135<E?(rt?-te:-Ct.Da.width)+Ct.la.x-ot:ut+ot+Ct.la.x),Ct.S.y+Ct.la.y-jt);x?(te=by(y,te,ft),0>ft&&(ft=0),135<E&&(jt+=re+ot),re=Math.max(Math.max(re,Qt),re+Qt+ot)):(135<E&&(ft+=te+ot),te=Math.max(Math.max(te,ut),te+ut+ot),re=Ny(y,re,jt),0>jt&&(jt=0)),y.la.h(ft,jt),y.Da.h(te,re)}}br.prototype.customAlignment=function(a,y,x,E,b){return[y,x,E,b]};function hx(a,y,x,E,b,z){var tt=x.length;if(tt===0)return new Be(E,0,b,z);if(tt===1)return y=x[0],b=y.Da.width,z=y.Da.height,new Be(E,0,b,z);for(var rt=y.nodeSpacing,ot=y.rowSpacing,lt=eu(y)===90,ut=0,ft=0,yt=0,xt=0;xt<tt;xt++)if(!(xt%2!==0||1<tt&&xt===tt-1)){var Ct=x[xt],bt=Ct.Da,Wt=ut===0?0:ot;if(lt){var jt=a.computeBusNodeSpacing(Ct)-rt;Ct.S.h(E-(bt.width+jt),yt+Wt),b=Math.max(b,bt.width+jt),z=Math.max(z,yt+Wt+bt.height),yt+=Wt+bt.height}else jt=a.computeBusNodeSpacing(Ct)-rt,Ct.S.h(ft+Wt,E-(bt.height+jt)),z=Math.max(z,bt.height+jt),b=Math.max(b,ft+Wt+bt.width),ft+=Wt+bt.width;ut++}for(ut=0,Ct=ft,xt=yt,lt?(ft=E+rt,yt=0):(ft=0,yt=E+rt),bt=0;bt<tt;bt++)if(bt%2!==0){Wt=x[bt],jt=Wt.Da;var Qt=ut===0?0:ot;if(lt){var te=a.computeBusNodeSpacing(Wt)-rt;Wt.S.h(ft+te,yt+Qt),b=Math.max(b,ft+jt.width+te),z=Math.max(z,yt+Qt+jt.height),yt+=Qt+jt.height}else te=a.computeBusNodeSpacing(Wt)-rt,Wt.S.h(ft+Qt,yt+te),b=Math.max(b,ft+Qt+jt.width),z=Math.max(z,yt+jt.height+te),ft+=Qt+jt.width;ut++}return 1<tt&&tt%2===1&&(x=x[tt-1],tt=x.Da,a=a.computeBusLastRowSpacing(x,lt?Math.max(Math.abs(xt),Math.abs(yt)):Math.max(Math.abs(Ct),Math.abs(ft))),lt?(x.S.h(E+rt/2-x.focus.x-x.la.x,z+a),lt=E+rt/2-x.focus.x-x.la.x,b=Math.max(b,lt+tt.width),0>lt&&(b-=lt),z=Math.max(z,Math.max(xt,yt)+a+tt.height),0>x.S.x&&(E=A0(y,x.S.x,!1,E,rt))):(x.S.h(b+a,E+rt/2-x.focus.y-x.la.y),b=Math.max(b,Math.max(Ct,ft)+a+tt.width),yt=E+rt/2-x.focus.y-x.la.y,z=Math.max(z,yt+tt.height),0>yt&&(z-=yt),0>x.S.y&&(E=A0(y,x.S.y,!0,E,rt)))),new Be(E,0,b,z)}function dx(a,y,x,E,b,z){var tt=x.length;if(tt===0)return new Be(E,0,b,z);if(tt===1)return x=x[0],b=x.Da.width,z=x.Da.height,new Be(E,0,b,z);for(var rt=y.nodeSpacing,ot=y.rowSpacing,lt=eu(y)===270,ut=0,ft=0,yt=0,xt=0;xt<tt;xt++)if(!(xt%2!==0||1<tt&&xt===tt-1)){var Ct=x[xt],bt=Ct.Da,Wt=ut===0?0:ot;if(lt){var jt=a.computeBusNodeSpacing(Ct)-rt;yt-=Wt+bt.height,Ct.S.h(E-(bt.width+jt),yt),b=Math.max(b,bt.width+jt),z=Math.max(z,Math.abs(yt))}else jt=a.computeBusNodeSpacing(Ct)-rt,ft-=Wt+bt.width,Ct.S.h(ft,E-(bt.height+jt)),z=Math.max(z,bt.height+jt),b=Math.max(b,Math.abs(ft));ut++}for(ut=0,Ct=ft,xt=yt,lt?(ft=E+rt,yt=0):(ft=0,yt=E+rt),bt=0;bt<tt;bt++)if(bt%2!==0){Wt=x[bt],jt=Wt.Da;var Qt=ut===0?0:ot;if(lt){var te=a.computeBusNodeSpacing(Wt)-rt;yt-=Qt+jt.height,Wt.S.h(ft+te,yt),b=Math.max(b,ft+jt.width+te),z=Math.max(z,Math.abs(yt))}else te=a.computeBusNodeSpacing(Wt)-rt,ft-=Qt+jt.width,Wt.S.h(ft,yt+te),z=Math.max(z,yt+jt.height+te),b=Math.max(b,Math.abs(ft));ut++}for(1<tt&&tt%2===1&&(ot=x[tt-1],ut=ot.Da,a=a.computeBusLastRowSpacing(ot,lt?Math.max(Math.abs(xt),Math.abs(yt)):Math.max(Math.abs(Ct),Math.abs(ft))),lt?(ot.S.h(E+rt/2-ot.focus.x-ot.la.x,-z-ut.height-a),ft=E+rt/2-ot.focus.x-ot.la.x,b=Math.max(b,ft+ut.width),0>ft&&(b-=ft),z=Math.max(z,Math.abs(Math.min(xt,yt))+a+ut.height),0>ot.S.x&&(E=A0(y,ot.S.x,!1,E,rt))):(ot.S.h(-b-ut.width-a,E+rt/2-ot.focus.y-ot.la.y),b=Math.max(b,Math.abs(Math.min(Ct,ft))+a+ut.width),yt=E+rt/2-ot.focus.y-ot.la.y,z=Math.max(z,yt+ut.height),0>yt&&(z-=yt),0>ot.S.y&&(E=A0(y,ot.S.y,!0,E,rt)))),y=0;y<tt;y++)rt=x[y],lt?rt.S.h(rt.S.x,rt.S.y+z):rt.S.h(rt.S.x+b,rt.S.y);return new Be(E,0,b,z)}br.prototype.computeBusNodeSpacing=function(a){return a.parent===null?0:a.parent.nodeSpacing},br.prototype.computeBusLastRowSpacing=function(a){return a.parent===null?0:a.parent.rowSpacing};function A0(a,y,x,E,b){a=a.children;for(var z=a.length,tt=0;tt<z;tt++)x?a[tt].S.h(a[tt].S.x,a[tt].S.y-y):a[tt].S.h(a[tt].S.x-y,a[tt].S.y);return y=a[z-1],Math.max(E,x?y.la.y+y.focus.y-b/2:y.la.x+y.focus.x-b/2)}function by(a,y,x){switch(a.alignment){case Jc:case ng:return x+a.width>y&&(y=x+a.width),0>x&&(y-=x),y;case Ju:return a.width>y?a.width:y;case Qu:return 2*a.focus.x>y?a.width:y+a.width-2*a.focus.x;case Hh:case $u:return Math.max(a.width,Math.max(y,x+a.width)-Math.min(0,x));case Wh:return a.width-a.focus.x+a.nodeSpacing/2+y;case gh:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+y);default:return y}}function Ny(a,y,x){switch(a.alignment){case Jc:case ng:return x+a.height>y&&(y=x+a.height),0>x&&(y-=x),y;case Ju:return a.height>y?a.height:y;case Qu:return 2*a.focus.y>y?a.height:y+a.height-2*a.focus.y;case Hh:case $u:return Math.max(a.height,Math.max(y,x+a.height)-Math.min(0,x));case Wh:return a.height-a.focus.y+a.nodeSpacing/2+y;case gh:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+y);default:return y}}function By(a,y,x){switch(a){case ng:y/=2,x/=2;break;case Jc:y/=2,x/=2;break;case Ju:x=y=0;break;case Qu:break;default:$t("Unhandled alignment value "+a.toString())}return new At(y,x)}function lc(a,y,x,E,b,z){y=By(y,x,E),Yc(a,y.x,y.y,b,z)}function Yc(a,y,x,E,b){if(y!==0||x!==0)for(a=a.children;E<=b;E++){var z=a[E].S;z.x+=y,z.y+=x}}function T0(a,y,x,E){var b=y.parent;switch(a.ud){case Xu:for(a=y.sourceEdges;a.next();)y=a.value,y.fromVertex===b&&y.relativePoint.h(x,E);break;case Xc:for(a=y.destinationEdges;a.next();)y=a.value,y.toVertex===b&&y.relativePoint.h(x,E);break;default:$t("Unhandled path value "+a.ud.toString())}}function D0(a,y,x){for(var E=0;E<a.length;E++){var b=a[E];b.x+=y,b.y+=x}}function cx(a,y,x,E,b,z,tt,rt){var ot=eu(y),lt=ot===90||ot===270,ut=y.nodeSpacing;y=E;var ft=b;E=z;var yt=tt,xt=x.Yo,Ct=x.kp;tt=x.Da;var bt=lt?Math.max(yt,tt.height):Math.max(E,tt.width);if((xt===null||ot!==eu(x))&&(xt=Ws(a,2),Ct=Ws(a,2),lt?(xt[0].h(0,0),xt[1].h(0,tt.height),Ct[0].h(tt.width,0),Ct[1].h(Ct[0].x,xt[1].y)):(xt[0].h(0,0),xt[1].h(tt.width,0),Ct[0].h(0,tt.height),Ct[1].h(xt[1].x,Ct[0].y))),lt){if(yt=9999999,!(ft===null||2>ft.length||xt===null||2>xt.length))for(b=x=0;x<ft.length&&b<xt.length;){z=ft[x];var Wt=xt[b];ot=Wt.x,lt=Wt.y,ot+=E;var jt=z;x+1<ft.length&&(jt=ft[x+1]);var Qt=Wt;Wt=Qt.x,Qt=Qt.y,b+1<xt.length&&(Qt=xt[b+1],Wt=Qt.x,Qt=Qt.y,Wt+=E);var te=yt;z.y===lt?te=ot-z.x:z.y>lt&&z.y<Qt?te=ot+(z.y-lt)/(Qt-lt)*(Wt-ot)-z.x:lt>z.y&&lt<jt.y&&(te=ot-(z.x+(lt-z.y)/(jt.y-z.y)*(jt.x-z.x))),te<yt&&(yt=te),jt.y<=z.y?x++:Qt<=lt?b++:(jt.y<=Qt&&x++,Qt<=jt.y&&b++)}if(yt=E-yt,yt+=ut,x=xt,b=yt,y===null||2>y.length||x===null||2>x.length)E=null;else{for(ut=Ws(a,y.length+x.length),E=z=ot=0;z<x.length&&x[z].y<y[0].y;)lt=x[z++],ut[E++].h(lt.x+b,lt.y);for(;ot<y.length;)lt=y[ot++],ut[E++].h(lt.x,lt.y);for(ot=y[y.length-1].y;z<x.length&&x[z].y<=ot;)z++;for(;z<x.length&&x[z].y>ot;)lt=x[z++],ut[E++].h(lt.x+b,lt.y);for(x=Ws(a,E),ot=0;ot<E;ot++)x[ot].assign(ut[ot]);vu(a,ut),E=x}if(z=Ct,ot=yt,ft===null||2>ft.length||z===null||2>z.length)b=null;else{for(ut=Ws(a,ft.length+z.length),b=lt=x=0;x<ft.length&&ft[x].y<z[0].y;)jt=ft[x++],ut[b++].h(jt.x,jt.y);for(;lt<z.length;)jt=z[lt++],ut[b++].h(jt.x+ot,jt.y);for(z=z[z.length-1].y;x<ft.length&&ft[x].y<=z;)x++;for(;x<ft.length&&ft[x].y>z;)ot=ft[x++],ut[b++].h(ot.x,ot.y);for(z=Ws(a,b),x=0;x<b;x++)z[x].assign(ut[x]);vu(a,ut),b=z}return z=Math.max(0,yt)+tt.width,tt=bt,vu(a,y),vu(a,xt),vu(a,ft),vu(a,Ct),rt[0]=E,rt[1]=b,new Be(yt,0,z,tt)}if(E=9999999,!(ft===null||2>ft.length||xt===null||2>xt.length))for(b=x=0;x<ft.length&&b<xt.length;)z=ft[x],Wt=xt[b],ot=Wt.x,lt=Wt.y,lt+=yt,jt=z,x+1<ft.length&&(jt=ft[x+1]),Qt=Wt,Wt=Qt.x,Qt=Qt.y,b+1<xt.length&&(Qt=xt[b+1],Wt=Qt.x,Qt=Qt.y,Qt+=yt),te=E,z.x===ot?te=lt-z.y:z.x>ot&&z.x<Wt?te=lt+(z.x-ot)/(Wt-ot)*(Qt-lt)-z.y:ot>z.x&&ot<jt.x&&(te=lt-(z.y+(ot-z.x)/(jt.x-z.x)*(jt.y-z.y))),te<E&&(E=te),jt.x<=z.x?x++:Wt<=ot?b++:(jt.x<=Wt&&x++,Wt<=jt.x&&b++);if(yt-=E,yt+=ut,x=xt,b=yt,y===null||2>y.length||x===null||2>x.length)E=null;else{for(ut=Ws(a,y.length+x.length),E=z=ot=0;z<x.length&&x[z].x<y[0].x;)lt=x[z++],ut[E++].h(lt.x,lt.y+b);for(;ot<y.length;)lt=y[ot++],ut[E++].h(lt.x,lt.y);for(ot=y[y.length-1].x;z<x.length&&x[z].x<=ot;)z++;for(;z<x.length&&x[z].x>ot;)lt=x[z++],ut[E++].h(lt.x,lt.y+b);for(x=Ws(a,E),ot=0;ot<E;ot++)x[ot].assign(ut[ot]);vu(a,ut),E=x}if(z=Ct,ot=yt,ft===null||2>ft.length||z===null||2>z.length)b=null;else{for(ut=Ws(a,ft.length+z.length),b=lt=x=0;x<ft.length&&ft[x].x<z[0].x;)jt=ft[x++],ut[b++].h(jt.x,jt.y);for(;lt<z.length;)jt=z[lt++],ut[b++].h(jt.x,jt.y+ot);for(z=z[z.length-1].x;x<ft.length&&ft[x].x<=z;)x++;for(;x<ft.length&&ft[x].x>z;)ot=ft[x++],ut[b++].h(ot.x,ot.y);for(z=Ws(a,b),x=0;x<b;x++)z[x].assign(ut[x]);vu(a,ut),b=z}return z=bt,tt=Math.max(0,yt)+tt.height,vu(a,y),vu(a,xt),vu(a,ft),vu(a,Ct),rt[0]=E,rt[1]=b,new Be(yt,0,z,tt)}function Ws(a,y){if(a=a.ru[y],a!==void 0&&(a=a.pop(),a!==void 0))return a;a=[];for(var x=0;x<y;x++)a[x]=new At;return a}function vu(a,y){var x=y.length,E=a.ru[x];E===void 0&&(E=[],a.ru[x]=E),E.push(y)}br.prototype.arrangeTrees=function(){if(this.Rb===j0)for(var a=this.Ub.iterator;a.next();){var y=a.value;if(y instanceof _l){var x=y.node;if(x!==null){var E=x.position;x=E.x,E=E.y,isFinite(x)||(x=0),isFinite(E)||(E=0),Ay(this,y,x,E)}}}else{for(a=[],y=this.Ub.iterator;y.next();)x=y.value,x instanceof _l&&a.push(x);switch(this.sorting){case eg:break;case Bp:a.reverse();break;case Ap:a.sort(this.comparer);break;case Tp:a.sort(this.comparer),a.reverse();break;default:$t("Unhandled sorting value "+this.sorting.toString())}for(x=this.arrangementOrigin,y=x.x,x=x.y,E=0;E<a.length;E++){var b=a[E];switch(Ay(this,b,y+b.la.x,x+b.la.y),this.Rb){case R0:x+=b.Da.height+this.$d.height;break;case Iy:y+=b.Da.width+this.$d.width;break;default:$t("Unhandled arrangement value "+this.Rb.toString())}}}};function Ay(a,y,x,E){if(y!==null){y.x=x,y.y=E,y=y.children;for(var b=y.length,z=0;z<b;z++){var tt=y[z];Ay(a,tt,x+tt.S.x,E+tt.S.y)}}}br.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()},br.prototype.commitNodes=function(){for(var a=this.network.vertexes.iterator;a.next();)a.value.commit();for(a.reset();a.next();)this.layoutComments(a.value)},br.prototype.Gu=function(){if(this.layerStyle===z0){for(var a=this.$v,y=[],x=null,E=this.network.vertexes.iterator;E.next();){var b=E.value;x===null?x=b.bounds.copy():x.ed(b.bounds);var z=y[b.level];z===void 0?z=this.computeLayerSpacing(b):z=Math.max(z,this.computeLayerSpacing(b)),y[b.level]=z}for(E=0;E<y.length;E++)y[E]===void 0&&(y[E]=0);if(this.angle===90||this.angle===270?(x.Bc(this.nodeSpacing/2,this.layerSpacing),E=new At(-this.nodeSpacing/2,-this.layerSpacing/2)):(x.Bc(this.layerSpacing,this.nodeSpacing/2),E=new At(-this.layerSpacing/2,-this.nodeSpacing/2)),b=[],x=this.angle===90||this.angle===270?x.width:x.height,z=0,this.angle===180||this.angle===270)for(var tt=0;tt<a.length;tt++)z+=a[tt]+y[tt];for(tt=0;tt<a.length;tt++){var rt=a[tt]+y[tt];this.angle===270?(z-=rt,b.push(new Be(0,z,x,rt))):this.angle===90?(b.push(new Be(0,z,x,rt)),z+=rt):this.angle===180?(z-=rt,b.push(new Be(z,0,rt,x))):(b.push(new Be(z,0,rt,x)),z+=rt)}this.commitLayers(b,E)}},br.prototype.commitLayers=function(){},br.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},br.prototype.yv=function(){for(var a=this.Ub.iterator;a.next();){var y=a.value;y instanceof _l&&fx(this,y)}};function fx(a,y){if(y!==null){a.setPortSpots(y),y=y.children;for(var x=y.length,E=0;E<x;E++)fx(a,y[E])}}br.prototype.setPortSpots=function(a){var y=a.alignment;if(Md(y)){var x=this.ud===Xu,E=eu(a);switch(E){case 0:var b=Fa;break;case 90:b=Ma;break;case 180:b=ns;break;default:b=Xa}var z=a.children,tt=z.length;switch(y){case Hh:case $u:for(y=0;y<tt;y++){var rt=z[y];if(rt=(x?rt.sourceEdges:rt.destinationEdges).first(),rt!==null&&(rt=rt.link,rt!==null)){var ot=E===90||E===270?ns:Xa;if(tt===1||y===tt-1&&tt%2===1)switch(E){case 0:ot=ns;break;case 90:ot=Xa;break;case 180:ot=Fa;break;default:ot=Ma}else y%2===0&&(ot=E===90||E===270?Fa:Ma);x?(a.setsPortSpot&&(rt.fromSpot=b),a.setsChildPortSpot&&(rt.toSpot=ot)):(a.setsPortSpot&&(rt.fromSpot=ot),a.setsChildPortSpot&&(rt.toSpot=b))}}break;case Wh:for(E=E===90||E===270?Fa:Ma,z=x?a.destinationEdges:a.sourceEdges;z.next();)tt=z.value.link,tt!==null&&(x?(a.setsPortSpot&&(tt.fromSpot=b),a.setsChildPortSpot&&(tt.toSpot=E)):(a.setsPortSpot&&(tt.fromSpot=E),a.setsChildPortSpot&&(tt.toSpot=b)));break;case gh:for(E=E===90||E===270?ns:Xa,z=x?a.destinationEdges:a.sourceEdges;z.next();)tt=z.value.link,tt!==null&&(x?(a.setsPortSpot&&(tt.fromSpot=b),a.setsChildPortSpot&&(tt.toSpot=E)):(a.setsPortSpot&&(tt.fromSpot=E),a.setsChildPortSpot&&(tt.toSpot=b)))}}else if(x=eu(a),this.ud===Xu){for(b=a.destinationEdges;b.next();)if(E=b.value.link,E!==null){if(a.setsPortSpot)if(a.portSpot.Xb())switch(x){case 0:E.fromSpot=Fa;break;case 90:E.fromSpot=Ma;break;case 180:E.fromSpot=ns;break;default:E.fromSpot=Xa}else E.fromSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:E.toSpot=ns;break;case 90:E.toSpot=Xa;break;case 180:E.toSpot=Fa;break;default:E.toSpot=Ma}else E.toSpot=a.childPortSpot}}else for(b=a.sourceEdges;b.next();)if(E=b.value.link,E!==null){if(a.setsPortSpot)if(a.portSpot.Xb())switch(x){case 0:E.toSpot=Fa;break;case 90:E.toSpot=Ma;break;case 180:E.toSpot=ns;break;default:E.toSpot=Xa}else E.toSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:E.fromSpot=ns;break;case 90:E.fromSpot=Xa;break;case 180:E.fromSpot=Fa;break;default:E.fromSpot=Ma}else E.fromSpot=a.childPortSpot}};function eu(a){return a=a.angle,45>=a?0:135>=a?90:225>=a?180:315>=a?270:0}br.prototype.computeLayerSpacing=function(a){var y=eu(a);y=y===90||y===270;var x=a.layerSpacing;if(0<a.layerSpacingParentOverlap){var E=Math.min(1,a.layerSpacingParentOverlap);x-=y?a.height*E:a.width*E}return x<(y?-a.height:-a.width)&&(x=y?-a.height:-a.width),x},br.prototype.computeNodeIndent=function(a){var y=eu(a),x=a.nodeIndent;if(0<a.nodeIndentPastParent){var E=Math.min(1,a.nodeIndentPastParent);x+=y===90||y===270?a.width*E:a.height*E}return x=Math.max(0,x)},ve.Object.defineProperties(br.prototype,{roots:{get:function(){return this.Ub},set:function(a){this.Ub!==a&&(this.Ub=a,this.C())}},path:{get:function(){return this.Wn},set:function(a){this.Wn!==a&&(this.Wn=a,this.C())}},treeStyle:{get:function(){return this.vo},set:function(a){this.Rb===a||a!==_0&&a!==Dy&&a!==Ty&&a!==Oy||(this.vo=a,this.C())}},layerStyle:{get:function(){return this.Bq},set:function(a){this.Rb===a||a!==_y&&a!==Ry&&a!==z0||(this.Bq=a,this.C())}},comments:{get:function(){return this.td},set:function(a){this.td!==a&&(this.td=a,this.C())}},arrangement:{get:function(){return this.Rb},set:function(a){this.Rb===a||a!==R0&&a!==Iy&&a!==j0||(this.Rb=a,this.C())}},arrangementSpacing:{get:function(){return this.$d},set:function(a){this.$d.D(a)||(this.$d.assign(a),this.C())}},rootDefaults:{get:function(){return this.W},set:function(a){this.W!==a&&(this.W=a,this.C())}},alternateDefaults:{get:function(){return this.Y},set:function(a){this.Y!==a&&(this.Y=a,this.C())}},sorting:{get:function(){return this.W.sorting},set:function(a){this.W.sorting===a||a!==eg&&a!==Bp&&a!==Ap&&!Tp||(this.W.sorting=a,this.C())}},comparer:{get:function(){return this.W.comparer},set:function(a){this.W.comparer!==a&&(this.W.comparer=a,this.C())}},angle:{get:function(){return this.W.angle},set:function(a){this.W.angle!==a&&(a===0||a===90||a===180||a===270?(this.W.angle=a,this.C()):$t("TreeLayout.angle must be 0, 90, 180, or 270"))}},alignment:{get:function(){return this.W.alignment},set:function(a){this.W.alignment!==a&&(this.W.alignment=a,this.C())}},nodeIndent:{get:function(){return this.W.nodeIndent},set:function(a){this.W.nodeIndent!==a&&0<=a&&(this.W.nodeIndent=a,this.C())}},nodeIndentPastParent:{get:function(){return this.W.nodeIndentPastParent},set:function(a){this.W.nodeIndentPastParent!==a&&0<=a&&1>=a&&(this.W.nodeIndentPastParent=a,this.C())}},nodeSpacing:{get:function(){return this.W.nodeSpacing},set:function(a){this.W.nodeSpacing!==a&&(this.W.nodeSpacing=a,this.C())}},layerSpacing:{get:function(){return this.W.layerSpacing},set:function(a){this.W.layerSpacing!==a&&(this.W.layerSpacing=a,this.C())}},layerSpacingParentOverlap:{get:function(){return this.W.layerSpacingParentOverlap},set:function(a){this.W.layerSpacingParentOverlap!==a&&0<=a&&1>=a&&(this.W.layerSpacingParentOverlap=a,this.C())}},compaction:{get:function(){return this.W.compaction},set:function(a){this.W.compaction===a||a!==I0&&a!==Dp||(this.W.compaction=a,this.C())}},breadthLimit:{get:function(){return this.W.breadthLimit},set:function(a){this.W.breadthLimit!==a&&0<=a&&(this.W.breadthLimit=a,this.C())}},rowSpacing:{get:function(){return this.W.rowSpacing},set:function(a){this.W.rowSpacing!==a&&(this.W.rowSpacing=a,this.C())}},rowIndent:{get:function(){return this.W.rowIndent},set:function(a){this.W.rowIndent!==a&&0<=a&&(this.W.rowIndent=a,this.C())}},commentSpacing:{get:function(){return this.W.commentSpacing},set:function(a){this.W.commentSpacing!==a&&(this.W.commentSpacing=a,this.C())}},commentMargin:{get:function(){return this.W.commentMargin},set:function(a){this.W.commentMargin!==a&&(this.W.commentMargin=a,this.C())}},setsPortSpot:{get:function(){return this.W.setsPortSpot},set:function(a){this.W.setsPortSpot!==a&&(this.W.setsPortSpot=a,this.C())}},portSpot:{get:function(){return this.W.portSpot},set:function(a){this.W.portSpot.D(a)||(this.W.portSpot=a,this.C())}},setsChildPortSpot:{get:function(){return this.W.setsChildPortSpot},set:function(a){this.W.setsChildPortSpot!==a&&(this.W.setsChildPortSpot=a,this.C())}},childPortSpot:{get:function(){return this.W.childPortSpot},set:function(a){this.W.childPortSpot.D(a)||(this.W.childPortSpot=a,this.C())}},alternateSorting:{get:function(){return this.Y.sorting},set:function(a){this.Y.sorting===a||a!==eg&&a!==Bp&&a!==Ap&&!Tp||(this.Y.sorting=a,this.C())}},alternateComparer:{get:function(){return this.Y.comparer},set:function(a){this.Y.comparer!==a&&(this.Y.comparer=a,this.C())}},alternateAngle:{get:function(){return this.Y.angle},set:function(a){this.Y.angle===a||a!==0&&a!==90&&a!==180&&a!==270||(this.Y.angle=a,this.C())}},alternateAlignment:{get:function(){return this.Y.alignment},set:function(a){this.Y.alignment!==a&&(this.Y.alignment=a,this.C())}},alternateNodeIndent:{get:function(){return this.Y.nodeIndent},set:function(a){this.Y.nodeIndent!==a&&0<=a&&(this.Y.nodeIndent=a,this.C())}},alternateNodeIndentPastParent:{get:function(){return this.Y.nodeIndentPastParent},set:function(a){this.Y.nodeIndentPastParent!==a&&0<=a&&1>=a&&(this.Y.nodeIndentPastParent=a,this.C())}},alternateNodeSpacing:{get:function(){return this.Y.nodeSpacing},set:function(a){this.Y.nodeSpacing!==a&&(this.Y.nodeSpacing=a,this.C())}},alternateLayerSpacing:{get:function(){return this.Y.layerSpacing},set:function(a){this.Y.layerSpacing!==a&&(this.Y.layerSpacing=a,this.C())}},alternateLayerSpacingParentOverlap:{get:function(){return this.Y.layerSpacingParentOverlap},set:function(a){this.Y.layerSpacingParentOverlap!==a&&0<=a&&1>=a&&(this.Y.layerSpacingParentOverlap=a,this.C())}},alternateCompaction:{get:function(){return this.Y.compaction},set:function(a){this.Y.compaction===a||a!==I0&&a!==Dp||(this.Y.compaction=a,this.C())}},alternateBreadthLimit:{get:function(){return this.Y.breadthLimit},set:function(a){this.Y.breadthLimit!==a&&0<=a&&(this.Y.breadthLimit=a,this.C())}},alternateRowSpacing:{get:function(){return this.Y.rowSpacing},set:function(a){this.Y.rowSpacing!==a&&(this.Y.rowSpacing=a,this.C())}},alternateRowIndent:{get:function(){return this.Y.rowIndent},set:function(a){this.Y.rowIndent!==a&&0<=a&&(this.Y.rowIndent=a,this.C())}},alternateCommentSpacing:{get:function(){return this.Y.commentSpacing},set:function(a){this.Y.commentSpacing!==a&&(this.Y.commentSpacing=a,this.C())}},alternateCommentMargin:{get:function(){return this.Y.commentMargin},set:function(a){this.Y.commentMargin!==a&&(this.Y.commentMargin=a,this.C())}},alternateSetsPortSpot:{get:function(){return this.Y.setsPortSpot},set:function(a){this.Y.setsPortSpot!==a&&(this.Y.setsPortSpot=a,this.C())}},alternatePortSpot:{get:function(){return this.Y.portSpot},set:function(a){this.Y.portSpot.D(a)||(this.Y.portSpot=a,this.C())}},alternateSetsChildPortSpot:{get:function(){return this.Y.setsChildPortSpot},set:function(a){this.Y.setsChildPortSpot!==a&&(this.Y.setsChildPortSpot=a,this.C())}},alternateChildPortSpot:{get:function(){return this.Y.childPortSpot},set:function(a){this.Y.childPortSpot.D(a)||(this.Y.childPortSpot=a,this.C())}}});var O0=new He(br,"PathDefault",-1),Xu=new He(br,"PathDestination",0),Xc=new He(br,"PathSource",1),eg=new He(br,"SortingForwards",10),Bp=new He(br,"SortingReverse",11),Ap=new He(br,"SortingAscending",12),Tp=new He(br,"SortingDescending",13),ng=new He(br,"AlignmentCenterSubtrees",20),Jc=new He(br,"AlignmentCenterChildren",21),Ju=new He(br,"AlignmentStart",22),Qu=new He(br,"AlignmentEnd",23),Hh=new He(br,"AlignmentBus",24),$u=new He(br,"AlignmentBusBranching",25),Wh=new He(br,"AlignmentTopLeftBus",26),gh=new He(br,"AlignmentBottomRightBus",27),I0=new He(br,"CompactionNone",30),Dp=new He(br,"CompactionBlock",31),_0=new He(br,"StyleLayered",40),Ty=new He(br,"StyleLastParents",41),Dy=new He(br,"StyleAlternating",42),Oy=new He(br,"StyleRootOnly",43),R0=new He(br,"ArrangementVertical",50),Iy=new He(br,"ArrangementHorizontal",51),j0=new He(br,"ArrangementFixedRoots",52),_y=new He(br,"LayerIndividual",60),Ry=new He(br,"LayerSiblings",61),z0=new He(br,"LayerUniform",62);br.className="TreeLayout",br.PathDefault=O0,br.PathDestination=Xu,br.PathSource=Xc,br.SortingForwards=eg,br.SortingReverse=Bp,br.SortingAscending=Ap,br.SortingDescending=Tp,br.AlignmentCenterSubtrees=ng,br.AlignmentCenterChildren=Jc,br.AlignmentStart=Ju,br.AlignmentEnd=Qu,br.AlignmentBus=Hh,br.AlignmentBusBranching=$u,br.AlignmentTopLeftBus=Wh,br.AlignmentBottomRightBus=gh,br.CompactionNone=I0,br.CompactionBlock=Dp,br.StyleLayered=_0,br.StyleLastParents=Ty,br.StyleAlternating=Dy,br.StyleRootOnly=Oy,br.ArrangementVertical=R0,br.ArrangementHorizontal=Iy,br.ArrangementFixedRoots=j0,br.LayerIndividual=_y,br.LayerSiblings=Ry,br.LayerUniform=z0;function Qc(a){Do.call(this,a)}Se(Qc,Do),Qc.prototype.createVertex=function(){return new _l(this)},Qc.prototype.createEdge=function(){return new ig(this)},Qc.className="TreeNetwork";function _l(a){Ca.call(this,a),this.V=!1,this.hb=null,this.u=[],this.nb=this.Ha=this.F=this.ia=0,this.td=null,this.S=new At(0,0),this.Da=new ln(0,0),this.la=new At(0,0),this.im=this.hm=this.qA=!1,this.kp=this.Yo=null,this.nd=eg,this.hd=ry,this.Kb=0,this.Jb=Jc,this.Vq=this.Uq=0,this.Wq=20,this.ie=50,this.Aq=0,this.Hp=Dp,this.Ap=0,this.nr=25,this.Gp=this.mr=10,this.Fp=20,this.xr=!0,this.dr=xa,this.wr=!0,this.Dp=xa}Se(_l,Ca),_l.prototype.copyInheritedPropertiesFrom=function(a){a!==null&&(this.nd=a.sorting,this.hd=a.comparer,this.Kb=a.angle,this.Jb=a.alignment,this.Uq=a.nodeIndent,this.Vq=a.nodeIndentPastParent,this.Wq=a.nodeSpacing,this.ie=a.layerSpacing,this.Aq=a.layerSpacingParentOverlap,this.Hp=a.compaction,this.Ap=a.breadthLimit,this.nr=a.rowSpacing,this.mr=a.rowIndent,this.Gp=a.commentSpacing,this.Fp=a.commentMargin,this.xr=a.setsPortSpot,this.dr=a.portSpot,this.wr=a.setsChildPortSpot,this.Dp=a.childPortSpot)},ve.Object.defineProperties(_l.prototype,{initialized:{get:function(){return this.V},set:function(a){this.V!==a&&(this.V=a)}},parent:{get:function(){return this.hb},set:function(a){this.hb!==a&&(this.hb=a)}},children:{get:function(){return this.u},set:function(a){if(this.u!==a){if(a!==null)for(var y=a.length,x=0;x<y;x++);this.u=a}}},level:{get:function(){return this.ia},set:function(a){this.ia!==a&&(this.ia=a)}},descendantCount:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a)}},maxChildrenCount:{get:function(){return this.Ha},set:function(a){this.Ha!==a&&(this.Ha=a)}},maxGenerationCount:{get:function(){return this.nb},set:function(a){this.nb!==a&&(this.nb=a)}},comments:{get:function(){return this.td},set:function(a){if(this.td!==a){if(a!==null)for(var y=a.length,x=0;x<y;x++);this.td=a}}},sorting:{get:function(){return this.nd},set:function(a){this.nd!==a&&(this.nd=a)}},comparer:{get:function(){return this.hd},set:function(a){this.hd!==a&&(this.hd=a)}},angle:{get:function(){return this.Kb},set:function(a){this.Kb!==a&&(this.Kb=a)}},alignment:{get:function(){return this.Jb},set:function(a){this.Jb!==a&&(this.Jb=a)}},nodeIndent:{get:function(){return this.Uq},set:function(a){this.Uq!==a&&(this.Uq=a)}},nodeIndentPastParent:{get:function(){return this.Vq},set:function(a){this.Vq!==a&&(this.Vq=a)}},nodeSpacing:{get:function(){return this.Wq},set:function(a){this.Wq!==a&&(this.Wq=a)}},layerSpacing:{get:function(){return this.ie},set:function(a){this.ie!==a&&(this.ie=a)}},layerSpacingParentOverlap:{get:function(){return this.Aq},set:function(a){this.Aq!==a&&(this.Aq=a)}},compaction:{get:function(){return this.Hp},set:function(a){this.Hp!==a&&(this.Hp=a)}},breadthLimit:{get:function(){return this.Ap},set:function(a){this.Ap!==a&&(this.Ap=a)}},rowSpacing:{get:function(){return this.nr},set:function(a){this.nr!==a&&(this.nr=a)}},rowIndent:{get:function(){return this.mr},set:function(a){this.mr!==a&&(this.mr=a)}},commentSpacing:{get:function(){return this.Gp},set:function(a){this.Gp!==a&&(this.Gp=a)}},commentMargin:{get:function(){return this.Fp},set:function(a){this.Fp!==a&&(this.Fp=a)}},setsPortSpot:{get:function(){return this.xr},set:function(a){this.xr!==a&&(this.xr=a)}},portSpot:{get:function(){return this.dr},set:function(a){this.dr.D(a)||(this.dr=a)}},setsChildPortSpot:{get:function(){return this.wr},set:function(a){this.wr!==a&&(this.wr=a)}},childPortSpot:{get:function(){return this.Dp},set:function(a){this.Dp.D(a)||(this.Dp=a)}},childrenCount:{get:function(){return this.children.length}},relativePosition:{get:function(){return this.S},set:function(a){this.S.set(a)}},subtreeSize:{get:function(){return this.Da},set:function(a){this.Da.set(a)}},subtreeOffset:{get:function(){return this.la},set:function(a){this.la.set(a)}}}),_l.className="TreeVertex";function ig(a){qs.call(this,a),this.$t=new At(0,0)}Se(ig,qs),ig.prototype.commit=function(){var a=this.link;if(a!==null&&!a.isAvoiding){var y=this.network.layout,x=null,E=null;switch(y.ud){case Xu:x=this.fromVertex,E=this.toVertex;break;case Xc:x=this.toVertex,E=this.fromVertex;break;default:$t("Unhandled path value "+y.ud.toString())}if(x!==null&&E!==null){var b=this.$t;if(b.x!==0||b.y!==0||x.qA){E=x.bounds;var z=eu(x),tt=y.computeLayerSpacing(x),rt=x.rowSpacing;a.vg();var ot=a.curve===ul,lt=a.isOrthogonal,ut;if(a.uh(),lt||ot){for(ut=2;4<a.pointsCount;)a.pv(2);var ft=a.i(1),yt=a.i(2)}else{for(ut=1;3<a.pointsCount;)a.pv(1);ft=a.i(0),yt=a.i(a.pointsCount-1)}var xt=a.i(a.pointsCount-1);z===0?(x.alignment===Qu?(z=E.bottom+b.y,b.y===0&&ft.y>xt.y+x.rowIndent&&(z=Math.min(z,Math.max(ft.y,z-y.computeNodeIndent(x))))):x.alignment===Ju?(z=E.top+b.y,b.y===0&&ft.y<xt.y-x.rowIndent&&(z=Math.max(z,Math.min(ft.y,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?E.top-x.la.y+b.y:E.y+E.height/2+b.y,ot?(a.m(ut,ft.x,z),ut++,a.m(ut,E.right+tt,z),ut++,a.m(ut,E.right+tt+(b.x-rt)/3,z),ut++,a.m(ut,E.right+tt+2*(b.x-rt)/3,z),ut++,a.m(ut,E.right+tt+(b.x-rt),z),ut++,a.m(ut,yt.x,z)):(lt&&(a.m(ut,E.right+tt/2,ft.y),ut++),a.m(ut,E.right+tt/2,z),ut++,a.m(ut,E.right+tt+b.x-(lt?rt/2:rt),z),ut++,lt&&a.m(ut,a.i(ut-1).x,yt.y))):z===90?(x.alignment===Qu?(z=E.right+b.x,b.x===0&&ft.x>xt.x+x.rowIndent&&(z=Math.min(z,Math.max(ft.x,z-y.computeNodeIndent(x))))):x.alignment===Ju?(z=E.left+b.x,b.x===0&&ft.x<xt.x-x.rowIndent&&(z=Math.max(z,Math.min(ft.x,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?E.left-x.la.x+b.x:E.x+E.width/2+b.x,ot?(a.m(ut,z,ft.y),ut++,a.m(ut,z,E.bottom+tt),ut++,a.m(ut,z,E.bottom+tt+(b.y-rt)/3),ut++,a.m(ut,z,E.bottom+tt+2*(b.y-rt)/3),ut++,a.m(ut,z,E.bottom+tt+(b.y-rt)),ut++,a.m(ut,z,yt.y)):(lt&&(a.m(ut,ft.x,E.bottom+tt/2),ut++),a.m(ut,z,E.bottom+tt/2),ut++,a.m(ut,z,E.bottom+tt+b.y-(lt?rt/2:rt)),ut++,lt&&a.m(ut,yt.x,a.i(ut-1).y))):z===180?(x.alignment===Qu?(z=E.bottom+b.y,b.y===0&&ft.y>xt.y+x.rowIndent&&(z=Math.min(z,Math.max(ft.y,z-y.computeNodeIndent(x))))):x.alignment===Ju?(z=E.top+b.y,b.y===0&&ft.y<xt.y-x.rowIndent&&(z=Math.max(z,Math.min(ft.y,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?E.top-x.la.y+b.y:E.y+E.height/2+b.y,ot?(a.m(ut,ft.x,z),ut++,a.m(ut,E.left-tt,z),ut++,a.m(ut,E.left-tt+(b.x+rt)/3,z),ut++,a.m(ut,E.left-tt+2*(b.x+rt)/3,z),ut++,a.m(ut,E.left-tt+(b.x+rt),z),ut++,a.m(ut,yt.x,z)):(lt&&(a.m(ut,E.left-tt/2,ft.y),ut++),a.m(ut,E.left-tt/2,z),ut++,a.m(ut,E.left-tt+b.x+(lt?rt/2:rt),z),ut++,lt&&a.m(ut,a.i(ut-1).x,yt.y))):z===270?(x.alignment===Qu?(z=E.right+b.x,b.x===0&&ft.x>xt.x+x.rowIndent&&(z=Math.min(z,Math.max(ft.x,z-y.computeNodeIndent(x))))):x.alignment===Ju?(z=E.left+b.x,b.x===0&&ft.x<xt.x-x.rowIndent&&(z=Math.max(z,Math.min(ft.x,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?E.left-x.la.x+b.x:E.x+E.width/2+b.x,ot?(a.m(ut,z,ft.y),ut++,a.m(ut,z,E.top-tt),ut++,a.m(ut,z,E.top-tt+(b.y+rt)/3),ut++,a.m(ut,z,E.top-tt+2*(b.y+rt)/3),ut++,a.m(ut,z,E.top-tt+(b.y+rt)),ut++,a.m(ut,z,yt.y)):(lt&&(a.m(ut,ft.x,E.top-tt/2),ut++),a.m(ut,z,E.top-tt/2),ut++,a.m(ut,z,E.top-tt+b.y+(lt?rt/2:rt)),ut++,lt&&a.m(ut,yt.x,a.i(ut-1).y))):$t("Invalid angle "+z),a.zf()}else b=E,a=this.link,E=this.network.layout,y=eu(x),y!==eu(b)&&(tt=E.computeLayerSpacing(x),rt=x.bounds,x=b.bounds,y===0&&x.left-rt.right<tt+1||y===90&&x.top-rt.bottom<tt+1||y===180&&rt.left-x.right<tt+1||y===270&&rt.top-x.bottom<tt+1||(a.vg(),x=a.curve===ul,b=a.isOrthogonal,E=Md(this.fromVertex.alignment),a.uh(),y===0?(y=rt.right+tt/2,x?a.pointsCount===4&&(x=a.i(3).y,a.L(1,y-20,a.i(1).y),a.m(2,y-20,x),a.m(3,y,x),a.m(4,y+20,x),a.L(5,a.i(5).x,x)):b?E?a.L(3,a.i(2).x,a.i(4).y):a.pointsCount===6&&(a.L(2,y,a.i(2).y),a.L(3,y,a.i(3).y)):a.pointsCount===4?a.m(2,y,a.i(2).y):a.pointsCount===3?a.L(1,y,a.i(2).y):a.pointsCount===2&&a.m(1,y,a.i(1).y)):y===90?(y=rt.bottom+tt/2,x?a.pointsCount===4&&(x=a.i(3).x,a.L(1,a.i(1).x,y-20),a.m(2,x,y-20),a.m(3,x,y),a.m(4,x,y+20),a.L(5,x,a.i(5).y)):b?E?a.L(3,a.i(2).x,a.i(4).y):a.pointsCount===6&&(a.L(2,a.i(2).x,y),a.L(3,a.i(3).x,y)):a.pointsCount===4?a.m(2,a.i(2).x,y):a.pointsCount===3?a.L(1,a.i(2).x,y):a.pointsCount===2&&a.m(1,a.i(1).x,y)):y===180?(y=rt.left-tt/2,x?a.pointsCount===4&&(x=a.i(3).y,a.L(1,y+20,a.i(1).y),a.m(2,y+20,x),a.m(3,y,x),a.m(4,y-20,x),a.L(5,a.i(5).x,x)):b?E?a.L(3,a.i(2).x,a.i(4).y):a.pointsCount===6&&(a.L(2,y,a.i(2).y),a.L(3,y,a.i(3).y)):a.pointsCount===4?a.m(2,y,a.i(2).y):a.pointsCount===3?a.L(1,y,a.i(2).y):a.pointsCount===2&&a.m(1,y,a.i(1).y)):y===270&&(y=rt.top-tt/2,x?a.pointsCount===4&&(x=a.i(3).x,a.L(1,a.i(1).x,y+20),a.m(2,x,y+20),a.m(3,x,y),a.m(4,x,y-20),a.L(5,x,a.i(5).y)):b?E?a.L(3,a.i(2).x,a.i(4).y):a.pointsCount===6&&(a.L(2,a.i(2).x,y),a.L(3,a.i(3).x,y)):a.pointsCount===4?a.m(2,a.i(2).x,y):a.pointsCount===3?a.L(1,a.i(2).x,y):a.pointsCount===2&&a.m(1,a.i(1).x,y)),a.zf()))}}},ve.Object.defineProperties(ig.prototype,{fromVertex:{get:function(){return this.kd},set:function(a){this.kd!==a&&(this.kd=a)}},toVertex:{get:function(){return this.qd},set:function(a){this.qd!==a&&(this.qd=a)}},relativePoint:{get:function(){return this.$t},set:function(a){this.$t.set(a)}}}),ig.className="TreeEdge",Nr.prototype.initializeStandardTools=function(){this.gb("Action",new Nl,this.mouseDownTools),this.gb("Relinking",new Ua,this.mouseDownTools),this.gb("LinkReshaping",new $o,this.mouseDownTools),this.gb("Rotating",new Ss,this.mouseDownTools),this.gb("Resizing",new rs,this.mouseDownTools),this.gb("Linking",new Er,this.mouseMoveTools),this.gb("Dragging",new Ro,this.mouseMoveTools),this.gb("DragSelecting",new fl,this.mouseMoveTools),this.gb("Panning",new Qa,this.mouseMoveTools),this.gb("ContextMenu",new xs,this.mouseUpTools),this.gb("TextEditing",new Zo,this.mouseUpTools),this.gb("ClickCreating",new Eh,this.mouseUpTools),this.gb("ClickSelecting",new td,this.mouseUpTools)},bu("Horizontal",new pm),bu("Spot",new vm),bu("Table",new Sm),bu("Viewbox",new wm),bu("TableRow",new xm),bu("TableColumn",new Pm),bu("Graduated",new Jg),bu("Grid",new Xg),Ff.add("GraphLinksModel",Da),Ff.add("TreeModel",Pl);var Z0=$e.go,jy={get licenseKey(){return be.licenseKey},set licenseKey(a){be.licenseKey=a},get version(){return be.version},Group:or,EnumValue:He,List:fn,Set:pn,Map:Ie,Point:At,Size:ln,Rect:Be,Margin:ir,Spot:In,Geometry:Ye,PathFigure:Ur,PathSegment:Ri,InputEvent:er,DiagramEvent:tr,ChangedEvent:bi,Model:Ci,GraphLinksModel:zr,TreeModel:ks,Binding:ua,Transaction:dr,UndoManager:po,CommandHandler:Ht,Tool:zi,DraggingTool:Ro,DraggingInfo:lh,DraggingOptions:at,LinkingBaseTool:Cr,LinkingTool:Er,RelinkingTool:Ua,LinkReshapingTool:$o,ResizingTool:rs,RotatingTool:Ss,ClickSelectingTool:td,ActionTool:Nl,ClickCreatingTool:Eh,HTMLInfo:Eu,ContextMenuTool:xs,DragSelectingTool:fl,PanningTool:Qa,TextEditingTool:Zo,ToolManager:Nr,Animation:$a,AnimationManager:Js,AnimationTrigger:Ul,Layer:_a,Diagram:be,Palette:ct,Overview:mt,Brush:mo,GraphObject:de,Panel:En,RowColumnDefinition:va,Shape:cr,TextBlock:To,Picture:Is,Part:Ni,Adornment:Yr,Node:qn,Link:Tn,Placeholder:Es,Layout:Wo,LayoutNetwork:Do,LayoutVertex:Ca,LayoutEdge:qs,GridLayout:Ha,PanelLayout:wa,CircularLayout:Xo,CircularNetwork:$f,CircularVertex:Ep,CircularEdge:P0,ForceDirectedLayout:ts,ForceDirectedNetwork:Uc,ForceDirectedVertex:Lp,ForceDirectedEdge:Fp,LayeredDigraphLayout:So,LayeredDigraphNetwork:tg,LayeredDigraphVertex:Cl,LayeredDigraphEdge:bp,TreeLayout:br,TreeNetwork:Qc,TreeVertex:_l,TreeEdge:ig};typeof Z0=="object"&&Z0.version&&ri("WARNING: a `go` object on the root object is already defined. "+("Debug"in Z0?"debug ":"")+"version: "+Z0.version+", replaced with version: "+jy.version),be.prototype.go=jy,$e.go=jy,typeof Dn.exports=="object"&&(Dn.exports=typeof kt.g!="undefined"?kt.g.go:self.go)}();var pt=typeof kt.g!="undefined"?kt.g.go:self.go;const Ut=typeof kt.g!="undefined"?kt.g.go:self.go,le=Ut.Group,Me=Ut.EnumValue,ue=Ut.List,It=Ut.Set,qt=Ut.Map,ge=Ut.Point,ne=Ut.Size,Rt=Ut.Rect,Ae=Ut.Margin,ie=Ut.Spot,Ee=Ut.Geometry,Bt=Ut.PathFigure,nt=Ut.PathSegment,et=Ut.InputEvent,ht=Ut.DiagramEvent,st=Ut.ChangedEvent,gt=Ut.Model,vt=Ut.GraphLinksModel,St=Ut.TreeModel,Et=Ut.Binding,Tt=Ut.Transaction,Dt=Ut.UndoManager,Jt=Ut.CommandHandler,Yt=Ut.Tool,Gt=Ut.DraggingTool,me=Ut.DraggingInfo,ae=Ut.LinkingBaseTool,Ne=Ut.LinkingTool,Ce=Ut.RelinkingTool,we=Ut.LinkReshapingTool,tn=Ut.ResizingTool,_e=Ut.RotatingTool,an=Ut.ClickSelectingTool,Ke=Ut.ActionTool,oe=Ut.ClickCreatingTool,Xt=Ut.HTMLInfo,qe=Ut.ContextMenuTool,_n=Ut.DragSelectingTool,Pn=Ut.PanningTool,De=Ut.TextEditingTool,dn=Ut.ToolManager,sn=Ut.Animation,jn=Ut.AnimationManager,Te=Ut.AnimationTrigger,Sn=Ut.Layer,ee=Ut.Diagram,Mn=Ut.Palette,ui=Ut.Overview,_t=Ut.Brush,Lt=Ut.GraphObject,Pt=Ut.Panel,Nt=Ut.RowColumnDefinition,zt=Ut.Shape,Mt=Ut.TextBlock,Kt=Ut.TextBlockMetrics,ye=Ut.Picture,Ue=Ut.Part,Qe=Ut.Adornment,ce=Ut.Node,Oe=Ut.Link,Le=Ut.Placeholder,Xe=Ut.Layout,vn=Ut.LayoutNetwork,cn=Ut.LayoutVertex,hn=Ut.LayoutEdge,Ti=Ut.GridLayout,Ge=Ut.PanelLayout,Je=Ut.CircularLayout,rn=Ut.CircularNetwork,Xn=Ut.CircularVertex,Ln=Ut.CircularEdge,nn=Ut.ForceDirectedLayout,Kn=Ut.ForceDirectedNetwork,mi=Ut.ForceDirectedVertex,ei=Ut.ForceDirectedEdge,Si=Ut.LayeredDigraphLayout,Wi=Ut.LayeredDigraphNetwork,An=Ut.LayeredDigraphVertex,gn=Ut.LayeredDigraphEdge,Rn=Ut.TreeLayout,si=Ut.TreeNetwork,xi=Ut.TreeVertex,di=Ut.TreeEdge,Oi=Ut.version},24334:function(Dn,Gn,kt){var pt,Ut;(function(le,Me){Dn.exports=Me(le)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof kt.g!="undefined"?kt.g:this,function(le){"use strict";le=le||{};var Me=le.Base64,ue="2.6.4",It="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qt=function(Ce){for(var we={},tn=0,_e=Ce.length;tn<_e;tn++)we[Ce.charAt(tn)]=tn;return we}(It),ge=String.fromCharCode,ne=function(Ce){if(Ce.length<2){var we=Ce.charCodeAt(0);return we<128?Ce:we<2048?ge(192|we>>>6)+ge(128|we&63):ge(224|we>>>12&15)+ge(128|we>>>6&63)+ge(128|we&63)}else{var we=65536+(Ce.charCodeAt(0)-55296)*1024+(Ce.charCodeAt(1)-56320);return ge(240|we>>>18&7)+ge(128|we>>>12&63)+ge(128|we>>>6&63)+ge(128|we&63)}},Rt=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Ae=function(Ce){return Ce.replace(Rt,ne)},ie=function(Ce){var we=[0,2,1][Ce.length%3],tn=Ce.charCodeAt(0)<<16|(Ce.length>1?Ce.charCodeAt(1):0)<<8|(Ce.length>2?Ce.charCodeAt(2):0),_e=[It.charAt(tn>>>18),It.charAt(tn>>>12&63),we>=2?"=":It.charAt(tn>>>6&63),we>=1?"=":It.charAt(tn&63)];return _e.join("")},Ee=le.btoa&&typeof le.btoa=="function"?function(Ce){return le.btoa(Ce)}:function(Ce){if(Ce.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return Ce.replace(/[\s\S]{1,3}/g,ie)},Bt=function(Ce){return Ee(Ae(String(Ce)))},nt=function(Ce){return Ce.replace(/[+\/]/g,function(we){return we=="+"?"-":"_"}).replace(/=/g,"")},et=function(Ce,we){return we?nt(Bt(Ce)):Bt(Ce)},ht=function(Ce){return et(Ce,!0)},st;le.Uint8Array&&(st=function(Ce,we){for(var tn="",_e=0,an=Ce.length;_e<an;_e+=3){var Ke=Ce[_e],oe=Ce[_e+1],Xt=Ce[_e+2],qe=Ke<<16|oe<<8|Xt;tn+=It.charAt(qe>>>18)+It.charAt(qe>>>12&63)+(typeof oe!="undefined"?It.charAt(qe>>>6&63):"=")+(typeof Xt!="undefined"?It.charAt(qe&63):"=")}return we?nt(tn):tn});var gt=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,vt=function(Ce){switch(Ce.length){case 4:var we=(7&Ce.charCodeAt(0))<<18|(63&Ce.charCodeAt(1))<<12|(63&Ce.charCodeAt(2))<<6|63&Ce.charCodeAt(3),tn=we-65536;return ge((tn>>>10)+55296)+ge((tn&1023)+56320);case 3:return ge((15&Ce.charCodeAt(0))<<12|(63&Ce.charCodeAt(1))<<6|63&Ce.charCodeAt(2));default:return ge((31&Ce.charCodeAt(0))<<6|63&Ce.charCodeAt(1))}},St=function(Ce){return Ce.replace(gt,vt)},Et=function(Ce){var we=Ce.length,tn=we%4,_e=(we>0?qt[Ce.charAt(0)]<<18:0)|(we>1?qt[Ce.charAt(1)]<<12:0)|(we>2?qt[Ce.charAt(2)]<<6:0)|(we>3?qt[Ce.charAt(3)]:0),an=[ge(_e>>>16),ge(_e>>>8&255),ge(_e&255)];return an.length-=[0,0,2,1][tn],an.join("")},Tt=le.atob&&typeof le.atob=="function"?function(Ce){return le.atob(Ce)}:function(Ce){return Ce.replace(/\S{1,4}/g,Et)},Dt=function(Ce){return Tt(String(Ce).replace(/[^A-Za-z0-9\+\/]/g,""))},Jt=function(Ce){return St(Tt(Ce))},Yt=function(Ce){return String(Ce).replace(/[-_]/g,function(we){return we=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},Gt=function(Ce){return Jt(Yt(Ce))},me;le.Uint8Array&&(me=function(Ce){return Uint8Array.from(Dt(Yt(Ce)),function(we){return we.charCodeAt(0)})});var ae=function(){var Ce=le.Base64;return le.Base64=Me,Ce};if(le.Base64={VERSION:ue,atob:Dt,btoa:Ee,fromBase64:Gt,toBase64:et,utob:Ae,encode:et,encodeURI:ht,btou:St,decode:Gt,noConflict:ae,fromUint8Array:st,toUint8Array:me},typeof Object.defineProperty=="function"){var Ne=function(Ce){return{value:Ce,enumerable:!1,writable:!0,configurable:!0}};le.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",Ne(function(){return Gt(this)})),Object.defineProperty(String.prototype,"toBase64",Ne(function(Ce){return et(this,Ce)})),Object.defineProperty(String.prototype,"toBase64URI",Ne(function(){return et(this,!0)}))}}return le.Meteor&&(Base64=le.Base64),Dn.exports?Dn.exports.Base64=le.Base64:(pt=[],Ut=function(){return le.Base64}.apply(Gn,pt),Ut!==void 0&&(Dn.exports=Ut)),{Base64:le.Base64}})},2859:function(Dn,Gn,kt){"use strict";kt.d(Gn,{hP:function(){return ui}});var pt=function(_t,Lt){return(pt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Pt,Nt){Pt.__proto__=Nt}||function(Pt,Nt){for(var zt in Nt)Object.prototype.hasOwnProperty.call(Nt,zt)&&(Pt[zt]=Nt[zt])})(_t,Lt)};function Ut(_t,Lt){function Pt(){this.constructor=_t}pt(_t,Lt),_t.prototype=Lt===null?Object.create(Lt):(Pt.prototype=Lt.prototype,new Pt)}function le(_t,Lt,Pt,Nt){return new(Pt||(Pt=Promise))(function(zt,Mt){function Kt(Qe){try{Ue(Nt.next(Qe))}catch(ce){Mt(ce)}}function ye(Qe){try{Ue(Nt.throw(Qe))}catch(ce){Mt(ce)}}function Ue(Qe){var ce;Qe.done?zt(Qe.value):(ce=Qe.value,ce instanceof Pt?ce:new Pt(function(Oe){Oe(ce)})).then(Kt,ye)}Ue((Nt=Nt.apply(_t,Lt||[])).next())})}function Me(_t,Lt){var Pt,Nt,zt,Mt,Kt={label:0,sent:function(){if(1&zt[0])throw zt[1];return zt[1]},trys:[],ops:[]};return Mt={next:ye(0),throw:ye(1),return:ye(2)},typeof Symbol=="function"&&(Mt[Symbol.iterator]=function(){return this}),Mt;function ye(Ue){return function(Qe){return function(ce){if(Pt)throw new TypeError("Generator is already executing.");for(;Kt;)try{if(Pt=1,Nt&&(zt=2&ce[0]?Nt.return:ce[0]?Nt.throw||((zt=Nt.return)&&zt.call(Nt),0):Nt.next)&&!(zt=zt.call(Nt,ce[1])).done)return zt;switch(Nt=0,zt&&(ce=[2&ce[0],zt.value]),ce[0]){case 0:case 1:zt=ce;break;case 4:return Kt.label++,{value:ce[1],done:!1};case 5:Kt.label++,Nt=ce[1],ce=[0];continue;case 7:ce=Kt.ops.pop(),Kt.trys.pop();continue;default:if(zt=Kt.trys,!((zt=zt.length>0&&zt[zt.length-1])||ce[0]!==6&&ce[0]!==2)){Kt=0;continue}if(ce[0]===3&&(!zt||ce[1]>zt[0]&&ce[1]<zt[3])){Kt.label=ce[1];break}if(ce[0]===6&&Kt.label<zt[1]){Kt.label=zt[1],zt=ce;break}if(zt&&Kt.label<zt[2]){Kt.label=zt[2],Kt.ops.push(ce);break}zt[2]&&Kt.ops.pop(),Kt.trys.pop();continue}ce=Lt.call(_t,Kt)}catch(Oe){ce=[6,Oe],Nt=0}finally{Pt=zt=0}if(5&ce[0])throw ce[1];return{value:ce[0]?ce[1]:void 0,done:!0}}([Ue,Qe])}}}function ue(){for(var _t=0,Lt=0,Pt=arguments.length;Lt<Pt;Lt++)_t+=arguments[Lt].length;var Nt=Array(_t),zt=0;for(Lt=0;Lt<Pt;Lt++)for(var Mt=arguments[Lt],Kt=0,ye=Mt.length;Kt<ye;Kt++,zt++)Nt[zt]=Mt[Kt];return Nt}var It=function(){function _t(){}return _t.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},_t.setAttributes=function(Lt,Pt){for(var Nt=0,zt=Pt;Nt<zt.length;Nt++){var Mt=zt[Nt],Kt=Mt[0],ye=Mt[1];Lt.setAttribute(Kt,ye)}},_t.createRect=function(Lt,Pt,Nt){var zt=document.createElementNS("http://www.w3.org/2000/svg","rect");return zt.setAttribute("width",Lt.toString()),zt.setAttribute("height",Pt.toString()),Nt&&_t.setAttributes(zt,Nt),zt},_t.createLine=function(Lt,Pt,Nt,zt,Mt){var Kt=document.createElementNS("http://www.w3.org/2000/svg","line");return Kt.setAttribute("x1",Lt.toString()),Kt.setAttribute("y1",Pt.toString()),Kt.setAttribute("x2",Nt.toString()),Kt.setAttribute("y2",zt.toString()),Mt&&_t.setAttributes(Kt,Mt),Kt},_t.createPolygon=function(Lt,Pt){var Nt=document.createElementNS("http://www.w3.org/2000/svg","polygon");return Nt.setAttribute("points",Lt),Pt&&_t.setAttributes(Nt,Pt),Nt},_t.createCircle=function(Lt,Pt){var Nt=document.createElementNS("http://www.w3.org/2000/svg","circle");return Nt.setAttribute("cx",(Lt/2).toString()),Nt.setAttribute("cy",(Lt/2).toString()),Nt.setAttribute("r",Lt.toString()),Pt&&_t.setAttributes(Nt,Pt),Nt},_t.createEllipse=function(Lt,Pt,Nt){var zt=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return zt.setAttribute("cx",(Lt/2).toString()),zt.setAttribute("cy",(Pt/2).toString()),zt.setAttribute("rx",(Lt/2).toString()),zt.setAttribute("ry",(Pt/2).toString()),Nt&&_t.setAttributes(zt,Nt),zt},_t.createGroup=function(Lt){var Pt=document.createElementNS("http://www.w3.org/2000/svg","g");return Lt&&_t.setAttributes(Pt,Lt),Pt},_t.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},_t.createMarker=function(Lt,Pt,Nt,zt,Mt,Kt,ye){var Ue=document.createElementNS("http://www.w3.org/2000/svg","marker");return _t.setAttributes(Ue,[["id",Lt],["orient",Pt],["markerWidth",Nt.toString()],["markerHeight",zt.toString()],["refX",Mt.toString()],["refY",Kt.toString()]]),Ue.appendChild(ye),Ue},_t.createText=function(Lt){var Pt=document.createElementNS("http://www.w3.org/2000/svg","text");return Pt.setAttribute("x","0"),Pt.setAttribute("y","0"),Lt&&_t.setAttributes(Pt,Lt),Pt},_t.createTSpan=function(Lt,Pt){var Nt=document.createElementNS("http://www.w3.org/2000/svg","tspan");return Nt.textContent=Lt,Pt&&_t.setAttributes(Nt,Pt),Nt},_t.createImage=function(Lt){var Pt=document.createElementNS("http://www.w3.org/2000/svg","image");return Lt&&_t.setAttributes(Pt,Lt),Pt},_t.createPoint=function(Lt,Pt){var Nt=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return Nt.x=Lt,Nt.y=Pt,Nt},_t.createPath=function(Lt,Pt){var Nt=document.createElementNS("http://www.w3.org/2000/svg","path");return Nt.setAttribute("d",Lt),Pt&&_t.setAttributes(Nt,Pt),Nt},_t}(),qt=function(){function _t(){}return _t.addKey=function(Lt){_t.key=Lt},Object.defineProperty(_t,"isLicensed",{get:function(){return!!_t.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(_t.key)},enumerable:!1,configurable:!0}),_t}(),ge=function(){function _t(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return _t.prototype.rasterize=function(Lt,Pt,Nt){var zt=this;return new Promise(function(Mt){var Kt=Nt!==void 0?Nt:document.createElement("canvas");Lt===null&&(zt.markersOnly=!0,zt.naturalSize=!1);var ye=document.createElementNS("http://www.w3.org/2000/svg","svg");ye.setAttribute("xmlns","http://www.w3.org/2000/svg"),ye.setAttribute("width",Pt.width.baseVal.valueAsString),ye.setAttribute("height",Pt.height.baseVal.valueAsString),ye.setAttribute("viewBox","0 0 "+Pt.viewBox.baseVal.width.toString()+" "+Pt.viewBox.baseVal.height.toString()),ye.innerHTML=Pt.innerHTML,zt.naturalSize===!0?(ye.width.baseVal.value=Lt.naturalWidth,ye.height.baseVal.value=Lt.naturalHeight):zt.width!==void 0&&zt.height!==void 0&&(ye.width.baseVal.value=zt.width,ye.height.baseVal.value=zt.height),Kt.width=ye.width.baseVal.value,Kt.height=ye.height.baseVal.value;var Ue=ye.outerHTML,Qe=Kt.getContext("2d");zt.markersOnly!==!0&&Qe.drawImage(Lt,0,0,Kt.width,Kt.height);var ce=window.URL,Oe=new Image(Kt.width,Kt.height);Oe.setAttribute("crossOrigin","anonymous");var Le=new Blob([Ue],{type:"image/svg+xml"}),Xe=ce.createObjectURL(Le);Oe.onload=function(){Qe.drawImage(Oe,0,0),ce.revokeObjectURL(Xe);var vn=Kt.toDataURL(zt.imageType,zt.imageQuality);Mt(vn)},Oe.src=Xe})},_t}(),ne=function(){},Rt=function(){function _t(Lt){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+Lt+"_"}return Object.defineProperty(_t.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),_t.prototype.addClass=function(Lt){return this.styleSheet===void 0&&this.addStyleSheet(),Lt.name=""+this.classNamePrefix+Lt.localName,this.classes.push(Lt),this.styleSheet.sheet.insertRule("."+Lt.name+" {"+Lt.style+"}",this.styleSheet.sheet.cssRules.length),Lt},_t.prototype.addRule=function(Lt){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(Lt),this.styleSheet.sheet.insertRule(Lt.selector+" {"+Lt.style+"}",this.styleSheet.sheet.cssRules.length)},_t.prototype.addStyleSheet=function(){var Lt;this.styleSheet=document.createElement("style"),((Lt=this.styleSheetRoot)!==null&&Lt!==void 0?Lt:document.head).appendChild(this.styleSheet),this.addRule(new Ae("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ae("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Ae("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new ie("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new ie("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},_t.prototype.removeStyleSheet=function(){var Lt;this.styleSheet&&(((Lt=this.styleSheetRoot)!==null&&Lt!==void 0?Lt:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},_t}(),Ae=function(_t,Lt){this.selector=_t,this.style=Lt},ie=function(_t,Lt){this.localName=_t,this.style=Lt},Ee=function(){function _t(Lt,Pt,Nt,zt,Mt){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=Lt,this.displayMode=Pt,this.markerItems=Nt,this.uiStyleSettings=zt,this.styles=Mt,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return _t.prototype.show=function(Lt){var Pt=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=Lt,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var Nt=document.createElement("div");Nt.className=this.toolbarBlockStyleClass.name,Nt.style.whiteSpace="nowrap",this.uiContainer.appendChild(Nt),this.addActionButton(Nt,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(Nt,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(Nt,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(Nt,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(Nt,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(Nt,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(Nt,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(Nt,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(Mt){var Kt=document.createElement("div");Kt.className=""+Pt.toolbarButtonStyleClass.name,Kt.setAttribute("data-type-name",Mt.typeName),Kt.innerHTML=Mt.icon,Kt.addEventListener("click",function(){Pt.markerToolbarButtonClicked(Kt,Mt)}),Pt.buttons.push(Kt),Pt.markerButtons.push(Kt)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var zt=document.createElement("div");zt.className=this.toolbarBlockStyleClass.name,zt.style.whiteSpace="nowrap",zt.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(zt),this.addActionButton(zt,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(zt,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},_t.prototype.addButtonClickListener=function(Lt){this.buttonClickListeners.push(Lt)},_t.prototype.removeButtonClickListener=function(Lt){this.buttonClickListeners.indexOf(Lt)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(Lt),1)},_t.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},_t.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var Lt=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var Pt=0;Pt<this.markerButtons.length;Pt++)Pt<Lt||Pt===Lt&&this.markerButtons.length-1===Lt?this.markerButtonBlock.appendChild(this.markerButtons[Pt]):(Pt===Lt&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[Pt]))}},_t.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},_t.prototype.resetButtonStyles=function(){var Lt=this;this.buttons.forEach(function(Pt){Pt.className=Pt.className.replace(Lt.uiStyleSettings.toolbarButtonStyleColorsClassName?Lt.uiStyleSettings.toolbarButtonStyleColorsClassName:Lt.toolbarButtonStyleColorsClass.name,"").trim(),Pt.className=Pt.className.replace(Lt.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?Lt.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:Lt.toolbarActiveButtonStyleColorsClass.name,"").trim(),Pt.className+=" "+(Lt.uiStyleSettings.toolbarButtonStyleColorsClassName?Lt.uiStyleSettings.toolbarButtonStyleColorsClassName:Lt.toolbarButtonStyleColorsClass.name)})},_t.prototype.addActionButton=function(Lt,Pt,Nt){var zt=this,Mt=document.createElement("div");switch(Mt.className=""+this.toolbarButtonStyleClass.name,Mt.innerHTML=Pt,Mt.setAttribute("data-action",Nt),Mt.addEventListener("click",function(){zt.actionToolbarButtonClicked(Mt,Nt)}),Nt){case"select":Mt.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Mt.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Mt.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Mt.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Mt.style.fill=this.uiStyleSettings.closeButtonColor}Lt.appendChild(Mt),this.buttons.push(Mt)},_t.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ie("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new ie("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ie("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ie("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new ie("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var Lt=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ie("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*Lt)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*Lt)+`px;
padding: `+Lt+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ie("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ie("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ae("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new Ae("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},_t.prototype.markerToolbarButtonClicked=function(Lt,Pt){this.setActiveButton(Lt),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Nt){return Nt("marker",Pt)}),this.markerButtonOverflowBlock.style.display="none"},_t.prototype.actionToolbarButtonClicked=function(Lt,Pt){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(Nt){return Nt("action",Pt)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},_t.prototype.setActiveButton=function(Lt){this.resetButtonStyles(),Lt.className=Lt.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),Lt.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},_t.prototype.setActiveMarkerButton=function(Lt){var Pt=this.markerButtons.find(function(Nt){return Nt.getAttribute("data-type-name")===Lt});Pt&&this.setActiveButton(Pt)},_t.prototype.setCurrentMarker=function(Lt){var Pt=this;this.currentMarker=Lt,this.buttons.filter(function(Nt){return/delete|notes/.test(Nt.getAttribute("data-action"))}).forEach(function(Nt){Pt.currentMarker===void 0?(Nt.style.fillOpacity="0.4",Nt.style.pointerEvents="none"):(Nt.style.fillOpacity="1",Nt.style.pointerEvents="all")})},_t}(),Bt=function(){function _t(Lt,Pt,Nt,zt){this.panels=[],this.panelButtons=[],this.markerjsContainer=Lt,this.displayMode=Pt,this.uiStyleSettings=Nt,this.styles=zt,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return _t.prototype.addStyles=function(){var Lt;this.toolboxStyleClass=this.styles.addClass(new ie("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new ie("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var Pt=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ie("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ie("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ie("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new ie("toolbox-panel-row_colors",`
background-color: `+((Lt=this.uiStyleSettings.toolboxBackgroundColor)!==null&&Lt!==void 0?Lt:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ie("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*Pt)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*Pt)+`px;
padding: `+Pt+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new ie("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ie("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new Ae("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new Ae("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},_t.prototype.show=function(Lt){var Pt;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=Lt,this.uiContainer.className=this.toolboxStyleClass.name+" "+((Pt=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&Pt!==void 0?Pt:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},_t.prototype.setPanelButtons=function(Lt){var Pt,Nt,zt=this;this.panels=Lt,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((Pt=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&Pt!==void 0?Pt:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((Nt=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&Nt!==void 0?Nt:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Mt){var Kt;Mt.uiStyleSettings=zt.uiStyleSettings;var ye=document.createElement("div");ye.className=zt.toolboxButtonStyleClass.name+" "+((Kt=zt.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Kt!==void 0?Kt:zt.toolboxButtonStyleColorsClass.name),ye.innerHTML=Mt.icon,ye.title=Mt.title,ye.addEventListener("click",function(){zt.panelButtonClick(Mt)}),zt.panelButtons.push(ye),zt.buttonRow.appendChild(ye)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},_t.prototype.panelButtonClick=function(Lt){var Pt=this,Nt=-1;if(Lt!==this.activePanel){Nt=this.panels.indexOf(Lt),this.panelRow.innerHTML="";var zt=Lt.getUi();zt.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(zt),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=Lt}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){Pt.displayMode==="inline"?Pt.panelRow.style.display="none":Pt.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Mt,Kt){var ye,Ue;Mt.className=Pt.toolboxButtonStyleClass.name+" "+(Kt===Nt?""+((ye=Pt.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&ye!==void 0?ye:Pt.toolboxActiveButtonStyleColorsClass.name):""+((Ue=Pt.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ue!==void 0?Ue:Pt.toolboxButtonStyleColorsClass.name))})},_t}(),nt=function(_t,Lt){this.title=_t,this.icon=Lt},et=function(_t){function Lt(Pt,Nt,zt,Mt){var Kt=_t.call(this,Pt,Mt||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return Kt.colors=[],Kt.addTransparent=!1,Kt.colorBoxes=[],Kt.colors=Nt,Kt.currentColor=zt,Kt.setCurrentColor=Kt.setCurrentColor.bind(Kt),Kt.getColorBox=Kt.getColorBox.bind(Kt),Kt}return Ut(Lt,_t),Lt.prototype.getUi=function(){var Pt=this,Nt=document.createElement("div");return Nt.style.overflow="hidden",Nt.style.whiteSpace="nowrap",this.colors.forEach(function(zt){var Mt=Pt.getColorBox(zt);Nt.appendChild(Mt),Pt.colorBoxes.push(Mt)}),Nt},Lt.prototype.getColorBox=function(Pt){var Nt=this,zt=this.uiStyleSettings.toolbarHeight/4,Mt=this.uiStyleSettings.toolbarHeight-zt,Kt=document.createElement("div");Kt.style.display="inline-block",Kt.style.boxSizing="content-box",Kt.style.width=Mt-2+"px",Kt.style.height=Mt-2+"px",Kt.style.padding="1px",Kt.style.marginRight="2px",Kt.style.marginBottom="2px",Kt.style.borderWidth="2px",Kt.style.borderStyle="solid",Kt.style.borderRadius=(Mt+2)/2+"px",Kt.style.borderColor=Pt===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Kt.addEventListener("click",function(){Nt.setCurrentColor(Pt,Kt)});var ye=document.createElement("div");return ye.style.display="inline-block",ye.style.width=Mt-2+"px",ye.style.height=Mt-2+"px",ye.style.backgroundColor=Pt,ye.style.borderRadius=Mt/2+"px",Pt==="transparent"&&(ye.style.fill=this.uiStyleSettings.toolboxAccentColor,ye.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),Kt.appendChild(ye),Kt},Lt.prototype.setCurrentColor=function(Pt,Nt){var zt=this;this.currentColor=Pt,this.colorBoxes.forEach(function(Mt){Mt.style.borderColor=Mt===Nt?zt.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(Pt)},Lt}(nt),ht=function(){function _t(Lt,Pt,Nt){this._state="new",this._isSelected=!1,this._container=Lt,this._overlayContainer=Pt,this.globalSettings=Nt,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(_t.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),_t.prototype.ownsTarget=function(Lt){return!1},Object.defineProperty(_t.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),_t.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},_t.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},_t.prototype.pointerDown=function(Lt,Pt){},_t.prototype.dblClick=function(Lt,Pt){},_t.prototype.manipulate=function(Lt){},_t.prototype.pointerUp=function(Lt){this.stateChanged()},_t.prototype.dispose=function(){},_t.prototype.addMarkerVisualToContainer=function(Lt){this.container.childNodes.length>0?this.container.insertBefore(Lt,this.container.childNodes[0]):this.container.appendChild(Lt)},_t.prototype.getState=function(){return{typeName:_t.typeName,state:this.state,notes:this.notes}},_t.prototype.restoreState=function(Lt){this._state=Lt.state,this.notes=Lt.notes},_t.prototype.scale=function(Lt,Pt){},_t.prototype.colorChanged=function(Lt){this.onColorChanged&&this.onColorChanged(Lt),this.stateChanged()},_t.prototype.fillColorChanged=function(Lt){this.onFillColorChanged&&this.onFillColorChanged(Lt),this.stateChanged()},_t.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var Lt=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),Lt.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(Lt)&&this.onStateChanged(this)}},_t.typeName="MarkerBase",_t}(),st=function(){function _t(){this.findGripByVisual=this.findGripByVisual.bind(this)}return _t.prototype.findGripByVisual=function(Lt){return this.topLeft.ownsTarget(Lt)?this.topLeft:this.topCenter.ownsTarget(Lt)?this.topCenter:this.topRight.ownsTarget(Lt)?this.topRight:this.centerLeft.ownsTarget(Lt)?this.centerLeft:this.centerRight.ownsTarget(Lt)?this.centerRight:this.bottomLeft.ownsTarget(Lt)?this.bottomLeft:this.bottomCenter.ownsTarget(Lt)?this.bottomCenter:this.bottomRight.ownsTarget(Lt)?this.bottomRight:void 0},_t}(),gt=function(){function _t(){this.GRIP_SIZE=10,this.visual=It.createGroup(),this.visual.appendChild(It.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(It.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return _t.prototype.ownsTarget=function(Lt){return Lt===this.visual||Lt===this.visual.childNodes[0]||Lt===this.visual.childNodes[1]},_t}(),vt=function(){function _t(){}return _t.toITransformMatrix=function(Lt){return{a:Lt.a,b:Lt.b,c:Lt.c,d:Lt.d,e:Lt.e,f:Lt.f}},_t.toSVGMatrix=function(Lt,Pt){return Lt.a=Pt.a,Lt.b=Pt.b,Lt.c=Pt.c,Lt.d=Pt.d,Lt.e=Pt.e,Lt.f=Pt.f,Lt},_t}(),St=function(_t){function Lt(Pt,Nt,zt){var Mt=_t.call(this,Pt,Nt,zt)||this;return Mt.left=0,Mt.top=0,Mt.width=0,Mt.height=0,Mt.defaultSize={x:50,y:20},Mt.offsetX=0,Mt.offsetY=0,Mt.rotationAngle=0,Mt.CB_DISTANCE=10,Mt._suppressMarkerCreateEvent=!1,Mt.container.transform.baseVal.appendItem(It.createTransform()),Mt.setupControlBox(),Mt}return Ut(Lt,_t),Object.defineProperty(Lt.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(Lt.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(Lt.prototype,"visual",{get:function(){return this._visual},set:function(Pt){this._visual=Pt;var Nt=It.createTransform();this._visual.transform.baseVal.appendItem(Nt)},enumerable:!1,configurable:!0}),Lt.prototype.ownsTarget=function(Pt){return!!_t.prototype.ownsTarget.call(this,Pt)||!!(this.controlGrips.findGripByVisual(Pt)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Pt))},Lt.prototype.pointerDown=function(Pt,Nt){_t.prototype.pointerDown.call(this,Pt,Nt),this.state==="new"&&(this.left=Pt.x,this.top=Pt.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var zt=this.unrotatePoint(Pt);if(this.manipulationStartX=zt.x,this.manipulationStartY=zt.y,this.offsetX=zt.x-this.left,this.offsetY=zt.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(Nt),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Nt)){this.activeGrip=this.rotatorGrip;var Mt=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Mt.x-this.width/2,this.top=Mt.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Kt=this.container.transform.baseVal.getItem(0);Kt.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Kt,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},Lt.prototype.pointerUp=function(Pt){var Nt=this.state;_t.prototype.pointerUp.call(this,Pt),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(Pt),this._state="select",Nt==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},Lt.prototype.moveVisual=function(Pt){this.visual.style.transform="translate("+Pt.x+"px, "+Pt.y+"px)"},Lt.prototype.manipulate=function(Pt){var Nt=this.unrotatePoint(Pt);this.state==="creating"?this.resize(Pt):this.state==="move"?(this.left=this.manipulationStartLeft+(Nt.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(Nt.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(Nt):this.state==="rotate"&&this.rotate(Pt)},Lt.prototype.resize=function(Pt){var Nt=this.manipulationStartLeft,zt=this.manipulationStartWidth,Mt=this.manipulationStartTop,Kt=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:Nt=this.manipulationStartLeft+Pt.x-this.manipulationStartX,zt=this.manipulationStartWidth+this.manipulationStartLeft-Nt;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:zt=this.manipulationStartWidth+Pt.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Mt=this.manipulationStartTop+Pt.y-this.manipulationStartY,Kt=this.manipulationStartHeight+this.manipulationStartTop-Mt;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Kt=this.manipulationStartHeight+Pt.y-this.manipulationStartY}zt>=0?(this.left=Nt,this.width=zt):(this.left=Nt+zt,this.width=-zt),Kt>=0?(this.top=Mt,this.height=Kt):(this.top=Mt+Kt,this.height=-Kt),this.setSize()},Lt.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},Lt.prototype.rotate=function(Pt){if(Math.abs(Pt.x-this.centerX)>.1){var Nt=Math.sign(Pt.x-this.centerX);this.rotationAngle=180*Math.atan((Pt.y-this.centerY)/(Pt.x-this.centerX))/Math.PI+90*Nt,this.applyRotation()}},Lt.prototype.applyRotation=function(){var Pt=this.container.transform.baseVal.getItem(0);Pt.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Pt,0)},Lt.prototype.rotatePoint=function(Pt){if(this.rotationAngle===0)return Pt;var Nt=this.container.getCTM(),zt=It.createPoint(Pt.x,Pt.y);return{x:(zt=zt.matrixTransform(Nt)).x,y:zt.y}},Lt.prototype.unrotatePoint=function(Pt){if(this.rotationAngle===0)return Pt;var Nt=this.container.getCTM();Nt=Nt.inverse();var zt=It.createPoint(Pt.x,Pt.y);return{x:(zt=zt.matrixTransform(Nt)).x,y:zt.y}},Lt.prototype.select=function(){_t.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},Lt.prototype.deselect=function(){_t.prototype.deselect.call(this),this.controlBox.style.display="none"},Lt.prototype.setupControlBox=function(){this.controlBox=It.createGroup();var Pt=It.createTransform();Pt.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(Pt),this.container.appendChild(this.controlBox),this.controlRect=It.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=It.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new st,this.addControlGrips(),this.controlBox.style.display="none"},Lt.prototype.adjustControlBox=function(){var Pt=this.controlBox.transform.baseVal.getItem(0);Pt.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(Pt,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},Lt.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},Lt.prototype.createGrip=function(){var Pt=new gt;return Pt.visual.transform.baseVal.appendItem(It.createTransform()),this.controlBox.appendChild(Pt.visual),Pt},Lt.prototype.positionGrips=function(){var Pt=this.controlGrips.topLeft.GRIP_SIZE,Nt=-Pt/2,zt=Nt,Mt=(this.width+this.CB_DISTANCE)/2-Pt/2,Kt=(this.height+this.CB_DISTANCE)/2-Pt/2,ye=this.height+this.CB_DISTANCE-Pt/2,Ue=this.width+this.CB_DISTANCE-Pt/2;this.positionGrip(this.controlGrips.topLeft.visual,Nt,zt),this.positionGrip(this.controlGrips.topCenter.visual,Mt,zt),this.positionGrip(this.controlGrips.topRight.visual,Ue,zt),this.positionGrip(this.controlGrips.centerLeft.visual,Nt,Kt),this.positionGrip(this.controlGrips.centerRight.visual,Ue,Kt),this.positionGrip(this.controlGrips.bottomLeft.visual,Nt,ye),this.positionGrip(this.controlGrips.bottomCenter.visual,Mt,ye),this.positionGrip(this.controlGrips.bottomRight.visual,Ue,ye),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Mt,zt-3*this.CB_DISTANCE)},Lt.prototype.positionGrip=function(Pt,Nt,zt){var Mt=Pt.transform.baseVal.getItem(0);Mt.setTranslate(Nt,zt),Pt.transform.baseVal.replaceItem(Mt,0)},Lt.prototype.hideControlBox=function(){this.controlBox.style.display="none"},Lt.prototype.showControlBox=function(){this.controlBox.style.display=""},Lt.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:vt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:vt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},_t.prototype.getState.call(this))},Lt.prototype.restoreState=function(Pt){_t.prototype.restoreState.call(this,Pt);var Nt=Pt;this.left=Nt.left,this.top=Nt.top,this.width=Nt.width,this.height=Nt.height,this.rotationAngle=Nt.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(vt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,Nt.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(vt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,Nt.containerTransformMatrix))},Lt.prototype.scale=function(Pt,Nt){_t.prototype.scale.call(this,Pt,Nt);var zt=this.rotatePoint({x:this.left,y:this.top}),Mt=this.unrotatePoint({x:zt.x*Pt,y:zt.y*Nt});this.left=Mt.x,this.top=Mt.y,this.width=this.width*Pt,this.height=this.height*Nt,this.adjustControlBox()},Lt}(ht),Et=function(_t){function Lt(Pt,Nt,zt){var Mt=_t.call(this,Pt,Nt,zt)||this;return Mt.fillColor="transparent",Mt.strokeColor="transparent",Mt.strokeWidth=0,Mt.strokeDasharray="",Mt.opacity=1,Mt.setStrokeColor=Mt.setStrokeColor.bind(Mt),Mt.setFillColor=Mt.setFillColor.bind(Mt),Mt.setStrokeWidth=Mt.setStrokeWidth.bind(Mt),Mt.setStrokeDasharray=Mt.setStrokeDasharray.bind(Mt),Mt.createVisual=Mt.createVisual.bind(Mt),Mt}return Ut(Lt,_t),Lt.prototype.ownsTarget=function(Pt){return!(!_t.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual)},Lt.prototype.createVisual=function(){this.visual=It.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},Lt.prototype.pointerDown=function(Pt,Nt){_t.prototype.pointerDown.call(this,Pt,Nt),this.state==="new"&&(this.createVisual(),this.moveVisual(Pt),this._state="creating")},Lt.prototype.manipulate=function(Pt){_t.prototype.manipulate.call(this,Pt)},Lt.prototype.resize=function(Pt){_t.prototype.resize.call(this,Pt),this.setSize()},Lt.prototype.setSize=function(){_t.prototype.setSize.call(this),It.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},Lt.prototype.pointerUp=function(Pt){_t.prototype.pointerUp.call(this,Pt),this.setSize()},Lt.prototype.setStrokeColor=function(Pt){this.strokeColor=Pt,this.visual&&It.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Pt),this.stateChanged()},Lt.prototype.setFillColor=function(Pt){this.fillColor=Pt,this.visual&&It.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},Lt.prototype.setStrokeWidth=function(Pt){this.strokeWidth=Pt,this.visual&&It.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Lt.prototype.setStrokeDasharray=function(Pt){this.strokeDasharray=Pt,this.visual&&It.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Lt.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},_t.prototype.getState.call(this))},Lt.prototype.restoreState=function(Pt){var Nt=Pt;this.fillColor=Nt.fillColor,this.strokeColor=Nt.strokeColor,this.strokeWidth=Nt.strokeWidth,this.strokeDasharray=Nt.strokeDasharray,this.opacity=Nt.opacity,this.createVisual(),_t.prototype.restoreState.call(this,Pt),this.setSize()},Lt.prototype.scale=function(Pt,Nt){_t.prototype.scale.call(this,Pt,Nt),this.setSize()},Lt.title="Rectangle marker",Lt}(St),Tt=function(_t){function Lt(Pt,Nt,zt,Mt){var Kt=_t.call(this,Pt,Mt||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Kt.widths=[],Kt.widthBoxes=[],Kt.widths=Nt,Kt.currentWidth=zt,Kt.setCurrentWidth=Kt.setCurrentWidth.bind(Kt),Kt}return Ut(Lt,_t),Lt.prototype.getUi=function(){var Pt=this,Nt=document.createElement("div");return Nt.style.display="flex",Nt.style.overflow="hidden",Nt.style.flexGrow="2",this.widths.forEach(function(zt){var Mt=document.createElement("div");Mt.style.display="flex",Mt.style.flexGrow="2",Mt.style.alignItems="center",Mt.style.justifyContent="space-between",Mt.style.padding="5px",Mt.style.borderWidth="2px",Mt.style.borderStyle="solid",Mt.style.borderColor=zt===Pt.currentWidth?Pt.uiStyleSettings.toolboxAccentColor:"transparent",Mt.addEventListener("click",function(){Pt.setCurrentWidth(zt,Mt)}),Nt.appendChild(Mt);var Kt=document.createElement("div");Kt.innerText=zt.toString(),Kt.style.marginRight="5px",Mt.appendChild(Kt);var ye=document.createElement("div");ye.style.minHeight="20px",ye.style.flexGrow="2",ye.style.display="flex",ye.style.alignItems="center";var Ue=document.createElement("hr");Ue.style.minWidth="20px",Ue.style.border="0px",Ue.style.borderTop=zt+"px solid "+Pt.uiStyleSettings.toolboxColor,Ue.style.flexGrow="2",ye.appendChild(Ue),Mt.appendChild(ye),Pt.widthBoxes.push(Mt)}),Nt},Lt.prototype.setCurrentWidth=function(Pt,Nt){var zt=this;this.currentWidth=Pt,this.widthBoxes.forEach(function(Mt){Mt.style.borderColor=Mt===Nt?zt.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},Lt}(nt),Dt=function(_t){function Lt(Pt,Nt,zt,Mt){var Kt=_t.call(this,Pt,Mt||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return Kt.styles=[],Kt.styleBoxes=[],Kt.styles=Nt,Kt.currentStyle=zt,Kt.setCurrentStyle=Kt.setCurrentStyle.bind(Kt),Kt}return Ut(Lt,_t),Lt.prototype.getUi=function(){var Pt=this,Nt=document.createElement("div");return Nt.style.display="flex",Nt.style.overflow="hidden",Nt.style.flexGrow="2",this.styles.forEach(function(zt){var Mt=document.createElement("div");Mt.style.display="flex",Mt.style.alignItems="center",Mt.style.justifyContent="space-between",Mt.style.padding="5px",Mt.style.borderWidth="2px",Mt.style.borderStyle="solid",Mt.style.overflow="hidden",Mt.style.maxWidth=100/Pt.styles.length-5+"%",Mt.style.borderColor=zt===Pt.currentStyle?Pt.uiStyleSettings.toolboxAccentColor:"transparent",Mt.addEventListener("click",function(){Pt.setCurrentStyle(zt,Mt)}),Nt.appendChild(Mt);var Kt=document.createElement("div");Kt.style.minHeight="20px",Kt.style.flexGrow="2",Kt.style.overflow="hidden";var ye=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+Pt.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(zt!==""?'stroke-dasharray="'+zt+'"':"")+` />
</svg>`;Kt.innerHTML=ye,Mt.appendChild(Kt),Pt.styleBoxes.push(Mt)}),Nt},Lt.prototype.setCurrentStyle=function(Pt,Nt){var zt=this;this.currentStyle=Pt,this.styleBoxes.forEach(function(Mt){Mt.style.borderColor=Mt===Nt?zt.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},Lt}(nt),Jt=function(_t){function Lt(Pt,Nt,zt){var Mt=_t.call(this,Pt,Nt,zt)||this;return Mt.strokeColor=zt.defaultColor,Mt.strokeWidth=zt.defaultStrokeWidth,Mt.strokeDasharray=zt.defaultStrokeDasharray,Mt.strokePanel=new et("Line color",zt.defaultColorSet,zt.defaultColor),Mt.strokePanel.onColorChanged=Mt.setStrokeColor,Mt.strokeWidthPanel=new Tt("Line width",zt.defaultStrokeWidths,zt.defaultStrokeWidth),Mt.strokeWidthPanel.onWidthChanged=Mt.setStrokeWidth,Mt.strokeStylePanel=new Dt("Line style",zt.defaultStrokeDasharrays,zt.defaultStrokeDasharray),Mt.strokeStylePanel.onStyleChanged=Mt.setStrokeDasharray,Mt}return Ut(Lt,_t),Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=_t.prototype.getState.call(this);return Pt.typeName=Lt.typeName,Pt},Lt.typeName="FrameMarker",Lt.title="Frame marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',Lt}(Et),Yt=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1,this.defaultCaptionFontSize="1rem",this.defaultCaptionText="Text"},Gt=function(_t){function Lt(Pt,Nt,zt){var Mt=_t.call(this,Pt,Nt,zt)||this;return Mt.x1=0,Mt.y1=0,Mt.x2=0,Mt.y2=0,Mt.defaultLength=50,Mt.manipulationStartX=0,Mt.manipulationStartY=0,Mt.manipulationStartX1=0,Mt.manipulationStartY1=0,Mt.manipulationStartX2=0,Mt.manipulationStartY2=0,Mt.setupControlBox(),Mt}return Ut(Lt,_t),Lt.prototype.ownsTarget=function(Pt){return!!_t.prototype.ownsTarget.call(this,Pt)||!(!this.grip1.ownsTarget(Pt)&&!this.grip2.ownsTarget(Pt))},Lt.prototype.pointerDown=function(Pt,Nt){_t.prototype.pointerDown.call(this,Pt,Nt),this.manipulationStartX=Pt.x,this.manipulationStartY=Pt.y,this.state==="new"&&(this.x1=Pt.x,this.y1=Pt.y,this.x2=Pt.x,this.y2=Pt.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(Nt)?this.activeGrip=this.grip1:this.grip2.ownsTarget(Nt)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},Lt.prototype.pointerUp=function(Pt){var Nt=this.state;_t.prototype.pointerUp.call(this,Pt),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(Pt),this._state="select",Nt==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},Lt.prototype.adjustVisual=function(){},Lt.prototype.manipulate=function(Pt){this.state==="creating"?this.resize(Pt):this.state==="move"?(this.x1=this.manipulationStartX1+Pt.x-this.manipulationStartX,this.y1=this.manipulationStartY1+Pt.y-this.manipulationStartY,this.x2=this.manipulationStartX2+Pt.x-this.manipulationStartX,this.y2=this.manipulationStartY2+Pt.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(Pt)},Lt.prototype.resize=function(Pt){switch(this.activeGrip){case this.grip1:this.x1=Pt.x,this.y1=Pt.y;break;case this.grip2:case void 0:this.x2=Pt.x,this.y2=Pt.y}this.adjustVisual(),this.adjustControlBox()},Lt.prototype.select=function(){_t.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},Lt.prototype.deselect=function(){_t.prototype.deselect.call(this),this.controlBox.style.display="none"},Lt.prototype.setupControlBox=function(){this.controlBox=It.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},Lt.prototype.adjustControlBox=function(){this.positionGrips()},Lt.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},Lt.prototype.createGrip=function(){var Pt=new gt;return Pt.visual.transform.baseVal.appendItem(It.createTransform()),this.controlBox.appendChild(Pt.visual),Pt},Lt.prototype.positionGrips=function(){var Pt=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-Pt/2,this.y1-Pt/2),this.positionGrip(this.grip2.visual,this.x2-Pt/2,this.y2-Pt/2)},Lt.prototype.positionGrip=function(Pt,Nt,zt){var Mt=Pt.transform.baseVal.getItem(0);Mt.setTranslate(Nt,zt),Pt.transform.baseVal.replaceItem(Mt,0)},Lt.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},_t.prototype.getState.call(this))},Lt.prototype.restoreState=function(Pt){_t.prototype.restoreState.call(this,Pt);var Nt=Pt;this.x1=Nt.x1,this.y1=Nt.y1,this.x2=Nt.x2,this.y2=Nt.y2},Lt.prototype.scale=function(Pt,Nt){_t.prototype.scale.call(this,Pt,Nt),this.x1=this.x1*Pt,this.y1=this.y1*Nt,this.x2=this.x2*Pt,this.y2=this.y2*Nt,this.adjustVisual(),this.adjustControlBox()},Lt}(ht),me=function(_t){function Lt(Pt,Nt,zt){var Mt=_t.call(this,Pt,Nt,zt)||this;return Mt.strokeColor="transparent",Mt.strokeWidth=0,Mt.strokeDasharray="",Mt.setStrokeColor=Mt.setStrokeColor.bind(Mt),Mt.setStrokeWidth=Mt.setStrokeWidth.bind(Mt),Mt.setStrokeDasharray=Mt.setStrokeDasharray.bind(Mt),Mt.strokeColor=zt.defaultColor,Mt.strokeWidth=zt.defaultStrokeWidth,Mt.strokeDasharray=zt.defaultStrokeDasharray,Mt.strokePanel=new et("Line color",zt.defaultColorSet,zt.defaultColor),Mt.strokePanel.onColorChanged=Mt.setStrokeColor,Mt.strokeWidthPanel=new Tt("Line width",zt.defaultStrokeWidths,zt.defaultStrokeWidth),Mt.strokeWidthPanel.onWidthChanged=Mt.setStrokeWidth,Mt.strokeStylePanel=new Dt("Line style",zt.defaultStrokeDasharrays,zt.defaultStrokeDasharray),Mt.strokeStylePanel.onStyleChanged=Mt.setStrokeDasharray,Mt}return Ut(Lt,_t),Lt.prototype.ownsTarget=function(Pt){return!(!_t.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual&&Pt!==this.selectorLine&&Pt!==this.visibleLine)},Lt.prototype.createVisual=function(){this.visual=It.createGroup(),this.selectorLine=It.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=It.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},Lt.prototype.pointerDown=function(Pt,Nt){_t.prototype.pointerDown.call(this,Pt,Nt),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},Lt.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),It.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),It.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),It.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},Lt.prototype.setStrokeColor=function(Pt){this.strokeColor=Pt,this.adjustVisual(),this.colorChanged(Pt)},Lt.prototype.setStrokeWidth=function(Pt){this.strokeWidth=Pt,this.adjustVisual()},Lt.prototype.setStrokeDasharray=function(Pt){this.strokeDasharray=Pt,this.adjustVisual(),this.stateChanged()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},_t.prototype.getState.call(this));return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){_t.prototype.restoreState.call(this,Pt);var Nt=Pt;this.strokeColor=Nt.strokeColor,this.strokeWidth=Nt.strokeWidth,this.strokeDasharray=Nt.strokeDasharray,this.createVisual(),this.adjustVisual()},Lt.typeName="LineMarker",Lt.title="Line marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',Lt}(Gt),ae=function(_t){function Lt(Pt,Nt,zt,Mt){var Kt=_t.call(this,Pt,Mt||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return Kt.fonts=[],Kt.fontBoxes=[],Kt.fonts=Nt,Kt.currentFont=zt,Kt.setCurrentFont=Kt.setCurrentFont.bind(Kt),Kt}return Ut(Lt,_t),Lt.prototype.getUi=function(){var Pt=this,Nt=document.createElement("div");return Nt.style.overflow="hidden",Nt.style.flexGrow="2",this.fonts.forEach(function(zt){var Mt=document.createElement("div");Mt.style.display="inline-block",Mt.style.alignItems="center",Mt.style.justifyContent="space-between",Mt.style.padding="5px",Mt.style.borderWidth="2px",Mt.style.borderStyle="solid",Mt.style.overflow="hidden",Mt.style.maxWidth=100/Pt.fonts.length-5+"%",Mt.style.borderColor=zt===Pt.currentFont?Pt.uiStyleSettings.toolboxAccentColor:"transparent",Mt.addEventListener("click",function(){Pt.setCurrentFont(zt,Mt)}),Nt.appendChild(Mt);var Kt=document.createElement("div");Kt.style.display="flex",Kt.style.minHeight="20px",Kt.style.flexGrow="2",Kt.style.fontFamily=zt,Kt.style.overflow="hidden";var ye=document.createElement("div");ye.style.whiteSpace="nowrap",ye.style.overflow="hidden",ye.style.textOverflow="ellipsis",ye.innerHTML="The quick brown fox jumps over the lazy dog",Kt.appendChild(ye),Mt.appendChild(Kt),Pt.fontBoxes.push(Mt)}),Nt},Lt.prototype.setCurrentFont=function(Pt,Nt){var zt=this;this.currentFont=Pt,this.fontBoxes.forEach(function(Mt){Mt.style.borderColor=Mt===Nt?zt.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},Lt}(nt),Ne=function(_t){function Lt(Pt,Nt,zt){var Mt=_t.call(this,Pt,Nt,zt)||this;return Mt.color="transparent",Mt.padding=5,Mt.DEFAULT_TEXT="\u8BF7\u8F93\u5165\u6587\u672C",Mt.text=Mt.DEFAULT_TEXT,Mt.isMoved=!1,Mt.color=zt.defaultColor,Mt.fontFamily=zt.defaultFontFamily,Mt.defaultSize={x:100,y:30},Mt.setColor=Mt.setColor.bind(Mt),Mt.setFont=Mt.setFont.bind(Mt),Mt.renderText=Mt.renderText.bind(Mt),Mt.sizeText=Mt.sizeText.bind(Mt),Mt.textEditDivClicked=Mt.textEditDivClicked.bind(Mt),Mt.showTextEditor=Mt.showTextEditor.bind(Mt),Mt.setSize=Mt.setSize.bind(Mt),Mt.positionTextEditor=Mt.positionTextEditor.bind(Mt),Mt.colorPanel=new et("Color",zt.defaultColorSet,zt.defaultColor),Mt.colorPanel.onColorChanged=Mt.setColor,Mt.fontFamilyPanel=new ae("Font",zt.defaultFontFamilies,zt.defaultFontFamily),Mt.fontFamilyPanel.onFontChanged=Mt.setFont,Mt}return Ut(Lt,_t),Lt.prototype.ownsTarget=function(Pt){if(_t.prototype.ownsTarget.call(this,Pt)||Pt===this.visual||Pt===this.textElement||Pt===this.bgRectangle)return!0;var Nt=!1;return this.textElement.childNodes.forEach(function(zt){zt===Pt&&(Nt=!0)}),Nt},Lt.prototype.createVisual=function(){this.visual=It.createGroup(),this.bgRectangle=It.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=It.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(It.createTransform()),this.textElement.transform.baseVal.appendItem(It.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},Lt.prototype.pointerDown=function(Pt,Nt){_t.prototype.pointerDown.call(this,Pt,Nt),this.isMoved=!1,this.pointerDownPoint=Pt,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(Pt),this._state="creating")},Lt.prototype.renderText=function(){var Pt=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(Nt){Pt.textElement.appendChild(It.createTSpan(Nt.trim()===""?" ":Nt.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},Lt.prototype.getTextScale=function(){var Pt=this.textElement.getBBox(),Nt=1;if(Pt.width>0&&Pt.height>0){var zt=(1*this.width-this.width*this.padding*2/100)/Pt.width,Mt=(1*this.height-this.height*this.padding*2/100)/Pt.height;Nt=Math.min(zt,Mt)}return Nt},Lt.prototype.getTextPosition=function(Pt){var Nt=this.textElement.getBBox(),zt=0,Mt=0;return Nt.width>0&&Nt.height>0&&(zt=(this.width-Nt.width*Pt)/2,Mt=this.height/2-Nt.height*Pt/2),{x:zt,y:Mt}},Lt.prototype.sizeText=function(){var Pt=this.textElement.getBBox(),Nt=this.getTextScale(),zt=this.getTextPosition(Nt);zt.y-=Pt.y*Nt,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+zt.x+"px, "+zt.y+"px) scale("+Nt+", "+Nt+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(zt.x,zt.y),this.textElement.transform.baseVal.getItem(1).setScale(Nt,Nt))},Lt.prototype.manipulate=function(Pt){_t.prototype.manipulate.call(this,Pt),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(Pt.x-this.pointerDownPoint.x)>5||Math.abs(Pt.y-this.pointerDownPoint.y)>5)},Lt.prototype.resize=function(Pt){_t.prototype.resize.call(this,Pt),this.isMoved=!0,this.setSize(),this.sizeText()},Lt.prototype.setSize=function(){_t.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(It.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),It.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},Lt.prototype.pointerUp=function(Pt){var Nt=this.state;Nt==="creating"&&(this._suppressMarkerCreateEvent=!0),_t.prototype.pointerUp.call(this,Pt),this.setSize(),(Nt==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},Lt.prototype.showTextEditor=function(){var Pt=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(Nt){Nt.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var Nt=Number.parseFloat(Pt.textEditor.style.fontSize);Pt.textEditor.clientWidth>=Number.parseInt(Pt.textEditor.style.maxWidth)&&Nt>.9;)Nt-=.1,Pt.textEditor.style.fontSize=Math.max(Nt,.9)+"em"}),this.textEditor.addEventListener("keyup",function(Nt){Nt.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(Nt){if(Nt.clipboardData){var zt=Nt.clipboardData.getData("text"),Mt=window.getSelection();if(!Mt.rangeCount)return!1;Mt.deleteFromDocument(),Mt.getRangeAt(0).insertNode(document.createTextNode(zt)),Nt.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){Pt.textEditDivClicked(Pt.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},Lt.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var Pt=this.getTextScale(),Nt=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),zt=this.textElement.getBBox(),Mt={x:zt.width*Pt,y:zt.height*Pt};Nt.x-=Mt.x/2,Nt.y-=Mt.y/2,this.textEditor.style.top=Nt.y+"px",this.textEditor.style.left=Nt.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-Nt.x+"px",this.textEditor.style.fontSize=Math.max(16*Pt,12)+"px",this.textElement.style.display="none"}},Lt.prototype.textEditDivClicked=function(Pt){this.text=Pt.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},Lt.prototype.select=function(){_t.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},Lt.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),_t.prototype.deselect.call(this)},Lt.prototype.dblClick=function(Pt,Nt){_t.prototype.dblClick.call(this,Pt,Nt),this.showTextEditor()},Lt.prototype.setColor=function(Pt){this.textElement&&It.setAttributes(this.textElement,[["fill",Pt]]),this.color=Pt,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(Pt)},Lt.prototype.setFont=function(Pt){this.textElement&&It.setAttributes(this.textElement,[["font-family",Pt]]),this.fontFamily=Pt,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},Lt.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},Lt.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},_t.prototype.getState.call(this));return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){var Nt=Pt;this.color=Nt.color,this.fontFamily=Nt.fontFamily,this.padding=Nt.padding,this.text=Nt.text,this.createVisual(),_t.prototype.restoreState.call(this,Pt),this.setSize()},Lt.prototype.scale=function(Pt,Nt){_t.prototype.scale.call(this,Pt,Nt),this.setSize(),this.sizeText(),this.positionTextEditor()},Lt.typeName="TextMarker",Lt.title="Text marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',Lt}(St),Ce=function(_t){function Lt(Pt,Nt,zt){var Mt=_t.call(this,Pt,Nt,zt)||this;return Mt.color="transparent",Mt.lineWidth=3,Mt.drawing=!1,Mt.pixelRatio=1,Mt.color=zt.defaultColor,Mt.lineWidth=zt.defaultStrokeWidth,Mt.pixelRatio=zt.freehandPixelRatio,Mt.setColor=Mt.setColor.bind(Mt),Mt.addCanvas=Mt.addCanvas.bind(Mt),Mt.finishCreation=Mt.finishCreation.bind(Mt),Mt.setLineWidth=Mt.setLineWidth.bind(Mt),Mt.colorPanel=new et("Color",zt.defaultColorSet,zt.defaultColor),Mt.colorPanel.onColorChanged=Mt.setColor,Mt.lineWidthPanel=new Tt("Line width",zt.defaultStrokeWidths,zt.defaultStrokeWidth),Mt.lineWidthPanel.onWidthChanged=Mt.setLineWidth,Mt}return Ut(Lt,_t),Lt.prototype.ownsTarget=function(Pt){return!(!_t.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual&&Pt!==this.drawingImage)},Lt.prototype.createVisual=function(){this.visual=It.createGroup(),this.drawingImage=It.createImage(),this.visual.appendChild(this.drawingImage);var Pt=It.createTransform();this.visual.transform.baseVal.appendItem(Pt),this.addMarkerVisualToContainer(this.visual)},Lt.prototype.pointerDown=function(Pt,Nt){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(Pt.x,Pt.y),this.drawing=!0):_t.prototype.pointerDown.call(this,Pt,Nt)},Lt.prototype.manipulate=function(Pt){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(Pt.x,Pt.y),this.canvasContext.stroke()):_t.prototype.manipulate.call(this,Pt)},Lt.prototype.resize=function(Pt){_t.prototype.resize.call(this,Pt),It.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),It.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},Lt.prototype.pointerUp=function(Pt){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):_t.prototype.pointerUp.call(this,Pt)},Lt.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},Lt.prototype.select=function(){this.state==="creating"&&this.finishCreation(),_t.prototype.select.call(this)},Lt.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),_t.prototype.deselect.call(this)},Lt.prototype.finishCreation=function(){for(var Pt=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),Nt=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],zt=Nt[0],Mt=Nt[1],Kt=Nt[2],ye=Nt[3],Ue=!1,Qe=0;Qe<this.canvasElement.height;Qe++)for(var ce=0;ce<this.canvasElement.width;ce++)Pt.data[Qe*this.canvasElement.width*4+4*ce+3]>0&&(Ue=!0,Qe<Mt&&(Mt=Qe),ce<zt&&(zt=ce),Qe>ye&&(ye=Qe),ce>Kt&&(Kt=ce));if(Ue){this.left=zt/this.pixelRatio,this.top=Mt/this.pixelRatio,this.width=(Kt-zt)/this.pixelRatio,this.height=(ye-Mt)/this.pixelRatio;var Oe=document.createElement("canvas");Oe.width=Kt-zt,Oe.height=ye-Mt,Oe.getContext("2d").putImageData(this.canvasContext.getImageData(zt,Mt,Kt-zt,ye-Mt),0,0),this.drawingImgUrl=Oe.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},Lt.prototype.setDrawingImage=function(){It.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),It.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},Lt.prototype.setColor=function(Pt){this.color=Pt,this.colorChanged(Pt)},Lt.prototype.setLineWidth=function(Pt){this.lineWidth=Pt},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Object.assign({drawingImgUrl:this.drawingImgUrl},_t.prototype.getState.call(this));return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){this.createVisual(),_t.prototype.restoreState.call(this,Pt),this.drawingImgUrl=Pt.drawingImgUrl,this.setDrawingImage()},Lt.prototype.scale=function(Pt,Nt){_t.prototype.scale.call(this,Pt,Nt),this.setDrawingImage()},Lt.typeName="FreehandMarker",Lt.title="Freehand marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',Lt}(St),we=function(_t){function Lt(Pt,Nt,zt){var Mt=_t.call(this,Pt,zt||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Mt.typeBoxes=[],Mt.currentType=Nt,Mt.setCurrentType=Mt.setCurrentType.bind(Mt),Mt}return Ut(Lt,_t),Lt.prototype.getUi=function(){var Pt=this,Nt=document.createElement("div");Nt.style.display="flex",Nt.style.overflow="hidden",Nt.style.flexGrow="2";for(var zt=function(ye){var Ue="both";switch(ye){case 0:Ue="both";break;case 1:Ue="start";break;case 2:Ue="end";break;case 3:Ue="none"}var Qe=document.createElement("div");if(Qe.style.display="flex",Qe.style.flexGrow="2",Qe.style.alignItems="center",Qe.style.justifyContent="space-between",Qe.style.padding="5px",Qe.style.borderWidth="2px",Qe.style.borderStyle="solid",Qe.style.borderColor=Ue===Mt.currentType?Mt.uiStyleSettings.toolboxAccentColor:"transparent",Qe.addEventListener("click",function(){Pt.setCurrentType(Ue,Qe)}),Nt.appendChild(Qe),Ue==="both"||Ue==="start"){var ce=document.createElement("div");ce.style.display="flex",ce.style.alignItems="center",ce.style.minHeight="20px",ce.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(Mt.uiStyleSettings!==void 0?Mt.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,ce.style.marginLeft="5px",Qe.appendChild(ce)}var Oe=document.createElement("div");Oe.style.display="flex",Oe.style.alignItems="center",Oe.style.minHeight="20px",Oe.style.flexGrow="2";var Le=document.createElement("hr");if(Le.style.minWidth="20px",Le.style.border="0px",Le.style.borderTop="3px solid "+(Mt.uiStyleSettings!==void 0?Mt.uiStyleSettings.toolboxColor:"#eeeeee"),Le.style.flexGrow="2",Oe.appendChild(Le),Qe.appendChild(Oe),Ue==="both"||Ue==="end"){var Xe=document.createElement("div");Xe.style.display="flex",Xe.style.alignItems="center",Xe.style.minHeight="20px",Xe.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(Mt.uiStyleSettings!==void 0?Mt.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Xe.style.marginRight="5px",Qe.appendChild(Xe)}Mt.typeBoxes.push(Qe)},Mt=this,Kt=0;Kt<4;Kt++)zt(Kt);return Nt},Lt.prototype.setCurrentType=function(Pt,Nt){var zt=this;this.currentType=Pt,this.typeBoxes.forEach(function(Mt){Mt.style.borderColor=Mt===Nt?zt.uiStyleSettings!==void 0?zt.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},Lt}(nt),tn=function(_t){function Lt(Pt,Nt,zt){var Mt=_t.call(this,Pt,Nt,zt)||this;return Mt.arrowType="end",Mt.arrowBaseHeight=10,Mt.arrowBaseWidth=10,Mt.getArrowPoints=Mt.getArrowPoints.bind(Mt),Mt.setArrowType=Mt.setArrowType.bind(Mt),Mt.arrowTypePanel=new we("Arrow type","end"),Mt.arrowTypePanel.onArrowTypeChanged=Mt.setArrowType,Mt}return Ut(Lt,_t),Lt.prototype.ownsTarget=function(Pt){return!(!_t.prototype.ownsTarget.call(this,Pt)&&Pt!==this.arrow1&&Pt!==this.arrow2)},Lt.prototype.getArrowPoints=function(Pt,Nt){var zt=this.arrowBaseWidth+2*this.strokeWidth,Mt=this.arrowBaseHeight+2*this.strokeWidth;return Pt-zt/2+","+(Nt+Mt/2)+" "+Pt+","+(Nt-Mt/2)+" "+(Pt+zt/2)+","+(Nt+Mt/2)},Lt.prototype.createTips=function(){this.arrow1=It.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(It.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=It.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(It.createTransform()),this.visual.appendChild(this.arrow2)},Lt.prototype.pointerDown=function(Pt,Nt){_t.prototype.pointerDown.call(this,Pt,Nt),this.state==="creating"&&this.createTips()},Lt.prototype.adjustVisual=function(){if(_t.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2){this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",It.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),It.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var Pt=0;Math.abs(this.x1-this.x2)>.1&&(Pt=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var Nt=this.arrow1.transform.baseVal.getItem(0);Nt.setRotate(Pt,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(Nt,0);var zt=this.arrow2.transform.baseVal.getItem(0);zt.setRotate(Pt+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(zt,0)}},Lt.prototype.setArrowType=function(Pt){this.arrowType=Pt,this.adjustVisual(),this.stateChanged()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Object.assign({arrowType:this.arrowType},_t.prototype.getState.call(this));return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){_t.prototype.restoreState.call(this,Pt);var Nt=Pt;this.arrowType=Nt.arrowType,this.createTips(),this.adjustVisual()},Lt.typeName="ArrowMarker",Lt.title="Arrow marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',Lt}(me),_e=function(_t){function Lt(Pt,Nt,zt){var Mt=_t.call(this,Pt,Nt,zt)||this;return Mt.fillColor=zt.defaultFillColor,Mt.strokeWidth=0,Mt.fillPanel=new et("Color",zt.defaultColorSet,zt.defaultFillColor),Mt.fillPanel.onColorChanged=Mt.setFillColor,Mt}return Ut(Lt,_t),Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=_t.prototype.getState.call(this);return Pt.typeName=Lt.typeName,Pt},Lt.typeName="CoverMarker",Lt.title="Cover marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',Lt}(Et),an=function(_t){function Lt(Pt,Nt,zt,Mt){var Kt=_t.call(this,Pt,Mt||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return Kt.opacities=[],Kt.opacityBoxes=[],Kt.opacities=Nt,Kt.currentOpacity=zt,Kt.setCurrentOpacity=Kt.setCurrentOpacity.bind(Kt),Kt}return Ut(Lt,_t),Lt.prototype.getUi=function(){var Pt=this,Nt=document.createElement("div");return Nt.style.display="flex",Nt.style.overflow="hidden",Nt.style.flexGrow="2",Nt.style.justifyContent="space-between",this.opacities.forEach(function(zt){var Mt=document.createElement("div");Mt.style.display="flex",Mt.style.alignItems="center",Mt.style.justifyContent="center",Mt.style.padding="5px",Mt.style.borderWidth="2px",Mt.style.borderStyle="solid",Mt.style.borderColor=zt===Pt.currentOpacity?Pt.uiStyleSettings.toolboxAccentColor:"transparent",Mt.addEventListener("click",function(){Pt.setCurrentOpacity(zt,Mt)}),Nt.appendChild(Mt);var Kt=document.createElement("div");Kt.innerText=100*zt+"%",Mt.appendChild(Kt),Pt.opacityBoxes.push(Mt)}),Nt},Lt.prototype.setCurrentOpacity=function(Pt,Nt){var zt=this;this.currentOpacity=Pt,this.opacityBoxes.forEach(function(Mt){Mt.style.borderColor=Mt===Nt?zt.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},Lt}(nt),Ke=function(_t){function Lt(Pt,Nt,zt){var Mt=_t.call(this,Pt,Nt,zt)||this;return Mt.setOpacity=Mt.setOpacity.bind(Mt),Mt.fillColor=zt.defaultHighlightColor,Mt.strokeWidth=0,Mt.opacity=zt.defaultHighlightOpacity,Mt.fillPanel=new et("Color",zt.defaultColorSet,Mt.fillColor),Mt.fillPanel.onColorChanged=Mt.setFillColor,Mt.opacityPanel=new an("Opacity",zt.defaultOpacitySteps,Mt.opacity),Mt.opacityPanel.onOpacityChanged=Mt.setOpacity,Mt}return Ut(Lt,_t),Lt.prototype.setOpacity=function(Pt){this.opacity=Pt,this.visual&&It.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=_t.prototype.getState.call(this);return Pt.typeName=Lt.typeName,Pt},Lt.typeName="HighlightMarker",Lt.title="Highlight marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',Lt}(_e),oe='<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>',Xt='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',qe=function(_t){function Lt(Pt,Nt,zt){var Mt=_t.call(this,Pt,Nt,zt)||this;return Mt.bgColor="transparent",Mt.tipPosition={x:0,y:0},Mt.tipBase1Position={x:0,y:0},Mt.tipBase2Position={x:0,y:0},Mt.tipMoving=!1,Mt.color=zt.defaultStrokeColor,Mt.bgColor=zt.defaultFillColor,Mt.fontFamily=zt.defaultFontFamily,Mt.defaultSize={x:100,y:30},Mt.setBgColor=Mt.setBgColor.bind(Mt),Mt.getTipPoints=Mt.getTipPoints.bind(Mt),Mt.positionTip=Mt.positionTip.bind(Mt),Mt.setTipPoints=Mt.setTipPoints.bind(Mt),Mt.colorPanel=new et("Text color",zt.defaultColorSet,Mt.color,oe),Mt.colorPanel.onColorChanged=Mt.setColor,Mt.bgColorPanel=new et("Fill color",zt.defaultColorSet,Mt.bgColor,Xt),Mt.bgColorPanel.onColorChanged=Mt.setBgColor,Mt.fontFamilyPanel=new ae("Font",zt.defaultFontFamilies,zt.defaultFontFamily),Mt.fontFamilyPanel.onFontChanged=Mt.setFont,Mt.tipGrip=new gt,Mt.tipGrip.visual.transform.baseVal.appendItem(It.createTransform()),Mt.controlBox.appendChild(Mt.tipGrip.visual),Mt}return Ut(Lt,_t),Lt.prototype.ownsTarget=function(Pt){return _t.prototype.ownsTarget.call(this,Pt)||this.tipGrip.ownsTarget(Pt)||this.tip===Pt},Lt.prototype.createTip=function(){It.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=It.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},Lt.prototype.pointerDown=function(Pt,Nt){this.state==="new"&&_t.prototype.pointerDown.call(this,Pt,Nt),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(Nt)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):_t.prototype.pointerDown.call(this,Pt,Nt)},Lt.prototype.pointerUp=function(Pt){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,_t.prototype.pointerUp.call(this,Pt);else{var Nt=this.state==="creating";_t.prototype.pointerUp.call(this,Pt),this.setTipPoints(Nt),this.positionTip()}},Lt.prototype.manipulate=function(Pt){if(this.tipMoving){var Nt=this.unrotatePoint(Pt);this.tipPosition={x:Nt.x-this.manipulationStartLeft,y:Nt.y-this.manipulationStartTop},this.positionTip()}else _t.prototype.manipulate.call(this,Pt)},Lt.prototype.setBgColor=function(Pt){this.bgRectangle&&this.tip&&(It.setAttributes(this.bgRectangle,[["fill",Pt]]),It.setAttributes(this.tip,[["fill",Pt]])),this.bgColor=Pt,this.fillColorChanged(Pt)},Lt.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},Lt.prototype.setTipPoints=function(Pt){Pt===void 0&&(Pt=!1);var Nt=Math.min(this.height/2,15),zt=this.height/5;Pt&&(this.tipPosition={x:Nt+zt/2,y:this.height+20});var Mt=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Mt<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(zt=this.width/5,Nt=Math.min(this.width/2,15),this.tipBase1Position={x:Nt,y:0},this.tipBase2Position={x:Nt+zt,y:0}):(this.tipBase1Position={x:0,y:Nt},this.tipBase2Position={x:0,y:Nt+zt}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Mt<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(zt=this.width/5,Nt=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Nt-zt,y:0},this.tipBase2Position={x:this.width-Nt,y:0}):(this.tipBase1Position={x:this.width,y:Nt},this.tipBase2Position={x:this.width,y:Nt+zt}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Mt<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(zt=this.width/5,Nt=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-Nt-zt,y:this.height},this.tipBase2Position={x:this.width-Nt,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-Nt-zt},this.tipBase2Position={x:this.width,y:this.height-Nt}):Mt<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(zt=this.width/5,Nt=Math.min(this.width/2,15),this.tipBase1Position={x:Nt,y:this.height},this.tipBase2Position={x:Nt+zt,y:this.height}):(this.tipBase1Position={x:0,y:this.height-Nt},this.tipBase2Position={x:0,y:this.height-Nt-zt})},Lt.prototype.resize=function(Pt){_t.prototype.resize.call(this,Pt),this.positionTip()},Lt.prototype.positionTip=function(){It.setAttributes(this.tip,[["points",this.getTipPoints()]]);var Pt=this.tipGrip.visual.transform.baseVal.getItem(0);Pt.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(Pt,0)},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),Lt.prototype.select=function(){this.positionTip(),_t.prototype.select.call(this)},Lt.prototype.getState=function(){var Pt=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},_t.prototype.getState.call(this));return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){var Nt=Pt;this.bgColor=Nt.bgColor,this.tipPosition=Nt.tipPosition,_t.prototype.restoreState.call(this,Pt),this.createTip(),this.setTipPoints()},Lt.prototype.scale=function(Pt,Nt){_t.prototype.scale.call(this,Pt,Nt),this.tipPosition={x:this.tipPosition.x*Pt,y:this.tipPosition.y*Nt},this.positionTip()},Lt.typeName="CalloutMarker",Lt.title="Callout marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',Lt}(Ne),_n=function(_t){function Lt(Pt,Nt,zt){var Mt=_t.call(this,Pt,Nt,zt)||this;return Mt.fillColor="transparent",Mt.strokeColor="transparent",Mt.strokeWidth=0,Mt.strokeDasharray="",Mt.opacity=1,Mt.strokeColor=zt.defaultColor,Mt.strokeWidth=zt.defaultStrokeWidth,Mt.strokeDasharray=zt.defaultStrokeDasharray,Mt.fillColor=zt.defaultFillColor,Mt.setStrokeColor=Mt.setStrokeColor.bind(Mt),Mt.setFillColor=Mt.setFillColor.bind(Mt),Mt.setStrokeWidth=Mt.setStrokeWidth.bind(Mt),Mt.setStrokeDasharray=Mt.setStrokeDasharray.bind(Mt),Mt.setOpacity=Mt.setOpacity.bind(Mt),Mt.createVisual=Mt.createVisual.bind(Mt),Mt.strokePanel=new et("Line color",ue(zt.defaultColorSet,["transparent"]),zt.defaultColor),Mt.strokePanel.onColorChanged=Mt.setStrokeColor,Mt.fillPanel=new et("Fill color",ue(zt.defaultColorSet,["transparent"]),Mt.fillColor,Xt),Mt.fillPanel.onColorChanged=Mt.setFillColor,Mt.strokeWidthPanel=new Tt("Line width",zt.defaultStrokeWidths,zt.defaultStrokeWidth),Mt.strokeWidthPanel.onWidthChanged=Mt.setStrokeWidth,Mt.strokeStylePanel=new Dt("Line style",zt.defaultStrokeDasharrays,zt.defaultStrokeDasharray),Mt.strokeStylePanel.onStyleChanged=Mt.setStrokeDasharray,Mt.opacityPanel=new an("Opacity",zt.defaultOpacitySteps,Mt.opacity),Mt.opacityPanel.onOpacityChanged=Mt.setOpacity,Mt}return Ut(Lt,_t),Lt.prototype.ownsTarget=function(Pt){return!(!_t.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual)},Lt.prototype.createVisual=function(){this.visual=It.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},Lt.prototype.pointerDown=function(Pt,Nt){_t.prototype.pointerDown.call(this,Pt,Nt),this.state==="new"&&(this.createVisual(),this.moveVisual(Pt),this._state="creating")},Lt.prototype.manipulate=function(Pt){_t.prototype.manipulate.call(this,Pt)},Lt.prototype.resize=function(Pt){_t.prototype.resize.call(this,Pt),this.setSize()},Lt.prototype.setSize=function(){_t.prototype.setSize.call(this),It.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},Lt.prototype.pointerUp=function(Pt){_t.prototype.pointerUp.call(this,Pt),this.setSize()},Lt.prototype.setStrokeColor=function(Pt){this.strokeColor=Pt,this.visual&&It.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(Pt),this.stateChanged()},Lt.prototype.setFillColor=function(Pt){this.fillColor=Pt,this.visual&&It.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(Pt),this.stateChanged()},Lt.prototype.setStrokeWidth=function(Pt){this.strokeWidth=Pt,this.visual&&It.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Lt.prototype.setStrokeDasharray=function(Pt){this.strokeDasharray=Pt,this.visual&&It.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Lt.prototype.setOpacity=function(Pt){this.opacity=Pt,this.visual&&It.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},_t.prototype.getState.call(this));return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){var Nt=Pt;this.fillColor=Nt.fillColor,this.strokeColor=Nt.strokeColor,this.strokeWidth=Nt.strokeWidth,this.strokeDasharray=Nt.strokeDasharray,this.opacity=Nt.opacity,this.createVisual(),_t.prototype.restoreState.call(this,Pt),this.setSize()},Lt.prototype.scale=function(Pt,Nt){_t.prototype.scale.call(this,Pt,Nt),this.setSize()},Lt.typeName="EllipseMarker",Lt.title="Ellipse marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',Lt}(St),Pn=function(_t){function Lt(Pt,Nt,zt){return _t.call(this,Pt,Nt,zt)||this}return Ut(Lt,_t),Object.defineProperty(Lt.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),Lt.prototype.ownsTarget=function(Pt){return!(!_t.prototype.ownsTarget.call(this,Pt)&&Pt!==this.tip1&&Pt!==this.tip2)},Lt.prototype.createTips=function(){this.tip1=It.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(It.createTransform()),this.visual.appendChild(this.tip1),this.tip2=It.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(It.createTransform()),this.visual.appendChild(this.tip2)},Lt.prototype.pointerDown=function(Pt,Nt){_t.prototype.pointerDown.call(this,Pt,Nt),this.state==="creating"&&this.createTips()},Lt.prototype.adjustVisual=function(){if(_t.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(It.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),It.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var Pt=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),Nt=this.tip1.transform.baseVal.getItem(0);Nt.setRotate(Pt,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(Nt,0);var zt=this.tip2.transform.baseVal.getItem(0);zt.setRotate(Pt+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(zt,0)}},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=_t.prototype.getState.call(this);return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){_t.prototype.restoreState.call(this,Pt),this.createTips(),this.adjustVisual()},Lt.typeName="MeasurementMarker",Lt.title="Measurement marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',Lt}(me),De=function(_t){function Lt(Pt,Nt,zt){var Mt=_t.call(this,Pt,Nt,zt)||this;return Mt.strokePanel.colors=zt.defaultColorSet,Mt.fillColor="transparent",Mt}return Ut(Lt,_t),Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=_t.prototype.getState.call(this);return Pt.typeName=Lt.typeName,Pt},Lt.typeName="EllipseFrameMarker",Lt.title="Ellipse frame marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',Lt}(_n),dn=function(){function _t(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(_t.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),_t.prototype.addUndoStep=function(Lt){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(Lt)||(this.undoStack.push(Lt),JSON.stringify(this.lastRedoStep)!==JSON.stringify(Lt)&&this.redoStack.splice(0,this.redoStack.length))},_t.prototype.replaceLastUndoStep=function(Lt){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=Lt)},_t.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},_t.prototype.undo=function(){if(this.undoStack.length>1){var Lt=this.undoStack.pop();return Lt!==void 0&&this.redoStack.push(Lt),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},_t.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},_t}(),sn=function(_t){function Lt(Pt,Nt,zt){var Mt=_t.call(this,Pt,Nt,zt)||this;return Mt.strokeColor="transparent",Mt.strokeWidth=0,Mt.strokeDasharray="",Mt.curveX=0,Mt.curveY=0,Mt.manipulationStartCurveX=0,Mt.manipulationStartCurveY=0,Mt.setStrokeColor=Mt.setStrokeColor.bind(Mt),Mt.setStrokeWidth=Mt.setStrokeWidth.bind(Mt),Mt.setStrokeDasharray=Mt.setStrokeDasharray.bind(Mt),Mt.positionGrips=Mt.positionGrips.bind(Mt),Mt.addControlGrips=Mt.addControlGrips.bind(Mt),Mt.adjustVisual=Mt.adjustVisual.bind(Mt),Mt.setupControlBox=Mt.setupControlBox.bind(Mt),Mt.resize=Mt.resize.bind(Mt),Mt.strokeColor=zt.defaultColor,Mt.strokeWidth=zt.defaultStrokeWidth,Mt.strokeDasharray=zt.defaultStrokeDasharray,Mt.strokePanel=new et("Line color",zt.defaultColorSet,zt.defaultColor),Mt.strokePanel.onColorChanged=Mt.setStrokeColor,Mt.strokeWidthPanel=new Tt("Line width",zt.defaultStrokeWidths,zt.defaultStrokeWidth),Mt.strokeWidthPanel.onWidthChanged=Mt.setStrokeWidth,Mt.strokeStylePanel=new Dt("Line style",zt.defaultStrokeDasharrays,zt.defaultStrokeDasharray),Mt.strokeStylePanel.onStyleChanged=Mt.setStrokeDasharray,Mt}return Ut(Lt,_t),Lt.prototype.ownsTarget=function(Pt){return!(!_t.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual&&Pt!==this.selectorCurve&&Pt!==this.visibleCurve&&!this.curveGrip.ownsTarget(Pt))},Lt.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},Lt.prototype.createVisual=function(){this.visual=It.createGroup(),this.selectorCurve=It.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=It.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},Lt.prototype.pointerDown=function(Pt,Nt){_t.prototype.pointerDown.call(this,Pt,Nt),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=Pt.x,this.curveY=Pt.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(Nt)&&(this.activeGrip=this.curveGrip,this._state="resize")},Lt.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),It.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),It.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),It.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},Lt.prototype.setupControlBox=function(){_t.prototype.setupControlBox.call(this),this.curveControlLine1=It.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=It.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},Lt.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,_t.prototype.addControlGrips.call(this)},Lt.prototype.positionGrips=function(){_t.prototype.positionGrips.call(this);var Pt=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-Pt/2,this.curveY-Pt/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},Lt.prototype.manipulate=function(Pt){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+Pt.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+Pt.y-this.manipulationStartY),_t.prototype.manipulate.call(this,Pt)},Lt.prototype.resize=function(Pt){this.activeGrip===this.curveGrip&&(this.curveX=Pt.x,this.curveY=Pt.y),_t.prototype.resize.call(this,Pt),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},Lt.prototype.setStrokeColor=function(Pt){this.strokeColor=Pt,this.adjustVisual(),this.colorChanged(Pt)},Lt.prototype.setStrokeWidth=function(Pt){this.strokeWidth=Pt,this.adjustVisual()},Lt.prototype.setStrokeDasharray=function(Pt){this.strokeDasharray=Pt,this.adjustVisual()},Lt.prototype.scale=function(Pt,Nt){this.curveX=this.curveX*Pt,this.curveY=this.curveY*Nt,_t.prototype.scale.call(this,Pt,Nt)},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},_t.prototype.getState.call(this));return Pt.typeName=Lt.typeName,Pt},Lt.prototype.restoreState=function(Pt){_t.prototype.restoreState.call(this,Pt);var Nt=Pt;this.strokeColor=Nt.strokeColor,this.strokeWidth=Nt.strokeWidth,this.strokeDasharray=Nt.strokeDasharray,this.curveX=Nt.curveX,this.curveY=Nt.curveY,this.createVisual(),this.adjustVisual()},Lt.typeName="CurveMarker",Lt.title="Curve marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',Lt}(Gt),jn=function(_t){function Lt(Pt,Nt,zt){var Mt=_t.call(this,Pt,Nt,zt)||this;return Mt.fillColor="transparent",Mt.strokeColor="transparent",Mt.strokeWidth=0,Mt.strokeDasharray="",Mt.textColor="transparent",Mt.fontSize="1rem",Mt.isMoved=!1,Mt.captionText="Caption",Mt.PADDING=5,Mt.captionBoxWidth=0,Mt.captionBoxHeight=0,Mt.strokeColor=zt.defaultColor,Mt.strokeWidth=zt.defaultStrokeWidth,Mt.strokeDasharray=zt.defaultStrokeDasharray,Mt.fillColor=zt.defaultFillColor,Mt.textColor=zt.defaultStrokeColor,Mt.fontFamily=zt.defaultFontFamily,Mt.fontSize=zt.defaultCaptionFontSize,Mt.captionText=zt.defaultCaptionText,Mt.setStrokeColor=Mt.setStrokeColor.bind(Mt),Mt.setFillColor=Mt.setFillColor.bind(Mt),Mt.setStrokeWidth=Mt.setStrokeWidth.bind(Mt),Mt.setStrokeDasharray=Mt.setStrokeDasharray.bind(Mt),Mt.createVisual=Mt.createVisual.bind(Mt),Mt.sizeCaption=Mt.sizeCaption.bind(Mt),Mt.setCaptionText=Mt.setCaptionText.bind(Mt),Mt.showTextEditor=Mt.showTextEditor.bind(Mt),Mt.positionTextEditor=Mt.positionTextEditor.bind(Mt),Mt.finishTextEditing=Mt.finishTextEditing.bind(Mt),Mt.setFont=Mt.setFont.bind(Mt),Mt.setTextColor=Mt.setTextColor.bind(Mt),Mt.strokePanel=new et("Line color",ue(zt.defaultColorSet,["transparent"]),Mt.strokeColor),Mt.strokePanel.onColorChanged=Mt.setStrokeColor,Mt.fillPanel=new et("Fill color",ue(zt.defaultColorSet,["transparent"]),Mt.fillColor,Xt),Mt.fillPanel.onColorChanged=Mt.setFillColor,Mt.strokeWidthPanel=new Tt("Line width",zt.defaultStrokeWidths,zt.defaultStrokeWidth),Mt.strokeWidthPanel.onWidthChanged=Mt.setStrokeWidth,Mt.strokeStylePanel=new Dt("Line style",zt.defaultStrokeDasharrays,zt.defaultStrokeDasharray),Mt.strokeStylePanel.onStyleChanged=Mt.setStrokeDasharray,Mt.fontFamilyPanel=new ae("Font",zt.defaultFontFamilies,zt.defaultFontFamily),Mt.fontFamilyPanel.onFontChanged=Mt.setFont,Mt.textColorPanel=new et("Text color",zt.defaultColorSet,Mt.textColor,oe),Mt.textColorPanel.onColorChanged=Mt.setTextColor,Mt}return Ut(Lt,_t),Lt.prototype.ownsTarget=function(Pt){return!(!_t.prototype.ownsTarget.call(this,Pt)&&Pt!==this.visual&&Pt!==this.frame&&Pt!==this.captionBg&&Pt!==this.captionElement)},Lt.prototype.createVisual=function(){this.visual=It.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=It.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=It.createText([["fill",this.textColor],["font-family",this.fontFamily]]),this.captionElement.style.fontSize=this.fontSize,this.captionElement.style.textAnchor="start",this.captionElement.style.dominantBaseline="text-before-edge",this.captionElement.textContent=this.captionText,this.visual.appendChild(this.captionElement),this.frame=It.createRect(this.width,this.height,[["fill","transparent"],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray]]),this.visual.appendChild(this.frame),this.sizeCaption()},Lt.prototype.setCaptionText=function(Pt){this.captionText=Pt,this.captionElement.textContent=this.captionText,this.sizeCaption()},Lt.prototype.pointerDown=function(Pt,Nt){_t.prototype.pointerDown.call(this,Pt,Nt),this.isMoved=!1,this.pointerDownPoint=Pt,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(Pt),this._state="creating")},Lt.prototype.manipulate=function(Pt){_t.prototype.manipulate.call(this,Pt),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(Pt.x-this.pointerDownPoint.x)>5||Math.abs(Pt.y-this.pointerDownPoint.y)>5)},Lt.prototype.resize=function(Pt){_t.prototype.resize.call(this,Pt),this.setSize()},Lt.prototype.sizeCaption=function(){var Pt=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=Pt.width+2*this.PADDING,this.captionBoxHeight=Pt.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),It.setAttributes(this.captionBg,[["width",this.captionBoxWidth.toString()],["height",this.captionBoxHeight.toString()],["clip-path","path('M0,0 H"+this.width+" V"+this.height+" H"+-this.width+" Z')"]]),It.setAttributes(this.captionElement,[["x",this.PADDING.toString()],["y",this.PADDING.toString()],["clip-path","path('M0,0 H"+(this.width-this.PADDING)+" V"+this.height+" H"+(-this.width-this.PADDING)+" Z')"]])},Lt.prototype.showTextEditor=function(){var Pt=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditBox=document.createElement("input"),this.textEditBox.style.position="absolute",this.textEditBox.style.width=this.width+"px",this.captionBoxHeight>0&&(this.textEditBox.style.height=this.captionBoxHeight+"px"),this.textEditBox.style.fontSize=this.fontSize,this.textEditBox.style.fontFamily=this.fontFamily,this.textEditBox.style.backgroundColor=this.fillColor,this.textEditBox.style.color=this.textColor,this.textEditBox.style.borderWidth="0",this.textEditBox.setAttribute("value",this.captionText),this.textEditBox.select(),this.textEditDiv.appendChild(this.textEditBox),this.overlayContainer.appendChild(this.textEditDiv),this.textEditBox.addEventListener("pointerup",function(Nt){Nt.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(Nt){Nt.key==="Enter"&&Pt.finishTextEditing(Pt.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(Nt){Nt.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){Pt.finishTextEditing(Pt.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){Pt.finishTextEditing(Pt.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},Lt.prototype.positionTextEditor=function(){this.state==="edit"&&(this.textEditBox===void 0?this.showTextEditor():(this.textEditBox.style.left=this.left+"px",this.textEditBox.style.top=this.top+"px",this.textEditBox.style.transform="rotate("+this.rotationAngle+"deg)",this.textEditBox.style.transformOrigin=this.width/2+"px "+this.height/2+"px"))},Lt.prototype.finishTextEditing=function(Pt){this.setCaptionText(Pt.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},Lt.prototype.setFont=function(Pt){this.captionElement&&It.setAttributes(this.captionElement,[["font-family",Pt]]),this.fontFamily=Pt,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},Lt.prototype.setTextColor=function(Pt){this.captionElement&&It.setAttributes(this.captionElement,[["fill",Pt]]),this.textColor=Pt,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},Lt.prototype.setSize=function(){_t.prototype.setSize.call(this),It.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},Lt.prototype.pointerUp=function(Pt){_t.prototype.pointerUp.call(this,Pt),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},Lt.prototype.dblClick=function(Pt,Nt){_t.prototype.dblClick.call(this,Pt,Nt),this.showTextEditor()},Lt.prototype.setStrokeColor=function(Pt){this.strokeColor=Pt,this.frame&&It.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(Pt),this.stateChanged()},Lt.prototype.setFillColor=function(Pt){this.fillColor=Pt,this.captionBg&&It.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(Pt),this.stateChanged()},Lt.prototype.setStrokeWidth=function(Pt){this.strokeWidth=Pt,this.frame&&It.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Lt.prototype.setStrokeDasharray=function(Pt){this.strokeDasharray=Pt,this.frame&&It.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(Lt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),Lt.prototype.getState=function(){var Pt=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:1,textColor:this.textColor,fontFamily:this.fontFamily,fontSize:this.fontSize,captionText:this.captionText},_t.prototype.getState.call(this));return Pt.typeName=this.typeName,Pt},Lt.prototype.restoreState=function(Pt){var Nt=Pt;this.fillColor=Nt.fillColor,this.strokeColor=Nt.strokeColor,this.strokeWidth=Nt.strokeWidth,this.strokeDasharray=Nt.strokeDasharray,this.textColor=Nt.textColor,this.fontFamily=Nt.fontFamily,this.captionText=Nt.captionText,this.fontSize=Nt.fontSize,this.createVisual(),_t.prototype.restoreState.call(this,Pt),this.setSize()},Lt.prototype.scale=function(Pt,Nt){_t.prototype.scale.call(this,Pt,Nt),this.setSize()},Lt.typeName="CaptionFrameMarker",Lt.title="Caption frame marker",Lt.icon='<svg viewBox="0 0 24 24"><path d="M5 3c-1.11 0-2 .89-2 2v14c0 1.11.89 2 2 2h14c1.11 0 2-.89 2-2V5c0-1.11-.89-2-2-2H5m0 2h14v14H5V5m2 2v2h10V7H7z"/></svg>',Lt}(St),Te=function(){function _t(Lt,Pt){Pt===void 0&&(Pt=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=Lt,this.cancelable=Pt}return Object.defineProperty(_t.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),_t.prototype.preventDefault=function(){this._defaultPrevented=!0},_t}(),Sn=function(_t){function Lt(Pt,Nt,zt){var Mt=_t.call(this,Pt,!1)||this;return Mt.dataUrl=Nt,Mt.state=zt,Mt}return Ut(Lt,_t),Lt}(Te),ee=function(_t){function Lt(Pt,Nt,zt){zt===void 0&&(zt=!1);var Mt=_t.call(this,Pt,zt)||this;return Mt.marker=Nt,Mt}return Ut(Lt,_t),Lt}(Te),Mn=function(){function _t(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return _t.prototype.addEventListener=function(Lt,Pt){this[Lt].push(Pt)},_t.prototype.removeEventListener=function(Lt,Pt){var Nt=this[Lt].indexOf(Pt);Nt>-1&&this[Lt].splice(Nt,1)},_t}(),ui=function(){function _t(Lt){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Yt,this._isOpen=!1,this.undoRedoManager=new dn,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Mn,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=_t.instanceCounter++,this.styles=new Rt(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=Lt,this.targetRoot=document.body,this.width=Lt.clientWidth,this.height=Lt.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(_t.prototype,"ALL_MARKER_TYPES",{get:function(){return[Jt,Ce,tn,Ne,De,_n,Ke,qe,Pn,_e,me,sn,jn]},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Jt,Ce,tn,Ne,_n,Ke,qe]},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Jt,Ce,tn,Ne,Ke]},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(Lt){var Pt=this;this._availableMarkerTypes.splice(0),Lt.forEach(function(Nt){if(typeof Nt=="string"){var zt=Pt.ALL_MARKER_TYPES.find(function(Mt){return Mt.typeName===Nt});zt!==void 0&&Pt._availableMarkerTypes.push(zt)}else Pt._availableMarkerTypes.push(Nt)})},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(Lt){this._zoomLevel=Lt,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(_t.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),_t.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),qt.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},_t.prototype.show=function(){var Lt=this;this.styles.styleSheetRoot===void 0&&ne.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ne.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(Pt){return Pt(new Te(Lt))})},_t.prototype.render=function(){return le(this,void 0,void 0,function(){var Lt;return Me(this,function(Pt){switch(Pt.label){case 0:return this.setCurrentMarker(),(Lt=new ge).naturalSize=this.renderAtNaturalSize,Lt.imageType=this.renderImageType,Lt.imageQuality=this.renderImageQuality,Lt.markersOnly=this.renderMarkersOnly,Lt.width=this.renderWidth,Lt.height=this.renderHeight,[4,Lt.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return Pt.sent(),[4,Lt.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,Pt.sent()]}})})},_t.prototype.close=function(Lt){var Pt=this;if(Lt===void 0&&(Lt=!1),this.isOpen){var Nt=!1;Lt||this.eventListeners.beforeclose.forEach(function(zt){var Mt=new Te(Pt,!0);zt(Mt),Mt.defaultPrevented&&(Nt=!0)}),Nt||(this.coverDiv&&this.closeUI(),this.targetObserver&&(this.targetObserver.unobserve(this.target),this.targetObserver.unobserve(this.editorCanvas)),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(zt){return zt(new Te(Pt))}),this.detachEvents(),this._isOpen=!1)}},_t.prototype.addMarkersToToolbar=function(){for(var Lt,Pt=[],Nt=0;Nt<arguments.length;Nt++)Pt[Nt]=arguments[Nt];(Lt=this._availableMarkerTypes).push.apply(Lt,Pt)},_t.prototype.addRenderEventListener=function(Lt){this.addEventListener("render",function(Pt){Lt(Pt.dataUrl,Pt.state)})},_t.prototype.removeRenderEventListener=function(Lt){},_t.prototype.addCloseEventListener=function(Lt){this.addEventListener("close",function(){Lt()})},_t.prototype.removeCloseEventListener=function(Lt){},_t.prototype.setupResizeObserver=function(){var Lt=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){Lt.resize(Lt.target.clientWidth,Lt.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return Lt.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},_t.prototype.onPopupTargetResize=function(){var Lt=1*this.target.clientWidth/this.target.clientHeight,Pt=this.editorCanvas.clientWidth/Lt>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*Lt:this.editorCanvas.clientWidth,Nt=Pt<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/Lt;this.resize(Pt,Nt)},_t.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},_t.prototype.resize=function(Lt,Pt){this._isResizing=!0;var Nt=Lt/this.imageWidth,zt=Pt/this.imageHeight;this.imageWidth=Math.round(Lt),this.imageHeight=Math.round(Pt),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(Nt,zt),this._isResizing=!1},_t.prototype.scaleMarkers=function(Lt,Pt){var Nt,zt=this;this._currentMarker&&this._currentMarker instanceof Ne?this._currentMarker.scale(Lt,Pt):(Nt=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Mt){Mt!==zt._currentMarker&&Mt.scale(Lt,Pt)}),Nt!==void 0&&this.setCurrentMarker(Nt)},_t.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},_t.prototype.setTopLeft=function(){var Lt=this.editingTarget.getBoundingClientRect(),Pt=this.editorCanvas.getBoundingClientRect();this.left=Lt.left-Pt.left,this.top=Lt.top-Pt.top},_t.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},_t.prototype.addDefs=function(){for(var Lt,Pt=[],Nt=0;Nt<arguments.length;Nt++)Pt[Nt]=arguments[Nt];this.defs=It.createDefs(),this.addDefsToImage(),(Lt=this.defs).append.apply(Lt,Pt)},_t.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},_t.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},_t.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},_t.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},_t.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},_t.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},_t.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},_t.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var Lt=document.createElement("a");Lt.href="https://markerjs.com/",Lt.target="_blank",Lt.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',Lt.title="Powered by marker.js",Lt.style.display="grid",Lt.style.alignItems="center",Lt.style.justifyItems="center",Lt.style.padding="3px",Lt.style.width="20px",Lt.style.height="20px",this.logoUI.appendChild(Lt),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},_t.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},_t.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},_t.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},_t.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var Lt=this.settings.uiOffsetTop!==void 0?this.target.offsetTop+this.settings.uiOffsetTop:this.target.offsetTop>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=Lt+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Ee(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.settings.uiOffsetTop===void 0&&this.target.offsetTop<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Bt(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},_t.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},_t.prototype.removeMarker=function(Lt){this.markerImage.removeChild(Lt.container),this.markers.indexOf(Lt)>-1&&this.markers.splice(this.markers.indexOf(Lt),1),Lt.dispose()},_t.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},_t.prototype.toolbarButtonClicked=function(Lt,Pt){if(Lt==="marker"&&Pt!==void 0)this.createNewMarker(Pt);else if(Lt==="action")switch(Pt){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},_t.prototype.deleteSelectedMarker=function(){var Lt=this;if(this._currentMarker!==void 0){var Pt=!1;if(this.eventListeners.markerbeforedelete.forEach(function(zt){var Mt=new ee(Lt,Lt._currentMarker,!0);zt(Mt),Mt.defaultPrevented&&(Pt=!0)}),!Pt){var Nt=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(zt){return zt(new ee(Lt,Nt))})}}},_t.prototype.clear=function(){var Lt=this,Pt=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Kt){var ye=new ee(Lt,void 0,!0);Kt(ye),ye.defaultPrevented&&(Pt=!0)}),!Pt)){this.setCurrentMarker();for(var Nt=function(Kt){var ye=zt.markers[Kt];zt.setCurrentMarker(zt.markers[Kt]),zt._currentMarker.dispose(),zt.markerImage.removeChild(zt._currentMarker.container),zt.markers.splice(zt.markers.indexOf(zt._currentMarker),1),zt.eventListeners.markerdelete.forEach(function(Ue){return Ue(new ee(Lt,ye))})},zt=this,Mt=this.markers.length-1;Mt>=0;Mt--)Nt(Mt);this.addUndoStep()}},Object.defineProperty(_t.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),_t.prototype.showNotesEditor=function(){var Lt;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(Lt=this._currentMarker.notes)!==null&&Lt!==void 0?Lt:"",this.overlayContainer.appendChild(this.notesArea))},_t.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},_t.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},_t.prototype.addUndoStep=function(){var Lt=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var Pt=this.getState(),Nt=this.undoRedoManager.getLastUndoStep();if(!Nt||Nt.width===Pt.width&&Nt.height===Pt.height){var zt=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(Pt),zt<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Mt){return Mt(new Te(Lt))})}else this.undoRedoManager.replaceLastUndoStep(Pt),this.eventListeners.statechange.forEach(function(Mt){return Mt(new Te(Lt))})}},_t.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},_t.prototype.undoStep=function(){var Lt=this,Pt=this.undoRedoManager.undo();Pt!==void 0&&(this.restoreState(Pt),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Nt){return Nt(new Te(Lt))}))},_t.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},_t.prototype.redoStep=function(){var Lt=this,Pt=this.undoRedoManager.redo();Pt!==void 0&&(this.restoreState(Pt),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(Nt){return Nt(new Te(Lt))}))},_t.prototype.stepZoom=function(){var Lt=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=Lt<this.zoomSteps.length-1?this.zoomSteps[Lt+1]:this.zoomSteps[0]},_t.prototype.panTo=function(Lt){this.contentDiv.scrollBy({left:this.prevPanPoint.x-Lt.x,top:this.prevPanPoint.y-Lt.y}),this.prevPanPoint=Lt},_t.prototype.startRenderAndClose=function(){return le(this,void 0,void 0,function(){var Lt,Pt,Nt=this;return Me(this,function(zt){switch(zt.label){case 0:return[4,this.render()];case 1:return Lt=zt.sent(),Pt=this.getState(),this.eventListeners.render.forEach(function(Mt){return Mt(new Sn(Nt,Lt,Pt))}),this.close(!0),[2]}})})},_t.prototype.getState=function(Lt){Lt===!0&&this.setCurrentMarker();var Pt={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(Nt){return Pt.markers.push(Nt.getState())}),Pt},_t.prototype.restoreState=function(Lt){var Pt=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);Lt.markers.forEach(function(Nt){var zt=Pt._availableMarkerTypes.find(function(Kt){return Kt.typeName===Nt.typeName});if(zt!==void 0){var Mt=Pt.addNewMarker(zt);Mt.restoreState(Nt),Pt.markers.push(Mt)}}),Lt.width&&Lt.height&&(Lt.width!==this.imageWidth||Lt.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/Lt.width,this.imageHeight/Lt.height),this.eventListeners.restorestate.forEach(function(Nt){return Nt(new Te(Pt))})},_t.prototype.addNewMarker=function(Lt){var Pt=It.createGroup();return this.markerImage.appendChild(Pt),new Lt(Pt,this.overlayContainer,this.settings)},_t.prototype.createNewMarker=function(Lt){var Pt,Nt=this;(Pt=typeof Lt=="string"?this._availableMarkerTypes.find(function(zt){return zt.typeName===Lt}):Lt)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(Pt),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(Pt.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(zt){return zt(new ee(Nt,Nt._currentMarker))}))},_t.prototype.markerCreated=function(Lt){var Pt=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(Lt),this.setCurrentMarker(Lt),Lt instanceof Ce&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Ce):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(Nt){return Nt(new ee(Pt,Pt._currentMarker))})},_t.prototype.colorChanged=function(Lt){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=Lt,this.settings.defaultStrokeColor=Lt)},_t.prototype.fillColorChanged=function(Lt){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=Lt)},_t.prototype.markerStateChanged=function(Lt){var Pt=this;this.eventListeners.markerchange.forEach(function(Nt){return Nt(new ee(Pt,Lt))})},_t.prototype.setCurrentMarker=function(Lt){var Pt=this;this._currentMarker!==Lt&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(Nt){return Nt(new ee(Pt,Pt._currentMarker))})),this._currentMarker=Lt,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(Nt){return Nt(new ee(Pt,Pt._currentMarker))}))},_t.prototype.onPointerDown=function(Lt){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||Lt.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var Pt=this.markers.find(function(Nt){return Nt.ownsTarget(Lt.target)});Pt!==void 0?(this.setCurrentMarker(Pt),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(Lt.clientX,Lt.clientY),Lt.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:Lt.clientX,y:Lt.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(Lt.clientX,Lt.clientY))},_t.prototype.onDblClick=function(Lt){if(this._isFocused||this.focus(),this.mode==="select"){var Pt=this.markers.find(function(Nt){return Nt.ownsTarget(Lt.target)});Pt!==void 0&&Pt!==this._currentMarker&&this.setCurrentMarker(Pt),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(Lt.clientX,Lt.clientY),Lt.target):this.setCurrentMarker()}},_t.prototype.onPointerMove=function(Lt){this.touchPoints!==1&&Lt.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||Lt.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(Lt.clientX,Lt.clientY)):this.zoomLevel>1&&this.panTo({x:Lt.clientX,y:Lt.clientY}))},_t.prototype.onPointerUp=function(Lt){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(Lt.clientX,Lt.clientY)),this.isDragging=!1,this.addUndoStep()},_t.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},_t.prototype.onKeyUp=function(Lt){this._currentMarker===void 0||this.notesArea!==void 0||Lt.key!=="Delete"&&Lt.key!=="Backspace"||this.deleteSelectedMarker()},_t.prototype.clientToLocalCoordinates=function(Lt,Pt){var Nt=this.markerImage.getBoundingClientRect();return{x:(Lt-Nt.left)/this.zoomLevel,y:(Pt-Nt.top)/this.zoomLevel}},_t.prototype.onWindowResize=function(){this.positionUI()},_t.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var Lt=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=Lt+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},_t.prototype.addLicenseKey=function(Lt){qt.addKey(Lt)},_t.prototype.addEventListener=function(Lt,Pt){this.eventListeners.addEventListener(Lt,Pt)},_t.prototype.removeEventListener=function(Lt,Pt){this.eventListeners.removeEventListener(Lt,Pt)},_t.prototype.renderState=function(Lt){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(Lt),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(_t.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),_t.prototype.focus=function(){var Lt=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(Pt){return Pt(new Te(Lt))}))},_t.prototype.blur=function(){var Lt=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(Pt){return Pt(new Te(Lt))}))},_t.instanceCounter=0,_t}()},63727:function(Dn,Gn,kt){"use strict";kt.d(Gn,{s:function(){return ce},default:function(){return Ti}});var pt=kt(72308),Ut=kt(77321),le=kt(80702),Me=kt(52487),ue=kt(74416),It=kt(45560),qt=kt(69582),ge=kt(6089),ne=kt(18929),Rt=kt(59301),Ae=Rt.createContext({}),ie=Ae,Ee=kt(62853),Bt=kt(49618),nt="__rc_cascader_search_mark__",et=function(Je,rn,Xn){var Ln=Xn.label,nn=Ln===void 0?"":Ln;return rn.some(function(Kn){return String(Kn[nn]).toLowerCase().includes(Je.toLowerCase())})},ht=function(Je,rn,Xn,Ln){return rn.map(function(nn){return nn[Ln.label]}).join(" / ")},st=function(Je,rn,Xn,Ln,nn,Kn){var mi=nn.filter,ei=mi===void 0?et:mi,Si=nn.render,Wi=Si===void 0?ht:Si,An=nn.limit,gn=An===void 0?50:An,Rn=nn.sort;return Rt.useMemo(function(){var si=[];if(!Je)return[];function xi(di,Oi){var wt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;di.forEach(function(yn){if(!(!Rn&&gn!==!1&&gn>0&&si.length>=gn)){var Wn=[].concat((0,le.Z)(Oi),[yn]),ki=yn[Xn.children],Ui=wt||yn.disabled;if((!ki||ki.length===0||Kn)&&ei(Je,Wn,{label:Xn.label})){var ur;si.push((0,Ut.Z)((0,Ut.Z)({},yn),{},(ur={disabled:Ui},(0,Bt.Z)(ur,Xn.label,Wi(Je,Wn,Ln,Xn)),(0,Bt.Z)(ur,nt,Wn),(0,Bt.Z)(ur,Xn.children,void 0),ur)))}ki&&xi(yn[Xn.children],Wn,Ui)}})}return xi(rn,[]),Rn&&si.sort(function(di,Oi){return Rn(di[nt],Oi[nt],Je,Xn)}),gn!==!1&&gn>0?si.slice(0,gn):si},[Je,rn,Xn,Ln,Wi,Kn,ei,Rn,gn])},gt=st,vt="__RC_CASCADER_SPLIT__",St="SHOW_PARENT",Et="SHOW_CHILD";function Tt(Ge){return Ge.join(vt)}function Dt(Ge){return Ge.map(Tt)}function Jt(Ge){return Ge.split(vt)}function Yt(Ge){var Je=Ge||{},rn=Je.label,Xn=Je.value,Ln=Je.children,nn=Xn||"value";return{label:rn||"label",value:nn,key:nn,children:Ln||"children"}}function Gt(Ge,Je){var rn,Xn;return(rn=Ge.isLeaf)!==null&&rn!==void 0?rn:!((Xn=Ge[Je.children])!==null&&Xn!==void 0&&Xn.length)}function me(Ge){var Je=Ge.parentElement;if(Je){var rn=Ge.offsetTop-Je.offsetTop;rn-Je.scrollTop<0?Je.scrollTo({top:rn}):rn+Ge.offsetHeight-Je.scrollTop>Je.offsetHeight&&Je.scrollTo({top:rn+Ge.offsetHeight-Je.offsetHeight})}}function ae(Ge,Je){return Ge.map(function(rn){var Xn;return(Xn=rn[nt])===null||Xn===void 0?void 0:Xn.map(function(Ln){return Ln[Je.value]})})}function Ne(Ge){return Array.isArray(Ge)&&Array.isArray(Ge[0])}function Ce(Ge){return Ge?Ne(Ge)?Ge:(Ge.length===0?[]:[Ge]).map(function(Je){return Array.isArray(Je)?Je:[Je]}):[]}function we(Ge,Je,rn){var Xn=new Set(Ge),Ln=Je();return Ge.filter(function(nn){var Kn=Ln[nn],mi=Kn?Kn.parent:null,ei=Kn?Kn.children:null;return Kn&&Kn.node.disabled?!0:rn===Et?!(ei&&ei.some(function(Si){return Si.key&&Xn.has(Si.key)})):!(mi&&!mi.node.disabled&&Xn.has(mi.key))})}function tn(Ge,Je,rn){for(var Xn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,Ln=Je,nn=[],Kn=function(){var Si,Wi,An,gn=Ge[mi],Rn=(Si=Ln)===null||Si===void 0?void 0:Si.findIndex(function(xi){var di=xi[rn.value];return Xn?String(di)===String(gn):di===gn}),si=Rn!==-1?(Wi=Ln)===null||Wi===void 0?void 0:Wi[Rn]:null;nn.push({value:(An=si==null?void 0:si[rn.value])!==null&&An!==void 0?An:gn,index:Rn,option:si}),Ln=si==null?void 0:si[rn.children]},mi=0;mi<Ge.length;mi+=1)Kn();return nn}var _e=function(Ge,Je,rn,Xn,Ln){return Rt.useMemo(function(){var nn=Ln||function(Kn){var mi=Xn?Kn.slice(-1):Kn,ei=" / ";return mi.every(function(Si){return["string","number"].includes((0,Ee.Z)(Si))})?mi.join(ei):mi.reduce(function(Si,Wi,An){var gn=Rt.isValidElement(Wi)?Rt.cloneElement(Wi,{key:An}):Wi;return An===0?[gn]:[].concat((0,le.Z)(Si),[ei,gn])},[])};return Ge.map(function(Kn){var mi,ei=tn(Kn,Je,rn),Si=nn(ei.map(function(An){var gn,Rn=An.option,si=An.value;return(gn=Rn==null?void 0:Rn[rn.label])!==null&&gn!==void 0?gn:si}),ei.map(function(An){var gn=An.option;return gn})),Wi=Tt(Kn);return{label:Si,value:Wi,key:Wi,valueCells:Kn,disabled:(mi=ei[ei.length-1])===null||mi===void 0||(mi=mi.option)===null||mi===void 0?void 0:mi.disabled}})},[Ge,Je,rn,Ln,Xn])};function an(Ge,Je){return Rt.useCallback(function(rn){var Xn=[],Ln=[];return rn.forEach(function(nn){var Kn=tn(nn,Ge,Je);Kn.every(function(mi){return mi.option})?Ln.push(nn):Xn.push(nn)}),[Ln,Xn]},[Ge,Je])}var Ke=kt(34061),oe=function(Ge,Je){var rn=Rt.useRef({options:[],info:{keyEntities:{},pathKeyEntities:{}}}),Xn=Rt.useCallback(function(){return rn.current.options!==Ge&&(rn.current.options=Ge,rn.current.info=(0,Ke.I8)(Ge,{fieldNames:Je,initWrapper:function(nn){return(0,Ut.Z)((0,Ut.Z)({},nn),{},{pathKeyEntities:{}})},processEntity:function(nn,Kn){var mi=nn.nodes.map(function(ei){return ei[Je.value]}).join(vt);Kn.pathKeyEntities[mi]=nn,nn.key=mi}})),rn.current.info.pathKeyEntities},[Je,Ge]);return Xn};function Xt(Ge,Je){var rn=Rt.useMemo(function(){return Je||[]},[Je]),Xn=oe(rn,Ge),Ln=Rt.useCallback(function(nn){var Kn=Xn();return nn.map(function(mi){var ei=Kn[mi].nodes;return ei.map(function(Si){return Si[Ge.value]})})},[Xn,Ge]);return[rn,Xn,Ln]}var qe=kt(48736);function _n(Ge){return Rt.useMemo(function(){if(!Ge)return[!1,{}];var Je={matchInputWidth:!0,limit:50};return Ge&&(0,Ee.Z)(Ge)==="object"&&(Je=(0,Ut.Z)((0,Ut.Z)({},Je),Ge)),Je.limit<=0&&(Je.limit=!1),[!0,Je]},[Ge])}var Pn=kt(34643);function De(Ge,Je,rn,Xn,Ln,nn,Kn,mi){return function(ei){if(!Ge)Je(ei);else{var Si=Tt(ei),Wi=Dt(rn),An=Dt(Xn),gn=Wi.includes(Si),Rn=Ln.some(function(Ui){return Tt(Ui)===Si}),si=rn,xi=Ln;if(Rn&&!gn)xi=Ln.filter(function(Ui){return Tt(Ui)!==Si});else{var di=gn?Wi.filter(function(Ui){return Ui!==Si}):[].concat((0,le.Z)(Wi),[Si]),Oi=nn(),wt;if(gn){var yn=(0,Pn.S)(di,{checked:!1,halfCheckedKeys:An},Oi);wt=yn.checkedKeys}else{var Wn=(0,Pn.S)(di,!0,Oi);wt=Wn.checkedKeys}var ki=we(wt,nn,mi);si=Kn(ki)}Je([].concat((0,le.Z)(xi),(0,le.Z)(si)))}}}function dn(Ge,Je,rn,Xn,Ln){return Rt.useMemo(function(){var nn=Ln(Je),Kn=(0,Me.Z)(nn,2),mi=Kn[0],ei=Kn[1];if(!Ge||!Je.length)return[mi,[],ei];var Si=Dt(mi),Wi=rn(),An=(0,Pn.S)(Si,!0,Wi),gn=An.checkedKeys,Rn=An.halfCheckedKeys;return[Xn(gn),Xn(Rn),ei]},[Ge,Je,rn,Xn,Ln])}var sn=kt(92310),jn=kt.n(sn),Te=Rt.memo(function(Ge){var Je=Ge.children;return Je},function(Ge,Je){return!Je.open}),Sn=Te;function ee(Ge){var Je,rn=Ge.prefixCls,Xn=Ge.checked,Ln=Ge.halfChecked,nn=Ge.disabled,Kn=Ge.onClick,mi=Ge.disableCheckbox,ei=Rt.useContext(ie),Si=ei.checkable,Wi=typeof Si!="boolean"?Si:null;return Rt.createElement("span",{className:jn()("".concat(rn),(Je={},(0,Bt.Z)(Je,"".concat(rn,"-checked"),Xn),(0,Bt.Z)(Je,"".concat(rn,"-indeterminate"),!Xn&&Ln),(0,Bt.Z)(Je,"".concat(rn,"-disabled"),nn||mi),Je)),onClick:Kn},Wi)}var Mn="__cascader_fix_label__";function ui(Ge){var Je=Ge.prefixCls,rn=Ge.multiple,Xn=Ge.options,Ln=Ge.activeValue,nn=Ge.prevValuePath,Kn=Ge.onToggleOpen,mi=Ge.onSelect,ei=Ge.onActive,Si=Ge.checkedSet,Wi=Ge.halfCheckedSet,An=Ge.loadingKeys,gn=Ge.isSelectable,Rn=Ge.disabled,si="".concat(Je,"-menu"),xi="".concat(Je,"-menu-item"),di=Rt.useContext(ie),Oi=di.fieldNames,wt=di.changeOnSelect,yn=di.expandTrigger,Wn=di.expandIcon,ki=di.loadingIcon,Ui=di.dropdownMenuColumnStyle,ur=di.optionRender,Mr=yn==="hover",gi=function(Se){return Rn||Se},bn=Rt.useMemo(function(){return Xn.map(function(pe){var Se,ve=pe.disabled,zn=pe.disableCheckbox,kn=pe[nt],Qn=(Se=pe[Mn])!==null&&Se!==void 0?Se:pe[Oi.label],$e=pe[Oi.value],On=Gt(pe,Oi),Fe=kn?kn.map(function(wn){return wn[Oi.value]}):[].concat((0,le.Z)(nn),[$e]),Pe=Tt(Fe),Zn=An.includes(Pe),$t=Si.has(Pe),Ze=Wi.has(Pe);return{disabled:ve,label:Qn,value:$e,isLeaf:On,isLoading:Zn,checked:$t,halfChecked:Ze,option:pe,disableCheckbox:zn,fullPath:Fe,fullPathKey:Pe}})},[Xn,Si,Oi,Wi,An,nn]);return Rt.createElement("ul",{className:si,role:"menu"},bn.map(function(pe){var Se,ve=pe.disabled,zn=pe.label,kn=pe.value,Qn=pe.isLeaf,$e=pe.isLoading,On=pe.checked,Fe=pe.halfChecked,Pe=pe.option,Zn=pe.fullPath,$t=pe.fullPathKey,Ze=pe.disableCheckbox,wn=function(){if(!gi(ve)){var Vn=(0,le.Z)(Zn);Mr&&Qn&&Vn.pop(),ei(Vn)}},ri=function(){gn(Pe)&&!gi(ve)&&mi(Zn,Qn)},We;return typeof Pe.title=="string"?We=Pe.title:typeof zn=="string"&&(We=zn),Rt.createElement("li",{key:$t,className:jn()(xi,(Se={},(0,Bt.Z)(Se,"".concat(xi,"-expand"),!Qn),(0,Bt.Z)(Se,"".concat(xi,"-active"),Ln===kn||Ln===$t),(0,Bt.Z)(Se,"".concat(xi,"-disabled"),gi(ve)),(0,Bt.Z)(Se,"".concat(xi,"-loading"),$e),Se)),style:Ui,role:"menuitemcheckbox",title:We,"aria-checked":On,"data-path-key":$t,onClick:function(){wn(),!Ze&&(!rn||Qn)&&ri()},onDoubleClick:function(){wt&&Kn(!1)},onMouseEnter:function(){Mr&&wn()},onMouseDown:function(Vn){Vn.preventDefault()}},rn&&Rt.createElement(ee,{prefixCls:"".concat(Je,"-checkbox"),checked:On,halfChecked:Fe,disabled:gi(ve)||Ze,disableCheckbox:Ze,onClick:function(Vn){Ze||(Vn.stopPropagation(),ri())}}),Rt.createElement("div",{className:"".concat(xi,"-content")},ur?ur(Pe):zn),!$e&&Wn&&!Qn&&Rt.createElement("div",{className:"".concat(xi,"-expand-icon")},Wn),$e&&ki&&Rt.createElement("div",{className:"".concat(xi,"-loading-icon")},ki))}))}var _t=function(Je,rn){var Xn=Rt.useContext(ie),Ln=Xn.values,nn=Ln[0],Kn=Rt.useState([]),mi=(0,Me.Z)(Kn,2),ei=mi[0],Si=mi[1];return Rt.useEffect(function(){Je||Si(nn||[])},[rn,nn]),[ei,Si]},Lt=_t,Pt=kt(10228),Nt=function(Ge,Je,rn,Xn,Ln,nn,Kn){var mi=Kn.direction,ei=Kn.searchValue,Si=Kn.toggleOpen,Wi=Kn.open,An=mi==="rtl",gn=Rt.useMemo(function(){for(var Ui=-1,ur=Je,Mr=[],gi=[],bn=Xn.length,pe=ae(Je,rn),Se=function($e){var On=ur.findIndex(function(Fe,Pe){return(pe[Pe]?Tt(pe[Pe]):Fe[rn.value])===Xn[$e]});if(On===-1)return 1;Ui=On,Mr.push(Ui),gi.push(Xn[$e]),ur=ur[Ui][rn.children]},ve=0;ve<bn&&ur&&!Se(ve);ve+=1);for(var zn=Je,kn=0;kn<Mr.length-1;kn+=1)zn=zn[Mr[kn]][rn.children];return[gi,Ui,zn,pe]},[Xn,rn,Je]),Rn=(0,Me.Z)(gn,4),si=Rn[0],xi=Rn[1],di=Rn[2],Oi=Rn[3],wt=function(ur){Ln(ur)},yn=function(ur){var Mr=di.length,gi=xi;gi===-1&&ur<0&&(gi=Mr);for(var bn=0;bn<Mr;bn+=1){gi=(gi+ur+Mr)%Mr;var pe=di[gi];if(pe&&!pe.disabled){var Se=si.slice(0,-1).concat(Oi[gi]?Tt(Oi[gi]):pe[rn.value]);wt(Se);return}}},Wn=function(){if(si.length>1){var ur=si.slice(0,-1);wt(ur)}else Si(!1)},ki=function(){var ur,Mr=((ur=di[xi])===null||ur===void 0?void 0:ur[rn.children])||[],gi=Mr.find(function(pe){return!pe.disabled});if(gi){var bn=[].concat((0,le.Z)(si),[gi[rn.value]]);wt(bn)}};Rt.useImperativeHandle(Ge,function(){return{onKeyDown:function(ur){var Mr=ur.which;switch(Mr){case Pt.Z.UP:case Pt.Z.DOWN:{var gi=0;Mr===Pt.Z.UP?gi=-1:Mr===Pt.Z.DOWN&&(gi=1),gi!==0&&yn(gi);break}case Pt.Z.LEFT:{if(ei)break;An?ki():Wn();break}case Pt.Z.RIGHT:{if(ei)break;An?Wn():ki();break}case Pt.Z.BACKSPACE:{ei||Wn();break}case Pt.Z.ENTER:{if(si.length){var bn=di[xi],pe=(bn==null?void 0:bn[nt])||[];pe.length?nn(pe.map(function(Se){return Se[rn.value]}),pe[pe.length-1]):nn(si,di[xi])}break}case Pt.Z.ESC:Si(!1),Wi&&ur.stopPropagation()}},onKeyUp:function(){}}})},zt=Rt.forwardRef(function(Ge,Je){var rn,Xn,Ln,nn=Ge.prefixCls,Kn=Ge.multiple,mi=Ge.searchValue,ei=Ge.toggleOpen,Si=Ge.notFoundContent,Wi=Ge.direction,An=Ge.open,gn=Ge.disabled,Rn=Rt.useRef(null),si=Wi==="rtl",xi=Rt.useContext(ie),di=xi.options,Oi=xi.values,wt=xi.halfValues,yn=xi.fieldNames,Wn=xi.changeOnSelect,ki=xi.onSelect,Ui=xi.searchOptions,ur=xi.dropdownPrefixCls,Mr=xi.loadData,gi=xi.expandTrigger,bn=ur||nn,pe=Rt.useState([]),Se=(0,Me.Z)(pe,2),ve=Se[0],zn=Se[1],kn=function(Bi){if(!(!Mr||mi)){var _i=tn(Bi,di,yn),Ki=_i.map(function(vr){var Xr=vr.option;return Xr}),en=Ki[Ki.length-1];if(en&&!Gt(en,yn)){var no=Tt(Bi);zn(function(vr){return[].concat((0,le.Z)(vr),[no])}),Mr(Ki)}}};Rt.useEffect(function(){ve.length&&ve.forEach(function(hi){var Bi=Jt(hi),_i=tn(Bi,di,yn,!0).map(function(en){var no=en.option;return no}),Ki=_i[_i.length-1];(!Ki||Ki[yn.children]||Gt(Ki,yn))&&zn(function(en){return en.filter(function(no){return no!==hi})})})},[di,ve,yn]);var Qn=Rt.useMemo(function(){return new Set(Dt(Oi))},[Oi]),$e=Rt.useMemo(function(){return new Set(Dt(wt))},[wt]),On=Lt(Kn,An),Fe=(0,Me.Z)(On,2),Pe=Fe[0],Zn=Fe[1],$t=function(Bi){Zn(Bi),kn(Bi)},Ze=function(Bi){if(gn)return!1;var _i=Bi.disabled,Ki=Gt(Bi,yn);return!_i&&(Ki||Wn||Kn)},wn=function(Bi,_i){var Ki=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;ki(Bi),!Kn&&(_i||Wn&&(gi==="hover"||Ki))&&ei(!1)},ri=Rt.useMemo(function(){return mi?Ui:di},[mi,Ui,di]),We=Rt.useMemo(function(){for(var hi=[{options:ri}],Bi=ri,_i=ae(Bi,yn),Ki=function(){var vr=Pe[en],Xr=Bi.find(function(Hn,Fi){return(_i[Fi]?Tt(_i[Fi]):Hn[yn.value])===vr}),He=Xr==null?void 0:Xr[yn.children];if(!(He!=null&&He.length))return 1;Bi=He,hi.push({options:He})},en=0;en<Pe.length&&!Ki();en+=1);return hi},[ri,Pe,yn]),je=function(Bi,_i){Ze(_i)&&wn(Bi,Gt(_i,yn),!0)};Nt(Je,ri,yn,Pe,$t,je,{direction:Wi,searchValue:mi,toggleOpen:ei,open:An}),Rt.useEffect(function(){if(!mi)for(var hi=0;hi<Pe.length;hi+=1){var Bi,_i=Pe.slice(0,hi+1),Ki=Tt(_i),en=(Bi=Rn.current)===null||Bi===void 0?void 0:Bi.querySelector('li[data-path-key="'.concat(Ki.replace(/\\{0,2}"/g,'\\"'),'"]'));en&&me(en)}},[Pe,mi]);var Vn=!((rn=We[0])!==null&&rn!==void 0&&(rn=rn.options)!==null&&rn!==void 0&&rn.length),ci=[(Xn={},(0,Bt.Z)(Xn,yn.value,"__EMPTY__"),(0,Bt.Z)(Xn,Mn,Si),(0,Bt.Z)(Xn,"disabled",!0),Xn)],Mi=(0,Ut.Z)((0,Ut.Z)({},Ge),{},{multiple:!Vn&&Kn,onSelect:wn,onActive:$t,onToggleOpen:ei,checkedSet:Qn,halfCheckedSet:$e,loadingKeys:ve,isSelectable:Ze}),pi=Vn?[{options:ci}]:We,oi=pi.map(function(hi,Bi){var _i=Pe.slice(0,Bi),Ki=Pe[Bi];return Rt.createElement(ui,(0,pt.Z)({key:Bi},Mi,{prefixCls:bn,options:hi.options,prevValuePath:_i,activeValue:Ki}))});return Rt.createElement(Sn,{open:An},Rt.createElement("div",{className:jn()("".concat(bn,"-menus"),(Ln={},(0,Bt.Z)(Ln,"".concat(bn,"-menu-empty"),Vn),(0,Bt.Z)(Ln,"".concat(bn,"-rtl"),si),Ln)),ref:Rn},oi))}),Mt=zt,Kt=Rt.forwardRef(function(Ge,Je){var rn=(0,It.lk)();return Rt.createElement(Mt,(0,pt.Z)({},Ge,rn,{ref:Je}))}),ye=Kt,Ue=kt(70425);function Qe(){}function ce(Ge){var Je,rn=Ge,Xn=rn.prefixCls,Ln=Xn===void 0?"rc-cascader":Xn,nn=rn.style,Kn=rn.className,mi=rn.options,ei=rn.checkable,Si=rn.defaultValue,Wi=rn.value,An=rn.fieldNames,gn=rn.changeOnSelect,Rn=rn.onChange,si=rn.showCheckedStrategy,xi=rn.loadData,di=rn.expandTrigger,Oi=rn.expandIcon,wt=Oi===void 0?">":Oi,yn=rn.loadingIcon,Wn=rn.direction,ki=rn.notFoundContent,Ui=ki===void 0?"Not Found":ki,ur=rn.disabled,Mr=!!ei,gi=(0,Ue.C8)(Si,{value:Wi,postState:Ce}),bn=(0,Me.Z)(gi,2),pe=bn[0],Se=bn[1],ve=Rt.useMemo(function(){return Yt(An)},[JSON.stringify(An)]),zn=Xt(ve,mi),kn=(0,Me.Z)(zn,3),Qn=kn[0],$e=kn[1],On=kn[2],Fe=an(Qn,ve),Pe=dn(Mr,pe,$e,On,Fe),Zn=(0,Me.Z)(Pe,3),$t=Zn[0],Ze=Zn[1],wn=Zn[2],ri=(0,Ue.zX)(function(pi){if(Se(pi),Rn){var oi=Ce(pi),hi=oi.map(function(Ki){return tn(Ki,Qn,ve).map(function(en){return en.option})}),Bi=Mr?oi:oi[0],_i=Mr?hi:hi[0];Rn(Bi,_i)}}),We=De(Mr,ri,$t,Ze,wn,$e,On,si),je=(0,Ue.zX)(function(pi){We(pi)}),Vn=Rt.useMemo(function(){return{options:Qn,fieldNames:ve,values:$t,halfValues:Ze,changeOnSelect:gn,onSelect:je,checkable:ei,searchOptions:[],dropdownPrefixCls:void 0,loadData:xi,expandTrigger:di,expandIcon:wt,loadingIcon:yn,dropdownMenuColumnStyle:void 0}},[Qn,ve,$t,Ze,gn,je,ei,xi,di,wt,yn]),ci="".concat(Ln,"-panel"),Mi=!Qn.length;return Rt.createElement(ie.Provider,{value:Vn},Rt.createElement("div",{className:jn()(ci,(Je={},(0,Bt.Z)(Je,"".concat(ci,"-rtl"),Wn==="rtl"),(0,Bt.Z)(Je,"".concat(ci,"-empty"),Mi),Je),Kn),style:nn},Mi?Ui:Rt.createElement(Mt,{prefixCls:Ln,searchValue:"",multiple:Mr,toggleOpen:Qe,open:!0,direction:Wn,disabled:ur})))}function Oe(Ge){var Je=Ge.onPopupVisibleChange,rn=Ge.popupVisible,Xn=Ge.popupClassName,Ln=Ge.popupPlacement;warning(!Je,"`onPopupVisibleChange` is deprecated. Please use `onDropdownVisibleChange` instead."),warning(rn===void 0,"`popupVisible` is deprecated. Please use `open` instead."),warning(Xn===void 0,"`popupClassName` is deprecated. Please use `dropdownClassName` instead."),warning(Ln===void 0,"`popupPlacement` is deprecated. Please use `placement` instead.")}function Le(Ge,Je){if(Ge){var rn=function Xn(Ln){for(var nn=0;nn<Ln.length;nn++){var Kn=Ln[nn];if(Kn[Je==null?void 0:Je.value]===null)return warning(!1,"`value` in Cascader options should not be `null`."),!0;if(Array.isArray(Kn[Je==null?void 0:Je.children])&&Xn(Kn[Je==null?void 0:Je.children]))return!0}};rn(Ge)}}var Xe=null,vn=["id","prefixCls","fieldNames","defaultValue","value","changeOnSelect","onChange","displayRender","checkable","autoClearSearchValue","searchValue","onSearch","showSearch","expandTrigger","options","dropdownPrefixCls","loadData","popupVisible","open","popupClassName","dropdownClassName","dropdownMenuColumnStyle","dropdownStyle","popupPlacement","placement","onDropdownVisibleChange","onPopupVisibleChange","expandIcon","loadingIcon","children","dropdownMatchSelectWidth","showCheckedStrategy","optionRender"],cn=Rt.forwardRef(function(Ge,Je){var rn=Ge.id,Xn=Ge.prefixCls,Ln=Xn===void 0?"rc-cascader":Xn,nn=Ge.fieldNames,Kn=Ge.defaultValue,mi=Ge.value,ei=Ge.changeOnSelect,Si=Ge.onChange,Wi=Ge.displayRender,An=Ge.checkable,gn=Ge.autoClearSearchValue,Rn=gn===void 0?!0:gn,si=Ge.searchValue,xi=Ge.onSearch,di=Ge.showSearch,Oi=Ge.expandTrigger,wt=Ge.options,yn=Ge.dropdownPrefixCls,Wn=Ge.loadData,ki=Ge.popupVisible,Ui=Ge.open,ur=Ge.popupClassName,Mr=Ge.dropdownClassName,gi=Ge.dropdownMenuColumnStyle,bn=Ge.dropdownStyle,pe=Ge.popupPlacement,Se=Ge.placement,ve=Ge.onDropdownVisibleChange,zn=Ge.onPopupVisibleChange,kn=Ge.expandIcon,Qn=kn===void 0?">":kn,$e=Ge.loadingIcon,On=Ge.children,Fe=Ge.dropdownMatchSelectWidth,Pe=Fe===void 0?!1:Fe,Zn=Ge.showCheckedStrategy,$t=Zn===void 0?St:Zn,Ze=Ge.optionRender,wn=(0,ue.Z)(Ge,vn),ri=(0,qt.ZP)(rn),We=!!An,je=(0,ne.Z)(Kn,{value:mi,postState:Ce}),Vn=(0,Me.Z)(je,2),ci=Vn[0],Mi=Vn[1],pi=Rt.useMemo(function(){return Yt(nn)},[JSON.stringify(nn)]),oi=Xt(pi,wt),hi=(0,Me.Z)(oi,3),Bi=hi[0],_i=hi[1],Ki=hi[2],en=(0,ne.Z)("",{value:si,postState:function(Yn){return Yn||""}}),no=(0,Me.Z)(en,2),vr=no[0],Xr=no[1],He=function(Yn,ai){Xr(Yn),ai.source!=="blur"&&xi&&xi(Yn)},Hn=_n(di),Fi=(0,Me.Z)(Hn,2),Hi=Fi[0],Ii=Fi[1],Yi=gt(vr,Bi,pi,yn||Ln,Ii,ei||We),Ar=an(Bi,pi),Pr=dn(We,ci,_i,Ki,Ar),Br=(0,Me.Z)(Pr,3),Fr=Br[0],fn=Br[1],io=Br[2],pn=Rt.useMemo(function(){var Nn=Dt(Fr),Yn=we(Nn,_i,$t);return[].concat((0,le.Z)(io),(0,le.Z)(Ki(Yn)))},[Fr,_i,Ki,io,$t]),Di=_e(pn,Bi,pi,We,Wi),$i=(0,ge.Z)(function(Nn){if(Mi(Nn),Si){var Yn=Ce(Nn),ai=Yn.map(function($n){return tn($n,Bi,pi).map(function(ti){return ti.option})}),vi=We?Yn:Yn[0],Cn=We?ai:ai[0];Si(vi,Cn)}}),Ai=De(We,$i,Fr,fn,io,_i,Ki,$t),bo=(0,ge.Z)(function(Nn){(!We||Rn)&&Xr(""),Ai(Nn)}),Fo=function(Yn,ai){if(ai.type==="clear"){$i([]);return}var vi=ai.values[0],Cn=vi.valueCells;bo(Cn)},ao=Ui!==void 0?Ui:ki,co=Mr||ur,Re=Se||pe,mn=function(Yn){ve==null||ve(Yn),zn==null||zn(Yn)},Ie=Rt.useMemo(function(){return{options:Bi,fieldNames:pi,values:Fr,halfValues:fn,changeOnSelect:ei,onSelect:bo,checkable:An,searchOptions:Yi,dropdownPrefixCls:yn,loadData:Wn,expandTrigger:Oi,expandIcon:Qn,loadingIcon:$e,dropdownMenuColumnStyle:gi,optionRender:Ze}},[Bi,pi,Fr,fn,ei,bo,An,Yi,yn,Wn,Oi,Qn,$e,gi,Ze]),At=!(vr?Yi:Bi).length,Un=vr&&Ii.matchInputWidth||At?{}:{minWidth:"auto"};return Rt.createElement(ie.Provider,{value:Ie},Rt.createElement(It.Ac,(0,pt.Z)({},wn,{ref:Je,id:ri,prefixCls:Ln,autoClearSearchValue:Rn,dropdownMatchSelectWidth:Pe,dropdownStyle:(0,Ut.Z)((0,Ut.Z)({},Un),bn),displayValues:Di,onDisplayValuesChange:Fo,mode:We?"multiple":void 0,searchValue:vr,onSearch:He,showSearch:Hi,OptionList:ye,emptyOptions:At,open:ao,dropdownClassName:co,placement:Re,onDropdownVisibleChange:mn,getRawInputElement:function(){return On}})))});cn.SHOW_PARENT=St,cn.SHOW_CHILD=Et,cn.Panel=ce;var hn=cn,Ti=hn},98535:function(Dn,Gn,kt){"use strict";kt.r(Gn),kt.d(Gn,{Panel:function(){return Ce},default:function(){return Ne}});var pt=kt(72308),Ut=kt(80702),le=kt(52487),Me=kt(62853),ue=kt(92310),It=kt.n(ue),qt=kt(18929),ge=kt(48736),ne=kt(59301),Rt=kt(74416),Ae=kt(11592),ie=kt(77321),Ee=kt(49618),Bt=kt(77900),nt=kt(10228),et=ne.forwardRef(function(we,tn){var _e=we.prefixCls,an=we.forceRender,Ke=we.className,oe=we.style,Xt=we.children,qe=we.isActive,_n=we.role,Pn=we.classNames,De=we.styles,dn=ne.useState(qe||an),sn=(0,le.Z)(dn,2),jn=sn[0],Te=sn[1];return ne.useEffect(function(){(an||qe)&&Te(!0)},[an,qe]),jn?ne.createElement("div",{ref:tn,className:It()("".concat(_e,"-content"),(0,Ee.Z)((0,Ee.Z)({},"".concat(_e,"-content-active"),qe),"".concat(_e,"-content-inactive"),!qe),Ke),style:oe,role:_n},ne.createElement("div",{className:It()("".concat(_e,"-content-box"),Pn==null?void 0:Pn.body),style:De==null?void 0:De.body},Xt)):null});et.displayName="PanelContent";var ht=et,st=["showArrow","headerClass","isActive","onItemClick","forceRender","className","classNames","styles","prefixCls","collapsible","accordion","panelKey","extra","header","expandIcon","openMotion","destroyInactivePanel","children"],gt=ne.forwardRef(function(we,tn){var _e=we.showArrow,an=_e===void 0?!0:_e,Ke=we.headerClass,oe=we.isActive,Xt=we.onItemClick,qe=we.forceRender,_n=we.className,Pn=we.classNames,De=Pn===void 0?{}:Pn,dn=we.styles,sn=dn===void 0?{}:dn,jn=we.prefixCls,Te=we.collapsible,Sn=we.accordion,ee=we.panelKey,Mn=we.extra,ui=we.header,_t=we.expandIcon,Lt=we.openMotion,Pt=we.destroyInactivePanel,Nt=we.children,zt=(0,Rt.Z)(we,st),Mt=Te==="disabled",Kt=Mn!=null&&typeof Mn!="boolean",ye=(0,Ee.Z)((0,Ee.Z)((0,Ee.Z)({onClick:function(){Xt==null||Xt(ee)},onKeyDown:function(vn){(vn.key==="Enter"||vn.keyCode===nt.Z.ENTER||vn.which===nt.Z.ENTER)&&(Xt==null||Xt(ee))},role:Sn?"tab":"button"},"aria-expanded",oe),"aria-disabled",Mt),"tabIndex",Mt?-1:0),Ue=typeof _t=="function"?_t(we):ne.createElement("i",{className:"arrow"}),Qe=Ue&&ne.createElement("div",(0,pt.Z)({className:"".concat(jn,"-expand-icon")},["header","icon"].includes(Te)?ye:{}),Ue),ce=It()("".concat(jn,"-item"),(0,Ee.Z)((0,Ee.Z)({},"".concat(jn,"-item-active"),oe),"".concat(jn,"-item-disabled"),Mt),_n),Oe=It()(Ke,"".concat(jn,"-header"),(0,Ee.Z)({},"".concat(jn,"-collapsible-").concat(Te),!!Te),De.header),Le=(0,ie.Z)({className:Oe,style:sn.header},["header","icon"].includes(Te)?{}:ye);return ne.createElement("div",(0,pt.Z)({},zt,{ref:tn,className:ce}),ne.createElement("div",Le,an&&Qe,ne.createElement("span",(0,pt.Z)({className:"".concat(jn,"-header-text")},Te==="header"?ye:{}),ui),Kt&&ne.createElement("div",{className:"".concat(jn,"-extra")},Mn)),ne.createElement(Bt.default,(0,pt.Z)({visible:oe,leavedClassName:"".concat(jn,"-content-hidden")},Lt,{forceRender:qe,removeOnLeave:Pt}),function(Xe,vn){var cn=Xe.className,hn=Xe.style;return ne.createElement(ht,{ref:vn,prefixCls:jn,className:cn,classNames:De,style:hn,styles:sn,isActive:oe,forceRender:qe,role:Sn?"tabpanel":void 0},Nt)}))}),vt=gt,St=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],Et=function(tn,_e){var an=_e.prefixCls,Ke=_e.accordion,oe=_e.collapsible,Xt=_e.destroyInactivePanel,qe=_e.onItemClick,_n=_e.activeKey,Pn=_e.openMotion,De=_e.expandIcon;return tn.map(function(dn,sn){var jn=dn.children,Te=dn.label,Sn=dn.key,ee=dn.collapsible,Mn=dn.onItemClick,ui=dn.destroyInactivePanel,_t=(0,Rt.Z)(dn,St),Lt=String(Sn!=null?Sn:sn),Pt=ee!=null?ee:oe,Nt=ui!=null?ui:Xt,zt=function(ye){Pt!=="disabled"&&(qe(ye),Mn==null||Mn(ye))},Mt=!1;return Ke?Mt=_n[0]===Lt:Mt=_n.indexOf(Lt)>-1,ne.createElement(vt,(0,pt.Z)({},_t,{prefixCls:an,key:Lt,panelKey:Lt,isActive:Mt,accordion:Ke,openMotion:Pn,expandIcon:De,header:Te,collapsible:Pt,onItemClick:zt,destroyInactivePanel:Nt}),jn)})},Tt=function(tn,_e,an){if(!tn)return null;var Ke=an.prefixCls,oe=an.accordion,Xt=an.collapsible,qe=an.destroyInactivePanel,_n=an.onItemClick,Pn=an.activeKey,De=an.openMotion,dn=an.expandIcon,sn=tn.key||String(_e),jn=tn.props,Te=jn.header,Sn=jn.headerClass,ee=jn.destroyInactivePanel,Mn=jn.collapsible,ui=jn.onItemClick,_t=!1;oe?_t=Pn[0]===sn:_t=Pn.indexOf(sn)>-1;var Lt=Mn!=null?Mn:Xt,Pt=function(Mt){Lt!=="disabled"&&(_n(Mt),ui==null||ui(Mt))},Nt={key:sn,panelKey:sn,header:Te,headerClass:Sn,isActive:_t,prefixCls:Ke,destroyInactivePanel:ee!=null?ee:qe,openMotion:De,accordion:oe,children:tn.props.children,onItemClick:Pt,expandIcon:dn,collapsible:Lt};return typeof tn.type=="string"?tn:(Object.keys(Nt).forEach(function(zt){typeof Nt[zt]=="undefined"&&delete Nt[zt]}),ne.cloneElement(tn,Nt))};function Dt(we,tn,_e){return Array.isArray(we)?Et(we,_e):(0,Ae.Z)(tn).map(function(an,Ke){return Tt(an,Ke,_e)})}var Jt=Dt,Yt=kt(26112);function Gt(we){var tn=we;if(!Array.isArray(tn)){var _e=(0,Me.Z)(tn);tn=_e==="number"||_e==="string"?[tn]:[]}return tn.map(function(an){return String(an)})}var me=ne.forwardRef(function(we,tn){var _e=we.prefixCls,an=_e===void 0?"rc-collapse":_e,Ke=we.destroyInactivePanel,oe=Ke===void 0?!1:Ke,Xt=we.style,qe=we.accordion,_n=we.className,Pn=we.children,De=we.collapsible,dn=we.openMotion,sn=we.expandIcon,jn=we.activeKey,Te=we.defaultActiveKey,Sn=we.onChange,ee=we.items,Mn=It()(an,_n),ui=(0,qt.Z)([],{value:jn,onChange:function(Kt){return Sn==null?void 0:Sn(Kt)},defaultValue:Te,postState:Gt}),_t=(0,le.Z)(ui,2),Lt=_t[0],Pt=_t[1],Nt=function(Kt){return Pt(function(){if(qe)return Lt[0]===Kt?[]:[Kt];var ye=Lt.indexOf(Kt),Ue=ye>-1;return Ue?Lt.filter(function(Qe){return Qe!==Kt}):[].concat((0,Ut.Z)(Lt),[Kt])})};(0,ge.ZP)(!Pn,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var zt=Jt(ee,Pn,{prefixCls:an,accordion:qe,openMotion:dn,expandIcon:sn,collapsible:De,destroyInactivePanel:oe,onItemClick:Nt,activeKey:Lt});return ne.createElement("div",(0,pt.Z)({ref:tn,className:Mn,style:Xt,role:qe?"tablist":void 0},(0,Yt.Z)(we,{aria:!0,data:!0})),zt)}),ae=Object.assign(me,{Panel:vt}),Ne=ae,Ce=ae.Panel},23425:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Z:function(){return Dt}});var pt=kt(49618),Ut=kt(72308),le=kt(62853),Me=kt(77321),ue=kt(52487),It=kt(92310),qt=kt.n(It),ge=kt(18929),ne=kt(10228),Rt=kt(26112),Ae=kt(48736),ie=kt(59301),Ee=kt(17119),Bt=[10,20,50,100],nt=function(Yt){var Gt=Yt.pageSizeOptions,me=Gt===void 0?Bt:Gt,ae=Yt.locale,Ne=Yt.changeSize,Ce=Yt.pageSize,we=Yt.goButton,tn=Yt.quickGo,_e=Yt.rootPrefixCls,an=Yt.disabled,Ke=Yt.buildOptionText,oe=Yt.showSizeChanger,Xt=Yt.sizeChangerRender,qe=ie.useState(""),_n=(0,ue.Z)(qe,2),Pn=_n[0],De=_n[1],dn=function(){return!Pn||Number.isNaN(Pn)?void 0:Number(Pn)},sn=typeof Ke=="function"?Ke:function(Pt){return"".concat(Pt," ").concat(ae.items_per_page)},jn=function(Nt){De(Nt.target.value)},Te=function(Nt){we||Pn===""||(De(""),!(Nt.relatedTarget&&(Nt.relatedTarget.className.indexOf("".concat(_e,"-item-link"))>=0||Nt.relatedTarget.className.indexOf("".concat(_e,"-item"))>=0))&&(tn==null||tn(dn())))},Sn=function(Nt){Pn!==""&&(Nt.keyCode===ne.Z.ENTER||Nt.type==="click")&&(De(""),tn==null||tn(dn()))},ee=function(){return me.some(function(Nt){return Nt.toString()===Ce.toString()})?me:me.concat([Ce]).sort(function(Nt,zt){var Mt=Number.isNaN(Number(Nt))?0:Number(Nt),Kt=Number.isNaN(Number(zt))?0:Number(zt);return Mt-Kt})},Mn="".concat(_e,"-options");if(!oe&&!tn)return null;var ui=null,_t=null,Lt=null;return oe&&Xt&&(ui=Xt({disabled:an,size:Ce,onSizeChange:function(Nt){Ne==null||Ne(Number(Nt))},"aria-label":ae.page_size,className:"".concat(Mn,"-size-changer"),options:ee().map(function(Pt){return{label:sn(Pt),value:Pt}})})),tn&&(we&&(Lt=typeof we=="boolean"?ie.createElement("button",{type:"button",onClick:Sn,onKeyUp:Sn,disabled:an,className:"".concat(Mn,"-quick-jumper-button")},ae.jump_to_confirm):ie.createElement("span",{onClick:Sn,onKeyUp:Sn},we)),_t=ie.createElement("div",{className:"".concat(Mn,"-quick-jumper")},ae.jump_to,ie.createElement("input",{disabled:an,type:"text",value:Pn,onChange:jn,onKeyUp:Sn,onBlur:Te,"aria-label":ae.page}),ae.page,Lt)),ie.createElement("li",{className:Mn},ui,_t)},et=nt,ht=function(Yt){var Gt=Yt.rootPrefixCls,me=Yt.page,ae=Yt.active,Ne=Yt.className,Ce=Yt.showTitle,we=Yt.onClick,tn=Yt.onKeyPress,_e=Yt.itemRender,an="".concat(Gt,"-item"),Ke=qt()(an,"".concat(an,"-").concat(me),(0,pt.Z)((0,pt.Z)({},"".concat(an,"-active"),ae),"".concat(an,"-disabled"),!me),Ne),oe=function(){we(me)},Xt=function(Pn){tn(Pn,we,me)},qe=_e(me,"page",ie.createElement("a",{rel:"nofollow"},me));return qe?ie.createElement("li",{title:Ce?String(me):null,className:Ke,onClick:oe,onKeyDown:Xt,tabIndex:0},qe):null},st=ht,gt=function(Yt,Gt,me){return me};function vt(){}function St(Jt){var Yt=Number(Jt);return typeof Yt=="number"&&!Number.isNaN(Yt)&&isFinite(Yt)&&Math.floor(Yt)===Yt}function Et(Jt,Yt,Gt){var me=typeof Jt=="undefined"?Yt:Jt;return Math.floor((Gt-1)/me)+1}var Tt=function(Yt){var Gt=Yt.prefixCls,me=Gt===void 0?"rc-pagination":Gt,ae=Yt.selectPrefixCls,Ne=ae===void 0?"rc-select":ae,Ce=Yt.className,we=Yt.current,tn=Yt.defaultCurrent,_e=tn===void 0?1:tn,an=Yt.total,Ke=an===void 0?0:an,oe=Yt.pageSize,Xt=Yt.defaultPageSize,qe=Xt===void 0?10:Xt,_n=Yt.onChange,Pn=_n===void 0?vt:_n,De=Yt.hideOnSinglePage,dn=Yt.align,sn=Yt.showPrevNextJumpers,jn=sn===void 0?!0:sn,Te=Yt.showQuickJumper,Sn=Yt.showLessItems,ee=Yt.showTitle,Mn=ee===void 0?!0:ee,ui=Yt.onShowSizeChange,_t=ui===void 0?vt:ui,Lt=Yt.locale,Pt=Lt===void 0?Ee.Z:Lt,Nt=Yt.style,zt=Yt.totalBoundaryShowSizeChanger,Mt=zt===void 0?50:zt,Kt=Yt.disabled,ye=Yt.simple,Ue=Yt.showTotal,Qe=Yt.showSizeChanger,ce=Qe===void 0?Ke>Mt:Qe,Oe=Yt.sizeChangerRender,Le=Yt.pageSizeOptions,Xe=Yt.itemRender,vn=Xe===void 0?gt:Xe,cn=Yt.jumpPrevIcon,hn=Yt.jumpNextIcon,Ti=Yt.prevIcon,Ge=Yt.nextIcon,Je=ie.useRef(null),rn=(0,ge.Z)(10,{value:oe,defaultValue:qe}),Xn=(0,ue.Z)(rn,2),Ln=Xn[0],nn=Xn[1],Kn=(0,ge.Z)(1,{value:we,defaultValue:_e,postState:function($i){return Math.max(1,Math.min($i,Et(void 0,Ln,Ke)))}}),mi=(0,ue.Z)(Kn,2),ei=mi[0],Si=mi[1],Wi=ie.useState(ei),An=(0,ue.Z)(Wi,2),gn=An[0],Rn=An[1];(0,ie.useEffect)(function(){Rn(ei)},[ei]);var si=Pn!==vt,xi="current"in Yt,di=Math.max(1,ei-(Sn?3:5)),Oi=Math.min(Et(void 0,Ln,Ke),ei+(Sn?3:5));function wt(Di,$i){var Ai=Di||ie.createElement("button",{type:"button","aria-label":$i,className:"".concat(me,"-item-link")});return typeof Di=="function"&&(Ai=ie.createElement(Di,(0,Me.Z)({},Yt))),Ai}function yn(Di){var $i=Di.target.value,Ai=Et(void 0,Ln,Ke),bo;return $i===""?bo=$i:Number.isNaN(Number($i))?bo=gn:$i>=Ai?bo=Ai:bo=Number($i),bo}function Wn(Di){return St(Di)&&Di!==ei&&St(Ke)&&Ke>0}var ki=Ke>Ln?Te:!1;function Ui(Di){(Di.keyCode===ne.Z.UP||Di.keyCode===ne.Z.DOWN)&&Di.preventDefault()}function ur(Di){var $i=yn(Di);switch($i!==gn&&Rn($i),Di.keyCode){case ne.Z.ENTER:bn($i);break;case ne.Z.UP:bn($i-1);break;case ne.Z.DOWN:bn($i+1);break;default:break}}function Mr(Di){bn(yn(Di))}function gi(Di){var $i=Et(Di,Ln,Ke),Ai=ei>$i&&$i!==0?$i:ei;nn(Di),Rn(Ai),_t==null||_t(ei,Di),Si(Ai),Pn==null||Pn(Ai,Di)}function bn(Di){if(Wn(Di)&&!Kt){var $i=Et(void 0,Ln,Ke),Ai=Di;return Di>$i?Ai=$i:Di<1&&(Ai=1),Ai!==gn&&Rn(Ai),Si(Ai),Pn==null||Pn(Ai,Ln),Ai}return ei}var pe=ei>1,Se=ei<Et(void 0,Ln,Ke);function ve(){pe&&bn(ei-1)}function zn(){Se&&bn(ei+1)}function kn(){bn(di)}function Qn(){bn(Oi)}function $e(Di,$i){if(Di.key==="Enter"||Di.charCode===ne.Z.ENTER||Di.keyCode===ne.Z.ENTER){for(var Ai=arguments.length,bo=new Array(Ai>2?Ai-2:0),Fo=2;Fo<Ai;Fo++)bo[Fo-2]=arguments[Fo];$i.apply(void 0,bo)}}function On(Di){$e(Di,ve)}function Fe(Di){$e(Di,zn)}function Pe(Di){$e(Di,kn)}function Zn(Di){$e(Di,Qn)}function $t(Di){var $i=vn(Di,"prev",wt(Ti,"prev page"));return ie.isValidElement($i)?ie.cloneElement($i,{disabled:!pe}):$i}function Ze(Di){var $i=vn(Di,"next",wt(Ge,"next page"));return ie.isValidElement($i)?ie.cloneElement($i,{disabled:!Se}):$i}function wn(Di){(Di.type==="click"||Di.keyCode===ne.Z.ENTER)&&bn(gn)}var ri=null,We=(0,Rt.Z)(Yt,{aria:!0,data:!0}),je=Ue&&ie.createElement("li",{className:"".concat(me,"-total-text")},Ue(Ke,[Ke===0?0:(ei-1)*Ln+1,ei*Ln>Ke?Ke:ei*Ln])),Vn=null,ci=Et(void 0,Ln,Ke);if(De&&Ke<=Ln)return null;var Mi=[],pi={rootPrefixCls:me,onClick:bn,onKeyPress:$e,showTitle:Mn,itemRender:vn,page:-1},oi=ei-1>0?ei-1:0,hi=ei+1<ci?ei+1:ci,Bi=Te&&Te.goButton,_i=(0,le.Z)(ye)==="object"?ye.readOnly:!ye,Ki=Bi,en=null;ye&&(Bi&&(typeof Bi=="boolean"?Ki=ie.createElement("button",{type:"button",onClick:wn,onKeyUp:wn},Pt.jump_to_confirm):Ki=ie.createElement("span",{onClick:wn,onKeyUp:wn},Bi),Ki=ie.createElement("li",{title:Mn?"".concat(Pt.jump_to).concat(ei,"/").concat(ci):null,className:"".concat(me,"-simple-pager")},Ki)),en=ie.createElement("li",{title:Mn?"".concat(ei,"/").concat(ci):null,className:"".concat(me,"-simple-pager")},_i?gn:ie.createElement("input",{type:"text","aria-label":Pt.jump_to,value:gn,disabled:Kt,onKeyDown:Ui,onKeyUp:ur,onChange:ur,onBlur:Mr,size:3}),ie.createElement("span",{className:"".concat(me,"-slash")},"/"),ci));var no=Sn?1:2;if(ci<=3+no*2){ci||Mi.push(ie.createElement(st,(0,Ut.Z)({},pi,{key:"noPager",page:1,className:"".concat(me,"-item-disabled")})));for(var vr=1;vr<=ci;vr+=1)Mi.push(ie.createElement(st,(0,Ut.Z)({},pi,{key:vr,page:vr,active:ei===vr})))}else{var Xr=Sn?Pt.prev_3:Pt.prev_5,He=Sn?Pt.next_3:Pt.next_5,Hn=vn(di,"jump-prev",wt(cn,"prev page")),Fi=vn(Oi,"jump-next",wt(hn,"next page"));jn&&(ri=Hn?ie.createElement("li",{title:Mn?Xr:null,key:"prev",onClick:kn,tabIndex:0,onKeyDown:Pe,className:qt()("".concat(me,"-jump-prev"),(0,pt.Z)({},"".concat(me,"-jump-prev-custom-icon"),!!cn))},Hn):null,Vn=Fi?ie.createElement("li",{title:Mn?He:null,key:"next",onClick:Qn,tabIndex:0,onKeyDown:Zn,className:qt()("".concat(me,"-jump-next"),(0,pt.Z)({},"".concat(me,"-jump-next-custom-icon"),!!hn))},Fi):null);var Hi=Math.max(1,ei-no),Ii=Math.min(ei+no,ci);ei-1<=no&&(Ii=1+no*2),ci-ei<=no&&(Hi=ci-no*2);for(var Yi=Hi;Yi<=Ii;Yi+=1)Mi.push(ie.createElement(st,(0,Ut.Z)({},pi,{key:Yi,page:Yi,active:ei===Yi})));if(ei-1>=no*2&&ei!==3&&(Mi[0]=ie.cloneElement(Mi[0],{className:qt()("".concat(me,"-item-after-jump-prev"),Mi[0].props.className)}),Mi.unshift(ri)),ci-ei>=no*2&&ei!==ci-2){var Ar=Mi[Mi.length-1];Mi[Mi.length-1]=ie.cloneElement(Ar,{className:qt()("".concat(me,"-item-before-jump-next"),Ar.props.className)}),Mi.push(Vn)}Hi!==1&&Mi.unshift(ie.createElement(st,(0,Ut.Z)({},pi,{key:1,page:1}))),Ii!==ci&&Mi.push(ie.createElement(st,(0,Ut.Z)({},pi,{key:ci,page:ci})))}var Pr=$t(oi);if(Pr){var Br=!pe||!ci;Pr=ie.createElement("li",{title:Mn?Pt.prev_page:null,onClick:ve,tabIndex:Br?null:0,onKeyDown:On,className:qt()("".concat(me,"-prev"),(0,pt.Z)({},"".concat(me,"-disabled"),Br)),"aria-disabled":Br},Pr)}var Fr=Ze(hi);if(Fr){var fn,io;ye?(fn=!Se,io=pe?0:null):(fn=!Se||!ci,io=fn?null:0),Fr=ie.createElement("li",{title:Mn?Pt.next_page:null,onClick:zn,tabIndex:io,onKeyDown:Fe,className:qt()("".concat(me,"-next"),(0,pt.Z)({},"".concat(me,"-disabled"),fn)),"aria-disabled":fn},Fr)}var pn=qt()(me,Ce,(0,pt.Z)((0,pt.Z)((0,pt.Z)((0,pt.Z)((0,pt.Z)({},"".concat(me,"-start"),dn==="start"),"".concat(me,"-center"),dn==="center"),"".concat(me,"-end"),dn==="end"),"".concat(me,"-simple"),ye),"".concat(me,"-disabled"),Kt));return ie.createElement("ul",(0,Ut.Z)({className:pn,style:Nt,ref:Je},We),je,Pr,ye?en:Mi,Fr,ie.createElement(et,{locale:Pt,rootPrefixCls:me,disabled:Kt,selectPrefixCls:Ne,changeSize:gi,pageSize:Ln,pageSizeOptions:Le,quickGo:ki?bn:null,goButton:Ki,showSizeChanger:ce,sizeChangerRender:Oe}))},Dt=Tt},738:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Z:function(){return vt}});var pt=kt(72308),Ut=kt(49618),le=kt(52487),Me=kt(74416),ue=kt(92310),It=kt.n(ue),qt=kt(18929),ge=kt(10228),ne=kt(26112),Rt=kt(59301);function Ae(St,Et){var Tt=St.disabled,Dt=St.prefixCls,Jt=St.character,Yt=St.characterRender,Gt=St.index,me=St.count,ae=St.value,Ne=St.allowHalf,Ce=St.focused,we=St.onHover,tn=St.onClick,_e=function(De){we(De,Gt)},an=function(De){tn(De,Gt)},Ke=function(De){De.keyCode===ge.Z.ENTER&&tn(De,Gt)},oe=Gt+1,Xt=new Set([Dt]);ae===0&&Gt===0&&Ce?Xt.add("".concat(Dt,"-focused")):Ne&&ae+.5>=oe&&ae<oe?(Xt.add("".concat(Dt,"-half")),Xt.add("".concat(Dt,"-active")),Ce&&Xt.add("".concat(Dt,"-focused"))):(oe<=ae?Xt.add("".concat(Dt,"-full")):Xt.add("".concat(Dt,"-zero")),oe===ae&&Ce&&Xt.add("".concat(Dt,"-focused")));var qe=typeof Jt=="function"?Jt(St):Jt,_n=Rt.createElement("li",{className:It()(Array.from(Xt)),ref:Et},Rt.createElement("div",{onClick:Tt?null:an,onKeyDown:Tt?null:Ke,onMouseMove:Tt?null:_e,role:"radio","aria-checked":ae>Gt?"true":"false","aria-posinset":Gt+1,"aria-setsize":me,tabIndex:Tt?-1:0},Rt.createElement("div",{className:"".concat(Dt,"-first")},qe),Rt.createElement("div",{className:"".concat(Dt,"-second")},qe)));return Yt&&(_n=Yt(_n,St)),_n}var ie=Rt.forwardRef(Ae);function Ee(){var St=Rt.useRef({});function Et(Dt){return St.current[Dt]}function Tt(Dt){return function(Jt){St.current[Dt]=Jt}}return[Et,Tt]}function Bt(St){var Et=St.pageXOffset,Tt="scrollLeft";if(typeof Et!="number"){var Dt=St.document;Et=Dt.documentElement[Tt],typeof Et!="number"&&(Et=Dt.body[Tt])}return Et}function nt(St){var Et,Tt,Dt=St.ownerDocument,Jt=Dt.body,Yt=Dt&&Dt.documentElement,Gt=St.getBoundingClientRect();return Et=Gt.left,Tt=Gt.top,Et-=Yt.clientLeft||Jt.clientLeft||0,Tt-=Yt.clientTop||Jt.clientTop||0,{left:Et,top:Tt}}function et(St){var Et=nt(St),Tt=St.ownerDocument,Dt=Tt.defaultView||Tt.parentWindow;return Et.left+=Bt(Dt),Et.left}var ht=["prefixCls","className","defaultValue","value","count","allowHalf","allowClear","keyboard","character","characterRender","disabled","direction","tabIndex","autoFocus","onHoverChange","onChange","onFocus","onBlur","onKeyDown","onMouseLeave"];function st(St,Et){var Tt=St.prefixCls,Dt=Tt===void 0?"rc-rate":Tt,Jt=St.className,Yt=St.defaultValue,Gt=St.value,me=St.count,ae=me===void 0?5:me,Ne=St.allowHalf,Ce=Ne===void 0?!1:Ne,we=St.allowClear,tn=we===void 0?!0:we,_e=St.keyboard,an=_e===void 0?!0:_e,Ke=St.character,oe=Ke===void 0?"\u2605":Ke,Xt=St.characterRender,qe=St.disabled,_n=St.direction,Pn=_n===void 0?"ltr":_n,De=St.tabIndex,dn=De===void 0?0:De,sn=St.autoFocus,jn=St.onHoverChange,Te=St.onChange,Sn=St.onFocus,ee=St.onBlur,Mn=St.onKeyDown,ui=St.onMouseLeave,_t=(0,Me.Z)(St,ht),Lt=Ee(),Pt=(0,le.Z)(Lt,2),Nt=Pt[0],zt=Pt[1],Mt=Rt.useRef(null),Kt=function(){if(!qe){var di;(di=Mt.current)===null||di===void 0||di.focus()}};Rt.useImperativeHandle(Et,function(){return{focus:Kt,blur:function(){if(!qe){var di;(di=Mt.current)===null||di===void 0||di.blur()}}}});var ye=(0,qt.Z)(Yt||0,{value:Gt}),Ue=(0,le.Z)(ye,2),Qe=Ue[0],ce=Ue[1],Oe=(0,qt.Z)(null),Le=(0,le.Z)(Oe,2),Xe=Le[0],vn=Le[1],cn=function(di,Oi){var wt=Pn==="rtl",yn=di+1;if(Ce){var Wn=Nt(di),ki=et(Wn),Ui=Wn.clientWidth;(wt&&Oi-ki>Ui/2||!wt&&Oi-ki<Ui/2)&&(yn-=.5)}return yn},hn=function(di){ce(di),Te==null||Te(di)},Ti=Rt.useState(!1),Ge=(0,le.Z)(Ti,2),Je=Ge[0],rn=Ge[1],Xn=function(){rn(!0),Sn==null||Sn()},Ln=function(){rn(!1),ee==null||ee()},nn=Rt.useState(null),Kn=(0,le.Z)(nn,2),mi=Kn[0],ei=Kn[1],Si=function(di,Oi){var wt=cn(Oi,di.pageX);wt!==Xe&&(ei(wt),vn(null)),jn==null||jn(wt)},Wi=function(di){qe||(ei(null),vn(null),jn==null||jn(void 0)),di&&(ui==null||ui(di))},An=function(di,Oi){var wt=cn(Oi,di.pageX),yn=!1;tn&&(yn=wt===Qe),Wi(),hn(yn?0:wt),vn(yn?wt:null)},gn=function(di){var Oi=di.keyCode,wt=Pn==="rtl",yn=Ce?.5:1;an&&(Oi===ge.Z.RIGHT&&Qe<ae&&!wt?(hn(Qe+yn),di.preventDefault()):Oi===ge.Z.LEFT&&Qe>0&&!wt||Oi===ge.Z.RIGHT&&Qe>0&&wt?(hn(Qe-yn),di.preventDefault()):Oi===ge.Z.LEFT&&Qe<ae&&wt&&(hn(Qe+yn),di.preventDefault())),Mn==null||Mn(di)};Rt.useEffect(function(){sn&&!qe&&Kt()},[]);var Rn=new Array(ae).fill(0).map(function(xi,di){return Rt.createElement(ie,{ref:zt(di),index:di,count:ae,disabled:qe,prefixCls:"".concat(Dt,"-star"),allowHalf:Ce,value:mi===null?Qe:mi,onClick:An,onHover:Si,key:xi||di,character:oe,characterRender:Xt,focused:Je})}),si=It()(Dt,Jt,(0,Ut.Z)((0,Ut.Z)({},"".concat(Dt,"-disabled"),qe),"".concat(Dt,"-rtl"),Pn==="rtl"));return Rt.createElement("ul",(0,pt.Z)({className:si,onMouseLeave:Wi,tabIndex:qe?-1:dn,onFocus:qe?null:Xn,onBlur:qe?null:Ln,onKeyDown:qe?null:gn,ref:Mt},(0,ne.Z)(_t,{aria:!0,data:!0,attr:!0})),Rn)}var gt=Rt.forwardRef(st),vt=gt},69582:function(Dn,Gn,kt){"use strict";kt.d(Gn,{ZP:function(){return qt}});var pt=kt(52487),Ut=kt(59301),le=kt(47273),Me=0,ue=(0,le.Z)();function It(){var ge;return ue?(ge=Me,Me+=1):ge="TEST_OR_SSR",ge}function qt(ge){var ne=Ut.useState(),Rt=(0,pt.Z)(ne,2),Ae=Rt[0],ie=Rt[1];return Ut.useEffect(function(){ie("rc_select_".concat(It()))},[]),ge||Ae}},45560:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Ac:function(){return Ti},Xo:function(){return Je},Wx:function(){return Xn},ZP:function(){return On},lk:function(){return vt}});var pt=kt(72308),Ut=kt(80702),le=kt(49618),Me=kt(77321),ue=kt(52487),It=kt(74416),qt=kt(62853),ge=kt(18929),ne=kt(48736),Rt=kt(59301),Ae=kt(92310),ie=kt.n(Ae),Ee=kt(34280),Bt=kt(49658),nt=kt(8654),et=function(Pe){var Zn=Pe.className,$t=Pe.customizeIcon,Ze=Pe.customizeIconProps,wn=Pe.children,ri=Pe.onMouseDown,We=Pe.onClick,je=typeof $t=="function"?$t(Ze):$t;return Rt.createElement("span",{className:Zn,onMouseDown:function(ci){ci.preventDefault(),ri==null||ri(ci)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:We,"aria-hidden":!0},je!==void 0?je:Rt.createElement("span",{className:ie()(Zn.split(/\s+/).map(function(Vn){return"".concat(Vn,"-icon")}))},wn))},ht=et,st=function(Pe,Zn,$t,Ze,wn){var ri=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,We=arguments.length>6?arguments[6]:void 0,je=arguments.length>7?arguments[7]:void 0,Vn=Rt.useMemo(function(){if((0,qt.Z)(Ze)==="object")return Ze.clearIcon;if(wn)return wn},[Ze,wn]),ci=Rt.useMemo(function(){return!!(!ri&&Ze&&($t.length||We)&&!(je==="combobox"&&We===""))},[Ze,ri,$t.length,We,je]);return{allowClear:ci,clearIcon:Rt.createElement(ht,{className:"".concat(Pe,"-clear"),onMouseDown:Zn,customizeIcon:Vn},"\xD7")}},gt=Rt.createContext(null);function vt(){return Rt.useContext(gt)}function St(){var Fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,Pe=Rt.useState(!1),Zn=(0,ue.Z)(Pe,2),$t=Zn[0],Ze=Zn[1],wn=Rt.useRef(null),ri=function(){window.clearTimeout(wn.current)};Rt.useEffect(function(){return ri},[]);var We=function(Vn,ci){ri(),wn.current=window.setTimeout(function(){Ze(Vn),ci&&ci()},Fe)};return[$t,We,ri]}function Et(){var Fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,Pe=Rt.useRef(null),Zn=Rt.useRef(null);Rt.useEffect(function(){return function(){window.clearTimeout(Zn.current)}},[]);function $t(Ze){(Ze||Pe.current===null)&&(Pe.current=Ze),window.clearTimeout(Zn.current),Zn.current=window.setTimeout(function(){Pe.current=null},Fe)}return[function(){return Pe.current},$t]}function Tt(Fe,Pe,Zn,$t){var Ze=Rt.useRef(null);Ze.current={open:Pe,triggerOpen:Zn,customizedTrigger:$t},Rt.useEffect(function(){function wn(ri){var We;if(!((We=Ze.current)!==null&&We!==void 0&&We.customizedTrigger)){var je=ri.target;je.shadowRoot&&ri.composed&&(je=ri.composedPath()[0]||je),Ze.current.open&&Fe().filter(function(Vn){return Vn}).every(function(Vn){return!Vn.contains(je)&&Vn!==je})&&Ze.current.triggerOpen(!1)}}return window.addEventListener("mousedown",wn),function(){return window.removeEventListener("mousedown",wn)}},[])}var Dt=kt(10228);function Jt(Fe){return Fe&&![Dt.Z.ESC,Dt.Z.SHIFT,Dt.Z.BACKSPACE,Dt.Z.TAB,Dt.Z.WIN_KEY,Dt.Z.ALT,Dt.Z.META,Dt.Z.WIN_KEY_RIGHT,Dt.Z.CTRL,Dt.Z.SEMICOLON,Dt.Z.EQUALS,Dt.Z.CAPS_LOCK,Dt.Z.CONTEXT_MENU,Dt.Z.F1,Dt.Z.F2,Dt.Z.F3,Dt.Z.F4,Dt.Z.F5,Dt.Z.F6,Dt.Z.F7,Dt.Z.F8,Dt.Z.F9,Dt.Z.F10,Dt.Z.F11,Dt.Z.F12].includes(Fe)}var Yt=kt(26112),Gt=kt(11780),me=function(Pe,Zn){var $t,Ze=Pe.prefixCls,wn=Pe.id,ri=Pe.inputElement,We=Pe.disabled,je=Pe.tabIndex,Vn=Pe.autoFocus,ci=Pe.autoComplete,Mi=Pe.editable,pi=Pe.activeDescendantId,oi=Pe.value,hi=Pe.maxLength,Bi=Pe.onKeyDown,_i=Pe.onMouseDown,Ki=Pe.onChange,en=Pe.onPaste,no=Pe.onCompositionStart,vr=Pe.onCompositionEnd,Xr=Pe.onBlur,He=Pe.open,Hn=Pe.attrs,Fi=ri||Rt.createElement("input",null),Hi=Fi,Ii=Hi.ref,Yi=Hi.props,Ar=Yi.onKeyDown,Pr=Yi.onChange,Br=Yi.onMouseDown,Fr=Yi.onCompositionStart,fn=Yi.onCompositionEnd,io=Yi.onBlur,pn=Yi.style;return(0,ne.Kp)(!("maxLength"in Fi.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),Fi=Rt.cloneElement(Fi,(0,Me.Z)((0,Me.Z)((0,Me.Z)({type:"search"},Yi),{},{id:wn,ref:(0,nt.sQ)(Zn,Ii),disabled:We,tabIndex:je,autoComplete:ci||"off",autoFocus:Vn,className:ie()("".concat(Ze,"-selection-search-input"),($t=Fi)===null||$t===void 0||($t=$t.props)===null||$t===void 0?void 0:$t.className),role:"combobox","aria-expanded":He||!1,"aria-haspopup":"listbox","aria-owns":"".concat(wn,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(wn,"_list"),"aria-activedescendant":He?pi:void 0},Hn),{},{value:Mi?oi:"",maxLength:hi,readOnly:!Mi,unselectable:Mi?null:"on",style:(0,Me.Z)((0,Me.Z)({},pn),{},{opacity:Mi?null:0}),onKeyDown:function($i){Bi($i),Ar&&Ar($i)},onMouseDown:function($i){_i($i),Br&&Br($i)},onChange:function($i){Ki($i),Pr&&Pr($i)},onCompositionStart:function($i){no($i),Fr&&Fr($i)},onCompositionEnd:function($i){vr($i),fn&&fn($i)},onPaste:en,onBlur:function($i){Xr($i),io&&io($i)}})),Fi},ae=Rt.forwardRef(me),Ne=ae;function Ce(Fe){return Array.isArray(Fe)?Fe:Fe!==void 0?[Fe]:[]}var we=typeof window!="undefined"&&window.document&&window.document.documentElement,tn=we;function _e(Fe){return Fe!=null}function an(Fe){return!Fe&&Fe!==0}function Ke(Fe){return["string","number"].includes((0,qt.Z)(Fe))}function oe(Fe){var Pe=void 0;return Fe&&(Ke(Fe.title)?Pe=Fe.title.toString():Ke(Fe.label)&&(Pe=Fe.label.toString())),Pe}function Xt(Fe,Pe){tn?Rt.useLayoutEffect(Fe,Pe):Rt.useEffect(Fe,Pe)}function qe(Fe){var Pe;return(Pe=Fe.key)!==null&&Pe!==void 0?Pe:Fe.value}var _n=function(Pe){Pe.preventDefault(),Pe.stopPropagation()},Pn=function(Pe){var Zn=Pe.id,$t=Pe.prefixCls,Ze=Pe.values,wn=Pe.open,ri=Pe.searchValue,We=Pe.autoClearSearchValue,je=Pe.inputRef,Vn=Pe.placeholder,ci=Pe.disabled,Mi=Pe.mode,pi=Pe.showSearch,oi=Pe.autoFocus,hi=Pe.autoComplete,Bi=Pe.activeDescendantId,_i=Pe.tabIndex,Ki=Pe.removeIcon,en=Pe.maxTagCount,no=Pe.maxTagTextLength,vr=Pe.maxTagPlaceholder,Xr=vr===void 0?function(vi){return"+ ".concat(vi.length," ...")}:vr,He=Pe.tagRender,Hn=Pe.onToggleOpen,Fi=Pe.onRemove,Hi=Pe.onInputChange,Ii=Pe.onInputPaste,Yi=Pe.onInputKeyDown,Ar=Pe.onInputMouseDown,Pr=Pe.onInputCompositionStart,Br=Pe.onInputCompositionEnd,Fr=Pe.onInputBlur,fn=Rt.useRef(null),io=(0,Rt.useState)(0),pn=(0,ue.Z)(io,2),Di=pn[0],$i=pn[1],Ai=(0,Rt.useState)(!1),bo=(0,ue.Z)(Ai,2),Fo=bo[0],ao=bo[1],co="".concat($t,"-selection"),Re=wn||Mi==="multiple"&&We===!1||Mi==="tags"?ri:"",mn=Mi==="tags"||Mi==="multiple"&&We===!1||pi&&(wn||Fo);Xt(function(){$i(fn.current.scrollWidth)},[Re]);var Ie=function(Cn,$n,ti,ii,ni){return Rt.createElement("span",{title:oe(Cn),className:ie()("".concat(co,"-item"),(0,le.Z)({},"".concat(co,"-item-disabled"),ti))},Rt.createElement("span",{className:"".concat(co,"-item-content")},$n),ii&&Rt.createElement(ht,{className:"".concat(co,"-item-remove"),onMouseDown:_n,onClick:ni,customizeIcon:Ki},"\xD7"))},At=function(Cn,$n,ti,ii,ni,Vi){var Ei=function(ln){_n(ln),Hn(!wn)};return Rt.createElement("span",{onMouseDown:Ei},He({label:$n,value:Cn,disabled:ti,closable:ii,onClose:ni,isMaxTag:!!Vi}))},Un=function(Cn){var $n=Cn.disabled,ti=Cn.label,ii=Cn.value,ni=!ci&&!$n,Vi=ti;if(typeof no=="number"&&(typeof ti=="string"||typeof ti=="number")){var Ei=String(Vi);Ei.length>no&&(Vi="".concat(Ei.slice(0,no),"..."))}var yi=function(Pi){Pi&&Pi.stopPropagation(),Fi(Cn)};return typeof He=="function"?At(ii,Vi,$n,ni,yi):Ie(Cn,Vi,$n,ni,yi)},Nn=function(Cn){if(!Ze.length)return null;var $n=typeof Xr=="function"?Xr(Cn):Xr;return typeof He=="function"?At(void 0,$n,!1,!1,void 0,!0):Ie({title:$n},$n,!1)},Yn=Rt.createElement("div",{className:"".concat(co,"-search"),style:{width:Di},onFocus:function(){ao(!0)},onBlur:function(){ao(!1)}},Rt.createElement(Ne,{ref:je,open:wn,prefixCls:$t,id:Zn,inputElement:null,disabled:ci,autoFocus:oi,autoComplete:hi,editable:mn,activeDescendantId:Bi,value:Re,onKeyDown:Yi,onMouseDown:Ar,onChange:Hi,onPaste:Ii,onCompositionStart:Pr,onCompositionEnd:Br,onBlur:Fr,tabIndex:_i,attrs:(0,Yt.Z)(Pe,!0)}),Rt.createElement("span",{ref:fn,className:"".concat(co,"-search-mirror"),"aria-hidden":!0},Re,"\xA0")),ai=Rt.createElement(Gt.Z,{prefixCls:"".concat(co,"-overflow"),data:Ze,renderItem:Un,renderRest:Nn,suffix:Yn,itemKey:qe,maxCount:en});return Rt.createElement("span",{className:"".concat(co,"-wrap")},ai,!Ze.length&&!Re&&Rt.createElement("span",{className:"".concat(co,"-placeholder")},Vn))},De=Pn,dn=function(Pe){var Zn=Pe.inputElement,$t=Pe.prefixCls,Ze=Pe.id,wn=Pe.inputRef,ri=Pe.disabled,We=Pe.autoFocus,je=Pe.autoComplete,Vn=Pe.activeDescendantId,ci=Pe.mode,Mi=Pe.open,pi=Pe.values,oi=Pe.placeholder,hi=Pe.tabIndex,Bi=Pe.showSearch,_i=Pe.searchValue,Ki=Pe.activeValue,en=Pe.maxLength,no=Pe.onInputKeyDown,vr=Pe.onInputMouseDown,Xr=Pe.onInputChange,He=Pe.onInputPaste,Hn=Pe.onInputCompositionStart,Fi=Pe.onInputCompositionEnd,Hi=Pe.onInputBlur,Ii=Pe.title,Yi=Rt.useState(!1),Ar=(0,ue.Z)(Yi,2),Pr=Ar[0],Br=Ar[1],Fr=ci==="combobox",fn=Fr||Bi,io=pi[0],pn=_i||"";Fr&&Ki&&!Pr&&(pn=Ki),Rt.useEffect(function(){Fr&&Br(!1)},[Fr,Ki]);var Di=ci!=="combobox"&&!Mi&&!Bi?!1:!!pn,$i=Ii===void 0?oe(io):Ii,Ai=Rt.useMemo(function(){return io?null:Rt.createElement("span",{className:"".concat($t,"-selection-placeholder"),style:Di?{visibility:"hidden"}:void 0},oi)},[io,Di,oi,$t]);return Rt.createElement("span",{className:"".concat($t,"-selection-wrap")},Rt.createElement("span",{className:"".concat($t,"-selection-search")},Rt.createElement(Ne,{ref:wn,prefixCls:$t,id:Ze,open:Mi,inputElement:Zn,disabled:ri,autoFocus:We,autoComplete:je,editable:fn,activeDescendantId:Vn,value:pn,onKeyDown:no,onMouseDown:vr,onChange:function(Fo){Br(!0),Xr(Fo)},onPaste:He,onCompositionStart:Hn,onCompositionEnd:Fi,onBlur:Hi,tabIndex:hi,attrs:(0,Yt.Z)(Pe,!0),maxLength:Fr?en:void 0})),!Fr&&io?Rt.createElement("span",{className:"".concat($t,"-selection-item"),title:$i,style:Di?{visibility:"hidden"}:void 0},io.label):null,Ai)},sn=dn,jn=function(Pe,Zn){var $t=(0,Rt.useRef)(null),Ze=(0,Rt.useRef)(!1),wn=Pe.prefixCls,ri=Pe.open,We=Pe.mode,je=Pe.showSearch,Vn=Pe.tokenWithEnter,ci=Pe.disabled,Mi=Pe.prefix,pi=Pe.autoClearSearchValue,oi=Pe.onSearch,hi=Pe.onSearchSubmit,Bi=Pe.onToggleOpen,_i=Pe.onInputKeyDown,Ki=Pe.onInputBlur,en=Pe.domRef;Rt.useImperativeHandle(Zn,function(){return{focus:function($i){$t.current.focus($i)},blur:function(){$t.current.blur()}}});var no=Et(0),vr=(0,ue.Z)(no,2),Xr=vr[0],He=vr[1],Hn=function($i){var Ai=$i.which,bo=$t.current instanceof HTMLTextAreaElement;!bo&&ri&&(Ai===Dt.Z.UP||Ai===Dt.Z.DOWN)&&$i.preventDefault(),_i&&_i($i),Ai===Dt.Z.ENTER&&We==="tags"&&!Ze.current&&!ri&&(hi==null||hi($i.target.value)),!(bo&&!ri&&~[Dt.Z.UP,Dt.Z.DOWN,Dt.Z.LEFT,Dt.Z.RIGHT].indexOf(Ai))&&Jt(Ai)&&Bi(!0)},Fi=function(){He(!0)},Hi=(0,Rt.useRef)(null),Ii=function($i){oi($i,!0,Ze.current)!==!1&&Bi(!0)},Yi=function(){Ze.current=!0},Ar=function($i){Ze.current=!1,We!=="combobox"&&Ii($i.target.value)},Pr=function($i){var Ai=$i.target.value;if(Vn&&Hi.current&&/[\r\n]/.test(Hi.current)){var bo=Hi.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");Ai=Ai.replace(bo,Hi.current)}Hi.current=null,Ii(Ai)},Br=function($i){var Ai=$i.clipboardData,bo=Ai==null?void 0:Ai.getData("text");Hi.current=bo||""},Fr=function($i){var Ai=$i.target;if(Ai!==$t.current){var bo=document.body.style.msTouchAction!==void 0;bo?setTimeout(function(){$t.current.focus()}):$t.current.focus()}},fn=function($i){var Ai=Xr();$i.target!==$t.current&&!Ai&&!(We==="combobox"&&ci)&&$i.preventDefault(),(We!=="combobox"&&(!je||!Ai)||!ri)&&(ri&&pi!==!1&&oi("",!0,!1),Bi())},io={inputRef:$t,onInputKeyDown:Hn,onInputMouseDown:Fi,onInputChange:Pr,onInputPaste:Br,onInputCompositionStart:Yi,onInputCompositionEnd:Ar,onInputBlur:Ki},pn=We==="multiple"||We==="tags"?Rt.createElement(De,(0,pt.Z)({},Pe,io)):Rt.createElement(sn,(0,pt.Z)({},Pe,io));return Rt.createElement("div",{ref:en,className:"".concat(wn,"-selector"),onClick:Fr,onMouseDown:fn},Mi&&Rt.createElement("div",{className:"".concat(wn,"-prefix")},Mi),pn)},Te=Rt.forwardRef(jn),Sn=Te,ee=kt(65352),Mn=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],ui=function(Pe){var Zn=Pe===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:Zn,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:Zn,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:Zn,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:Zn,adjustY:1},htmlRegion:"scroll"}}},_t=function(Pe,Zn){var $t=Pe.prefixCls,Ze=Pe.disabled,wn=Pe.visible,ri=Pe.children,We=Pe.popupElement,je=Pe.animation,Vn=Pe.transitionName,ci=Pe.dropdownStyle,Mi=Pe.dropdownClassName,pi=Pe.direction,oi=pi===void 0?"ltr":pi,hi=Pe.placement,Bi=Pe.builtinPlacements,_i=Pe.dropdownMatchSelectWidth,Ki=Pe.dropdownRender,en=Pe.dropdownAlign,no=Pe.getPopupContainer,vr=Pe.empty,Xr=Pe.getTriggerDOMNode,He=Pe.onPopupVisibleChange,Hn=Pe.onPopupMouseEnter,Fi=(0,It.Z)(Pe,Mn),Hi="".concat($t,"-dropdown"),Ii=We;Ki&&(Ii=Ki(We));var Yi=Rt.useMemo(function(){return Bi||ui(_i)},[Bi,_i]),Ar=je?"".concat(Hi,"-").concat(je):Vn,Pr=typeof _i=="number",Br=Rt.useMemo(function(){return Pr?null:_i===!1?"minWidth":"width"},[_i,Pr]),Fr=ci;Pr&&(Fr=(0,Me.Z)((0,Me.Z)({},Fr),{},{width:_i}));var fn=Rt.useRef(null);return Rt.useImperativeHandle(Zn,function(){return{getPopupElement:function(){var pn;return(pn=fn.current)===null||pn===void 0?void 0:pn.popupElement}}}),Rt.createElement(ee.Z,(0,pt.Z)({},Fi,{showAction:He?["click"]:[],hideAction:He?["click"]:[],popupPlacement:hi||(oi==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:Yi,prefixCls:Hi,popupTransitionName:Ar,popup:Rt.createElement("div",{onMouseEnter:Hn},Ii),ref:fn,stretch:Br,popupAlign:en,popupVisible:wn,getPopupContainer:no,popupClassName:ie()(Mi,(0,le.Z)({},"".concat(Hi,"-empty"),vr)),popupStyle:Fr,getTriggerDOMNode:Xr,onPopupVisibleChange:He}),ri)},Lt=Rt.forwardRef(_t),Pt=Lt,Nt=kt(68413);function zt(Fe,Pe){var Zn=Fe.key,$t;return"value"in Fe&&($t=Fe.value),Zn!=null?Zn:$t!==void 0?$t:"rc-index-key-".concat(Pe)}function Mt(Fe){return typeof Fe!="undefined"&&!Number.isNaN(Fe)}function Kt(Fe,Pe){var Zn=Fe||{},$t=Zn.label,Ze=Zn.value,wn=Zn.options,ri=Zn.groupLabel,We=$t||(Pe?"children":"label");return{label:We,value:Ze||"value",options:wn||"options",groupLabel:ri||We}}function ye(Fe){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Zn=Pe.fieldNames,$t=Pe.childrenAsData,Ze=[],wn=Kt(Zn,!1),ri=wn.label,We=wn.value,je=wn.options,Vn=wn.groupLabel;function ci(Mi,pi){Array.isArray(Mi)&&Mi.forEach(function(oi){if(pi||!(je in oi)){var hi=oi[We];Ze.push({key:zt(oi,Ze.length),groupOption:pi,data:oi,label:oi[ri],value:hi})}else{var Bi=oi[Vn];Bi===void 0&&$t&&(Bi=oi.label),Ze.push({key:zt(oi,Ze.length),group:!0,data:oi,label:Bi}),ci(oi[je],!0)}})}return ci(Fe,!1),Ze}function Ue(Fe){var Pe=(0,Me.Z)({},Fe);return"props"in Pe||Object.defineProperty(Pe,"props",{get:function(){return(0,ne.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),Pe}}),Pe}var Qe=function(Pe,Zn,$t){if(!Zn||!Zn.length)return null;var Ze=!1,wn=function We(je,Vn){var ci=(0,Nt.Z)(Vn),Mi=ci[0],pi=ci.slice(1);if(!Mi)return[je];var oi=je.split(Mi);return Ze=Ze||oi.length>1,oi.reduce(function(hi,Bi){return[].concat((0,Ut.Z)(hi),(0,Ut.Z)(We(Bi,pi)))},[]).filter(Boolean)},ri=wn(Pe,Zn);return Ze?typeof $t!="undefined"?ri.slice(0,$t):ri:null},ce=Rt.createContext(null),Oe=ce;function Le(Fe){var Pe=Fe.visible,Zn=Fe.values;if(!Pe)return null;var $t=50;return Rt.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(Zn.slice(0,$t).map(function(Ze){var wn=Ze.label,ri=Ze.value;return["number","string"].includes((0,qt.Z)(wn))?wn:ri}).join(", ")),Zn.length>$t?", ...":null)}var Xe=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],vn=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],cn=function(Pe){return Pe==="tags"||Pe==="multiple"},hn=Rt.forwardRef(function(Fe,Pe){var Zn,$t=Fe.id,Ze=Fe.prefixCls,wn=Fe.className,ri=Fe.showSearch,We=Fe.tagRender,je=Fe.direction,Vn=Fe.omitDomProps,ci=Fe.displayValues,Mi=Fe.onDisplayValuesChange,pi=Fe.emptyOptions,oi=Fe.notFoundContent,hi=oi===void 0?"Not Found":oi,Bi=Fe.onClear,_i=Fe.mode,Ki=Fe.disabled,en=Fe.loading,no=Fe.getInputElement,vr=Fe.getRawInputElement,Xr=Fe.open,He=Fe.defaultOpen,Hn=Fe.onDropdownVisibleChange,Fi=Fe.activeValue,Hi=Fe.onActiveValueChange,Ii=Fe.activeDescendantId,Yi=Fe.searchValue,Ar=Fe.autoClearSearchValue,Pr=Fe.onSearch,Br=Fe.onSearchSplit,Fr=Fe.tokenSeparators,fn=Fe.allowClear,io=Fe.prefix,pn=Fe.suffixIcon,Di=Fe.clearIcon,$i=Fe.OptionList,Ai=Fe.animation,bo=Fe.transitionName,Fo=Fe.dropdownStyle,ao=Fe.dropdownClassName,co=Fe.dropdownMatchSelectWidth,Re=Fe.dropdownRender,mn=Fe.dropdownAlign,Ie=Fe.placement,At=Fe.builtinPlacements,Un=Fe.getPopupContainer,Nn=Fe.showAction,Yn=Nn===void 0?[]:Nn,ai=Fe.onFocus,vi=Fe.onBlur,Cn=Fe.onKeyUp,$n=Fe.onKeyDown,ti=Fe.onMouseDown,ii=(0,It.Z)(Fe,Xe),ni=cn(_i),Vi=(ri!==void 0?ri:ni)||_i==="combobox",Ei=(0,Me.Z)({},ii);vn.forEach(function(Lo){delete Ei[Lo]}),Vn==null||Vn.forEach(function(Lo){delete Ei[Lo]});var yi=Rt.useState(!1),ln=(0,ue.Z)(yi,2),Pi=ln[0],qi=ln[1];Rt.useEffect(function(){qi((0,Bt.Z)())},[]);var Tr=Rt.useRef(null),Lr=Rt.useRef(null),Rr=Rt.useRef(null),Zr=Rt.useRef(null),jr=Rt.useRef(null),Co=Rt.useRef(!1),vo=St(),Uo=(0,ue.Z)(vo,3),Be=Uo[0],Wr=Uo[1],qr=Uo[2];Rt.useImperativeHandle(Pe,function(){var Lo,ro;return{focus:(Lo=Zr.current)===null||Lo===void 0?void 0:Lo.focus,blur:(ro=Zr.current)===null||ro===void 0?void 0:ro.blur,scrollTo:function(Ia){var Ea;return(Ea=jr.current)===null||Ea===void 0?void 0:Ea.scrollTo(Ia)},nativeElement:Tr.current||Lr.current}});var fr=Rt.useMemo(function(){var Lo;if(_i!=="combobox")return Yi;var ro=(Lo=ci[0])===null||Lo===void 0?void 0:Lo.value;return typeof ro=="string"||typeof ro=="number"?String(ro):""},[Yi,_i,ci]),Qr=_i==="combobox"&&typeof no=="function"&&no()||null,hr=typeof vr=="function"&&vr(),zo=(0,nt.x1)(Lr,hr==null||(Zn=hr.props)===null||Zn===void 0?void 0:Zn.ref),Eo=Rt.useState(!1),Jr=(0,ue.Z)(Eo,2),Dr=Jr[0],za=Jr[1];(0,Ee.Z)(function(){za(!0)},[]);var aa=(0,ge.Z)(!1,{defaultValue:He,value:Xr}),es=(0,ue.Z)(aa,2),La=es[0],ir=es[1],_o=Dr?La:!1,ia=!hi&&pi;(Ki||ia&&_o&&_i==="combobox")&&(_o=!1);var ca=ia?!1:_o,$r=Rt.useCallback(function(Lo){var ro=Lo!==void 0?Lo:!_o;Ki||(ir(ro),_o!==ro&&(Hn==null||Hn(ro)))},[Ki,_o,ir,Hn]),Kr=Rt.useMemo(function(){return(Fr||[]).some(function(Lo){return[`
`,`\r
`].includes(Lo)})},[Fr]),In=Rt.useContext(Oe)||{},gr=In.maxCount,eo=In.rawValues,Vo=function(ro,uo,Ia){if(!(ni&&Mt(gr)&&(eo==null?void 0:eo.size)>=gr)){var Ea=!0,xe=ro;Hi==null||Hi(null);var fe=Qe(ro,Fr,Mt(gr)?gr-eo.size:void 0),Ve=Ia?null:fe;return _i!=="combobox"&&Ve&&(xe="",Br==null||Br(Ve),$r(!1),Ea=!1),Pr&&fr!==xe&&Pr(xe,{source:uo?"typing":"effect"}),Ea}},Va=function(ro){!ro||!ro.trim()||Pr(ro,{source:"submit"})};Rt.useEffect(function(){!_o&&!ni&&_i!=="combobox"&&Vo("",!1,!1)},[_o]),Rt.useEffect(function(){La&&Ki&&ir(!1),Ki&&!Co.current&&Wr(!1)},[Ki]);var Ba=Et(),Or=(0,ue.Z)(Ba,2),fa=Or[0],Sa=Or[1],Yo=Rt.useRef(!1),No=function(ro){var uo=fa(),Ia=ro.key,Ea=Ia==="Enter";if(Ea&&(_i!=="combobox"&&ro.preventDefault(),_o||$r(!0)),Sa(!!fr),Ia==="Backspace"&&!uo&&ni&&!fr&&ci.length){for(var xe=(0,Ut.Z)(ci),fe=null,Ve=xe.length-1;Ve>=0;Ve-=1){var Zt=xe[Ve];if(!Zt.disabled){xe.splice(Ve,1),fe=Zt;break}}fe&&Mi(xe,{type:"remove",values:[fe]})}for(var Ye=arguments.length,pr=new Array(Ye>1?Ye-1:0),oo=1;oo<Ye;oo++)pr[oo-1]=arguments[oo];if(_o&&(!Ea||!Yo.current)){var rr;Ea&&(Yo.current=!0),(rr=jr.current)===null||rr===void 0||rr.onKeyDown.apply(rr,[ro].concat(pr))}$n==null||$n.apply(void 0,[ro].concat(pr))},Ka=function(ro){for(var uo=arguments.length,Ia=new Array(uo>1?uo-1:0),Ea=1;Ea<uo;Ea++)Ia[Ea-1]=arguments[Ea];if(_o){var xe;(xe=jr.current)===null||xe===void 0||xe.onKeyUp.apply(xe,[ro].concat(Ia))}ro.key==="Enter"&&(Yo.current=!1),Cn==null||Cn.apply(void 0,[ro].concat(Ia))},us=function(ro){var uo=ci.filter(function(Ia){return Ia!==ro});Mi(uo,{type:"remove",values:[ro]})},Ko=function(){Yo.current=!1},hs=Rt.useRef(!1),Xs=function(){Wr(!0),Ki||(ai&&!hs.current&&ai.apply(void 0,arguments),Yn.includes("focus")&&$r(!0)),hs.current=!0},Ou=function(){Co.current=!0,Wr(!1,function(){hs.current=!1,Co.current=!1,$r(!1)}),!Ki&&(fr&&(_i==="tags"?Pr(fr,{source:"submit"}):_i==="multiple"&&Pr("",{source:"blur"})),vi&&vi.apply(void 0,arguments))},ga=[];Rt.useEffect(function(){return function(){ga.forEach(function(Lo){return clearTimeout(Lo)}),ga.splice(0,ga.length)}},[]);var Iu=function(ro){var uo,Ia=ro.target,Ea=(uo=Rr.current)===null||uo===void 0?void 0:uo.getPopupElement();if(Ea&&Ea.contains(Ia)){var xe=setTimeout(function(){var Ye=ga.indexOf(xe);if(Ye!==-1&&ga.splice(Ye,1),qr(),!Pi&&!Ea.contains(document.activeElement)){var pr;(pr=Zr.current)===null||pr===void 0||pr.focus()}});ga.push(xe)}for(var fe=arguments.length,Ve=new Array(fe>1?fe-1:0),Zt=1;Zt<fe;Zt++)Ve[Zt-1]=arguments[Zt];ti==null||ti.apply(void 0,[ro].concat(Ve))},Cu=Rt.useState({}),Zl=(0,ue.Z)(Cu,2),Ll=Zl[1];function js(){Ll({})}var Fl;hr&&(Fl=function(ro){$r(ro)}),Tt(function(){var Lo;return[Tr.current,(Lo=Rr.current)===null||Lo===void 0?void 0:Lo.getPopupElement()]},ca,$r,!!hr);var ru=Rt.useMemo(function(){return(0,Me.Z)((0,Me.Z)({},Fe),{},{notFoundContent:hi,open:_o,triggerOpen:ca,id:$t,showSearch:Vi,multiple:ni,toggleOpen:$r})},[Fe,hi,ca,_o,$t,Vi,ni,$r]),ou=!!pn||en,xa;ou&&(xa=Rt.createElement(ht,{className:ie()("".concat(Ze,"-arrow"),(0,le.Z)({},"".concat(Ze,"-arrow-loading"),en)),customizeIcon:pn,customizeIconProps:{loading:en,searchValue:fr,open:_o,focused:Be,showSearch:Vi}}));var rl=function(){var ro;Bi==null||Bi(),(ro=Zr.current)===null||ro===void 0||ro.focus(),Mi([],{type:"clear",values:ci}),Vo("",!1,!1)},_u=st(Ze,rl,ci,fn,Di,Ki,fr,_i),au=_u.allowClear,su=_u.clearIcon,Xa=Rt.createElement($i,{ref:jr}),ns=ie()(Ze,wn,(0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)({},"".concat(Ze,"-focused"),Be),"".concat(Ze,"-multiple"),ni),"".concat(Ze,"-single"),!ni),"".concat(Ze,"-allow-clear"),fn),"".concat(Ze,"-show-arrow"),ou),"".concat(Ze,"-disabled"),Ki),"".concat(Ze,"-loading"),en),"".concat(Ze,"-open"),_o),"".concat(Ze,"-customize-input"),Qr),"".concat(Ze,"-show-search"),Vi)),Fa=Rt.createElement(Pt,{ref:Rr,disabled:Ki,prefixCls:Ze,visible:ca,popupElement:Xa,animation:Ai,transitionName:bo,dropdownStyle:Fo,dropdownClassName:ao,direction:je,dropdownMatchSelectWidth:co,dropdownRender:Re,dropdownAlign:mn,placement:Ie,builtinPlacements:At,getPopupContainer:Un,empty:pi,getTriggerDOMNode:function(ro){return Lr.current||ro},onPopupVisibleChange:Fl,onPopupMouseEnter:js},hr?Rt.cloneElement(hr,{ref:zo}):Rt.createElement(Sn,(0,pt.Z)({},Fe,{domRef:Lr,prefixCls:Ze,inputElement:Qr,ref:Zr,id:$t,prefix:io,showSearch:Vi,autoClearSearchValue:Ar,mode:_i,activeDescendantId:Ii,tagRender:We,values:ci,open:_o,onToggleOpen:$r,activeValue:Fi,searchValue:fr,onSearch:Vo,onSearchSubmit:Va,onRemove:us,tokenWithEnter:Kr,onInputBlur:Ko}))),Ma;return hr?Ma=Fa:Ma=Rt.createElement("div",(0,pt.Z)({className:ns},Ei,{ref:Tr,onMouseDown:Iu,onKeyDown:No,onKeyUp:Ka,onFocus:Xs,onBlur:Ou}),Rt.createElement(Le,{visible:Be&&!_o,values:ci}),Fa,xa,au&&su),Rt.createElement(gt.Provider,{value:ru},Ma)}),Ti=hn,Ge=function(){return null};Ge.isSelectOptGroup=!0;var Je=Ge,rn=function(){return null};rn.isSelectOption=!0;var Xn=rn,Ln=kt(80547),nn=kt(2738),Kn=kt(45680);function mi(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var ei=["disabled","title","children","style","className"];function Si(Fe){return typeof Fe=="string"||typeof Fe=="number"}var Wi=function(Pe,Zn){var $t=vt(),Ze=$t.prefixCls,wn=$t.id,ri=$t.open,We=$t.multiple,je=$t.mode,Vn=$t.searchValue,ci=$t.toggleOpen,Mi=$t.notFoundContent,pi=$t.onPopupScroll,oi=Rt.useContext(Oe),hi=oi.maxCount,Bi=oi.flattenOptions,_i=oi.onActiveValue,Ki=oi.defaultActiveFirstOption,en=oi.onSelect,no=oi.menuItemSelectedIcon,vr=oi.rawValues,Xr=oi.fieldNames,He=oi.virtual,Hn=oi.direction,Fi=oi.listHeight,Hi=oi.listItemHeight,Ii=oi.optionRender,Yi="".concat(Ze,"-item"),Ar=(0,Ln.Z)(function(){return Bi},[ri,Bi],function(Nn,Yn){return Yn[0]&&Nn[1]!==Yn[1]}),Pr=Rt.useRef(null),Br=Rt.useMemo(function(){return We&&Mt(hi)&&(vr==null?void 0:vr.size)>=hi},[We,hi,vr==null?void 0:vr.size]),Fr=function(Yn){Yn.preventDefault()},fn=function(Yn){var ai;(ai=Pr.current)===null||ai===void 0||ai.scrollTo(typeof Yn=="number"?{index:Yn}:Yn)},io=Rt.useCallback(function(Nn){return je==="combobox"?!1:vr.has(Nn)},[je,(0,Ut.Z)(vr).toString(),vr.size]),pn=function(Yn){for(var ai=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,vi=Ar.length,Cn=0;Cn<vi;Cn+=1){var $n=(Yn+Cn*ai+vi)%vi,ti=Ar[$n]||{},ii=ti.group,ni=ti.data;if(!ii&&!(ni!=null&&ni.disabled)&&(io(ni.value)||!Br))return $n}return-1},Di=Rt.useState(function(){return pn(0)}),$i=(0,ue.Z)(Di,2),Ai=$i[0],bo=$i[1],Fo=function(Yn){var ai=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;bo(Yn);var vi={source:ai?"keyboard":"mouse"},Cn=Ar[Yn];if(!Cn){_i(null,-1,vi);return}_i(Cn.value,Yn,vi)};(0,Rt.useEffect)(function(){Fo(Ki!==!1?pn(0):-1)},[Ar.length,Vn]);var ao=Rt.useCallback(function(Nn){return je==="combobox"?String(Nn).toLowerCase()===Vn.toLowerCase():vr.has(Nn)},[je,Vn,(0,Ut.Z)(vr).toString(),vr.size]);(0,Rt.useEffect)(function(){var Nn=setTimeout(function(){if(!We&&ri&&vr.size===1){var ai=Array.from(vr)[0],vi=Ar.findIndex(function(Cn){var $n=Cn.data;return $n.value===ai});vi!==-1&&(Fo(vi),fn(vi))}});if(ri){var Yn;(Yn=Pr.current)===null||Yn===void 0||Yn.scrollTo(void 0)}return function(){return clearTimeout(Nn)}},[ri,Vn]);var co=function(Yn){Yn!==void 0&&en(Yn,{selected:!vr.has(Yn)}),We||ci(!1)};if(Rt.useImperativeHandle(Zn,function(){return{onKeyDown:function(Yn){var ai=Yn.which,vi=Yn.ctrlKey;switch(ai){case Dt.Z.N:case Dt.Z.P:case Dt.Z.UP:case Dt.Z.DOWN:{var Cn=0;if(ai===Dt.Z.UP?Cn=-1:ai===Dt.Z.DOWN?Cn=1:mi()&&vi&&(ai===Dt.Z.N?Cn=1:ai===Dt.Z.P&&(Cn=-1)),Cn!==0){var $n=pn(Ai+Cn,Cn);fn($n),Fo($n,!0)}break}case Dt.Z.TAB:case Dt.Z.ENTER:{var ti,ii=Ar[Ai];ii&&!(ii!=null&&(ti=ii.data)!==null&&ti!==void 0&&ti.disabled)&&!Br?co(ii.value):co(void 0),ri&&Yn.preventDefault();break}case Dt.Z.ESC:ci(!1),ri&&Yn.stopPropagation()}},onKeyUp:function(){},scrollTo:function(Yn){fn(Yn)}}}),Ar.length===0)return Rt.createElement("div",{role:"listbox",id:"".concat(wn,"_list"),className:"".concat(Yi,"-empty"),onMouseDown:Fr},Mi);var Re=Object.keys(Xr).map(function(Nn){return Xr[Nn]}),mn=function(Yn){return Yn.label};function Ie(Nn,Yn){var ai=Nn.group;return{role:ai?"presentation":"option",id:"".concat(wn,"_list_").concat(Yn)}}var At=function(Yn){var ai=Ar[Yn];if(!ai)return null;var vi=ai.data||{},Cn=vi.value,$n=ai.group,ti=(0,Yt.Z)(vi,!0),ii=mn(ai);return ai?Rt.createElement("div",(0,pt.Z)({"aria-label":typeof ii=="string"&&!$n?ii:null},ti,{key:Yn},Ie(ai,Yn),{"aria-selected":ao(Cn)}),Cn):null},Un={role:"listbox",id:"".concat(wn,"_list")};return Rt.createElement(Rt.Fragment,null,He&&Rt.createElement("div",(0,pt.Z)({},Un,{style:{height:0,width:0,overflow:"hidden"}}),At(Ai-1),At(Ai),At(Ai+1)),Rt.createElement(Kn.Z,{itemKey:"key",ref:Pr,data:Ar,height:Fi,itemHeight:Hi,fullHeight:!1,onMouseDown:Fr,onScroll:pi,virtual:He,direction:Hn,innerProps:He?null:Un},function(Nn,Yn){var ai=Nn.group,vi=Nn.groupOption,Cn=Nn.data,$n=Nn.label,ti=Nn.value,ii=Cn.key;if(ai){var ni,Vi=(ni=Cn.title)!==null&&ni!==void 0?ni:Si($n)?$n.toString():void 0;return Rt.createElement("div",{className:ie()(Yi,"".concat(Yi,"-group"),Cn.className),title:Vi},$n!==void 0?$n:ii)}var Ei=Cn.disabled,yi=Cn.title,ln=Cn.children,Pi=Cn.style,qi=Cn.className,Tr=(0,It.Z)(Cn,ei),Lr=(0,nn.Z)(Tr,Re),Rr=io(ti),Zr=Ei||!Rr&&Br,jr="".concat(Yi,"-option"),Co=ie()(Yi,jr,qi,(0,le.Z)((0,le.Z)((0,le.Z)((0,le.Z)({},"".concat(jr,"-grouped"),vi),"".concat(jr,"-active"),Ai===Yn&&!Zr),"".concat(jr,"-disabled"),Zr),"".concat(jr,"-selected"),Rr)),vo=mn(Nn),Uo=!no||typeof no=="function"||Rr,Be=typeof vo=="number"?vo:vo||ti,Wr=Si(Be)?Be.toString():void 0;return yi!==void 0&&(Wr=yi),Rt.createElement("div",(0,pt.Z)({},(0,Yt.Z)(Lr),He?{}:Ie(Nn,Yn),{"aria-selected":ao(ti),className:Co,title:Wr,onMouseMove:function(){Ai===Yn||Zr||Fo(Yn)},onClick:function(){Zr||co(ti)},style:Pi}),Rt.createElement("div",{className:"".concat(jr,"-content")},typeof Ii=="function"?Ii(Nn,{index:Yn}):Be),Rt.isValidElement(no)||Rr,Uo&&Rt.createElement(ht,{className:"".concat(Yi,"-option-state"),customizeIcon:no,customizeIconProps:{value:ti,disabled:Zr,isSelected:Rr}},Rr?"\u2713":null))}))},An=Rt.forwardRef(Wi),gn=An,Rn=function(Fe,Pe){var Zn=Rt.useRef({values:new Map,options:new Map}),$t=Rt.useMemo(function(){var wn=Zn.current,ri=wn.values,We=wn.options,je=Fe.map(function(Mi){if(Mi.label===void 0){var pi;return(0,Me.Z)((0,Me.Z)({},Mi),{},{label:(pi=ri.get(Mi.value))===null||pi===void 0?void 0:pi.label})}return Mi}),Vn=new Map,ci=new Map;return je.forEach(function(Mi){Vn.set(Mi.value,Mi),ci.set(Mi.value,Pe.get(Mi.value)||We.get(Mi.value))}),Zn.current.values=Vn,Zn.current.options=ci,je},[Fe,Pe]),Ze=Rt.useCallback(function(wn){return Pe.get(wn)||Zn.current.options.get(wn)},[Pe]);return[$t,Ze]};function si(Fe,Pe){return Ce(Fe).join("").toUpperCase().includes(Pe)}var xi=function(Fe,Pe,Zn,$t,Ze){return Rt.useMemo(function(){if(!Zn||$t===!1)return Fe;var wn=Pe.options,ri=Pe.label,We=Pe.value,je=[],Vn=typeof $t=="function",ci=Zn.toUpperCase(),Mi=Vn?$t:function(oi,hi){return Ze?si(hi[Ze],ci):hi[wn]?si(hi[ri!=="children"?ri:"label"],ci):si(hi[We],ci)},pi=Vn?function(oi){return Ue(oi)}:function(oi){return oi};return Fe.forEach(function(oi){if(oi[wn]){var hi=Mi(Zn,pi(oi));if(hi)je.push(oi);else{var Bi=oi[wn].filter(function(_i){return Mi(Zn,pi(_i))});Bi.length&&je.push((0,Me.Z)((0,Me.Z)({},oi),{},(0,le.Z)({},wn,Bi)))}return}Mi(Zn,pi(oi))&&je.push(oi)}),je},[Fe,$t,Ze,Zn,Pe])},di=kt(69582),Oi=kt(11592),wt=["children","value"],yn=["children"];function Wn(Fe){var Pe=Fe,Zn=Pe.key,$t=Pe.props,Ze=$t.children,wn=$t.value,ri=(0,It.Z)($t,wt);return(0,Me.Z)({key:Zn,value:wn!==void 0?wn:Zn,children:Ze},ri)}function ki(Fe){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,Oi.Z)(Fe).map(function(Zn,$t){if(!Rt.isValidElement(Zn)||!Zn.type)return null;var Ze=Zn,wn=Ze.type.isSelectOptGroup,ri=Ze.key,We=Ze.props,je=We.children,Vn=(0,It.Z)(We,yn);return Pe||!wn?Wn(Zn):(0,Me.Z)((0,Me.Z)({key:"__RC_SELECT_GRP__".concat(ri===null?$t:ri,"__"),label:ri},Vn),{},{options:ki(je)})}).filter(function(Zn){return Zn})}var Ui=function(Pe,Zn,$t,Ze,wn){return Rt.useMemo(function(){var ri=Pe,We=!Pe;We&&(ri=ki(Zn));var je=new Map,Vn=new Map,ci=function(oi,hi,Bi){Bi&&typeof Bi=="string"&&oi.set(hi[Bi],hi)},Mi=function pi(oi){for(var hi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Bi=0;Bi<oi.length;Bi+=1){var _i=oi[Bi];!_i[$t.options]||hi?(je.set(_i[$t.value],_i),ci(Vn,_i,$t.label),ci(Vn,_i,Ze),ci(Vn,_i,wn)):pi(_i[$t.options],!0)}};return Mi(ri),{options:ri,valueOptions:je,labelOptions:Vn}},[Pe,Zn,$t,Ze,wn])},ur=Ui;function Mr(Fe){var Pe=Rt.useRef();Pe.current=Fe;var Zn=Rt.useCallback(function(){return Pe.current.apply(Pe,arguments)},[]);return Zn}function gi(Fe){var Pe=Fe.mode,Zn=Fe.options,$t=Fe.children,Ze=Fe.backfill,wn=Fe.allowClear,ri=Fe.placeholder,We=Fe.getInputElement,je=Fe.showSearch,Vn=Fe.onSearch,ci=Fe.defaultOpen,Mi=Fe.autoFocus,pi=Fe.labelInValue,oi=Fe.value,hi=Fe.inputValue,Bi=Fe.optionLabelProp,_i=isMultiple(Pe),Ki=je!==void 0?je:_i||Pe==="combobox",en=Zn||convertChildrenToData($t);if(warning(Pe!=="tags"||en.every(function(He){return!He.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Pe==="tags"||Pe==="combobox"){var no=en.some(function(He){return He.options?He.options.some(function(Hn){return typeof("value"in Hn?Hn.value:Hn.key)=="number"}):typeof("value"in He?He.value:He.key)=="number"});warning(!no,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(Pe!=="combobox"||!Bi,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(Pe==="combobox"||!Ze,"`backfill` only works with `combobox` mode."),warning(Pe==="combobox"||!We,"`getInputElement` only work with `combobox` mode."),noteOnce(Pe!=="combobox"||!We||!wn||!ri,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Vn&&!Ki&&Pe!=="combobox"&&Pe!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!ci||Mi,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),oi!=null){var vr=toArray(oi);warning(!pi||vr.every(function(He){return _typeof(He)==="object"&&("key"in He||"value"in He)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!_i||Array.isArray(oi),"`value` should be array when `mode` is `multiple` or `tags`")}if($t){var Xr=null;toNodeArray($t).some(function(He){if(!React.isValidElement(He)||!He.type)return!1;var Hn=He,Fi=Hn.type;if(Fi.isSelectOption)return!1;if(Fi.isSelectOptGroup){var Hi=toNodeArray(He.props.children).every(function(Ii){return!React.isValidElement(Ii)||!He.type||Ii.type.isSelectOption?!0:(Xr=Ii.type,!1)});return!Hi}return Xr=Fi,!0}),Xr&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Xr.displayName||Xr.name||Xr,"`.")),warning(hi===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function bn(Fe,Pe){if(Fe){var Zn=function $t(Ze){for(var wn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ri=0;ri<Ze.length;ri++){var We=Ze[ri];if(We[Pe==null?void 0:Pe.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!wn&&Array.isArray(We[Pe==null?void 0:Pe.options])&&$t(We[Pe==null?void 0:Pe.options],!0))break}};Zn(Fe)}}var pe=null,Se=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],ve=["inputValue"];function zn(Fe){return!Fe||(0,qt.Z)(Fe)!=="object"}var kn=Rt.forwardRef(function(Fe,Pe){var Zn=Fe.id,$t=Fe.mode,Ze=Fe.prefixCls,wn=Ze===void 0?"rc-select":Ze,ri=Fe.backfill,We=Fe.fieldNames,je=Fe.inputValue,Vn=Fe.searchValue,ci=Fe.onSearch,Mi=Fe.autoClearSearchValue,pi=Mi===void 0?!0:Mi,oi=Fe.onSelect,hi=Fe.onDeselect,Bi=Fe.dropdownMatchSelectWidth,_i=Bi===void 0?!0:Bi,Ki=Fe.filterOption,en=Fe.filterSort,no=Fe.optionFilterProp,vr=Fe.optionLabelProp,Xr=Fe.options,He=Fe.optionRender,Hn=Fe.children,Fi=Fe.defaultActiveFirstOption,Hi=Fe.menuItemSelectedIcon,Ii=Fe.virtual,Yi=Fe.direction,Ar=Fe.listHeight,Pr=Ar===void 0?200:Ar,Br=Fe.listItemHeight,Fr=Br===void 0?20:Br,fn=Fe.labelRender,io=Fe.value,pn=Fe.defaultValue,Di=Fe.labelInValue,$i=Fe.onChange,Ai=Fe.maxCount,bo=(0,It.Z)(Fe,Se),Fo=(0,di.ZP)(Zn),ao=cn($t),co=!!(!Xr&&Hn),Re=Rt.useMemo(function(){return Ki===void 0&&$t==="combobox"?!1:Ki},[Ki,$t]),mn=Rt.useMemo(function(){return Kt(We,co)},[JSON.stringify(We),co]),Ie=(0,ge.Z)("",{value:Vn!==void 0?Vn:je,postState:function(Kr){return Kr||""}}),At=(0,ue.Z)(Ie,2),Un=At[0],Nn=At[1],Yn=ur(Xr,Hn,mn,no,vr),ai=Yn.valueOptions,vi=Yn.labelOptions,Cn=Yn.options,$n=Rt.useCallback(function($r){var Kr=Ce($r);return Kr.map(function(In){var gr,eo,Vo,Va,Ba;if(zn(In))gr=In;else{var Or;Vo=In.key,eo=In.label,gr=(Or=In.value)!==null&&Or!==void 0?Or:Vo}var fa=ai.get(gr);if(fa){var Sa;if(eo===void 0&&(eo=fa==null?void 0:fa[vr||mn.label]),Vo===void 0&&(Vo=(Sa=fa==null?void 0:fa.key)!==null&&Sa!==void 0?Sa:gr),Va=fa==null?void 0:fa.disabled,Ba=fa==null?void 0:fa.title,0)var Yo}return{label:eo,value:gr,key:Vo,disabled:Va,title:Ba}})},[mn,vr,ai]),ti=(0,ge.Z)(pn,{value:io}),ii=(0,ue.Z)(ti,2),ni=ii[0],Vi=ii[1],Ei=Rt.useMemo(function(){var $r,Kr=ao&&ni===null?[]:ni,In=$n(Kr);return $t==="combobox"&&an(($r=In[0])===null||$r===void 0?void 0:$r.value)?[]:In},[ni,$n,$t,ao]),yi=Rn(Ei,ai),ln=(0,ue.Z)(yi,2),Pi=ln[0],qi=ln[1],Tr=Rt.useMemo(function(){if(!$t&&Pi.length===1){var $r=Pi[0];if($r.value===null&&($r.label===null||$r.label===void 0))return[]}return Pi.map(function(Kr){var In;return(0,Me.Z)((0,Me.Z)({},Kr),{},{label:(In=typeof fn=="function"?fn(Kr):Kr.label)!==null&&In!==void 0?In:Kr.value})})},[$t,Pi,fn]),Lr=Rt.useMemo(function(){return new Set(Pi.map(function($r){return $r.value}))},[Pi]);Rt.useEffect(function(){if($t==="combobox"){var $r,Kr=($r=Pi[0])===null||$r===void 0?void 0:$r.value;Nn(_e(Kr)?String(Kr):"")}},[Pi]);var Rr=Mr(function($r,Kr){var In=Kr!=null?Kr:$r;return(0,le.Z)((0,le.Z)({},mn.value,$r),mn.label,In)}),Zr=Rt.useMemo(function(){if($t!=="tags")return Cn;var $r=(0,Ut.Z)(Cn),Kr=function(gr){return ai.has(gr)};return(0,Ut.Z)(Pi).sort(function(In,gr){return In.value<gr.value?-1:1}).forEach(function(In){var gr=In.value;Kr(gr)||$r.push(Rr(gr,In.label))}),$r},[Rr,Cn,ai,Pi,$t]),jr=xi(Zr,mn,Un,Re,no),Co=Rt.useMemo(function(){return $t!=="tags"||!Un||jr.some(function($r){return $r[no||"value"]===Un})||jr.some(function($r){return $r[mn.value]===Un})?jr:[Rr(Un)].concat((0,Ut.Z)(jr))},[Rr,no,$t,jr,Un,mn]),vo=function $r(Kr){var In=(0,Ut.Z)(Kr).sort(function(gr,eo){return en(gr,eo,{searchValue:Un})});return In.map(function(gr){return Array.isArray(gr.options)?(0,Me.Z)((0,Me.Z)({},gr),{},{options:gr.options.length>0?$r(gr.options):gr.options}):gr})},Uo=Rt.useMemo(function(){return en?vo(Co):Co},[Co,en,Un]),Be=Rt.useMemo(function(){return ye(Uo,{fieldNames:mn,childrenAsData:co})},[Uo,mn,co]),Wr=function(Kr){var In=$n(Kr);if(Vi(In),$i&&(In.length!==Pi.length||In.some(function(Vo,Va){var Ba;return((Ba=Pi[Va])===null||Ba===void 0?void 0:Ba.value)!==(Vo==null?void 0:Vo.value)}))){var gr=Di?In:In.map(function(Vo){return Vo.value}),eo=In.map(function(Vo){return Ue(qi(Vo.value))});$i(ao?gr:gr[0],ao?eo:eo[0])}},qr=Rt.useState(null),fr=(0,ue.Z)(qr,2),Qr=fr[0],hr=fr[1],zo=Rt.useState(0),Eo=(0,ue.Z)(zo,2),Jr=Eo[0],Dr=Eo[1],za=Fi!==void 0?Fi:$t!=="combobox",aa=Rt.useCallback(function($r,Kr){var In=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},gr=In.source,eo=gr===void 0?"keyboard":gr;Dr(Kr),ri&&$t==="combobox"&&$r!==null&&eo==="keyboard"&&hr(String($r))},[ri,$t]),es=function(Kr,In,gr){var eo=function(){var us,Ko=qi(Kr);return[Di?{label:Ko==null?void 0:Ko[mn.label],value:Kr,key:(us=Ko==null?void 0:Ko.key)!==null&&us!==void 0?us:Kr}:Kr,Ue(Ko)]};if(In&&oi){var Vo=eo(),Va=(0,ue.Z)(Vo,2),Ba=Va[0],Or=Va[1];oi(Ba,Or)}else if(!In&&hi&&gr!=="clear"){var fa=eo(),Sa=(0,ue.Z)(fa,2),Yo=Sa[0],No=Sa[1];hi(Yo,No)}},La=Mr(function($r,Kr){var In,gr=ao?Kr.selected:!0;gr?In=ao?[].concat((0,Ut.Z)(Pi),[$r]):[$r]:In=Pi.filter(function(eo){return eo.value!==$r}),Wr(In),es($r,gr),$t==="combobox"?hr(""):(!cn||pi)&&(Nn(""),hr(""))}),ir=function(Kr,In){Wr(Kr);var gr=In.type,eo=In.values;(gr==="remove"||gr==="clear")&&eo.forEach(function(Vo){es(Vo.value,!1,gr)})},_o=function(Kr,In){if(Nn(Kr),hr(null),In.source==="submit"){var gr=(Kr||"").trim();if(gr){var eo=Array.from(new Set([].concat((0,Ut.Z)(Lr),[gr])));Wr(eo),es(gr,!0),Nn("")}return}In.source!=="blur"&&($t==="combobox"&&Wr(Kr),ci==null||ci(Kr))},ia=function(Kr){var In=Kr;$t!=="tags"&&(In=Kr.map(function(eo){var Vo=vi.get(eo);return Vo==null?void 0:Vo.value}).filter(function(eo){return eo!==void 0}));var gr=Array.from(new Set([].concat((0,Ut.Z)(Lr),(0,Ut.Z)(In))));Wr(gr),gr.forEach(function(eo){es(eo,!0)})},ca=Rt.useMemo(function(){var $r=Ii!==!1&&_i!==!1;return(0,Me.Z)((0,Me.Z)({},Yn),{},{flattenOptions:Be,onActiveValue:aa,defaultActiveFirstOption:za,onSelect:La,menuItemSelectedIcon:Hi,rawValues:Lr,fieldNames:mn,virtual:$r,direction:Yi,listHeight:Pr,listItemHeight:Fr,childrenAsData:co,maxCount:Ai,optionRender:He})},[Ai,Yn,Be,aa,za,La,Hi,Lr,mn,Ii,_i,Yi,Pr,Fr,co,He]);return Rt.createElement(Oe.Provider,{value:ca},Rt.createElement(Ti,(0,pt.Z)({},bo,{id:Fo,prefixCls:wn,ref:Pe,omitDomProps:ve,mode:$t,displayValues:Tr,onDisplayValuesChange:ir,direction:Yi,searchValue:Un,onSearch:_o,autoClearSearchValue:pi,onSearchSplit:ia,dropdownMatchSelectWidth:_i,OptionList:gn,emptyOptions:!Be.length,activeValue:Qr,activeDescendantId:"".concat(Fo,"_list_").concat(Jr)})))}),Qn=kn;Qn.Option=Xn,Qn.OptGroup=Je;var $e=Qn,On=$e},63158:function(Dn,Gn,kt){"use strict";var pt=kt(72308),Ut=kt(49618),le=kt(52487),Me=kt(74416),ue=kt(59301),It=kt(92310),qt=kt.n(It),ge=kt(18929),ne=kt(10228),Rt=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],Ae=ue.forwardRef(function(ie,Ee){var Bt,nt=ie.prefixCls,et=nt===void 0?"rc-switch":nt,ht=ie.className,st=ie.checked,gt=ie.defaultChecked,vt=ie.disabled,St=ie.loadingIcon,Et=ie.checkedChildren,Tt=ie.unCheckedChildren,Dt=ie.onClick,Jt=ie.onChange,Yt=ie.onKeyDown,Gt=(0,Me.Z)(ie,Rt),me=(0,ge.Z)(!1,{value:st,defaultValue:gt}),ae=(0,le.Z)(me,2),Ne=ae[0],Ce=ae[1];function we(Ke,oe){var Xt=Ne;return vt||(Xt=Ke,Ce(Xt),Jt==null||Jt(Xt,oe)),Xt}function tn(Ke){Ke.which===ne.Z.LEFT?we(!1,Ke):Ke.which===ne.Z.RIGHT&&we(!0,Ke),Yt==null||Yt(Ke)}function _e(Ke){var oe=we(!Ne,Ke);Dt==null||Dt(oe,Ke)}var an=qt()(et,ht,(Bt={},(0,Ut.Z)(Bt,"".concat(et,"-checked"),Ne),(0,Ut.Z)(Bt,"".concat(et,"-disabled"),vt),Bt));return ue.createElement("button",(0,pt.Z)({},Gt,{type:"button",role:"switch","aria-checked":Ne,disabled:vt,className:an,ref:Ee,onKeyDown:tn,onClick:_e}),St,ue.createElement("span",{className:"".concat(et,"-inner")},ue.createElement("span",{className:"".concat(et,"-inner-checked")},Et),ue.createElement("span",{className:"".concat(et,"-inner-unchecked")},Tt)))});Ae.displayName="Switch",Gn.Z=Ae},67204:function(Dn,Gn,kt){"use strict";kt.d(Gn,{R:function(){return Ut},w:function(){return pt}});var pt={},Ut="rc-table-internal-hook"},78612:function(Dn,Gn,kt){"use strict";kt.d(Gn,{L:function(){return et},Z:function(){return St}});var pt=kt(52487),Ut=kt(49618),le=kt(80702),Me=kt(62853),ue=kt(77321),It=kt(74416),qt=kt(11592),ge=kt(48736),ne=kt(59301),Rt=kt(67204),Ae=kt(90494);function ie(Et){var Tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return typeof Tt=="number"?Tt:Tt.endsWith("%")?Et*parseFloat(Tt)/100:null}function Ee(Et,Tt,Dt){return ne.useMemo(function(){if(Tt&&Tt>0){var Jt=0,Yt=0;Et.forEach(function(_e){var an=ie(Tt,_e.width);an?Jt+=an:Yt+=1});var Gt=Math.max(Tt,Dt),me=Math.max(Gt-Jt,Yt),ae=Yt,Ne=me/Yt,Ce=0,we=Et.map(function(_e){var an=(0,ue.Z)({},_e),Ke=ie(Tt,an.width);if(Ke)an.width=Ke;else{var oe=Math.floor(Ne);an.width=ae===1?me:oe,me-=oe,ae-=1}return Ce+=an.width,an});if(Ce<Gt){var tn=Gt/Ce;me=Gt,we.forEach(function(_e,an){var Ke=Math.floor(_e.width*tn);_e.width=an===we.length-1?me:Ke,me-=Ke})}return[we,Math.max(Ce,Gt)]}return[Et,Tt]},[Et,Tt,Dt])}var Bt=["children"],nt=["fixed"];function et(Et){return(0,qt.Z)(Et).filter(function(Tt){return ne.isValidElement(Tt)}).map(function(Tt){var Dt=Tt.key,Jt=Tt.props,Yt=Jt.children,Gt=(0,It.Z)(Jt,Bt),me=(0,ue.Z)({key:Dt},Gt);return Yt&&(me.children=et(Yt)),me})}function ht(Et){return Et.filter(function(Tt){return Tt&&(0,Me.Z)(Tt)==="object"&&!Tt.hidden}).map(function(Tt){var Dt=Tt.children;return Dt&&Dt.length>0?(0,ue.Z)((0,ue.Z)({},Tt),{},{children:ht(Dt)}):Tt})}function st(Et){var Tt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"key";return Et.filter(function(Dt){return Dt&&(0,Me.Z)(Dt)==="object"}).reduce(function(Dt,Jt,Yt){var Gt=Jt.fixed,me=Gt===!0?"left":Gt,ae="".concat(Tt,"-").concat(Yt),Ne=Jt.children;return Ne&&Ne.length>0?[].concat((0,le.Z)(Dt),(0,le.Z)(st(Ne,ae).map(function(Ce){return(0,ue.Z)({fixed:me},Ce)}))):[].concat((0,le.Z)(Dt),[(0,ue.Z)((0,ue.Z)({key:ae},Jt),{},{fixed:me})])},[])}function gt(Et){return Et.map(function(Tt){var Dt=Tt.fixed,Jt=(0,It.Z)(Tt,nt),Yt=Dt;return Dt==="left"?Yt="right":Dt==="right"&&(Yt="left"),(0,ue.Z)({fixed:Yt},Jt)})}function vt(Et,Tt){var Dt=Et.prefixCls,Jt=Et.columns,Yt=Et.children,Gt=Et.expandable,me=Et.expandedKeys,ae=Et.columnTitle,Ne=Et.getRowKey,Ce=Et.onTriggerExpand,we=Et.expandIcon,tn=Et.rowExpandable,_e=Et.expandIconColumnIndex,an=Et.direction,Ke=Et.expandRowByClick,oe=Et.columnWidth,Xt=Et.fixed,qe=Et.scrollWidth,_n=Et.clientWidth,Pn=ne.useMemo(function(){var ui=Jt||et(Yt)||[];return ht(ui.slice())},[Jt,Yt]),De=ne.useMemo(function(){if(Gt){var ui=Pn.slice();if(!ui.includes(Rt.w)){var _t=_e||0;_t>=0&&(_t||Xt==="left"||!Xt)&&ui.splice(_t,0,Rt.w),Xt==="right"&&ui.splice(Pn.length,0,Rt.w)}var Lt=ui.indexOf(Rt.w);ui=ui.filter(function(Mt,Kt){return Mt!==Rt.w||Kt===Lt});var Pt=Pn[Lt],Nt;Xt?Nt=Xt:Nt=Pt?Pt.fixed:null;var zt=(0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)({},Ae.v,{className:"".concat(Dt,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),"title",ae),"fixed",Nt),"className","".concat(Dt,"-row-expand-icon-cell")),"width",oe),"render",function(Kt,ye,Ue){var Qe=Ne(ye,Ue),ce=me.has(Qe),Oe=tn?tn(ye):!0,Le=we({prefixCls:Dt,expanded:ce,expandable:Oe,record:ye,onExpand:Ce});return Ke?ne.createElement("span",{onClick:function(vn){return vn.stopPropagation()}},Le):Le});return ui.map(function(Mt){return Mt===Rt.w?zt:Mt})}return Pn.filter(function(Mt){return Mt!==Rt.w})},[Gt,Pn,Ne,me,we,an]),dn=ne.useMemo(function(){var ui=De;return Tt&&(ui=Tt(ui)),ui.length||(ui=[{render:function(){return null}}]),ui},[Tt,De,an]),sn=ne.useMemo(function(){return an==="rtl"?gt(st(dn)):st(dn)},[dn,an,qe]),jn=ne.useMemo(function(){for(var ui=-1,_t=sn.length-1;_t>=0;_t-=1){var Lt=sn[_t].fixed;if(Lt==="left"||Lt===!0){ui=_t;break}}if(ui>=0)for(var Pt=0;Pt<=ui;Pt+=1){var Nt=sn[Pt].fixed;if(Nt!=="left"&&Nt!==!0)return!0}var zt=sn.findIndex(function(ye){var Ue=ye.fixed;return Ue==="right"});if(zt>=0)for(var Mt=zt;Mt<sn.length;Mt+=1){var Kt=sn[Mt].fixed;if(Kt!=="right")return!0}return!1},[sn]),Te=Ee(sn,qe,_n),Sn=(0,pt.Z)(Te,2),ee=Sn[0],Mn=Sn[1];return[dn,ee,Mn,jn]}var St=vt},16596:function(Dn,Gn,kt){"use strict";kt.d(Gn,{w2:function(){return pt.w},vP:function(){return gn.v},RQ:function(){return pt.R},ER:function(){return Qe},Q$:function(){return vr},TN:function(){return Fo}});var pt=kt(67204),Ut=kt(52487),le=kt(6089),Me=kt(34280),ue=kt(13697),It=kt(59301),qt=kt(4676);function ge(Re){var mn=It.createContext(void 0),Ie=function(Un){var Nn=Un.value,Yn=Un.children,ai=It.useRef(Nn);ai.current=Nn;var vi=It.useState(function(){return{getValue:function(){return ai.current},listeners:new Set}}),Cn=(0,Ut.Z)(vi,1),$n=Cn[0];return(0,Me.Z)(function(){(0,qt.unstable_batchedUpdates)(function(){$n.listeners.forEach(function(ti){ti(Nn)})})},[Nn]),It.createElement(mn.Provider,{value:$n},Yn)};return{Context:mn,Provider:Ie,defaultValue:Re}}function ne(Re,mn){var Ie=(0,le.Z)(typeof mn=="function"?mn:function(ti){if(mn===void 0)return ti;if(!Array.isArray(mn))return ti[mn];var ii={};return mn.forEach(function(ni){ii[ni]=ti[ni]}),ii}),At=It.useContext(Re==null?void 0:Re.Context),Un=At||{},Nn=Un.listeners,Yn=Un.getValue,ai=It.useRef();ai.current=Ie(At?Yn():Re==null?void 0:Re.defaultValue);var vi=It.useState({}),Cn=(0,Ut.Z)(vi,2),$n=Cn[1];return(0,Me.Z)(function(){if(!At)return;function ti(ii){var ni=Ie(ii);(0,ue.Z)(ai.current,ni,!0)||$n({})}return Nn.add(ti),function(){Nn.delete(ti)}},[At]),ai.current}var Rt=kt(72308),Ae=kt(8654);function ie(){var Re=It.createContext(null);function mn(){return It.useContext(Re)}function Ie(Un,Nn){var Yn=(0,Ae.Yr)(Un),ai=function(Cn,$n){var ti=Yn?{ref:$n}:{},ii=It.useRef(0),ni=It.useRef(Cn),Vi=mn();return Vi!==null?It.createElement(Un,(0,Rt.Z)({},Cn,ti)):((!Nn||Nn(ni.current,Cn))&&(ii.current+=1),ni.current=Cn,It.createElement(Re.Provider,{value:ii.current},It.createElement(Un,(0,Rt.Z)({},Cn,ti))))};return Yn?It.forwardRef(ai):ai}function At(Un,Nn){var Yn=(0,Ae.Yr)(Un),ai=function(Cn,$n){var ti=Yn?{ref:$n}:{};return mn(),It.createElement(Un,(0,Rt.Z)({},Cn,ti))};return Yn?It.memo(It.forwardRef(ai),Nn):It.memo(ai,Nn)}return{makeImmutable:Ie,responseImmutable:At,useImmutableMark:mn}}var Ee=ie(),Bt=Ee.makeImmutable,nt=Ee.responseImmutable,et=Ee.useImmutableMark,ht=ie(),st=ht.makeImmutable,gt=ht.responseImmutable,vt=ht.useImmutableMark,St=ge(),Et=St;function Tt(Re,mn){var Ie=React.useRef(0);Ie.current+=1;var At=React.useRef(Re),Un=[];Object.keys(Re||{}).map(function(Yn){var ai;(Re==null?void 0:Re[Yn])!==((ai=At.current)===null||ai===void 0?void 0:ai[Yn])&&Un.push(Yn)}),At.current=Re;var Nn=React.useRef([]);return Un.length&&(Nn.current=Un),React.useDebugValue(Ie.current),React.useDebugValue(Nn.current.join(", ")),mn&&console.log("".concat(mn,":"),Ie.current,Nn.current),Ie.current}var Dt=null,Jt=null,Yt=kt(62853),Gt=kt(77321),me=kt(49618),ae=kt(92310),Ne=kt.n(ae),Ce=kt(80547),we=kt(97938),tn=kt(48736),_e=It.createContext({renderWithProps:!1}),an=_e,Ke="RC_TABLE_KEY";function oe(Re){return Re==null?[]:Array.isArray(Re)?Re:[Re]}function Xt(Re){var mn=[],Ie={};return Re.forEach(function(At){for(var Un=At||{},Nn=Un.key,Yn=Un.dataIndex,ai=Nn||oe(Yn).join("-")||Ke;Ie[ai];)ai="".concat(ai,"_next");Ie[ai]=!0,mn.push(ai)}),mn}function qe(Re){return Re!=null}function _n(Re){return typeof Re=="number"&&!Number.isNaN(Re)}function Pn(Re){return Re&&(0,Yt.Z)(Re)==="object"&&!Array.isArray(Re)&&!It.isValidElement(Re)}function De(Re,mn,Ie,At,Un,Nn){var Yn=It.useContext(an),ai=vt(),vi=(0,Ce.Z)(function(){if(qe(At))return[At];var Cn=mn==null||mn===""?[]:Array.isArray(mn)?mn:[mn],$n=(0,we.Z)(Re,Cn),ti=$n,ii=void 0;if(Un){var ni=Un($n,Re,Ie);Pn(ni)?(ti=ni.children,ii=ni.props,Yn.renderWithProps=!0):ti=ni}return[ti,ii]},[ai,Re,At,mn,Un,Ie],function(Cn,$n){if(Nn){var ti=(0,Ut.Z)(Cn,2),ii=ti[1],ni=(0,Ut.Z)($n,2),Vi=ni[1];return Nn(Vi,ii)}return Yn.renderWithProps?!0:!(0,ue.Z)(Cn,$n,!0)});return vi}function dn(Re,mn,Ie,At){var Un=Re+mn-1;return Re<=At&&Un>=Ie}function sn(Re,mn){return ne(Et,function(Ie){var At=dn(Re,mn||1,Ie.hoverStartRow,Ie.hoverEndRow);return[At,Ie.onHover]})}var jn=kt(70425),Te=function(mn){var Ie=mn.ellipsis,At=mn.rowType,Un=mn.children,Nn,Yn=Ie===!0?{showTitle:!0}:Ie;return Yn&&(Yn.showTitle||At==="header")&&(typeof Un=="string"||typeof Un=="number"?Nn=Un.toString():It.isValidElement(Un)&&typeof Un.props.children=="string"&&(Nn=Un.props.children)),Nn};function Sn(Re){var mn,Ie,At,Un,Nn,Yn,ai,vi,Cn=Re.component,$n=Re.children,ti=Re.ellipsis,ii=Re.scope,ni=Re.prefixCls,Vi=Re.className,Ei=Re.align,yi=Re.record,ln=Re.render,Pi=Re.dataIndex,qi=Re.renderIndex,Tr=Re.shouldCellUpdate,Lr=Re.index,Rr=Re.rowType,Zr=Re.colSpan,jr=Re.rowSpan,Co=Re.fixLeft,vo=Re.fixRight,Uo=Re.firstFixLeft,Be=Re.lastFixLeft,Wr=Re.firstFixRight,qr=Re.lastFixRight,fr=Re.appendNode,Qr=Re.additionalProps,hr=Qr===void 0?{}:Qr,zo=Re.isSticky,Eo="".concat(ni,"-cell"),Jr=ne(Et,["supportSticky","allColumnsFixedLeft","rowHoverable"]),Dr=Jr.supportSticky,za=Jr.allColumnsFixedLeft,aa=Jr.rowHoverable,es=De(yi,Pi,qi,$n,ln,Tr),La=(0,Ut.Z)(es,2),ir=La[0],_o=La[1],ia={},ca=typeof Co=="number"&&Dr,$r=typeof vo=="number"&&Dr;ca&&(ia.position="sticky",ia.left=Co),$r&&(ia.position="sticky",ia.right=vo);var Kr=(mn=(Ie=(At=_o==null?void 0:_o.colSpan)!==null&&At!==void 0?At:hr.colSpan)!==null&&Ie!==void 0?Ie:Zr)!==null&&mn!==void 0?mn:1,In=(Un=(Nn=(Yn=_o==null?void 0:_o.rowSpan)!==null&&Yn!==void 0?Yn:hr.rowSpan)!==null&&Nn!==void 0?Nn:jr)!==null&&Un!==void 0?Un:1,gr=sn(Lr,In),eo=(0,Ut.Z)(gr,2),Vo=eo[0],Va=eo[1],Ba=(0,jn.zX)(function(us){var Ko;yi&&Va(Lr,Lr+In-1),hr==null||(Ko=hr.onMouseEnter)===null||Ko===void 0||Ko.call(hr,us)}),Or=(0,jn.zX)(function(us){var Ko;yi&&Va(-1,-1),hr==null||(Ko=hr.onMouseLeave)===null||Ko===void 0||Ko.call(hr,us)});if(Kr===0||In===0)return null;var fa=(ai=hr.title)!==null&&ai!==void 0?ai:Te({rowType:Rr,ellipsis:ti,children:ir}),Sa=Ne()(Eo,Vi,(vi={},(0,me.Z)((0,me.Z)((0,me.Z)((0,me.Z)((0,me.Z)((0,me.Z)((0,me.Z)((0,me.Z)((0,me.Z)((0,me.Z)(vi,"".concat(Eo,"-fix-left"),ca&&Dr),"".concat(Eo,"-fix-left-first"),Uo&&Dr),"".concat(Eo,"-fix-left-last"),Be&&Dr),"".concat(Eo,"-fix-left-all"),Be&&za&&Dr),"".concat(Eo,"-fix-right"),$r&&Dr),"".concat(Eo,"-fix-right-first"),Wr&&Dr),"".concat(Eo,"-fix-right-last"),qr&&Dr),"".concat(Eo,"-ellipsis"),ti),"".concat(Eo,"-with-append"),fr),"".concat(Eo,"-fix-sticky"),(ca||$r)&&zo&&Dr),(0,me.Z)(vi,"".concat(Eo,"-row-hover"),!_o&&Vo)),hr.className,_o==null?void 0:_o.className),Yo={};Ei&&(Yo.textAlign=Ei);var No=(0,Gt.Z)((0,Gt.Z)((0,Gt.Z)((0,Gt.Z)({},_o==null?void 0:_o.style),ia),Yo),hr.style),Ka=ir;return(0,Yt.Z)(Ka)==="object"&&!Array.isArray(Ka)&&!It.isValidElement(Ka)&&(Ka=null),ti&&(Be||Wr)&&(Ka=It.createElement("span",{className:"".concat(Eo,"-content")},Ka)),It.createElement(Cn,(0,Rt.Z)({},_o,hr,{className:Sa,style:No,title:fa,scope:ii,onMouseEnter:aa?Ba:void 0,onMouseLeave:aa?Or:void 0,colSpan:Kr!==1?Kr:null,rowSpan:In!==1?In:null}),fr,Ka)}var ee=It.memo(Sn);function Mn(Re,mn,Ie,At,Un){var Nn=Ie[Re]||{},Yn=Ie[mn]||{},ai,vi;Nn.fixed==="left"?ai=At.left[Un==="rtl"?mn:Re]:Yn.fixed==="right"&&(vi=At.right[Un==="rtl"?Re:mn]);var Cn=!1,$n=!1,ti=!1,ii=!1,ni=Ie[mn+1],Vi=Ie[Re-1],Ei=ni&&!ni.fixed||Vi&&!Vi.fixed||Ie.every(function(Tr){return Tr.fixed==="left"});if(Un==="rtl"){if(ai!==void 0){var yi=Vi&&Vi.fixed==="left";ii=!yi&&Ei}else if(vi!==void 0){var ln=ni&&ni.fixed==="right";ti=!ln&&Ei}}else if(ai!==void 0){var Pi=ni&&ni.fixed==="left";Cn=!Pi&&Ei}else if(vi!==void 0){var qi=Vi&&Vi.fixed==="right";$n=!qi&&Ei}return{fixLeft:ai,fixRight:vi,lastFixLeft:Cn,firstFixRight:$n,lastFixRight:ti,firstFixLeft:ii,isSticky:At.isSticky}}var ui=It.createContext({}),_t=ui;function Lt(Re){var mn=Re.className,Ie=Re.index,At=Re.children,Un=Re.colSpan,Nn=Un===void 0?1:Un,Yn=Re.rowSpan,ai=Re.align,vi=ne(Et,["prefixCls","direction"]),Cn=vi.prefixCls,$n=vi.direction,ti=It.useContext(_t),ii=ti.scrollColumnIndex,ni=ti.stickyOffsets,Vi=ti.flattenColumns,Ei=Ie+Nn-1,yi=Ei+1===ii?Nn+1:Nn,ln=Mn(Ie,Ie+yi-1,Vi,ni,$n);return It.createElement(ee,(0,Rt.Z)({className:mn,index:Ie,component:"td",prefixCls:Cn,record:null,dataIndex:null,align:ai,colSpan:yi,rowSpan:Yn,render:function(){return At}},ln))}var Pt=kt(74416),Nt=["children"];function zt(Re){var mn=Re.children,Ie=(0,Pt.Z)(Re,Nt);return It.createElement("tr",Ie,mn)}function Mt(Re){var mn=Re.children;return mn}Mt.Row=zt,Mt.Cell=Lt;var Kt=Mt;function ye(Re){var mn=Re.children,Ie=Re.stickyOffsets,At=Re.flattenColumns,Un=ne(Et,"prefixCls"),Nn=At.length-1,Yn=At[Nn],ai=It.useMemo(function(){return{stickyOffsets:Ie,flattenColumns:At,scrollColumnIndex:Yn!=null&&Yn.scrollbar?Nn:null}},[Yn,At,Nn,Ie]);return It.createElement(_t.Provider,{value:ai},It.createElement("tfoot",{className:"".concat(Un,"-summary")},mn))}var Ue=gt(ye),Qe=Kt,ce=kt(29301),Oe=kt(29194),Le=kt(24514),Xe=kt(75152),vn=kt(26112);function cn(Re,mn,Ie,At,Un,Nn,Yn){Re.push({record:mn,indent:Ie,index:Yn});var ai=Nn(mn),vi=Un==null?void 0:Un.has(ai);if(mn&&Array.isArray(mn[At])&&vi)for(var Cn=0;Cn<mn[At].length;Cn+=1)cn(Re,mn[At][Cn],Ie+1,At,Un,Nn,Cn)}function hn(Re,mn,Ie,At){var Un=It.useMemo(function(){if(Ie!=null&&Ie.size){for(var Nn=[],Yn=0;Yn<(Re==null?void 0:Re.length);Yn+=1){var ai=Re[Yn];cn(Nn,ai,0,mn,Ie,At,Yn)}return Nn}return Re==null?void 0:Re.map(function(vi,Cn){return{record:vi,indent:0,index:Cn}})},[Re,mn,Ie,At]);return Un}function Ti(Re,mn,Ie,At){var Un=ne(Et,["prefixCls","fixedInfoList","flattenColumns","expandableType","expandRowByClick","onTriggerExpand","rowClassName","expandedRowClassName","indentSize","expandIcon","expandedRowRender","expandIconColumnIndex","expandedKeys","childrenColumnName","rowExpandable","onRow"]),Nn=Un.flattenColumns,Yn=Un.expandableType,ai=Un.expandedKeys,vi=Un.childrenColumnName,Cn=Un.onTriggerExpand,$n=Un.rowExpandable,ti=Un.onRow,ii=Un.expandRowByClick,ni=Un.rowClassName,Vi=Yn==="nest",Ei=Yn==="row"&&(!$n||$n(Re)),yi=Ei||Vi,ln=ai&&ai.has(mn),Pi=vi&&Re&&Re[vi],qi=(0,jn.zX)(Cn),Tr=ti==null?void 0:ti(Re,Ie),Lr=Tr==null?void 0:Tr.onClick,Rr=function(vo){ii&&yi&&Cn(Re,vo);for(var Uo=arguments.length,Be=new Array(Uo>1?Uo-1:0),Wr=1;Wr<Uo;Wr++)Be[Wr-1]=arguments[Wr];Lr==null||Lr.apply(void 0,[vo].concat(Be))},Zr;typeof ni=="string"?Zr=ni:typeof ni=="function"&&(Zr=ni(Re,Ie,At));var jr=Xt(Nn);return(0,Gt.Z)((0,Gt.Z)({},Un),{},{columnsKey:jr,nestExpandable:Vi,expanded:ln,hasNestChildren:Pi,record:Re,onTriggerExpand:qi,rowSupportExpand:Ei,expandable:yi,rowProps:(0,Gt.Z)((0,Gt.Z)({},Tr),{},{className:Ne()(Zr,Tr==null?void 0:Tr.className),onClick:Rr})})}function Ge(Re){var mn=Re.prefixCls,Ie=Re.children,At=Re.component,Un=Re.cellComponent,Nn=Re.className,Yn=Re.expanded,ai=Re.colSpan,vi=Re.isEmpty,Cn=ne(Et,["scrollbarSize","fixHeader","fixColumn","componentWidth","horizonScroll"]),$n=Cn.scrollbarSize,ti=Cn.fixHeader,ii=Cn.fixColumn,ni=Cn.componentWidth,Vi=Cn.horizonScroll,Ei=Ie;return(vi?Vi&&ni:ii)&&(Ei=It.createElement("div",{style:{width:ni-(ti&&!vi?$n:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(mn,"-expanded-row-fixed")},Ei)),It.createElement(At,{className:Nn,style:{display:Yn?null:"none"}},It.createElement(ee,{component:Un,prefixCls:mn,colSpan:ai},Ei))}var Je=Ge;function rn(Re){var mn=Re.prefixCls,Ie=Re.record,At=Re.onExpand,Un=Re.expanded,Nn=Re.expandable,Yn="".concat(mn,"-row-expand-icon");if(!Nn)return It.createElement("span",{className:Ne()(Yn,"".concat(mn,"-row-spaced"))});var ai=function(Cn){At(Ie,Cn),Cn.stopPropagation()};return It.createElement("span",{className:Ne()(Yn,(0,me.Z)((0,me.Z)({},"".concat(mn,"-row-expanded"),Un),"".concat(mn,"-row-collapsed"),!Un)),onClick:ai})}function Xn(Re,mn,Ie){var At=[];function Un(Nn){(Nn||[]).forEach(function(Yn,ai){At.push(mn(Yn,ai)),Un(Yn[Ie])})}return Un(Re),At}function Ln(Re,mn,Ie,At){return typeof Re=="string"?Re:typeof Re=="function"?Re(mn,Ie,At):""}function nn(Re,mn,Ie,At,Un){var Nn=Re.record,Yn=Re.prefixCls,ai=Re.columnsKey,vi=Re.fixedInfoList,Cn=Re.expandIconColumnIndex,$n=Re.nestExpandable,ti=Re.indentSize,ii=Re.expandIcon,ni=Re.expanded,Vi=Re.hasNestChildren,Ei=Re.onTriggerExpand,yi=ai[Ie],ln=vi[Ie],Pi;Ie===(Cn||0)&&$n&&(Pi=It.createElement(It.Fragment,null,It.createElement("span",{style:{paddingLeft:"".concat(ti*At,"px")},className:"".concat(Yn,"-row-indent indent-level-").concat(At)}),ii({prefixCls:Yn,expanded:ni,expandable:Vi,record:Nn,onExpand:Ei})));var qi;return mn.onCell&&(qi=mn.onCell(Nn,Un)),{key:yi,fixedInfo:ln,appendCellNode:Pi,additionalCellProps:qi||{}}}function Kn(Re){var mn=Re.className,Ie=Re.style,At=Re.record,Un=Re.index,Nn=Re.renderIndex,Yn=Re.rowKey,ai=Re.indent,vi=ai===void 0?0:ai,Cn=Re.rowComponent,$n=Re.cellComponent,ti=Re.scopeCellComponent,ii=Ti(At,Yn,Un,vi),ni=ii.prefixCls,Vi=ii.flattenColumns,Ei=ii.expandedRowClassName,yi=ii.expandedRowRender,ln=ii.rowProps,Pi=ii.expanded,qi=ii.rowSupportExpand,Tr=It.useRef(!1);Tr.current||(Tr.current=Pi);var Lr=Ln(Ei,At,Un,vi),Rr=It.createElement(Cn,(0,Rt.Z)({},ln,{"data-row-key":Yn,className:Ne()(mn,"".concat(ni,"-row"),"".concat(ni,"-row-level-").concat(vi),ln==null?void 0:ln.className,(0,me.Z)({},Lr,vi>=1)),style:(0,Gt.Z)((0,Gt.Z)({},Ie),ln==null?void 0:ln.style)}),Vi.map(function(Co,vo){var Uo=Co.render,Be=Co.dataIndex,Wr=Co.className,qr=nn(ii,Co,vo,vi,Un),fr=qr.key,Qr=qr.fixedInfo,hr=qr.appendCellNode,zo=qr.additionalCellProps;return It.createElement(ee,(0,Rt.Z)({className:Wr,ellipsis:Co.ellipsis,align:Co.align,scope:Co.rowScope,component:Co.rowScope?ti:$n,prefixCls:ni,key:fr,record:At,index:Un,renderIndex:Nn,dataIndex:Be,render:Uo,shouldCellUpdate:Co.shouldCellUpdate},Qr,{appendNode:hr,additionalProps:zo}))})),Zr;if(qi&&(Tr.current||Pi)){var jr=yi(At,Un,vi+1,Pi);Zr=It.createElement(Je,{expanded:Pi,className:Ne()("".concat(ni,"-expanded-row"),"".concat(ni,"-expanded-row-level-").concat(vi+1),Lr),prefixCls:ni,component:Cn,cellComponent:$n,colSpan:Vi.length,isEmpty:!1},jr)}return It.createElement(It.Fragment,null,Rr,Zr)}var mi=gt(Kn);function ei(Re){var mn=Re.columnKey,Ie=Re.onColumnResize,At=It.useRef();return It.useEffect(function(){At.current&&Ie(mn,At.current.offsetWidth)},[]),It.createElement(ce.Z,{data:mn},It.createElement("td",{ref:At,style:{padding:0,border:0,height:0}},It.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function Si(Re){var mn=Re.prefixCls,Ie=Re.columnsKey,At=Re.onColumnResize;return It.createElement("tr",{"aria-hidden":"true",className:"".concat(mn,"-measure-row"),style:{height:0,fontSize:0}},It.createElement(ce.Z.Collection,{onBatchResize:function(Nn){Nn.forEach(function(Yn){var ai=Yn.data,vi=Yn.size;At(ai,vi.offsetWidth)})}},Ie.map(function(Un){return It.createElement(ei,{key:Un,columnKey:Un,onColumnResize:At})})))}function Wi(Re){var mn=Re.data,Ie=Re.measureColumnWidth,At=ne(Et,["prefixCls","getComponent","onColumnResize","flattenColumns","getRowKey","expandedKeys","childrenColumnName","emptyNode"]),Un=At.prefixCls,Nn=At.getComponent,Yn=At.onColumnResize,ai=At.flattenColumns,vi=At.getRowKey,Cn=At.expandedKeys,$n=At.childrenColumnName,ti=At.emptyNode,ii=hn(mn,$n,Cn,vi),ni=It.useRef({renderWithProps:!1}),Vi=Nn(["body","wrapper"],"tbody"),Ei=Nn(["body","row"],"tr"),yi=Nn(["body","cell"],"td"),ln=Nn(["body","cell"],"th"),Pi;mn.length?Pi=ii.map(function(Tr,Lr){var Rr=Tr.record,Zr=Tr.indent,jr=Tr.index,Co=vi(Rr,Lr);return It.createElement(mi,{key:Co,rowKey:Co,record:Rr,index:Lr,renderIndex:jr,rowComponent:Ei,cellComponent:yi,scopeCellComponent:ln,indent:Zr})}):Pi=It.createElement(Je,{expanded:!0,className:"".concat(Un,"-placeholder"),prefixCls:Un,component:Ei,cellComponent:yi,colSpan:ai.length,isEmpty:!0},ti);var qi=Xt(ai);return It.createElement(an.Provider,{value:ni.current},It.createElement(Vi,{className:"".concat(Un,"-tbody")},Ie&&It.createElement(Si,{prefixCls:Un,columnsKey:qi,onColumnResize:Yn}),Pi))}var An=gt(Wi),gn=kt(90494),Rn=["columnType"];function si(Re){for(var mn=Re.colWidths,Ie=Re.columns,At=Re.columCount,Un=ne(Et,["tableLayout"]),Nn=Un.tableLayout,Yn=[],ai=At||Ie.length,vi=!1,Cn=ai-1;Cn>=0;Cn-=1){var $n=mn[Cn],ti=Ie&&Ie[Cn],ii=void 0,ni=void 0;if(ti&&(ii=ti[gn.v],Nn==="auto"&&(ni=ti.minWidth)),$n||ni||ii||vi){var Vi=ii||{},Ei=Vi.columnType,yi=(0,Pt.Z)(Vi,Rn);Yn.unshift(It.createElement("col",(0,Rt.Z)({key:Cn,style:{width:$n,minWidth:ni}},yi))),vi=!0}}return It.createElement("colgroup",null,Yn)}var xi=si,di=kt(80702),Oi=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"];function wt(Re,mn){return(0,It.useMemo)(function(){for(var Ie=[],At=0;At<mn;At+=1){var Un=Re[At];if(Un!==void 0)Ie[At]=Un;else return null}return Ie},[Re.join("_"),mn])}var yn=It.forwardRef(function(Re,mn){var Ie=Re.className,At=Re.noData,Un=Re.columns,Nn=Re.flattenColumns,Yn=Re.colWidths,ai=Re.columCount,vi=Re.stickyOffsets,Cn=Re.direction,$n=Re.fixHeader,ti=Re.stickyTopOffset,ii=Re.stickyBottomOffset,ni=Re.stickyClassName,Vi=Re.onScroll,Ei=Re.maxContentScroll,yi=Re.children,ln=(0,Pt.Z)(Re,Oi),Pi=ne(Et,["prefixCls","scrollbarSize","isSticky","getComponent"]),qi=Pi.prefixCls,Tr=Pi.scrollbarSize,Lr=Pi.isSticky,Rr=Pi.getComponent,Zr=Rr(["header","table"],"table"),jr=Lr&&!$n?0:Tr,Co=It.useRef(null),vo=It.useCallback(function(zo){(0,Ae.mH)(mn,zo),(0,Ae.mH)(Co,zo)},[]);It.useEffect(function(){var zo;function Eo(Jr){var Dr=Jr,za=Dr.currentTarget,aa=Dr.deltaX;aa&&(Vi({currentTarget:za,scrollLeft:za.scrollLeft+aa}),Jr.preventDefault())}return(zo=Co.current)===null||zo===void 0||zo.addEventListener("wheel",Eo,{passive:!1}),function(){var Jr;(Jr=Co.current)===null||Jr===void 0||Jr.removeEventListener("wheel",Eo)}},[]);var Uo=It.useMemo(function(){return Nn.every(function(zo){return zo.width})},[Nn]),Be=Nn[Nn.length-1],Wr={fixed:Be?Be.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(qi,"-cell-scrollbar")}}},qr=(0,It.useMemo)(function(){return jr?[].concat((0,di.Z)(Un),[Wr]):Un},[jr,Un]),fr=(0,It.useMemo)(function(){return jr?[].concat((0,di.Z)(Nn),[Wr]):Nn},[jr,Nn]),Qr=(0,It.useMemo)(function(){var zo=vi.right,Eo=vi.left;return(0,Gt.Z)((0,Gt.Z)({},vi),{},{left:Cn==="rtl"?[].concat((0,di.Z)(Eo.map(function(Jr){return Jr+jr})),[0]):Eo,right:Cn==="rtl"?zo:[].concat((0,di.Z)(zo.map(function(Jr){return Jr+jr})),[0]),isSticky:Lr})},[jr,vi,Lr]),hr=wt(Yn,ai);return It.createElement("div",{style:(0,Gt.Z)({overflow:"hidden"},Lr?{top:ti,bottom:ii}:{}),ref:vo,className:Ne()(Ie,(0,me.Z)({},ni,!!ni))},It.createElement(Zr,{style:{tableLayout:"fixed",visibility:At||hr?null:"hidden"}},(!At||!Ei||Uo)&&It.createElement(xi,{colWidths:hr?[].concat((0,di.Z)(hr),[jr]):[],columCount:ai+1,columns:fr}),yi((0,Gt.Z)((0,Gt.Z)({},ln),{},{stickyOffsets:Qr,columns:qr,flattenColumns:fr}))))}),Wn=It.memo(yn),ki=function(mn){var Ie=mn.cells,At=mn.stickyOffsets,Un=mn.flattenColumns,Nn=mn.rowComponent,Yn=mn.cellComponent,ai=mn.onHeaderRow,vi=mn.index,Cn=ne(Et,["prefixCls","direction"]),$n=Cn.prefixCls,ti=Cn.direction,ii;ai&&(ii=ai(Ie.map(function(Vi){return Vi.column}),vi));var ni=Xt(Ie.map(function(Vi){return Vi.column}));return It.createElement(Nn,ii,Ie.map(function(Vi,Ei){var yi=Vi.column,ln=Mn(Vi.colStart,Vi.colEnd,Un,At,ti),Pi;return yi&&yi.onHeaderCell&&(Pi=Vi.column.onHeaderCell(yi)),It.createElement(ee,(0,Rt.Z)({},Vi,{scope:yi.title?Vi.colSpan>1?"colgroup":"col":null,ellipsis:yi.ellipsis,align:yi.align,component:Yn,prefixCls:$n,key:ni[Ei]},ln,{additionalProps:Pi,rowType:"header"}))}))},Ui=ki;function ur(Re){var mn=[];function Ie(Yn,ai){var vi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;mn[vi]=mn[vi]||[];var Cn=ai,$n=Yn.filter(Boolean).map(function(ti){var ii={key:ti.key,className:ti.className||"",children:ti.title,column:ti,colStart:Cn},ni=1,Vi=ti.children;return Vi&&Vi.length>0&&(ni=Ie(Vi,Cn,vi+1).reduce(function(Ei,yi){return Ei+yi},0),ii.hasSubColumns=!0),"colSpan"in ti&&(ni=ti.colSpan),"rowSpan"in ti&&(ii.rowSpan=ti.rowSpan),ii.colSpan=ni,ii.colEnd=ii.colStart+ni-1,mn[vi].push(ii),Cn+=ni,ni});return $n}Ie(Re,0);for(var At=mn.length,Un=function(ai){mn[ai].forEach(function(vi){!("rowSpan"in vi)&&!vi.hasSubColumns&&(vi.rowSpan=At-ai)})},Nn=0;Nn<At;Nn+=1)Un(Nn);return mn}var Mr=function(mn){var Ie=mn.stickyOffsets,At=mn.columns,Un=mn.flattenColumns,Nn=mn.onHeaderRow,Yn=ne(Et,["prefixCls","getComponent"]),ai=Yn.prefixCls,vi=Yn.getComponent,Cn=It.useMemo(function(){return ur(At)},[At]),$n=vi(["header","wrapper"],"thead"),ti=vi(["header","row"],"tr"),ii=vi(["header","cell"],"th");return It.createElement($n,{className:"".concat(ai,"-thead")},Cn.map(function(ni,Vi){var Ei=It.createElement(Ui,{key:Vi,flattenColumns:Un,cells:ni,stickyOffsets:Ie,rowComponent:ti,cellComponent:ii,onHeaderRow:Nn,index:Vi});return Ei}))},gi=gt(Mr),bn=kt(78612);function pe(Re,mn,Ie){var At=(0,gn.g)(Re),Un=At.expandIcon,Nn=At.expandedRowKeys,Yn=At.defaultExpandedRowKeys,ai=At.defaultExpandAllRows,vi=At.expandedRowRender,Cn=At.onExpand,$n=At.onExpandedRowsChange,ti=At.childrenColumnName,ii=Un||rn,ni=ti||"children",Vi=It.useMemo(function(){return vi?"row":Re.expandable&&Re.internalHooks===pt.R&&Re.expandable.__PARENT_RENDER_ICON__||mn.some(function(Lr){return Lr&&(0,Yt.Z)(Lr)==="object"&&Lr[ni]})?"nest":!1},[!!vi,mn]),Ei=It.useState(function(){return Yn||(ai?Xn(mn,Ie,ni):[])}),yi=(0,Ut.Z)(Ei,2),ln=yi[0],Pi=yi[1],qi=It.useMemo(function(){return new Set(Nn||ln||[])},[Nn,ln]),Tr=It.useCallback(function(Lr){var Rr=Ie(Lr,mn.indexOf(Lr)),Zr,jr=qi.has(Rr);jr?(qi.delete(Rr),Zr=(0,di.Z)(qi)):Zr=[].concat((0,di.Z)(qi),[Rr]),Pi(Zr),Cn&&Cn(!jr,Lr),$n&&$n(Zr)},[Ie,qi,mn,Cn,$n]);return[At,Vi,qi,ii,ni,Tr]}function Se(Re,mn,Ie){var At=Re.map(function(Un,Nn){return Mn(Nn,Nn,Re,mn,Ie)});return(0,Ce.Z)(function(){return At},[At],function(Un,Nn){return!(0,ue.Z)(Un,Nn)})}function ve(Re){var mn=(0,It.useRef)(Re),Ie=(0,It.useState)({}),At=(0,Ut.Z)(Ie,2),Un=At[1],Nn=(0,It.useRef)(null),Yn=(0,It.useRef)([]);function ai(vi){Yn.current.push(vi);var Cn=Promise.resolve();Nn.current=Cn,Cn.then(function(){if(Nn.current===Cn){var $n=Yn.current,ti=mn.current;Yn.current=[],$n.forEach(function(ii){mn.current=ii(mn.current)}),Nn.current=null,ti!==mn.current&&Un({})}})}return(0,It.useEffect)(function(){return function(){Nn.current=null}},[]),[mn.current,ai]}function zn(Re){var mn=(0,It.useRef)(Re||null),Ie=(0,It.useRef)();function At(){window.clearTimeout(Ie.current)}function Un(Yn){mn.current=Yn,At(),Ie.current=window.setTimeout(function(){mn.current=null,Ie.current=void 0},100)}function Nn(){return mn.current}return(0,It.useEffect)(function(){return At},[]),[Un,Nn]}function kn(){var Re=It.useState(-1),mn=(0,Ut.Z)(Re,2),Ie=mn[0],At=mn[1],Un=It.useState(-1),Nn=(0,Ut.Z)(Un,2),Yn=Nn[0],ai=Nn[1],vi=It.useCallback(function(Cn,$n){At(Cn),ai($n)},[]);return[Ie,Yn,vi]}var Qn=kt(47273),$e=(0,Qn.Z)()?window:null;function On(Re,mn){var Ie=(0,Yt.Z)(Re)==="object"?Re:{},At=Ie.offsetHeader,Un=At===void 0?0:At,Nn=Ie.offsetSummary,Yn=Nn===void 0?0:Nn,ai=Ie.offsetScroll,vi=ai===void 0?0:ai,Cn=Ie.getContainer,$n=Cn===void 0?function(){return $e}:Cn,ti=$n()||$e,ii=!!Re;return It.useMemo(function(){return{isSticky:ii,stickyClassName:ii?"".concat(mn,"-sticky-holder"):"",offsetHeader:Un,offsetSummary:Yn,offsetScroll:vi,container:ti}},[ii,vi,Un,Yn,mn,ti])}function Fe(Re,mn,Ie){var At=(0,It.useMemo)(function(){var Un=mn.length,Nn=function(Cn,$n,ti){for(var ii=[],ni=0,Vi=Cn;Vi!==$n;Vi+=ti)ii.push(ni),mn[Vi].fixed&&(ni+=Re[Vi]||0);return ii},Yn=Nn(0,Un,1),ai=Nn(Un-1,-1,-1).reverse();return Ie==="rtl"?{left:ai,right:Yn}:{left:Yn,right:ai}},[Re,mn,Ie]);return At}var Pe=Fe;function Zn(Re){var mn=Re.className,Ie=Re.children;return It.createElement("div",{className:mn},Ie)}var $t=Zn,Ze=kt(8224),wn=kt(16089),ri=kt(76846);function We(Re){var mn=(0,ri.bn)(Re),Ie=mn.getBoundingClientRect(),At=document.documentElement;return{left:Ie.left+(window.pageXOffset||At.scrollLeft)-(At.clientLeft||document.body.clientLeft||0),top:Ie.top+(window.pageYOffset||At.scrollTop)-(At.clientTop||document.body.clientTop||0)}}var je=function(mn,Ie){var At,Un,Nn=mn.scrollBodyRef,Yn=mn.onScroll,ai=mn.offsetScroll,vi=mn.container,Cn=mn.direction,$n=ne(Et,"prefixCls"),ti=((At=Nn.current)===null||At===void 0?void 0:At.scrollWidth)||0,ii=((Un=Nn.current)===null||Un===void 0?void 0:Un.clientWidth)||0,ni=ti&&ii*(ii/ti),Vi=It.useRef(),Ei=ve({scrollLeft:0,isHiddenScrollBar:!0}),yi=(0,Ut.Z)(Ei,2),ln=yi[0],Pi=yi[1],qi=It.useRef({delta:0,x:0}),Tr=It.useState(!1),Lr=(0,Ut.Z)(Tr,2),Rr=Lr[0],Zr=Lr[1],jr=It.useRef(null);It.useEffect(function(){return function(){wn.Z.cancel(jr.current)}},[]);var Co=function(){Zr(!1)},vo=function(fr){fr.persist(),qi.current.delta=fr.pageX-ln.scrollLeft,qi.current.x=0,Zr(!0),fr.preventDefault()},Uo=function(fr){var Qr,hr=fr||((Qr=window)===null||Qr===void 0?void 0:Qr.event),zo=hr.buttons;if(!Rr||zo===0){Rr&&Zr(!1);return}var Eo=qi.current.x+fr.pageX-qi.current.x-qi.current.delta,Jr=Cn==="rtl";Eo=Math.max(Jr?ni-ii:0,Math.min(Jr?0:ii-ni,Eo));var Dr=!Jr||Math.abs(Eo)+Math.abs(ni)<ii;Dr&&(Yn({scrollLeft:Eo/ii*(ti+2)}),qi.current.x=fr.pageX)},Be=function(){wn.Z.cancel(jr.current),jr.current=(0,wn.Z)(function(){if(Nn.current){var fr=We(Nn.current).top,Qr=fr+Nn.current.offsetHeight,hr=vi===window?document.documentElement.scrollTop+window.innerHeight:We(vi).top+vi.clientHeight;Qr-(0,Xe.Z)()<=hr||fr>=hr-ai?Pi(function(zo){return(0,Gt.Z)((0,Gt.Z)({},zo),{},{isHiddenScrollBar:!0})}):Pi(function(zo){return(0,Gt.Z)((0,Gt.Z)({},zo),{},{isHiddenScrollBar:!1})})}})},Wr=function(fr){Pi(function(Qr){return(0,Gt.Z)((0,Gt.Z)({},Qr),{},{scrollLeft:fr/ti*ii||0})})};return It.useImperativeHandle(Ie,function(){return{setScrollLeft:Wr,checkScrollBarVisible:Be}}),It.useEffect(function(){var qr=(0,Ze.Z)(document.body,"mouseup",Co,!1),fr=(0,Ze.Z)(document.body,"mousemove",Uo,!1);return Be(),function(){qr.remove(),fr.remove()}},[ni,Rr]),It.useEffect(function(){if(Nn.current){for(var qr=[],fr=(0,ri.bn)(Nn.current);fr;)qr.push(fr),fr=fr.parentElement;return qr.forEach(function(Qr){return Qr.addEventListener("scroll",Be,!1)}),window.addEventListener("resize",Be,!1),window.addEventListener("scroll",Be,!1),vi.addEventListener("scroll",Be,!1),function(){qr.forEach(function(Qr){return Qr.removeEventListener("scroll",Be)}),window.removeEventListener("resize",Be),window.removeEventListener("scroll",Be),vi.removeEventListener("scroll",Be)}}},[vi]),It.useEffect(function(){ln.isHiddenScrollBar||Pi(function(qr){var fr=Nn.current;return fr?(0,Gt.Z)((0,Gt.Z)({},qr),{},{scrollLeft:fr.scrollLeft/fr.scrollWidth*fr.clientWidth}):qr})},[ln.isHiddenScrollBar]),ti<=ii||!ni||ln.isHiddenScrollBar?null:It.createElement("div",{style:{height:(0,Xe.Z)(),width:ii,bottom:ai},className:"".concat($n,"-sticky-scroll")},It.createElement("div",{onMouseDown:vo,ref:Vi,className:Ne()("".concat($n,"-sticky-scroll-bar"),(0,me.Z)({},"".concat($n,"-sticky-scroll-bar-active"),Rr)),style:{width:"".concat(ni,"px"),transform:"translate3d(".concat(ln.scrollLeft,"px, 0, 0)")}}))},Vn=It.forwardRef(je);function ci(Re){return null}var Mi=ci;function pi(Re){return null}var oi=pi,hi="rc-table",Bi=[],_i={};function Ki(){return"No Data"}function en(Re,mn){var Ie=(0,Gt.Z)({rowKey:"key",prefixCls:hi,emptyText:Ki},Re),At=Ie.prefixCls,Un=Ie.className,Nn=Ie.rowClassName,Yn=Ie.style,ai=Ie.data,vi=Ie.rowKey,Cn=Ie.scroll,$n=Ie.tableLayout,ti=Ie.direction,ii=Ie.title,ni=Ie.footer,Vi=Ie.summary,Ei=Ie.caption,yi=Ie.id,ln=Ie.showHeader,Pi=Ie.components,qi=Ie.emptyText,Tr=Ie.onRow,Lr=Ie.onHeaderRow,Rr=Ie.onScroll,Zr=Ie.internalHooks,jr=Ie.transformColumns,Co=Ie.internalRefs,vo=Ie.tailor,Uo=Ie.getContainerWidth,Be=Ie.sticky,Wr=Ie.rowHoverable,qr=Wr===void 0?!0:Wr,fr=ai||Bi,Qr=!!fr.length,hr=Zr===pt.R,zo=It.useCallback(function(ko,Oo){return(0,we.Z)(Pi,ko)||Oo},[Pi]),Eo=It.useMemo(function(){return typeof vi=="function"?vi:function(ko){var Oo=ko&&ko[vi];return Oo}},[vi]),Jr=zo(["body"]),Dr=kn(),za=(0,Ut.Z)(Dr,3),aa=za[0],es=za[1],La=za[2],ir=pe(Ie,fr,Eo),_o=(0,Ut.Z)(ir,6),ia=_o[0],ca=_o[1],$r=_o[2],Kr=_o[3],In=_o[4],gr=_o[5],eo=Cn==null?void 0:Cn.x,Vo=It.useState(0),Va=(0,Ut.Z)(Vo,2),Ba=Va[0],Or=Va[1],fa=(0,bn.Z)((0,Gt.Z)((0,Gt.Z)((0,Gt.Z)({},Ie),ia),{},{expandable:!!ia.expandedRowRender,columnTitle:ia.columnTitle,expandedKeys:$r,getRowKey:Eo,onTriggerExpand:gr,expandIcon:Kr,expandIconColumnIndex:ia.expandIconColumnIndex,direction:ti,scrollWidth:hr&&vo&&typeof eo=="number"?eo:null,clientWidth:Ba}),hr?jr:null),Sa=(0,Ut.Z)(fa,4),Yo=Sa[0],No=Sa[1],Ka=Sa[2],us=Sa[3],Ko=Ka!=null?Ka:eo,hs=It.useMemo(function(){return{columns:Yo,flattenColumns:No}},[Yo,No]),Xs=It.useRef(),Ou=It.useRef(),ga=It.useRef(),Iu=It.useRef();It.useImperativeHandle(mn,function(){return{nativeElement:Xs.current,scrollTo:function(Oo){var Pa;if(ga.current instanceof HTMLElement){var is=Oo.index,Ja=Oo.top,Wl=Oo.key;if(_n(Ja)){var kl;(kl=ga.current)===null||kl===void 0||kl.scrollTo({top:Ja})}else{var Vl,Fn=Wl!=null?Wl:Eo(fr[is]);(Vl=ga.current.querySelector('[data-row-key="'.concat(Fn,'"]')))===null||Vl===void 0||Vl.scrollIntoView()}}else(Pa=ga.current)!==null&&Pa!==void 0&&Pa.scrollTo&&ga.current.scrollTo(Oo)}}});var Cu=It.useRef(),Zl=It.useState(!1),Ll=(0,Ut.Z)(Zl,2),js=Ll[0],Fl=Ll[1],ru=It.useState(!1),ou=(0,Ut.Z)(ru,2),xa=ou[0],rl=ou[1],_u=ve(new Map),au=(0,Ut.Z)(_u,2),su=au[0],Xa=au[1],ns=Xt(No),Fa=ns.map(function(ko){return su.get(ko)}),Ma=It.useMemo(function(){return Fa},[Fa.join("_")]),Lo=Pe(Ma,No,ti),ro=Cn&&qe(Cn.y),uo=Cn&&qe(Ko)||!!ia.fixed,Ia=uo&&No.some(function(ko){var Oo=ko.fixed;return Oo}),Ea=It.useRef(),xe=On(Be,At),fe=xe.isSticky,Ve=xe.offsetHeader,Zt=xe.offsetSummary,Ye=xe.offsetScroll,pr=xe.stickyClassName,oo=xe.container,rr=It.useMemo(function(){return Vi==null?void 0:Vi(fr)},[Vi,fr]),Sr=(ro||fe)&&It.isValidElement(rr)&&rr.type===Kt&&rr.props.fixed,xo,Vr,Po;ro&&(Vr={overflowY:Qr?"scroll":"auto",maxHeight:Cn.y}),uo&&(xo={overflowX:"auto"},ro||(Vr={overflowY:"hidden"}),Po={width:Ko===!0?"auto":Ko,minWidth:"100%"});var Ur=It.useCallback(function(ko,Oo){(0,Oe.Z)(Xs.current)&&Xa(function(Pa){if(Pa.get(ko)!==Oo){var is=new Map(Pa);return is.set(ko,Oo),is}return Pa})},[]),Ri=zn(null),Gi=(0,Ut.Z)(Ri,2),kr=Gi[0],wr=Gi[1];function Qi(ko,Oo){Oo&&(typeof Oo=="function"?Oo(ko):Oo.scrollLeft!==ko&&(Oo.scrollLeft=ko,Oo.scrollLeft!==ko&&setTimeout(function(){Oo.scrollLeft=ko},0)))}var ar=(0,le.Z)(function(ko){var Oo=ko.currentTarget,Pa=ko.scrollLeft,is=ti==="rtl",Ja=typeof Pa=="number"?Pa:Oo.scrollLeft,Wl=Oo||_i;if(!wr()||wr()===Wl){var kl;kr(Wl),Qi(Ja,Ou.current),Qi(Ja,ga.current),Qi(Ja,Cu.current),Qi(Ja,(kl=Ea.current)===null||kl===void 0?void 0:kl.setScrollLeft)}var Vl=Oo||Ou.current;if(Vl){var Fn=hr&&vo&&typeof Ko=="number"?Ko:Vl.scrollWidth,sr=Vl.clientWidth;if(Fn===sr){Fl(!1),rl(!1);return}is?(Fl(-Ja<Fn-sr),rl(-Ja>0)):(Fl(Ja>0),rl(Ja<Fn-sr))}}),so=(0,le.Z)(function(ko){ar(ko),Rr==null||Rr(ko)}),xr=function(){if(uo&&ga.current){var Oo;ar({currentTarget:(0,ri.bn)(ga.current),scrollLeft:(Oo=ga.current)===null||Oo===void 0?void 0:Oo.scrollLeft})}else Fl(!1),rl(!1)},Ji=function(Oo){var Pa,is=Oo.width;(Pa=Ea.current)===null||Pa===void 0||Pa.checkScrollBarVisible();var Ja=Xs.current?Xs.current.offsetWidth:is;hr&&Uo&&Xs.current&&(Ja=Uo(Xs.current,Ja)||Ja),Ja!==Ba&&(xr(),Or(Ja))},er=It.useRef(!1);It.useEffect(function(){er.current&&xr()},[uo,ai,Yo.length]),It.useEffect(function(){er.current=!0},[]);var tr=It.useState(0),bi=(0,Ut.Z)(tr,2),ho=bi[0],Ir=bi[1],fo=It.useState(!0),Mo=(0,Ut.Z)(fo,2),dr=Mo[0],po=Mo[1];It.useEffect(function(){(!vo||!hr)&&(ga.current instanceof Element?Ir((0,Xe.o)(ga.current).width):Ir((0,Xe.o)(Iu.current).width)),po((0,Le.G)("position","sticky"))},[]),It.useEffect(function(){hr&&Co&&(Co.body.current=ga.current)});var Za=It.useCallback(function(ko){return It.createElement(It.Fragment,null,It.createElement(gi,ko),Sr==="top"&&It.createElement(Ue,ko,rr))},[Sr,rr]),zi=It.useCallback(function(ko){return It.createElement(Ue,ko,rr)},[rr]),ta=zo(["table"],"table"),Nr=It.useMemo(function(){return $n||(Ia?Ko==="max-content"?"auto":"fixed":ro||fe||No.some(function(ko){var Oo=ko.ellipsis;return Oo})?"fixed":"auto")},[ro,Ia,No,$n,fe]),ra,Aa={colWidths:Ma,columCount:No.length,stickyOffsets:Lo,onHeaderRow:Lr,fixHeader:ro,scroll:Cn},cl=It.useMemo(function(){return Qr?null:typeof qi=="function"?qi():qi},[Qr,qi]),lu=It.createElement(An,{data:fr,measureColumnWidth:ro||uo||fe}),uu=It.createElement(xi,{colWidths:No.map(function(ko){var Oo=ko.width;return Oo}),columns:No}),zs=Ei!=null?It.createElement("caption",{className:"".concat(At,"-caption")},Ei):void 0,Ml=(0,vn.Z)(Ie,{data:!0}),Ro=(0,vn.Z)(Ie,{aria:!0});if(ro||fe){var ds;typeof Jr=="function"?(ds=Jr(fr,{scrollbarSize:ho,ref:ga,onScroll:ar}),Aa.colWidths=No.map(function(ko,Oo){var Pa=ko.width,is=Oo===No.length-1?Pa-ho:Pa;return typeof is=="number"&&!Number.isNaN(is)?is:0})):ds=It.createElement("div",{style:(0,Gt.Z)((0,Gt.Z)({},xo),Vr),onScroll:so,ref:ga,className:Ne()("".concat(At,"-body"))},It.createElement(ta,(0,Rt.Z)({style:(0,Gt.Z)((0,Gt.Z)({},Po),{},{tableLayout:Nr})},Ro),zs,uu,lu,!Sr&&rr&&It.createElement(Ue,{stickyOffsets:Lo,flattenColumns:No},rr)));var hu=(0,Gt.Z)((0,Gt.Z)((0,Gt.Z)({noData:!fr.length,maxContentScroll:uo&&Ko==="max-content"},Aa),hs),{},{direction:ti,stickyClassName:pr,onScroll:ar});ra=It.createElement(It.Fragment,null,ln!==!1&&It.createElement(Wn,(0,Rt.Z)({},hu,{stickyTopOffset:Ve,className:"".concat(At,"-header"),ref:Ou}),Za),ds,Sr&&Sr!=="top"&&It.createElement(Wn,(0,Rt.Z)({},hu,{stickyBottomOffset:Zt,className:"".concat(At,"-summary"),ref:Cu}),zi),fe&&ga.current&&ga.current instanceof Element&&It.createElement(Vn,{ref:Ea,offsetScroll:Ye,scrollBodyRef:ga,onScroll:ar,container:oo,direction:ti}))}else ra=It.createElement("div",{style:(0,Gt.Z)((0,Gt.Z)({},xo),Vr),className:Ne()("".concat(At,"-content")),onScroll:ar,ref:ga},It.createElement(ta,(0,Rt.Z)({style:(0,Gt.Z)((0,Gt.Z)({},Po),{},{tableLayout:Nr})},Ro),zs,uu,ln!==!1&&It.createElement(gi,(0,Rt.Z)({},Aa,hs)),lu,rr&&It.createElement(Ue,{stickyOffsets:Lo,flattenColumns:No},rr)));var Gl=It.createElement("div",(0,Rt.Z)({className:Ne()(At,Un,(0,me.Z)((0,me.Z)((0,me.Z)((0,me.Z)((0,me.Z)((0,me.Z)((0,me.Z)((0,me.Z)((0,me.Z)((0,me.Z)({},"".concat(At,"-rtl"),ti==="rtl"),"".concat(At,"-ping-left"),js),"".concat(At,"-ping-right"),xa),"".concat(At,"-layout-fixed"),$n==="fixed"),"".concat(At,"-fixed-header"),ro),"".concat(At,"-fixed-column"),Ia),"".concat(At,"-fixed-column-gapped"),Ia&&us),"".concat(At,"-scroll-horizontal"),uo),"".concat(At,"-has-fix-left"),No[0]&&No[0].fixed),"".concat(At,"-has-fix-right"),No[No.length-1]&&No[No.length-1].fixed==="right")),style:Yn,id:yi,ref:Xs},Ml),ii&&It.createElement($t,{className:"".concat(At,"-title")},ii(fr)),It.createElement("div",{ref:Iu,className:"".concat(At,"-container")},ra),ni&&It.createElement($t,{className:"".concat(At,"-footer")},ni(fr)));uo&&(Gl=It.createElement(ce.Z,{onResize:Ji},Gl));var Ph=Se(No,Lo,ti),Hl=It.useMemo(function(){return{scrollX:Ko,prefixCls:At,getComponent:zo,scrollbarSize:ho,direction:ti,fixedInfoList:Ph,isSticky:fe,supportSticky:dr,componentWidth:Ba,fixHeader:ro,fixColumn:Ia,horizonScroll:uo,tableLayout:Nr,rowClassName:Nn,expandedRowClassName:ia.expandedRowClassName,expandIcon:Kr,expandableType:ca,expandRowByClick:ia.expandRowByClick,expandedRowRender:ia.expandedRowRender,onTriggerExpand:gr,expandIconColumnIndex:ia.expandIconColumnIndex,indentSize:ia.indentSize,allColumnsFixedLeft:No.every(function(ko){return ko.fixed==="left"}),emptyNode:cl,columns:Yo,flattenColumns:No,onColumnResize:Ur,hoverStartRow:aa,hoverEndRow:es,onHover:La,rowExpandable:ia.rowExpandable,onRow:Tr,getRowKey:Eo,expandedKeys:$r,childrenColumnName:In,rowHoverable:qr}},[Ko,At,zo,ho,ti,Ph,fe,dr,Ba,ro,Ia,uo,Nr,Nn,ia.expandedRowClassName,Kr,ca,ia.expandRowByClick,ia.expandedRowRender,gr,ia.expandIconColumnIndex,ia.indentSize,cl,Yo,No,Ur,aa,es,La,ia.rowExpandable,Tr,Eo,$r,In,qr]);return It.createElement(Et.Provider,{value:Hl},Gl)}var no=It.forwardRef(en);function vr(Re){return st(no,Re)}var Xr=vr();Xr.EXPAND_COLUMN=pt.w,Xr.INTERNAL_HOOKS=pt.R,Xr.Column=Mi,Xr.ColumnGroup=oi,Xr.Summary=Qe;var He=Xr,Hn=kt(45680),Fi=ge(null),Hi=ge(null);function Ii(Re,mn,Ie){var At=mn||1;return Ie[Re+At]-(Ie[Re]||0)}function Yi(Re){var mn=Re.rowInfo,Ie=Re.column,At=Re.colIndex,Un=Re.indent,Nn=Re.index,Yn=Re.component,ai=Re.renderIndex,vi=Re.record,Cn=Re.style,$n=Re.className,ti=Re.inverse,ii=Re.getHeight,ni=Ie.render,Vi=Ie.dataIndex,Ei=Ie.className,yi=Ie.width,ln=ne(Hi,["columnsOffset"]),Pi=ln.columnsOffset,qi=nn(mn,Ie,At,Un,Nn),Tr=qi.key,Lr=qi.fixedInfo,Rr=qi.appendCellNode,Zr=qi.additionalCellProps,jr=Zr.style,Co=Zr.colSpan,vo=Co===void 0?1:Co,Uo=Zr.rowSpan,Be=Uo===void 0?1:Uo,Wr=At-1,qr=Ii(Wr,vo,Pi),fr=vo>1?yi-qr:0,Qr=(0,Gt.Z)((0,Gt.Z)((0,Gt.Z)({},jr),Cn),{},{flex:"0 0 ".concat(qr,"px"),width:"".concat(qr,"px"),marginRight:fr,pointerEvents:"auto"}),hr=It.useMemo(function(){return ti?Be<=1:vo===0||Be===0||Be>1},[Be,vo,ti]);hr?Qr.visibility="hidden":ti&&(Qr.height=ii==null?void 0:ii(Be));var zo=hr?function(){return null}:ni,Eo={};return(Be===0||vo===0)&&(Eo.rowSpan=1,Eo.colSpan=1),It.createElement(ee,(0,Rt.Z)({className:Ne()(Ei,$n),ellipsis:Ie.ellipsis,align:Ie.align,scope:Ie.rowScope,component:Yn,prefixCls:mn.prefixCls,key:Tr,record:vi,index:Nn,renderIndex:ai,dataIndex:Vi,render:zo,shouldCellUpdate:Ie.shouldCellUpdate},Lr,{appendNode:Rr,additionalProps:(0,Gt.Z)((0,Gt.Z)({},Zr),{},{style:Qr},Eo)}))}var Ar=Yi,Pr=["data","index","className","rowKey","style","extra","getHeight"],Br=It.forwardRef(function(Re,mn){var Ie=Re.data,At=Re.index,Un=Re.className,Nn=Re.rowKey,Yn=Re.style,ai=Re.extra,vi=Re.getHeight,Cn=(0,Pt.Z)(Re,Pr),$n=Ie.record,ti=Ie.indent,ii=Ie.index,ni=ne(Et,["prefixCls","flattenColumns","fixColumn","componentWidth","scrollX"]),Vi=ni.scrollX,Ei=ni.flattenColumns,yi=ni.prefixCls,ln=ni.fixColumn,Pi=ni.componentWidth,qi=ne(Fi,["getComponent"]),Tr=qi.getComponent,Lr=Ti($n,Nn,At,ti),Rr=Tr(["body","row"],"div"),Zr=Tr(["body","cell"],"div"),jr=Lr.rowSupportExpand,Co=Lr.expanded,vo=Lr.rowProps,Uo=Lr.expandedRowRender,Be=Lr.expandedRowClassName,Wr;if(jr&&Co){var qr=Uo($n,At,ti+1,Co),fr=Ln(Be,$n,At,ti),Qr={};ln&&(Qr={style:(0,me.Z)({},"--virtual-width","".concat(Pi,"px"))});var hr="".concat(yi,"-expanded-row-cell");Wr=It.createElement(Rr,{className:Ne()("".concat(yi,"-expanded-row"),"".concat(yi,"-expanded-row-level-").concat(ti+1),fr)},It.createElement(ee,{component:Zr,prefixCls:yi,className:Ne()(hr,(0,me.Z)({},"".concat(hr,"-fixed"),ln)),additionalProps:Qr},qr))}var zo=(0,Gt.Z)((0,Gt.Z)({},Yn),{},{width:Vi});ai&&(zo.position="absolute",zo.pointerEvents="none");var Eo=It.createElement(Rr,(0,Rt.Z)({},vo,Cn,{"data-row-key":Nn,ref:jr?null:mn,className:Ne()(Un,"".concat(yi,"-row"),vo==null?void 0:vo.className,(0,me.Z)({},"".concat(yi,"-row-extra"),ai)),style:(0,Gt.Z)((0,Gt.Z)({},zo),vo==null?void 0:vo.style)}),Ei.map(function(Jr,Dr){return It.createElement(Ar,{key:Dr,component:Zr,rowInfo:Lr,column:Jr,colIndex:Dr,indent:ti,index:At,renderIndex:ii,record:$n,inverse:ai,getHeight:vi})}));return jr?It.createElement("div",{ref:mn},Eo,Wr):Eo}),Fr=gt(Br),fn=Fr,io=It.forwardRef(function(Re,mn){var Ie=Re.data,At=Re.onScroll,Un=ne(Et,["flattenColumns","onColumnResize","getRowKey","prefixCls","expandedKeys","childrenColumnName","scrollX","direction"]),Nn=Un.flattenColumns,Yn=Un.onColumnResize,ai=Un.getRowKey,vi=Un.expandedKeys,Cn=Un.prefixCls,$n=Un.childrenColumnName,ti=Un.scrollX,ii=Un.direction,ni=ne(Fi),Vi=ni.sticky,Ei=ni.scrollY,yi=ni.listItemHeight,ln=ni.getComponent,Pi=ni.onScroll,qi=It.useRef(),Tr=hn(Ie,$n,vi,ai),Lr=It.useMemo(function(){var Wr=0;return Nn.map(function(qr){var fr=qr.width,Qr=qr.key;return Wr+=fr,[Qr,fr,Wr]})},[Nn]),Rr=It.useMemo(function(){return Lr.map(function(Wr){return Wr[2]})},[Lr]);It.useEffect(function(){Lr.forEach(function(Wr){var qr=(0,Ut.Z)(Wr,2),fr=qr[0],Qr=qr[1];Yn(fr,Qr)})},[Lr]),It.useImperativeHandle(mn,function(){var Wr,qr={scrollTo:function(Qr){var hr;(hr=qi.current)===null||hr===void 0||hr.scrollTo(Qr)},nativeElement:(Wr=qi.current)===null||Wr===void 0?void 0:Wr.nativeElement};return Object.defineProperty(qr,"scrollLeft",{get:function(){var Qr;return((Qr=qi.current)===null||Qr===void 0?void 0:Qr.getScrollInfo().x)||0},set:function(Qr){var hr;(hr=qi.current)===null||hr===void 0||hr.scrollTo({left:Qr})}}),qr});var Zr=function(qr,fr){var Qr,hr=(Qr=Tr[fr])===null||Qr===void 0?void 0:Qr.record,zo=qr.onCell;if(zo){var Eo,Jr=zo(hr,fr);return(Eo=Jr==null?void 0:Jr.rowSpan)!==null&&Eo!==void 0?Eo:1}return 1},jr=function(qr){var fr=qr.start,Qr=qr.end,hr=qr.getSize,zo=qr.offsetY;if(Qr<0)return null;for(var Eo=Nn.filter(function(Kr){return Zr(Kr,fr)===0}),Jr=fr,Dr=function(In){if(Eo=Eo.filter(function(gr){return Zr(gr,In)===0}),!Eo.length)return Jr=In,1},za=fr;za>=0&&!Dr(za);za-=1);for(var aa=Nn.filter(function(Kr){return Zr(Kr,Qr)!==1}),es=Qr,La=function(In){if(aa=aa.filter(function(gr){return Zr(gr,In)!==1}),!aa.length)return es=Math.max(In-1,Qr),1},ir=Qr;ir<Tr.length&&!La(ir);ir+=1);for(var _o=[],ia=function(In){var gr=Tr[In];if(!gr)return 1;Nn.some(function(eo){return Zr(eo,In)>1})&&_o.push(In)},ca=Jr;ca<=es;ca+=1)ia(ca);var $r=_o.map(function(Kr){var In=Tr[Kr],gr=ai(In.record,Kr),eo=function(Ba){var Or=Kr+Ba-1,fa=ai(Tr[Or].record,Or),Sa=hr(gr,fa);return Sa.bottom-Sa.top},Vo=hr(gr);return It.createElement(fn,{key:Kr,data:In,rowKey:gr,index:Kr,style:{top:-zo+Vo.top},extra:!0,getHeight:eo})});return $r},Co=It.useMemo(function(){return{columnsOffset:Rr}},[Rr]),vo="".concat(Cn,"-tbody"),Uo=ln(["body","wrapper"]),Be={};return Vi&&(Be.position="sticky",Be.bottom=0,(0,Yt.Z)(Vi)==="object"&&Vi.offsetScroll&&(Be.bottom=Vi.offsetScroll)),It.createElement(Hi.Provider,{value:Co},It.createElement(Hn.Z,{fullHeight:!1,ref:qi,prefixCls:"".concat(vo,"-virtual"),styles:{horizontalScrollBar:Be},className:vo,height:Ei,itemHeight:yi||24,data:Tr,itemKey:function(qr){return ai(qr.record)},component:Uo,scrollWidth:ti,direction:ii,onVirtualScroll:function(qr){var fr,Qr=qr.x;At({currentTarget:(fr=qi.current)===null||fr===void 0?void 0:fr.nativeElement,scrollLeft:Qr})},onScroll:Pi,extraRender:jr},function(Wr,qr,fr){var Qr=ai(Wr.record,qr);return It.createElement(fn,{data:Wr,rowKey:Qr,index:qr,style:fr.style})}))}),pn=gt(io),Di=pn,$i=function(mn,Ie){var At=Ie.ref,Un=Ie.onScroll;return It.createElement(Di,{ref:At,data:mn,onScroll:Un})};function Ai(Re,mn){var Ie=Re.data,At=Re.columns,Un=Re.scroll,Nn=Re.sticky,Yn=Re.prefixCls,ai=Yn===void 0?hi:Yn,vi=Re.className,Cn=Re.listItemHeight,$n=Re.components,ti=Re.onScroll,ii=Un||{},ni=ii.x,Vi=ii.y;typeof ni!="number"&&(ni=1),typeof Vi!="number"&&(Vi=500);var Ei=(0,jn.zX)(function(Pi,qi){return(0,we.Z)($n,Pi)||qi}),yi=(0,jn.zX)(ti),ln=It.useMemo(function(){return{sticky:Nn,scrollY:Vi,listItemHeight:Cn,getComponent:Ei,onScroll:yi}},[Nn,Vi,Cn,Ei,yi]);return It.createElement(Fi.Provider,{value:ln},It.createElement(He,(0,Rt.Z)({},Re,{className:Ne()(vi,"".concat(ai,"-virtual")),scroll:(0,Gt.Z)((0,Gt.Z)({},Un),{},{x:ni}),components:(0,Gt.Z)((0,Gt.Z)({},$n),{},{body:Ie!=null&&Ie.length?$i:void 0}),columns:At,internalHooks:pt.R,tailor:!0,ref:mn})))}var bo=It.forwardRef(Ai);function Fo(Re){return st(bo,Re)}var ao=Fo(),co=null},90494:function(Dn,Gn,kt){"use strict";kt.d(Gn,{g:function(){return It},v:function(){return ue}});var pt=kt(77321),Ut=kt(74416),le=kt(48736),Me=["expandable"],ue="RC_TABLE_INTERNAL_COL_DEFINE";function It(qt){var ge=qt.expandable,ne=(0,Ut.Z)(qt,Me),Rt;return"expandable"in qt?Rt=(0,pt.Z)((0,pt.Z)({},ne),ge):Rt=ne,Rt.showExpandColumn===!1&&(Rt.expandIconColumnIndex=-1),Rt}},22711:function(Dn,Gn,kt){"use strict";kt.r(Gn),kt.d(Gn,{ResizableTextArea:function(){return ae},default:function(){return tn}});var pt=kt(72308),Ut=kt(49618),le=kt(77321),Me=kt(80702),ue=kt(52487),It=kt(74416),qt=kt(92310),ge=kt.n(qt),ne=kt(36901),Rt=kt(66003),Ae=kt(30292),ie=kt(18929),Ee=kt(59301),Bt=kt(62853),nt=kt(29301),et=kt(34280),ht=kt(16089),st=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important;
pointer-events: none !important;
`,gt=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],vt={},St;function Et(_e){var an=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ke=_e.getAttribute("id")||_e.getAttribute("data-reactid")||_e.getAttribute("name");if(an&&vt[Ke])return vt[Ke];var oe=window.getComputedStyle(_e),Xt=oe.getPropertyValue("box-sizing")||oe.getPropertyValue("-moz-box-sizing")||oe.getPropertyValue("-webkit-box-sizing"),qe=parseFloat(oe.getPropertyValue("padding-bottom"))+parseFloat(oe.getPropertyValue("padding-top")),_n=parseFloat(oe.getPropertyValue("border-bottom-width"))+parseFloat(oe.getPropertyValue("border-top-width")),Pn=gt.map(function(dn){return"".concat(dn,":").concat(oe.getPropertyValue(dn))}).join(";"),De={sizingStyle:Pn,paddingSize:qe,borderSize:_n,boxSizing:Xt};return an&&Ke&&(vt[Ke]=De),De}function Tt(_e){var an=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ke=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,oe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;St||(St=document.createElement("textarea"),St.setAttribute("tab-index","-1"),St.setAttribute("aria-hidden","true"),St.setAttribute("name","hiddenTextarea"),document.body.appendChild(St)),_e.getAttribute("wrap")?St.setAttribute("wrap",_e.getAttribute("wrap")):St.removeAttribute("wrap");var Xt=Et(_e,an),qe=Xt.paddingSize,_n=Xt.borderSize,Pn=Xt.boxSizing,De=Xt.sizingStyle;St.setAttribute("style","".concat(De,";").concat(st)),St.value=_e.value||_e.placeholder||"";var dn=void 0,sn=void 0,jn,Te=St.scrollHeight;if(Pn==="border-box"?Te+=_n:Pn==="content-box"&&(Te-=qe),Ke!==null||oe!==null){St.value=" ";var Sn=St.scrollHeight-qe;Ke!==null&&(dn=Sn*Ke,Pn==="border-box"&&(dn=dn+qe+_n),Te=Math.max(dn,Te)),oe!==null&&(sn=Sn*oe,Pn==="border-box"&&(sn=sn+qe+_n),jn=Te>sn?"":"hidden",Te=Math.min(sn,Te))}var ee={height:Te,overflowY:jn,resize:"none"};return dn&&(ee.minHeight=dn),sn&&(ee.maxHeight=sn),ee}var Dt=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],Jt=0,Yt=1,Gt=2,me=Ee.forwardRef(function(_e,an){var Ke=_e,oe=Ke.prefixCls,Xt=Ke.defaultValue,qe=Ke.value,_n=Ke.autoSize,Pn=Ke.onResize,De=Ke.className,dn=Ke.style,sn=Ke.disabled,jn=Ke.onChange,Te=Ke.onInternalAutoSize,Sn=(0,It.Z)(Ke,Dt),ee=(0,ie.Z)(Xt,{value:qe,postState:function(Kn){return Kn!=null?Kn:""}}),Mn=(0,ue.Z)(ee,2),ui=Mn[0],_t=Mn[1],Lt=function(Kn){_t(Kn.target.value),jn==null||jn(Kn)},Pt=Ee.useRef();Ee.useImperativeHandle(an,function(){return{textArea:Pt.current}});var Nt=Ee.useMemo(function(){return _n&&(0,Bt.Z)(_n)==="object"?[_n.minRows,_n.maxRows]:[]},[_n]),zt=(0,ue.Z)(Nt,2),Mt=zt[0],Kt=zt[1],ye=!!_n,Ue=function(){try{if(document.activeElement===Pt.current){var Kn=Pt.current,mi=Kn.selectionStart,ei=Kn.selectionEnd,Si=Kn.scrollTop;Pt.current.setSelectionRange(mi,ei),Pt.current.scrollTop=Si}}catch(Wi){}},Qe=Ee.useState(Gt),ce=(0,ue.Z)(Qe,2),Oe=ce[0],Le=ce[1],Xe=Ee.useState(),vn=(0,ue.Z)(Xe,2),cn=vn[0],hn=vn[1],Ti=function(){Le(Jt)};(0,et.Z)(function(){ye&&Ti()},[qe,Mt,Kt,ye]),(0,et.Z)(function(){if(Oe===Jt)Le(Yt);else if(Oe===Yt){var nn=Tt(Pt.current,!1,Mt,Kt);Le(Gt),hn(nn)}else Ue()},[Oe]);var Ge=Ee.useRef(),Je=function(){ht.Z.cancel(Ge.current)},rn=function(Kn){Oe===Gt&&(Pn==null||Pn(Kn),_n&&(Je(),Ge.current=(0,ht.Z)(function(){Ti()})))};Ee.useEffect(function(){return Je},[]);var Xn=ye?cn:null,Ln=(0,le.Z)((0,le.Z)({},dn),Xn);return(Oe===Jt||Oe===Yt)&&(Ln.overflowY="hidden",Ln.overflowX="hidden"),Ee.createElement(nt.Z,{onResize:rn,disabled:!(_n||Pn)},Ee.createElement("textarea",(0,pt.Z)({},Sn,{ref:Pt,style:Ln,className:ge()(oe,De,(0,Ut.Z)({},"".concat(oe,"-disabled"),sn)),disabled:sn,value:ui,onChange:Lt})))}),ae=me,Ne=["defaultValue","value","onFocus","onBlur","onChange","allowClear","maxLength","onCompositionStart","onCompositionEnd","suffix","prefixCls","showCount","count","className","style","disabled","hidden","classNames","styles","onResize","onClear","onPressEnter","readOnly","autoSize","onKeyDown"],Ce=Ee.forwardRef(function(_e,an){var Ke,oe=_e.defaultValue,Xt=_e.value,qe=_e.onFocus,_n=_e.onBlur,Pn=_e.onChange,De=_e.allowClear,dn=_e.maxLength,sn=_e.onCompositionStart,jn=_e.onCompositionEnd,Te=_e.suffix,Sn=_e.prefixCls,ee=Sn===void 0?"rc-textarea":Sn,Mn=_e.showCount,ui=_e.count,_t=_e.className,Lt=_e.style,Pt=_e.disabled,Nt=_e.hidden,zt=_e.classNames,Mt=_e.styles,Kt=_e.onResize,ye=_e.onClear,Ue=_e.onPressEnter,Qe=_e.readOnly,ce=_e.autoSize,Oe=_e.onKeyDown,Le=(0,It.Z)(_e,Ne),Xe=(0,ie.Z)(oe,{value:Xt,defaultValue:oe}),vn=(0,ue.Z)(Xe,2),cn=vn[0],hn=vn[1],Ti=cn==null?"":String(cn),Ge=Ee.useState(!1),Je=(0,ue.Z)(Ge,2),rn=Je[0],Xn=Je[1],Ln=Ee.useRef(!1),nn=Ee.useState(null),Kn=(0,ue.Z)(nn,2),mi=Kn[0],ei=Kn[1],Si=(0,Ee.useRef)(null),Wi=(0,Ee.useRef)(null),An=function(){var Fe;return(Fe=Wi.current)===null||Fe===void 0?void 0:Fe.textArea},gn=function(){An().focus()};(0,Ee.useImperativeHandle)(an,function(){var On;return{resizableTextArea:Wi.current,focus:gn,blur:function(){An().blur()},nativeElement:((On=Si.current)===null||On===void 0?void 0:On.nativeElement)||An()}}),(0,Ee.useEffect)(function(){Xn(function(On){return!Pt&&On})},[Pt]);var Rn=Ee.useState(null),si=(0,ue.Z)(Rn,2),xi=si[0],di=si[1];Ee.useEffect(function(){if(xi){var On;(On=An()).setSelectionRange.apply(On,(0,Me.Z)(xi))}},[xi]);var Oi=(0,Rt.Z)(ui,Mn),wt=(Ke=Oi.max)!==null&&Ke!==void 0?Ke:dn,yn=Number(wt)>0,Wn=Oi.strategy(Ti),ki=!!wt&&Wn>wt,Ui=function(Fe,Pe){var Zn=Pe;!Ln.current&&Oi.exceedFormatter&&Oi.max&&Oi.strategy(Pe)>Oi.max&&(Zn=Oi.exceedFormatter(Pe,{max:Oi.max}),Pe!==Zn&&di([An().selectionStart||0,An().selectionEnd||0])),hn(Zn),(0,Ae.rJ)(Fe.currentTarget,Fe,Pn,Zn)},ur=function(Fe){Ln.current=!0,sn==null||sn(Fe)},Mr=function(Fe){Ln.current=!1,Ui(Fe,Fe.currentTarget.value),jn==null||jn(Fe)},gi=function(Fe){Ui(Fe,Fe.target.value)},bn=function(Fe){Fe.key==="Enter"&&Ue&&Ue(Fe),Oe==null||Oe(Fe)},pe=function(Fe){Xn(!0),qe==null||qe(Fe)},Se=function(Fe){Xn(!1),_n==null||_n(Fe)},ve=function(Fe){hn(""),gn(),(0,Ae.rJ)(An(),Fe,Pn)},zn=Te,kn;Oi.show&&(Oi.showFormatter?kn=Oi.showFormatter({value:Ti,count:Wn,maxLength:wt}):kn="".concat(Wn).concat(yn?" / ".concat(wt):""),zn=Ee.createElement(Ee.Fragment,null,zn,Ee.createElement("span",{className:ge()("".concat(ee,"-data-count"),zt==null?void 0:zt.count),style:Mt==null?void 0:Mt.count},kn)));var Qn=function(Fe){var Pe;Kt==null||Kt(Fe),(Pe=An())!==null&&Pe!==void 0&&Pe.style.height&&ei(!0)},$e=!ce&&!Mn&&!De;return Ee.createElement(ne.BaseInput,{ref:Si,value:Ti,allowClear:De,handleReset:ve,suffix:zn,prefixCls:ee,classNames:(0,le.Z)((0,le.Z)({},zt),{},{affixWrapper:ge()(zt==null?void 0:zt.affixWrapper,(0,Ut.Z)((0,Ut.Z)({},"".concat(ee,"-show-count"),Mn),"".concat(ee,"-textarea-allow-clear"),De))}),disabled:Pt,focused:rn,className:ge()(_t,ki&&"".concat(ee,"-out-of-range")),style:(0,le.Z)((0,le.Z)({},Lt),mi&&!$e?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof kn=="string"?kn:void 0}},hidden:Nt,readOnly:Qe,onClear:ye},Ee.createElement(ae,(0,pt.Z)({},Le,{autoSize:ce,maxLength:dn,onKeyDown:bn,onChange:gi,onFocus:pe,onBlur:Se,onCompositionStart:ur,onCompositionEnd:Mr,className:ge()(zt==null?void 0:zt.textarea),style:(0,le.Z)((0,le.Z)({},Mt==null?void 0:Mt.textarea),{},{resize:Lt==null?void 0:Lt.resize}),disabled:Pt,prefixCls:ee,onResize:Qn,ref:Wi,readOnly:Qe})))}),we=Ce,tn=we},639:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Z:function(){return vt}});var pt=kt(72308),Ut=kt(49618),le=kt(77321),Me=kt(52487),ue=kt(74416),It=kt(59301),qt=kt(92310),ge=kt.n(qt),ne=kt(26112),Rt=kt(30699),Ae=function(Et){for(var Tt=Et.prefixCls,Dt=Et.level,Jt=Et.isStart,Yt=Et.isEnd,Gt="".concat(Tt,"-indent-unit"),me=[],ae=0;ae<Dt;ae+=1)me.push(It.createElement("span",{key:ae,className:ge()(Gt,(0,Ut.Z)((0,Ut.Z)({},"".concat(Gt,"-start"),Jt[ae]),"".concat(Gt,"-end"),Yt[ae]))}));return It.createElement("span",{"aria-hidden":"true",className:"".concat(Tt,"-indent")},me)},ie=It.memo(Ae),Ee=kt(65065),Bt=kt(34061),nt=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],et="open",ht="close",st="---",gt=function(Et){var Tt,Dt,Jt,Yt=Et.eventKey,Gt=Et.className,me=Et.style,ae=Et.dragOver,Ne=Et.dragOverGapTop,Ce=Et.dragOverGapBottom,we=Et.isLeaf,tn=Et.isStart,_e=Et.isEnd,an=Et.expanded,Ke=Et.selected,oe=Et.checked,Xt=Et.halfChecked,qe=Et.loading,_n=Et.domRef,Pn=Et.active,De=Et.data,dn=Et.onMouseMove,sn=Et.selectable,jn=(0,ue.Z)(Et,nt),Te=It.useContext(Rt.k),Sn=It.useContext(Rt.y),ee=It.useRef(null),Mn=It.useState(!1),ui=(0,Me.Z)(Mn,2),_t=ui[0],Lt=ui[1],Pt=!!(Te.disabled||Et.disabled||(Tt=Sn.nodeDisabled)!==null&&Tt!==void 0&&Tt.call(Sn,De)),Nt=It.useMemo(function(){return!Te.checkable||Et.checkable===!1?!1:Te.checkable},[Te.checkable,Et.checkable]),zt=function(Wn){Pt||Te.onNodeSelect(Wn,(0,Bt.F)(Et))},Mt=function(Wn){Pt||!Nt||Et.disableCheckbox||Te.onNodeCheck(Wn,(0,Bt.F)(Et),!oe)},Kt=It.useMemo(function(){return typeof sn=="boolean"?sn:Te.selectable},[sn,Te.selectable]),ye=function(Wn){Te.onNodeClick(Wn,(0,Bt.F)(Et)),Kt?zt(Wn):Mt(Wn)},Ue=function(Wn){Te.onNodeDoubleClick(Wn,(0,Bt.F)(Et))},Qe=function(Wn){Te.onNodeMouseEnter(Wn,(0,Bt.F)(Et))},ce=function(Wn){Te.onNodeMouseLeave(Wn,(0,Bt.F)(Et))},Oe=function(Wn){Te.onNodeContextMenu(Wn,(0,Bt.F)(Et))},Le=It.useMemo(function(){return!!(Te.draggable&&(!Te.draggable.nodeDraggable||Te.draggable.nodeDraggable(De)))},[Te.draggable,De]),Xe=function(Wn){Wn.stopPropagation(),Lt(!0),Te.onNodeDragStart(Wn,Et);try{Wn.dataTransfer.setData("text/plain","")}catch(ki){}},vn=function(Wn){Wn.preventDefault(),Wn.stopPropagation(),Te.onNodeDragEnter(Wn,Et)},cn=function(Wn){Wn.preventDefault(),Wn.stopPropagation(),Te.onNodeDragOver(Wn,Et)},hn=function(Wn){Wn.stopPropagation(),Te.onNodeDragLeave(Wn,Et)},Ti=function(Wn){Wn.stopPropagation(),Lt(!1),Te.onNodeDragEnd(Wn,Et)},Ge=function(Wn){Wn.preventDefault(),Wn.stopPropagation(),Lt(!1),Te.onNodeDrop(Wn,Et)},Je=function(Wn){qe||Te.onNodeExpand(Wn,(0,Bt.F)(Et))},rn=It.useMemo(function(){var yn=(0,Ee.Z)(Te.keyEntities,Yt)||{},Wn=yn.children;return!!(Wn||[]).length},[Te.keyEntities,Yt]),Xn=It.useMemo(function(){return we===!1?!1:we||!Te.loadData&&!rn||Te.loadData&&Et.loaded&&!rn},[we,Te.loadData,rn,Et.loaded]);It.useEffect(function(){qe||typeof Te.loadData=="function"&&an&&!Xn&&!Et.loaded&&Te.onNodeLoad((0,Bt.F)(Et))},[qe,Te.loadData,Te.onNodeLoad,an,Xn,Et]);var Ln=It.useMemo(function(){var yn;return(yn=Te.draggable)!==null&&yn!==void 0&&yn.icon?It.createElement("span",{className:"".concat(Te.prefixCls,"-draggable-icon")},Te.draggable.icon):null},[Te.draggable]),nn=function(Wn){var ki=Et.switcherIcon||Te.switcherIcon;return typeof ki=="function"?ki((0,le.Z)((0,le.Z)({},Et),{},{isLeaf:Wn})):ki},Kn=function(){if(Xn){var Wn=nn(!0);return Wn!==!1?It.createElement("span",{className:ge()("".concat(Te.prefixCls,"-switcher"),"".concat(Te.prefixCls,"-switcher-noop"))},Wn):null}var ki=nn(!1);return ki!==!1?It.createElement("span",{onClick:Je,className:ge()("".concat(Te.prefixCls,"-switcher"),"".concat(Te.prefixCls,"-switcher_").concat(an?et:ht))},ki):null},mi=It.useMemo(function(){if(!Nt)return null;var yn=typeof Nt!="boolean"?Nt:null;return It.createElement("span",{className:ge()("".concat(Te.prefixCls,"-checkbox"),(0,Ut.Z)((0,Ut.Z)((0,Ut.Z)({},"".concat(Te.prefixCls,"-checkbox-checked"),oe),"".concat(Te.prefixCls,"-checkbox-indeterminate"),!oe&&Xt),"".concat(Te.prefixCls,"-checkbox-disabled"),Pt||Et.disableCheckbox)),onClick:Mt,role:"checkbox","aria-checked":Xt?"mixed":oe,"aria-disabled":Pt||Et.disableCheckbox,"aria-label":"Select ".concat(typeof Et.title=="string"?Et.title:"tree node")},yn)},[Nt,oe,Xt,Pt,Et.disableCheckbox,Et.title]),ei=It.useMemo(function(){return Xn?null:an?et:ht},[Xn,an]),Si=It.useMemo(function(){return It.createElement("span",{className:ge()("".concat(Te.prefixCls,"-iconEle"),"".concat(Te.prefixCls,"-icon__").concat(ei||"docu"),(0,Ut.Z)({},"".concat(Te.prefixCls,"-icon_loading"),qe))})},[Te.prefixCls,ei,qe]),Wi=It.useMemo(function(){var yn=!!Te.draggable,Wn=!Et.disabled&&yn&&Te.dragOverNodeKey===Yt;return Wn?Te.dropIndicatorRender({dropPosition:Te.dropPosition,dropLevelOffset:Te.dropLevelOffset,indent:Te.indent,prefixCls:Te.prefixCls,direction:Te.direction}):null},[Te.dropPosition,Te.dropLevelOffset,Te.indent,Te.prefixCls,Te.direction,Te.draggable,Te.dragOverNodeKey,Te.dropIndicatorRender]),An=It.useMemo(function(){var yn=Et.title,Wn=yn===void 0?st:yn,ki="".concat(Te.prefixCls,"-node-content-wrapper"),Ui;if(Te.showIcon){var ur=Et.icon||Te.icon;Ui=ur?It.createElement("span",{className:ge()("".concat(Te.prefixCls,"-iconEle"),"".concat(Te.prefixCls,"-icon__customize"))},typeof ur=="function"?ur(Et):ur):Si}else Te.loadData&&qe&&(Ui=Si);var Mr;return typeof Wn=="function"?Mr=Wn(De):Te.titleRender?Mr=Te.titleRender(De):Mr=Wn,It.createElement("span",{ref:ee,title:typeof Wn=="string"?Wn:"",className:ge()(ki,"".concat(ki,"-").concat(ei||"normal"),(0,Ut.Z)({},"".concat(Te.prefixCls,"-node-selected"),!Pt&&(Ke||_t))),onMouseEnter:Qe,onMouseLeave:ce,onContextMenu:Oe,onClick:ye,onDoubleClick:Ue},Ui,It.createElement("span",{className:"".concat(Te.prefixCls,"-title")},Mr),Wi)},[Te.prefixCls,Te.showIcon,Et,Te.icon,Si,Te.titleRender,De,ei,Qe,ce,Oe,ye,Ue]),gn=(0,ne.Z)(jn,{aria:!0,data:!0}),Rn=(0,Ee.Z)(Te.keyEntities,Yt)||{},si=Rn.level,xi=_e[_e.length-1],di=!Pt&&Le,Oi=Te.draggingNodeKey===Yt,wt=sn!==void 0?{"aria-selected":!!sn}:void 0;return It.createElement("div",(0,pt.Z)({ref:_n,role:"treeitem","aria-expanded":we?void 0:an,className:ge()(Gt,"".concat(Te.prefixCls,"-treenode"),(Jt={},(0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)(Jt,"".concat(Te.prefixCls,"-treenode-disabled"),Pt),"".concat(Te.prefixCls,"-treenode-switcher-").concat(an?"open":"close"),!we),"".concat(Te.prefixCls,"-treenode-checkbox-checked"),oe),"".concat(Te.prefixCls,"-treenode-checkbox-indeterminate"),Xt),"".concat(Te.prefixCls,"-treenode-selected"),Ke),"".concat(Te.prefixCls,"-treenode-loading"),qe),"".concat(Te.prefixCls,"-treenode-active"),Pn),"".concat(Te.prefixCls,"-treenode-leaf-last"),xi),"".concat(Te.prefixCls,"-treenode-draggable"),Le),"dragging",Oi),(0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)((0,Ut.Z)(Jt,"drop-target",Te.dropTargetKey===Yt),"drop-container",Te.dropContainerKey===Yt),"drag-over",!Pt&&ae),"drag-over-gap-top",!Pt&&Ne),"drag-over-gap-bottom",!Pt&&Ce),"filter-node",(Dt=Te.filterTreeNode)===null||Dt===void 0?void 0:Dt.call(Te,(0,Bt.F)(Et))),"".concat(Te.prefixCls,"-treenode-leaf"),Xn))),style:me,draggable:di,onDragStart:di?Xe:void 0,onDragEnter:Le?vn:void 0,onDragOver:Le?cn:void 0,onDragLeave:Le?hn:void 0,onDrop:Le?Ge:void 0,onDragEnd:Le?Ti:void 0,onMouseMove:dn},wt,gn),It.createElement(ie,{prefixCls:Te.prefixCls,level:si,isStart:tn,isEnd:_e}),Ln,Kn(),mi,An)};gt.isTreeNode=1;var vt=gt},30699:function(Dn,Gn,kt){"use strict";kt.d(Gn,{k:function(){return Ut},y:function(){return le}});var pt=kt(59301),Ut=pt.createContext(null),le=pt.createContext({})},15018:function(Dn,Gn,kt){"use strict";kt.d(Gn,{OF:function(){return Yt.Z},y6:function(){return ht.y},ZP:function(){return Pt}});var pt=kt(72308),Ut=kt(62853),le=kt(77321),Me=kt(80702),ue=kt(96949),It=kt(55090),qt=kt(80237),ge=kt(77205),ne=kt(38793),Rt=kt(49618),Ae=kt(92310),ie=kt.n(Ae),Ee=kt(10228),Bt=kt(26112),nt=kt(48736),et=kt(59301),ht=kt(30699),st=function(zt){var Mt=zt.dropPosition,Kt=zt.dropLevelOffset,ye=zt.indent,Ue={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(Mt){case-1:Ue.top=0,Ue.left=-Kt*ye;break;case 1:Ue.bottom=0,Ue.left=-Kt*ye;break;case 0:Ue.bottom=0,Ue.left=ye;break}return et.createElement("div",{style:Ue})},gt=st;function vt(Nt){if(Nt==null)throw new TypeError("Cannot destructure "+Nt)}var St=kt(52487),Et=kt(74416),Tt=kt(34280),Dt=kt(45680),Jt=kt(77900),Yt=kt(639);function Gt(Nt,zt){var Mt=et.useState(!1),Kt=(0,St.Z)(Mt,2),ye=Kt[0],Ue=Kt[1];(0,Tt.Z)(function(){if(ye)return Nt(),function(){zt()}},[ye]),(0,Tt.Z)(function(){return Ue(!0),function(){Ue(!1)}},[])}var me=Gt,ae=kt(34061),Ne=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],Ce=et.forwardRef(function(Nt,zt){var Mt=Nt.className,Kt=Nt.style,ye=Nt.motion,Ue=Nt.motionNodes,Qe=Nt.motionType,ce=Nt.onMotionStart,Oe=Nt.onMotionEnd,Le=Nt.active,Xe=Nt.treeNodeRequiredProps,vn=(0,Et.Z)(Nt,Ne),cn=et.useState(!0),hn=(0,St.Z)(cn,2),Ti=hn[0],Ge=hn[1],Je=et.useContext(ht.k),rn=Je.prefixCls,Xn=Ue&&Qe!=="hide";(0,Tt.Z)(function(){Ue&&Xn!==Ti&&Ge(Xn)},[Ue]);var Ln=function(){Ue&&ce()},nn=et.useRef(!1),Kn=function(){Ue&&!nn.current&&(nn.current=!0,Oe())};me(Ln,Kn);var mi=function(Si){Xn===Si&&Kn()};return Ue?et.createElement(Jt.default,(0,pt.Z)({ref:zt,visible:Ti},ye,{motionAppear:Qe==="show",onVisibleChanged:mi}),function(ei,Si){var Wi=ei.className,An=ei.style;return et.createElement("div",{ref:Si,className:ie()("".concat(rn,"-treenode-motion"),Wi),style:An},Ue.map(function(gn){var Rn=Object.assign({},(vt(gn.data),gn.data)),si=gn.title,xi=gn.key,di=gn.isStart,Oi=gn.isEnd;delete Rn.children;var wt=(0,ae.H8)(xi,Xe);return et.createElement(Yt.Z,(0,pt.Z)({},Rn,wt,{title:si,active:Le,data:gn.data,key:xi,isStart:di,isEnd:Oi}))}))}):et.createElement(Yt.Z,(0,pt.Z)({domRef:zt,className:Mt,style:Kt},vn,{active:Le}))}),we=Ce;function tn(){var Nt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],zt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Mt=Nt.length,Kt=zt.length;if(Math.abs(Mt-Kt)!==1)return{add:!1,key:null};function ye(Ue,Qe){var ce=new Map;Ue.forEach(function(Le){ce.set(Le,!0)});var Oe=Qe.filter(function(Le){return!ce.has(Le)});return Oe.length===1?Oe[0]:null}return Mt<Kt?{add:!0,key:ye(Nt,zt)}:{add:!1,key:ye(zt,Nt)}}function _e(Nt,zt,Mt){var Kt=Nt.findIndex(function(ce){return ce.key===Mt}),ye=Nt[Kt+1],Ue=zt.findIndex(function(ce){return ce.key===Mt});if(ye){var Qe=zt.findIndex(function(ce){return ce.key===ye.key});return zt.slice(Ue+1,Qe)}return zt.slice(Ue+1)}var an=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","scrollWidth","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],Ke={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},oe=function(){},Xt="RC_TREE_MOTION_".concat(Math.random()),qe={key:Xt},_n={key:Xt,level:0,index:0,pos:"0",node:qe,nodes:[qe]},Pn={parent:null,children:[],pos:_n.pos,data:qe,title:null,key:Xt,isStart:[],isEnd:[]};function De(Nt,zt,Mt,Kt){return zt===!1||!Mt?Nt:Nt.slice(0,Math.ceil(Mt/Kt)+1)}function dn(Nt){var zt=Nt.key,Mt=Nt.pos;return(0,ae.km)(zt,Mt)}function sn(Nt){for(var zt=String(Nt.data.key),Mt=Nt;Mt.parent;)Mt=Mt.parent,zt="".concat(Mt.data.key," > ").concat(zt);return zt}var jn=et.forwardRef(function(Nt,zt){var Mt=Nt.prefixCls,Kt=Nt.data,ye=Nt.selectable,Ue=Nt.checkable,Qe=Nt.expandedKeys,ce=Nt.selectedKeys,Oe=Nt.checkedKeys,Le=Nt.loadedKeys,Xe=Nt.loadingKeys,vn=Nt.halfCheckedKeys,cn=Nt.keyEntities,hn=Nt.disabled,Ti=Nt.dragging,Ge=Nt.dragOverNodeKey,Je=Nt.dropPosition,rn=Nt.motion,Xn=Nt.height,Ln=Nt.itemHeight,nn=Nt.virtual,Kn=Nt.scrollWidth,mi=Nt.focusable,ei=Nt.activeItem,Si=Nt.focused,Wi=Nt.tabIndex,An=Nt.onKeyDown,gn=Nt.onFocus,Rn=Nt.onBlur,si=Nt.onActiveChange,xi=Nt.onListChangeStart,di=Nt.onListChangeEnd,Oi=(0,Et.Z)(Nt,an),wt=et.useRef(null),yn=et.useRef(null);et.useImperativeHandle(zt,function(){return{scrollTo:function(ci){wt.current.scrollTo(ci)},getIndentWidth:function(){return yn.current.offsetWidth}}});var Wn=et.useState(Qe),ki=(0,St.Z)(Wn,2),Ui=ki[0],ur=ki[1],Mr=et.useState(Kt),gi=(0,St.Z)(Mr,2),bn=gi[0],pe=gi[1],Se=et.useState(Kt),ve=(0,St.Z)(Se,2),zn=ve[0],kn=ve[1],Qn=et.useState([]),$e=(0,St.Z)(Qn,2),On=$e[0],Fe=$e[1],Pe=et.useState(null),Zn=(0,St.Z)(Pe,2),$t=Zn[0],Ze=Zn[1],wn=et.useRef(Kt);wn.current=Kt;function ri(){var Vn=wn.current;pe(Vn),kn(Vn),Fe([]),Ze(null),di()}(0,Tt.Z)(function(){ur(Qe);var Vn=tn(Ui,Qe);if(Vn.key!==null)if(Vn.add){var ci=bn.findIndex(function(_i){var Ki=_i.key;return Ki===Vn.key}),Mi=De(_e(bn,Kt,Vn.key),nn,Xn,Ln),pi=bn.slice();pi.splice(ci+1,0,Pn),kn(pi),Fe(Mi),Ze("show")}else{var oi=Kt.findIndex(function(_i){var Ki=_i.key;return Ki===Vn.key}),hi=De(_e(Kt,bn,Vn.key),nn,Xn,Ln),Bi=Kt.slice();Bi.splice(oi+1,0,Pn),kn(Bi),Fe(hi),Ze("hide")}else bn!==Kt&&(pe(Kt),kn(Kt))},[Qe,Kt]),et.useEffect(function(){Ti||ri()},[Ti]);var We=rn?zn:Kt,je={expandedKeys:Qe,selectedKeys:ce,loadedKeys:Le,loadingKeys:Xe,checkedKeys:Oe,halfCheckedKeys:vn,dragOverNodeKey:Ge,dropPosition:Je,keyEntities:cn};return et.createElement(et.Fragment,null,Si&&ei&&et.createElement("span",{style:Ke,"aria-live":"assertive"},sn(ei)),et.createElement("div",null,et.createElement("input",{style:Ke,disabled:mi===!1||hn,tabIndex:mi!==!1?Wi:null,onKeyDown:An,onFocus:gn,onBlur:Rn,value:"",onChange:oe,"aria-label":"for screen reader"})),et.createElement("div",{className:"".concat(Mt,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},et.createElement("div",{className:"".concat(Mt,"-indent")},et.createElement("div",{ref:yn,className:"".concat(Mt,"-indent-unit")}))),et.createElement(Dt.Z,(0,pt.Z)({},Oi,{data:We,itemKey:dn,height:Xn,fullHeight:!1,virtual:nn,itemHeight:Ln,scrollWidth:Kn,prefixCls:"".concat(Mt,"-list"),ref:wt,role:"tree",onVisibleChange:function(ci){ci.every(function(Mi){return dn(Mi)!==Xt})&&ri()}}),function(Vn){var ci=Vn.pos,Mi=Object.assign({},(vt(Vn.data),Vn.data)),pi=Vn.title,oi=Vn.key,hi=Vn.isStart,Bi=Vn.isEnd,_i=(0,ae.km)(oi,ci);delete Mi.key,delete Mi.children;var Ki=(0,ae.H8)(_i,je);return et.createElement(we,(0,pt.Z)({},Mi,Ki,{title:pi,active:!!ei&&oi===ei.key,pos:ci,data:Vn.data,isStart:hi,isEnd:Bi,motion:rn,motionNodes:oi===Xt?On:null,motionType:$t,onMotionStart:xi,onMotionEnd:ri,treeNodeRequiredProps:je,onMouseMove:function(){si(null)}}))}))}),Te=jn,Sn=kt(82661),ee=kt(34643),Mn=kt(65065),ui=10,_t=function(Nt){(0,ge.Z)(Mt,Nt);var zt=(0,ne.Z)(Mt);function Mt(){var Kt;(0,ue.Z)(this,Mt);for(var ye=arguments.length,Ue=new Array(ye),Qe=0;Qe<ye;Qe++)Ue[Qe]=arguments[Qe];return Kt=zt.call.apply(zt,[this].concat(Ue)),(0,Rt.Z)((0,qt.Z)(Kt),"destroyed",!1),(0,Rt.Z)((0,qt.Z)(Kt),"delayedDragEnterLogic",void 0),(0,Rt.Z)((0,qt.Z)(Kt),"loadingRetryTimes",{}),(0,Rt.Z)((0,qt.Z)(Kt),"state",{keyEntities:{},indent:null,selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],draggingNodeKey:null,dragChildrenKeys:[],dropTargetKey:null,dropPosition:null,dropContainerKey:null,dropLevelOffset:null,dropTargetPos:null,dropAllowed:!0,dragOverNodeKey:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null,fieldNames:(0,ae.w$)()}),(0,Rt.Z)((0,qt.Z)(Kt),"dragStartMousePosition",null),(0,Rt.Z)((0,qt.Z)(Kt),"dragNodeProps",null),(0,Rt.Z)((0,qt.Z)(Kt),"currentMouseOverDroppableNodeKey",null),(0,Rt.Z)((0,qt.Z)(Kt),"listRef",et.createRef()),(0,Rt.Z)((0,qt.Z)(Kt),"onNodeDragStart",function(ce,Oe){var Le=Kt.state,Xe=Le.expandedKeys,vn=Le.keyEntities,cn=Kt.props.onDragStart,hn=Oe.eventKey;Kt.dragNodeProps=Oe,Kt.dragStartMousePosition={x:ce.clientX,y:ce.clientY};var Ti=(0,Sn._5)(Xe,hn);Kt.setState({draggingNodeKey:hn,dragChildrenKeys:(0,Sn.wA)(hn,vn),indent:Kt.listRef.current.getIndentWidth()}),Kt.setExpandedKeys(Ti),window.addEventListener("dragend",Kt.onWindowDragEnd),cn==null||cn({event:ce,node:(0,ae.F)(Oe)})}),(0,Rt.Z)((0,qt.Z)(Kt),"onNodeDragEnter",function(ce,Oe){var Le=Kt.state,Xe=Le.expandedKeys,vn=Le.keyEntities,cn=Le.dragChildrenKeys,hn=Le.flattenNodes,Ti=Le.indent,Ge=Kt.props,Je=Ge.onDragEnter,rn=Ge.onExpand,Xn=Ge.allowDrop,Ln=Ge.direction,nn=Oe.pos,Kn=Oe.eventKey;if(Kt.currentMouseOverDroppableNodeKey!==Kn&&(Kt.currentMouseOverDroppableNodeKey=Kn),!Kt.dragNodeProps){Kt.resetDragState();return}var mi=(0,Sn.OM)(ce,Kt.dragNodeProps,Oe,Ti,Kt.dragStartMousePosition,Xn,hn,vn,Xe,Ln),ei=mi.dropPosition,Si=mi.dropLevelOffset,Wi=mi.dropTargetKey,An=mi.dropContainerKey,gn=mi.dropTargetPos,Rn=mi.dropAllowed,si=mi.dragOverNodeKey;if(cn.includes(Wi)||!Rn){Kt.resetDragState();return}if(Kt.delayedDragEnterLogic||(Kt.delayedDragEnterLogic={}),Object.keys(Kt.delayedDragEnterLogic).forEach(function(xi){clearTimeout(Kt.delayedDragEnterLogic[xi])}),Kt.dragNodeProps.eventKey!==Oe.eventKey&&(ce.persist(),Kt.delayedDragEnterLogic[nn]=window.setTimeout(function(){if(Kt.state.draggingNodeKey!==null){var xi=(0,Me.Z)(Xe),di=(0,Mn.Z)(vn,Oe.eventKey);di&&(di.children||[]).length&&(xi=(0,Sn.L0)(Xe,Oe.eventKey)),Kt.props.hasOwnProperty("expandedKeys")||Kt.setExpandedKeys(xi),rn==null||rn(xi,{node:(0,ae.F)(Oe),expanded:!0,nativeEvent:ce.nativeEvent})}},800)),Kt.dragNodeProps.eventKey===Wi&&Si===0){Kt.resetDragState();return}Kt.setState({dragOverNodeKey:si,dropPosition:ei,dropLevelOffset:Si,dropTargetKey:Wi,dropContainerKey:An,dropTargetPos:gn,dropAllowed:Rn}),Je==null||Je({event:ce,node:(0,ae.F)(Oe),expandedKeys:Xe})}),(0,Rt.Z)((0,qt.Z)(Kt),"onNodeDragOver",function(ce,Oe){var Le=Kt.state,Xe=Le.dragChildrenKeys,vn=Le.flattenNodes,cn=Le.keyEntities,hn=Le.expandedKeys,Ti=Le.indent,Ge=Kt.props,Je=Ge.onDragOver,rn=Ge.allowDrop,Xn=Ge.direction;if(Kt.dragNodeProps){var Ln=(0,Sn.OM)(ce,Kt.dragNodeProps,Oe,Ti,Kt.dragStartMousePosition,rn,vn,cn,hn,Xn),nn=Ln.dropPosition,Kn=Ln.dropLevelOffset,mi=Ln.dropTargetKey,ei=Ln.dropContainerKey,Si=Ln.dropTargetPos,Wi=Ln.dropAllowed,An=Ln.dragOverNodeKey;Xe.includes(mi)||!Wi||(Kt.dragNodeProps.eventKey===mi&&Kn===0?Kt.state.dropPosition===null&&Kt.state.dropLevelOffset===null&&Kt.state.dropTargetKey===null&&Kt.state.dropContainerKey===null&&Kt.state.dropTargetPos===null&&Kt.state.dropAllowed===!1&&Kt.state.dragOverNodeKey===null||Kt.resetDragState():nn===Kt.state.dropPosition&&Kn===Kt.state.dropLevelOffset&&mi===Kt.state.dropTargetKey&&ei===Kt.state.dropContainerKey&&Si===Kt.state.dropTargetPos&&Wi===Kt.state.dropAllowed&&An===Kt.state.dragOverNodeKey||Kt.setState({dropPosition:nn,dropLevelOffset:Kn,dropTargetKey:mi,dropContainerKey:ei,dropTargetPos:Si,dropAllowed:Wi,dragOverNodeKey:An}),Je==null||Je({event:ce,node:(0,ae.F)(Oe)}))}}),(0,Rt.Z)((0,qt.Z)(Kt),"onNodeDragLeave",function(ce,Oe){Kt.currentMouseOverDroppableNodeKey===Oe.eventKey&&!ce.currentTarget.contains(ce.relatedTarget)&&(Kt.resetDragState(),Kt.currentMouseOverDroppableNodeKey=null);var Le=Kt.props.onDragLeave;Le==null||Le({event:ce,node:(0,ae.F)(Oe)})}),(0,Rt.Z)((0,qt.Z)(Kt),"onWindowDragEnd",function(ce){Kt.onNodeDragEnd(ce,null,!0),window.removeEventListener("dragend",Kt.onWindowDragEnd)}),(0,Rt.Z)((0,qt.Z)(Kt),"onNodeDragEnd",function(ce,Oe){var Le=Kt.props.onDragEnd;Kt.setState({dragOverNodeKey:null}),Kt.cleanDragState(),Le==null||Le({event:ce,node:(0,ae.F)(Oe)}),Kt.dragNodeProps=null,window.removeEventListener("dragend",Kt.onWindowDragEnd)}),(0,Rt.Z)((0,qt.Z)(Kt),"onNodeDrop",function(ce,Oe){var Le,Xe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,vn=Kt.state,cn=vn.dragChildrenKeys,hn=vn.dropPosition,Ti=vn.dropTargetKey,Ge=vn.dropTargetPos,Je=vn.dropAllowed;if(Je){var rn=Kt.props.onDrop;if(Kt.setState({dragOverNodeKey:null}),Kt.cleanDragState(),Ti!==null){var Xn=(0,le.Z)((0,le.Z)({},(0,ae.H8)(Ti,Kt.getTreeNodeRequiredProps())),{},{active:((Le=Kt.getActiveItem())===null||Le===void 0?void 0:Le.key)===Ti,data:(0,Mn.Z)(Kt.state.keyEntities,Ti).node}),Ln=cn.includes(Ti);(0,nt.ZP)(!Ln,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var nn=(0,Sn.yx)(Ge),Kn={event:ce,node:(0,ae.F)(Xn),dragNode:Kt.dragNodeProps?(0,ae.F)(Kt.dragNodeProps):null,dragNodesKeys:[Kt.dragNodeProps.eventKey].concat(cn),dropToGap:hn!==0,dropPosition:hn+Number(nn[nn.length-1])};Xe||rn==null||rn(Kn),Kt.dragNodeProps=null}}}),(0,Rt.Z)((0,qt.Z)(Kt),"cleanDragState",function(){var ce=Kt.state.draggingNodeKey;ce!==null&&Kt.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),Kt.dragStartMousePosition=null,Kt.currentMouseOverDroppableNodeKey=null}),(0,Rt.Z)((0,qt.Z)(Kt),"triggerExpandActionExpand",function(ce,Oe){var Le=Kt.state,Xe=Le.expandedKeys,vn=Le.flattenNodes,cn=Oe.expanded,hn=Oe.key,Ti=Oe.isLeaf;if(!(Ti||ce.shiftKey||ce.metaKey||ce.ctrlKey)){var Ge=vn.filter(function(rn){return rn.key===hn})[0],Je=(0,ae.F)((0,le.Z)((0,le.Z)({},(0,ae.H8)(hn,Kt.getTreeNodeRequiredProps())),{},{data:Ge.data}));Kt.setExpandedKeys(cn?(0,Sn._5)(Xe,hn):(0,Sn.L0)(Xe,hn)),Kt.onNodeExpand(ce,Je)}}),(0,Rt.Z)((0,qt.Z)(Kt),"onNodeClick",function(ce,Oe){var Le=Kt.props,Xe=Le.onClick,vn=Le.expandAction;vn==="click"&&Kt.triggerExpandActionExpand(ce,Oe),Xe==null||Xe(ce,Oe)}),(0,Rt.Z)((0,qt.Z)(Kt),"onNodeDoubleClick",function(ce,Oe){var Le=Kt.props,Xe=Le.onDoubleClick,vn=Le.expandAction;vn==="doubleClick"&&Kt.triggerExpandActionExpand(ce,Oe),Xe==null||Xe(ce,Oe)}),(0,Rt.Z)((0,qt.Z)(Kt),"onNodeSelect",function(ce,Oe){var Le=Kt.state.selectedKeys,Xe=Kt.state,vn=Xe.keyEntities,cn=Xe.fieldNames,hn=Kt.props,Ti=hn.onSelect,Ge=hn.multiple,Je=Oe.selected,rn=Oe[cn.key],Xn=!Je;Xn?Ge?Le=(0,Sn.L0)(Le,rn):Le=[rn]:Le=(0,Sn._5)(Le,rn);var Ln=Le.map(function(nn){var Kn=(0,Mn.Z)(vn,nn);return Kn?Kn.node:null}).filter(Boolean);Kt.setUncontrolledState({selectedKeys:Le}),Ti==null||Ti(Le,{event:"select",selected:Xn,node:Oe,selectedNodes:Ln,nativeEvent:ce.nativeEvent})}),(0,Rt.Z)((0,qt.Z)(Kt),"onNodeCheck",function(ce,Oe,Le){var Xe=Kt.state,vn=Xe.keyEntities,cn=Xe.checkedKeys,hn=Xe.halfCheckedKeys,Ti=Kt.props,Ge=Ti.checkStrictly,Je=Ti.onCheck,rn=Oe.key,Xn,Ln={event:"check",node:Oe,checked:Le,nativeEvent:ce.nativeEvent};if(Ge){var nn=Le?(0,Sn.L0)(cn,rn):(0,Sn._5)(cn,rn),Kn=(0,Sn._5)(hn,rn);Xn={checked:nn,halfChecked:Kn},Ln.checkedNodes=nn.map(function(gn){return(0,Mn.Z)(vn,gn)}).filter(Boolean).map(function(gn){return gn.node}),Kt.setUncontrolledState({checkedKeys:nn})}else{var mi=(0,ee.S)([].concat((0,Me.Z)(cn),[rn]),!0,vn),ei=mi.checkedKeys,Si=mi.halfCheckedKeys;if(!Le){var Wi=new Set(ei);Wi.delete(rn);var An=(0,ee.S)(Array.from(Wi),{checked:!1,halfCheckedKeys:Si},vn);ei=An.checkedKeys,Si=An.halfCheckedKeys}Xn=ei,Ln.checkedNodes=[],Ln.checkedNodesPositions=[],Ln.halfCheckedKeys=Si,ei.forEach(function(gn){var Rn=(0,Mn.Z)(vn,gn);if(Rn){var si=Rn.node,xi=Rn.pos;Ln.checkedNodes.push(si),Ln.checkedNodesPositions.push({node:si,pos:xi})}}),Kt.setUncontrolledState({checkedKeys:ei},!1,{halfCheckedKeys:Si})}Je==null||Je(Xn,Ln)}),(0,Rt.Z)((0,qt.Z)(Kt),"onNodeLoad",function(ce){var Oe,Le=ce.key,Xe=Kt.state.keyEntities,vn=(0,Mn.Z)(Xe,Le);if(!(vn!=null&&(Oe=vn.children)!==null&&Oe!==void 0&&Oe.length)){var cn=new Promise(function(hn,Ti){Kt.setState(function(Ge){var Je=Ge.loadedKeys,rn=Je===void 0?[]:Je,Xn=Ge.loadingKeys,Ln=Xn===void 0?[]:Xn,nn=Kt.props,Kn=nn.loadData,mi=nn.onLoad;if(!Kn||rn.includes(Le)||Ln.includes(Le))return null;var ei=Kn(ce);return ei.then(function(){var Si=Kt.state.loadedKeys,Wi=(0,Sn.L0)(Si,Le);mi==null||mi(Wi,{event:"load",node:ce}),Kt.setUncontrolledState({loadedKeys:Wi}),Kt.setState(function(An){return{loadingKeys:(0,Sn._5)(An.loadingKeys,Le)}}),hn()}).catch(function(Si){if(Kt.setState(function(An){return{loadingKeys:(0,Sn._5)(An.loadingKeys,Le)}}),Kt.loadingRetryTimes[Le]=(Kt.loadingRetryTimes[Le]||0)+1,Kt.loadingRetryTimes[Le]>=ui){var Wi=Kt.state.loadedKeys;(0,nt.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),Kt.setUncontrolledState({loadedKeys:(0,Sn.L0)(Wi,Le)}),hn()}Ti(Si)}),{loadingKeys:(0,Sn.L0)(Ln,Le)}})});return cn.catch(function(){}),cn}}),(0,Rt.Z)((0,qt.Z)(Kt),"onNodeMouseEnter",function(ce,Oe){var Le=Kt.props.onMouseEnter;Le==null||Le({event:ce,node:Oe})}),(0,Rt.Z)((0,qt.Z)(Kt),"onNodeMouseLeave",function(ce,Oe){var Le=Kt.props.onMouseLeave;Le==null||Le({event:ce,node:Oe})}),(0,Rt.Z)((0,qt.Z)(Kt),"onNodeContextMenu",function(ce,Oe){var Le=Kt.props.onRightClick;Le&&(ce.preventDefault(),Le({event:ce,node:Oe}))}),(0,Rt.Z)((0,qt.Z)(Kt),"onFocus",function(){var ce=Kt.props.onFocus;Kt.setState({focused:!0});for(var Oe=arguments.length,Le=new Array(Oe),Xe=0;Xe<Oe;Xe++)Le[Xe]=arguments[Xe];ce==null||ce.apply(void 0,Le)}),(0,Rt.Z)((0,qt.Z)(Kt),"onBlur",function(){var ce=Kt.props.onBlur;Kt.setState({focused:!1}),Kt.onActiveChange(null);for(var Oe=arguments.length,Le=new Array(Oe),Xe=0;Xe<Oe;Xe++)Le[Xe]=arguments[Xe];ce==null||ce.apply(void 0,Le)}),(0,Rt.Z)((0,qt.Z)(Kt),"getTreeNodeRequiredProps",function(){var ce=Kt.state,Oe=ce.expandedKeys,Le=ce.selectedKeys,Xe=ce.loadedKeys,vn=ce.loadingKeys,cn=ce.checkedKeys,hn=ce.halfCheckedKeys,Ti=ce.dragOverNodeKey,Ge=ce.dropPosition,Je=ce.keyEntities;return{expandedKeys:Oe||[],selectedKeys:Le||[],loadedKeys:Xe||[],loadingKeys:vn||[],checkedKeys:cn||[],halfCheckedKeys:hn||[],dragOverNodeKey:Ti,dropPosition:Ge,keyEntities:Je}}),(0,Rt.Z)((0,qt.Z)(Kt),"setExpandedKeys",function(ce){var Oe=Kt.state,Le=Oe.treeData,Xe=Oe.fieldNames,vn=(0,ae.oH)(Le,ce,Xe);Kt.setUncontrolledState({expandedKeys:ce,flattenNodes:vn},!0)}),(0,Rt.Z)((0,qt.Z)(Kt),"onNodeExpand",function(ce,Oe){var Le=Kt.state.expandedKeys,Xe=Kt.state,vn=Xe.listChanging,cn=Xe.fieldNames,hn=Kt.props,Ti=hn.onExpand,Ge=hn.loadData,Je=Oe.expanded,rn=Oe[cn.key];if(!vn){var Xn=Le.includes(rn),Ln=!Je;if((0,nt.ZP)(Je&&Xn||!Je&&!Xn,"Expand state not sync with index check"),Le=Ln?(0,Sn.L0)(Le,rn):(0,Sn._5)(Le,rn),Kt.setExpandedKeys(Le),Ti==null||Ti(Le,{node:Oe,expanded:Ln,nativeEvent:ce.nativeEvent}),Ln&&Ge){var nn=Kt.onNodeLoad(Oe);nn&&nn.then(function(){var Kn=(0,ae.oH)(Kt.state.treeData,Le,cn);Kt.setUncontrolledState({flattenNodes:Kn})}).catch(function(){var Kn=Kt.state.expandedKeys,mi=(0,Sn._5)(Kn,rn);Kt.setExpandedKeys(mi)})}}}),(0,Rt.Z)((0,qt.Z)(Kt),"onListChangeStart",function(){Kt.setUncontrolledState({listChanging:!0})}),(0,Rt.Z)((0,qt.Z)(Kt),"onListChangeEnd",function(){setTimeout(function(){Kt.setUncontrolledState({listChanging:!1})})}),(0,Rt.Z)((0,qt.Z)(Kt),"onActiveChange",function(ce){var Oe=Kt.state.activeKey,Le=Kt.props,Xe=Le.onActiveChange,vn=Le.itemScrollOffset,cn=vn===void 0?0:vn;Oe!==ce&&(Kt.setState({activeKey:ce}),ce!==null&&Kt.scrollTo({key:ce,offset:cn}),Xe==null||Xe(ce))}),(0,Rt.Z)((0,qt.Z)(Kt),"getActiveItem",function(){var ce=Kt.state,Oe=ce.activeKey,Le=ce.flattenNodes;return Oe===null?null:Le.find(function(Xe){var vn=Xe.key;return vn===Oe})||null}),(0,Rt.Z)((0,qt.Z)(Kt),"offsetActiveKey",function(ce){var Oe=Kt.state,Le=Oe.flattenNodes,Xe=Oe.activeKey,vn=Le.findIndex(function(Ti){var Ge=Ti.key;return Ge===Xe});vn===-1&&ce<0&&(vn=Le.length),vn=(vn+ce+Le.length)%Le.length;var cn=Le[vn];if(cn){var hn=cn.key;Kt.onActiveChange(hn)}else Kt.onActiveChange(null)}),(0,Rt.Z)((0,qt.Z)(Kt),"onKeyDown",function(ce){var Oe=Kt.state,Le=Oe.activeKey,Xe=Oe.expandedKeys,vn=Oe.checkedKeys,cn=Oe.fieldNames,hn=Kt.props,Ti=hn.onKeyDown,Ge=hn.checkable,Je=hn.selectable;switch(ce.which){case Ee.Z.UP:{Kt.offsetActiveKey(-1),ce.preventDefault();break}case Ee.Z.DOWN:{Kt.offsetActiveKey(1),ce.preventDefault();break}}var rn=Kt.getActiveItem();if(rn&&rn.data){var Xn=Kt.getTreeNodeRequiredProps(),Ln=rn.data.isLeaf===!1||!!(rn.data[cn.children]||[]).length,nn=(0,ae.F)((0,le.Z)((0,le.Z)({},(0,ae.H8)(Le,Xn)),{},{data:rn.data,active:!0}));switch(ce.which){case Ee.Z.LEFT:{Ln&&Xe.includes(Le)?Kt.onNodeExpand({},nn):rn.parent&&Kt.onActiveChange(rn.parent.key),ce.preventDefault();break}case Ee.Z.RIGHT:{Ln&&!Xe.includes(Le)?Kt.onNodeExpand({},nn):rn.children&&rn.children.length&&Kt.onActiveChange(rn.children[0].key),ce.preventDefault();break}case Ee.Z.ENTER:case Ee.Z.SPACE:{Ge&&!nn.disabled&&nn.checkable!==!1&&!nn.disableCheckbox?Kt.onNodeCheck({},nn,!vn.includes(Le)):!Ge&&Je&&!nn.disabled&&nn.selectable!==!1&&Kt.onNodeSelect({},nn);break}}}Ti==null||Ti(ce)}),(0,Rt.Z)((0,qt.Z)(Kt),"setUncontrolledState",function(ce){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!Kt.destroyed){var Xe=!1,vn=!0,cn={};Object.keys(ce).forEach(function(hn){if(Kt.props.hasOwnProperty(hn)){vn=!1;return}Xe=!0,cn[hn]=ce[hn]}),Xe&&(!Oe||vn)&&Kt.setState((0,le.Z)((0,le.Z)({},cn),Le))}}),(0,Rt.Z)((0,qt.Z)(Kt),"scrollTo",function(ce){Kt.listRef.current.scrollTo(ce)}),Kt}return(0,It.Z)(Mt,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var ye=this.props,Ue=ye.activeKey,Qe=ye.itemScrollOffset,ce=Qe===void 0?0:Qe;Ue!==void 0&&Ue!==this.state.activeKey&&(this.setState({activeKey:Ue}),Ue!==null&&this.scrollTo({key:Ue,offset:ce}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var ye=this.state,Ue=ye.focused,Qe=ye.flattenNodes,ce=ye.keyEntities,Oe=ye.draggingNodeKey,Le=ye.activeKey,Xe=ye.dropLevelOffset,vn=ye.dropContainerKey,cn=ye.dropTargetKey,hn=ye.dropPosition,Ti=ye.dragOverNodeKey,Ge=ye.indent,Je=this.props,rn=Je.prefixCls,Xn=Je.className,Ln=Je.style,nn=Je.showLine,Kn=Je.focusable,mi=Je.tabIndex,ei=mi===void 0?0:mi,Si=Je.selectable,Wi=Je.showIcon,An=Je.icon,gn=Je.switcherIcon,Rn=Je.draggable,si=Je.checkable,xi=Je.checkStrictly,di=Je.disabled,Oi=Je.motion,wt=Je.loadData,yn=Je.filterTreeNode,Wn=Je.height,ki=Je.itemHeight,Ui=Je.scrollWidth,ur=Je.virtual,Mr=Je.titleRender,gi=Je.dropIndicatorRender,bn=Je.onContextMenu,pe=Je.onScroll,Se=Je.direction,ve=Je.rootClassName,zn=Je.rootStyle,kn=(0,Bt.Z)(this.props,{aria:!0,data:!0}),Qn;Rn&&((0,Ut.Z)(Rn)==="object"?Qn=Rn:typeof Rn=="function"?Qn={nodeDraggable:Rn}:Qn={});var $e={prefixCls:rn,selectable:Si,showIcon:Wi,icon:An,switcherIcon:gn,draggable:Qn,draggingNodeKey:Oe,checkable:si,checkStrictly:xi,disabled:di,keyEntities:ce,dropLevelOffset:Xe,dropContainerKey:vn,dropTargetKey:cn,dropPosition:hn,dragOverNodeKey:Ti,indent:Ge,direction:Se,dropIndicatorRender:gi,loadData:wt,filterTreeNode:yn,titleRender:Mr,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop};return et.createElement(ht.k.Provider,{value:$e},et.createElement("div",{className:ie()(rn,Xn,ve,(0,Rt.Z)((0,Rt.Z)((0,Rt.Z)({},"".concat(rn,"-show-line"),nn),"".concat(rn,"-focused"),Ue),"".concat(rn,"-active-focused"),Le!==null)),style:zn},et.createElement(Te,(0,pt.Z)({ref:this.listRef,prefixCls:rn,style:Ln,data:Qe,disabled:di,selectable:Si,checkable:!!si,motion:Oi,dragging:Oe!==null,height:Wn,itemHeight:ki,virtual:ur,focusable:Kn,focused:Ue,tabIndex:ei,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:bn,onScroll:pe,scrollWidth:Ui},this.getTreeNodeRequiredProps(),kn))))}}],[{key:"getDerivedStateFromProps",value:function(ye,Ue){var Qe=Ue.prevProps,ce={prevProps:ye};function Oe(ei){return!Qe&&ye.hasOwnProperty(ei)||Qe&&Qe[ei]!==ye[ei]}var Le,Xe=Ue.fieldNames;if(Oe("fieldNames")&&(Xe=(0,ae.w$)(ye.fieldNames),ce.fieldNames=Xe),Oe("treeData")?Le=ye.treeData:Oe("children")&&((0,nt.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),Le=(0,ae.zn)(ye.children)),Le){ce.treeData=Le;var vn=(0,ae.I8)(Le,{fieldNames:Xe});ce.keyEntities=(0,le.Z)((0,Rt.Z)({},Xt,_n),vn.keyEntities)}var cn=ce.keyEntities||Ue.keyEntities;if(Oe("expandedKeys")||Qe&&Oe("autoExpandParent"))ce.expandedKeys=ye.autoExpandParent||!Qe&&ye.defaultExpandParent?(0,Sn.r7)(ye.expandedKeys,cn):ye.expandedKeys;else if(!Qe&&ye.defaultExpandAll){var hn=(0,le.Z)({},cn);delete hn[Xt];var Ti=[];Object.keys(hn).forEach(function(ei){var Si=hn[ei];Si.children&&Si.children.length&&Ti.push(Si.key)}),ce.expandedKeys=Ti}else!Qe&&ye.defaultExpandedKeys&&(ce.expandedKeys=ye.autoExpandParent||ye.defaultExpandParent?(0,Sn.r7)(ye.defaultExpandedKeys,cn):ye.defaultExpandedKeys);if(ce.expandedKeys||delete ce.expandedKeys,Le||ce.expandedKeys){var Ge=(0,ae.oH)(Le||Ue.treeData,ce.expandedKeys||Ue.expandedKeys,Xe);ce.flattenNodes=Ge}if(ye.selectable&&(Oe("selectedKeys")?ce.selectedKeys=(0,Sn.BT)(ye.selectedKeys,ye):!Qe&&ye.defaultSelectedKeys&&(ce.selectedKeys=(0,Sn.BT)(ye.defaultSelectedKeys,ye))),ye.checkable){var Je;if(Oe("checkedKeys")?Je=(0,Sn.E6)(ye.checkedKeys)||{}:!Qe&&ye.defaultCheckedKeys?Je=(0,Sn.E6)(ye.defaultCheckedKeys)||{}:Le&&(Je=(0,Sn.E6)(ye.checkedKeys)||{checkedKeys:Ue.checkedKeys,halfCheckedKeys:Ue.halfCheckedKeys}),Je){var rn=Je,Xn=rn.checkedKeys,Ln=Xn===void 0?[]:Xn,nn=rn.halfCheckedKeys,Kn=nn===void 0?[]:nn;if(!ye.checkStrictly){var mi=(0,ee.S)(Ln,!0,cn);Ln=mi.checkedKeys,Kn=mi.halfCheckedKeys}ce.checkedKeys=Ln,ce.halfCheckedKeys=Kn}}return Oe("loadedKeys")&&(ce.loadedKeys=ye.loadedKeys),ce}}]),Mt}(et.Component);(0,Rt.Z)(_t,"defaultProps",{prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:gt,allowDrop:function(){return!0},expandAction:!1}),(0,Rt.Z)(_t,"TreeNode",Yt.Z);var Lt=_t,Pt=Lt},82661:function(Dn,Gn,kt){"use strict";kt.d(Gn,{BT:function(){return et},E6:function(){return gt},L0:function(){return Rt},OM:function(){return nt},_5:function(){return ne},r7:function(){return vt},wA:function(){return ie},yx:function(){return Ae}});var pt=kt(80702),Ut=kt(62853),le=kt(48736),Me=kt(59301),ue=kt(639),It=kt(65065),qt=kt(34061),ge=null;function ne(St,Et){if(!St)return[];var Tt=St.slice(),Dt=Tt.indexOf(Et);return Dt>=0&&Tt.splice(Dt,1),Tt}function Rt(St,Et){var Tt=(St||[]).slice();return Tt.indexOf(Et)===-1&&Tt.push(Et),Tt}function Ae(St){return St.split("-")}function ie(St,Et){var Tt=[],Dt=(0,It.Z)(Et,St);function Jt(){var Yt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Yt.forEach(function(Gt){var me=Gt.key,ae=Gt.children;Tt.push(me),Jt(ae)})}return Jt(Dt.children),Tt}function Ee(St){if(St.parent){var Et=Ae(St.pos);return Number(Et[Et.length-1])===St.parent.children.length-1}return!1}function Bt(St){var Et=Ae(St.pos);return Number(Et[Et.length-1])===0}function nt(St,Et,Tt,Dt,Jt,Yt,Gt,me,ae,Ne){var Ce,we=St.clientX,tn=St.clientY,_e=St.target.getBoundingClientRect(),an=_e.top,Ke=_e.height,oe=(Ne==="rtl"?-1:1)*(((Jt==null?void 0:Jt.x)||0)-we),Xt=(oe-12)/Dt,qe=ae.filter(function(Pt){var Nt;return(Nt=me[Pt])===null||Nt===void 0||(Nt=Nt.children)===null||Nt===void 0?void 0:Nt.length}),_n=(0,It.Z)(me,Tt.eventKey);if(tn<an+Ke/2){var Pn=Gt.findIndex(function(Pt){return Pt.key===_n.key}),De=Pn<=0?0:Pn-1,dn=Gt[De].key;_n=(0,It.Z)(me,dn)}var sn=_n.key,jn=_n,Te=_n.key,Sn=0,ee=0;if(!qe.includes(sn))for(var Mn=0;Mn<Xt&&Ee(_n);Mn+=1)_n=_n.parent,ee+=1;var ui=Et.data,_t=_n.node,Lt=!0;return Bt(_n)&&_n.level===0&&tn<an+Ke/2&&Yt({dragNode:ui,dropNode:_t,dropPosition:-1})&&_n.key===Tt.eventKey?Sn=-1:(jn.children||[]).length&&qe.includes(Te)?Yt({dragNode:ui,dropNode:_t,dropPosition:0})?Sn=0:Lt=!1:ee===0?Xt>-1.5?Yt({dragNode:ui,dropNode:_t,dropPosition:1})?Sn=1:Lt=!1:Yt({dragNode:ui,dropNode:_t,dropPosition:0})?Sn=0:Yt({dragNode:ui,dropNode:_t,dropPosition:1})?Sn=1:Lt=!1:Yt({dragNode:ui,dropNode:_t,dropPosition:1})?Sn=1:Lt=!1,{dropPosition:Sn,dropLevelOffset:ee,dropTargetKey:_n.key,dropTargetPos:_n.pos,dragOverNodeKey:Te,dropContainerKey:Sn===0?null:((Ce=_n.parent)===null||Ce===void 0?void 0:Ce.key)||null,dropAllowed:Lt}}function et(St,Et){if(St){var Tt=Et.multiple;return Tt?St.slice():St.length?[St[0]]:St}}var ht=function(Et){return Et};function st(St,Et){if(!St)return[];var Tt=Et||{},Dt=Tt.processProps,Jt=Dt===void 0?ht:Dt,Yt=Array.isArray(St)?St:[St];return Yt.map(function(Gt){var me=Gt.children,ae=_objectWithoutProperties(Gt,ge),Ne=st(me,Et);return React.createElement(TreeNode,_extends({key:ae.key},Jt(ae)),Ne)})}function gt(St){if(!St)return null;var Et;if(Array.isArray(St))Et={checkedKeys:St,halfCheckedKeys:void 0};else if((0,Ut.Z)(St)==="object")Et={checkedKeys:St.checked||void 0,halfCheckedKeys:St.halfChecked||void 0};else return(0,le.ZP)(!1,"`checkedKeys` is not an array or an object"),null;return Et}function vt(St,Et){var Tt=new Set;function Dt(Jt){if(!Tt.has(Jt)){var Yt=(0,It.Z)(Et,Jt);if(Yt){Tt.add(Jt);var Gt=Yt.parent,me=Yt.node;me.disabled||Gt&&Dt(Gt.key)}}}return(St||[]).forEach(function(Jt){Dt(Jt)}),(0,pt.Z)(Tt)}},34643:function(Dn,Gn,kt){"use strict";kt.d(Gn,{S:function(){return qt}});var pt=kt(48736),Ut=kt(65065);function le(ge,ne){var Rt=new Set;return ge.forEach(function(Ae){ne.has(Ae)||Rt.add(Ae)}),Rt}function Me(ge){var ne=ge||{},Rt=ne.disabled,Ae=ne.disableCheckbox,ie=ne.checkable;return!!(Rt||Ae)||ie===!1}function ue(ge,ne,Rt,Ae){for(var ie=new Set(ge),Ee=new Set,Bt=0;Bt<=Rt;Bt+=1){var nt=ne.get(Bt)||new Set;nt.forEach(function(gt){var vt=gt.key,St=gt.node,Et=gt.children,Tt=Et===void 0?[]:Et;ie.has(vt)&&!Ae(St)&&Tt.filter(function(Dt){return!Ae(Dt.node)}).forEach(function(Dt){ie.add(Dt.key)})})}for(var et=new Set,ht=Rt;ht>=0;ht-=1){var st=ne.get(ht)||new Set;st.forEach(function(gt){var vt=gt.parent,St=gt.node;if(!(Ae(St)||!gt.parent||et.has(gt.parent.key))){if(Ae(gt.parent.node)){et.add(vt.key);return}var Et=!0,Tt=!1;(vt.children||[]).filter(function(Dt){return!Ae(Dt.node)}).forEach(function(Dt){var Jt=Dt.key,Yt=ie.has(Jt);Et&&!Yt&&(Et=!1),!Tt&&(Yt||Ee.has(Jt))&&(Tt=!0)}),Et&&ie.add(vt.key),Tt&&Ee.add(vt.key),et.add(vt.key)}})}return{checkedKeys:Array.from(ie),halfCheckedKeys:Array.from(le(Ee,ie))}}function It(ge,ne,Rt,Ae,ie){for(var Ee=new Set(ge),Bt=new Set(ne),nt=0;nt<=Ae;nt+=1){var et=Rt.get(nt)||new Set;et.forEach(function(vt){var St=vt.key,Et=vt.node,Tt=vt.children,Dt=Tt===void 0?[]:Tt;!Ee.has(St)&&!Bt.has(St)&&!ie(Et)&&Dt.filter(function(Jt){return!ie(Jt.node)}).forEach(function(Jt){Ee.delete(Jt.key)})})}Bt=new Set;for(var ht=new Set,st=Ae;st>=0;st-=1){var gt=Rt.get(st)||new Set;gt.forEach(function(vt){var St=vt.parent,Et=vt.node;if(!(ie(Et)||!vt.parent||ht.has(vt.parent.key))){if(ie(vt.parent.node)){ht.add(St.key);return}var Tt=!0,Dt=!1;(St.children||[]).filter(function(Jt){return!ie(Jt.node)}).forEach(function(Jt){var Yt=Jt.key,Gt=Ee.has(Yt);Tt&&!Gt&&(Tt=!1),!Dt&&(Gt||Bt.has(Yt))&&(Dt=!0)}),Tt||Ee.delete(St.key),Dt&&Bt.add(St.key),ht.add(St.key)}})}return{checkedKeys:Array.from(Ee),halfCheckedKeys:Array.from(le(Bt,Ee))}}function qt(ge,ne,Rt,Ae){var ie=[],Ee;Ae?Ee=Ae:Ee=Me;var Bt=new Set(ge.filter(function(st){var gt=!!(0,Ut.Z)(Rt,st);return gt||ie.push(st),gt})),nt=new Map,et=0;Object.keys(Rt).forEach(function(st){var gt=Rt[st],vt=gt.level,St=nt.get(vt);St||(St=new Set,nt.set(vt,St)),St.add(gt),et=Math.max(et,vt)}),(0,pt.ZP)(!ie.length,"Tree missing follow keys: ".concat(ie.slice(0,100).map(function(st){return"'".concat(st,"'")}).join(", ")));var ht;return ne===!0?ht=ue(Bt,nt,et,Ee):ht=It(Bt,ne.halfCheckedKeys,nt,et,Ee),ht}},65065:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Z:function(){return pt}});function pt(Ut,le){return Ut[le]}},34061:function(Dn,Gn,kt){"use strict";kt.d(Gn,{F:function(){return vt},H8:function(){return gt},I8:function(){return st},km:function(){return ie},oH:function(){return et},w$:function(){return Ee},zn:function(){return nt}});var pt=kt(62853),Ut=kt(80702),le=kt(77321),Me=kt(74416),ue=kt(11592),It=kt(2738),qt=kt(48736),ge=kt(65065),ne=["children"];function Rt(St,Et){return"".concat(St,"-").concat(Et)}function Ae(St){return St&&St.type&&St.type.isTreeNode}function ie(St,Et){return St!=null?St:Et}function Ee(St){var Et=St||{},Tt=Et.title,Dt=Et._title,Jt=Et.key,Yt=Et.children,Gt=Tt||"title";return{title:Gt,_title:Dt||[Gt],key:Jt||"key",children:Yt||"children"}}function Bt(St,Et){var Tt=new Map;function Dt(Jt){var Yt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(Jt||[]).forEach(function(Gt){var me=Gt[Et.key],ae=Gt[Et.children];warning(me!=null,"Tree node must have a certain key: [".concat(Yt).concat(me,"]"));var Ne=String(me);warning(!Tt.has(Ne)||me===null||me===void 0,"Same 'key' exist in the Tree: ".concat(Ne)),Tt.set(Ne,!0),Dt(ae,"".concat(Yt).concat(Ne," > "))})}Dt(St)}function nt(St){function Et(Tt){var Dt=(0,ue.Z)(Tt);return Dt.map(function(Jt){if(!Ae(Jt))return(0,qt.ZP)(!Jt,"Tree/TreeNode can only accept TreeNode as children."),null;var Yt=Jt.key,Gt=Jt.props,me=Gt.children,ae=(0,Me.Z)(Gt,ne),Ne=(0,le.Z)({key:Yt},ae),Ce=Et(me);return Ce.length&&(Ne.children=Ce),Ne}).filter(function(Jt){return Jt})}return Et(St)}function et(St,Et,Tt){var Dt=Ee(Tt),Jt=Dt._title,Yt=Dt.key,Gt=Dt.children,me=new Set(Et===!0?[]:Et),ae=[];function Ne(Ce){var we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return Ce.map(function(tn,_e){for(var an=Rt(we?we.pos:"0",_e),Ke=ie(tn[Yt],an),oe,Xt=0;Xt<Jt.length;Xt+=1){var qe=Jt[Xt];if(tn[qe]!==void 0){oe=tn[qe];break}}var _n=Object.assign((0,It.Z)(tn,[].concat((0,Ut.Z)(Jt),[Yt,Gt])),{title:oe,key:Ke,parent:we,pos:an,children:null,data:tn,isStart:[].concat((0,Ut.Z)(we?we.isStart:[]),[_e===0]),isEnd:[].concat((0,Ut.Z)(we?we.isEnd:[]),[_e===Ce.length-1])});return ae.push(_n),Et===!0||me.has(Ke)?_n.children=Ne(tn[Gt]||[],_n):_n.children=[],_n})}return Ne(St),ae}function ht(St,Et,Tt){var Dt={};(0,pt.Z)(Tt)==="object"?Dt=Tt:Dt={externalGetKey:Tt},Dt=Dt||{};var Jt=Dt,Yt=Jt.childrenPropName,Gt=Jt.externalGetKey,me=Jt.fieldNames,ae=Ee(me),Ne=ae.key,Ce=ae.children,we=Yt||Ce,tn;Gt?typeof Gt=="string"?tn=function(Ke){return Ke[Gt]}:typeof Gt=="function"&&(tn=function(Ke){return Gt(Ke)}):tn=function(Ke,oe){return ie(Ke[Ne],oe)};function _e(an,Ke,oe,Xt){var qe=an?an[we]:St,_n=an?Rt(oe.pos,Ke):"0",Pn=an?[].concat((0,Ut.Z)(Xt),[an]):[];if(an){var De=tn(an,_n),dn={node:an,index:Ke,pos:_n,key:De,parentPos:oe.node?oe.pos:null,level:oe.level+1,nodes:Pn};Et(dn)}qe&&qe.forEach(function(sn,jn){_e(sn,jn,{node:an,pos:_n,level:oe?oe.level+1:-1},Pn)})}_e(null)}function st(St){var Et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Tt=Et.initWrapper,Dt=Et.processEntity,Jt=Et.onProcessFinished,Yt=Et.externalGetKey,Gt=Et.childrenPropName,me=Et.fieldNames,ae=arguments.length>2?arguments[2]:void 0,Ne=Yt||ae,Ce={},we={},tn={posEntities:Ce,keyEntities:we};return Tt&&(tn=Tt(tn)||tn),ht(St,function(_e){var an=_e.node,Ke=_e.index,oe=_e.pos,Xt=_e.key,qe=_e.parentPos,_n=_e.level,Pn=_e.nodes,De={node:an,nodes:Pn,index:Ke,key:Xt,pos:oe,level:_n},dn=ie(Xt,oe);Ce[oe]=De,we[dn]=De,De.parent=Ce[qe],De.parent&&(De.parent.children=De.parent.children||[],De.parent.children.push(De)),Dt&&Dt(De,tn)},{externalGetKey:Ne,childrenPropName:Gt,fieldNames:me}),Jt&&Jt(tn),tn}function gt(St,Et){var Tt=Et.expandedKeys,Dt=Et.selectedKeys,Jt=Et.loadedKeys,Yt=Et.loadingKeys,Gt=Et.checkedKeys,me=Et.halfCheckedKeys,ae=Et.dragOverNodeKey,Ne=Et.dropPosition,Ce=Et.keyEntities,we=(0,ge.Z)(Ce,St),tn={eventKey:St,expanded:Tt.indexOf(St)!==-1,selected:Dt.indexOf(St)!==-1,loaded:Jt.indexOf(St)!==-1,loading:Yt.indexOf(St)!==-1,checked:Gt.indexOf(St)!==-1,halfChecked:me.indexOf(St)!==-1,pos:String(we?we.pos:""),dragOver:ae===St&&Ne===0,dragOverGapTop:ae===St&&Ne===-1,dragOverGapBottom:ae===St&&Ne===1};return tn}function vt(St){var Et=St.data,Tt=St.expanded,Dt=St.selected,Jt=St.checked,Yt=St.loaded,Gt=St.loading,me=St.halfChecked,ae=St.dragOver,Ne=St.dragOverGapTop,Ce=St.dragOverGapBottom,we=St.pos,tn=St.active,_e=St.eventKey,an=(0,le.Z)((0,le.Z)({},Et),{},{expanded:Tt,selected:Dt,checked:Jt,loaded:Yt,loading:Gt,halfChecked:me,dragOver:ae,dragOverGapTop:Ne,dragOverGapBottom:Ce,pos:we,active:tn,key:_e});return"props"in an||Object.defineProperty(an,"props",{get:function(){return(0,qt.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),St}}),an}},8224:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Z:function(){return Ut}});var pt=kt(4676);function Ut(le,Me,ue,It){var qt=pt.unstable_batchedUpdates?function(ne){pt.unstable_batchedUpdates(ue,ne)}:ue;return le!=null&&le.addEventListener&&le.addEventListener(Me,qt,It),{remove:function(){le!=null&&le.removeEventListener&&le.removeEventListener(Me,qt,It)}}}},24514:function(Dn,Gn,kt){"use strict";kt.d(Gn,{G:function(){return Me}});var pt=kt(47273),Ut=function(It){if((0,pt.Z)()&&window.document.documentElement){var qt=Array.isArray(It)?It:[It],ge=window.document.documentElement;return qt.some(function(ne){return ne in ge.style})}return!1},le=function(It,qt){if(!Ut(It))return!1;var ge=document.createElement("div"),ne=ge.style[It];return ge.style[It]=qt,ge.style[It]!==ne};function Me(ue,It){return!Array.isArray(ue)&&It!==void 0?le(ue,It):Ut(ue)}},45680:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Z:function(){return ui}});var pt=kt(72308),Ut=kt(62853),le=kt(77321),Me=kt(49618),ue=kt(52487),It=kt(74416),qt=kt(92310),ge=kt.n(qt),ne=kt(29301),Rt=kt(70425),Ae=kt(34280),ie=kt(59301),Ee=kt(4676),Bt=ie.forwardRef(function(_t,Lt){var Pt=_t.height,Nt=_t.offsetY,zt=_t.offsetX,Mt=_t.children,Kt=_t.prefixCls,ye=_t.onInnerResize,Ue=_t.innerProps,Qe=_t.rtl,ce=_t.extra,Oe={},Le={display:"flex",flexDirection:"column"};return Nt!==void 0&&(Oe={height:Pt,position:"relative",overflow:"hidden"},Le=(0,le.Z)((0,le.Z)({},Le),{},(0,Me.Z)((0,Me.Z)((0,Me.Z)((0,Me.Z)((0,Me.Z)({transform:"translateY(".concat(Nt,"px)")},Qe?"marginRight":"marginLeft",-zt),"position","absolute"),"left",0),"right",0),"top",0))),ie.createElement("div",{style:Oe},ie.createElement(ne.Z,{onResize:function(vn){var cn=vn.offsetHeight;cn&&ye&&ye()}},ie.createElement("div",(0,pt.Z)({style:Le,className:ge()((0,Me.Z)({},"".concat(Kt,"-holder-inner"),Kt)),ref:Lt},Ue),Mt,ce)))});Bt.displayName="Filler";var nt=Bt;function et(_t){var Lt=_t.children,Pt=_t.setRef,Nt=ie.useCallback(function(zt){Pt(zt)},[]);return ie.cloneElement(Lt,{ref:Nt})}function ht(_t,Lt,Pt,Nt,zt,Mt,Kt,ye){var Ue=ye.getKey;return _t.slice(Lt,Pt+1).map(function(Qe,ce){var Oe=Lt+ce,Le=Kt(Qe,Oe,{style:{width:Nt},offsetX:zt}),Xe=Ue(Qe);return ie.createElement(et,{key:Xe,setRef:function(cn){return Mt(Qe,cn)}},Le)})}function st(_t,Lt,Pt,Nt){var zt=Pt-_t,Mt=Lt-Pt,Kt=Math.min(zt,Mt)*2;if(Nt<=Kt){var ye=Math.floor(Nt/2);return Nt%2?Pt+ye+1:Pt-ye}return zt>Mt?Pt-(Nt-Mt):Pt+(Nt-zt)}function gt(_t,Lt,Pt){var Nt=_t.length,zt=Lt.length,Mt,Kt;if(Nt===0&&zt===0)return null;Nt<zt?(Mt=_t,Kt=Lt):(Mt=Lt,Kt=_t);var ye={__EMPTY_ITEM__:!0};function Ue(vn){return vn!==void 0?Pt(vn):ye}for(var Qe=null,ce=Math.abs(Nt-zt)!==1,Oe=0;Oe<Kt.length;Oe+=1){var Le=Ue(Mt[Oe]),Xe=Ue(Kt[Oe]);if(Le!==Xe){Qe=Oe,ce=ce||Le!==Ue(Kt[Oe+1]);break}}return Qe===null?null:{index:Qe,multiple:ce}}function vt(_t,Lt,Pt){var Nt=ie.useState(_t),zt=(0,ue.Z)(Nt,2),Mt=zt[0],Kt=zt[1],ye=ie.useState(null),Ue=(0,ue.Z)(ye,2),Qe=Ue[0],ce=Ue[1];return ie.useEffect(function(){var Oe=gt(Mt||[],_t||[],Lt);(Oe==null?void 0:Oe.index)!==void 0&&(Pt==null||Pt(Oe.index),ce(_t[Oe.index])),Kt(_t)},[_t]),[Qe]}var St=kt(16089),Et=(typeof navigator=="undefined"?"undefined":(0,Ut.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),Tt=Et,Dt=function(_t,Lt,Pt,Nt){var zt=(0,ie.useRef)(!1),Mt=(0,ie.useRef)(null);function Kt(){clearTimeout(Mt.current),zt.current=!0,Mt.current=setTimeout(function(){zt.current=!1},50)}var ye=(0,ie.useRef)({top:_t,bottom:Lt,left:Pt,right:Nt});return ye.current.top=_t,ye.current.bottom=Lt,ye.current.left=Pt,ye.current.right=Nt,function(Ue,Qe){var ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Oe=Ue?Qe<0&&ye.current.left||Qe>0&&ye.current.right:Qe<0&&ye.current.top||Qe>0&&ye.current.bottom;return ce&&Oe?(clearTimeout(Mt.current),zt.current=!1):(!Oe||zt.current)&&Kt(),!zt.current&&Oe}};function Jt(_t,Lt,Pt,Nt,zt,Mt,Kt){var ye=(0,ie.useRef)(0),Ue=(0,ie.useRef)(null),Qe=(0,ie.useRef)(null),ce=(0,ie.useRef)(!1),Oe=Dt(Lt,Pt,Nt,zt);function Le(Ge,Je){if(St.Z.cancel(Ue.current),!Oe(!1,Je)){var rn=Ge;if(!rn._virtualHandled)rn._virtualHandled=!0;else return;ye.current+=Je,Qe.current=Je,Tt||rn.preventDefault(),Ue.current=(0,St.Z)(function(){var Xn=ce.current?10:1;Kt(ye.current*Xn,!1),ye.current=0})}}function Xe(Ge,Je){Kt(Je,!0),Tt||Ge.preventDefault()}var vn=(0,ie.useRef)(null),cn=(0,ie.useRef)(null);function hn(Ge){if(_t){St.Z.cancel(cn.current),cn.current=(0,St.Z)(function(){vn.current=null},2);var Je=Ge.deltaX,rn=Ge.deltaY,Xn=Ge.shiftKey,Ln=Je,nn=rn;(vn.current==="sx"||!vn.current&&Xn&&rn&&!Je)&&(Ln=rn,nn=0,vn.current="sx");var Kn=Math.abs(Ln),mi=Math.abs(nn);vn.current===null&&(vn.current=Mt&&Kn>mi?"x":"y"),vn.current==="y"?Le(Ge,nn):Xe(Ge,Ln)}}function Ti(Ge){_t&&(ce.current=Ge.detail===Qe.current)}return[hn,Ti]}function Yt(_t,Lt,Pt,Nt){var zt=ie.useMemo(function(){return[new Map,[]]},[_t,Pt.id,Nt]),Mt=(0,ue.Z)(zt,2),Kt=Mt[0],ye=Mt[1],Ue=function(ce){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ce,Le=Kt.get(ce),Xe=Kt.get(Oe);if(Le===void 0||Xe===void 0)for(var vn=_t.length,cn=ye.length;cn<vn;cn+=1){var hn,Ti=_t[cn],Ge=Lt(Ti);Kt.set(Ge,cn);var Je=(hn=Pt.get(Ge))!==null&&hn!==void 0?hn:Nt;if(ye[cn]=(ye[cn-1]||0)+Je,Ge===ce&&(Le=cn),Ge===Oe&&(Xe=cn),Le!==void 0&&Xe!==void 0)break}return{top:ye[Le-1]||0,bottom:ye[Xe]}};return Ue}var Gt=kt(96949),me=kt(55090),ae=function(){function _t(){(0,Gt.Z)(this,_t),(0,Me.Z)(this,"maps",void 0),(0,Me.Z)(this,"id",0),(0,Me.Z)(this,"diffKeys",new Set),this.maps=Object.create(null)}return(0,me.Z)(_t,[{key:"set",value:function(Pt,Nt){this.maps[Pt]=Nt,this.id+=1,this.diffKeys.add(Pt)}},{key:"get",value:function(Pt){return this.maps[Pt]}},{key:"resetRecord",value:function(){this.diffKeys.clear()}},{key:"getRecord",value:function(){return this.diffKeys}}]),_t}(),Ne=ae;function Ce(_t){var Lt=parseFloat(_t);return isNaN(Lt)?0:Lt}function we(_t,Lt,Pt){var Nt=ie.useState(0),zt=(0,ue.Z)(Nt,2),Mt=zt[0],Kt=zt[1],ye=(0,ie.useRef)(new Map),Ue=(0,ie.useRef)(new Ne),Qe=(0,ie.useRef)(0);function ce(){Qe.current+=1}function Oe(){var Xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;ce();var vn=function(){var Ti=!1;ye.current.forEach(function(Ge,Je){if(Ge&&Ge.offsetParent){var rn=Ge.offsetHeight,Xn=getComputedStyle(Ge),Ln=Xn.marginTop,nn=Xn.marginBottom,Kn=Ce(Ln),mi=Ce(nn),ei=rn+Kn+mi;Ue.current.get(Je)!==ei&&(Ue.current.set(Je,ei),Ti=!0)}}),Ti&&Kt(function(Ge){return Ge+1})};if(Xe)vn();else{Qe.current+=1;var cn=Qe.current;Promise.resolve().then(function(){cn===Qe.current&&vn()})}}function Le(Xe,vn){var cn=_t(Xe),hn=ye.current.get(cn);vn?(ye.current.set(cn,vn),Oe()):ye.current.delete(cn),!hn!=!vn&&(vn?Lt==null||Lt(Xe):Pt==null||Pt(Xe))}return(0,ie.useEffect)(function(){return ce},[]),[Le,Oe,Ue.current,Mt]}var tn=14/15;function _e(_t,Lt,Pt){var Nt=(0,ie.useRef)(!1),zt=(0,ie.useRef)(0),Mt=(0,ie.useRef)(0),Kt=(0,ie.useRef)(null),ye=(0,ie.useRef)(null),Ue,Qe=function(Xe){if(Nt.current){var vn=Math.ceil(Xe.touches[0].pageX),cn=Math.ceil(Xe.touches[0].pageY),hn=zt.current-vn,Ti=Mt.current-cn,Ge=Math.abs(hn)>Math.abs(Ti);Ge?zt.current=vn:Mt.current=cn;var Je=Pt(Ge,Ge?hn:Ti,!1,Xe);Je&&Xe.preventDefault(),clearInterval(ye.current),Je&&(ye.current=setInterval(function(){Ge?hn*=tn:Ti*=tn;var rn=Math.floor(Ge?hn:Ti);(!Pt(Ge,rn,!0)||Math.abs(rn)<=.1)&&clearInterval(ye.current)},16))}},ce=function(){Nt.current=!1,Ue()},Oe=function(Xe){Ue(),Xe.touches.length===1&&!Nt.current&&(Nt.current=!0,zt.current=Math.ceil(Xe.touches[0].pageX),Mt.current=Math.ceil(Xe.touches[0].pageY),Kt.current=Xe.target,Kt.current.addEventListener("touchmove",Qe,{passive:!1}),Kt.current.addEventListener("touchend",ce,{passive:!0}))};Ue=function(){Kt.current&&(Kt.current.removeEventListener("touchmove",Qe),Kt.current.removeEventListener("touchend",ce))},(0,Ae.Z)(function(){return _t&&Lt.current.addEventListener("touchstart",Oe,{passive:!0}),function(){var Le;(Le=Lt.current)===null||Le===void 0||Le.removeEventListener("touchstart",Oe),Ue(),clearInterval(ye.current)}},[_t])}function an(_t){return Math.floor(Math.pow(_t,.5))}function Ke(_t,Lt){var Pt="touches"in _t?_t.touches[0]:_t;return Pt[Lt?"pageX":"pageY"]-window[Lt?"scrollX":"scrollY"]}function oe(_t,Lt,Pt){ie.useEffect(function(){var Nt=Lt.current;if(_t&&Nt){var zt=!1,Mt,Kt,ye=function(){St.Z.cancel(Mt)},Ue=function Le(){ye(),Mt=(0,St.Z)(function(){Pt(Kt),Le()})},Qe=function(Xe){if(!(Xe.target.draggable||Xe.button!==0)){var vn=Xe;vn._virtualHandled||(vn._virtualHandled=!0,zt=!0)}},ce=function(){zt=!1,ye()},Oe=function(Xe){if(zt){var vn=Ke(Xe,!1),cn=Nt.getBoundingClientRect(),hn=cn.top,Ti=cn.bottom;if(vn<=hn){var Ge=hn-vn;Kt=-an(Ge),Ue()}else if(vn>=Ti){var Je=vn-Ti;Kt=an(Je),Ue()}else ye()}};return Nt.addEventListener("mousedown",Qe),Nt.ownerDocument.addEventListener("mouseup",ce),Nt.ownerDocument.addEventListener("mousemove",Oe),function(){Nt.removeEventListener("mousedown",Qe),Nt.ownerDocument.removeEventListener("mouseup",ce),Nt.ownerDocument.removeEventListener("mousemove",Oe),ye()}}},[_t])}var Xt=10;function qe(_t,Lt,Pt,Nt,zt,Mt,Kt,ye){var Ue=ie.useRef(),Qe=ie.useState(null),ce=(0,ue.Z)(Qe,2),Oe=ce[0],Le=ce[1];return(0,Ae.Z)(function(){if(Oe&&Oe.times<Xt){if(!_t.current){Le(function(Oi){return(0,le.Z)({},Oi)});return}Mt();var Xe=Oe.targetAlign,vn=Oe.originAlign,cn=Oe.index,hn=Oe.offset,Ti=_t.current.clientHeight,Ge=!1,Je=Xe,rn=null;if(Ti){for(var Xn=Xe||vn,Ln=0,nn=0,Kn=0,mi=Math.min(Lt.length-1,cn),ei=0;ei<=mi;ei+=1){var Si=zt(Lt[ei]);nn=Ln;var Wi=Pt.get(Si);Kn=nn+(Wi===void 0?Nt:Wi),Ln=Kn}for(var An=Xn==="top"?hn:Ti-hn,gn=mi;gn>=0;gn-=1){var Rn=zt(Lt[gn]),si=Pt.get(Rn);if(si===void 0){Ge=!0;break}if(An-=si,An<=0)break}switch(Xn){case"top":rn=nn-hn;break;case"bottom":rn=Kn-Ti+hn;break;default:{var xi=_t.current.scrollTop,di=xi+Ti;nn<xi?Je="top":Kn>di&&(Je="bottom")}}rn!==null&&Kt(rn),rn!==Oe.lastTop&&(Ge=!0)}Ge&&Le((0,le.Z)((0,le.Z)({},Oe),{},{times:Oe.times+1,targetAlign:Je,lastTop:rn}))}},[Oe,_t.current]),function(Xe){if(Xe==null){ye();return}if(St.Z.cancel(Ue.current),typeof Xe=="number")Kt(Xe);else if(Xe&&(0,Ut.Z)(Xe)==="object"){var vn,cn=Xe.align;"index"in Xe?vn=Xe.index:vn=Lt.findIndex(function(Ge){return zt(Ge)===Xe.key});var hn=Xe.offset,Ti=hn===void 0?0:hn;Le({times:0,index:vn,offset:Ti,originAlign:cn})}}}var _n=ie.forwardRef(function(_t,Lt){var Pt=_t.prefixCls,Nt=_t.rtl,zt=_t.scrollOffset,Mt=_t.scrollRange,Kt=_t.onStartMove,ye=_t.onStopMove,Ue=_t.onScroll,Qe=_t.horizontal,ce=_t.spinSize,Oe=_t.containerSize,Le=_t.style,Xe=_t.thumbStyle,vn=_t.showScrollBar,cn=ie.useState(!1),hn=(0,ue.Z)(cn,2),Ti=hn[0],Ge=hn[1],Je=ie.useState(null),rn=(0,ue.Z)(Je,2),Xn=rn[0],Ln=rn[1],nn=ie.useState(null),Kn=(0,ue.Z)(nn,2),mi=Kn[0],ei=Kn[1],Si=!Nt,Wi=ie.useRef(),An=ie.useRef(),gn=ie.useState(vn),Rn=(0,ue.Z)(gn,2),si=Rn[0],xi=Rn[1],di=ie.useRef(),Oi=function(){vn===!0||vn===!1||(clearTimeout(di.current),xi(!0),di.current=setTimeout(function(){xi(!1)},3e3))},wt=Mt-Oe||0,yn=Oe-ce||0,Wn=ie.useMemo(function(){if(zt===0||wt===0)return 0;var ve=zt/wt;return ve*yn},[zt,wt,yn]),ki=function(zn){zn.stopPropagation(),zn.preventDefault()},Ui=ie.useRef({top:Wn,dragging:Ti,pageY:Xn,startTop:mi});Ui.current={top:Wn,dragging:Ti,pageY:Xn,startTop:mi};var ur=function(zn){Ge(!0),Ln(Ke(zn,Qe)),ei(Ui.current.top),Kt(),zn.stopPropagation(),zn.preventDefault()};ie.useEffect(function(){var ve=function($e){$e.preventDefault()},zn=Wi.current,kn=An.current;return zn.addEventListener("touchstart",ve,{passive:!1}),kn.addEventListener("touchstart",ur,{passive:!1}),function(){zn.removeEventListener("touchstart",ve),kn.removeEventListener("touchstart",ur)}},[]);var Mr=ie.useRef();Mr.current=wt;var gi=ie.useRef();gi.current=yn,ie.useEffect(function(){if(Ti){var ve,zn=function($e){var On=Ui.current,Fe=On.dragging,Pe=On.pageY,Zn=On.startTop;St.Z.cancel(ve);var $t=Wi.current.getBoundingClientRect(),Ze=Oe/(Qe?$t.width:$t.height);if(Fe){var wn=(Ke($e,Qe)-Pe)*Ze,ri=Zn;!Si&&Qe?ri-=wn:ri+=wn;var We=Mr.current,je=gi.current,Vn=je?ri/je:0,ci=Math.ceil(Vn*We);ci=Math.max(ci,0),ci=Math.min(ci,We),ve=(0,St.Z)(function(){Ue(ci,Qe)})}},kn=function(){Ge(!1),ye()};return window.addEventListener("mousemove",zn,{passive:!0}),window.addEventListener("touchmove",zn,{passive:!0}),window.addEventListener("mouseup",kn,{passive:!0}),window.addEventListener("touchend",kn,{passive:!0}),function(){window.removeEventListener("mousemove",zn),window.removeEventListener("touchmove",zn),window.removeEventListener("mouseup",kn),window.removeEventListener("touchend",kn),St.Z.cancel(ve)}}},[Ti]),ie.useEffect(function(){return Oi(),function(){clearTimeout(di.current)}},[zt]),ie.useImperativeHandle(Lt,function(){return{delayHidden:Oi}});var bn="".concat(Pt,"-scrollbar"),pe={position:"absolute",visibility:si?null:"hidden"},Se={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return Qe?(pe.height=8,pe.left=0,pe.right=0,pe.bottom=0,Se.height="100%",Se.width=ce,Si?Se.left=Wn:Se.right=Wn):(pe.width=8,pe.top=0,pe.bottom=0,Si?pe.right=0:pe.left=0,Se.width="100%",Se.height=ce,Se.top=Wn),ie.createElement("div",{ref:Wi,className:ge()(bn,(0,Me.Z)((0,Me.Z)((0,Me.Z)({},"".concat(bn,"-horizontal"),Qe),"".concat(bn,"-vertical"),!Qe),"".concat(bn,"-visible"),si)),style:(0,le.Z)((0,le.Z)({},pe),Le),onMouseDown:ki,onMouseMove:Oi},ie.createElement("div",{ref:An,className:ge()("".concat(bn,"-thumb"),(0,Me.Z)({},"".concat(bn,"-thumb-moving"),Ti)),style:(0,le.Z)((0,le.Z)({},Se),Xe),onMouseDown:ur}))}),Pn=_n,De=20;function dn(){var _t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Lt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Pt=_t/Lt*_t;return isNaN(Pt)&&(Pt=0),Pt=Math.max(Pt,De),Math.floor(Pt)}var sn=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],jn=[],Te={overflowY:"auto",overflowAnchor:"none"};function Sn(_t,Lt){var Pt=_t.prefixCls,Nt=Pt===void 0?"rc-virtual-list":Pt,zt=_t.className,Mt=_t.height,Kt=_t.itemHeight,ye=_t.fullHeight,Ue=ye===void 0?!0:ye,Qe=_t.style,ce=_t.data,Oe=_t.children,Le=_t.itemKey,Xe=_t.virtual,vn=_t.direction,cn=_t.scrollWidth,hn=_t.component,Ti=hn===void 0?"div":hn,Ge=_t.onScroll,Je=_t.onVirtualScroll,rn=_t.onVisibleChange,Xn=_t.innerProps,Ln=_t.extraRender,nn=_t.styles,Kn=_t.showScrollBar,mi=Kn===void 0?"optional":Kn,ei=(0,It.Z)(_t,sn),Si=ie.useCallback(function(Cn){return typeof Le=="function"?Le(Cn):Cn==null?void 0:Cn[Le]},[Le]),Wi=we(Si,null,null),An=(0,ue.Z)(Wi,4),gn=An[0],Rn=An[1],si=An[2],xi=An[3],di=!!(Xe!==!1&&Mt&&Kt),Oi=ie.useMemo(function(){return Object.values(si.maps).reduce(function(Cn,$n){return Cn+$n},0)},[si.id,si.maps]),wt=di&&ce&&(Math.max(Kt*ce.length,Oi)>Mt||!!cn),yn=vn==="rtl",Wn=ge()(Nt,(0,Me.Z)({},"".concat(Nt,"-rtl"),yn),zt),ki=ce||jn,Ui=(0,ie.useRef)(),ur=(0,ie.useRef)(),Mr=(0,ie.useRef)(),gi=(0,ie.useState)(0),bn=(0,ue.Z)(gi,2),pe=bn[0],Se=bn[1],ve=(0,ie.useState)(0),zn=(0,ue.Z)(ve,2),kn=zn[0],Qn=zn[1],$e=(0,ie.useState)(!1),On=(0,ue.Z)($e,2),Fe=On[0],Pe=On[1],Zn=function(){Pe(!0)},$t=function(){Pe(!1)},Ze={getKey:Si};function wn(Cn){Se(function($n){var ti;typeof Cn=="function"?ti=Cn($n):ti=Cn;var ii=Yi(ti);return Ui.current.scrollTop=ii,ii})}var ri=(0,ie.useRef)({start:0,end:ki.length}),We=(0,ie.useRef)(),je=vt(ki,Si),Vn=(0,ue.Z)(je,1),ci=Vn[0];We.current=ci;var Mi=ie.useMemo(function(){if(!di)return{scrollHeight:void 0,start:0,end:ki.length-1,offset:void 0};if(!wt){var Cn;return{scrollHeight:((Cn=ur.current)===null||Cn===void 0?void 0:Cn.offsetHeight)||0,start:0,end:ki.length-1,offset:void 0}}for(var $n=0,ti,ii,ni,Vi=ki.length,Ei=0;Ei<Vi;Ei+=1){var yi=ki[Ei],ln=Si(yi),Pi=si.get(ln),qi=$n+(Pi===void 0?Kt:Pi);qi>=pe&&ti===void 0&&(ti=Ei,ii=$n),qi>pe+Mt&&ni===void 0&&(ni=Ei),$n=qi}return ti===void 0&&(ti=0,ii=0,ni=Math.ceil(Mt/Kt)),ni===void 0&&(ni=ki.length-1),ni=Math.min(ni+1,ki.length-1),{scrollHeight:$n,start:ti,end:ni,offset:ii}},[wt,di,pe,ki,xi,Mt]),pi=Mi.scrollHeight,oi=Mi.start,hi=Mi.end,Bi=Mi.offset;ri.current.start=oi,ri.current.end=hi,ie.useLayoutEffect(function(){var Cn=si.getRecord();if(Cn.size===1){var $n=Array.from(Cn)[0],ti=ki[oi];if(ti){var ii=Si(ti);if(ii===$n){var ni=si.get($n),Vi=ni-Kt;wn(function(Ei){return Ei+Vi})}}}si.resetRecord()},[pi]);var _i=ie.useState({width:0,height:Mt}),Ki=(0,ue.Z)(_i,2),en=Ki[0],no=Ki[1],vr=function($n){no({width:$n.offsetWidth,height:$n.offsetHeight})},Xr=(0,ie.useRef)(),He=(0,ie.useRef)(),Hn=ie.useMemo(function(){return dn(en.width,cn)},[en.width,cn]),Fi=ie.useMemo(function(){return dn(en.height,pi)},[en.height,pi]),Hi=pi-Mt,Ii=(0,ie.useRef)(Hi);Ii.current=Hi;function Yi(Cn){var $n=Cn;return Number.isNaN(Ii.current)||($n=Math.min($n,Ii.current)),$n=Math.max($n,0),$n}var Ar=pe<=0,Pr=pe>=Hi,Br=kn<=0,Fr=kn>=cn,fn=Dt(Ar,Pr,Br,Fr),io=function(){return{x:yn?-kn:kn,y:pe}},pn=(0,ie.useRef)(io()),Di=(0,Rt.zX)(function(Cn){if(Je){var $n=(0,le.Z)((0,le.Z)({},io()),Cn);(pn.current.x!==$n.x||pn.current.y!==$n.y)&&(Je($n),pn.current=$n)}});function $i(Cn,$n){var ti=Cn;$n?((0,Ee.flushSync)(function(){Qn(ti)}),Di()):wn(ti)}function Ai(Cn){var $n=Cn.currentTarget.scrollTop;$n!==pe&&wn($n),Ge==null||Ge(Cn),Di()}var bo=function($n){var ti=$n,ii=cn?cn-en.width:0;return ti=Math.max(ti,0),ti=Math.min(ti,ii),ti},Fo=(0,Rt.zX)(function(Cn,$n){$n?((0,Ee.flushSync)(function(){Qn(function(ti){var ii=ti+(yn?-Cn:Cn);return bo(ii)})}),Di()):wn(function(ti){var ii=ti+Cn;return ii})}),ao=Jt(di,Ar,Pr,Br,Fr,!!cn,Fo),co=(0,ue.Z)(ao,2),Re=co[0],mn=co[1];_e(di,Ui,function(Cn,$n,ti,ii){var ni=ii;return fn(Cn,$n,ti)?!1:!ni||!ni._virtualHandled?(ni&&(ni._virtualHandled=!0),Re({preventDefault:function(){},deltaX:Cn?$n:0,deltaY:Cn?0:$n}),!0):!1}),oe(wt,Ui,function(Cn){wn(function($n){return $n+Cn})}),(0,Ae.Z)(function(){function Cn(ti){var ii=Ar&&ti.detail<0,ni=Pr&&ti.detail>0;di&&!ii&&!ni&&ti.preventDefault()}var $n=Ui.current;return $n.addEventListener("wheel",Re,{passive:!1}),$n.addEventListener("DOMMouseScroll",mn,{passive:!0}),$n.addEventListener("MozMousePixelScroll",Cn,{passive:!1}),function(){$n.removeEventListener("wheel",Re),$n.removeEventListener("DOMMouseScroll",mn),$n.removeEventListener("MozMousePixelScroll",Cn)}},[di,Ar,Pr]),(0,Ae.Z)(function(){if(cn){var Cn=bo(kn);Qn(Cn),Di({x:Cn})}},[en.width,cn]);var Ie=function(){var $n,ti;($n=Xr.current)===null||$n===void 0||$n.delayHidden(),(ti=He.current)===null||ti===void 0||ti.delayHidden()},At=qe(Ui,ki,si,Kt,Si,function(){return Rn(!0)},wn,Ie);ie.useImperativeHandle(Lt,function(){return{nativeElement:Mr.current,getScrollInfo:io,scrollTo:function($n){function ti(ii){return ii&&(0,Ut.Z)(ii)==="object"&&("left"in ii||"top"in ii)}ti($n)?($n.left!==void 0&&Qn(bo($n.left)),At($n.top)):At($n)}}}),(0,Ae.Z)(function(){if(rn){var Cn=ki.slice(oi,hi+1);rn(Cn,ki)}},[oi,hi,ki]);var Un=Yt(ki,Si,si,Kt),Nn=Ln==null?void 0:Ln({start:oi,end:hi,virtual:wt,offsetX:kn,offsetY:Bi,rtl:yn,getSize:Un}),Yn=ht(ki,oi,hi,cn,kn,gn,Oe,Ze),ai=null;Mt&&(ai=(0,le.Z)((0,Me.Z)({},Ue?"height":"maxHeight",Mt),Te),di&&(ai.overflowY="hidden",cn&&(ai.overflowX="hidden"),Fe&&(ai.pointerEvents="none")));var vi={};return yn&&(vi.dir="rtl"),ie.createElement("div",(0,pt.Z)({ref:Mr,style:(0,le.Z)((0,le.Z)({},Qe),{},{position:"relative"}),className:Wn},vi,ei),ie.createElement(ne.Z,{onResize:vr},ie.createElement(Ti,{className:"".concat(Nt,"-holder"),style:ai,ref:Ui,onScroll:Ai,onMouseEnter:Ie},ie.createElement(nt,{prefixCls:Nt,height:pi,offsetX:kn,offsetY:Bi,scrollWidth:cn,onInnerResize:Rn,ref:ur,innerProps:Xn,rtl:yn,extra:Nn},Yn))),wt&&pi>Mt&&ie.createElement(Pn,{ref:Xr,prefixCls:Nt,scrollOffset:pe,scrollRange:pi,rtl:yn,onScroll:$i,onStartMove:Zn,onStopMove:$t,spinSize:Fi,containerSize:en.height,style:nn==null?void 0:nn.verticalScrollBar,thumbStyle:nn==null?void 0:nn.verticalScrollBarThumb,showScrollBar:mi}),wt&&cn>en.width&&ie.createElement(Pn,{ref:He,prefixCls:Nt,scrollOffset:kn,scrollRange:cn,rtl:yn,onScroll:$i,onStartMove:Zn,onStopMove:$t,spinSize:Hn,containerSize:en.width,horizontal:!0,style:nn==null?void 0:nn.horizontalScrollBar,thumbStyle:nn==null?void 0:nn.horizontalScrollBarThumb,showScrollBar:mi}))}var ee=ie.forwardRef(Sn);ee.displayName="List";var Mn=ee,ui=Mn},32637:function(Dn,Gn,kt){"use strict";Dn.exports=kt.p+"static/AssistantCode3.a8740efb.jpeg"},93314:function(Dn){"use strict";Dn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAACaCAYAAADl9acYAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXQd4U1Ubfs/NaJtO9kzLahFQEJkiUBBFUFFkCCjiAAVFERT5FREQQQXBBcpysWRP2RtkKRsEOphNodCZdDfjnv85CU2TZt2bhABNDw9PmtzvrO+c957xLQIP0pkz1yrQIEmwwcDzHhTj91klEo7jpcG5zetWUJdmRjmPvTM9GI9JgSGvadOoLE9KJJ5kPp2YXLtZdO1kT8ooz2vigCNelvPYezPEG7z0CDAn4pJqPvJA5A3vdcl/S3LEy3Iee29OeIOX5YDx3nh4VFI5YDxin6DM5YARxKb7g6gcMHd+nMoBc+d57LKGhCQ1ZURBCoVL2nKCO8sBZWW50x1TOWDuLP8FlV4OGEFs8glROWB8wmbPKikHjGf882bucsB4k5t3qKxywNwhxrpRbJkGTOx0ehlA3d9e5VEtzA3ulGe55zmg1QOfrCVo34BgQGvr5rLDRl4RRZG+5NjBESBc4FHw1LlrCAuPsCo0JjKi7J5hYqfTXADBq4byCJLf82Nf3kA3OfD9LgKdgeCzZ4CUTJ1VKQFyKQgpmeMSjiKvQC+oplspN/wOMDcBVFv0Bo+KwYJ4VE50H3Jg7j6CWzkEX74A3MrSgTfeKZpSaBCHcAVn/JunBHlFPDR5BkG9LMjPt7mZLOtbskQADea9wqOW9coqiGHlRPcHBxYcJriQQvB9P+v2cqCwWFxgoOJk6JeTNX4HmJMAHv6xP4/6VXw/+OxNx/bM/pIohdUE9VW/VxwjOHiJYO5A6xolpGSpYW3jIW4w/A8wM+h+UHSY2pvHgzV9NXymeor0wPc7Cf7XzWJ/4Nsm+Ly2LzZx+OwZ3yuVbzhNsPEMwcI3rM8wMikHiURi5gNbbQoKrc84zpjkj2eYzQC6f96DomUd305ctrp8tp5gSk/f1utzlFhUOHYthy9f8D1gdpwnWHiEYOVQ6zNM6QM/AY+CImHnF9YtfwTMCgB9P+5G0SHa9xP3bk2gT9cBU3r6Hjp95nBYNcz3gDlwkRhX843vlfS59PmFHfjFzgC/2pJ1nEEnEIpIAG+834Wia2Ox7PJ8wt0twLz7J8Gsl3zf316zCVYPsz5oe85F1yUcu0YwcQPBjlElZyjL8wsrQeyBn+XxK8DETqefgyACFCPe6kjxfDPfT6C7BpilBLMG+L6/A34h+P1VikCZ60nuTYpzN4AxqznjCqPOMZ1RSp9f2OVLYZH1lbOrNvjVlswIGEAKYOyrj1K82NL3E+huAWbEMnbFSn1+Qzd4AcE3fajPZV6X04D3lnHGM4xOawKFJwLLYiD5H2AoCkHwJQMLA42v090CzJjVBBN7UCh8rN3AgDrqCYq6lX3L6RQ1MGQRhwWvA7UrALbnFzCJjOhG+d2WjFCkUYKZPZpSDIv1PWDGrycY34NCahI0+yxN/Ivg3c4UlUN8VqWxok/XEfRrSdG0tm/rzcoHBv7KYc5AILqqLWDcOb/45RmGEFyhFL8/0Yga33y+Tl9uJhjxOEVIoG9rnrqVKSJSRFb0fb3tG1A81sC39TLRSu85HL57Eaii0Bm3oqEKqZXSJaUURUxTU0Tyuy0ZAc5SYCUbxE+6+x4w3+0kGNiWooqP3/Qz9xB0bUTRsLqI2eEFUlbvA9WBJxv5ltdMit9jFocpLwB1InQIkBEQTmLUHStOBoMBOr24K2+/AwwPHOKArS2iKCY9VzKIg34jyMgTv6f1wpwqL8JLHKgUTLHwjZIxZTKg0V2Bzg2tLzvYBYA75xe/25J1mkEnGAzYyXE40KQmMK23uLeLN8b1j0ME7epTxFTzRmnCy/jzXyCqIny+NVryDzFeKfd+xLcrDOMMO8MMfgx45iFrOZA7AstiTvvVoZ91usM3tClHcLpeZWDmAN8DZtlRgkY1KJr5+BC87hQQLAeebCwcZN6gXH6MgG2P+rfyDmD+WLoV8xZugkIRiNh2TTHghcfRoF4tFBZpkXgpGQ81rmdu9puLOLzwMPBYPR1Cgzw/v7CC/WpLxjrc/jtaT2LApRrhwC+DfA+Y9aeI0dKzbT3vTCChk3r7eaBABzzfTGgO79CtPUmM9b7U2jv9bf3kOyjSlihLcoSg93MdkZ2Th227j2Hoq8/inTeeNzZ+xFIOsTHAsw/pAeL5+cUvAdPuG1pVRnArQgEsGex7wGw7RxAgBTo19M4EEjqtD1wEkrPYm15oDu/QbfkPSM0hHsu8du0/gSnfLkFGVrbThjFLynULJ6FOZHUw2RNbyd/qUJLFHZV+ywr9aksWO4Ou0BK8KueRz/bVq++CUuD+RGbhB3R/0LeAOZEEnFIRvPGYb+vdGw+cvU7w3uOe1dv+mfeRk5svCMUfvz8AA3o9jgkbCJQVgPe7lGTz5MDvj4f+VXs/JH1ip1PmAkHy17u8z42bjl4lxjf9C809m0CCZo4FUVwKsDPOJLz0ZTp6Fdh6jtnWe1bvuCm/4q/tRwQ1/b03e2LIwGfw1RaCkADg425AOvPkYCHZd0cG43dbsk4zaDFgWHiHcG85wjBQoEhnMhAzf5r/Jihkf9/+fjXDtDXqGA108+Eqcy0DYAfwMU95NnEFzVgLovibwK8HCab19qze61s24Pf5K7A5KwB5vHM1CblMij9m/Q87rtc1jsek54CMPIBayGD0BgP0ImUw/gwYFiqjllhHGAcvAkuPcijU8cgv0KGgSGv8LNJqweu1MOh14A3ss+S78W+Dzuo3RsPoTy0YgIjQALFz0C36tBzg570EE3p4NnHFVn5TA0zaSPDzy57Vu2bIS6jF67BDHYBHgnVI0kow+6ZjLyZNm9RD+35jkZINfNO7ZIVhEn+e16NQ6157/OqWjJ1h9n1IXoydTi8AeGD+KzxqinCEsfkswfBJC2HQacXOG7v0B+e9CGXVUK+U5aoQdm5iE3eqh296R/XoDEBu0e3/hcz3FzF+Z292trI91Zgav7N2tKrDrrfFTdgTI4dAl61BipZDDXYINRCMvBrusNvBikAMHT8LTM3/pwElK4xMAuQV6uBuKK4yA5hEVfY8SvmmHCETGyjDtzqbQLHf0KMgaCnWEcaW/whGT1mAHHZP6oW09bueaFy3khdKcl0EO+y+v4xgphs2MWxbs+K46bLCDIoi6+9iVLKY4PbTp8UB5t8h/UB53qimz1aJA9lyLExz7H1vyMCnUa15L/x9EfhtkIk/nh74y9ShPz5JnUGA26qFZIdcTofWqR5xxd5Uip1O9wDoJNYRxs4LBB9PXYxUdaHrGSqAYuWUp9GmSQ0BlN4h8cTq8qVfOGgKStpBeAoJb4DEYPrPsU89b/5e/LvEYPubLCIQX06NEtWpfwa/yA4h0FEgqVCK71OCUeTARdLLfbpg9PAXsfGsBBtOA0uHmKpyV0PZsqFl5lo5QaXWgRqNw4pTHiEYGa2M+KX0yMROpxsA9BDrCGNvAsG4GcuQdMt45eJx+nXsk3iyNbOY9k161wOry8/GqZCr1t4GBA/O3T0Nm7gSDl/89IBRHiU0nRk3CgU3knEmT4pZN51rrjI5TN2oGmCOMP44BKx7B8jINemP8ZRCK2Y5LNXAMrMlS0hSpwKw9TRGME+XHf5ekybEfPCInU7/BDBArCOMw5cIPvt+JRJUGqHj7JRu2rsd0P+JGBuanELTTVpwwO3/cnjFxNcTwMz95hquxud5pd+skIEfR6NJA+F2y6o1S3Fj4xpj/X9lBmK7OsDuChMUKMf+v36AXC4Fc4QxYwew/X0gM8/k5VKvN0BvcF9gfc8CJuGWuh4twgoQnJSBzK+nDP+3eLTsBahJSNL8DdD29kaUAFsDSU4vpVJp3FTETqdzAbwl1hHGySSCCTPX41RimlcmzthBrTCsV1Obss5cJ2hWXQupTIoiHUW+1nRYZkcn5kRbTzlIOQq5hBmimfRu2RwoeU4gl5rAFiI3Odpmb/NRK0zXu+zgKzZtWZWK/VvTxWZzSP/EK5HoEivcxsFQWIBzk8caVxmWmMT+g6thNlfMg/p1xYfv9DXSMEcYEzYAu247wnBXQ9myE/fslixRpf6FUgw2N5bgDChmk6Lw33MMqkqlg8JeVKmn8hRjHI0QIdgbiJynGWhiZ9AZoPhgaEeK50Q4wmDCvwmzt+HwGe8EcH67V1N8MshWV4UBpnlNLQID3Lcn5nkKrZ6iUEex4azEqC08di0BW1XDgsTP+2NHsrH6F+/0m9Xetns1PN9b3IWHPi8XyetXIOPoEeg1WbhYKMGK9CCoiiSoWq0SnuvWzqhLVuyoz+wI411mmi3epZI9Lt2zgElIUht9INtpdDJPMUsSGf59NCFFxc8TknI6AoZ9LqbCmj+V4X33zMAEAOMHtaXoJ0KLVpUJjJuzD3v+vSh+xtnJ0ffxaMwY0dHuCtO8pg6BAcK3LI4axCTai/4hRsBM3kww5DGK6o5vYx32S52pw9QxbEi8k6o2DMeoj2q5VVhqNnB29JsI0TP5M6Dj5Gg7dwmkpVZOsyOMtyg4joDyBhRq3d+Osbru3S2ZSp0LCmf+9ZM5CUY3qBWx3LREUy5RpbkKQOl0FAimvrksPAME08Q6wmD74DGz/8H2A/+5NdClM8U2r4VFE7rZBcwjtXQIkHsOGLbSLP7XBJhvdxD0fJiinhs+pVk5n41IBM/UFryQSHggvpxRooovpsgdFwjoD8MQri3ZIso/XYzm9a2FwDfUAFPxX/AaRYSCeCR/KW7fvQuYJE0RQF3vSQh2UQn3bsOaYXEJSZrPADrJBfP5BceCVx+4LO0r1hGG3gC8//Np/LXrmJjxdUhbv1YE9vzU22eAmbOPBRmieNCNFzvP8/jhaxVSL3vn4M9zBJN/bgSZgJsyplZ0KQ24oSZgq8vmE4V4+9hrkNIS8O5uPhbNOz+CprWpWRhd7Ahj9svMYM871rT38pbM/q2XvelHoeU4bpxBgt+Jjr8MAqfi80NXZEW/H1UEuOMIY/zCRPyxZr9XABMSJMP5pbelahYlsjNMi1p6402Pp8lyhWEhIBpVp2hdV1yp6nwgPAhYvzQF/+zOEpfZCfXgz6LRIMrxKsq0B5YcKsL6UxRFvBygelBdLjhZGMCx/RfTKWMCUGZzbAClvJEmtiGH97oEGLdhzBHGjL4UDyvLOmBUmn9AaamAay7GimAXgdErzG1RlX36k9el+PlgsPFtK9YRxtwtNzBl7havTZoLywYhuJRbSCNgauvBlAg9TQYDjyVHOeOWbOVxoEoo0Mn2JttpNZvOcmhfn0KTXoTr8TlITSnCrRSt8TMvV7gj79KVPDskCo+1tb/rZkLScavzcTlTARBrZUu+MB1coHNHZ8rQXEzvH4T+8yWY9DzQrj6QptFDzzRlPUj37JbM5pZMeCfZK5CNgsPt3PlbEny3LwSlHWEIqWLzcTWGfbFaCKkgml0zeyNaaa3QdqcAs+msSa2k+4OCmmYm2nyWQ98W9idabo4eqSla3EopMn6m3mRgKkJ6KlM6dV5Plz418ES3CjZE7Ar9w2X5UGXbv3bmC1NBAiqBEOf34zFhKlzLq40PuxK0i8qFutBzRdd7FjDx1zSDCKELxA2tmZoyyztqqc9tUdDlDAm+2hUCdxxhHIwrwOAJy5EvIkSCsz78Nq4rnmhpfU/BANOytgEydwQmpSpjQro/b68we+JNArzej4jjKouz0q+luDwGAzWCxnI1Kr0qPfpEZTzXv6pVwUzf6+MVBTiX6vi+hxoKQfUF4AJswWZZGF+UCUN2IsYMaINnbcVd4jp0m/qePcNcvJlTldcaUm5vVN3qnKNM1zUcJm4LhTuOMP65qMWYGWtxJcU76jGT3nwUrz1j7ZnCCBilAbLS96RucIFJtv88ZpLD/HMZSEgFXmkrrqANp2yjEYsroYRar6f44I3zxh9qNwnH8FHWNxBLj2ix6F85SKltmGV9lBrAF6RConCuh8fotCn7MSC2Fob3ELkPddDBexYwrL2JSZqtFPQpdwfHUT7mf+zjTWFwxxHG8St6zPhtCw6cZXcSnqdhLzTF2FethZcMMK2UBki9DBgmbz18mYAJbMUk5shiYBsxORzT5ucZ8PHbcUaC4OpBGDe55AbiShqP9/40gHLOt058UZbxXMPJnQuUKK+DLi8DEs0R/PJBLIIVwjULHPXgnt2SsQbHq7JeIJSYFIi8mNgeeeT6cFRQAItFOsL4L5li0do9WLrLriK06FZ2e7QO5v3PwugcgDcBo9MbsPT2CnMxFcYwdiNFuMhlKjcs/J23AMMEoONHJhj5JA2T44tvS2TTo5cX4kKqY5X9YuYacq9CEhzlMngmr8uGQasFLUpDPcUV/DCiKwrcNBwrrvueBsyKFVTSvG32aQraRPRMdJKBWaa+vSrcqNAo1hEGsyD8Y/1R/LzmjFea1EBZAbtn9rIqywiYSB5Siecey3U6A5YeN23JmCCPORIcK8IWhV0ps1Wpj8hzjyPmsDPN5P+ZNCWInMOXPz9g/PtgohZfbpEZ3SE5TxSGXBUkIa61vPnCDLCzFEuGrOMY1q02Xunq2VS6p7dkrKOJ17N7UAPP1PG9moatCoOBJ9go0hEGe+P+vC4e3yw84JX2VAoLxMmFL9sApnUkD4kXAKPV6bHsuNQIGDb5p28nmCwixmZSJnA5jeCZh1x3NzfpKi7M/xlFGRmo0qoNqnfohPAG1mcH1dUCfDP+sqkwjuCreY2Mf478swiJGa6V3Az518EFVgHhXMu0DYUZ4G8Dhuqy0Sg0EfM+8myHf88DhjEzIUmzAaA9XA+ZcIqR60KRp+XgjiOM3Sdu4s0vtyAkSIrgQCmCg6QIYZ+BMuPf7Dfzs9vP2bPi34ICZTh2szJ6NM41HuyrV7f2G8tWmNZRPCSc5yuMJWCYGcjHawm+7Sv8DPPfdSBfS9C5oWveHhg+GFqNyfRBEhgIeWgY2kz7AZysRDh5KT4fP0y5vZ0lwBdzGoO9FwbOK4S6KMDpCkP1eaD6fCNghCSDNhe8zmTsVznrMD59XIGa7Wx194SUVUxzT2/JihuZmJJThWoNZ0HgNY/EH28MRUY+B7GOMFibcrJzkJuXB3Z1zXHc7U9ivNlh0mX2aXpm/7ekLA57E6R44zHm5slWAs0A0ybKpDDoaWLhHJafMK0wLIm1ujx0iYD56WgrQO3ryuplSN6xzajkqM83+RCr1aUrol95A5zUJIT971QO5n2bZPybXYRNntsYvx4guLJrL1qkbsD2moOQHP6wlUskRkt5PfiCm5AEC/exa9DmgNcVoVL2KQy59RsqhAQg6tPvwAU5U1F0zvH7AjCsC4mqnE6UGpitvsfSJ0IIHb8lmNzIlkCsIwxPJzDLf10NrDtJMNyBjzDvAkaH5SdkbgOGOf5oVAN4sKawnl+YOwspf+81EzPIh9VvgCbvfoDAKlVx9JAai+ZcNz4PVBBE9W+M07uPo9/laeBgknSeC22ObbVeQ06QCRzselivuQhZBNveCX+JGAoyEZEThyE3fkIYNa00yh69UPdF6y2wsJ6ZqO6LLZl5pUlW9wHFMkrh6mTokgdf7QzG5UwpxDrCcFmwAAImPPztIMHorva3RkbA1GEhGoRPDkfVMj/EVoARaabM2vliCxj9QQtJ1GDAtU3rcGPXDmjVWWDfWWJbtHp9BiCwRScU6KQICJRg4VEp4g8ex4tXvrFSpGT0JxXNsKraIEgVFaHLuQ5ZSE1wAeLsEioRFZ5PnAVlTok5hiQwCG1+mAupwr1V5r4CDGNkgkrzEij93Znqi5CB/XafAhduySDWEYaQsl3RFGiB6Tsce4NkgGlbx+WtqatqjM9ZlOAVJ0tWmPeWEvzYX3gYcOY9cuKzsLE1EVK5oagQJ7/4DDlXS67gZTVqI6dlXxwNaIXrJ06j75UZkFhoHbNyK7Zqh2E3usHAlCupDgFhtSAJEmdsxsqJqZSHevmJaHPoC6vm1nvpNdTu7t6R+L4DjAk06t7M+tKuDb+QkQTw00EFTl2XQawjDIHFOyVj6h+frSeY4uC2it1MRVXgIeUIpBLTWcjdxMJArDgpN2/JPlpF8PlzwoPDjl9v0vZ1N2k1apz+ehJyVaZzS3HimUMKIoWUWrusqtDqUTR46308/bUKekghU1QBkbq+PbPXPkNuEog8DAOS5+ABzVEzSWj9GDSf+JVbXbovAcNs+oODFYSjsp8oqCm2gcj06z9BOHJNbjTZ7RDt/oQQWa2ZXEw0ZWY1yYzYGdCYuj5L7AJNwgBlvHRgj3mjnfvtx0YlS/Zcp9dj6wU5nmpiysccdLMYm5UECr3HruHwQ3/P+KPLzcWZ6VOQfdG5xWbVzl0R9fJgEI7DjO0Eu85rQSTuH1lbV45HbmYSzl1OR+2im4g0ZEJpyETdAC26zpnv1tDdt4AptulPNJ1rplMKUY6uFh8PxL5LARDrCMMtLtvJJAYw3qqTlcOCw7JYLUoBwWHZWWvBIYJxz3jeAiZxv7R0AZJ3bIetdT1B7T4voebTPc0VMbe2G08Wur26sII+6JyD5x4JQU6+FkfOp+DA2es4fO4GsvO1qFk5BE3qVEaTupWNn9G1K0AmILT1fQ8YxhhKqfTi9ewBoPQjSiFAxAasOh2AbfGBRr0qMY4wPJ86phLuFmBm7ibo2oSioYAL+uPXgKvpBIMe9VavgctnE5C7fyuyz58Bc2oRVKMWaj7XBxVbWGuELjxMsOxIAYjUtaqMo9Z90CkHz7WwXkoNPMXZy2k4ePYGDvx3HVdSTHIjBqCVn7verJQJwBQzjKnzJyRlPcZJuJ6UxwsAHEoP/joXgA3nAiHWEYa3ps7dAgyTeTwSRdHcuecDYzdXHCN4oBrwaH3v9Fqr55GWmY2ICNe3XWtOEvyy17MVZmRsLnq2dH4bdv5qBt6Ytg3d29TDOAFvhjIFmNLDGp+c1UxCycs8xTu3jcrMJDvi5VhxOghiHWF4Z+rcvRXGGBy2EvCYABB8sZHggycpqoa6f+lgya/MXC20RUUIDXV9gGJueb/d5tkZ5r0OOejd2nldm/+5gkkLDuOzQe3QrY1r2+0yDZjiwbp4PUNJeelKSqlZSX3/ZRkWHVNArCMMbwFm/AaC8c9Qt65rPWkDCw7Lggw9YVLhcprWnCCoH5qKGmHUaC4tl8sgl0kgl7FPqWhdt6upuQiWc1AoXN96MSd849ez62/31YPeeSwHL7Z1DpixvxzA7hNJWP9lL1RmjgtcJL8ADOOBSkWDCqiGaQoYlYn+TZJh/hEF3HGE4YqpQp7/sC0PrzRPhYxPg9yQjmCkoTA/HUV5aZDq0wBZBQQ0my6kKFE028/BGODpOYHBYfPy8qDT6aDT6Y2flolpUxeDhznscAWkfxKzEFNDAbncteIk8xIzYinxSBj1VrtcvPSo4y0Zs0Z96qPVqFpBgcXjnhXEx/saMCZfZNmTQCjTmZCAEC0oUglPU3iOnDEYtCcb16nCrDaN6ZxKU1HK0xOEIOrMDSlmHnDPEYZLzhoKAW0aivLSQXRpCKRp4HTpKMxNAy1KN36XE+cRAHjKIb/pckhk7h967bXz70STao47wWHZ9bZebwJOMYDY38Zrb4vEtKwZeAKMq5IJSDKZFOuPpqFr8yqCNBjYDd3AXwwgnPu+2Qa3zccrjzleNY7G3cR7P+7G8+2jMWaAMH8r9zVg4pKynudA1jmawExnjKf8fwRkAwF+j46MuJSoyupEKdkdnyoh0/e65wjDUX1c3MdA3hUEEO+YL6fU+BwRNUQa07tAM7v5OpNM8LoXg8PqDXrotHrojUDSQafXgXmrKZ3i0uV4vKkwiT2TJ/WcqYWBBLp8PzkieK1NIV5r71iO8/2qE1i2O8542GeHfiHpvgbMRVX2RzzlpwnpKCGEOa76i5dynxCeTriaTvpP2RnqliMMhwC9MBaBBaeFNEcQTU7FvpDWeU0QrVCiCynA7jjHip9Cy3FFxxz/mVYi0//sPD2u5wWgXUOBSmkAXvtVj7R819s3R215ta0Orz/m2FVVnwkbkJyWa7xOZtfKQtJ9DZiEpKzXAfKbkI6W0JAiQrDyZjZ5adyWUM4dRxiO6qOqRVCkLRPXHCfUt2gjhLXw7jmGBYdl18Uf+Tg47K4LBCz0uZh6P1oJnL/p/qH/5dYGvNnBfv5rN7PRb9JGVAoLwoavrC1enQ3gfQ2YC1ey6kil3CV2lhE7S7MKuMIxf4UGuuMIw1FdhszjCLk6XmxTHNLrqRT5TVdAJnNfPaR04cbgsPsIJjzrmbqL2E4evgxsPy+uXubM7+Vfmbss9661X2lDMdhuABRgyc4LmLnmJGKbKfHlW8KNyu5rwLBBS0zSbKBuWGOyWCoj1rrnCMPRZNEX5SLk3ACmVih2PjmkV9WYiso1RHrec1I7i1HJ5Ct3Kjiso6rPXgeY9P6bPsKB2uSRWKSlZbjNy3FjhuOTD5kIzja9891OnEhMxVs9muHVbsL5e98DJu5ydkNOxh934enfhmPsUDl0ZRgCZUS0IwyHWzJmqPPfcATorrk9yKUzZld5DTKlKUCQNxLr98jlJhV/X6ZrmcBXmwnmDBReb2R0CxQWmiOaiG5uj+5dsOyPH23yMd2ybmNWg6nJfDv8cbRpLDzO6H0PGMaN2zYyi8Q6/Ru+Ogw6A8FfIh1hOBs5evE7KLJ3ih5cRxluSR5FWLNxXiuPFeRJ6D53G5KWC3y4gmDhG8IAw7Ssa9Vlpsrup8jaNXHh+A6bAnYcu4bPfjto/H3z1D4IZ5JcgalMAIb1NVGlHkwpmQ1QwRf3H6wPRU6Re44wHPHXcGMTQm7+LJD9rsnU+soIaO2ux1z75Yu163fdStcUuYXA6wsIVg4VBpjMLDUeaOrgAOK6OjNFcvwhVCiluzbh90PYdvQqqlcMxuovSjSkhRRbZgDDOnsxOaczpYaFlEKQp4Sxm0KQlidxyxGGI+Zqs+IRfuUDIbwXTJMWsxghIc79CAsu7C6Ndg0lAAAdVklEQVStMEws88Jsgg3DhQEmSXUdLdt55hLJuIKs/g2x7UvcdrJtWPcxq40q/h2bKfGViAM/K69MAYZ16NKlzHCDlHwBwr0FUKdr7efbQpCs8a4jjMKCfITHDQRH3d97l578qmqTUblWczGYcErLzjDT+/hej63HLA5r32YOCl135dyFeHTuahtsynVOa4qvPv8II4aVyLJOXUzFsG9NW+bXuz+EISK9lJc5wBSz69KNzEheLxlFQVnEIrvmUlN3B+NiuncdYWi1OsjjP0KQznvxIDVVh0Bem1kreCcZg8N2pwhzX4juVkN6zebwx+u8oHr/OXoCPXrZBpsSW/GAvj3wy6yvzdl+WnsKi3aYnKFPHtIBnZu79qBpWWeZBUxxJ69coYE6ae4zlOqfIyBPM59uxc++36/AuZvedYTBJNz6+OkIL3AVn1b40N8K6oawRu8Jz+CCcvImgiEdKKoLF7p7pe4B8zl8148XVO+uPQcwYNAwj+tt0iga/+4t0Z4a8MUms9HY0vE9ECnUHc7tlpR5wFhyfA+l0lqq7L4A/QlAhTmHgnA8We51Rxh5FxejcvZSjwe7uIAk/cOo0nqK18qbsYPghebUGO7Dl+n1Pzh89iwvqN71G7fhzbc/9Lh5LALCzr+PQVMkR2w0Na4u566m49J1tVElRqyDEb8CTDH3LyblPMhTw67fjwZVPXTV+44wspP2oVq6IBU3QRPiprYWwtvOE0QrhGj2PoKO0dSoR+fL9O5SDm/H8oLq/XP5Gowc7R2tic9/XIlNyU2wY5RH1gJGVvklYFjHL6k0Ty85EbhxV6KceNsRRuatS6h1fYTX5mK+IQR5TZcbDb+8kVhw2MY1KFrV8UZpwsv4ZC3BCw8LC0o7/7fF+HRCydnDWS1FOSmQh1S363aX5XtlxGTEBfbCxveAIMFCB/s1+i1gGDsGL9Cvvpgm6eVtRxgZGZmomTQYHNUKn01OKHlIcEG5AfWE+eB2WefKY0DVMCDWO0G5XNZXTMDOTu3qUzxuinDhNH0/cx6+nGYrpS+diflxLkhPgFRRGfIQ+wzq9OxA5DUei5VDgYruObw0V+vXgOn8LR3L85jibUcY6iw1KiV9CLnhpqt5Ieg5DxkOV16PRyKFyTBcFbrxDPNZJj44rKtyXT1nvsYaVqeC4k1OmfoDfpjl2ncYb9CiMOOS0edyUOVoEGM4cuvUuGkrBHdbgIVvALWs4++6arLNc78GTOx0yq6efvS2I4zs7ByEJY1HkNYUactZ4kkg9FwE9JIKMEgijH8bjN/Z36bftCQcudLaeKC6q9KEPd8dB2Tliw8OK6x0x1Q/7SWoGkrRt4XrksZN/Brzfl3skpB59S9IN13hy0KrQxZkK+ANCQ1Do7ePYO5AoIF1DFqX5Zcm8G/AfENfB8Fv3naEkZubi6CkbxCou2yc9CZARJgBwcCRVlgZV3KC0aSmAhwnQYBcYowHI5FIwIN9MjPfkt/shcUQPdq3Mxy5DLDwfQNFBod1t77ifMyxuVxCBdX7wZgJWLzUdXh3Zh7NtmSgPCQBIQgIt+8/qtmw3fj5zep4yDoGregu+TVgOk2nTNl8pbcdYeTnFyA9U2MMDhQYIIFcwoGTSGCgnHHLECTnIJVIMG2H1BjywtcCRBYc9shlgrdEBocVPbtKZVjyDwGLLyqk3mHvjsGa9ZtdV0k4FGZdBa/NM/JbUcX+wSy692z8PDoWAjwpOa3TvwEzjXajHLa0b0DxSXfvnA9cj3AJxfe7TG5bq4aKyeU5bWIqsOkswcguvu3zyuPE6IBDSL2DBr+Hrdv3uOxshVqNkZqwH7q8NCNtYKUG4CS2V2G1OozE7ClvoZOHFx3+DZjptD0F/m4RRTHpOd9OHja4c/cRdHuQGh3r+TKxScuMuXz9kmDRmM/dgKB6+wwYgv0HjrhkS6+Bb2PlbzNQpDbZILEtGdualU4VH3gaX0/92ii89HZSVpY7NQllzvOLfYG7W7d7Nqe3a/NGA1hR7WfQZhKKU0yAN62396wkhTKFyUPa1qVo6KXDvNB62YH/2x0EXzzv/cnjrA07zhPsT4SgepkeGdMnc5V++nE6Phz/PTITmEIlhSykOmQK24M/W3mmzV2Lpxp7f5z9BjCPT6P1DRwuetMRhqsBtnzOnFHEVAMeVvp24hbpmata4lHcFzH9LKZl8TJXn4Cgep98+kWcPmtSknSWVi/7BZNmrsc/G2eC1xVAqqgEeYjtVRjhpPji1wN49qE7x+uYyAi7C4E3XvA+XWFU6Vo1ABsP2MzJwvDlMnjTEYarAbZ8zrYoVUKBR+vduUF01J67YUR2OhmYs49g9suu+9uhy/OIT2DyFedpz/bVWLXtFL77/F3o8zMhCQxHQJh9nZ/RU5diYJc7p95QZgCTnKHLppTaHK3Zm3bwYhkqKIDFg72/VLsabLZFYbYhnRu6nkCuyhL7/G4AJuEWwKT9QsyUWz3WDdeSkl1268zR3ThwLgtDBzyFIo0KnDwYgRH2VfYrP/jCzKTdX3pPZ8ll60wE990Kk5yhi6OU2kSaZx5OBy2UIkDqPUcYAnloJDtwkSC7AHj6Dm4THK4wIoPDiumXI1pVJjBqBcGqYa5fEA+16IxbqaabL2cp+dJJ3MqRoGXL1si7cRKcNAiBFe2vIopqDZemn133kqsyvf38fgTMJkops4WxSUOWSFGoI9joRUcYQhl+SgUkZZK7EtBp3DpgsjhzdqHdckiXlQcMWcReTq4Bw+z5mV2/sxQcrMCVuH+NoQof7DwESf/+aTz4B1WyH8tDHl7zhDpxlwA9A4+7alXAfQcYVYb2V1C8YY8N7y6XQl1AsGoojyD3vZK6zWHm9siDmK9u13u3Mgrtb71GbZCbm+e0mbVq1cDJIyavMK99OAvrfp0IfVEOFJWj7earUKUG9mxZ45WuOzqv2Cv8vgNMcqZuCuXpWHudGb1GipvZxKuOMLwyIn5eSGSDR8AiQDtLDzZ+ALu3rTKSzPrzAMa//xK0OSlQVLHZfd8uhuDQ/p1QKDyPiFCmAaNK17KD3g/2mP/ZXxJcyeAw/xUeNT3UZPXzOe7V7tes2wx6vcFpme3btcaa5SbX2gfP56Dnk62NipiKqo7tB1at+BMPPdjE47a6kr1YVnD/rTAZ+r6U8ivscWnyVgnibnL4sT+P+l6yN/F4NMoLQLXIh2zizpRmy9PduuCP+ab3YE4h8OCjzyMzfrvDMwyjm/rVZPR8vofHHC7TgLmRpetoMFC7Ximm75TgVDJn1G96srHrw6jHnC4vQBAHqipd+zvu/2JP/Dhjsrm8zv0n4sSWHx3KYRjh0DcH44NRnt8sl2nApGTROnqD7oq9kZq1T4IjV0Q7/xc06OVE7nPg6DS2bXL+AqvW4hVEdvnEXEna2bW4uGY4pEGO99ZPPv4YZs3y3DNpmQYM42hyujaBAjbXJxvOcFhxggHGI+UD92dGeU67HDg6/SGAd36GqfHoMNTuULJaFGZexem5T4CTOL7ufCCmAf7dv0EQ11MyrWN6WmYq84C5lqEdyVF8J4hTlkQc+URZUSbMG4PowsVlSEhSO3zlBtm5+alR0UOPD+KaZ5fa0aQryM+3oi/d/ocfaYOCQudxQCeOHYUPRrxpLocZk8U0i8Wt1HSHLQ+Qy3Hj0jFjzE1Xya8Bw4IuJWfoFgJ42RWjip8TQlbVqijtbwz3dw8kfwJM23YdkaXWOOX6tMljMWzIQCuawW9/hJVrNznNt37Fr+jc8VGXI+rXgCnmjipT353w/Es80IIALDAIM56QMFBQSpmkLAUEJzmeX1qrSuBfLrnqQwJ/AkyXJ7sh+bo5ALZdLs+cPgmvDuxj9ezPFesxbETJucZexrfeeAnTv3QdQqTMAyY5TdeZEspcjdjXjfDm5Ka4REDerF1F5tos0Ev1+hNger7QGxfiLzrl3PyfpqJfb+sr4vSMTDR4qCOYy15HSVmrJs4ddx3Dp8wDRpWhvQQKYfGjvTGJCS4rK8nvPDhvt9WfADPwlUE4etx5ROpFv/6A55950mYkn+zxMv45etLpCB/esw5NGjm3Vy77gEnX+lyQIua2xFOM+hNghg8fjp17Djhl2aolc9C1i21A1x9//h3jJn3jNO+EsaPwocWFgT3isg+Y8hXGatzv51uyTz75GGvWb3E66Teu+h0dLYIlFRNfuapCs7bOgzG1a9MCW9ezKI+OU5kHTPkZxnrw72fAfP3VFPy+yK42k7mTOzf+idYt7cfB7PBkH6cmzsz/29ULhxAe5thlT5kHjOV0SUzKfp6CLwkMAnIjJjLcyo3bRZV6Kk8xxpyPIjsmqiQgYkKS5jpAzfauBFzP6Miw9Z5urdzN709bsjmzZ+K7mb84ZdWBnavR9MFGdmm+/XE+Jn7pXOy2cP536NnD8UrkX4BRaSZQSieauUnIphhl+LNWoFJpFlFKSy7yCYmLUYabRyBBpdkISp8pzkMImRitDP/c3QnvaT5/AsyyJQswYcq3Tll29O+NaBht/45HyLZs0Et9MOvbSQ7r8DfArKOUPm/BjSkxkRFWl++JKvUuSvF4CSCwO1oZ0aX4e0KSmmn2fWoBmPXRynAf2ymW9MCfALNt8zqMGD3BKWDOHt2BKKVj36+du/XD8VNnHZZRu2YNnD+xqxwwjAOJKvU1SlHiDYGgT4wywspZb8I19QUQlBhPULokJqqCecVJUKl7g8JkocS0zQiSopURUZ6uFO7m9yfA/HtoL14Z8r5TViWe2Y9qVR2HUftp7kJ84iLGjLNVqsysMKcTk2s3i67t0KXIheTsSlJK0yilJRqVFPVjoiIuW59z1Ew5q8T9EsE3McoI85km4Zq6HgjMvn4IIVRPSJVGtcMy3J30nuTzJ8AkXjiJZ3uXRD+2xzdV/BGEhzsO1JlyMxWNHnncqRDzmymfYuhg+9pS3gKMq/kqZE54pBp85sy1CjRIEmww2BfnKoKC23NEsrzk/IKc/PycRjzTzrudQoLCAi3BwH6mlH6eV5Bjjo3HEUIUitALoDBfpfDU0C+/IM+5gEAIB9ygCVGEXXeUrawpX2bcvIx2jzuPHJ167SQCA5yHZevR9w3s+9uxy9mnn+qMZQtYyFPb5Awwaek3BcUBkEg4jhQY8po2jcpyY8gtprAnuV3kTVCpPwKFOcgkIdgbrYzobJntokrTgKfUKjY4B/RvEBlRAjTT1m4Ppehk0fIxMcoI51KxO9Q3f1phaFEmHmhuNWQ2XNWknHMYpq+YePGytXhnpPkYalNGSEgwkuIOQyq11V721grjjeng0QrjqgGJKs0SSqmF/ynyfUxk+CjLfAlJWR0BYmWFKZVyHevVDPvbmk7zHUBHFv9GCPkzWhkuWOPZVVvFPPcnwFQI5lE1qrlD9jA1/bSkUy7Zl52TiwYPdkBhUZFD2u0blqBta9u6/AcwSZrzFNR8PcxR8mqDqHCm2m9O8Uma/gTUKjY4R0h0A2W4lcbfxWuaQTyhC8yAAbkQHRne2OVI3QECfwIME7pWr9sC+QUFdjkZFhqK5MR/BHH5taEfOtUa+GT0u/hk9Ds2ZfkFYG7coIo8gyabUpiDHUqItGl9ZYjV/WJikmYUBbW66A+RhgfXrEmsLJsuqXIfMlD9mZIVBoZgSXhYaTpBI+chkb8BpknLJ6BKvmGXa1WrVMbFs/sFcXT7rv3o8/Iwh7SO1GT8AjCJydmPUp4/ZMGdwmhleCghRG+11VKpp4HiI4vfNDGRETbG4JRSaaJKk8Ni9ZhBw3HtomuHHRY0Wl4kEgsYL1bt9aJcWVyyCnv1HYBz5+x78K9Zswb27NwqqF16gwGxnZ9Eerr9y01mffnv4QNQKIIElceIfKl0y+q7Y2eY+CTNOwS05NqDkKMxyvDWpTmRqNIsppRanEXIhRgHW60ElYb5I21VXAYFGd4wMtxzTwqCh8dE6G+AGfzW2zhwwPLdV8KwunXqYOtm4VpKX0+bjt//cKxs+cu8n9Gh/WOCR6TMACZRlT2PUr7E0Jtw82KUYUNLcyL+mno3ISi5hiFkV4wy/Al7HEtQZc8F5d8q2ZZx86OVYebvgrnsIaG/Aeaj/43Fhr/smxs3bBiDDWtXCubohbg49OzVzyH9kMGv46MPzXc7LsstO4BJ0hyloC3Nkxt4JzoyYnZpDiRcU8eBwOxTlFK6uGFUhVfscSoxSf02BcwrCgE5Fh0Zbl5xXHLXSwRiAXM/ayuztn88/mv8PM/qrsbMyRbNH8KeLVYSAJdcZnKd/87H26Vr3uxB7NtmrR1d5s8w7LxxUZWdQ0Etzhvk0eja4TaSq4Qko4cFs5iYI9y0Bsqw/9kFTLKmLeWp+cxCQAobKMNszkUuR8xDAn8DzLTv5mDy1B/tcq1d25bYus4+mByxedacBRg7cardxxzH4VrcYSt1/zIPmMuqzKZ6ylnatRpCpPlhNWvWtLr5unmTBmdrNbmWnCOUjIqOCv/eHjdv3LihyNUrspmzjOLnUsI3q6esaL498xALgrL7G2B+W7gcI8fYVw5/PPYxrFvO3DcIT2npGWj4cGfo9Vb3P+YCmMSfSf6LU5kHTPy17FcJ4f8o2Y6R89GR4Taepy+pNNEGShOsAYN+0VERDi2WEpM05yioWf5CKfdaw6gws3xG+LC5T+lvgNmwaQcGDravgNm9a2csX2hfpcUZh/u/+i42b9ttl2T40Ffx1eclm4wyD5jEJM131FoqvyRaGW7tuMqo7pIVSynZa8k1Cr5jw8iKVlJ+y+elb9UIyPfRpbQH3IeCsJz+BphDR46jW0+7x0qj4RczABObNm7ZhZdef89uNmaMxozS/GaFSVSp91KKWAtufBQTGTG9NHcuXtf05w3WUn4CNIiOjHAYhTQhST0agFmHjBDsi1ZGlOiYiR05N+j9DTDxiZfRqoOVzZ+Za/369MD8WfbPI85Yq9Pp0fDhTmDumEondo5hZssRtzWgy/QKw1T5L6o0WZbq+pTiiYZRETYWQolJ2R9Q8DMsGRakDFcoCbGvhwEg/pq6CyEwO7MigKaBMrwCU/l3Y+67lcXfAMNC9tVp1M4ur159uQ9mznBsLemMwWMnTMOsueaduxXp0j9m4ZluJpvCMg2YxCR1fQqY9cDYRA4MC6usDCc2r5KEJDVbKdiKUZzUMZERFZwxWaXSVCwE0i1tbFytSm6hwkkmR4Cxp9rPirnfr5WZM75KymYwGGw99Qr1XmmPnefjEtG2k6UxbgmV5TmmbAMmWd2H8jBLsgjBtWhlhN1wuglJmiWAlTbz+Rg7lwOlmZ2oUl+lFGaLS8Khb3TtCLNFprcBUro8fwMM6z/zYpmaZutc/L23X8eUCZaaTeK437l7Pxw/aWu+3Oyhxvh7h2lIyzZgktRTKGCOY0kI1kUrI+xaICUkqZl715LzB8WumKgIu1J+y2FIVKnXUgqzTT8BvoyOjHBsbCFuDF1SiwWMywLvIoEQXTLWvB49+yAhwcpsydjqYUOHYNT79g/vQrq1bPkqTPj8CxtSdo759/DfCA1lLrcdp/te0p+g0myCRWhx5jGmYVQFu5f4CSpNHCg1S/kJIYuileGDXDE6/lrWBOY5xkxHyOYYZbjZq4yr/J4+90fAvPbGWzh8xFaNf8S772D4OzYaT4JZnJubi/Ydu9gNqTF39kx0irX1qGlZuM8Bc+PGZa86k8jVVzwGwOwRQQLD4CCpxq5LkFxDxXOgCC5mAOEwO5jLdHnlUqAP72KA5FcLxqWHSDPNajiCR8tNwlx9xav2sjo6w9ymTeCobjTR3bpjQlaDvLbddjnrptAV5oPRH2PTZlsPmLVrVv1q7+bf57rJSmO2Zu36TM3LLzArmAVWqo+qD/dD96c6Y1T3CiASx/F1JNpku9t9T9rjLO8d01a+Uw0uL/fucCCoSqPvCYGN9JJS8n5B2nn7ejMCmxpUpUl7TsL9HRHdBVWbD0CYspXRNZA+Lz394IQq91SI4HLACBxUfydTVGs8FpROseUDHZafGufRCtNxOh1nyM+YKFVUMqs86fLSaW7y0U1n5j/teahlLw5eOWC8yMyyXJSiWqMhoLBRGiOUvpaXFueRalLsdPongAGMfwUZl6G4sARtcw4e/XrXNhv7qbvN43sCMGcSUyy1Asw8aRpdw+gcw9FzMcwrLktMnnLaEg4oqjV8DpSzsRSjPAYUpF9Y5gmvOs2gbXke069tm8A9l7enaYNQWXCAhKMNK4ZFdl6yxqHfO0/qdDfvPQEYdxtfns93HIj9xpBm0BVUpgYteH0ReL0W1FAEWXDl/w5+VvEhIS1JSbli98VYnLdGjbr7furWZVGYXDawYlAAgmTSMY8vXn1XXGk56k+ZBYw3ViV7TLvXVipXk1DIRHZGwyYxex47nf4LwJ6xXuK+0cR5CDERjdjzWs8IXsvdvJRTGDDt7HXt9QLtmIJbF34QUcQdJS2zgLmjXPPHwmu2UCj0+SxYr1XiCN8l91a8fT19kXwqBv9Xg975fuHZaw9reZN6YLWqlfYe2rGoRO4motxiwIvI4pS0HDDe4qSflDPrqS5aA6UyAtAR23dz3u52gyffH3vj9HYWrcE0Nyl0lCOjC255dnXtrXaWA8ZbnPSTcna/3PsyBa0LILPLkjWVvN3tyk2emp+fljTEVC5N43j0zU2Ps/KM6u06xZRXDhgx3Cqnxe6Xe12gYKFJSF6XJaudK3qJ5xdRVG3ETNvZJcI5nqPPFt6ME629IL5a4TnKNGAopfLkbIRIDAgBj2BQnUJPiUIqQRD7JNSgAIgCBIGUkkCOIIAHH0gIFwBKAkH5QEogJwRyUCKn4OWEcDJCIQeBnFLIACoFAfOgLQX7TnH7O5UCHAdQCQjhQKkEIKbvAGf8m4DAFAqEEGIcCnLbbMH4m3FDAtDbtj70dtADCmb7w/6B8gB4gBiMfxNiAGW/se8sogLRg0IPYvyvA2D6DqIn7DuFlhJoKeV1BJwWhGophZZQaEG4QhBaSClfxIEr/HbR1mZrli2unp/8X6tcHW92bhJdv/6cLRvW/AIiyweHPIMEubXDkEsI0QqfhibK4KqNXqEA86hxOF9X1B1Zl5mDlHsq3dOASU2lIQYZKuv0usrgSCUJIRUBvgLlSQVKEMGBhPOgEaB8OEDCKBBGYAyJEUKBEAI2ocuTOxw4dfoMzp0/j/j4RJw5+x/i4uJZGBKbotq0boWFf9jGwKSAjgDMwUkuBXIIkA3QbBBOw4GoeVANoVATjmYBXJaB0syWrR79SSaX33rhuef7zpr2P/u+ad3pjBfz3BXAUEq5lCzUNhj0dQmhUQBRArQWBalBCGoAtBqlqAZAuM9QLzKlvCjgzaHDceCgydslc+Eqk8nNoSiYIRn7r9PpUCEiAn/vMxvAepN1BYTgFkBuUYoUApoCEBYcWEUpuSaRSK/UqIBkQghbZX2W7jhgKKWylCx9WwOPdoTQhylIE0IRbemzzGe9La+oTHGA+aWjBIkE9Byl5JSEw6EaFaRHCCFs+3lH0h0FTHK6bjIFhoNtm8pTOQd8wgGiJsBPtSvLrAIPe6vqOw8YguGg5YDx1oCVl+OCA4SoCb1PAcO6Zt6SAe0IpQ9TigcBRANwHhSxfGaUc8A1B1g4s0RC8B8l5JQE9/mWzFF/iw/9hOjrGkCiYKDmQz9AaxKCqpSSagAtP/S7njRllIIUEELZgT+VgqZwIDeMh34JUUlAr1FaRg/9noxm8bUy1esq6+1cK5vORiS8/FrZEy7fmbzOrpUBqgGImhCoCUqulaU8zSBSWbpEh/SqVYmVz+0700rxpd7RM4z45ng3hz3BJSREoadQSDkSZKBQgPIKUAeCS8IHMiElE16aBZeAnICTWQouCYHUJMQ0Ci9vCy6JlIJKOJOAkqNMcGkrwCTMFJdYCCwtBZilBZbsO5NWwiQPoaUFlsQouGQSS8oTkzCzRHAJGIWVtLTgEryOAtpiwSUTWjJhJqi14JKnKCKEFoKgEITLlxDk63laICXIh4Hme0Nw6d3RvzOl/R8AdGoXzom1qQAAAABJRU5ErkJggg=="},96908:function(Dn){"use strict";Dn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKQAAAA8CAYAAADogBFvAAAAAXNSR0IArs4c6QAADzxJREFUeF7tnQl4VcUVx3/3JSEBARFEFllcQAMJuKDUD7FqtVbFtUqtS6ufS1soxaW1Si0KBaFVWy2ittqqdQ9xpYq4tLgVFWUThYQlJIEkkJXs63u333lzL+/mrfeF9/KSeM/35Xv3zZw5c+bM/83MOTN3ouGQY4EuZAGtC+niqOJYAAeQDgi6lAU0fUayHqCR5gJXEriS/T6TICkZNOMzIN/gFx7/8vvLiFxDtpfP4G2Xb5Ej6SaPKddav6mPtb5g9e/PF9nSvmTVlpD1S36Sr63WOj1ukD/d+PR+b1NpAekmj5Gve8Dd5lc2ivK4G2lzV4K7Eo/8eSrQ3ZW424rw6J/ST1utTb2jtkuhLAplwgDS7BDj09txdgFqgsjCbwVOKMCYAPH+IAzABIDf8qPYz+OygMus0+8HFQDmYDpaypj1mp+m/qKbgMoKQO+zxwIyCzhNPhOIQQFrAas/uK3l5dlt/SEY9bbn0ZsrS1obynfXNJQXFTeUbPugua5utQZrM7PZHgU2EsIaHJAJUcWp1JYFklKgVx/fX0oqpPSBgw6BASOh/xAlxgC+u6WJqh0bqdi2nrb66gI0sjQXL2W8xHpb9XUykwPITjZ43KuTpcnBw2HA4TBwFBw81Dt66+42aoq2U7FjAw0Ve8R52KxpLB6v86KWjTvuetmswAGkTUN1W7aDBsHIieiHjkVDlhpuavbkU7ThE9wtjQLMbTosyFzGc5pGoD/RyQ13ANnJBk9YdSm9YVg6+tB0NC2ZtqZ6dn/1P+rKirwqaRqrknVuSM9mZ8J0FD2CetmJ1MipO74WkPXn0VOg72CvY1ZRuJU9uRvQPW4ZLes0jdszlvG3+CoRWroDyERZPtH1Dk1HH56B5vHQWFvJzrUf42lrUaMlPJ4BMxOxtnQAmWhgJLL+3gPQR5+E1qsPDdXl5G9YjUdipIreGpzGFUOfpb4zVXQA2ZnW7op1paSiH30qWlIqdVWlFGz6Al1ipmqkXH0wnD0ym8bOUt0BZGdZuivXk9IH/ajJaK4Uasr3UJizUQX/Fb2WOZ7LtfniosefHEDG38bdo4bUvuijJqG5XFQU5VOSv22/3hr8NTObWzqjIQ4gO8PK3aWO3v3RR57gHR13blpHQ121FZTTM7N5Od5NcQAZbwt3N/mDjvDu8jQ11rHj6/XoskevqKxXMuOPfZHyeDbJAWQ8rdsdZct2zYjj0VJS2bu7gLLiXdZRMiszmx/Hs1kOIONp3e4qO60/+rBx6O5WdmzeRHOTz8lO0pg2fhkr4tU0B5Dxsmx3lytTd99B1FZVUZC31dqanMzxTNDmsz9gGcumOoCMpTV7kixXEvrwCV4HZ1vuZlqamqytu2VCNn+NR3MdQMbDqj1Epj5wBFqfgVSU7qWkWB3CENKgEhibme39jCklBpCysf/H3aohrY1w64CYNqrLCJOziRJg1hN+qqtjJklJQx88xrudmJuzBY+cVveBcmlmNr/qmODQpRIHyPuKlVYtjXBL/1i3K7HyDh4Gp94IU2+Ee0+A+pgPJJ3WPn3QEWgpvSkpKaaiosJabxsuJk7IYksslXEAGUtrmrIW5sHAkerb7UO6NSBJ6wcDhnvXkFu354HlDK8GKzOzOS+WJnQAGUtrmrIW5atXCHoCIDXwDDwSlyuJvIICGhran7OIdRjIAaQDyIgW0PsNRkvtR2l5OaXlAcuPmIaBuh4gp1wP/QYrI338ODRUBRpM0+Cc36p0OVT6nwd9PIcdAydcqr7nroL8NXDi5TBmKoyepPgL16n0dS+3dzgGjoaTjY0If7n+Wow+GdK/p1Jr9sC+Ihg1SX0X3Xob6+K3F0FLg0r/egUUbWovSRy8SdNh5PEw4jho2Ae71sOuDbDhVaWvP1nbWLIZvvo3TLwQvjtDvdQlaf+eB2Uxeuu1V2/oP4yGhnryCn3etqmWS+PmjGUsiYhsGwxdD5C/WwsjJirV7xkX3KjyPvZSY+poqoXbBvqaetzF8HPjDMAbc2HIWDjlp8FNsfldePIaH+iTU2FxIRxkyHvgu5D3afCyM5dDprF8emuBN4jM6TPDm/zZG+HTf/l4xpwG1z/nXaMFpYIv4fHpUGVEJEwmaxu/eBFyP4Br/t5exMPnwZb3bUDADouGPmiU9+3FnLxC3BZvW0rHMgzUswEpI5O8Q9LaDAVroHgzDE2H0SdB6kGqJyryYdFJ0GicbLnsfjjLOGn1yT/ghRmBPSajmgBXLg+Qwwd3j4WzboXTDV4J95jkPZxghH2e+xl89ozKEVDdlKVu8RAq/lqNikm91Eg++GiVXlsGD52tRr1ggCz+BgaPAXk/20oxBSTo/YagJfdiV8lequuMEd9SnwYxCQP1bECKwerK4ZELQUYbk2RbbNZbMOQYlbJyMSy/Wz3LdDjvG/XcWAN3Hg6t7XYp4IxZ8CNjmSCj7NJp7cEQyamRH8m8zT7H54WZ8MkTPhlyO4ZM+xcvUGkb3oDHLw8OSDP1m3fgw0ehtlSBWUb2ysL2eh3It7T+iMddVV1LUVnQMFZMwkA9H5CPXQqb3gzsChlVBBSyHm2uh7ljFHiFbn4Pjj1DPT/1U5Bp0Uq/XQ1HnKxSnrgC1r8aHSAvnAfn3aXKfPYsPHN9cKiYywIJrC+a5Ft/WqfsSDIOBITWsnJjRr/DaG1pIbewJKjUWISBejYgZTqeOzZ0l9zyPhxzusp/7BLY9JZ6FifjhhfUc85/YckPfDKsI6iMRnNGq3t+rBRphJyzBuQgrNBD34etHwTXcfLVcN3TKu/d++H136lnKyDlx3TXkcGdv1iB0ZTT7zDv0/aiMppaWoNKP9AwUM8G5Fdvwt8MjzuY+ab/Bc40dr+yfw2rDEdRRgMBlXSArAFl9KwyzgVaR7f3HoDX5gRKjgTIh6rV2lZow+uBSwJTojhX489R32QUltHYH5A7P4P7T4s19ILLk2k7JY3SqhpK99WFqvOAwkA9G5Af/R1emhW6s865HS5ZpPJXLYXsW328Fy+EH9yhvi+/B1YafH/YCoceqdLnZUBpu6NZKj0cICVgLvnRkoSCFk8OBOSXy+DJq6OV1jH+5F6Q1p/G5mZ2lAQJxxlSDyQMFHtATpgGR56iVNvyHmz7KLDxstcrXqpQUx3cdoiPJ5ZhnzUvwNPXhjb+tLth2lyV/86f4I3f+3jF8Zmfq+6SLNsB96TDUVPgNx8qHmnXg2cFlx0OkDIyPrhPrV2FJNbqe8MvtK4S3go2Zcv6Vta5nUGicp9B3vuBcooraXMHfxHxQMJAsQfkRQvg3DuVeazeq9Vgo06EOz9XKXu3wvwMX651fbXgeCgxPF5reQlgLzSCvuHikOJpSiwxFF3zBEy5TuU+exN8aqzXTP5fvgkZxvrxz2fC5CvhtJ+p3KevgzXPRw9IKWHd6w41yoYDmH8csrMAKTql9vWGqoqr6qisaw6pZUfDQLEH5Hd+Atc+qRRdmw3/vCpQaStPzn9gybk+nl+8BhMvUN+XXgCb3wksf+1T8J1rVHo4QMoux7xxwcMfElwXUJt7zg+cDnmr29clux+/MDxoGW0zzlVBc9lNmTMy9Nov0hpy1goY/31Vl3/Ix6rB8ZfACT9UKRJe+vw59ZxIQMq0nZJGbUMzBRVhL7XoUBgo9oCUoPMdxu6GBKQXTIByy4VaKWnwm4/VVpnQf5fAy7/2dcP0B+FMY90XbMo9fCLM+UJNpZEAKflfZqndGH8SZ0acGiEJSC82wjhWPokH3pvnA62ZJ/G+rJsDZZop1nWmePni7VvpuIvg56+oFNlynJ8JzX5OgswCd63zbUH+5Xuw/ePEA1KWGvIOt9vNlr21eDyhz3p2JAwUe0CKyWavhHRjfVVXoUAni38x8ik/geHGFC33yMgIZu2wcWfDr972dZ/slnz+PNTuhaNPhUvuVd6vSeFGSPGQBbjrXoH3/gxl22BIOpz0I593LXIevQi+ttRpBc/5c+ECI2hupt8rMcGvQgPSGk6SsFHO+2rPXLxyk2a8DrLeFirdrtaHEryXy0ZlmTD5Kt9uzTcrVXDfpESOkKKD7G3rOruqmqhuCv9qjcvF+RlZhDBuoAnjA0iJ1ckoaR4wCNV1794HrxsBYivPze/CsWcGLyUgWz5XAVMoHCAFiEInXhZcloBkxQKQvehQJFP6wh2+Lb78L+C+KaH5JUeWE7Ks8KdZaeqqZaFDRsCMN3z79qEk7t4IMjo21XQdQLpSvP8QoKaxlcJ9odeRorCmsSVjHBPtvhQWH0CKJtKRVz3mO4BgNXhFgQrHyC8/GMmhUNlTPvWG9rnVJarcphX2DleIByrOxxVL1Mhsxv5EqkyVWbNh4/Lw4JLc2e/4TvbI3raM2pFo6k1wxkwYPNa3z2wFpJSXeOf5v1d751bdJE/WqfJDkeWBf+A90SOkTNtJvdA9bWwpa8ET4RWNaMJA8QOk2WF9DlEHGmS6FhDszVX7rXao76EwdJy6yF2OjJXLieUIFKqzpPMlHCWjdsFadWTMDglQFhVAnwFqi/HOEYHrPTtywvFIBx96FAzPVODbk6PW3XbCQQdad0fLiz11D7urW9nXHP4eqmjCQPEHZEcb3NFysR49JMxz5SNKm9VPgZzYcQjE4ZOzKy1u8qtt3Jmv8fCEZcyOZDoHkJEsNHcjDBuvuO6bCvlG/DRSuW9Dvly74tHZUumOOG3LUWo7L4U5gAwHHHGsxMESkvOKC40DEd8GsEXRxqI6D1VNka+P1ODtzGzOD7t66XGX3sdyypaguATHhbJvg1UPR9FN3x7WxjbYsc/ezSqRwkA9b4QclqE8aiEJeH/5UseQITs5F81X/+tQSPa6g73f0zHpPaqUhMa3VrppDRMkNxscKQzU8wDZo7q6+zSmtFGntN6GcwOECwM5gOw+fd6lNW31QG6lADLytTHhwkAOILt0N3cv5XZWe6gXZNqhEGEgB5B2jOfw2LLAvmad3bX2pu1QYSAHkLZM7TDZsYD4NDn2YpJeccHCQA4g7Vja4bFtgeJ6D5WNNqdtcXD8TgM5gLRtaofRjgWa3LC9yl5M0jtK+p0GcgBpx8oOT1QWyKt209Aa2ds2hbpczM7Iwrvr4AAyKlM7zHYsEKVz0+5uIAeQdizs8Ni2gIyL8icxSbeNnZv9go0wkANI26Z2GKOxwJ56D+VRODdmGMgBZDRWdnhtW6C6WWeX/Zjk/jDQ/wHkSLPJ/mcrgQAAAABJRU5ErkJggg=="},57177:function(Dn){"use strict";Dn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANQAAAA8CAYAAAAeyZT3AAAAAXNSR0IArs4c6QAAEpJJREFUeF7tXQeYFdUV/mcbS1F6UUEsoLC7IGKNJWpERbEgSoxGo7HEQFDRWCAGgdASNBbEhglqsC1rAxVBNGg0qNgLsJRddmFhe3vby3uT7393ZmfeezOv7M57W3LP9/EtM3Pn3DPn3n/uvf85c58CKdID0gOOeUBxTJNUJD0gPQAJKNkJpAcc9EALoNRpCaqt3rh4QIkDvH/jxV/zuZZjrVy8uRzvSzDdrx3HxWnnEnz1eevhOf/79HpNdrAs6wrQr9VvtiMc+/kc0HSan9Nrq8Uzt9hquuZjv8kPev26r8x16X5VPYDHDYT7Vy/L8vo94d7P8u5mcV+w+1U34GEZ7a+5Tg/vV31tbrmu36ff23JcB9VdBo9a5v2rekq14/1wN30GNXGzctPKKgf7eExVKUGBpJsSEkgWYPMHXEuH0sHlB5iW8jrAtE6sd9AW8GidVD9mR/fvxDrAzJ3Yp/ObAGL3srC1XweJnf0awHUQWgGJ52i3P+D9OyOP/QHSAjYT8Lwd3gRGH3Bp5dza34D7LUDsD04vmPzuN9cZGkSAF3xm4JttNoFWdasNlRVNta4SV21l6YHakvyPGurrNivA12kZ2B1TdLSisvAA1QrF8hbpAUsP8EWVkAwkdgMSugHxiUB8EpDcC+g1AOjeG+BciSBWPXA3NaA8Pxel+7LRXF+bCwXpShxeTX0V33ZED0tAdcRW+X+2iaN3j35Ar/7iX/e+XnCpbg9cZfkozctBrauci/9tioIlKSpeUTLg7iguk4DqKC0h7bD2QPJBQP/hUHsNhsIVv+qBq7QI+7O2w93USGDtUoEFaavxoqJ4x7Z2FQmodnW/rDxsD3Ba2PcwqL0PhaLEobmxAXnZmaiuKPOqUBRsSlBx06gM7AlbZxQKSkBFwalSZRQ9kJAEDD4GSD7Yyz6WFu5HQV4uVI+Ho1W1ouCe1NV4OooWBFUtAdVenpf1ts0DfQ6F2mcoOMurq6nCnp2Z8DAMwNEKWJEKTG+PtZUEVNuaVd7dnh5I6gF1wFFQEpJQW+1CTtYueBgeEPLuwGRcNWQVamJpogRULL0t63LeA/GJUAeNhBKXgOpqF3Kzs6Ey3iVGqs29gQnDMlDnfMXWGiWgYuVpWU/0PBCfBHXQ0VCUeLgqK7B3b67I4BDyZloKrlTmQ6AsyiIBFWUHS/Ux8kBCMtT+w70MYGlJMfILCloqVoDH0jIwMxaWSEDFwsuyjth4IKk71D7DGKzCnj05qK0zZnoKMDUtA69F2xAJqGh7WOqPrQeYvtSjL+rr65C1JxeqMfUrTkpAyrGvoCSaBklARdO7UnfsPaAAat/DocTFo7C4FMWlIvBLUYD0tAz8KppGSUBF07tSd/t4ILE71N5DoHrcyMrJQ0NjY4sd8QompazGumgZJgEVLc9Kve3rgZ79gW49UVVdg9wDhWZbMtNSMEaZDxEFdlgkoBx2qFTXQTygxHnz/gAPdu3NR2Njk9mwmWMy8Fg0LJWAioZXpU7DA/0OB479hTguyQZ2/Sdm3lF79IWS2B2llVXILylvqVcBuLAamZbh/euotA+geg0E/ponHqSpDrizj6MP1WGU8WM671eq7fhVweTFwIQ/Cpe8PRfY8NfYuue4y4BbNbb6y1eA534Tu/rjEqEeNAAejxs7cgvg4VfGmijA8rQM3Oa0Me0HqKUHxLM01gEzD3b6udpXX+9DgNNvBs64GVh0PFDj+Isw/Oe7fAlw3t2i/NoHgPVLwr/XiZLtCShGpHr29zJ++aWVKHX5pPU1Iw5jx6RjuxOP2QLUsPaUcLJG6uII1ZUBtTAb6McAI4B7BktAtdcIRf/zM/vkg9HY3IydeQxBGbMFBVifloELnezecoRy0pu6rsU5QJ/DJKDogXYeoWiCp2c/7mWF7MJy1Nb7kBNwmkaXgJKAioYHDJ0dAFBqt55Q4ruhyFWDooqArzkcpdE7HqBOuxE4aKBokE9WALUGO9PSStxc4Px7xWFzI/DhI0YDDjoGOP5ycbxjE5CzBRh/JTDiDGD4CaL83m/E+W9e8yUM+g0HTtIC6f56/bvd8JOAURp75SoAKvYDh58gStG27tq68L3FQGOtOP/TOmD/j76aOP09YSowbBww9DigtgLY9y2w7zvguzeEvf5ifsb8bcAPbwNjLwF+Pg3oPQTgubfnAcW7ASfXUAOOBH52PTB0nKiHn6UXZwFFu4DPVwEFFssRK0BRz7gpwn/0U+7XQM6XwFfpYrsxpyUhEUjqhdqGJmQXVgRoj1NwR+pqLHOi2o4HqD99DQwdK55t7mjRKfyF++4t1xIf66uAu/oZJcwNuGYOMHgkcKoNs7TtfWDltQZoOd9eshfoqel76OdA9mfWfp6+FkjTpt/vLhA79Jw1PXibrLoZ+OwFo8yIM4EbXwT6MF5iIblfASumAuUaI6oX8e+kOz4Crn3GV8HjFwLbP3AOUJfMBybO9m7eYCnuJmDjQ4L4MIu/rR8+Bty2zvCxuezuT4AVVwHVxU70bR8dao8+XsY1c38F3Ca2j4WcpNG7NqA4MiT1AJoagNwtwIFtwJBRwPATvVF0r5TmAItPBOoqxfEVDwLnapn+n/4DeHlaYONyVCHw4hPErqoPjATOvRM4Syvr3RVWE2/jaQvhF38HfP4vcYEd7ZZ0sWsu5cBPYlTiW58j6cCjxfmqYuDRCWLU0cXcSQ9sBQaOEPvcmcVJQF08F7joz4b2sr3iRcOX2eHjxT9dVl4HfPWqta0cnRmX4r58WZ8CRbsD24Mvj8UnOE7kqN16eT/t2FdWjcrawFHfKRq9awOKzVpdAjxxCcC3vS79jwBmvCs2+6CQStbfrJxOzdsqzte5gFmHAU31vp317BnAL7VpJke55ZN8r4ciJQjyedsM4uLl6cCnzxo6uDcdp42XLRDnvlsDrLjSupPqZ7duAD5+EqgqEmBkh2fHb+uUjy+eJXliI0rK6/f6TrF5ji+TK5aK65wCzh1lbyvb48nJQM4XRpkBRwHT3gIOGS3Obfw78OYsX5+29YgvnLgklNc0YH+FNgX31ekIjd71AfXU5cCP7wQ2B9/q7NScwjTUAHNGCPBR7tgIHHu2+D8DkQxImuXezcARJ4kzz14FfPuG7/VQgLpkHnDh/eIerj3+daN1d9GnlQwM862tr7/MI1QoHW0FFNdLE+8ToQ6uFTlFtpJFe4C+Q8WVmb2NdaO/rS/cCHyxyro95m4Ve9ozNsn24MvBKeHW10nd0dTsxo5C663TnaDRuzagOJ2bM9K+SWZ+ABxzlrj+1GTgx3fF/0kS3PSy+H/mv4FlFxg6zCMYG3z28MCFdChAzd4CDDte6Hz0PGDnR9Y2nvxr4IbnxbX3HwTe+pP4v7mT8mVw/5HW5A3LthVQ4XboO94Hjj1HlF403hr8ZfsEULQ9HwJUz1gHpJwnTj89RZAtTgpHW9WD3cU1qG+y/iK+rTR61wbUD+8AT2uMn1XDTH0YOEfLPsn4I7BJI3q43zZBcdAgsUZiJyjfJzSYRxcuwt+cHag5FKAerRRrO8p3bwVOKXWNJEdSzhdHHAU5GvoDas/nwINn2nc7JwHF2NrxUwCydP2PFEQMiRzulcdjfV1Ke2iXv61b14vpt52Y169v3Ad88LCTcBJ2KvEoqmpAUbUFeypqaxON3rUB9Z9ngFdn2DfK+fcAzHWjbFoOZNxplL1sIXDBfeJ47VxgvVbuLztFh6LMSwWKdgbqDwYodkpej1RIpS85ObCTfrUaWPnr6AKKDNlVy4DxUwURE0rsABWqPZhzOEXLNfz4KSD99lA1RXbd+1NCiahrdCOrzH4jpLbQ6M4Daswk4MhTxYNu32idXcxcN7JklPpq4K6+hmOcpM23vAw8f7290yc9AEyaI65v+BuwxsRkkbiYv0PM6fWF9lGnAXd/LMoza/qRc611BwMUR6ZHKgz6mbE2uymQWTsZNaspX6iE07aOUInJwO0bgKNPM9qL8bHCXUBVoRhdmxuAibOMaawdoL54EXjht/btYR791y0E3pkfGWBClSbjH0c21IPM4no0e6yTlttCozsPqEsXCOdSzOyZ+WFJs87SWJ7CncD8VOOqeX2xYByQrzFu5vsZgF2oxaeCxaHIdDGWZCfXPgucdoO4uuoW4DNtvaKX/8M7QKq2fvr7OcDJVwNn/k5cff4GYMtLkQOKd5hz/exGuWCdI5Lsg7YCimzj5EXCmrzvBYXP4LO/zPrcCGzbASrYS4j6rvuHCBxT7MiLUKAJdZ3Teag44GpCWZ39j3a0lkZ3HlCnXAdcv1I81tcZwD+vCXxEc5nMD4FlE40yv38TGHuxOF5+MbBtQ+D91z8HnKKxTcEAxSyDeaMFfewvDA4TlHrO3UNnAdmbfUsx++D3GoPH0S51oghIskPNHma/9gm1hjIvvv0pc7MF4yaLNQuF9Dzf8JRYAop0NmcdlGeuBL5fE+hL/qbT0gJjOmgHKLbHn48CXD5f0Ap9bA/67eDB4njp6SKbxWnRfjmzqr4ZuZVBszJaRaM7DygGTe/TsgsYUF0wBigx/SACpxB3fyJSbSj/Xga8pn2vw+OpjwDnaOseqynbYWOB2V+KqRglGKB4neksVlQvyQiSEhQGVJdoNLi5ARkPWpRtgE6/xnhP+h32TW1eZ5FlJNtoluMuBW59XZxhytL8NKCh2rcMR+H7vzFSmB7+BcBMAkosAWWegvPlyJekv5hBx2t2gOK1/64EXro1UMeEu4ApfxPnmYa0VJti2nu59Vfi4r27y24vaYYnyLdqraHRnQcUH/P29cAobX1RXSpAw8U7O8mp1wGHalM8bu7OEcTc4UZPAG57z3AWsxW+eEnM148+XUw/yL7pEgxQZOgIvG9eF8HC4l3A4FHAib802D3qefJS4CdTneamumgOcLFfOs0ixoR+sG9QMx1P2j3zA5EzSFZQF3MnZMYA10cMPvOzbU4zT77GyJbwZ8daCyjq58sjHPlhrfDJb1aKNqMU7gBemgZk/VdkeHCtfPliY82s6w0GKJYhkULSgdN5Zq4wTKGzrbzOGQtnLtES9gmPB/uqPKhsCL6hbFwcLkpNh03nCDQwOoBirIajlJ4gaueY95cCb2kBTnMZc0zD/16CZO0cY14fDFAEEmX8FdYWsJOvWwAwF89OOCVcmGWkCIXz9uR0lNNSf5mRLH6rlsIg6LQ1Rt6iXf1ct3B0qncZJVoLqEg6qM5sWrUlM0hIruiM386PBdj09aUdoLZtFOSGTq8HtK1bZKywX0RVvL/cBlejir2u4D9+qCjYnjoaY8Pd1CU6gKIz2BGvecpIIDU7qDRX0Nl881oJf7WOMYnTb/K9Wpkv7vtxXXjJsWTASB6Q8uVbVo/9UCunWqRlv18buunIcumZ5czt46gZSs64BTh7OjBwpJFnZwYU7+cCmTlyzB0028ZrXKcR6Jxe+mdgxxJQtOWIU4CrHzdYPP3Z2Y7fvi5GV+b7MXmWYgcopi0xiM2g+aARvh7kfhP0LUf0GAk5vu2l7qDTPpoSCY0ePUDpTunRVwzrnO6xE/NNFm5KCXcBHTJaLFT5yQWdHkrsOhs7L6co+ucCTKMJR9jRF+cCjMUwK2HW0MD1Tjh6gpVh+hPz2Q5NE+ApyBTrznDo9LbWHe79tHFIigACaXJOH/VUrXB1mMuxTbne1j+nqSltjZY235NX5UFFiGlfJDR69AHV5keOUEEkb+9wVHMac/UTouTm5wBmjEvpMh6oblKRUxnGb14reHzMaoSMNEtAheoac74HDkkRpZae4ZslHepeeb3De4DL6O1load9/JQ1nE1dJKCCNTmTPUmQUPi90kItobXDdxNpYCQe2F/tQXl96J+PUoD30jJwUdDZe7vsehTJ00Za1skpH4O6DO5SMu4CNj0eqTWyfCfwQF0zkFUR3qf3oWj0rjdCHZJqxE0YczF/PRpJ4zJyf+l8b3ayV5jrZ7W/RSQ6ZdkO6QGyfTvL3Giyye0zGx2KRu96gOqQTSaN6ugeKKpTUVQTBjkRgkaXgOroLS3ti4kH+L3hjjICKvS22cFodAmomDSXrKQzeGBPpQc1Nl/yBthvQ6NLQHWGlpY2xsQDFQ0q8qrCm/bZ0egSUDFpKllJZ/AAOYnM8GJS3sexotEloDpDS0sbY+aBAzUelNWFjknpBvnT6BJQMWsqWVFn8EC9G9hdHl5MyjtK+WWjS0B1hlaWNsbUA9mVbtQ2hWb7TKPU7anp8Eb9JaBi2lSyss7ggQjJCZ+90SWgOkMLSxtj5gGOS/zHmJQ7jMyJFsM0Gl0CKmZNJSvqTB4oqPGgJAJyQqfRJaA6UytLW2PmgcoGFfvCj0m10Oj/A9jGm+feuyEMAAAAAElFTkSuQmCC"},81378:function(Dn){"use strict";Dn.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALAAAAA8CAYAAADGxTD9AAAAAXNSR0IArs4c6QAAFoFJREFUeF7tXQl4k1W6fv8sTbqvlJa2tJSy74ugsiMqq4AKIlDUueNwR2dGHR0XdLwixW3uuF6Xq3O9o15nxuUiIIsCsijK1pa20NJ937eke5tmmec7f/40TfInaUNK6+R7nj5Jk7Of93z/t55w8JBnBYbwCnBDeOyeoXtWAB4Ae0AwpFeA+1SWbbA1A07KQSID6JWT0ivAyThIpBwgBSQy4+fCq0T4jANnrEdlWFkpjK/0ndAetd/znpMaTO0LZcz74tsxti0xjqVXfeNYZcZyxvHSuK3GbDYX03iMbbLy5nOz+pzGbGDrwpfj52DQG2DQAwad8Gcwvudf9ToDQN/pDdBrDYBFWfqMry/UAytP9fjPjJ/rYVHf2L7Qph4GaA0tOj1UnBYqvd6gMugMKr0OKoOOq+UMhhQ5DGfHPRNWMaSRaxy8bQBzPGAZAI3AFMAoAIJtnBnA2WaagdlU39iOAKKeje85FKY2TYDkwWh+APi2ebD0AJ8HMn/AzAHFA4x9Jxwss7bN5yXUpbnwB4SvY3Nu9LmwLr36NIKWAEhA1BlMgOUBCAZYBtJe761Byx+A3vV54Av1efDrtUawm4G+N+D5MfUcHH5s7H890KnqNjRWNGkaqlXqhgp1VV1JwxkOSJUAqUB0xk4s0Q4FgIty4KEweM8Yba+ARCmBzBuQeksgVXKQKugVkAdIoRwhhU+EHJycg0GrNz01Whs6UJhegtLsCmi7tI0GYC8H7osYTPhuO2Z3D9a19gB4sO6Mm8flFSKBd4QcyuFS+MbKIfOWMM6v69KjIq8WhVlFaKpvAQeuFsCr/gh45wmsbXHzsPrcvAfAfV6yn18FjgN8YmUInKiAd4TMJObUlNQj42wWutq7SNtXA9zrIVC88nts7Bgsq+AB8GDZiUEyDrm/BAFj5PBLUAASniNnpeSgvLCSjZADl8dBev8ubD41GIbsAfBg2IVBOAaSnUNnK6GM5DlyQ5UKmSlZ6GjvJBiT5epdGRSP7MRGzbUcvgfA13L1h0DfPtFyBE9VMKuMVqNH2rl0NNapBG78vQ98b9+B2xuu1VQ8AL5WKz+E+pV6cQiaqoAyXAp9tx5pyZfQUNdoBDEKAG5VEhJzrsWUPAC+Fqs+RPsMnOgF3xg5dBod0i9eRmM9D2IAFYB03m5sKRnoqXkAPNArPsT7CxingE+UFDqdHpfSMtHYYJIecn2hnL8DG+sGcooeAA/kav9M+gpIkEMZJYdBq0PqxXS0NDcLMvEFKRTzB1Kx8wD4ZwKqgZ6G/2g5vCPlaGttR+rFZMaRiSSQvLILW58YqPF4ADxQK/1z64cDs05IlByqqiqRX5gvKHV6gLspCYknB2LKHgAPxCr/TPuQ+XAImOQFzsDh0pVLUDcJ5jWUSaGcuBMbW9099WsOYDKYU8Qbi5zqshnZ6e41uGrtSxScU3NQhErR1UBhae4hstkaBiiWzDtSykSJri4NLmYmQ6s1dfz6bmx7xD0z7Gn1mgN4bX48CyapP9eBI/NLXZ5v3JYAzHlnOGvnyMJSqNO7TG36xMjYe41KB22r+GGR+nC48aNIVrb4780o2+OYkYTOVWLRnijk/JcKee+qoVHzMqE5zXlvOGLW+0MRIsXBGUVouuweJ9bys7HwjpJBldaJk2vcH/brP9aLRb1V11aisLzAKEpwWimks3Zic4bLm2qngUED4K5GHWpOttuda+U3bSj83ya7ZeLvCcD1f+HBd3hOMVQXeQDL/DhsVI1l71MerUXOm/zjzhYRV1lfmsC+Sn28FtmviZcV6t/wUSRGbQ5g/575RRWKPuE1c3Ma8+sgXPcmf7gynqvH5d3OO7DkARIowigzwDEtPxcLryApmrK7cGqtYwB31evQ3Wx94Bz3xJcgOThwrBd0Wj1Ssi6gW8sfTA44swuJ8zje9ewWGjQAdmZ2OW+rkPIwRfeJ09UAsH+CHGuuxLNOzj9Yjfz37R8axTAp1hWPBnmsOuu02BtXCL3Ges8IhOvLRkPmI0FjSie+ud55u//YB4Iw+w0e/Febkh+qQe47apea9Y2VQeYrQXlNGcpqeubFQfKrJGz9wKXG7VQeNADuqNKi6FNrrmU+9rqfOlDxtf3HudMAfkuFmPV+iN0QgMyXG6BK6xE1gqYpsDI5jnX9071VKHYwrklPhWDa88NY+csvNiDj2XrRJZ/7fgRG3xfIvv8qrgAdFc4Jq4MdwHQoCcQkA6fmXIBOz8v4HNAog2zcc9gsviguoNutAKZHsdRHYnd4y76LgU+UHKr0TvxwFx+y54iIu7WX9Ww8SwGS8/mp8YkBmPNuBHv/7fwSHph6A0jBshQhVqbGIWiKAgUfqnFue42p22HzvHHzyZHs/+83VKB8r/ihoRQjkuMp6IVShvYlFGLyjlCEzVXanIZXiJS5Y4laizSij+78/2lisrRA8kAJCz53RKO2BLL+ic5tr0btaftiGZXrrNGhu6n/IoQwJt+RMrbOJTVFqG4030vJX3dj632Oxt6f790K4CWHohF5s29/xmW3DoH98Oyex9TY3wRh9mvij1f15S4cWVBiBWCBW2vb9fhqZIFpEyNv9sGSQzFsDCdWlqHqqDgIiIsv+DyKlS39/xac3lSJpd9EI+Im1+Z9+YUGZPyHbaYVMlOB0DneNtdo5J3+GL7Ih31HcraYtYPmXPSx/SdeXzeORAifETJ0dnYivTgFBoMgRpEMLF24G5tP97VNR+WHJIBL97TgtBm37i+AJV4c1hbEsywEc8XOHJRHl5Si7rTtBASZLwfi4n7xXmydT60rR8XBNkx/IQwhM3s4cMgsJVOqCDT1Z5xLZij6W7MowMxFFkcbLPZ9R7UWX8XwFoOrSd4jOUilMuRWZkHdZq78cpdliJ5xtZNFBwTAxAW+u7nMap1uOhbDTEo1p9qR8oh95Ywe9YJp68fESpT8oyc9K+x6JUas8GPtB09TIGoV/55Eg45qHTprtSj8qMmmFWLKs6GY8scwNOdqcGBSEas3KjEAN3xotGRcV9xLPjafBJnFEv4tyPTRsZtKUfu9NUBJTApf6NOrD1dAYw7gikOt0Hc7r+SHTFcys6W7AOwVLIFXoBQ16iqU1BdaTvOJ3dj2iitzt6w7IADuqNHiq2jr0357xWgow2UoP9CK8/9eDZ8YOXxjZPAZaXyNkcN7uBRHF5dh7gcRGH1vIHQaA/ZE5ovKjk4rcUYzmt9oOW7L5i0Ox28tQ/Xxdkz+YyimPhvGPvsyPA8albV8GLXaF4u+iu61nqIAPhGD8Pk+aM7R4MBk/pC4QuYA3juqAJo+yK/XvRUOkpPdBWB6qpHuo9F0I73sgsU0uTYZFOShc93gb2x5wAD89YQiDLteyUBKDgVSZGI3+bOUb0e0L6EAEx8PRfQaP6gyOnFytbhts68Apr5vOT0SYXO9Uba3BT9sqMSNn0QiblMAOuu12BNpffDIbLYqLY4dPnMSA/CKlFgET1UyRdVcdnc0b7HvB7MIQWP2jiJlk8OVqgy0a6wU4H27sW1df+d+zTjwiRXlTF60R6TFd1Rq0VbSjbYyLdpLu9FW2s2UoxG3+qK1RIumzC67GnN/AEwmqmlJw5D3ngppO+pBjgCSYet+bGfc35IW7olih4mIQK4M44EsBuC1hfHswDYkd+LECuv2zNunC0wcORXMAaxR060nzsNB6ith9mp3cWAaiVewFBQnUaEqRVVzudXgOEjWJGHrAedHLV5ywDjw/rGFWF86Gu2lWrSV8cCM3xbIjPoElB+3VjHw0gbaIsHlXPyPZvyUWCU6I0sAtxV3Y/QvApH332pRTxx56TgJZwLOBtUYyP0kKPhrE87dX92rL6k3hzvrEtiTgwBZ+HGTybsmBuCN6jHMyO8M0eElU5w9MgfwF2F5fTKBCXZodwKY3MoE4rauVmTX2vQkF4dCOfFqpOcPGIBtycArLsQieLoS3a16ZL/WaFOWkyo4hN3gjejVPMdLe7oOWa+YUlms9tkcwAR2Uuh0HXrsH1folCuZYgjWF4/m+9pRh6w/Wfe1+EAUgiYp8M0NJezJILiubQGYAmvu7hjnDHZZmeY8DQ5MtC8nmwOY5Gq6b81Z8o6UMYuIOwFM3gvv4TLGjDJqkqHVWcd8SICXdmHbU86OW6zcNQWwI/OX5aAJ6IdnFqO1yPZNR8RJJz8dhomPhfSqShz/4NQipwAcscwHSw/zNuDv76hA+X5rJwYFDJFtmQKFzA+MLQCbx1VUHmlD9bE2m3sx/qFg5tBRZ3bh0PRipzlwfwHgVgADkAdL2F1zZc1FqG/v/RQzjrmbg9e0JGy60t85UD23AniZUfsmj9P+sdZchTRWAgxxMb943jtli7Tt5HnrRsnnLWg4T/cS9KaEXwZi5EZ/pulLjB45KkHyYe7bauS8pWIXdDgTzDPrtXCM+00w62BPTD46q+2HPToCcNQqXyzay1srLM1/5rNYkRyL4GlKNKZ24pu59mMkzDnwoZnF0DQ5H5o546VhzH3ubgBLlRLI/Tk0dzQjX51pc185cCeTkLhk0AL4ttxR8BvlxdyZx5bwygu5Q8l1KRDJpxTk0pKnYU4Aoti7/EEu1/Zyba/YB3Kn2nJ5Lvh8BAtTtKRvbyxBwwUe8M5Go60rjudd2xmdODzLcbCNIwBPfT4Mk5/iXbv2QihXpsUxsaTuTAeOLrRvZTIHcOmXLcy06CyRJYgcL+4GMF1XJQ+RsvvWLjcmQ0fXadogCbh7diHxY2fHb1nOrRz4rtYxTNkp+byZhQ7OejUc4Yt9cHBKEVryeDFAUM7MvWurMuIQOEGB6hNtOH4Lr8WS6eq23HhUHm5F+tP1vcSIcb8NwqQdoaDNNHQD437Lc1BnwinZ3b7G8xS+0BvLvuNjILLfaETqY44TbB0BeOmRaEQs8WXOhs8CckUDzVdfHoWAcV6oOtYGstjYo8FuRhPGToyJ4lRKW4rQ2NUTa2I+N7o8UAq/cTuxvl/hcG4DMGUd3FHNx9ReebWRKV7ktiVtPPcdFZIf4j1vzgJ4WlIYJj0RCl0nKWRFzGIhELl0dZ383bt9MaORy3j6i8NwfHk5yFohgI3abS3U4OCMYuja7XM3ewCmw3Fn3RjQfWP15ztwZJ44Z70tLx5+cXKTLdpZAP90TxW0rc4H4ox9MAgRS33dzoFp/BTYQ0p4i6YZha1Z9qb03m5s+3V/uLDbAEw3uaxM4e2+KY/VIucNFWb+aRjGPxzCrA57YwuY2coZAFMg9205o9j9tln/2Yi0p8Q5oxiAzZUpciuTB45kZqLkR2qgvtSFZcd47isQZVc4cnHbA/DIDf6Y/7cRrDlH1hMyMZKFoOj/mnDmvt5KD3FmWk+BYtb5IXYjHzx/9pdVIB3BWRqzPYgF+5B+cP6BHq6ozuhinsKrSSRGyPwl7B7izJZU6ETynDhAL4X0hp3Ycr6v/bsNwObKy+m7K9njnUxUxIVJO039Qy2yX1c5BeDrP4xAfGIgU1b2jym06doVJi4GYOK0ltYJqlN9vA2Xkhow+9VwZtKjCKqa4+0smozeH1taJhrMQ/XtAfjmUyMx7EY+auzriYUmscnWJt1Zn8BiCLLfVCH10d5xIRMeDcaMl8L7urd9Kn/xyVpc+bPjzJM+NUpc2FsCCQeUdRRA1S3OeDjg4lQor9uIjc5rpO60Qlz39nCM+RUf6GKuTC3aH4WoFX4sFpZEgbV5fE6cmAx8OanBJJemP1uHzBfFbcCWgBJkYP8xcqzJ4uMdiAiYFBif+VIjU/JINhfk5rz31YzDr8kZxTxsZJc9NKNYNFlTDMAhsxRYfpZ/AjnjQt7UOZYd7LRn6pD1cu85DmUAc3L6SQgJ2rXNKOiwK0ZQbu9Du7Dtzb4cErdwYDLe316eAJKDyQa7L77HsxS9zg8Lv4hC7Q/tOL25EreejrULYJKdKZWGLBDkzeuLTGquxJFiSMmHJZ+1IOvlBjRl8Y9LYTz0XrAXU8KneQaEvYMjBmDzWGjhCSS2MaSg3lHJ6wskEhR+ZB2nS8qQJUUs8wVF01Ecx8Wn6pD9qu3DPeU53hJCQVXkkcx/X42uut6MTswD2hcwiZUlzxz9NkduZxq6DeJiCgeu2RsY/zTsuFotOnELgEes9MXifbzt0zLFhsBNFgaSOYmckYFJGfIf44XmbMcy2vTdYSzwh+jgtCITUClIvTmvmylrAo1Y7osFX45glhLiyidXlZuC16nPVem8ZYBk9q8nFNq0CdsCsLmVwBnuO/EPIZj+Ap+SRFkkDeesbd3CmAkMI1b4ghwfw+bxMjwRJcSeWF1u/aTggDlvDwc5X8htT0Q28eK/tzD7OMm+7ibBNl+tKUO9zn7WDQd8loRtm5wdk1sALERz0SBI9qOYh/GP8KYtSxKi0djPTxnjWsnBwXEcA5Wt5Ehq48y91UyuJgpf5I15n4xgSiEBjoiSK/dEFYgGukTe4ouFe3rAe+GBGuT/pXfyprkcbysugvqxBDB9tvRIDBMHaPxkEqv+js/oGLbAGzNfCYeuXQ9dFz9fUlDDjNkVFAdB4ZZkUbEkGi/FKUet9mNxGgK1FGhw8ck6u2lPVJZMWgRicvpQZJwJ+KfaWYZ2OeUaOq8LOosvVo7iTCgxuVuvQW53msO6UnC3PI/Eow4LuksGnvnncIz/XTDqz3bgyIJSZqqypUA5M0CxMj9urWTiABFpuhvqE/iFMpKjDGaSUZedGMnuM7jwYA3yP7CdeXzT0RgMX+xjU7myBWAy7y0+EA3/0V649Hw9Lu3qSZ2nQKA7ahLYD6pYEkXiHVtSivqztrmv5RqSKzv/AzX70/fxN4ToYFL0XdBk3rJBThvy/rnzMhT62TNyahTpMtFhsO1OF9aEfsYgHKFTfoeVDh8PbuHANJCJj4ewC0QIGOQgEMvh6i+IKw609hIpxv8+mAWp0O0+ZftanLo0hOKRyUYrBl4aG5mvKOWo6ojtRY+72x+z3+Lz8egOhrofOxhXpUd8+h+tc9oS7g9EAF0EYvwJLNJc6n/qQOW3bb0SVS3XhTyYK5LjUL6vlUXJNSaLixlOrSnHZ55MeSaU5fE1pjrEilPNOiqkMtSiSmc/1oNxbXDPJSFxp6P23AZgRx17vu/HCtAD5mo/5t3Rpp2p6aFHji4VBgdaIwd0SsFN2YlE/tZAEfIAuB848lRxbQUq9Plo0ts3hxp7+HY3ti33ANi19fbUvsor0GFoRZHOvk1Y6FIC7q5dSPzcw4Gv8iZ4mnNtBQp0l9BlcHzFAAeu0h8B48V+JdQjQri2D57a/VyBBkMNanSOw1WNCt0bSUh82FZXHgD3cwM81VxbAT10yNWlQm+6vceupKuTQTJ7J7ZYGZE9AHZtHzy1XViBSn0B1Hpnr5jlziZh642WV7V6AOzCBniqurYCnWhDodZ2upGtliXA9l3Y9r75dx4Au7YHntourkChLhOdDjxzPV1wKl8oxpn/Fp0HwC5ugKe6ayvQbGhAuc75SwY5cB8lIfFeoVcPgF1bf09tl1fAgDxdut0wS+supIt2Y8v3zELxqSz7ajsnXZ6Sp4F/rRVoMFShRmf/yq3eK8JljcSE6dsxu9sD4H8trAzK2eqgQ54uDXohPdyJUXLgnkxC4sseADuxWJ4i7l+Ban0JGvW2U+9t9c4B7QZIJ3oA7P698fTgxAo0GepRobN/qaFlMxy4/f8E90wA8RE2tUgAAAAASUVORK5CYII="},16722:function(Dn,Gn,kt){"use strict";kt.d(Gn,{Z:function(){return ge}});const pt=ne=>typeof ne=="object"&&ne!=null&&ne.nodeType===1,Ut=(ne,Rt)=>(!Rt||ne!=="hidden")&&ne!=="visible"&&ne!=="clip",le=(ne,Rt)=>{if(ne.clientHeight<ne.scrollHeight||ne.clientWidth<ne.scrollWidth){const Ae=getComputedStyle(ne,null);return Ut(Ae.overflowY,Rt)||Ut(Ae.overflowX,Rt)||(ie=>{const Ee=(Bt=>{if(!Bt.ownerDocument||!Bt.ownerDocument.defaultView)return null;try{return Bt.ownerDocument.defaultView.frameElement}catch(nt){return null}})(ie);return!!Ee&&(Ee.clientHeight<ie.scrollHeight||Ee.clientWidth<ie.scrollWidth)})(ne)}return!1},Me=(ne,Rt,Ae,ie,Ee,Bt,nt,et)=>Bt<ne&&nt>Rt||Bt>ne&&nt<Rt?0:Bt<=ne&&et<=Ae||nt>=Rt&&et>=Ae?Bt-ne-ie:nt>Rt&&et<Ae||Bt<ne&&et>Ae?nt-Rt+Ee:0,ue=ne=>{const Rt=ne.parentElement;return Rt==null?ne.getRootNode().host||null:Rt},It=(ne,Rt)=>{var Ae,ie,Ee,Bt;if(typeof document=="undefined")return[];const{scrollMode:nt,block:et,inline:ht,boundary:st,skipOverflowHiddenElements:gt}=Rt,vt=typeof st=="function"?st:Pn=>Pn!==st;if(!pt(ne))throw new TypeError("Invalid target");const St=document.scrollingElement||document.documentElement,Et=[];let Tt=ne;for(;pt(Tt)&&vt(Tt);){if(Tt=ue(Tt),Tt===St){Et.push(Tt);break}Tt!=null&&Tt===document.body&&le(Tt)&&!le(document.documentElement)||Tt!=null&&le(Tt,gt)&&Et.push(Tt)}const Dt=(ie=(Ae=window.visualViewport)==null?void 0:Ae.width)!=null?ie:innerWidth,Jt=(Bt=(Ee=window.visualViewport)==null?void 0:Ee.height)!=null?Bt:innerHeight,{scrollX:Yt,scrollY:Gt}=window,{height:me,width:ae,top:Ne,right:Ce,bottom:we,left:tn}=ne.getBoundingClientRect(),{top:_e,right:an,bottom:Ke,left:oe}=(Pn=>{const De=window.getComputedStyle(Pn);return{top:parseFloat(De.scrollMarginTop)||0,right:parseFloat(De.scrollMarginRight)||0,bottom:parseFloat(De.scrollMarginBottom)||0,left:parseFloat(De.scrollMarginLeft)||0}})(ne);let Xt=et==="start"||et==="nearest"?Ne-_e:et==="end"?we+Ke:Ne+me/2-_e+Ke,qe=ht==="center"?tn+ae/2-oe+an:ht==="end"?Ce+an:tn-oe;const _n=[];for(let Pn=0;Pn<Et.length;Pn++){const De=Et[Pn],{height:dn,width:sn,top:jn,right:Te,bottom:Sn,left:ee}=De.getBoundingClientRect();if(nt==="if-needed"&&Ne>=0&&tn>=0&&we<=Jt&&Ce<=Dt&&(De===St&&!le(De)||Ne>=jn&&we<=Sn&&tn>=ee&&Ce<=Te))return _n;const Mn=getComputedStyle(De),ui=parseInt(Mn.borderLeftWidth,10),_t=parseInt(Mn.borderTopWidth,10),Lt=parseInt(Mn.borderRightWidth,10),Pt=parseInt(Mn.borderBottomWidth,10);let Nt=0,zt=0;const Mt="offsetWidth"in De?De.offsetWidth-De.clientWidth-ui-Lt:0,Kt="offsetHeight"in De?De.offsetHeight-De.clientHeight-_t-Pt:0,ye="offsetWidth"in De?De.offsetWidth===0?0:sn/De.offsetWidth:0,Ue="offsetHeight"in De?De.offsetHeight===0?0:dn/De.offsetHeight:0;if(St===De)Nt=et==="start"?Xt:et==="end"?Xt-Jt:et==="nearest"?Me(Gt,Gt+Jt,Jt,_t,Pt,Gt+Xt,Gt+Xt+me,me):Xt-Jt/2,zt=ht==="start"?qe:ht==="center"?qe-Dt/2:ht==="end"?qe-Dt:Me(Yt,Yt+Dt,Dt,ui,Lt,Yt+qe,Yt+qe+ae,ae),Nt=Math.max(0,Nt+Gt),zt=Math.max(0,zt+Yt);else{Nt=et==="start"?Xt-jn-_t:et==="end"?Xt-Sn+Pt+Kt:et==="nearest"?Me(jn,Sn,dn,_t,Pt+Kt,Xt,Xt+me,me):Xt-(jn+dn/2)+Kt/2,zt=ht==="start"?qe-ee-ui:ht==="center"?qe-(ee+sn/2)+Mt/2:ht==="end"?qe-Te+Lt+Mt:Me(ee,Te,sn,ui,Lt+Mt,qe,qe+ae,ae);const{scrollLeft:Qe,scrollTop:ce}=De;Nt=Ue===0?0:Math.max(0,Math.min(ce+Nt/Ue,De.scrollHeight-dn/Ue+Kt)),zt=ye===0?0:Math.max(0,Math.min(Qe+zt/ye,De.scrollWidth-sn/ye+Mt)),Xt+=ce-Nt,qe+=Qe-zt}_n.push({el:De,top:Nt,left:zt})}return _n},qt=ne=>ne===!1?{block:"end",inline:"nearest"}:(Rt=>Rt===Object(Rt)&&Object.keys(Rt).length!==0)(ne)?ne:{block:"start",inline:"nearest"};function ge(ne,Rt){if(!ne.isConnected||!(Ee=>{let Bt=Ee;for(;Bt&&Bt.parentNode;){if(Bt.parentNode===document)return!0;Bt=Bt.parentNode instanceof ShadowRoot?Bt.parentNode.host:Bt.parentNode}return!1})(ne))return;const Ae=(Ee=>{const Bt=window.getComputedStyle(Ee);return{top:parseFloat(Bt.scrollMarginTop)||0,right:parseFloat(Bt.scrollMarginRight)||0,bottom:parseFloat(Bt.scrollMarginBottom)||0,left:parseFloat(Bt.scrollMarginLeft)||0}})(ne);if((Ee=>typeof Ee=="object"&&typeof Ee.behavior=="function")(Rt))return Rt.behavior(It(ne,Rt));const ie=typeof Rt=="boolean"||Rt==null?void 0:Rt.behavior;for(const{el:Ee,top:Bt,left:nt}of It(ne,qt(Rt))){const et=Bt-Ae.top+Ae.bottom,ht=nt-Ae.left+Ae.right;Ee.scroll({top:et,left:ht,behavior:ie})}}}}]);